diff options
author | marcus <marcus> | 2005-02-03 22:52:52 +0000 |
---|---|---|
committer | marcus <marcus> | 2005-02-03 22:52:52 +0000 |
commit | 46c2b13fd1d23a2c5459bcb9665a7d554d700b49 (patch) | |
tree | 000db64b0310cf9ed32840bcb949a8c7ec3ab16c | |
parent | b1b0ae6dbcfe7024893d5833968d17dcbd3f0b8a (diff) |
2005-02-03 Marcus Brinkmann <marcus@gnu.org>
* deva.c (setup_threads): Allocate one more thread for all those
IRQ handlers.
(create_bootstrap_caps): Hand out a serial device cap as bogus
master.
-rw-r--r-- | deva/ChangeLog | 5 | ||||
-rw-r--r-- | deva/deva.c | 56 |
2 files changed, 48 insertions, 13 deletions
diff --git a/deva/ChangeLog b/deva/ChangeLog index 4b8d88f..830daaf 100644 --- a/deva/ChangeLog +++ b/deva/ChangeLog @@ -1,5 +1,10 @@ 2005-02-03 Marcus Brinkmann <marcus@gnu.org> + * deva.c (setup_threads): Allocate one more thread for all those + IRQ handlers. + (create_bootstrap_caps): Hand out a serial device cap as bogus + master. + * device-console.c (console_init): Create the kbd irq handler with a higher priority than normal threads. diff --git a/deva/deva.c b/deva/deva.c index 47c44d2..e272e1d 100644 --- a/deva/deva.c +++ b/deva/deva.c @@ -70,40 +70,60 @@ void create_bootstrap_caps (hurd_cap_bucket_t bucket) { error_t err; - hurd_cap_handle_t cap; - hurd_cap_obj_t obj; - bool master; + hurd_cap_obj_t console; l4_accept (L4_UNTYPED_WORDS_ACCEPTOR); /* FIXME: Allocate a system console driver. */ - err = device_alloc (&obj, DEVICE_CONSOLE); + err = device_alloc (&console, DEVICE_CONSOLE); if (err) panic ("device_alloc: %i\n", err); - hurd_cap_obj_unlock (obj); + hurd_cap_obj_unlock (console); while (1) { hurd_task_id_t task_id; + bool master; task_id = wortel_get_deva_cap_request (&master); if (master) { + hurd_cap_obj_t serial; + hurd_cap_handle_t cap; + /* This requests the master control capability. */ - /* FIXME: Create capability. */ - /* FIXME: Use our control cap for this task here. */ - wortel_get_deva_cap_reply (0xf00); + debug ("Creating console master device cap for 0x%x:", task_id); + + /* FIXME: For now, we allocate a serial device for the "deva + master cap". This is bogus, of course, but makes it easy + to use it in the initial server application without + having a proper deva interface to open new devices. */ + err = device_alloc (&serial, DEVICE_SERIAL); + if (err) + panic ("device_alloc: %i\n", err); + hurd_cap_obj_unlock (serial); + + err = hurd_cap_bucket_inject (bucket, serial, task_id, &cap); + if (err) + panic ("hurd_cap_bucket_inject: %i\n", err); + + debug (" 0x%x\n", cap); + + /* Return CAP. */ + wortel_get_deva_cap_reply (cap); /* This is the last request made. */ - return; + break; } else { + hurd_cap_handle_t cap; + debug ("Creating console device cap for 0x%x:", task_id); - err = hurd_cap_bucket_inject (bucket, obj, task_id, &cap); + err = hurd_cap_bucket_inject (bucket, console, task_id, &cap); if (err) panic ("hurd_cap_bucket_inject: %i\n", err); @@ -114,9 +134,8 @@ create_bootstrap_caps (hurd_cap_bucket_t bucket) } } - hurd_cap_obj_lock (obj); - hurd_cap_obj_drop (obj); - + hurd_cap_obj_lock (console); + hurd_cap_obj_drop (console); } @@ -185,6 +204,17 @@ setup_threads (void) pthread_pool_add_np (tid); + /* One more for irq handlers (blech). */ + err = task_thread_alloc (task->server, task->cap_handle, + (void *) + (l4_address (__hurd_startup_data->utcb_area) + + 4 * l4_utcb_size ()), + &tid); + if (err) + panic ("could not create first extra thread: %i", err); + + pthread_pool_add_np (tid); + return server_thread; } |