home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / inline.h < prev    next >
Encoding:
Text File  |  1988-06-26  |  3.1 KB  |  273 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. #ident    "@(#)head.sys:inline.h    1.4"
  9.  
  10. asm    int flushtlb()
  11. {
  12.     movl    %cr3, %eax
  13.     movl    %eax, %cr3
  14. }
  15.  
  16. asm    int _cr0()
  17. {
  18.     movl    %cr0, %eax
  19. }
  20.  
  21. asm    int _cr2()
  22. {
  23.     movl    %cr2, %eax
  24. }
  25.  
  26. asm    int _cr3()
  27. {
  28.     movl    %cr3, %eax
  29.     andl    $0x7FFFFFFF, %eax
  30. }
  31.  
  32. asm    int _wdr0(x)
  33. {
  34. %reg    x;
  35.     movl    x, %db0
  36. %ureg    x;
  37.     movl    x, %db0
  38. %con    x;
  39.     movl    $x,%eax
  40.     movl    %eax, %db0
  41. %mem    x;
  42.     movl    x,%eax
  43.     movl    %eax, %db0
  44. }
  45.  
  46. asm    int _wdr1(x)
  47. {
  48. %reg    x;
  49.     movl    x, %db1
  50. %ureg    x;
  51.     movl    x, %db1
  52. %con    x;
  53.     movl    $x,%eax
  54.     movl    %eax, %db1
  55. %mem    x;
  56.     movl    x,%eax
  57.     movl    %eax, %db1
  58. }
  59.  
  60. asm    int _wdr2(x)
  61. {
  62. %reg    x;
  63.     movl    x, %db2
  64. %ureg    x;
  65.     movl    x, %db2
  66. %con    x;
  67.     movl    $x,%eax
  68.     movl    %eax, %db2
  69. %mem    x;
  70.     movl    x,%eax
  71.     movl    %eax, %db2
  72. }
  73.  
  74. asm    int _wdr3(x)
  75. {
  76. %reg    x;
  77.     movl    x, %db3
  78. %ureg    x;
  79.     movl    x, %db3
  80. %con    x;
  81.     movl    $x,%eax
  82.     movl    %eax, %db3
  83. %mem    x;
  84.     movl    x,%eax
  85.     movl    %eax, %db3
  86. }
  87.  
  88. asm    int _wdr6(x)
  89. {
  90. %reg    x;
  91.     movl    x, %db6
  92. %ureg    x;
  93.     movl    x, %db6
  94. %con    x;
  95.     movl    $x,%eax
  96.     movl    %eax, %db6
  97. %mem    x;
  98.     movl    x,%eax
  99.     movl    %eax, %db6
  100. }
  101.  
  102. asm    int _wdr7(x)
  103. {
  104. %reg    x;
  105.     movl    x, %db7
  106. %ureg    x;
  107.     movl    x, %db7
  108. %con    x;
  109.     movl    $x,%eax
  110.     movl    %eax, %db7
  111. %mem    x;
  112.     movl    x,%eax
  113.     movl    %eax, %db7
  114. }
  115.  
  116. asm    int _dr0()
  117. {
  118.     movl    %dr0, %eax
  119. }
  120.  
  121. asm    int _dr1()
  122. {
  123.     movl    %dr1, %eax
  124. }
  125.  
  126. asm    int _dr2()
  127. {
  128.     movl    %dr2, %eax
  129. }
  130.  
  131. asm    int _dr3()
  132. {
  133.     movl    %dr3, %eax
  134. }
  135.  
  136. asm    int _dr6()
  137. {
  138.     movl    %dr6, %eax
  139. }
  140.  
  141. asm    int _dr7()
  142. {
  143.     movl    %dr7, %eax
  144. }
  145.  
  146. asm    int loadtr(x)
  147. {
  148. %reg    x;
  149.     movl    x,%eax
  150.     ltr    %ax
  151. %ureg    x;
  152.     movl    x,%eax
  153.     ltr    %ax
  154. %con    x;
  155.     movl    $x,%eax
  156.     ltr    %ax
  157. %mem    x;
  158.     movl    x,%eax
  159.     ltr    %ax
  160. }
  161.  
  162. asm     int outl(port,val)
  163. {
  164. %reg    port,val;
  165.     movl    port, %edx
  166.     movl    val, %eax
  167.     outl    (%dx)
  168. %reg    port; mem    val;
  169.     movl    port, %edx
  170.     movl    val, %eax
  171.     outl    (%dx)
  172. %mem    port; reg    val;
  173.     movw    port, %dx
  174.     movl    val, %eax
  175.     outl    (%dx)
  176. %mem    port,val;
  177.     movw    port, %dx
  178.     movl    val, %eax
  179.     outl    (%dx)
  180. }
  181.  
  182. asm    int outw(port,val)
  183. {
  184. %reg    port,val;
  185.     movl    port, %edx
  186.     movl    val, %eax
  187.     data16
  188.     outl    (%dx)
  189. %reg    port; mem    val;
  190.     movl    port, %edx
  191.     movw    val, %ax
  192.     data16
  193.     outl    (%dx)
  194. %mem    port; reg    val;
  195.     movw    port, %dx
  196.     movl    val, %eax
  197.     data16
  198.     outl    (%dx)
  199. %mem    port,val;
  200.     movw    port, %dx
  201.     movw    val, %ax
  202.     data16
  203.     outl    (%dx)
  204. }
  205.  
  206. asm    int outb(port,val)
  207. {
  208. %reg    port,val;
  209.     movl    port, %edx
  210.     movl    val, %eax
  211.     outb    (%dx)
  212. %reg    port; mem    val;
  213.     movl    port, %edx
  214.     movb    val, %al
  215.     outb    (%dx)
  216. %mem    port; reg    val;
  217.     movw    port, %dx
  218.     movl    val, %eax
  219.     outb    (%dx)
  220. %mem    port,val;
  221.     movw    port, %dx
  222.     movb    val, %al
  223.     outb    (%dx)
  224. }
  225.  
  226. asm     int inl(port)
  227. {
  228. %reg    port;
  229.     movl    port, %edx
  230.     inl    (%dx)
  231. %mem    port;
  232.     movw    port, %dx
  233.     inl    (%dx)
  234. }
  235.  
  236. asm    int inw(port)
  237. {
  238. %reg    port;
  239.     subl    %eax, %eax
  240.     movl    port, %edx
  241.     data16
  242.     inl    (%dx)
  243. %mem    port;
  244.     subl    %eax, %eax
  245.     movw    port, %dx
  246.     data16
  247.     inl    (%dx)
  248. }
  249.  
  250. asm    int inb(port)
  251. {
  252. %reg    port;
  253.     subl    %eax, %eax
  254.     movl    port, %edx
  255.     inb    (%dx)
  256. %mem    port;
  257.     subl    %eax, %eax
  258.     movw    port, %dx
  259.     inb    (%dx)
  260. }
  261.  
  262. asm     int intr_disable()
  263. {
  264.     pushfl
  265.     cli
  266. }
  267.  
  268. asm     int intr_restore()
  269. {
  270.     popfl
  271. }
  272.  
  273.