baremetal aarch64: error on unexpected interrupt

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-02-20 00:00:07 +00:00
parent 9db854871c
commit 48778ccd9c
2 changed files with 10 additions and 8 deletions

View File

@@ -21,12 +21,10 @@ mystart:
LKMC_VECTOR_TABLE LKMC_VECTOR_TABLE
/* Default trap handler that does nothing. /* Default trap handler. */
*
* Weak means that if any other file defines it as a non-weak global,
* that one will take precedence.
*
* We need this one to not get undefined references.
*/
LKMC_WEAK(lkmc_vector_trap_handler) LKMC_WEAK(lkmc_vector_trap_handler)
ret ldr x0, =lkmc_vector_trap_handler_error
bl puts
bl lkmc_assert_fail
lkmc_vector_trap_handler_error:
.asciz "error: unexpected interrupt"

4
lkmc.h
View File

@@ -22,6 +22,10 @@ bool lkmc_vector_equal(size_t n, double *v1, double *v2, double max_err);
.global name; \ .global name; \
name: name:
/* Weak means that if any other file defines it as a non-weak global,
* that one will take precedence:
* https://stackoverflow.com/questions/274753/how-to-make-weak-linking-work-with-gcc/54601464#54601464
*/
#define LKMC_WEAK(name) \ #define LKMC_WEAK(name) \
.weak name; \ .weak name; \
name: name: