diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-03-31 12:57:05 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-05-19 16:11:56 +0200 |
commit | b3c5e41bc05bc622c637d1da75a3c63091e4e789 (patch) | |
tree | 21327a66953e3014359ac8b4fce2e814ed2fdd62 /i386 | |
parent | 8b026d66eb22e1fcf1cb03974606dca991aae392 (diff) |
kern: import `macros.h' from x15
Import the macro definitions from the x15 kernel project, and replace
all similar definitions littered all over the place with it.
Importing this file will make importing code from the x15 kernel
easier. We are already using the red-black tree implementation and
the slab allocator from it, and we will import even more code in the
near future.
* kern/list.h: Do not define `structof', include `macros.h' instead.
* kern/rbtree.h: Likewise.
* kern/slab.c: Do not define `ARRAY_SIZE', include `macros.h' instead.
* i386/grub/misc.h: Likewise.
* i386/i386/xen.h: Do not define `barrier', include `macros.h' instead.
* kern/macro_help.h: Delete file. Replaced by `macros.h'.
* kern/macros.h: New file.
* Makefrag.am (libkernel_a_SOURCES): Add new file, remove old file.
* device/dev_master.h: Adopt accordingly.
* device/io_req.h: Likewise.
* device/net_io.h: Likewise.
* i386/intel/read_fault.c: Likewise.
* ipc/ipc_kmsg.h: Likewise.
* ipc/ipc_mqueue.h: Likewise.
* ipc/ipc_object.h: Likewise.
* ipc/ipc_port.h: Likewise.
* ipc/ipc_space.h: Likewise.
* ipc/ipc_splay.c: Likewise.
* ipc/ipc_splay.h: Likewise.
* kern/assert.h: Likewise.
* kern/ast.h: Likewise.
* kern/pc_sample.h: Likewise.
* kern/refcount.h: Likewise.
* kern/sched.h: Likewise.
* kern/sched_prim.c: Likewise.
* kern/timer.c: Likewise.
* kern/timer.h: Likewise.
* vm/vm_fault.c: Likewise.
* vm/vm_map.h: Likewise.
* vm/vm_object.h: Likewise.
* vm/vm_page.h: Likewise.
Diffstat (limited to 'i386')
-rw-r--r-- | i386/grub/misc.h | 2 | ||||
-rw-r--r-- | i386/i386/xen.h | 2 | ||||
-rw-r--r-- | i386/intel/read_fault.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/i386/grub/misc.h b/i386/grub/misc.h index c6cd456..b71140a 100644 --- a/i386/grub/misc.h +++ b/i386/grub/misc.h @@ -21,6 +21,7 @@ #define GRUB_MISC_HEADER 1 #include <stdarg.h> +#include <kern/macros.h> #include <grub/types.h> #include <grub/symbol.h> #include <grub/err.h> @@ -32,7 +33,6 @@ #define ALIGN_UP_OVERHEAD(addr, align) ((-(addr)) & ((typeof (addr)) (align) - 1)) #define ALIGN_DOWN(addr, align) \ ((addr) & ~((typeof (addr)) align - 1)) -#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) #define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; } #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__) diff --git a/i386/i386/xen.h b/i386/i386/xen.h index 638d671..c681187 100644 --- a/i386/i386/xen.h +++ b/i386/i386/xen.h @@ -21,6 +21,7 @@ #ifdef MACH_XEN #ifndef __ASSEMBLER__ +#include <kern/macros.h> #include <kern/printf.h> #include <mach/machine/vm_types.h> #include <mach/vm_param.h> @@ -32,7 +33,6 @@ #include <xen/public/xen.h> /* TODO: this should be moved in appropriate non-Xen place. */ -#define barrier() __asm__ __volatile__ ("": : :"memory") #define mb() __asm__ __volatile__("lock; addl $0,0(%%esp)":::"memory") #define rmb() mb() #define wmb() mb() diff --git a/i386/intel/read_fault.c b/i386/intel/read_fault.c index 29f4439..4b1edce 100644 --- a/i386/intel/read_fault.c +++ b/i386/intel/read_fault.c @@ -31,7 +31,7 @@ #include <vm/vm_page.h> #include <vm/pmap.h> -#include <kern/macro_help.h> +#include <kern/macros.h> /* * Expansion of vm_fault for read fault in kernel mode. |