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_irq_owner,4
  5. ;arg1 - irq
  6.   mov   edx,ebx
  7.   mov   eax,41
  8.   mov   ebx,[esp+4]
  9.   int   0x40
  10.   mov   ebx,edx
  11.   ret   4
  12.  
  13. public_stdcall _ksys_get_data_read_by_irq,12
  14. ;arg1 - irq
  15. ;arg2 - *size
  16. ;arg3 - data
  17.   mov   edx,ebx
  18.   mov   eax,42
  19.   mov   ebx,[esp+4]
  20.   int   0x40
  21.   cmp   ecx,2
  22.   jz    .not_an_owner
  23.   push  ecx
  24.   mov   ecx,[esp+16]
  25.   test  ecx,ecx
  26.   jz    .ignore_data
  27.   mov   [ecx],bl
  28. .ignore_data:    
  29.   mov   ecx,[esp+12]
  30.   mov   [ecx],eax
  31.   pop   eax
  32.   mov   ebx,edx
  33.   ret   12
  34. .not_an_owner:
  35.   mov   eax,2
  36.   mov   ebx,edx
  37.   ret
  38.  
  39. public_stdcall _ksys_send_data_to_device,8
  40. ;arg1 - port
  41. ;arg2 - data
  42.   mov   edx,ebx
  43.   mov   eax,63
  44.   mov   ebx,[esp+8]
  45.   mov   ecx,[esp+4]
  46.   int   0x40
  47.   mov   ebx,edx
  48.   ret   8
  49.  
  50. public_stdcall _ksys_receive_data_from_device,8
  51. ;arg1 - port
  52. ;arg2 - data
  53.   mov   edx,ebx
  54.   mov   eax,43
  55.   mov   ecx,[esp+4]
  56.   add   ecx,0x80000000
  57.   int   0x40
  58.   mov   ecx,[esp+8]
  59.   mov   [ecx],bl
  60.   mov   ebx,edx
  61.   ret   8
  62.  
  63. public_stdcall _ksys_program_irq,8
  64. ;arg1 - intrtable
  65. ;arg2 - irq
  66.   mov   edx,ebx
  67.   mov   eax,44
  68.   mov   ebx,[esp+4]
  69.   mov   ecx,[esp+8]
  70.   int   0x40
  71.   mov   ebx,edx
  72.   ret   8
  73.  
  74. public_stdcall _ksys_reserve_irq,4
  75. ;arg1 - irq
  76.   mov   edx,ebx
  77.   mov   eax,45
  78.   xor   ebx,ebx
  79.   mov   ecx,[esp+4]
  80.   int   0x40
  81.   mov   ebx,edx
  82.   ret   4
  83.  
  84. public_stdcall _ksys_free_irq,4
  85. ;arg1 - irq
  86.   mov   edx,ebx
  87.   mov   eax,45
  88.   xor   ebx,ebx
  89.   inc   ebx
  90.   mov   ecx,[esp+4]
  91.   int   0x40
  92.   mov   ebx,edx
  93.   ret   4
  94.  
  95. public_stdcall _ksys_reserve_port_area,8
  96. ;arg1 - start
  97. ;arg2 - end
  98.   push  ebx
  99.   mov   eax,46    
  100.   xor   ebx,ebx
  101.   mov   ecx,[esp+8]
  102.   mov   edx,[esp+12]
  103.   int   0x40
  104.   pop   ebx
  105.   ret   8
  106.  
  107. public_stdcall _ksys_free_port_area,8
  108. ;arg1 - start
  109. ;arg2 - end
  110.   push  ebx
  111.   mov   eax,46
  112.   xor   ebx,ebx
  113.   inc   ebx
  114.   mov   ecx,[esp+8]
  115.   mov   edx,[esp+12]
  116.   int   0x40
  117.   pop   ebx
  118.   ret   8
  119.