]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/pc64/fns.h
pc, pc64: move all fpu specific code from main.c to fpu.c
[plan9front.git] / sys / src / 9 / pc64 / fns.h
1 #include "../port/portfns.h"
2
3 void    aamloop(int);
4 Dirtab* addarchfile(char*, int, long(*)(Chan*,void*,long,vlong), long(*)(Chan*,void*,long,vlong));
5 void    archinit(void);
6 void    archreset(void);
7 int     bios32call(BIOS32ci*, u16int[3]);
8 int     bios32ci(BIOS32si*, BIOS32ci*);
9 void    bios32close(BIOS32si*);
10 BIOS32si* bios32open(char*);
11 void    bootargsinit(void);
12 uintptr cankaddr(uintptr);
13 int     checksum(void *, int);
14 void    clockintr(Ureg*, void*);
15 int     (*cmpswap)(long*, long, long);
16 int     cmpswap486(long*, long, long);
17 void    (*coherence)(void);
18 void    cpuid(int, int, ulong regs[]);
19 void    fpuinit(void);
20 int     cpuidentify(void);
21 void    cpuidprint(void);
22 void    (*cycles)(uvlong*);
23 void    delay(int);
24 void*   dmabva(int);
25 #define dmaflush(clean, addr, len)
26 int     dmacount(int);
27 int     dmadone(int);
28 void    dmaend(int);
29 int     dmainit(int, int);
30 #define DMAWRITE 0
31 #define DMAREAD 1
32 #define DMALOOP 2
33 long    dmasetup(int, void*, long, int);
34 void    dumpmcregs(void);
35 int     ecinit(int cmdport, int dataport);
36 int     ecread(uchar addr);
37 int     ecwrite(uchar addr, uchar val);
38 #define evenaddr(x)                             /* x86 doesn't care */
39 void    fpinit(void);
40 void    (*fprestore)(FPsave*);
41 void    (*fpsave)(FPsave*);
42 void    fpuprocsetup(Proc*);
43 void    fpuprocfork(Proc*);
44 void    fpuprocsave(Proc*);
45 void    fpuprocrestore(Proc*);
46 int     fpusave(void);
47 void    fpurestore(int);
48 u64int  getcr0(void);
49 u64int  getcr2(void);
50 u64int  getcr3(void);
51 u64int  getcr4(void);
52 u64int  getxcr0(void);
53 u64int  getdr6(void);
54 char*   getconf(char*);
55 void    guesscpuhz(int);
56 void    halt(void);
57 void    mwait(void*);
58 int     i8042auxcmd(int);
59 void    i8042auxenable(void (*)(int, int));
60 void    i8042reset(void);
61 void    i8250console(void);
62 void*   i8250alloc(int, int, int);
63 void    i8253enable(void);
64 void    i8253init(void);
65 void    i8253reset(void);
66 uvlong  i8253read(uvlong*);
67 void    i8253timerset(uvlong);
68 void    idle(void);
69 void    idlehands(void);
70 int     inb(int);
71 void    insb(int, void*, int);
72 ushort  ins(int);
73 void    inss(int, void*, int);
74 ulong   inl(int);
75 void    insl(int, void*, int);
76 void    intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
77 void    intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
78 void    introff(void);
79 void    intron(void);
80 void    invlpg(uintptr);
81 void    ioinit(void);
82 int     iprint(char*, ...);
83 int     isaconfig(char*, int, ISAConf*);
84 void*   kaddr(uintptr);
85 KMap*   kmap(Page*);
86 void    kunmap(KMap*);
87 #define kmapinval()
88 void    lgdt(void*);
89 void    lidt(void*);
90 void    links(void);
91 void    ltr(ulong);
92 void    mach0init(void);
93 void    mathinit(void);
94 void    mb386(void);
95 void    mb586(void);
96 void    meminit(void);
97 void    meminit0(void);
98 void    memreserve(uintptr, uintptr);
99 void    mfence(void);
100 #define mmuflushtlb() putcr3(getcr3())
101 void    mmuinit(void);
102 uintptr *mmuwalk(uintptr*, uintptr, int, int);
103 char*   mtrr(uvlong, uvlong, char *);
104 char*   mtrrattr(uvlong, uvlong *);
105 void    mtrrclock(void);
106 int     mtrrprint(char *, long);
107 void    mtrrsync(void);
108 void    nmienable(void);
109 void    noteret(void);
110 uchar   nvramread(int);
111 void    nvramwrite(int, uchar);
112 void    outb(int, int);
113 void    outsb(int, void*, int);
114 void    outs(int, ushort);
115 void    outss(int, void*, int);
116 void    outl(int, ulong);
117 void    outsl(int, void*, int);
118 uintptr paddr(void*);
119 void    patwc(void*, int);
120 void    pcicfginit(void);
121 int     (*pcicfgrw8)(int, int, int, int);
122 int     (*pcicfgrw16)(int, int, int, int);
123 int     (*pcicfgrw32)(int, int, int, int);
124 void    pcmcisread(PCMslot*);
125 int     pcmcistuple(int, int, int, void*, int);
126 PCMmap* pcmmap(int, ulong, int, int);
127 int     pcmspecial(char*, ISAConf*);
128 int     (*_pcmspecial)(char *, ISAConf *);
129 void    pcmspecialclose(int);
130 void    (*_pcmspecialclose)(int);
131 void    pcmunmap(int, PCMmap*);
132 void    pmap(uintptr, uintptr, vlong);
133 void    punmap(uintptr, vlong);
134 void    preallocpages(void);
135 void    procrestore(Proc*);
136 void    procsave(Proc*);
137 void    procsetup(Proc*);
138 void    procfork(Proc*);
139 void    putcr0(u64int);
140 void    putcr2(u64int);
141 void    putcr3(u64int);
142 void    putcr4(u64int);
143 void    putxcr0(u64int);
144 void    putdr(u64int*);
145 void    putdr01236(u64int*);
146 void    putdr6(u64int);
147 void    putdr7(u64int);
148 void*   rampage(void);
149 int     rdmsr(int, vlong*);
150 void    realmode(Ureg*);
151 void*   rsdsearch(void);
152 void    screeninit(void);
153 void    (*screenputs)(char*, int);
154 void    setconfenv(void);
155 void*   sigsearch(char*, int);
156 void    syncclock(void);
157 void    syscallentry(void);
158 void    touser(void*);
159 void    trapenable(int, void (*)(Ureg*, void*), void*, char*);
160 void    trapinit(void);
161 void    trapinit0(void);
162 int     tas(void*);
163 uvlong  tscticks(uvlong*);
164 ulong   umballoc(ulong, ulong, ulong);
165 void    umbfree(ulong, ulong);
166 uvlong  upaalloc(uvlong, ulong, ulong);
167 uvlong  upaallocwin(uvlong, ulong, ulong, ulong);
168 void    upafree(uvlong, ulong);
169 void    vectortable(void);
170 void    vmxprocrestore(Proc *);
171 void    vmxshutdown(void);
172 void*   vmap(uvlong, int);
173 void    vunmap(void*, int);
174 void    wbinvd(void);
175 void    writeconf(void);
176 int     wrmsr(int, vlong);
177 int     xchgw(ushort*, int);
178 void    rdrandbuf(void*, ulong);
179
180 #define userureg(ur)    (((ur)->cs & 3) == 3)
181 #define waserror()      (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
182 #define KADDR(a)        kaddr(a)
183 #define PADDR(a)        paddr((void*)(a))