/[hurd]/hurd-l4/deva/deva.c
ViewVC logotype

Diff of /hurd-l4/deva/deva.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by marcus, Tue Feb 1 01:22:38 2005 UTC revision 1.6 by marcus, Thu Feb 3 22:52:52 2005 UTC
# Line 70  void Line 70  void
70  create_bootstrap_caps (hurd_cap_bucket_t bucket)  create_bootstrap_caps (hurd_cap_bucket_t bucket)
71  {  {
72    error_t err;    error_t err;
73    hurd_cap_handle_t cap;    hurd_cap_obj_t console;
   hurd_cap_obj_t obj;  
   bool master;  
74    
75    l4_accept (L4_UNTYPED_WORDS_ACCEPTOR);    l4_accept (L4_UNTYPED_WORDS_ACCEPTOR);
76    
77    /* FIXME: Allocate a system console driver.  */    /* FIXME: Allocate a system console driver.  */
78    err = device_alloc (&obj, DEVICE_CONSOLE);    err = device_alloc (&console, DEVICE_CONSOLE);
79    if (err)    if (err)
80      panic ("device_alloc: %i\n", err);      panic ("device_alloc: %i\n", err);
81    hurd_cap_obj_unlock (obj);    hurd_cap_obj_unlock (console);
82    
83    while (1)    while (1)
84      {      {
85        hurd_task_id_t task_id;        hurd_task_id_t task_id;
86          bool master;
87    
88        task_id = wortel_get_deva_cap_request (&master);        task_id = wortel_get_deva_cap_request (&master);
89    
90        if (master)        if (master)
91          {          {
92              hurd_cap_obj_t serial;
93              hurd_cap_handle_t cap;
94    
95            /* This requests the master control capability.  */            /* This requests the master control capability.  */
96    
97            /* FIXME: Create capability.  */            debug ("Creating console master device cap for 0x%x:", task_id);
98            /* FIXME: Use our control cap for this task here.  */  
99            wortel_get_deva_cap_reply (0xf00);            /* FIXME: For now, we allocate a serial device for the "deva
100                 master cap".  This is bogus, of course, but makes it easy
101                 to use it in the initial server application without
102                 having a proper deva interface to open new devices.  */
103              err = device_alloc (&serial, DEVICE_SERIAL);
104              if (err)
105                panic ("device_alloc: %i\n", err);
106              hurd_cap_obj_unlock (serial);
107    
108              err = hurd_cap_bucket_inject (bucket, serial, task_id, &cap);
109              if (err)
110                panic ("hurd_cap_bucket_inject: %i\n", err);
111    
112              debug (" 0x%x\n", cap);
113    
114              /* Return CAP.  */
115              wortel_get_deva_cap_reply (cap);
116    
117            /* This is the last request made.  */            /* This is the last request made.  */
118            return;            break;
119          }          }
120        else        else
121          {          {
122              hurd_cap_handle_t cap;
123    
124            debug ("Creating console device cap for 0x%x:", task_id);            debug ("Creating console device cap for 0x%x:", task_id);
125    
126            err = hurd_cap_bucket_inject (bucket, obj, task_id, &cap);            err = hurd_cap_bucket_inject (bucket, console, task_id, &cap);
127            if (err)            if (err)
128              panic ("hurd_cap_bucket_inject: %i\n", err);              panic ("hurd_cap_bucket_inject: %i\n", err);
129    
# Line 114  create_bootstrap_caps (hurd_cap_bucket_t Line 134  create_bootstrap_caps (hurd_cap_bucket_t
134          }          }
135      }      }
136    
137    hurd_cap_obj_lock (obj);    hurd_cap_obj_lock (console);
138    hurd_cap_obj_drop (obj);    hurd_cap_obj_drop (console);
   
139  }  }
140    
141    
# Line 182  setup_threads (void) Line 201  setup_threads (void)
201                             &tid);                             &tid);
202    if (err)    if (err)
203      panic ("could not create first extra thread: %i", err);      panic ("could not create first extra thread: %i", err);
204    
205      pthread_pool_add_np (tid);
206    
207      /* One more for irq handlers (blech).  */
208      err = task_thread_alloc (task->server, task->cap_handle,
209                               (void *)
210                               (l4_address (__hurd_startup_data->utcb_area)
211                                + 4 * l4_utcb_size ()),
212                               &tid);
213      if (err)
214        panic ("could not create first extra thread: %i", err);
215    
216    pthread_pool_add_np (tid);    pthread_pool_add_np (tid);
217    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26