This source file includes following definitions.
- outb
- inb
- outw
- inw
- outl
- inl
- dr6
- dr0
- dr1
- dr2
- dr3
- dr_addr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #include <machine/asm.h>
30 #define S_ARG0 4(%esp)
31 #define S_ARG1 8(%esp)
32 #define S_ARG2 12(%esp)
33 #define S_ARG3 16(%esp)
34 #define B_ARG0 8(%ebp)
35 #define B_ARG1 12(%ebp)
36 #define B_ARG2 16(%ebp)
37 #define B_ARG3 20(%ebp)
38
39
40
41
42
43
44 ENTRY(outb)
45 movl S_ARG0,%edx
46 movl S_ARG1,%eax
47 outb %al,%dx
48 ret
49
50
51
52
53
54 ENTRY(inb)
55 movl S_ARG0,%edx
56 xor %eax,%eax
57 inb %dx,%al
58 ret
59
60
61
62
63
64
65 ENTRY(outw)
66 movl S_ARG0,%edx
67 movl S_ARG1,%eax
68 outw %ax,%dx
69 ret
70
71
72
73
74
75 ENTRY(inw)
76 movl S_ARG0,%edx
77 xor %eax,%eax
78 inw %dx,%ax
79 ret
80
81
82
83
84
85
86 ENTRY(outl)
87 movl S_ARG0,%edx
88 movl S_ARG1,%eax
89 outl %eax,%dx
90 ret
91
92
93
94
95
96 ENTRY(inl)
97 movl S_ARG0,%edx
98 inl %dx,%eax
99 ret
100 ENTRY(dr6)
101 movl %db6, %eax
102 ret
103
104
105
106
107
108
109
110
111
112
113 ENTRY(dr0)
114 movl S_ARG0, %eax
115 movl %eax,_C_LABEL(dr_addr)
116 movl %eax, %db0
117 movl $0, %ecx
118 jmp 0f
119 ENTRY(dr1)
120 movl S_ARG0, %eax
121 movl %eax,_C_LABEL(dr_addr)+1*4
122 movl %eax, %db1
123 movl $2, %ecx
124 jmp 0f
125 ENTRY(dr2)
126 movl S_ARG0, %eax
127 movl %eax,_C_LABEL(dr_addr)+2*4
128 movl %eax, %db2
129 movl $4, %ecx
130 jmp 0f
131 ENTRY(dr3)
132 movl S_ARG0, %eax
133 movl %eax,_C_LABEL(dr_addr)+3*4
134 movl %eax, %db3
135 movl $6, %ecx
136 0:
137 pushl %ebp
138 movl %esp, %ebp
139 movl %db7, %edx
140 movl %edx,_C_LABEL(dr_addr)+4*4
141 andl dr_msk(,%ecx,2),%edx
142 movl %edx,_C_LABEL(dr_addr)+5*4
143 movzbl B_ARG3, %eax
144 andb $3, %al
145 shll %cl, %eax
146 orl %eax, %edx
147 movzbl B_ARG1, %eax
148 andb $3, %al
149 add $0x10, %ecx
150 shll %cl, %eax
151 orl %eax, %edx
152 movzbl B_ARG2, %eax
153 andb $3, %al
154 add $0x2, %ecx
155 shll %cl, %eax
156 orl %eax, %edx
157 movl %edx, %db7
158 movl %edx,_C_LABEL(dr_addr)+7*4
159 movl %edx, %eax
160 leave
161 ret
162 .data
163 dr_msk:
164 .long ~0x000f0003
165 .long ~0x00f0000c
166 .long ~0x0f000030
167 .long ~0xf00000c0
168 ENTRY(dr_addr)
169 .long 0,0,0,0
170 .long 0,0,0,0
171 .text
172