mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
baremetal: create an assert_fail C helper
Create a test for it under interactive/assert_fail.c Move prompt under interactive Create baremetal/arch/aarch64/c_from_as.S as an example of calling C functions from assembly.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
enum {
|
||||
@@ -76,3 +77,8 @@ void _exit(int status) {
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
void assert_fail() {
|
||||
puts("lkmc_test_fail");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
4
baremetal/lib/common.h
Normal file
4
baremetal/lib/common.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
void assert_fail();
|
||||
#endif
|
||||
Reference in New Issue
Block a user