h_io_assist_asm.S revision 1.1 1 1.1 maxv /*
2 1.1 maxv * Copyright (c) 2019 The NetBSD Foundation, Inc.
3 1.1 maxv * All rights reserved.
4 1.1 maxv *
5 1.1 maxv * This code is derived from software contributed to The NetBSD Foundation
6 1.1 maxv * by Maxime Villard.
7 1.1 maxv *
8 1.1 maxv * Redistribution and use in source and binary forms, with or without
9 1.1 maxv * modification, are permitted provided that the following conditions
10 1.1 maxv * are met:
11 1.1 maxv * 1. Redistributions of source code must retain the above copyright
12 1.1 maxv * notice, this list of conditions and the following disclaimer.
13 1.1 maxv * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 maxv * notice, this list of conditions and the following disclaimer in the
15 1.1 maxv * documentation and/or other materials provided with the distribution.
16 1.1 maxv *
17 1.1 maxv * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 1.1 maxv * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 1.1 maxv * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 1.1 maxv * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 1.1 maxv * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 1.1 maxv * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 1.1 maxv * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 1.1 maxv * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 1.1 maxv * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 1.1 maxv * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 1.1 maxv * POSSIBILITY OF SUCH DAMAGE.
28 1.1 maxv */
29 1.1 maxv
30 1.1 maxv .globl test1_begin, test1_end
31 1.1 maxv .globl test2_begin, test2_end
32 1.1 maxv .globl test3_begin, test3_end
33 1.1 maxv .globl test4_begin, test4_end
34 1.1 maxv .globl test5_begin, test5_end
35 1.1 maxv .globl test6_begin, test6_end
36 1.1 maxv .globl test7_begin, test7_end
37 1.1 maxv .globl test8_begin, test8_end
38 1.1 maxv .globl test9_begin, test9_end
39 1.1 maxv .globl test10_begin, test10_end
40 1.1 maxv .globl test11_begin, test11_end
41 1.1 maxv .globl test12_begin, test12_end
42 1.1 maxv .text
43 1.1 maxv .code64
44 1.1 maxv
45 1.1 maxv #define TEST_END \
46 1.1 maxv movq $0xFFFFFFFFFFFFFFFF,%rcx; \
47 1.1 maxv rdmsr ;
48 1.1 maxv
49 1.1 maxv /*
50 1.1 maxv * IN
51 1.1 maxv */
52 1.1 maxv
53 1.1 maxv .align 64
54 1.1 maxv test1_begin:
55 1.1 maxv movq $0x1000,%rbx
56 1.1 maxv
57 1.1 maxv inb $123
58 1.1 maxv movb %al,(%rbx)
59 1.1 maxv incq %rbx
60 1.1 maxv
61 1.1 maxv movq $123,%rdx
62 1.1 maxv inb %dx
63 1.1 maxv movb %al,(%rbx)
64 1.1 maxv
65 1.1 maxv TEST_END
66 1.1 maxv test1_end:
67 1.1 maxv
68 1.1 maxv .align 64
69 1.1 maxv test2_begin:
70 1.1 maxv movq $0x1000,%rbx
71 1.1 maxv
72 1.1 maxv inw $123
73 1.1 maxv movw %ax,(%rbx)
74 1.1 maxv addq $2,%rbx
75 1.1 maxv
76 1.1 maxv movq $123,%rdx
77 1.1 maxv inw %dx
78 1.1 maxv movw %ax,(%rbx)
79 1.1 maxv
80 1.1 maxv TEST_END
81 1.1 maxv test2_end:
82 1.1 maxv
83 1.1 maxv .align 64
84 1.1 maxv test3_begin:
85 1.1 maxv movq $0x1000,%rbx
86 1.1 maxv
87 1.1 maxv inl $123
88 1.1 maxv movl %eax,(%rbx)
89 1.1 maxv addq $4,%rbx
90 1.1 maxv
91 1.1 maxv movq $123,%rdx
92 1.1 maxv inl %dx
93 1.1 maxv movl %eax,(%rbx)
94 1.1 maxv
95 1.1 maxv TEST_END
96 1.1 maxv test3_end:
97 1.1 maxv
98 1.1 maxv .align 64
99 1.1 maxv test4_begin:
100 1.1 maxv movq $0x1000,%rdi
101 1.1 maxv movq $5,%rcx
102 1.1 maxv
103 1.1 maxv movq $123,%rdx
104 1.1 maxv rep
105 1.1 maxv insb
106 1.1 maxv
107 1.1 maxv TEST_END
108 1.1 maxv test4_end:
109 1.1 maxv
110 1.1 maxv .align 64
111 1.1 maxv test5_begin:
112 1.1 maxv movq $0x1000,%rdi
113 1.1 maxv movq $14,%rcx
114 1.1 maxv
115 1.1 maxv movq $123,%rdx
116 1.1 maxv rep
117 1.1 maxv insw
118 1.1 maxv
119 1.1 maxv TEST_END
120 1.1 maxv test5_end:
121 1.1 maxv
122 1.1 maxv .align 64
123 1.1 maxv test6_begin:
124 1.1 maxv movq $0x1000,%rdi
125 1.1 maxv movq $7,%rcx
126 1.1 maxv
127 1.1 maxv movq $123,%rdx
128 1.1 maxv rep
129 1.1 maxv insl
130 1.1 maxv
131 1.1 maxv TEST_END
132 1.1 maxv test6_end:
133 1.1 maxv
134 1.1 maxv /*
135 1.1 maxv * OUT
136 1.1 maxv */
137 1.1 maxv
138 1.1 maxv .align 64
139 1.1 maxv test7_begin:
140 1.1 maxv movq $0x1000,%rbx
141 1.1 maxv
142 1.1 maxv movb (%rbx),%al
143 1.1 maxv outb $123
144 1.1 maxv incq %rbx
145 1.1 maxv
146 1.1 maxv movb (%rbx),%al
147 1.1 maxv movq $123,%rdx
148 1.1 maxv outb %dx
149 1.1 maxv
150 1.1 maxv TEST_END
151 1.1 maxv test7_end:
152 1.1 maxv
153 1.1 maxv .align 64
154 1.1 maxv test8_begin:
155 1.1 maxv movq $0x1000,%rbx
156 1.1 maxv
157 1.1 maxv movw (%rbx),%ax
158 1.1 maxv outw $123
159 1.1 maxv addq $2,%rbx
160 1.1 maxv
161 1.1 maxv movw (%rbx),%ax
162 1.1 maxv movq $123,%rdx
163 1.1 maxv outw %dx
164 1.1 maxv
165 1.1 maxv TEST_END
166 1.1 maxv test8_end:
167 1.1 maxv
168 1.1 maxv .align 64
169 1.1 maxv test9_begin:
170 1.1 maxv movq $0x1000,%rbx
171 1.1 maxv
172 1.1 maxv movl (%rbx),%eax
173 1.1 maxv outl $123
174 1.1 maxv addq $4,%rbx
175 1.1 maxv
176 1.1 maxv movl (%rbx),%eax
177 1.1 maxv movq $123,%rdx
178 1.1 maxv outl %dx
179 1.1 maxv
180 1.1 maxv TEST_END
181 1.1 maxv test9_end:
182 1.1 maxv
183 1.1 maxv .align 64
184 1.1 maxv test10_begin:
185 1.1 maxv movq $0x1000,%rsi
186 1.1 maxv movq $5,%rcx
187 1.1 maxv
188 1.1 maxv movq $123,%rdx
189 1.1 maxv rep
190 1.1 maxv outsb
191 1.1 maxv
192 1.1 maxv TEST_END
193 1.1 maxv test10_end:
194 1.1 maxv
195 1.1 maxv .align 64
196 1.1 maxv test11_begin:
197 1.1 maxv movq $0x1000,%rsi
198 1.1 maxv movq $8,%rcx
199 1.1 maxv
200 1.1 maxv movq $123,%rdx
201 1.1 maxv rep
202 1.1 maxv outsw
203 1.1 maxv
204 1.1 maxv TEST_END
205 1.1 maxv test11_end:
206 1.1 maxv
207 1.1 maxv .align 64
208 1.1 maxv test12_begin:
209 1.1 maxv movq $0x1000,%rsi
210 1.1 maxv movq $7,%rcx
211 1.1 maxv
212 1.1 maxv movq $123,%rdx
213 1.1 maxv rep
214 1.1 maxv outsl
215 1.1 maxv
216 1.1 maxv TEST_END
217 1.1 maxv test12_end:
218