aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2017-10-16 10:32:47 +0100
committerWill Deacon <will.deacon@arm.com>2017-10-16 10:32:47 +0100
commit9fee8cc800d855d73641c5c12e1b266204cb3946 (patch)
tree89e5b42d4d1cf525667693a5660db3ce0d71c51c
parent61483dd12ffeb625f48a6b2fedbf5eb9e1d58d12 (diff)
downloadqrwlock-rmem-9fee8cc800d855d73641c5c12e1b266204cb3946.tar.gz
Got rid of stdlib.h dependency
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--kernel.h3
-rw-r--r--main.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/kernel.h b/kernel.h
index 66ba11e..b2b3789 100644
--- a/kernel.h
+++ b/kernel.h
@@ -5,7 +5,7 @@
#ifndef __KERNEL_H
#define __KERNEL_H
-#include <stdlib.h> /* abort() */
+extern void abort(void);
/* Compiler bits */
#define __branch_check__(x, expect, is_constant) ({ \
@@ -18,6 +18,7 @@
#define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
#define __force
#define __aligned(x) __attribute__((aligned(x)))
+#define __always_inline inline __attribute__((always_inline))
/* Type definitions */
typedef unsigned char u8;
diff --git a/main.c b/main.c
index e71c166..7114add 100644
--- a/main.c
+++ b/main.c
@@ -2,6 +2,11 @@
struct qrwlock lock;
+void abort(void)
+{
+ while (1);
+}
+
int main(void)
{
arch_read_lock(&lock);