]> xenbits.xensource.com Git - people/liuw/mini-os.git/commitdiff
stubdom: fixes to compile with qemu-xen
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 10 Jul 2008 13:15:46 +0000 (14:15 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 10 Jul 2008 13:15:46 +0000 (14:15 +0100)
This adds fixes to the stub domain build into compiling Ian Jackson's
qemu-xen.  The most notable change is that mini-os headers now
#include each other through a mini-os/ prefix, so that we can turn all
-I into -isystem and still be sure that we include Mini-OS headers
(and not qemu's console.h or blktaplib's list.h for instance...).

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
38 files changed:
Config.mk
Makefile
include/arch/cc.h
include/arch/sys_arch.h
include/blkfront.h
include/byteswap.h
include/console.h
include/err.h
include/errno.h
include/events.h
include/fbfront.h
include/fs.h
include/hypervisor.h
include/ia64/atomic.h
include/ia64/efi.h
include/ia64/endian.h
include/ia64/hypercall-ia64.h
include/ia64/os.h
include/lib.h
include/linux/types.h
include/mm.h
include/netfront.h
include/pcifront.h
include/posix/limits.h
include/posix/sys/select.h
include/posix/unistd.h
include/sched.h
include/semaphore.h
include/spinlock.h
include/sys/lock.h
include/time.h
include/wait.h
include/waittypes.h
include/x86/arch_sched.h
include/x86/arch_spinlock.h
include/x86/os.h
include/x86/x86_32/hypercall-x86_32.h
include/x86/x86_64/hypercall-x86_64.h

index d802b506f705b286dc2d8aadf7f90cc261f52b8a..a6a738a68f4270a278905c832a1d55222e1dd798 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -38,20 +38,20 @@ EXTRA_INC = $(ARCH_INC)
 # This must be before include minios.mk!
 include $(MINI-OS_ROOT)/$(TARGET_ARCH_DIR)/arch.mk
 
-extra_incl := $(foreach dir,$(EXTRA_INC),-I$(realpath $(MINI-OS_ROOT)/include/$(dir)))
+extra_incl := $(foreach dir,$(EXTRA_INC),-isystem $(realpath $(MINI-OS_ROOT)/include/$(dir)))
 
-DEF_CPPFLAGS += -I$(realpath $(MINI-OS_ROOT)/include)
+DEF_CPPFLAGS += -isystem $(realpath $(MINI-OS_ROOT)/include)
 DEF_CPPFLAGS += -D__MINIOS__
 
 ifeq ($(libc),y)
 DEF_CPPFLAGS += -DHAVE_LIBC
-DEF_CPPFLAGS += -I$(realpath $(MINI-OS_ROOT)/include/posix)
-DEF_CPPFLAGS += -I$(realpath $(XEN_ROOT)/tools/xenstore)
+DEF_CPPFLAGS += -isystem $(realpath $(MINI-OS_ROOT)/include/posix)
+DEF_CPPFLAGS += -isystem $(realpath $(XEN_ROOT)/tools/xenstore)
 endif
 
 ifneq ($(LWIPDIR),)
 lwip=y
 DEF_CPPFLAGS += -DHAVE_LWIP
-DEF_CPPFLAGS += -I$(LWIPDIR)/src/include
-DEF_CPPFLAGS += -I$(LWIPDIR)/src/include/ipv4
+DEF_CPPFLAGS += -isystem $(LWIPDIR)/src/include
+DEF_CPPFLAGS += -isystem $(LWIPDIR)/src/include/ipv4
 endif
index bc55145f3a2c7740a4eed1285e433deb1badd074..5ef4e03811edaf21e78d1d62d15001577142e504 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,8 @@ endif
 .PHONY: links
 links: $(ARCH_LINKS)
        [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
+       [ -e include/mini-os ] || ln -sf . include/mini-os
+       [ -e include/$(TARGET_ARCH_FAM)/mini-os ] || ln -sf . include/$(TARGET_ARCH_FAM)/mini-os
 
 .PHONY: arch_lib
 arch_lib:
@@ -89,7 +91,7 @@ OBJS := $(filter-out $(OBJ_DIR)/daytime.o, $(OBJS))
 endif
 
 $(OBJ_DIR)/$(TARGET)_app.o: $(APP_OBJS) app.lds
-       $(LD) -r -d $(LDFLAGS) $^ $(APP_LDLIBS) --undefined main -o $@
+       $(LD) -r -d $(LDFLAGS) -\( $^ -\) $(APP_LDLIBS) --undefined main -o $@
 
 $(OBJ_DIR)/$(TARGET): links $(OBJS) $(OBJ_DIR)/$(TARGET)_app.o arch_lib
        $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJ_DIR)/$(TARGET)_app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
index 1c31feb7c816d7059bfa8a71767f2eca6cb09ab9..02aeb2f4bd53bc7970ff040dafb43c6a50c93354 100644 (file)
@@ -10,8 +10,8 @@
 #define __LWIP_ARCH_CC_H__
 
 /*   Typedefs for the types used by lwip - */
-#include <os.h>
-#include <types.h>
+#include <mini-os/os.h>
+#include <mini-os/types.h>
 #include <time.h>
 typedef  u8  u8_t;
 typedef  s8  s8_t;
@@ -46,7 +46,7 @@ extern void lwip_die(char *fmt, ...);
 
 /*   If the compiler does not provide memset() this file must include a */
 /*   definition of it, or include a file which defines it. */
-#include <lib.h>
+#include <mini-os/lib.h>
 
 /*   This file must either include a system-local <errno.h> which defines */
 /*   the standard *nix error codes, or it should #define LWIP_PROVIDE_ERRNO */
index 4e911549c93b00404372201121daa97eea4283ee..11d53288960330cf45a933d567c3a498a1a4760c 100644 (file)
@@ -9,9 +9,9 @@
 #ifndef __LWIP_ARCH_SYS_ARCH_H__
 #define __LWIP_ARCH_SYS_ARCH_H__
 
-#include <os.h>
-#include <xmalloc.h>
-#include <semaphore.h>
+#include <mini-os/os.h>
+#include <mini-os/xmalloc.h>
+#include <mini-os/semaphore.h>
 
 typedef struct semaphore *sys_sem_t;
 #define SYS_SEM_NULL ((sys_sem_t) NULL)
index a4e691140fe685b4e650ab445b7232f6d620f406..8cbc0905d3a129b209b66878850979c5cc3a1f59 100644 (file)
@@ -1,6 +1,6 @@
-#include <wait.h>
+#include <mini-os/wait.h>
 #include <xen/io/blkif.h>
-#include <types.h>
+#include <mini-os/types.h>
 struct blkfront_dev;
 struct blkfront_aiocb
 {
index 6d97f78f749b1cdc0cee470a7313cc8254d876f4..46821aefea1fcf46aa22b98f5fcebbfd6e04cdba 100644 (file)
@@ -3,7 +3,7 @@
 
 /* Unfortunately not provided by newlib.  */
 
-#include <types.h>
+#include <mini-os/types.h>
 static inline uint16_t bswap_16(uint16_t x)
 {
     return
index 4a61f1aaa0c67b2c6b6daae961d8bff46ccb111c..e9e516116635e587bc62279c514fa07031ac7a3e 100644 (file)
@@ -36,8 +36,8 @@
 #ifndef _LIB_CONSOLE_H_
 #define _LIB_CONSOLE_H_
 
-#include<os.h>
-#include<traps.h>
+#include<mini-os/os.h>
+#include<mini-os/traps.h>
 #include<stdarg.h>
 
 void print(int direct, const char *fmt, va_list args);
index c329c57d889415539f758d1892f2cb451935434a..4e19619dbe716f95f2f0a4fa7e89bcc772016275 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _ERR_H
 #define _ERR_H
 
-#include <errno.h>
+#include <mini-os/errno.h>
 
 /*
  * Kernel pointers have redundant information, so we can use a
index 5c2b2f8fad8d8c3c25793cc4a432ee452faa3b1f..f71b1311b9e1b239c0e27b70f4dd9df7685f04d8 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _ERRNO_H
 #define _ERRNO_H
 
-#include <errno-base.h>
+#include <mini-os/errno-base.h>
 
 typedef int error_t;
 
@@ -113,7 +113,7 @@ typedef int error_t;
 #define EFTYPE          132     /* Inappropriate file type or format */
 
 #ifdef HAVE_LIBC
-#include <sched.h>
+#include <mini-os/sched.h>
 extern int errno;
 #define ERRNO
 #define errno (get_current()->reent._errno)
index fd708eb5d31d9e723be1132891b51f526cd88d9a..912e4cff091d26c55b2bc16700cac3227c572289 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef _EVENTS_H_
 #define _EVENTS_H_
 
-#include<traps.h>
+#include<mini-os/traps.h>
 #include<xen/event_channel.h>
 
 typedef void (*evtchn_handler_t)(evtchn_port_t, struct pt_regs *, void *);
index 1e4d7ac6d9c9533491e6df695dac137851a75a23..7e29b4c97445b90b6e5a0b1ba950acfc97800544 100644 (file)
@@ -1,6 +1,6 @@
 #include <xen/io/kbdif.h>
 #include <xen/io/fbif.h>
-#include <wait.h>
+#include <mini-os/wait.h>
 
 /* from <linux/input.h> */
 #ifndef BTN_LEFT
index 4c822dfb20cc74a587a0abcc1a9370dfbf094ba3..d60f0c964bcdf7c74b4ddb2fb3f6e749ba93b18e 100644 (file)
@@ -2,8 +2,8 @@
 #define __FS_H__
 
 #include <xen/io/fsif.h>
-#include <semaphore.h>
-#include <types.h>
+#include <mini-os/semaphore.h>
+#include <mini-os/types.h>
 
 struct fs_import 
 {
index 41ef161db1427b33abc548baa93a194ff6b6f37a..b4c7292a47660ec3e449708584c45424ef61ca7d 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef _HYPERVISOR_H_
 #define _HYPERVISOR_H_
 
-#include <types.h>
+#include <mini-os/types.h>
 #include <xen/xen.h>
 #if defined(__i386__)
 #include <hypercall-x86_32.h>
@@ -24,7 +24,7 @@
 #else
 #error "Unsupported architecture"
 #endif
-#include <traps.h>
+#include <mini-os/traps.h>
 
 /*
  * a placeholder for the start of day information passed up from the hypervisor
index b565c14c91e2ac348945773fcf9c3c828ba7ecb4..618ff82abca320f1a61c3f07ba8325efb2af0254 100644 (file)
@@ -38,7 +38,7 @@
 
 #if !defined(__ASSEMBLY__)
 
-#include <types.h>
+#include <mini-os/types.h>
 
 
 /*
index 25396572b6f4dd4567f7dcf8bffde7a99f43e738..b70a0a8e2499436499c0286a88ff62bbfbfd88c2 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef _EFI_H_
 #define _EFI_H_
 
-#include "types.h"
+#include <mini-os/types.h>
 
 
 #define EFIWARN(a)                      (a)
index 18fc7030b6d493a4f019f4e948c576759e8ea338..1d036ffa2984fcc462df88b14a5bf663fe6a5040 100644 (file)
@@ -26,7 +26,7 @@
 #if !defined(_ENDIAN_H_)
 #define _ENDIAN_H_
 
-#include "types.h"
+#include <mini-os/types.h>
 
 
 #if !defined(__ASSEMBLY__)
index bca01b118d8202f23f065446878b757a75a7c874..dbab3d55bf5c4b4720b104e9f8e62602aa1fca3a 100644 (file)
@@ -34,8 +34,8 @@
 #ifndef __HYPERCALL_H__
 #define __HYPERCALL_H__
 
-#include "lib.h"       /* memcpy() */
-#include "errno.h"     /* ENOSYS() */
+#include <mini-os/lib.h>       /* memcpy() */
+#include <mini-os/errno.h>     /* ENOSYS() */
 #include <xen/event_channel.h>
 #include <xen/sched.h>
 #include <xen/version.h>
index bf3785fc825cb71d286c697be17682f36bd6abaf..2cbfa424b721b275d088944268ba073bd825caae 100644 (file)
 
 #if !defined(__ASSEMBLY__)
 
-#include "types.h"
+#include <mini-os/types.h>
 #include "endian.h"
 #include "ia64_cpu.h"
 #include "atomic.h"
 #include "efi.h"
 #include "sal.h"
 #include "pal.h"
-#include "hypervisor.h"
-#include <kernel.h>
+#include <mini-os/hypervisor.h>
+#include <mini-os/kernel.h>
 
 
 typedef uint64_t paddr_t;              /* Physical address. */
index ababf890fbabee9c39f3bb3a427f6313ad076e7d..b508c38f51345a00cff81c5c371a597fe9559119 100644 (file)
@@ -99,13 +99,13 @@ char  *strstr(const char *s1, const char *s2);
 char * strcat(char * dest, const char * src);
 char  *strdup(const char *s);
 #endif
-#include <console.h>
+#include <mini-os/console.h>
 
 #define RAND_MIX 2654435769U
 
 int rand(void);
 
-#include <xenbus.h>
+#include <mini-os/xenbus.h>
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
index f153ce8e422f73b1409fd87d8cfd36076d3c3b7b..978f29e2cb5d9d4b84d2ab6210f407dd63ab4c3f 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef _LINUX_TYPES_H_
 #define _LINUX_TYPES_H_
-#include <types.h>
+#include <mini-os/types.h>
 typedef u64 __u64;
 #endif /* _LINUX_TYPES_H_ */
index 7c8588ccf8f49afec74a3201d2bfb102b2138193..dd7a6ba311ab6f1f4dd7cab833f322e684c0c1e0 100644 (file)
 #error "Unsupported architecture"
 #endif
 
-#include <lib.h>
+#include <mini-os/lib.h>
 
-#include <arch_limits.h>
-#include <arch_mm.h>
+#include <mini-os/arch_limits.h>
+#include <mini-os/arch_mm.h>
 
 #define STACK_SIZE_PAGE_ORDER __STACK_SIZE_PAGE_ORDER
 #define STACK_SIZE __STACK_SIZE
index 681ebf2c0fc2d8ea5cadaa0255fdecc1d0c98daf..2b95da9948a00fab11e36568800c0125af462dce 100644 (file)
@@ -1,4 +1,4 @@
-#include <wait.h>
+#include <mini-os/wait.h>
 #ifdef HAVE_LWIP
 #include <lwip/netif.h>
 #endif
index f09769808d7891e0248296c032bc4933a52070e6..3bb37139a66b1aa042c6336ff26ebf39d6b50f5b 100644 (file)
@@ -1,4 +1,4 @@
-#include <types.h>
+#include <mini-os/types.h>
 #include <xen/io/pciif.h>
 struct pcifront_dev;
 struct pcifront_dev *init_pcifront(char *nodename);
index 5dd0e7d3b17bd3dbf1b9f4284b2dd5f379575266..c45e0399d464d5a5b8f10265169e480711d69230 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _POSIX_LIMITS_H
 #define _POSIX_LIMITS_H
 
-#include <arch_limits.h>
+#include <mini-os/arch_limits.h>
 
 #define CHAR_BIT        8
 
index 5132c512245cca0b697cd8c71380010cf6648544..a9337be4fc3e9ca46ae1c390e6a142d2096be00f 100644 (file)
@@ -2,6 +2,7 @@
 #define _POSIX_SELECT_H
 
 #include <sys/time.h>
+#include <lwip/sockets.h>
 int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
 
 #endif /* _POSIX_SELECT_H */
index 0cd9396ec99d80a0b7980b47dc4e1fb444e95789..373f07205a4215ab0d1bafc27389855cffb595db 100644 (file)
@@ -2,8 +2,7 @@
 #define _POSIX_UNISTD_H
 
 #include_next <unistd.h>
-#include <sys/select.h>
-#include <arch_limits.h>
+#include <mini-os/arch_limits.h>
 
 #define getpagesize() __PAGE_SIZE
 
index ba0d4e3df9c763f565fd4c4cdd5c463aa13144be..b3dab8dc6c893d8657d44619a1a698b594ce1005 100644 (file)
@@ -1,9 +1,12 @@
 #ifndef __SCHED_H__
 #define __SCHED_H__
 
-#include <list.h>
-#include <time.h>
-#include <arch_sched.h>
+#include <mini-os/list.h>
+#include <mini-os/time.h>
+#include <mini-os/arch_sched.h>
+#ifdef HAVE_LIBC
+#include <sys/reent.h>
+#endif
 
 struct thread
 {
index 19f515a1f162a29b22cd8699e56bc85db1bbcf04..368d09ecb4ece01f1b3d1c4d65cceabd07d518e3 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _SEMAPHORE_H_
 #define _SEMAPHORE_H_
 
-#include <wait.h>
-#include <spinlock.h>
+#include <mini-os/wait.h>
+#include <mini-os/spinlock.h>
 
 /*
  * Implementation of semaphore in Mini-os is simple, because 
index ecfe73627e7bf4c1ddc7e8d81c8764b4dacfb979..70cf20f17abb6657fbd25f97dd3c6b759b233c64 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __ASM_SPINLOCK_H
 #define __ASM_SPINLOCK_H
 
-#include <lib.h>
+#include <mini-os/lib.h>
 
 /*
  * Your basic SMP spinlocks, allowing only a single CPU anywhere
@@ -12,7 +12,7 @@ typedef struct {
 } spinlock_t;
 
 
-#include "arch_spinlock.h"
+#include <mini-os/arch_spinlock.h>
 
 
 #define SPINLOCK_MAGIC 0xdead4ead
index 0757a749ddac371f7bfc17d236c8c4588081a79d..8004536d0250f6f66e61eb43d774f6b1054d2c9d 100644 (file)
@@ -5,7 +5,7 @@
 
 /* Due to inclusion loop, we can not include sched.h, so have to hide things */
 
-#include <waittypes.h>
+#include <mini-os/waittypes.h>
 
 
 typedef struct {
index 250af5c5cf1cfe4c529cd906a6d139627c69ff8c..ac83df855b3bc481a6d0d2d8fb50ea58909fbd0e 100644 (file)
@@ -19,7 +19,7 @@
 
 #ifndef _MINIOS_TIME_H_
 #define _MINIOS_TIME_H_
-#include <types.h>
+#include <mini-os/types.h>
 
 /*
  * System Time
index 6519a4db8953905e705178d3dafc00d53a6ac575..2dc109b4f74ce5e03acc5bdedff20c6d0771bcd6 100644 (file)
@@ -1,9 +1,9 @@
 #ifndef __WAIT_H__
 #define __WAIT_H__
 
-#include <sched.h>
-#include <os.h>
-#include <waittypes.h>
+#include <mini-os/sched.h>
+#include <mini-os/os.h>
+#include <mini-os/waittypes.h>
 
 #define DEFINE_WAIT(name)                               \
 struct wait_queue name = {                              \
index fd5806348f91966fe4952b0242835215216f42f0..326eef0f45c6947d2b29e874fb7d080950644c70 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __WAITTYPE_H__
 #define __WAITTYPE_H__
 
-#include <list.h>
+#include <mini-os/list.h>
 
 struct thread;
 struct wait_queue
index d80323cd379d390b8d04ad42b1d4697825cd68f1..b494ecaf4a0ec1d8cf146150d1743251742077e0 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef __ARCH_SCHED_H__
 #define __ARCH_SCHED_H__
 
-#include <arch_limits.h>
+#include "arch_limits.h"
 
 static inline struct thread* get_current(void)
 {
index 59c2fb9b265c7268e040254176372e94b7c3008c..4b8faf75a8ca5a00271e6072b8df3178512f78d9 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef __ARCH_ASM_SPINLOCK_H
 #define __ARCH_ASM_SPINLOCK_H
 
-#include <lib.h>
+#include <mini-os/lib.h>
 #include "os.h"
 
 
index 39faa0395d9d0bdedc6df949c246a59b05f55b73..248105f13cae75e58dcc93f33648e3ec6f814421 100644 (file)
@@ -16,9 +16,9 @@
 
 
 #ifndef __ASSEMBLY__
-#include <types.h>
-#include <hypervisor.h>
-#include <kernel.h>
+#include <mini-os/types.h>
+#include <mini-os/hypervisor.h>
+#include <mini-os/kernel.h>
 
 #define USED    __attribute__ ((used))
 
index e11010b4131170f08eb60ba91a7746a3a7b435d6..d5f5b1e713c651f44484a0f5a07ec754b858ad95 100644 (file)
@@ -33,7 +33,7 @@
 #include <xen/xen.h>
 #include <xen/sched.h>
 #include <xen/nmi.h>
-#include <mm.h>
+#include <mini-os/mm.h>
 
 #define __STR(x) #x
 #define STR(x) __STR(x)
index 179b776ed52703c833cc85fa9ae5f22d45b5af87..32ea5bd611abb8d35a29f46f3106ea46c175a317 100644 (file)
@@ -36,7 +36,7 @@
 
 #include <xen/xen.h>
 #include <xen/sched.h>
-#include <mm.h>
+#include <mini-os/mm.h>
 
 #define __STR(x) #x
 #define STR(x) __STR(x)