Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. format ELF
  2. section '.text' executable
  3. public _msys_get_pci_version
  4. _msys_get_pci_version:
  5.   mov   edx,ebx
  6.   mov   eax,62
  7.   xor   ebx,ebx
  8.   int   0x40
  9.   movzx eax,ax
  10.   mov   ebx,edx
  11.   ret
  12.  
  13. public _msys_get_last_pci_bus
  14. _msys_get_last_pci_bus:
  15.   mov   edx,ebx
  16.   mov   eax,62
  17.   xor   ebx,ebx
  18.   inc   ebx
  19.   int   0x40
  20.   movzx eax,al
  21.   mov   ebx,edx
  22.   ret  
  23.  
  24. public _msys_get_pci_access_mechanism
  25. _msys_get_pci_access_mechanism:
  26.   mov   edx,ebx
  27.   mov   eax,62
  28.   mov   ebx,2
  29.   int   0x40
  30.   movzx eax,al  
  31.   mov   ebx,edx
  32.   ret
  33.  
  34. public _msys_pci_read_config_byte
  35. _msys_pci_read_config_byte:
  36. ;arg1 - bus
  37. ;arg2 - dev
  38. ;arg3 - fn
  39. ;arg4 - reg
  40.   mov   edx,ebx
  41.   mov   eax,62
  42.   mov   bl,4
  43.   mov   bh,[esp+4]
  44.   mov   ch,[esp+8]
  45.   shl   ch,3
  46.   add   ch,[esp+12]
  47.   mov   cl,[esp+16]
  48.   int   0x40
  49.   mov   ebx,edx
  50.   ret   16
  51.  
  52. public _msys_pci_read_config_word
  53. _msys_pci_read_config_word:
  54. ;arg1 - bus
  55. ;arg2 - dev
  56. ;arg3 - fn
  57. ;arg4 - reg
  58.   mov   edx,ebx
  59.   mov   eax,62
  60.   mov   bl,5
  61.   mov   bh,[esp+4]
  62.   mov   ch,[esp+8]
  63.   shl   ch,3
  64.   add   ch,[esp+12]
  65.   mov   cl,[esp+16]
  66.   int   0x40
  67.   mov   ebx,edx
  68.   ret   16
  69.  
  70. public _msys_pci_read_config_dword
  71. _msys_pci_read_config_dword:
  72. ;arg1 - bus
  73. ;arg2 - dev
  74. ;arg3 - fn
  75. ;arg4 - reg
  76.   mov   edx,ebx
  77.   mov   eax,62
  78.   mov   bl,6
  79.   mov   bh,[esp+4]
  80.   mov   ch,[esp+8]
  81.   shl   ch,3
  82.   add   ch,[esp+12]
  83.   mov   cl,[esp+16]
  84.   int   0x40
  85.   mov   ebx,edx
  86.   ret   16
  87.  
  88. public _msys_pci_write_config_byte
  89. _msys_pci_write_config_byte:
  90. ;arg1 - bus
  91. ;arg2 - dev
  92. ;arg3 - fn
  93. ;arg4 - reg
  94. ;arg5 - value
  95.   push  ebx
  96.   mov   eax,62
  97.   mov   bl,8
  98.   mov   bh,[esp+8]
  99.   mov   ch,[esp+12]
  100.   shl   ch,3
  101.   mov   ch,[esp+16]
  102.   mov   cl,[esp+20]
  103.   movzx edx,byte [esp+24]
  104.   int   0x40
  105.   pop   ebx
  106.   ret   20
  107.  
  108. public _msys_pci_write_config_word
  109. _msys_pci_write_config_word:
  110. ;arg1 - bus
  111. ;arg2 - dev
  112. ;arg3 - fn
  113. ;arg4 - reg
  114. ;arg5 - value
  115.   push  ebx
  116.   mov   eax,62
  117.   mov   bl,9
  118.   mov   bh,[esp+8]
  119.   mov   ch,[esp+12]
  120.   shl   ch,3
  121.   mov   ch,[esp+16]
  122.   mov   cl,[esp+20]
  123.   movzx edx,word [esp+24]
  124.   int   0x40
  125.   pop   ebx
  126.   ret   20
  127.  
  128. public _msys_pci_write_config_dword
  129. _msys_pci_write_config_dword:
  130. ;arg1 - bus
  131. ;arg2 - dev
  132. ;arg3 - fn
  133. ;arg4 - reg
  134. ;arg5 - value
  135.   push  ebx
  136.   mov   eax,62
  137.   mov   bl,10
  138.   mov   bh,[esp+8]
  139.   mov   ch,[esp+12]
  140.   shl   ch,3
  141.   mov   ch,[esp+16]
  142.   mov   cl,[esp+20]
  143.   mov   edx,[esp+24]
  144.   int   0x40
  145.   pop   ebx
  146.   ret   20