diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-10-21 21:24:10 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2007-10-23 01:49:55 -0400 |
commit | 15045275c32bf6d15d32c2eca8157be9c0ba6e45 (patch) | |
tree | 32ef90c875b22cb1bbb94e38f557a690f1c0c6f8 /include | |
parent | 0ca49ca946409f87a8cd0b14d5acb6dea58de6f3 (diff) |
Remove old lguest I/O infrrasructure.
This patch gets rid of the old lguest host I/O infrastructure and
replaces it with a single hypercall "LHCALL_NOTIFY" which takes an
address.
The main change is the removal of io.c: that mainly did inter-guest
I/O, which virtio doesn't yet support.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/lguest_hcall.h | 3 | ||||
-rw-r--r-- | include/linux/lguest_launcher.h | 36 |
2 files changed, 2 insertions, 37 deletions
diff --git a/include/asm-x86/lguest_hcall.h b/include/asm-x86/lguest_hcall.h index 0c553ef36240..f948491eb56a 100644 --- a/include/asm-x86/lguest_hcall.h +++ b/include/asm-x86/lguest_hcall.h | |||
@@ -13,11 +13,10 @@ | |||
13 | #define LHCALL_TS 8 | 13 | #define LHCALL_TS 8 |
14 | #define LHCALL_SET_CLOCKEVENT 9 | 14 | #define LHCALL_SET_CLOCKEVENT 9 |
15 | #define LHCALL_HALT 10 | 15 | #define LHCALL_HALT 10 |
16 | #define LHCALL_BIND_DMA 12 | ||
17 | #define LHCALL_SEND_DMA 13 | ||
18 | #define LHCALL_SET_PTE 14 | 16 | #define LHCALL_SET_PTE 14 |
19 | #define LHCALL_SET_PMD 15 | 17 | #define LHCALL_SET_PMD 15 |
20 | #define LHCALL_LOAD_TLS 16 | 18 | #define LHCALL_LOAD_TLS 16 |
19 | #define LHCALL_NOTIFY 17 | ||
21 | 20 | ||
22 | /*G:031 First, how does our Guest contact the Host to ask for privileged | 21 | /*G:031 First, how does our Guest contact the Host to ask for privileged |
23 | * operations? There are two ways: the direct way is to make a "hypercall", | 22 | * operations? There are two ways: the direct way is to make a "hypercall", |
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h index b6603f3fbff8..5ec04a225e4f 100644 --- a/include/linux/lguest_launcher.h +++ b/include/linux/lguest_launcher.h | |||
@@ -10,40 +10,6 @@ | |||
10 | /* How many devices? Assume each one wants up to two dma arrays per device. */ | 10 | /* How many devices? Assume each one wants up to two dma arrays per device. */ |
11 | #define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2) | 11 | #define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2) |
12 | 12 | ||
13 | /*D:200 | ||
14 | * Lguest I/O | ||
15 | * | ||
16 | * The lguest I/O mechanism is the only way Guests can talk to devices. There | ||
17 | * are two hypercalls involved: SEND_DMA for output and BIND_DMA for input. In | ||
18 | * each case, "struct lguest_dma" describes the buffer: this contains 16 | ||
19 | * addr/len pairs, and if there are fewer buffer elements the len array is | ||
20 | * terminated with a 0. | ||
21 | * | ||
22 | * I/O is organized by keys: BIND_DMA attaches buffers to a particular key, and | ||
23 | * SEND_DMA transfers to buffers bound to particular key. By convention, keys | ||
24 | * correspond to a physical address within the device's page. This means that | ||
25 | * devices will never accidentally end up with the same keys, and allows the | ||
26 | * Host use The Futex Trick (as we'll see later in our journey). | ||
27 | * | ||
28 | * SEND_DMA simply indicates a key to send to, and the physical address of the | ||
29 | * "struct lguest_dma" to send. The Host will write the number of bytes | ||
30 | * transferred into the "struct lguest_dma"'s used_len member. | ||
31 | * | ||
32 | * BIND_DMA indicates a key to bind to, a pointer to an array of "struct | ||
33 | * lguest_dma"s ready for receiving, the size of that array, and an interrupt | ||
34 | * to trigger when data is received. The Host will only allow transfers into | ||
35 | * buffers with a used_len of zero: it then sets used_len to the number of | ||
36 | * bytes transferred and triggers the interrupt for the Guest to process the | ||
37 | * new input. */ | ||
38 | struct lguest_dma | ||
39 | { | ||
40 | /* 0 if free to be used, filled by the Host. */ | ||
41 | __u32 used_len; | ||
42 | __u16 len[LGUEST_MAX_DMA_SECTIONS]; | ||
43 | unsigned long addr[LGUEST_MAX_DMA_SECTIONS]; | ||
44 | }; | ||
45 | /*:*/ | ||
46 | |||
47 | /* Where the Host expects the Guest to SEND_DMA console output to. */ | 13 | /* Where the Host expects the Guest to SEND_DMA console output to. */ |
48 | #define LGUEST_CONSOLE_DMA_KEY 0 | 14 | #define LGUEST_CONSOLE_DMA_KEY 0 |
49 | 15 | ||
@@ -95,7 +61,7 @@ struct lguest_device_desc { | |||
95 | enum lguest_req | 61 | enum lguest_req |
96 | { | 62 | { |
97 | LHREQ_INITIALIZE, /* + pfnlimit, pgdir, start, pageoffset */ | 63 | LHREQ_INITIALIZE, /* + pfnlimit, pgdir, start, pageoffset */ |
98 | LHREQ_GETDMA, /* + addr (returns &lguest_dma, irq in ->used_len) */ | 64 | LHREQ_GETDMA, /* No longer used */ |
99 | LHREQ_IRQ, /* + irq */ | 65 | LHREQ_IRQ, /* + irq */ |
100 | LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */ | 66 | LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */ |
101 | }; | 67 | }; |