mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
baremetal aarch64: error on unexpected interrupt
This commit is contained in:
@@ -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
4
lkmc.h
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user