mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
gdb: create some automated tests with pytest
gem5 baremetal: use m5exit m5op in exit() so as to not force users to apply a patch for almost all examples
This commit is contained in:
@@ -61,6 +61,13 @@ int _write(int file, char *ptr, int len) {
|
||||
|
||||
/* Only 0 is supported for now, arm semihosting cannot handle other values. */
|
||||
void _exit(int status) {
|
||||
#if defined(GEM5)
|
||||
#if defined(__arm__)
|
||||
__asm__ __volatile__ ("mov r0, #0; mov r1, #0; .inst 0xEE000110 | (0x21 << 16);");
|
||||
#elif defined(__aarch64__)
|
||||
__asm__ __volatile__ ("mov x0, #0; .inst 0XFF000110 | (0x21 << 16);");
|
||||
#endif
|
||||
#else
|
||||
#if defined(__arm__)
|
||||
__asm__ __volatile__ ("mov r0, #0x18; ldr r1, =#0x20026; svc 0x00123456");
|
||||
#elif defined(__aarch64__)
|
||||
@@ -76,6 +83,7 @@ void _exit(int status) {
|
||||
"hlt 0xf000\n"
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void assert_fail() {
|
||||
|
||||
Reference in New Issue
Block a user