]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/xen/fns.h
xen: use pc/fpu.c
[plan9front.git] / sys / src / 9 / xen / fns.h
1 #include "../port/portfns.h"
2
3 Dirtab* addarchfile(char*, int, long(*)(Chan*,void*,long,vlong), long(*)(Chan*,void*,long,vlong));
4 void    archinit(void);
5 void    bootargs(ulong);
6 ulong   cankaddr(ulong);
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[]);
13 void    fpuinit(void);
14 int             cpuidentify(void);
15 void    cpuidprint(void);
16 void    (*cycles)(uvlong*);
17 void    delay(int);
18 #define evenaddr(x)                             /* x86 doesn't care */
19 void    fpclear(void);
20 void    fpinit(void);
21 void    fpoff(void);
22 void    (*fprestore)(FPsave*);
23 void    (*fpsave)(FPsave*);
24 ulong   getcr4(void);
25 char*   getconf(char*);
26 void    guesscpuhz(int);
27 void    halt(void);
28 void    mwait(void*);
29 void    i8042reset(void);
30 void    i8253enable(void);
31 void    i8253init(void);
32 void    i8253link(void);
33 uvlong  i8253read(uvlong*);
34 void    i8253timerset(uvlong);
35 void    idle(void);
36 void    idlehands(void);
37 int     inb(int);
38 void    insb(int, void*, int);
39 ushort  ins(int);
40 void    inss(int, void*, int);
41 ulong   inl(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*);
45 void    ioinit(void);
46 int     isaconfig(char*, int, ISAConf*);
47 void    kbdenable(void);
48 #define kmapinval()
49 void    links(void);
50 void    mach0init(void);
51 void    mathinit(void);
52 void    mb386(void);
53 void    mb586(void);
54 void    mfence(void);
55 void mmuflushtlb(Page*);
56 void    mmuinit(void);
57 ulong   mmukmap(ulong, ulong, int);
58 int     mmukmapsync(ulong);
59 #define mmunewpage(x)
60 ulong*  mmuwalk(ulong*, ulong, int, int);
61 char*   mtrr(uvlong, uvlong, char *);
62 int     mtrrprint(char *, long);
63 void    mtrrsync(void);
64 void    outb(int, int);
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*);
72 void    procsave(Proc*);
73 void    procsetup(Proc*);
74 void    procfork(Proc*);
75 void    putcr4(ulong);
76 int             rdmsr(int, vlong*);
77 int             screenprint(char*, ...);                        /* debugging */
78 void    (*screenputs)(char*, int);
79 void    touser(void*);
80 void    trap(Ureg*);
81 void    trapenable(int, void (*)(Ureg*, void*), void*, char*);
82 void    trapinit(void);
83 int             tas(void*);
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);
91
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)
95
96 #define dcflush(a, b)
97
98 /* Xen functions */
99 #define rmb()   coherence()
100 #define wmb()   coherence()
101 void mb(void);
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);
115 int ffs(ulong);
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);
130
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);