# 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
.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:
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
#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;
/* 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 */
#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)
-#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
{
/* Unfortunately not provided by newlib. */
-#include <types.h>
+#include <mini-os/types.h>
static inline uint16_t bswap_16(uint16_t x)
{
return
#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);
#ifndef _ERR_H
#define _ERR_H
-#include <errno.h>
+#include <mini-os/errno.h>
/*
* Kernel pointers have redundant information, so we can use a
#ifndef _ERRNO_H
#define _ERRNO_H
-#include <errno-base.h>
+#include <mini-os/errno-base.h>
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)
#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 *);
#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
#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
{
#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>
#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
#if !defined(__ASSEMBLY__)
-#include <types.h>
+#include <mini-os/types.h>
/*
#ifndef _EFI_H_
#define _EFI_H_
-#include "types.h"
+#include <mini-os/types.h>
#define EFIWARN(a) (a)
#if !defined(_ENDIAN_H_)
#define _ENDIAN_H_
-#include "types.h"
+#include <mini-os/types.h>
#if !defined(__ASSEMBLY__)
#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>
#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. */
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]))
#ifndef _LINUX_TYPES_H_
#define _LINUX_TYPES_H_
-#include <types.h>
+#include <mini-os/types.h>
typedef u64 __u64;
#endif /* _LINUX_TYPES_H_ */
#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
-#include <wait.h>
+#include <mini-os/wait.h>
#ifdef HAVE_LWIP
#include <lwip/netif.h>
#endif
-#include <types.h>
+#include <mini-os/types.h>
#include <xen/io/pciif.h>
struct pcifront_dev;
struct pcifront_dev *init_pcifront(char *nodename);
#ifndef _POSIX_LIMITS_H
#define _POSIX_LIMITS_H
-#include <arch_limits.h>
+#include <mini-os/arch_limits.h>
#define CHAR_BIT 8
#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 */
#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
#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
{
#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
#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
} spinlock_t;
-#include "arch_spinlock.h"
+#include <mini-os/arch_spinlock.h>
#define SPINLOCK_MAGIC 0xdead4ead
/* 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 {
#ifndef _MINIOS_TIME_H_
#define _MINIOS_TIME_H_
-#include <types.h>
+#include <mini-os/types.h>
/*
* System Time
#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 = { \
#ifndef __WAITTYPE_H__
#define __WAITTYPE_H__
-#include <list.h>
+#include <mini-os/list.h>
struct thread;
struct wait_queue
#ifndef __ARCH_SCHED_H__
#define __ARCH_SCHED_H__
-#include <arch_limits.h>
+#include "arch_limits.h"
static inline struct thread* get_current(void)
{
#ifndef __ARCH_ASM_SPINLOCK_H
#define __ARCH_ASM_SPINLOCK_H
-#include <lib.h>
+#include <mini-os/lib.h>
#include "os.h"
#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))
#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)
#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)