aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2015-12-04 14:36:23 -0800
committerLuis R. Rodriguez <mcgrof@kernel.org>2016-02-11 08:42:16 -0800
commit5311211ce3367039cc90a97053ed6c52c794e3e9 (patch)
tree831a2c85366e30492da746924244aed6d383f8e9
parent373e2ea4a0176319158d868617a98aa0fceb10b8 (diff)
downloadlinker-tables-5311211ce3367039cc90a97053ed6c52c794e3e9.tar.gz
include: use Linux header paths
Again, another thing to make it easier to test / exchange code with upstream as it evolves. Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
-rw-r--r--.gitignore1
-rw-r--r--Makefile1
-rw-r--r--README7
-rw-r--r--alpha.c4
-rw-r--r--arch/x86/include/asm/boot/boot.h (renamed from setup.h)0
-rw-r--r--arch/x86/include/asm/bootparam.h (renamed from bootparam.h)0
-rw-r--r--arch/x86/include/asm/x86.h (renamed from x86.h)0
-rw-r--r--arch/x86/include/asm/x86_init_fn.h (renamed from x86_init_fn.h)7
-rw-r--r--beta.c4
-rw-r--r--driver.c9
-rw-r--r--include/linux/kasan.h (renamed from kasan.h)0
-rw-r--r--include/linux/kernel.h (renamed from kernel.h)1
-rw-r--r--include/linux/pci.h3
-rw-r--r--include/linux/start_kernel.h (renamed from start_kernel.h)0
-rw-r--r--include/linux/string.h6
-rw-r--r--include/linux/tables.h (renamed from tables.h)0
-rw-r--r--include/linux/types.h7
-rw-r--r--include/xen/xen.h (renamed from xen.h)0
-rw-r--r--init.c10
-rw-r--r--kasan.c8
-rw-r--r--main.c9
-rw-r--r--memory.c2
-rw-r--r--pci.c11
-rw-r--r--pci.h1
-rw-r--r--sort-init.c7
-rw-r--r--start_kernel.c4
-rw-r--r--x86.c18
-rw-r--r--xen-driver.c8
-rw-r--r--xen.c7
29 files changed, 74 insertions, 61 deletions
diff --git a/.gitignore b/.gitignore
index b47ec86..37a5790 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
main
*.o
*.swp
+parse-bzimage
diff --git a/Makefile b/Makefile
index e91be87..3f92057 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
CFLAGS += -O2 -g
CFLAGS += -std=gnu99 -Wall -Werror
+CFLAGS += -I include/ -I arch/x86/include/
CFLAGS +=-Wl,-Tcustom.lds.S
diff --git a/README b/README
index 50a8591..4f43450 100644
--- a/README
+++ b/README
@@ -117,3 +117,10 @@ size of all table init structures.
For now each subsystem must then define its own sorting scheme. A sorting
algorithm is only necessary if the linker script sorting does not suffice
for the semantics of the subsystem.
+
+File mapping upstream
+=====================
+
+In case this project maintains a matching with upstream this project strives
+to maintain a one to one direct mapping as things are or we hope would
+be on upstream Linux.
diff --git a/alpha.c b/alpha.c
index acbda71..1130def 100644
--- a/alpha.c
+++ b/alpha.c
@@ -1,8 +1,8 @@
#include <stdio.h>
#include <unistd.h>
-#include "x86_init_fn.h"
-#include "kernel.h"
+#include <linux/kernel.h>
+#include <asm/x86_init_fn.h>
static void early_init_alpha(void) {
}
diff --git a/setup.h b/arch/x86/include/asm/boot/boot.h
index af91b94..af91b94 100644
--- a/setup.h
+++ b/arch/x86/include/asm/boot/boot.h
diff --git a/bootparam.h b/arch/x86/include/asm/bootparam.h
index a7ef342..a7ef342 100644
--- a/bootparam.h
+++ b/arch/x86/include/asm/bootparam.h
diff --git a/x86.h b/arch/x86/include/asm/x86.h
index 974ea97..974ea97 100644
--- a/x86.h
+++ b/arch/x86/include/asm/x86.h
diff --git a/x86_init_fn.h b/arch/x86/include/asm/x86_init_fn.h
index 42aab41..9b4db23 100644
--- a/x86_init_fn.h
+++ b/arch/x86/include/asm/x86_init_fn.h
@@ -1,12 +1,11 @@
#ifndef __X86_INIT_TABLES_H
#define __X86_INIT_TABLES_H
-#include <stdbool.h>
#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/tables.h>
-#include "kernel.h"
-#include "tables.h"
-#include "bootparam.h"
+#include <asm/bootparam.h>
/**
* struct x86_init_fn - x86 generic kernel init call
diff --git a/beta.c b/beta.c
index 6763816..8646c0d 100644
--- a/beta.c
+++ b/beta.c
@@ -1,8 +1,8 @@
#include <stdio.h>
#include <unistd.h>
-#include "x86_init_fn.h"
-#include "kernel.h"
+#include <linux/kernel.h>
+#include <asm/x86_init_fn.h>
static void early_init_beta(void) {
}
diff --git a/driver.c b/driver.c
index 880f29b..c506b9b 100644
--- a/driver.c
+++ b/driver.c
@@ -1,9 +1,6 @@
-#include <stdio.h>
-#include <unistd.h>
-
-#include "x86_init_fn.h"
-#include "pci.h"
-#include "kernel.h"
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <asm/x86_init_fn.h>
static void early_init_driver(void) {
sleep(2);
diff --git a/kasan.h b/include/linux/kasan.h
index c30a087..c30a087 100644
--- a/kasan.h
+++ b/include/linux/kasan.h
diff --git a/kernel.h b/include/linux/kernel.h
index 9ffc05c..c91fdeb 100644
--- a/kernel.h
+++ b/include/linux/kernel.h
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <unistd.h>
#define BIT(nr) (1UL << (nr))
diff --git a/include/linux/pci.h b/include/linux/pci.h
new file mode 100644
index 0000000..7f7f560
--- /dev/null
+++ b/include/linux/pci.h
@@ -0,0 +1,3 @@
+#include <linux/types.h>
+
+bool detect_pci(void);
diff --git a/start_kernel.h b/include/linux/start_kernel.h
index 5c2cb9a..5c2cb9a 100644
--- a/start_kernel.h
+++ b/include/linux/start_kernel.h
diff --git a/include/linux/string.h b/include/linux/string.h
new file mode 100644
index 0000000..26b1615
--- /dev/null
+++ b/include/linux/string.h
@@ -0,0 +1,6 @@
+#ifndef __LINUX_USER_STRING_H
+#define __LINUX_USER_STRING_H
+
+#include <string.h> /* for memmove */
+
+#endif /* __LINUX_USER_STRING_H */
diff --git a/tables.h b/include/linux/tables.h
index 6fa9174..6fa9174 100644
--- a/tables.h
+++ b/include/linux/tables.h
diff --git a/include/linux/types.h b/include/linux/types.h
new file mode 100644
index 0000000..86b1d23
--- /dev/null
+++ b/include/linux/types.h
@@ -0,0 +1,7 @@
+#ifndef __LINUX_USER_TYPES_H
+#define __LINUX_USER_TYPES_H
+
+#include_next <linux/types.h>
+#include <stdbool.h>
+
+#endif /* __LINUX_USER_TYPES_H */
diff --git a/xen.h b/include/xen/xen.h
index 2201e97..2201e97 100644
--- a/xen.h
+++ b/include/xen/xen.h
diff --git a/init.c b/init.c
index 566e279..03f4367 100644
--- a/init.c
+++ b/init.c
@@ -1,10 +1,6 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "kernel.h"
-#include "x86_init_fn.h"
-#include "setup.h"
+#include <linux/kernel.h>
+#include <asm/x86_init_fn.h>
+#include <asm/boot/boot.h>
static bool x86_init_supports_subarch(struct x86_init_fn *fn)
{
diff --git a/kasan.c b/kasan.c
index 92f0e6f..bb85728 100644
--- a/kasan.c
+++ b/kasan.c
@@ -1,9 +1,11 @@
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
-#include "x86_init_fn.h"
-#include "kernel.h"
-#include "bootparam.h"
+
+#include <linux/kernel.h>
+
+#include <asm/x86_init_fn.h>
+#include <asm/bootparam.h>
void kasan_early_init(void) {
pr_info("Early init for Kasan...\n");
diff --git a/main.c b/main.c
index 9e74da9..c0b1f4c 100644
--- a/main.c
+++ b/main.c
@@ -1,8 +1,7 @@
-#include <string.h>
-
-#include "x86.h"
-#include "xen.h"
-#include "bootparam.h"
+#include <linux/string.h>
+#include <xen/xen.h>
+#include <asm/x86.h>
+#include <asm/bootparam.h>
struct boot_params boot_params __attribute__((aligned(16)));
diff --git a/memory.c b/memory.c
index 6206ce0..7a63fab 100644
--- a/memory.c
+++ b/memory.c
@@ -2,7 +2,7 @@
#include <unistd.h>
#include <errno.h>
-#include "x86_init_fn.h"
+#include <asm/x86_init_fn.h>
static void early_init_memory(void) {
sleep(1);
diff --git a/pci.c b/pci.c
index f40b82e..7dadadc 100644
--- a/pci.c
+++ b/pci.c
@@ -1,11 +1,8 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
+#include <linux/tables.h>
+#include <asm/x86_init_fn.h>
+#include <asm/bootparam.h>
-#include "tables.h"
-#include "x86_init_fn.h"
-#include "pci.h"
-#include "bootparam.h"
+#include <linux/pci.h>
void early_init_pci(void) {
sleep(1);
diff --git a/pci.h b/pci.h
deleted file mode 100644
index 2360bee..0000000
--- a/pci.h
+++ /dev/null
@@ -1 +0,0 @@
-bool detect_pci(void);
diff --git a/sort-init.c b/sort-init.c
index 3450a4b..aee2696 100644
--- a/sort-init.c
+++ b/sort-init.c
@@ -1,6 +1,7 @@
-#include <stdio.h> /* for NULL and pr_info */
-#include <string.h> /* for memmove */
-#include "x86_init_fn.h"
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <asm/x86_init_fn.h>
#define DEBUG 1
diff --git a/start_kernel.c b/start_kernel.c
index a409926..9345f5b 100644
--- a/start_kernel.c
+++ b/start_kernel.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdbool.h>
-#include "x86_init_fn.h"
-#include "x86.h"
+#include <asm/x86_init_fn.h>
+#include <asm/x86.h>
void start_kernel(void)
{
diff --git a/x86.c b/x86.c
index 2d1cfda..c5ed512 100644
--- a/x86.c
+++ b/x86.c
@@ -1,13 +1,11 @@
-#include <stdio.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <errno.h>
-#include "tables.h"
-#include "x86_init_fn.h"
-#include "start_kernel.h"
-#include "kasan.h"
-#include "setup.h"
-#include "bootparam.h"
+#include <linux/tables.h>
+
+#include <asm/x86_init_fn.h>
+#include <asm/boot/boot.h>
+#include <asm/bootparam.h>
+
+#include <linux/start_kernel.h>
+#include <linux/kasan.h>
extern struct x86_init_fn __tbl_x86_start_init_fns[], __tbl_x86_end_init_fns[];
diff --git a/xen-driver.c b/xen-driver.c
index f30d1c4..e81042d 100644
--- a/xen-driver.c
+++ b/xen-driver.c
@@ -1,9 +1,7 @@
-#include <stdio.h>
-#include <unistd.h>
+#include <asm/x86_init_fn.h>
-#include "x86_init_fn.h"
-#include "pci.h"
-#include "xen.h"
+#include <linux/pci.h>
+#include <xen/xen.h>
static void early_xen_init_driver(void) {
sleep(2);
diff --git a/xen.c b/xen.c
index 1188119..da385eb 100644
--- a/xen.c
+++ b/xen.c
@@ -1,8 +1,9 @@
#include <stdio.h>
#include <stdbool.h>
-#include "x86_init_fn.h"
-#include "tables.h"
-#include "x86.h"
+
+#include <linux/tables.h>
+#include <asm/x86_init_fn.h>
+#include <asm/x86.h>
extern struct x86_init_fn __tbl_x86_start_init_fns[], __tbl_x86_end_init_fns[];