summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-09-30 00:42:02 +0200
committerRichard Braun <rbraun@sceen.net>2017-09-30 00:42:02 +0200
commitca45067329704257d094618cdf2418d83053c14f (patch)
treee2f940e09c2e5dad9ff1b78d04b39f034d75cf94
parent5c209f9abd290eaf9b29f98cfd4102ed2a93507f (diff)
Stubs
-rw-r--r--arch/arm/Kconfig19
-rw-r--r--arch/arm/Makefile3
-rw-r--r--arch/arm/configs/qemu_virt_defconfig0
-rw-r--r--arch/arm/machine/atomic.h0
-rw-r--r--arch/arm/machine/boot.c67
-rw-r--r--arch/arm/machine/boot.h58
-rw-r--r--arch/arm/machine/config.h0
-rw-r--r--arch/arm/machine/cpu.c44
-rw-r--r--arch/arm/machine/cpu.h141
-rw-r--r--arch/arm/machine/page.h29
-rw-r--r--arch/arm/machine/pmap.c86
-rw-r--r--arch/arm/machine/pmap.h80
-rw-r--r--arch/arm/machine/pmem.h50
-rw-r--r--arch/arm/machine/strace.c26
-rw-r--r--arch/arm/machine/strace.h35
-rw-r--r--arch/arm/machine/string.h0
-rw-r--r--arch/arm/machine/tcb.c42
-rw-r--r--arch/arm/machine/tcb.h68
-rw-r--r--arch/arm/machine/trap.h23
-rw-r--r--arch/arm/machine/types.h23
-rw-r--r--arch/x86/machine/pmap.c1
-rw-r--r--kern/console.c1
-rw-r--r--kern/init.c1
-rw-r--r--kern/printf.c2
-rw-r--r--kern/sref.c1
-rw-r--r--kern/work.c1
-rw-r--r--vm/vm_page.c2
27 files changed, 803 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
new file mode 100644
index 00000000..9872df73
--- /dev/null
+++ b/arch/arm/Kconfig
@@ -0,0 +1,19 @@
+menu "Architecture-specific options"
+
+config ARM
+ def_bool y
+
+choice
+ prompt "Board"
+ default QEMU_VIRT
+
+config QEMU_VIRT
+ bool "QEMU virtual machine"
+
+endchoice
+
+config SUBARCH
+ string
+ default "armv5tej" if X86_32
+
+endmenu
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
new file mode 100644
index 00000000..921e76d9
--- /dev/null
+++ b/arch/arm/Makefile
@@ -0,0 +1,3 @@
+KCONFIG_DEFCONFIG := qemu_virt_defconfig
+
+#x15_SOURCES-y += \
diff --git a/arch/arm/configs/qemu_virt_defconfig b/arch/arm/configs/qemu_virt_defconfig
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/arch/arm/configs/qemu_virt_defconfig
diff --git a/arch/arm/machine/atomic.h b/arch/arm/machine/atomic.h
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/arch/arm/machine/atomic.h
diff --git a/arch/arm/machine/boot.c b/arch/arm/machine/boot.c
new file mode 100644
index 00000000..d476621a
--- /dev/null
+++ b/arch/arm/machine/boot.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <kern/init.h>
+
+void __init
+boot_log_info(void)
+{
+}
+
+/*
+ * Init operation aliases.
+ */
+
+static int __init
+boot_bootstrap_console(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(boot_bootstrap_console);
+
+static int __init
+boot_setup_console(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(boot_setup_console);
+
+static int __init
+boot_setup_intr(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(boot_load_vm_page_zones);
+
+static int __init
+boot_setup_intr(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(boot_setup_intr);
+
+static int __init
+boot_setup_shutdown(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(boot_setup_shutdown);
diff --git a/arch/arm/machine/boot.h b/arch/arm/machine/boot.h
new file mode 100644
index 00000000..812dd7b5
--- /dev/null
+++ b/arch/arm/machine/boot.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _ARM_BOOT_H
+#define _ARM_BOOT_H
+
+#include <kern/init.h>
+
+/*
+ * Log kernel version and other architecture-specific information.
+ */
+void boot_log_info(void);
+
+/*
+ * This init operation provides :
+ * - all console devices are bootstrapped
+ */
+INIT_OP_DECLARE(boot_bootstrap_console);
+
+/*
+ * This init operation provides :
+ * - all console devices are fully initialized
+ */
+INIT_OP_DECLARE(boot_setup_console);
+
+/*
+ * This init operation provides :
+ * - physical memory has been loaded to the VM system
+ */
+INIT_OP_DECLARE(boot_load_vm_page_zones);
+
+/*
+ * This init operation provides :
+ * - all interrupt controllers have been registered
+ */
+INIT_OP_DECLARE(boot_setup_intr);
+
+/*
+ * This init operation provides :
+ * - all shutdown operations have been registered
+ */
+INIT_OP_DECLARE(boot_setup_shutdown);
+
+#endif /* _ARM_BOOT_H */
diff --git a/arch/arm/machine/config.h b/arch/arm/machine/config.h
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/arch/arm/machine/config.h
diff --git a/arch/arm/machine/cpu.c b/arch/arm/machine/cpu.c
new file mode 100644
index 00000000..a38c948a
--- /dev/null
+++ b/arch/arm/machine/cpu.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <kern/init.h>
+#include <machine/cpu.h>
+
+void cpu_halt_broadcast(void)
+{
+}
+
+void cpu_log_info(const struct cpu *cpu)
+{
+ (void)cpu;
+}
+
+static int __init
+cpu_setup(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(cpu_setup);
+
+static int __init
+cpu_mp_probe(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(cpu_mp_probe);
diff --git a/arch/arm/machine/cpu.h b/arch/arm/machine/cpu.h
new file mode 100644
index 00000000..d6b8e892
--- /dev/null
+++ b/arch/arm/machine/cpu.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _ARM_CPU_H
+#define _ARM_CPU_H
+
+#include <limits.h>
+#include <stdbool.h>
+#include <stdnoreturn.h>
+
+#include <kern/init.h>
+
+/*
+ * L1 cache line size.
+ *
+ * XXX Use this value until processor selection is available.
+ */
+#define CPU_L1_SIZE 32
+
+/*
+ * Data alignment, normally the word size.
+ */
+#define CPU_DATA_ALIGN (LONG_BIT / 8)
+
+struct cpu {
+};
+
+static __always_inline void
+cpu_intr_enable(void)
+{
+}
+
+static __always_inline void
+cpu_intr_disable(void)
+{
+}
+
+static __always_inline void
+cpu_intr_restore(unsigned long flags)
+{
+ (void)flags;
+}
+
+static __always_inline void
+cpu_intr_save(unsigned long *flags)
+{
+ (void)flags;
+}
+
+static __always_inline bool
+cpu_intr_enabled(void)
+{
+ return false;
+}
+
+static __always_inline void
+cpu_pause(void)
+{
+}
+
+static __always_inline void
+cpu_idle(void)
+{
+}
+
+noreturn static __always_inline void
+cpu_halt(void)
+{
+ for (;;);
+}
+
+void cpu_halt_broadcast(void);
+
+#define cpu_local_ptr(var) (&(var))
+
+static inline struct cpu *
+cpu_current(void)
+{
+ return NULL;
+}
+
+static inline unsigned int
+cpu_id(void)
+{
+ return 0;
+}
+
+static inline unsigned int
+cpu_count(void)
+{
+ return 1;
+}
+
+/*
+ * Log processor information.
+ */
+void cpu_log_info(const struct cpu *cpu);
+
+void cpu_mp_setup(void);
+
+static inline void
+cpu_send_xcall(unsigned int cpu)
+{
+ (void)cpu;
+}
+
+static inline void
+cpu_send_thread_schedule(unsigned int cpu)
+{
+ (void)cpu;
+}
+
+/*
+ * This init operation provides :
+ * - initialization of the BSP structure.
+ * - cpu_delay()
+ * - cpu_local_ptr() and cpu_local_var()
+ */
+INIT_OP_DECLARE(cpu_setup);
+
+/*
+ * This init operation provides :
+ * - cpu_count()
+ */
+INIT_OP_DECLARE(cpu_mp_probe);
+
+#endif /* _ARM_CPU_H */
diff --git a/arch/arm/machine/page.h b/arch/arm/machine/page.h
new file mode 100644
index 00000000..6dfadd71
--- /dev/null
+++ b/arch/arm/machine/page.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This file is a top header in the inclusion hierarchy, and shouldn't include
+ * other headers that may cause circular dependencies.
+ */
+
+#ifndef _ARM_PAGE_H
+#define _ARM_PAGE_H
+
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1 << PAGE_SHIFT)
+#define PAGE_MASK (PAGE_SIZE - 1)
+
+#endif /* _ARM_PAGE_H */
diff --git a/arch/arm/machine/pmap.c b/arch/arm/machine/pmap.c
new file mode 100644
index 00000000..aa2516f4
--- /dev/null
+++ b/arch/arm/machine/pmap.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdint.h>
+
+#include <kern/error.h>
+#include <machine/pmap.h>
+#include <machine/types.h>
+
+static int __init
+pmap_bootstrap(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(pmap_bootstrap);
+
+int
+pmap_kextract(uintptr_t va, phys_addr_t *pap)
+{
+ (void)va;
+ (void)pap;
+}
+
+int
+pmap_create(struct pmap **pmapp)
+{
+ (void)pmapp;
+ return ERROR_AGAIN;
+}
+
+int
+pmap_enter(struct pmap *pmap, uintptr_t va, phys_addr_t pa,
+ int prot, int flags)
+{
+ (void)pmap;
+ (void)va;
+ (void)pa;
+ (void)prot;
+ (void)flags;
+ return ERROR_AGAIN;
+}
+
+int
+pmap_remove(struct pmap *pmap, uintptr_t va, const struct cpumap *cpumap)
+{
+ (void)pmap;
+ (void)va;
+ (void)cpumap;
+ return ERROR_AGAIN;
+}
+
+int
+pmap_update(struct pmap *pmap)
+{
+ (void)pmap;
+ return ERROR_AGAIN;
+}
+
+void
+pmap_load(struct pmap *pmap)
+{
+ (void)pmap;
+}
+
+static int __init
+pmap_setup(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(pmap_setup);
diff --git a/arch/arm/machine/pmap.h b/arch/arm/machine/pmap.h
new file mode 100644
index 00000000..3ec6ec92
--- /dev/null
+++ b/arch/arm/machine/pmap.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _ARM_PMAP_H
+#define _ARM_PMAP_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <kern/cpumap.h>
+#include <kern/macros.h>
+#include <machine/types.h>
+
+#define PMAP_START_ADDRESS DECL_CONST(0, UL)
+#define PMAP_END_ADDRESS DECL_CONST(0xc0000000, UL)
+
+#define PMAP_START_KERNEL_ADDRESS PMAP_END_ADDRESS
+#define PMAP_END_KERNEL_ADDRESS DECL_CONST(0xfffff000, UL)
+
+#define PMAP_START_DIRECTMAP_ADDRESS PMAP_END_ADDRESS
+#define PMAP_END_DIRECTMAP_ADDRESS DECL_CONST(0xf8000000, UL)
+
+#define PMAP_START_KMEM_ADDRESS PMAP_END_DIRECTMAP_ADDRESS
+#define PMAP_END_KMEM_ADDRESS PMAP_END_KERNEL_ADDRESS
+
+/*
+ * Mapping creation flags.
+ */
+#define PMAP_PEF_GLOBAL 0x1 /* Create a mapping on all processors */
+
+struct pmap;
+
+static inline struct pmap *
+pmap_get_kernel_pmap(void)
+{
+ return NULL;
+}
+
+int pmap_kextract(uintptr_t va, phys_addr_t *pap);
+
+int pmap_create(struct pmap **pmapp);
+
+int pmap_enter(struct pmap *pmap, uintptr_t va, phys_addr_t pa,
+ int prot, int flags);
+
+int pmap_remove(struct pmap *pmap, uintptr_t va,
+ const struct cpumap *cpumap);
+
+int pmap_update(struct pmap *pmap);
+
+void pmap_load(struct pmap *pmap);
+
+/*
+ * This init operation provides :
+ * - kernel pmap operations
+ */
+INIT_OP_DECLARE(pmap_bootstrap);
+
+/*
+ * This init operation provides :
+ * - user pmap creation
+ * - module fully initialized
+ */
+INIT_OP_DECLARE(pmap_setup);
+
+#endif /* _ARM_PMAP_H */
diff --git a/arch/arm/machine/pmem.h b/arch/arm/machine/pmem.h
new file mode 100644
index 00000000..c3314d75
--- /dev/null
+++ b/arch/arm/machine/pmem.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Physical memory layout.
+ *
+ * This file is a top header in the inclusion hierarchy, and shouldn't include
+ * other headers that may cause circular dependencies.
+ */
+
+#ifndef _ARM_PMEM_H
+#define _ARM_PMEM_H
+
+#include <kern/macros.h>
+
+/*
+ * Zone boundaries.
+ */
+
+#define PMEM_DMA_LIMIT DECL_CONST(0x1000000, UL)
+#define PMEM_DIRECTMAP_LIMIT DECL_CONST(0x38000000, ULL)
+#define PMEM_HIGHMEM_LIMIT DECL_CONST(0xfffff000, UL)
+
+#define PMEM_MAX_ZONES 3
+
+/*
+ * Zone vm_page indexes.
+ */
+
+#define PMEM_ZONE_DMA 0
+#define PMEM_ZONE_DMA32 1
+
+#define PMEM_ZONE_DMA32 1
+#define PMEM_ZONE_DIRECTMAP 1 /* Alias for the DMA32 zone */
+#define PMEM_ZONE_HIGHMEM 2
+
+#endif /* _ARM_PMEM_H */
diff --git a/arch/arm/machine/strace.c b/arch/arm/machine/strace.c
new file mode 100644
index 00000000..9c47a73a
--- /dev/null
+++ b/arch/arm/machine/strace.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <kern/init.h>
+
+static int __init
+strace_setup(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(strace_setup);
diff --git a/arch/arm/machine/strace.h b/arch/arm/machine/strace.h
new file mode 100644
index 00000000..362f7b05
--- /dev/null
+++ b/arch/arm/machine/strace.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Stack tracing.
+ */
+
+#ifndef _ARM_STRACE_H
+#define _ARM_STRACE_H
+
+static inline void
+strace_dump(void)
+{
+}
+
+/*
+ * This init operation provides :
+ * - module fully initialized
+ */
+INIT_OP_DECLARE(strace_setup);
+
+#endif /* _ARM_STRACE_H */
diff --git a/arch/arm/machine/string.h b/arch/arm/machine/string.h
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/arch/arm/machine/string.h
diff --git a/arch/arm/machine/tcb.c b/arch/arm/machine/tcb.c
new file mode 100644
index 00000000..a1695ec1
--- /dev/null
+++ b/arch/arm/machine/tcb.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <kern/init.h>
+#include <machine/tcb.h>
+
+int
+tcb_build(struct tcb *tcb, void *stack, void (*fn)(void *), void *arg)
+{
+ (void)tcb;
+ (void)stack;
+ (void)fn;
+ (void)arg;
+}
+
+void
+tcb_cleanup(struct tcb *tcb)
+{
+ (void)tcb;
+}
+
+static int __init
+tcb_setup(void)
+{
+ return 0;
+}
+
+INIT_OP_DEFINE(tcb_setup);
diff --git a/arch/arm/machine/tcb.h b/arch/arm/machine/tcb.h
new file mode 100644
index 00000000..fc0ae372
--- /dev/null
+++ b/arch/arm/machine/tcb.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Thread control block.
+ */
+
+#ifndef _ARM_TCB_H
+#define _ARM_TCB_H
+
+#include <stdnoreturn.h>
+
+#include <kern/init.h>
+#include <machine/page.h>
+
+/*
+ * Thread stack size.
+ */
+#define TCB_STACK_SIZE PAGE_SIZE
+
+struct tcb {
+};
+
+int tcb_build(struct tcb *tcb, void *stack, void (*fn)(void *), void *arg);
+
+void tcb_cleanup(struct tcb *tcb);
+
+static inline struct tcb *
+tcb_current(void)
+{
+ return NULL;
+}
+
+static inline void
+tcb_set_current(struct tcb *tcb)
+{
+ (void)tcb;
+}
+
+noreturn void tcb_load(struct tcb *tcb);
+
+static inline void
+tcb_switch(struct tcb *prev, struct tcb *next)
+{
+ (void)prev;
+ (void)next;
+}
+
+/*
+ * This init operation provides :
+ * - current TCB handling
+ */
+INIT_OP_DECLARE(tcb_setup);
+
+#endif /* _ARM_TCB_H */
diff --git a/arch/arm/machine/trap.h b/arch/arm/machine/trap.h
new file mode 100644
index 00000000..d29fa41b
--- /dev/null
+++ b/arch/arm/machine/trap.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _ARM_TRAP_H
+#define _ARM_TRAP_H
+
+#define TRAP_INTR_TABLE_SIZE 256
+
+#endif /* _ARM_TRAP_H */
diff --git a/arch/arm/machine/types.h b/arch/arm/machine/types.h
new file mode 100644
index 00000000..e2d72d76
--- /dev/null
+++ b/arch/arm/machine/types.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _ARM_TYPES_H
+#define _ARM_TYPES_H
+
+typedef unsigned long phys_addr_t;
+
+#endif /* _ARM_TYPES_H */
diff --git a/arch/x86/machine/pmap.c b/arch/x86/machine/pmap.c
index 6d424966..fc2c0a0f 100644
--- a/arch/x86/machine/pmap.c
+++ b/arch/x86/machine/pmap.c
@@ -21,6 +21,7 @@
#include <assert.h>
#include <stdalign.h>
#include <stddef.h>
+#include <stdint.h>
#include <string.h>
#include <kern/cpumap.h>
diff --git a/kern/console.c b/kern/console.c
index 0b5c4f86..0ed54b5e 100644
--- a/kern/console.c
+++ b/kern/console.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
+#include <stdio.h>
#include <string.h>
#include <kern/arg.h>
diff --git a/kern/init.c b/kern/init.c
index 6bd48380..da106acd 100644
--- a/kern/init.c
+++ b/kern/init.c
@@ -26,6 +26,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
#include <string.h>
#include <kern/error.h>
diff --git a/kern/printf.c b/kern/printf.c
index 68cf4ba9..29267a6e 100644
--- a/kern/printf.c
+++ b/kern/printf.c
@@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <stdio.h>
+
#include <kern/console.h>
#include <kern/fmt.h>
#include <kern/init.h>
diff --git a/kern/sref.c b/kern/sref.c
index 7775a5c9..051fe4c1 100644
--- a/kern/sref.c
+++ b/kern/sref.c
@@ -44,6 +44,7 @@
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
+#include <stdio.h>
#include <kern/condition.h>
#include <kern/cpumap.h>
diff --git a/kern/work.c b/kern/work.c
index a841d38d..c1bdede1 100644
--- a/kern/work.c
+++ b/kern/work.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <stdalign.h>
#include <stddef.h>
+#include <stdio.h>
#include <kern/bitmap.h>
#include <kern/error.h>
diff --git a/vm/vm_page.c b/vm/vm_page.c
index 7f419b97..a3844662 100644
--- a/vm/vm_page.c
+++ b/vm/vm_page.c
@@ -34,6 +34,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
#include <string.h>
#include <kern/init.h>
@@ -42,6 +43,7 @@
#include <kern/macros.h>
#include <kern/mutex.h>
#include <kern/panic.h>
+#include <kern/printf.h>
#include <kern/shell.h>
#include <kern/thread.h>
#include <machine/boot.h>