fns.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. void aamloop(int);
  2. void addconf(char*, ...);
  3. Alarm* alarm(int, void (*)(Alarm*), void*);
  4. void alarminit(void);
  5. Block* allocb(int);
  6. void apminit(void);
  7. int bootp(int, char*, Boot*);
  8. int bootpass(Boot*, void*, int);
  9. void cancel(Alarm*);
  10. void check(char*);
  11. void cgascreenputs(char*, int);
  12. int cistrcmp(char*, char*);
  13. int cistrncmp(char*, char*, int);
  14. void changeconf(char*, ...);
  15. void checkalarms(void);
  16. void clockinit(void);
  17. void consdrain(void);
  18. void consinit(char*, char*);
  19. void consputs(char*, int);
  20. void delay(int);
  21. uchar* etheraddr(int);
  22. int etherinit(void);
  23. void etherinitdev(int, char*);
  24. void etherprintdevs(int);
  25. int etherrxpkt(int, Etherpkt*, int);
  26. int ethertxpkt(int, Etherpkt*, int, int);
  27. #define evenaddr(x) /* 386 doesn't care */
  28. int floppyboot(int, char*, Boot*);
  29. int floppyinit(void);
  30. void floppyinitdev(int, char*);
  31. void floppyprintdevs(int);
  32. void* floppygetdospart(int, char*, int);
  33. void freeb(Block*);
  34. char* getconf(char*);
  35. ulong getcr0(void);
  36. ulong getcr2(void);
  37. ulong getcr3(void);
  38. ulong getcr4(void);
  39. int getfields(char*, char**, int, char);
  40. int getstr(char*, char*, int, char*, int);
  41. int gunzip(uchar*, int, uchar*, int);
  42. void i8042a20(void);
  43. void i8042init(void);
  44. void i8042reset(void);
  45. void* ialloc(ulong, int);
  46. void idle(void);
  47. void ilock(Lock*);
  48. int inb(int);
  49. ushort ins(int);
  50. ulong inl(int);
  51. void insb(int, void*, int);
  52. void inss(int, void*, int);
  53. void insl(int, void*, int);
  54. void iunlock(Lock*);
  55. int isaconfig(char*, int, ISAConf*);
  56. void kbdinit(void);
  57. void kbdchar(int);
  58. void machinit(void);
  59. void meminit(ulong);
  60. void microdelay(int);
  61. void mmuinit(void);
  62. #define nelem(x) (sizeof(x)/sizeof(x[0]))
  63. uchar nvramread(int);
  64. void outb(int, int);
  65. void outs(int, ushort);
  66. void outl(int, ulong);
  67. void outsb(int, void*, int);
  68. void outss(int, void*, int);
  69. void outsl(int, void*, int);
  70. void panic(char*, ...);
  71. int pcicfgr8(Pcidev*, int);
  72. int pcicfgr16(Pcidev*, int);
  73. int pcicfgr32(Pcidev*, int);
  74. void pcicfgw8(Pcidev*, int, int);
  75. void pcicfgw16(Pcidev*, int, int);
  76. void pcicfgw32(Pcidev*, int, int);
  77. Pcidev* pcimatch(Pcidev*, int, int);
  78. uchar pciintl(Pcidev *);
  79. uchar pciipin(Pcidev *, uchar);
  80. void pcireset(void);
  81. void pcisetbme(Pcidev*);
  82. int pcmcistuple(int, int, void*, int);
  83. int pcmspecial(char*, ISAConf*);
  84. void pcmspecialclose(int);
  85. void pcmunmap(int, PCMmap*);
  86. void ptcheck(char*);
  87. void putcr3(ulong);
  88. void putidt(Segdesc*, int);
  89. void qinit(IOQ*);
  90. void readlsconf(void);
  91. void sdaddconf(int);
  92. int sdboot(int, char*, Boot*);
  93. void sdcheck(char*);
  94. void* sdgetdospart(int, char*, int);
  95. int sdinit(void);
  96. void sdinitdev(int, char*);
  97. void sdprintdevs(int);
  98. int sdsetpart(int, char*);
  99. void setvec(int, void (*)(Ureg*, void*), void*);
  100. int splhi(void);
  101. int spllo(void);
  102. void splx(int);
  103. void trapinit(void);
  104. void uartdrain(void);
  105. void uartspecial(int, void (*)(int), int (*)(void), int);
  106. void uartputs(IOQ*, char*, int);
  107. ulong umbmalloc(ulong, int, int);
  108. void umbfree(ulong, int);
  109. ulong umbrwmalloc(ulong, int, int);
  110. void upafree(ulong, int);
  111. ulong upamalloc(ulong, int, int);
  112. void warp86(char*, ulong);
  113. void warp9(ulong);
  114. int x86cpuid(int*, int*);
  115. void* xspanalloc(ulong, int, ulong);
  116. #define malloc(n) ialloc(n, 0)
  117. #define mallocz(n, c) ialloc(n, 0)
  118. #define free(v) while(0)
  119. #define GSHORT(p) (((p)[1]<<8)|(p)[0])
  120. #define GLONG(p) ((GSHORT(p+2)<<16)|GSHORT(p))
  121. #define GLSHORT(p) (((p)[0]<<8)|(p)[1])
  122. #define GLLONG(p) (((ulong)GLSHORT(p)<<16)|GLSHORT(p+2))
  123. #define KADDR(a) ((void*)((ulong)(a)|KZERO))
  124. #define PADDR(a) ((ulong)(a)&~KZERO)
  125. #define HOWMANY(x, y) (((x)+((y)-1))/(y))
  126. #define ROUNDUP(x, y) (HOWMANY((x), (y))*(y))
  127. #define xalloc(n) ialloc(n, 0)
  128. #define xfree(v) while(0)
  129. #define lock(l) if(l){/* nothing to do */;}else{/* nothing to do */;}
  130. #define unlock(l) if(l){/* nothing to do */;}else{/* nothing to do */;}
  131. int dmacount(int);
  132. int dmadone(int);
  133. void dmaend(int);
  134. void dmainit(int);
  135. long dmasetup(int, void*, long, int);
  136. extern int (*_pcmspecial)(char *, ISAConf *);
  137. extern void (*_pcmspecialclose)(int);
  138. extern void devi82365link(void);
  139. extern void devpccardlink(void);