diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-02-07 03:18:50 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-02-07 03:18:50 +0100 |
commit | aaf803372bd4b30b97a2039e4b1b36b07c0a7250 (patch) | |
tree | 55e7c21adb37f514c2d888f5d3141659eea67ced | |
parent | d683da41fcfefcc8ba63b1fa1ab8af5b3078183f (diff) |
Defer Xen device initialization to device_service_create
* device/device_init.c (device_service_create) [MACH_HYP]: Call
hyp_dev_init.
* xen/xen.c (hyp_init): Do not call hyp_block_init and hyp_net_init, now
called in ...
(hyp_dev_init): New function.
* xen/xen.h (hyp_dev_init): New declaration.
-rw-r--r-- | device/device_init.c | 4 | ||||
-rw-r--r-- | xen/block.c | 1 | ||||
-rw-r--r-- | xen/xen.c | 12 | ||||
-rw-r--r-- | xen/xen.h | 3 |
4 files changed, 15 insertions, 5 deletions
diff --git a/device/device_init.c b/device/device_init.c index 1da2a6f..e43a2a9 100644 --- a/device/device_init.c +++ b/device/device_init.c @@ -33,6 +33,7 @@ #include <ipc/ipc_space.h> #include <kern/debug.h> #include <kern/task.h> +#include <xen/xen.h> #include <device/device_types.h> #include <device/device_port.h> @@ -57,6 +58,9 @@ device_service_create() panic("can't allocate master device port"); mach_device_init(); +#ifdef MACH_HYP + hyp_dev_init(); +#endif dev_lookup_init(); net_io_init(); device_pager_init(); diff --git a/xen/block.c b/xen/block.c index 3c188bf..76119e8 100644 --- a/xen/block.c +++ b/xen/block.c @@ -213,6 +213,7 @@ void hyp_block_init(void) { panic("%s: couldn't store state (%s)", device_name, hyp_store_error); kfree((vm_offset_t) c, strlen(c)+1); } while (!hyp_store_transaction_stop(t)); + /* TODO randomly wait? */ c = hyp_store_read(0, 5, VBD_PATH, "/", vbds[n], "/", "backend"); if (!c) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Samuel Thibault <samuel.thibault@ens-lyon.org> + * Copyright (C) 2007-2011 Samuel Thibault <samuel.thibault@ens-lyon.org> * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,13 +46,17 @@ void hyp_init(void) { hyp_grant_init(); hyp_store_init(); - /* these depend on the above */ - hyp_block_init(); - hyp_net_init(); evtchn_port_t port = hyp_event_channel_bind_virq(VIRQ_DEBUG, 0); hyp_evt_handler(port, hyp_debug, 0, SPL7); } +void hyp_dev_init(void) +{ + /* these depend on hyp_init() and working threads */ + hyp_block_init(); + hyp_net_init(); +} + void _hyp_halt(void) { hyp_halt(); @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Samuel Thibault <samuel.thibault@ens-lyon.org> + * Copyright (C) 2006-2010, 2011 Samuel Thibault <samuel.thibault@ens-lyon.org> * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #define XEN_XEN_H void hyp_init(void); +void hyp_dev_init(void); void hyp_invalidate_pte(pt_entry_t *pte); void hyp_idle(void); void hyp_p2m_init(void); |