2 |
- |
1 |
#include "../port/portfns.h"
|
|
|
2 |
|
|
|
3 |
void aamloop(int);
|
|
|
4 |
void acpiscan(void (*func)(uchar *));
|
|
|
5 |
Dirtab* addarchfile(char*, int, long(*)(Chan*,void*,long,vlong), long(*)(Chan*,void*,long,vlong));
|
|
|
6 |
void archinit(void);
|
|
|
7 |
void archrevert(void);
|
|
|
8 |
int bios32call(BIOS32ci*, u16int[3]);
|
|
|
9 |
int bios32ci(BIOS32si*, BIOS32ci*);
|
|
|
10 |
void bios32close(BIOS32si*);
|
|
|
11 |
BIOS32si* bios32open(char*);
|
|
|
12 |
void bootargs(void*);
|
|
|
13 |
ulong cankaddr(ulong);
|
|
|
14 |
void cgapost(int);
|
|
|
15 |
void clockintr(Ureg*, void*);
|
|
|
16 |
int (*cmpswap)(long*, long, long);
|
|
|
17 |
int cmpswap486(long*, long, long);
|
|
|
18 |
void (*coherence)(void);
|
|
|
19 |
void cpuid(int, ulong regs[]);
|
|
|
20 |
int cpuidentify(void);
|
|
|
21 |
void cpuidprint(void);
|
|
|
22 |
void (*cycles)(uvlong*);
|
|
|
23 |
void delay(int);
|
|
|
24 |
int dmacount(int);
|
|
|
25 |
int dmadone(int);
|
|
|
26 |
void dmaend(int);
|
|
|
27 |
int dmainit(int, int);
|
|
|
28 |
long dmasetup(int, void*, long, int);
|
|
|
29 |
void fpclear(void);
|
|
|
30 |
void fpenv(FPsave*);
|
|
|
31 |
void fpinit(void);
|
|
|
32 |
void fpoff(void);
|
|
|
33 |
void fpon(void);
|
|
|
34 |
void (*fprestore)(FPsave*);
|
|
|
35 |
void (*fpsave)(FPsave*);
|
|
|
36 |
void fpsavealloc(void);
|
|
|
37 |
void fpsserestore(FPsave*);
|
|
|
38 |
void fpsserestore0(FPsave*);
|
|
|
39 |
void fpssesave(FPsave*);
|
|
|
40 |
void fpssesave0(FPsave*);
|
|
|
41 |
ulong fpstatus(void);
|
|
|
42 |
void fpx87restore(FPsave*);
|
|
|
43 |
void fpx87save(FPsave*);
|
|
|
44 |
ulong getcr0(void);
|
|
|
45 |
ulong getcr2(void);
|
|
|
46 |
ulong getcr3(void);
|
|
|
47 |
ulong getcr4(void);
|
|
|
48 |
char* getconf(char*);
|
|
|
49 |
void guesscpuhz(int);
|
|
|
50 |
void halt(void);
|
|
|
51 |
int i8042auxcmd(int);
|
|
|
52 |
int i8042auxcmds(uchar*, int);
|
|
|
53 |
void i8042auxenable(void (*)(int, int));
|
|
|
54 |
void i8042reset(void);
|
|
|
55 |
void i8250console(void);
|
|
|
56 |
void i8250config(char *);
|
|
|
57 |
void* i8250alloc(int, int, int);
|
|
|
58 |
void i8250mouse(char*, int (*)(Queue*, int), int);
|
|
|
59 |
void i8250setmouseputc(char*, int (*)(Queue*, int));
|
|
|
60 |
void i8253enable(void);
|
|
|
61 |
void i8253init(void);
|
|
|
62 |
void i8253link(void);
|
|
|
63 |
uvlong i8253read(uvlong*);
|
|
|
64 |
void i8253timerset(uvlong);
|
|
|
65 |
int i8259disable(int);
|
|
|
66 |
int i8259enable(Vctl*);
|
|
|
67 |
void i8259init(void);
|
|
|
68 |
int i8259isr(int);
|
|
|
69 |
void i8259on(void);
|
|
|
70 |
void i8259off(void);
|
|
|
71 |
int i8259vecno(int);
|
|
|
72 |
void idle(void);
|
|
|
73 |
void idlehands(void);
|
|
|
74 |
int inb(int);
|
|
|
75 |
void insb(int, void*, int);
|
|
|
76 |
ushort ins(int);
|
|
|
77 |
void inss(int, void*, int);
|
|
|
78 |
ulong inl(int);
|
|
|
79 |
void insl(int, void*, int);
|
|
|
80 |
int intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
|
|
|
81 |
void intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
|
|
|
82 |
void introff(void);
|
|
|
83 |
void intron(void);
|
|
|
84 |
void invlpg(ulong);
|
|
|
85 |
void iofree(int);
|
|
|
86 |
void ioinit(void);
|
|
|
87 |
int iounused(int, int);
|
|
|
88 |
int ioalloc(int, int, int, char*);
|
|
|
89 |
int ioreserve(int, int, int, char*);
|
|
|
90 |
int iprint(char*, ...);
|
|
|
91 |
int isaconfig(char*, int, ISAConf*);
|
|
|
92 |
void* kaddr(ulong);
|
|
|
93 |
void kbdenable(void);
|
|
|
94 |
void kbdinit(void);
|
|
|
95 |
#define kmapinval()
|
|
|
96 |
void lgdt(ushort[3]);
|
|
|
97 |
void lidt(ushort[3]);
|
|
|
98 |
void links(void);
|
|
|
99 |
void ltr(ulong);
|
|
|
100 |
void mach0init(void);
|
|
|
101 |
void mathinit(void);
|
|
|
102 |
void mb386(void);
|
|
|
103 |
void mb586(void);
|
|
|
104 |
void meminit(void);
|
|
|
105 |
void memorysummary(void);
|
|
|
106 |
void mfence(void);
|
|
|
107 |
#define mmuflushtlb(pdb) putcr3(pdb)
|
|
|
108 |
void mmuinit(void);
|
|
|
109 |
ulong* mmuwalk(ulong*, ulong, int, int);
|
|
|
110 |
int mtrr(uvlong, uvlong, char *);
|
|
|
111 |
void mtrrclock(void);
|
|
|
112 |
int mtrrprint(char *, long);
|
|
|
113 |
uchar nvramread(int);
|
|
|
114 |
void nvramwrite(int, uchar);
|
|
|
115 |
void outb(int, int);
|
|
|
116 |
void outsb(int, void*, int);
|
|
|
117 |
void outs(int, ushort);
|
|
|
118 |
void outss(int, void*, int);
|
|
|
119 |
void outl(int, ulong);
|
|
|
120 |
void outsl(int, void*, int);
|
|
|
121 |
ulong paddr(void*);
|
|
|
122 |
ulong pcibarsize(Pcidev*, int);
|
|
|
123 |
void pcibussize(Pcidev*, ulong*, ulong*);
|
|
|
124 |
int pcicfgr8(Pcidev*, int);
|
|
|
125 |
int pcicfgr16(Pcidev*, int);
|
|
|
126 |
int pcicfgr32(Pcidev*, int);
|
|
|
127 |
void pcicfgw8(Pcidev*, int, int);
|
|
|
128 |
void pcicfgw16(Pcidev*, int, int);
|
|
|
129 |
void pcicfgw32(Pcidev*, int, int);
|
|
|
130 |
void pciclrbme(Pcidev*);
|
|
|
131 |
void pciclrioe(Pcidev*);
|
|
|
132 |
void pciclrmwi(Pcidev*);
|
|
|
133 |
int pcigetpms(Pcidev*);
|
|
|
134 |
void pcihinv(Pcidev*);
|
|
|
135 |
uchar pciipin(Pcidev*, uchar);
|
|
|
136 |
Pcidev* pcimatch(Pcidev*, int, int);
|
|
|
137 |
Pcidev* pcimatchtbdf(int);
|
|
|
138 |
void pcireset(void);
|
|
|
139 |
int pciscan(int, Pcidev**);
|
|
|
140 |
void pcisetbme(Pcidev*);
|
|
|
141 |
void pcisetioe(Pcidev*);
|
|
|
142 |
void pcisetmwi(Pcidev*);
|
|
|
143 |
int pcisetpms(Pcidev*, int);
|
|
|
144 |
void pcmcisread(PCMslot*);
|
|
|
145 |
int pcmcistuple(int, int, int, void*, int);
|
|
|
146 |
PCMmap* pcmmap(int, ulong, int, int);
|
|
|
147 |
int pcmspecial(char*, ISAConf*);
|
|
|
148 |
int (*_pcmspecial)(char *, ISAConf *);
|
|
|
149 |
void pcmspecialclose(int);
|
|
|
150 |
void (*_pcmspecialclose)(int);
|
|
|
151 |
void pcmunmap(int, PCMmap*);
|
|
|
152 |
int pdbmap(ulong*, ulong, ulong, int);
|
|
|
153 |
void procrestore(Proc*);
|
|
|
154 |
void procsave(Proc*);
|
|
|
155 |
void procsetup(Proc*);
|
|
|
156 |
void putcr0(ulong);
|
|
|
157 |
void putcr3(ulong);
|
|
|
158 |
void putcr4(ulong);
|
|
|
159 |
void* rampage(void);
|
|
|
160 |
void rdmsr(int, vlong*);
|
|
|
161 |
void realmode(Ureg*);
|
|
|
162 |
void screeninit(void);
|
|
|
163 |
void (*screenputs)(char*, int);
|
|
|
164 |
void* sigsearch(char*);
|
|
|
165 |
void syncclock(void);
|
|
|
166 |
void syscallfmt(int syscallno, ulong pc, va_list list);
|
|
|
167 |
void sysretfmt(int syscallno, va_list list, long ret, uvlong start, uvlong stop);
|
|
|
168 |
void* tmpmap(Page*);
|
|
|
169 |
void tmpunmap(void*);
|
|
|
170 |
void touser(void*);
|
|
|
171 |
void trapenable(int, void (*)(Ureg*, void*), void*, char*);
|
|
|
172 |
void trapinit(void);
|
|
|
173 |
void trapinit0(void);
|
|
|
174 |
int tas(void*);
|
|
|
175 |
uvlong tscticks(uvlong*);
|
|
|
176 |
ulong umbmalloc(ulong, int, int);
|
|
|
177 |
void umbfree(ulong, int);
|
|
|
178 |
ulong umbrwmalloc(ulong, int, int);
|
|
|
179 |
void umbrwfree(ulong, int);
|
|
|
180 |
ulong upaalloc(int, int);
|
|
|
181 |
void upafree(ulong, int);
|
|
|
182 |
void upareserve(ulong, int);
|
|
|
183 |
#define userureg(ur) (((ur)->cs & 0xFFFF) == UESEL)
|
|
|
184 |
void validalign(uintptr, unsigned);
|
|
|
185 |
void vectortable(void);
|
|
|
186 |
void* vmap(ulong, int);
|
|
|
187 |
int vmapsync(ulong);
|
|
|
188 |
void vunmap(void*, int);
|
|
|
189 |
void wbinvd(void);
|
|
|
190 |
void wrmsr(int, vlong);
|
|
|
191 |
int xchgw(ushort*, int);
|
|
|
192 |
|
|
|
193 |
#define PTR2UINT(p) ((uintptr)(p))
|
|
|
194 |
#define UINT2PTR(i) ((void*)(i))
|
|
|
195 |
|
|
|
196 |
#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
|
|
|
197 |
#define KADDR(a) kaddr(a)
|
|
|
198 |
#define PADDR(a) paddr((void*)(a))
|
|
|
199 |
|
|
|
200 |
#define dcflush(a, b)
|
|
|
201 |
|
|
|
202 |
#define BIOSSEG(a) KADDR(((uint)(a))<<4)
|
|
|
203 |
|
|
|
204 |
#define L16GET(p) (((p)[1]<<8)|(p)[0])
|
|
|
205 |
#define L32GET(p) (((u32int)L16GET((p)+2)<<16)|L16GET(p))
|