1 #include "../port/portfns.h"
3 Dirtab* addarchfile(char*, int, long(*)(Chan*,void*,long,vlong), long(*)(Chan*,void*,long,vlong));
7 #define clearmmucache() /* x86 doesn't have one */
8 void clockintr(Ureg*, void*);
9 int (*cmpswap)(long*, long, long);
10 int cmpswap486(long*, long, long);
11 void (*coherence)(void);
12 void cpuid(int, int, ulong regs[]);
14 int cpuidentify(void);
15 void cpuidprint(void);
16 void (*cycles)(uvlong*);
18 #define evenaddr(x) /* x86 doesn't care */
22 void (*fprestore)(FPsave*);
23 void (*fpsave)(FPsave*);
29 void i8042reset(void);
30 void i8253enable(void);
33 uvlong i8253read(uvlong*);
34 void i8253timerset(uvlong);
38 void insb(int, void*, int);
40 void inss(int, void*, int);
42 void insl(int, void*, int);
43 void intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
44 void intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
46 int isaconfig(char*, int, ISAConf*);
55 void mmuflushtlb(Page*);
57 ulong mmukmap(ulong, ulong, int);
58 int mmukmapsync(ulong);
60 ulong* mmuwalk(ulong*, ulong, int, int);
61 char* mtrr(uvlong, uvlong, char *);
62 int mtrrprint(char *, long);
65 void outsb(int, void*, int);
66 void outs(int, ushort);
67 void outss(int, void*, int);
68 void outl(int, ulong);
69 void outsl(int, void*, int);
70 void printcpufreq(void);
71 void procrestore(Proc*);
73 void procsetup(Proc*);
76 int rdmsr(int, vlong*);
77 int screenprint(char*, ...); /* debugging */
78 void (*screenputs)(char*, int);
81 void trapenable(int, void (*)(Ureg*, void*), void*, char*);
84 #define userureg(ur) (((ur)->cs & 0xFFFF) == UESEL)
85 void vectortable(void);
86 int wrmsr(int, vlong);
87 uint xchgl(uint*, uint);
88 uint xchgw(ushort*, uint);
89 uint xchgb(uchar*, uint);
90 void rdrandbuf(void*, ulong);
92 #define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
93 #define KADDR(a) ((void*)((ulong)(a)|KZERO))
94 #define PADDR(a) ((ulong)(a)&~KZERO)
99 #define rmb() coherence()
100 #define wmb() coherence()
102 void hypervisor_callback(void), failsafe_callback(void);
103 void xenconsinit(void);
104 ulong mmumapframe(ulong, ulong);
105 void mmumapcpu0(void);
106 void dprint(char *, ...);
107 void xenupdate(ulong *ptr, ulong val);
108 void xenupdatema(ulong *ptr, uvlong val);
109 int xenpdptpin(ulong va);
110 int xenpgdpin(ulong va);
111 int xenptpin(ulong va);
112 void xenptunpin(ulong va);
113 void xenptswitch(ulong pa);
114 void xentlbflush(void);
116 void xengrantinit(void);
117 int xengrant(domid_t domid, ulong frame, int flags);
118 int xengrantend(int ref);
119 void acceptframe(int ref, void *va);
120 int donateframe(int domid, void *va);
121 int shareframe(int domid, void *va, int write);
122 void xenchannotify(int);
123 void xenupcall(Ureg*);
124 ulong xenwallclock(void);
125 int xenstore_read(char*, char*, int);
126 void xenstore_write(char*, char*);
127 void xenstore_setd(char *dir, char *node, int value);
128 int xenstore_gets(char *dir, char *node, char *buf, int buflen);
129 int xenchanalloc(int);
131 long HYPERVISOR_set_timer_op(uvlong timeout);
132 int HYPERVISOR_set_trap_table(trap_info_t *table);
133 int HYPERVISOR_mmu_update(mmu_update_t *req, int count, int *success_count, domid_t domid);
134 int HYPERVISOR_mmuext_op(struct mmuext_op *op, int count, int *scount, domid_t domid);
135 int HYPERVISOR_set_gdt(ulong *frame_list, int entries);
136 int HYPERVISOR_stack_switch(ulong ss, ulong esp);
137 int HYPERVISOR_set_callbacks(ulong evss, ulong evfunc, ulong fsss, ulong fsfunc);
138 int HYPERVISOR_fpu_taskswitch(void);
139 int HYPERVISOR_yield(void);
140 int HYPERVISOR_block(void);
141 int HYPERVISOR_shutdown(int);
142 int HYPERVISOR_multicall(void *call_list, int nr_calls);
143 int HYPERVISOR_event_channel_op(void *op);
144 int HYPERVISOR_xen_version(int cmd, void *arg);
145 int HYPERVISOR_console_io(int cmd, int count, char *str);
146 int HYPERVISOR_grant_table_op(int cmd, gnttab_setup_table_t *setup, int count);
147 int HYPERVISOR_memory_op(int cmd, struct xen_memory_reservation *arg);