2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
13 * Those two probe hardware register for presence, trapping bus errors.
14 * inspired by the Linux version, cf.
15 * http://lxr.linux.no/linux+v2.6.27/arch/m68k/mm/hwtest.c
17 * though I'm not sure why the tests are on words only.
18 * Some regs are bytes only and the even byte is unmapped...
19 * but probably ignored.
22 /* extern bool m68k_is_hw_register_readable(addr_t address);
24 FUNCTION(m68k_is_hw_register_readable):
28 /* set our fault vector in the table */
29 move.l #trap_fault_r,fault_vector
31 /* swap our table in */
33 move.l #temp_vectors,%a0
36 /* attempt the access */
41 nop /* flush the pipeline */
48 FUNCTION_END(m68k_is_hw_register_readable)
51 /* extern bool m68k_is_hw_register_writable(addr_t address, uint32 value);
53 FUNCTION(m68k_is_hw_register_writable):
57 /* set our fault vector in the table */
58 move.l #trap_fault_w,fault_vector
60 /* swap our table in */
62 move.l #temp_vectors,%a0
65 /* attempt the access */
71 nop /* flush the pipeline */
78 FUNCTION_END(m68k_is_hw_register_writable)
80 /* scratch data for the 2 functions above */
84 .long 0 /* reset sp */
85 .long 0 /* reset pc */