diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-13 00:27:09 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-12 08:57:10 -0400 |
commit | df60aeef4f4fe0645d9a195a7689005520422de5 (patch) | |
tree | 3cfa3c4a986436c8accd5f0a57d5a6f70f1b7965 /drivers/lguest/lg.h | |
parent | 5718607bb670c721f45f0dbb1cc7d6c64969aab1 (diff) |
lguest: use eventfds for device notification
Currently, when a Guest wants to perform I/O it calls LHCALL_NOTIFY with
an address: the main Launcher process returns with this address, and figures
out what device to run.
A far nicer model is to let processes bind an eventfd to an address: if we
find one, we simply signal the eventfd.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Davide Libenzi <davidel@xmailserver.org>
Diffstat (limited to 'drivers/lguest/lg.h')
-rw-r--r-- | drivers/lguest/lg.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h index 040cb70780e7..32fefdc6ad3e 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h | |||
@@ -82,6 +82,16 @@ struct lg_cpu { | |||
82 | struct lg_cpu_arch arch; | 82 | struct lg_cpu_arch arch; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | struct lg_eventfd { | ||
86 | unsigned long addr; | ||
87 | struct file *event; | ||
88 | }; | ||
89 | |||
90 | struct lg_eventfd_map { | ||
91 | unsigned int num; | ||
92 | struct lg_eventfd map[]; | ||
93 | }; | ||
94 | |||
85 | /* The private info the thread maintains about the guest. */ | 95 | /* The private info the thread maintains about the guest. */ |
86 | struct lguest | 96 | struct lguest |
87 | { | 97 | { |
@@ -102,6 +112,8 @@ struct lguest | |||
102 | unsigned int stack_pages; | 112 | unsigned int stack_pages; |
103 | u32 tsc_khz; | 113 | u32 tsc_khz; |
104 | 114 | ||
115 | struct lg_eventfd_map *eventfds; | ||
116 | |||
105 | /* Dead? */ | 117 | /* Dead? */ |
106 | const char *dead; | 118 | const char *dead; |
107 | }; | 119 | }; |
@@ -154,6 +166,7 @@ void setup_default_idt_entries(struct lguest_ro_state *state, | |||
154 | void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, | 166 | void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, |
155 | const unsigned long *def); | 167 | const unsigned long *def); |
156 | void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta); | 168 | void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta); |
169 | bool send_notify_to_eventfd(struct lg_cpu *cpu); | ||
157 | void init_clockdev(struct lg_cpu *cpu); | 170 | void init_clockdev(struct lg_cpu *cpu); |
158 | bool check_syscall_vector(struct lguest *lg); | 171 | bool check_syscall_vector(struct lguest *lg); |
159 | int init_interrupts(void); | 172 | int init_interrupts(void); |