Subversion Repositories Kolibri OS

Rev

Rev 145 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
145 halyavin 1
format ELF
159 halyavin 2
include "public_stdcall.inc"
145 halyavin 3
section '.text' executable
159 halyavin 4
public_stdcall _msys_get_irq_owner,4
145 halyavin 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
 
159 halyavin 13
public_stdcall _msys_get_data_read_by_irq,12
145 halyavin 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
 
159 halyavin 39
public_stdcall _msys_send_data_to_device,8
145 halyavin 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
 
159 halyavin 50
public_stdcall _msys_receive_data_from_device,8
145 halyavin 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
 
159 halyavin 63
public_stdcall _msys_program_irq,8
145 halyavin 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
 
159 halyavin 74
public_stdcall _msys_reserve_irq,4
145 halyavin 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
 
159 halyavin 84
public_stdcall _msys_free_irq,4
145 halyavin 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
 
159 halyavin 95
public_stdcall _msys_reserve_port_area,8
145 halyavin 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
 
159 halyavin 107
public_stdcall _msys_free_port_area,8
145 halyavin 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