1 /* Things the lguest guest needs to know. Note: like all lguest interfaces,
2 * this is subject to wild and random change between versions. */
9 #define LHCALL_FLUSH_ASYNC 0
10 #define LHCALL_LGUEST_INIT 1
11 #define LHCALL_CRASH 2
12 #define LHCALL_LOAD_GDT 3
13 #define LHCALL_NEW_PGTABLE 4
14 #define LHCALL_FLUSH_TLB 5
15 #define LHCALL_LOAD_IDT_ENTRY 6
16 #define LHCALL_SET_STACK 7
18 #define LHCALL_SET_CLOCKEVENT 9
19 #define LHCALL_HALT 10
20 #define LHCALL_GET_WALLCLOCK 11
21 #define LHCALL_BIND_DMA 12
22 #define LHCALL_SEND_DMA 13
23 #define LHCALL_SET_PTE 14
24 #define LHCALL_SET_PMD 15
25 #define LHCALL_LOAD_TLS 16
27 #define LG_CLOCK_MIN_DELTA 100UL
28 #define LG_CLOCK_MAX_DELTA ULONG_MAX
30 #define LGUEST_TRAP_ENTRY 0x1F
32 static inline unsigned long
33 hcall(unsigned long call,
34 unsigned long arg1, unsigned long arg2, unsigned long arg3)
36 asm volatile("int $" __stringify(LGUEST_TRAP_ENTRY)
38 : "a"(call), "d"(arg1), "b"(arg2), "c"(arg3)
43 void async_hcall(unsigned long call,
44 unsigned long arg1, unsigned long arg2, unsigned long arg3);
46 /* Can't use our min() macro here: needs to be a constant */
47 #define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
49 #define LHCALL_RING_SIZE 64
52 u32 eax, edx, ebx, ecx;
55 /* All the good stuff happens here: guest registers it with LGUEST_INIT */
58 /* Fields which change during running: */
59 /* 512 == enabled (same as eflags) */
60 unsigned int irq_enabled;
61 /* Interrupts blocked by guest. */
62 DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS);
64 /* Virtual address of page fault. */
67 /* Async hypercall ring. 0xFF == done, 0 == pending. */
68 u8 hcall_status[LHCALL_RING_SIZE];
69 struct hcall_ring hcalls[LHCALL_RING_SIZE];
71 /* Fields initialized by the hypervisor at boot: */
72 /* Memory not to try to access */
73 unsigned long reserve_mem;
74 /* ID of this guest (used by network driver to set ethernet address) */
76 /* KHz for the TSC clock. */
79 /* Fields initialized by the guest at boot: */
80 /* Instruction range to suppress interrupts even if enabled */
81 unsigned long noirq_start, noirq_end;
83 extern struct lguest_data lguest_data;
84 #endif /* __ASSEMBLY__ */
85 #endif /* _ASM_LGUEST_H */