Subversion Repositories Kolibri OS

Rev

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

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