mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Factor common userland and baremetal C functions
This allows add.c to run unmodified on both! For that to work, use int main on baremetal, and pass the return value to the final exit.
This commit is contained in:
@@ -7,6 +7,6 @@ main:
|
||||
/* test-gdb-result */
|
||||
cmp x1, #3
|
||||
beq 1f
|
||||
bl assert_fail
|
||||
bl common_assert_fail
|
||||
1:
|
||||
ret
|
||||
|
||||
@@ -12,7 +12,7 @@ main:
|
||||
fmov d3, #4.0
|
||||
fcmp d2, d3
|
||||
beq 1f
|
||||
bl assert_fail
|
||||
bl common_assert_fail
|
||||
1:
|
||||
|
||||
/* Now in 32-bit. */
|
||||
@@ -26,7 +26,7 @@ main:
|
||||
fmov s3, #4.0
|
||||
fcmp s2, s3
|
||||
beq 1f
|
||||
bl assert_fail
|
||||
bl common_assert_fail
|
||||
1:
|
||||
|
||||
/* Higher registers. */
|
||||
@@ -40,6 +40,6 @@ main:
|
||||
/* test-gdb-d31 */
|
||||
fcmp d30, d31
|
||||
beq 1f
|
||||
bl assert_fail
|
||||
bl common_assert_fail
|
||||
1:
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user