]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/vmx/fns.h
vmx: add -D option to enable debug messages, use vmdebug for non-fatal "errors"
[plan9front.git] / sys / src / cmd / vmx / fns.h
1 #define MIN(a,b) ((a)<(b)?(a):(b))
2 void *emalloc(ulong);
3 void loadkernel(char *);
4 uvlong rget(char *);
5 void rpoke(char *, uvlong, int);
6 #define rset(a,b) rpoke(a,b,0)
7 void rsetsz(char *, uvlong, int);
8 uvlong rgetsz(char *, int);
9 void processexit(char *);
10 void pitadvance(void);
11 void rtcadvance(void);
12 void settimer(vlong targ);
13 void vmerror(char *, ...);
14 void vmdebug(char *, ...);
15 int ctl(char *, ...);
16 void registermmio(uvlong, uvlong, uvlong (*)(int, uvlong, uvlong));
17 void irqline(int, int);
18 void irqack(int);
19 void postexc(char *, vlong);
20 void vgaresize(void);
21 void uartinit(int, char *);
22 void sendnotif(void (*)(void *), void *);
23 PCIDev *mkpcidev(u32int, u32int, u32int, int);
24 PCIBar *mkpcibar(PCIDev *, u8int, u32int, u32int, void *, void *);
25 PCICap *mkpcicap(PCIDev *, u8int, u32int (*)(PCICap *, u8int), void(*)(PCICap *, u8int, u32int, u32int));
26 u32int allocbdf(void);
27 Region *regptr(u64int);
28 void *gptr(u64int, u64int);
29 void *gend(void *);
30 uintptr gpa(void *);
31 uintptr gavail(void *);
32 void pciirq(PCIDev *, int);
33 u32int iowhine(int, u16int, u32int, int, void *);
34 void elcr(u16int);
35 int mkvionet(char *);
36 int mkvioblk(char *);
37 int mkideblk(char *);
38 char* rcflush(int);
39 void i8042kick(void *);
40 #define GET8(p,n) (*((u8int*)(p)+(n)))
41 #define GET16(p,n) (*(u16int*)((u8int*)(p)+(n)))
42 #define GET32(p,n) (*(u32int*)((u8int*)(p)+(n)))
43 #define GET64(p,n) (*(u64int*)((u8int*)(p)+(n)))
44 #define PUT8(p,n,v) (*((u8int*)(p)+(n)) = (v))
45 #define PUT16(p,n,v) (*(u16int*)((u8int*)(p)+(n)) = (v))
46 #define PUT32(p,n,v) (*(u32int*)((u8int*)(p)+(n)) = (v))
47 #define PUT64(p,n,v) (*(u64int*)((u8int*)(p)+(n)) = (v))
48 u32int roundpow2(u32int);
49 u32int vgagetpal(u8int);
50 void vgasetpal(u8int, u32int);
51 uintptr vmemread(void *, uintptr, uintptr);
52 uintptr vmemwrite(void *, uintptr, uintptr);
53 int x86access(int, uintptr, int, uvlong*, int, int, TLB *);
54 u32int io(int, u16int, u32int, int);
55 int x86step(void);
56 uvlong nanosec(void);