]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/pc64/fns.h
01a1959d3e6c4f6a2f0ef84975a795deedbcd73c
[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    halt(void);
56 void    mwait(void*);
57 int     i8042auxcmd(int);
58 void    i8042auxenable(void (*)(int, int));
59 void    i8042reset(void);
60 void    i8250console(void);
61 void*   i8250alloc(int, int, int);
62 void    i8253enable(void);
63 void    i8253init(void);
64 void    i8253reset(void);
65 uvlong  i8253read(uvlong*);
66 void    i8253timerset(uvlong);
67 void    idle(void);
68 void    idlehands(void);
69 int     inb(int);
70 void    insb(int, void*, int);
71 ushort  ins(int);
72 void    inss(int, void*, int);
73 ulong   inl(int);
74 void    insl(int, void*, int);
75 void    intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
76 void    intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
77 void    introff(void);
78 void    intron(void);
79 void    invlpg(uintptr);
80 void    ioinit(void);
81 int     iprint(char*, ...);
82 int     isaconfig(char*, int, ISAConf*);
83 void*   kaddr(uintptr);
84 KMap*   kmap(Page*);
85 void    kunmap(KMap*);
86 #define kmapinval()
87 void    lgdt(void*);
88 void    lidt(void*);
89 void    links(void);
90 void    ltr(ulong);
91 void    mach0init(void);
92 void    mathinit(void);
93 void    mb386(void);
94 void    mb586(void);
95 void    meminit(void);
96 void    meminit0(void);
97 void    memreserve(uintptr, uintptr);
98 void    mfence(void);
99 #define mmuflushtlb() putcr3(getcr3())
100 void    mmuinit(void);
101 uintptr *mmuwalk(uintptr*, uintptr, int, int);
102 char*   mtrr(uvlong, uvlong, char *);
103 char*   mtrrattr(uvlong, uvlong *);
104 void    mtrrclock(void);
105 int     mtrrprint(char *, long);
106 void    mtrrsync(void);
107 void    nmienable(void);
108 void    noteret(void);
109 uchar   nvramread(int);
110 void    nvramwrite(int, uchar);
111 void    outb(int, int);
112 void    outsb(int, void*, int);
113 void    outs(int, ushort);
114 void    outss(int, void*, int);
115 void    outl(int, ulong);
116 void    outsl(int, void*, int);
117 uintptr paddr(void*);
118 void    patwc(void*, int);
119 void    pcicfginit(void);
120 int     (*pcicfgrw8)(int, int, int, int);
121 int     (*pcicfgrw16)(int, int, int, int);
122 int     (*pcicfgrw32)(int, int, int, int);
123 void    pcmcisread(PCMslot*);
124 int     pcmcistuple(int, int, int, void*, int);
125 PCMmap* pcmmap(int, ulong, int, int);
126 int     pcmspecial(char*, ISAConf*);
127 int     (*_pcmspecial)(char *, ISAConf *);
128 void    pcmspecialclose(int);
129 void    (*_pcmspecialclose)(int);
130 void    pcmunmap(int, PCMmap*);
131 void    pmap(uintptr, uintptr, vlong);
132 void    punmap(uintptr, vlong);
133 void    preallocpages(void);
134 void    procrestore(Proc*);
135 void    procsave(Proc*);
136 void    procsetup(Proc*);
137 void    procfork(Proc*);
138 void    putcr0(u64int);
139 void    putcr2(u64int);
140 void    putcr3(u64int);
141 void    putcr4(u64int);
142 void    putxcr0(u64int);
143 void    putdr(u64int*);
144 void    putdr01236(u64int*);
145 void    putdr6(u64int);
146 void    putdr7(u64int);
147 void*   rampage(void);
148 int     rdmsr(int, vlong*);
149 void    realmode(Ureg*);
150 void*   rsdsearch(void);
151 void    screeninit(void);
152 void    (*screenputs)(char*, int);
153 void    setconfenv(void);
154 void*   sigsearch(char*, int);
155 void    syncclock(void);
156 void    syscallentry(void);
157 void    touser(void*);
158 void    trapenable(int, void (*)(Ureg*, void*), void*, char*);
159 void    trapinit(void);
160 void    trapinit0(void);
161 int     tas(void*);
162 uvlong  tscticks(uvlong*);
163 ulong   umballoc(ulong, ulong, ulong);
164 void    umbfree(ulong, ulong);
165 uvlong  upaalloc(uvlong, ulong, ulong);
166 uvlong  upaallocwin(uvlong, ulong, ulong, ulong);
167 void    upafree(uvlong, ulong);
168 void    vectortable(void);
169 void    vmxprocrestore(Proc *);
170 void    vmxshutdown(void);
171 void*   vmap(uvlong, int);
172 void    vunmap(void*, int);
173 void    wbinvd(void);
174 void    writeconf(void);
175 int     wrmsr(int, vlong);
176 int     xchgw(ushort*, int);
177 void    rdrandbuf(void*, ulong);
178
179 #define userureg(ur)    (((ur)->cs & 3) == 3)
180 #define waserror()      (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
181 #define KADDR(a)        kaddr(a)
182 #define PADDR(a)        paddr((void*)(a))