aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/mini-os/Makefile53
-rw-r--r--extras/mini-os/arch/x86/traps.c (renamed from extras/mini-os/traps.c)0
-rw-r--r--extras/mini-os/include/hypervisor.h3
-rw-r--r--extras/mini-os/include/types.h4
-rw-r--r--extras/mini-os/include/x86/os.h (renamed from extras/mini-os/include/os.h)0
-rw-r--r--extras/mini-os/include/x86/spinlock.h (renamed from extras/mini-os/include/spinlock.h)0
-rw-r--r--extras/mini-os/include/x86/traps.h (renamed from extras/mini-os/include/traps.h)0
-rw-r--r--extras/mini-os/include/x86/x86_32/hypercall-x86_32.h (renamed from extras/mini-os/include/hypercall-x86_32.h)0
-rw-r--r--extras/mini-os/include/x86/x86_64/hypercall-x86_64.h (renamed from extras/mini-os/include/hypercall-x86_64.h)0
9 files changed, 56 insertions, 4 deletions
diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile
index e53c281c0f..281ae07198 100644
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -11,26 +11,54 @@ override TARGET_ARCH := $(XEN_TARGET_ARCH)
CFLAGS := -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
-override CPPFLAGS := -Iinclude $(CPPFLAGS)
ASFLAGS = -D__ASSEMBLY__
LDLIBS = -L. -lminios
LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
+# For possible special source directories.
+EXTRA_SRC =
+# For possible special header directories.
+EXTRA_INC =
+
+# Standard name for architecture specific subdirectories.
+TARGET_ARCH_DIR = $(TARGET_ARCH)
+# This is used for architecture specific links.
+ARCH_LINKS =
+
ifeq ($(TARGET_ARCH),x86_32)
CFLAGS += -m32 -march=i686
LDFLAGS += -m elf_i386
+TARGET_ARCH_DIR = x86
+EXTRA_INC += $(TARGET_ARCH_DIR)/$(TARGET_ARCH)
+EXTRA_SRC += arch/$(EXTRA_INC)
endif
ifeq ($(TARGET_ARCH)$(pae),x86_32y)
CFLAGS += -DCONFIG_X86_PAE=1
ASFLAGS += -DCONFIG_X86_PAE=1
+TARGET_ARCH_DIR = x86
+EXTRA_INC += $(TARGET_ARCH_DIR)/$(TARGET_ARCH)
+EXTRA_SRC += arch/$(EXTRA_INC)
endif
ifeq ($(TARGET_ARCH),x86_64)
CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
CFLAGS += -fno-asynchronous-unwind-tables
LDFLAGS += -m elf_x86_64
+TARGET_ARCH_DIR = x86
+EXTRA_INC += $(TARGET_ARCH_DIR)/$(TARGET_ARCH)
+EXTRA_SRC += arch/$(EXTRA_INC)
+endif
+
+ifeq ($(TARGET_ARCH),ia64)
+CFLAGS += -mfixed-range=f12-f15,f32-f127
+ASFLAGS += -x assembler-with-cpp -ansi -Wall
+ASFLAGS += -mfixed-range=f12-f15,f32-f127
+ARCH_LINKS = IA64_LINKS # Special link on ia64 needed
+define arch_links
+[ -e include/ia64/asm-xsi-offsets.h ] || ln -sf ../../../../xen/include/asm-ia64/asm-xsi-offsets.h include/ia64/asm-xsi-offsets.h
+endef
endif
ifeq ($(debug),y)
@@ -39,6 +67,10 @@ else
CFLAGS += -O3
endif
+# Add the special header directories to the include paths.
+extra_incl := $(foreach dir,$(EXTRA_INC),-Iinclude/$(dir))
+override CPPFLAGS := -Iinclude $(CPPFLAGS) -Iinclude/$(TARGET_ARCH_DIR) $(extra_incl)
+
TARGET := mini-os
HEAD := $(TARGET_ARCH).o
@@ -46,15 +78,32 @@ OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard console/*.c))
+OBJS += $(patsubst %.S,%.o,$(wildcard arch/$(TARGET_ARCH_DIR)/*.S))
+OBJS += $(patsubst %.c,%.o,$(wildcard arch/$(TARGET_ARCH_DIR)/*.c))
+# For special wanted source directories.
+extra_objs := $(foreach dir,$(EXTRA_SRC),$(patsubst %.c,%.o,$(wildcard $(dir)/*.c)))
+OBJS += $(extra_objs)
+extra_objs := $(foreach dir,$(EXTRA_SRC),$(patsubst %.S,%.o,$(wildcard $(dir)/*.S)))
+OBJS += $(extra_objs)
HDRS := $(wildcard include/*.h)
HDRS += $(wildcard include/xen/*.h)
+HDRS += $(wildcard include/$(TARGET_ARCH_DIR)/*.h)
+# For special wanted header directories.
+extra_heads := $(foreach dir,$(EXTRA_INC),$(wildcard $(dir)/*.h))
+HDRS += $(extra_heads)
.PHONY: default
default: $(TARGET)
+# Create special architecture specific links.
+ifneq ($(ARCH_LINKS),)
+$(ARCH_LINKS):
+ $(arch_links)
+endif
+
.PHONY: links
-links:
+links: $(ARCH_LINKS)
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
libminios.a: links $(OBJS) $(HEAD)
diff --git a/extras/mini-os/traps.c b/extras/mini-os/arch/x86/traps.c
index 292c48b22b..292c48b22b 100644
--- a/extras/mini-os/traps.c
+++ b/extras/mini-os/arch/x86/traps.c
diff --git a/extras/mini-os/include/hypervisor.h b/extras/mini-os/include/hypervisor.h
index f5daa2c315..e3f149e35f 100644
--- a/extras/mini-os/include/hypervisor.h
+++ b/extras/mini-os/include/hypervisor.h
@@ -7,6 +7,7 @@
* Copyright (c) 2002, K A Fraser
* Copyright (c) 2005, Grzegorz Milos
* Updates: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com>
+ * Updates: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> for ia64
*/
#ifndef _HYPERVISOR_H_
@@ -19,6 +20,8 @@
#include <hypercall-x86_32.h>
#elif defined(__x86_64__)
#include <hypercall-x86_64.h>
+#elif defined(__ia64__)
+#include <hypercall-ia64.h>
#else
#error "Unsupported architecture"
#endif
diff --git a/extras/mini-os/include/types.h b/extras/mini-os/include/types.h
index f6f3f94b03..f0b67607c3 100644
--- a/extras/mini-os/include/types.h
+++ b/extras/mini-os/include/types.h
@@ -29,7 +29,7 @@ typedef unsigned int u32;
#ifdef __i386__
typedef signed long long s64;
typedef unsigned long long u64;
-#elif defined(__x86_64__)
+#elif defined(__x86_64__) || defined(__ia64__)
typedef signed long s64;
typedef unsigned long u64;
#endif
@@ -49,7 +49,7 @@ typedef struct { unsigned long pte_low; } pte_t;
typedef struct { unsigned long pte_low, pte_high; } pte_t;
#endif /* CONFIG_X86_PAE */
-#elif defined(__x86_64__)
+#elif defined(__x86_64__) || defined(__ia64__)
typedef long quad_t;
typedef unsigned long u_quad_t;
typedef unsigned long uintptr_t;
diff --git a/extras/mini-os/include/os.h b/extras/mini-os/include/x86/os.h
index 2b6ed5512b..2b6ed5512b 100644
--- a/extras/mini-os/include/os.h
+++ b/extras/mini-os/include/x86/os.h
diff --git a/extras/mini-os/include/spinlock.h b/extras/mini-os/include/x86/spinlock.h
index 4274cd2869..4274cd2869 100644
--- a/extras/mini-os/include/spinlock.h
+++ b/extras/mini-os/include/x86/spinlock.h
diff --git a/extras/mini-os/include/traps.h b/extras/mini-os/include/x86/traps.h
index 2f54fd28f0..2f54fd28f0 100644
--- a/extras/mini-os/include/traps.h
+++ b/extras/mini-os/include/x86/traps.h
diff --git a/extras/mini-os/include/hypercall-x86_32.h b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
index 6556c4f7e2..6556c4f7e2 100644
--- a/extras/mini-os/include/hypercall-x86_32.h
+++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
diff --git a/extras/mini-os/include/hypercall-x86_64.h b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
index 6a68a10b02..6a68a10b02 100644
--- a/extras/mini-os/include/hypercall-x86_64.h
+++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h