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 void fpuprocsetup(Proc*);
15 void fpuprocfork(Proc*);
16 void fpuprocsave(Proc*);
17 void fpuprocrestore(Proc*);
18 int cpuidentify(void);
19 void cpuidprint(void);
20 void (*cycles)(uvlong*);
22 #define evenaddr(x) /* x86 doesn't care */
26 void (*fprestore)(FPsave*);
27 void (*fpsave)(FPsave*);
32 void i8042reset(void);
33 void i8253enable(void);
36 uvlong i8253read(uvlong*);
37 void i8253timerset(uvlong);
41 void insb(int, void*, int);
43 void inss(int, void*, int);
45 void insl(int, void*, int);
46 void intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
47 void intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
49 int isaconfig(char*, int, ISAConf*);
58 void mmuflushtlb(Page*);
60 ulong mmukmap(ulong, ulong, int);
61 int mmukmapsync(ulong);
63 ulong* mmuwalk(ulong*, ulong, int, int);
64 char* mtrr(uvlong, uvlong, char *);
65 int mtrrprint(char *, long);
68 void outsb(int, void*, int);
69 void outs(int, ushort);
70 void outss(int, void*, int);
71 void outl(int, ulong);
72 void outsl(int, void*, int);
73 void printcpufreq(void);
74 void procrestore(Proc*);
76 void procsetup(Proc*);
79 int rdmsr(int, vlong*);
80 int screenprint(char*, ...); /* debugging */
81 void (*screenputs)(char*, int);
84 void trapenable(int, void (*)(Ureg*, void*), void*, char*);
87 #define userureg(ur) (((ur)->cs & 0xFFFF) == UESEL)
88 void vectortable(void);
89 int wrmsr(int, vlong);
90 uint xchgl(uint*, uint);
91 uint xchgw(ushort*, uint);
92 uint xchgb(uchar*, uint);
93 void rdrandbuf(void*, ulong);
95 #define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
96 #define KADDR(a) ((void*)((ulong)(a)|KZERO))
97 #define PADDR(a) ((ulong)(a)&~KZERO)
102 #define rmb() coherence()
103 #define wmb() coherence()
105 void hypervisor_callback(void), failsafe_callback(void);
106 void xenconsinit(void);
107 ulong mmumapframe(ulong, ulong);
108 void mmumapcpu0(void);
109 void dprint(char *, ...);
110 void xenupdate(ulong *ptr, ulong val);
111 void xenupdatema(ulong *ptr, uvlong val);
112 int xenpdptpin(ulong va);
113 int xenpgdpin(ulong va);
114 int xenptpin(ulong va);
115 void xenptunpin(ulong va);
116 void xenptswitch(ulong pa);
117 void xentlbflush(void);
119 void xengrantinit(void);
120 int xengrant(domid_t domid, ulong frame, int flags);
121 int xengrantend(int ref);
122 void acceptframe(int ref, void *va);
123 int donateframe(int domid, void *va);
124 int shareframe(int domid, void *va, int write);
125 void xenchannotify(int);
126 void xenupcall(Ureg*);
127 ulong xenwallclock(void);
128 int xenstore_read(char*, char*, int);
129 void xenstore_write(char*, char*);
130 void xenstore_setd(char *dir, char *node, int value);
131 int xenstore_gets(char *dir, char *node, char *buf, int buflen);
132 int xenchanalloc(int);
134 long HYPERVISOR_set_timer_op(uvlong timeout);
135 int HYPERVISOR_set_trap_table(trap_info_t *table);
136 int HYPERVISOR_mmu_update(mmu_update_t *req, int count, int *success_count, domid_t domid);
137 int HYPERVISOR_mmuext_op(struct mmuext_op *op, int count, int *scount, domid_t domid);
138 int HYPERVISOR_set_gdt(ulong *frame_list, int entries);
139 int HYPERVISOR_stack_switch(ulong ss, ulong esp);
140 int HYPERVISOR_set_callbacks(ulong evss, ulong evfunc, ulong fsss, ulong fsfunc);
141 int HYPERVISOR_fpu_taskswitch(void);
142 int HYPERVISOR_yield(void);
143 int HYPERVISOR_block(void);
144 int HYPERVISOR_shutdown(int);
145 int HYPERVISOR_multicall(void *call_list, int nr_calls);
146 int HYPERVISOR_event_channel_op(void *op);
147 int HYPERVISOR_xen_version(int cmd, void *arg);
148 int HYPERVISOR_console_io(int cmd, int count, char *str);
149 int HYPERVISOR_grant_table_op(int cmd, gnttab_setup_table_t *setup, int count);
150 int HYPERVISOR_memory_op(int cmd, struct xen_memory_reservation *arg);