2 * Copyright (c) 2014 Andrew Turner
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #include <machine/asm.h>
29 __FBSDID("$FreeBSD$");
51 ENTRY(generic_bs_rm_1)
52 /* If there is anything to read. */
55 /* Calculate the device address. */
58 * x0 = The device address.
59 * x3 = The kernel address.
72 ENTRY(generic_bs_rm_2)
73 /* If there is anything to read. */
76 /* Calculate the device address. */
79 * x0 = The device address.
80 * x3 = The kernel address.
93 ENTRY(generic_bs_rm_4)
94 /* If there is anything to read. */
97 /* Calculate the device address. */
100 * x0 = The device address.
101 * x3 = The kernel address.
114 ENTRY(generic_bs_rm_8)
115 /* If there is anything to read. */
118 /* Calculate the device address. */
121 * x0 = The device address.
122 * x3 = The kernel address.
135 ENTRY(generic_bs_rr_1)
136 /* Is there is anything to read. */
139 /* Calculate the device address. */
142 * x0 = The device address.
143 * x3 = The kernel address.
156 ENTRY(generic_bs_rr_2)
157 /* Is there is anything to read. */
160 /* Calculate the device address. */
163 * x0 = The device address.
164 * x3 = The kernel address.
177 ENTRY(generic_bs_rr_4)
178 /* Is there is anything to read. */
181 /* Calculate the device address. */
184 * x0 = The device address.
185 * x3 = The kernel address.
198 ENTRY(generic_bs_rr_8)
199 /* Is there is anything to read. */
202 /* Calculate the device address. */
205 * x0 = The device address.
206 * x3 = The kernel address.
220 ENTRY(generic_bs_w_1)
225 ENTRY(generic_bs_w_2)
230 ENTRY(generic_bs_w_4)
235 ENTRY(generic_bs_w_8)
240 ENTRY(generic_bs_wm_1)
241 /* If there is anything to write. */
246 * x0 = The device address.
247 * x3 = The kernel address.
260 ENTRY(generic_bs_wm_2)
261 /* If there is anything to write. */
266 * x0 = The device address.
267 * x3 = The kernel address.
280 ENTRY(generic_bs_wm_4)
281 /* If there is anything to write. */
286 * x0 = The device address.
287 * x3 = The kernel address.
300 ENTRY(generic_bs_wm_8)
301 /* If there is anything to write. */
306 * x0 = The device address.
307 * x3 = The kernel address.
320 ENTRY(generic_bs_wr_1)
321 /* Is there is anything to write. */
326 * x0 = The device address.
327 * x3 = The kernel address.
340 ENTRY(generic_bs_wr_2)
341 /* Is there is anything to write. */
346 * x0 = The device address.
347 * x3 = The kernel address.
360 ENTRY(generic_bs_wr_4)
361 /* Is there is anything to write. */
366 * x0 = The device address.
367 * x3 = The kernel address.
380 ENTRY(generic_bs_wr_8)
381 /* Is there is anything to write. */
386 * x0 = The device address.
387 * x3 = The kernel address.
400 ENTRY(generic_bs_fault)
405 ENTRY(generic_bs_peek_1)
406 .globl generic_bs_peek_1f
408 ldrb w0, [x1, x2] /* Checked instruction */
413 END(generic_bs_peek_1)
415 ENTRY(generic_bs_peek_2)
416 .globl generic_bs_peek_2f
418 ldrh w0, [x1, x2] /* Checked instruction */
423 END(generic_bs_peek_2)
425 ENTRY(generic_bs_peek_4)
426 .globl generic_bs_peek_4f
428 ldr w0, [x1, x2] /* Checked instruction */
433 END(generic_bs_peek_4)
435 ENTRY(generic_bs_peek_8)
436 .globl generic_bs_peek_8f
438 ldr x0, [x1, x2] /* Checked instruction */
443 END(generic_bs_peek_8)
445 ENTRY(generic_bs_poke_1)
446 .globl generic_bs_poke_1f
448 strb w3, [x1, x2] /* Checked instruction */
452 END(generic_bs_poke_1)
454 ENTRY(generic_bs_poke_2)
455 .globl generic_bs_poke_2f
457 strh w3, [x1, x2] /* Checked instruction */
461 END(generic_bs_poke_2)
463 ENTRY(generic_bs_poke_4)
464 .globl generic_bs_poke_4f
466 str w3, [x1, x2] /* Checked instruction */
470 END(generic_bs_poke_4)
472 ENTRY(generic_bs_poke_8)
473 .globl generic_bs_poke_8f
475 str x3, [x1, x2] /* Checked instruction */
479 END(generic_bs_poke_8)