1 #include "../port/portfns.h"
3 Dirtab* addarchfile(char*, int, long(*)(Chan*,void*,long,vlong), long(*)(Chan*,void*,long,vlong));
7 int cistrcmp(char*, char*);
8 int cistrncmp(char*, char*, int);
9 #define clearmmucache() /* x86 doesn't have one */
10 void clockintr(Ureg*, void*);
11 int (*cmpswap)(long*, long, long);
12 int cmpswap486(long*, long, long);
13 void (*coherence)(void);
14 void cpuid(int, ulong regs[]);
15 int cpuidentify(void);
16 void cpuidprint(void);
17 void (*cycles)(uvlong*);
19 #define evenaddr(x) /* x86 doesn't care */
24 void (*fprestore)(FPsave*);
25 void (*fpsave)(FPsave*);
26 void fpsserestore(FPsave*);
27 void fpsserestore0(FPsave*);
28 void fpssesave(FPsave*);
29 void fpssesave0(FPsave*);
31 void fpx87restore(FPsave*);
32 void fpx87save(FPsave*);
38 void i8042reset(void);
39 void i8253enable(void);
42 uvlong i8253read(uvlong*);
43 void i8253timerset(uvlong);
44 int i8259disable(int);
45 int i8259enable(Vctl*);
54 void insb(int, void*, int);
56 void inss(int, void*, int);
58 void insl(int, void*, int);
59 int intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
60 void intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
61 int ioalloc(int, int, int, char*);
63 int isaconfig(char*, int, ISAConf*);
66 void lgdt(ushort[3]); // XXX remove and in l.s
67 void lidt(ushort[3]); // XXX remove and in l.s
69 void ltr(ulong); // XXX remove?
75 void mmuflushtlb(Page*);
77 ulong mmukmap(ulong, ulong, int);
78 int mmukmapsync(ulong);
80 ulong* mmuwalk(ulong*, ulong, int, int);
81 int mtrr(uvlong, uvlong, char *);
82 int mtrrprint(char *, long);
84 void outsb(int, void*, int);
85 void outs(int, ushort);
86 void outss(int, void*, int);
87 void outl(int, ulong);
88 void outsl(int, void*, int);
89 void printcpufreq(void);
90 void procrestore(Proc*);
92 void procsetup(Proc*);
95 int rdmsr(int, vlong*);
96 int screenprint(char*, ...); /* debugging */
97 void (*screenputs)(char*, int);
100 void trapenable(int, void (*)(Ureg*, void*), void*, char*);
103 #define userureg(ur) (((ur)->cs & 0xFFFF) == UESEL)
104 void vectortable(void);
105 int wrmsr(int, vlong);
106 uint xchgl(uint*, uint);
107 uint xchgw(ushort*, uint);
108 uint xchgb(uchar*, uint);
110 #define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
111 #define KADDR(a) ((void*)((ulong)(a)|KZERO))
112 #define PADDR(a) ((ulong)(a)&~KZERO)
114 #define dcflush(a, b)
117 #define rmb() coherence()
118 #define wmb() coherence()
120 void hypervisor_callback(void), failsafe_callback(void);
121 void xenconsinit(void);
122 ulong mmumapframe(ulong, ulong);
123 void mmumapcpu0(void);
124 void dprint(char *, ...);
125 void xenupdate(ulong *ptr, ulong val);
126 void xenupdatema(ulong *ptr, uvlong val);
127 int xenpdptpin(ulong va);
128 int xenpgdpin(ulong va);
129 int xenptpin(ulong va);
130 void xenptunpin(ulong va);
131 void xenptswitch(ulong pa);
132 void xentlbflush(void);
134 void xengrantinit(void);
135 int xengrant(domid_t domid, ulong frame, int flags);
136 int xengrantend(int ref);
137 void acceptframe(int ref, void *va);
138 int donateframe(int domid, void *va);
139 int shareframe(int domid, void *va, int write);
140 void xenchannotify(int);
141 void xenupcall(Ureg*);
142 ulong xenwallclock(void);
143 int xenstore_read(char*, char*, int);
144 void xenstore_write(char*, char*);
145 void xenstore_setd(char *dir, char *node, int value);
146 int xenstore_gets(char *dir, char *node, char *buf, int buflen);
147 int xenchanalloc(int);
149 long HYPERVISOR_set_timer_op(uvlong timeout);
150 int HYPERVISOR_set_trap_table(trap_info_t *table);
151 int HYPERVISOR_mmu_update(mmu_update_t *req, int count, int *success_count, domid_t domid);
152 int HYPERVISOR_mmuext_op(struct mmuext_op *op, int count, int *scount, domid_t domid);
153 int HYPERVISOR_set_gdt(ulong *frame_list, int entries);
154 int HYPERVISOR_stack_switch(ulong ss, ulong esp);
155 int HYPERVISOR_set_callbacks(ulong evss, ulong evfunc, ulong fsss, ulong fsfunc);
156 int HYPERVISOR_fpu_taskswitch(void);
157 int HYPERVISOR_yield(void);
158 int HYPERVISOR_block(void);
159 int HYPERVISOR_shutdown(int);
160 int HYPERVISOR_multicall(void *call_list, int nr_calls);
161 int HYPERVISOR_event_channel_op(void *op);
162 int HYPERVISOR_xen_version(int cmd, void *arg);
163 int HYPERVISOR_console_io(int cmd, int count, char *str);
164 int HYPERVISOR_grant_table_op(int cmd, gnttab_setup_table_t *setup, int count);
165 int HYPERVISOR_memory_op(int cmd, struct xen_memory_reservation *arg);