Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. format ELF
  2. section '.text' executable
  3. public _msys_get_irq_owner
  4. _msys_get_irq_owner:
  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 _msys_get_data_read_by_irq
  14. _msys_get_data_read_by_irq:
  15. ;arg1 - irq
  16. ;arg2 - *size
  17. ;arg3 - data
  18.   mov   edx,ebx
  19.   mov   eax,42
  20.   mov   ebx,[esp+4]
  21.   int   0x40
  22.   cmp   ecx,2
  23.   jz    .not_an_owner
  24.   push  ecx
  25.   mov   ecx,[esp+16]
  26.   test  ecx,ecx
  27.   jz    .ignore_data
  28.   mov   [ecx],bl
  29. .ignore_data:    
  30.   mov   ecx,[esp+12]
  31.   mov   [ecx],eax
  32.   pop   eax
  33.   mov   ebx,edx
  34.   ret   12
  35. .not_an_owner:
  36.   mov   eax,2
  37.   mov   ebx,edx
  38.   ret
  39.  
  40. public _msys_send_data_to_device
  41. _msys_send_data_to_device:
  42. ;arg1 - port
  43. ;arg2 - data
  44.   mov   edx,ebx
  45.   mov   eax,63
  46.   mov   ebx,[esp+8]
  47.   mov   ecx,[esp+4]
  48.   int   0x40
  49.   mov   ebx,edx
  50.   ret   8
  51.  
  52. public _msys_receive_data_from_device
  53. _msys_receive_data_from_device:  
  54. ;arg1 - port
  55. ;arg2 - data
  56.   mov   edx,ebx
  57.   mov   eax,43
  58.   mov   ecx,[esp+4]
  59.   add   ecx,0x80000000
  60.   int   0x40
  61.   mov   ecx,[esp+8]
  62.   mov   [ecx],bl
  63.   mov   ebx,edx
  64.   ret   8
  65.  
  66. public _msys_program_irq
  67. _msys_program_irq:
  68. ;arg1 - intrtable
  69. ;arg2 - irq
  70.   mov   edx,ebx
  71.   mov   eax,44
  72.   mov   ebx,[esp+4]
  73.   mov   ecx,[esp+8]
  74.   int   0x40
  75.   mov   ebx,edx
  76.   ret   8
  77.  
  78. public _msys_reserve_irq
  79. _msys_reserve_irq:
  80. ;arg1 - irq
  81.   mov   edx,ebx
  82.   mov   eax,45
  83.   xor   ebx,ebx
  84.   mov   ecx,[esp+4]
  85.   int   0x40
  86.   mov   ebx,edx
  87.   ret   4
  88.  
  89. public _msys_free_irq
  90. _msys_free_irq:
  91. ;arg1 - irq
  92.   mov   edx,ebx
  93.   mov   eax,45
  94.   xor   ebx,ebx
  95.   inc   ebx
  96.   mov   ecx,[esp+4]
  97.   int   0x40
  98.   mov   ebx,edx
  99.   ret   4
  100.  
  101. public _msys_reserve_port_area
  102. _msys_reserve_port_area:
  103. ;arg1 - start
  104. ;arg2 - end
  105.   push  ebx
  106.   mov   eax,46    
  107.   xor   ebx,ebx
  108.   mov   ecx,[esp+8]
  109.   mov   edx,[esp+12]
  110.   int   0x40
  111.   pop   ebx
  112.   ret   8
  113.  
  114. public _msys_free_port_area
  115. _msys_free_port_area:
  116. ;arg1 - start
  117. ;arg2 - end
  118.   push  ebx
  119.   mov   eax,46
  120.   xor   ebx,ebx
  121.   inc   ebx
  122.   mov   ecx,[esp+8]
  123.   mov   edx,[esp+12]
  124.   int   0x40
  125.   pop   ebx
  126.   ret   8
  127.