1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2012 by Amaury Pouly
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
27 .section .text.safe_read8
28 .type safe_read8, %function
30 @ bool safe_read8(uint8_t *addr, uint8_t *value)
37 safe_read8_faulty_addr:
52 .size safe_read8, . - safe_read8
54 .section .text.safe_read16
55 .type safe_read16, %function
57 @ bool safe_read16(uint16_t *addr, uint16_t *value)
64 safe_read16_faulty_addr:
79 .size safe_read16, . - safe_read16
81 .section .text.safe_read32
82 .type safe_read32, %function
84 @ bool safe_read32(uint32_t *addr, uint32_t *value)
91 safe_read32_faulty_addr:
106 .size safe_read32, . - safe_read32
108 #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
109 .section .text.data_abort_handler
110 .type data_abort_handler, %function
111 .global data_abort_handler
113 @ store minimal amount of registers
115 @ compute faulty address
117 @ compare to safe_read8
118 ldr r1, =safe_read8_faulty_addr
121 @ compare to safe_read16
122 ldr r1, =safe_read16_faulty_addr
125 @ compare to safe_read32
126 ldr r1, =safe_read32_faulty_addr
129 @ otherwise just normally to UIE
139 @ restore mode and jump back to the *next* instruction
141 .size data_abort_handler, . - data_abort_handler