aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/include/x86
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-02-12 14:35:39 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-02-12 14:35:39 +0000
commit0243b256d6187ea610174531607366945e489605 (patch)
treefd2de9267b7493642626f8c84d7c81ebcd336bed /extras/mini-os/include/x86
parent67bfbd67d1311a1a590b47e568a07622d4492873 (diff)
downloadxen-0243b256d6187ea610174531607366945e489605.tar.gz
xen-0243b256d6187ea610174531607366945e489605.tar.bz2
xen-0243b256d6187ea610174531607366945e489605.zip
Add stubdomain support. See stubdom/README for usage details.
- Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in arch_limits.h so as to permit getting them from there without pulling all the internal Mini-OS defines. - Setup a xen-elf cross-compilation environment in stubdom/cross-root - Add a POSIX layer on top of Mini-OS by linking against the newlib C library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c - Cross-compile zlib and libpci too. - Add an xs.h-compatible layer on top of Mini-OS' xenbus. - Cross-compile libxc with an additional xc_minios.c and a few things disabled. - Cross-compile ioemu with an additional block-vbd, but without sound, tpm and other details. A few hacks are needed: - Align ide and scsi buffers at least on sector size to permit direct transmission to the block backend. While we are at it, just page-align it to possibly save a segment. Also, limit the scsi buffer size because of limitations of the block paravirtualization protocol. - Allocate big tables dynamically rather that letting them go to bss: when Mini-OS gets installed in memory, bss is not lazily allocated, and doing so during Mini-OS is unnecessarily trick while we can simply use malloc. - Had to change the Mini-OS compilation somehow, so as to export Mini-OS compilation flags to the Makefiles of libxc and ioemu. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'extras/mini-os/include/x86')
-rw-r--r--extras/mini-os/include/x86/arch_limits.h20
-rw-r--r--extras/mini-os/include/x86/arch_mm.h22
-rw-r--r--extras/mini-os/include/x86/arch_sched.h4
-rw-r--r--extras/mini-os/include/x86/arch_spinlock.h1
-rw-r--r--extras/mini-os/include/x86/os.h1
5 files changed, 33 insertions, 15 deletions
diff --git a/extras/mini-os/include/x86/arch_limits.h b/extras/mini-os/include/x86/arch_limits.h
new file mode 100644
index 0000000000..7f0351c67f
--- /dev/null
+++ b/extras/mini-os/include/x86/arch_limits.h
@@ -0,0 +1,20 @@
+
+#ifndef __ARCH_LIMITS_H__
+#define __ARCH_LIMITS_H__
+
+#define __PAGE_SHIFT 12
+
+#ifdef __ASSEMBLY__
+#define __PAGE_SIZE (1 << __PAGE_SHIFT)
+#else
+#ifndef CONFIG_X86_PAE
+#define __PAGE_SIZE (1UL << __PAGE_SHIFT)
+#else
+#define __PAGE_SIZE (1ULL << __PAGE_SHIFT)
+#endif
+#endif
+
+#define __STACK_SIZE_PAGE_ORDER 4
+#define __STACK_SIZE (__PAGE_SIZE * (1 << __STACK_SIZE_PAGE_ORDER))
+
+#endif /* __ARCH_LIMITS_H__ */
diff --git a/extras/mini-os/include/x86/arch_mm.h b/extras/mini-os/include/x86/arch_mm.h
index c5e106e6da..7ad8bc14be 100644
--- a/extras/mini-os/include/x86/arch_mm.h
+++ b/extras/mini-os/include/x86/arch_mm.h
@@ -157,16 +157,9 @@ typedef unsigned long pgentry_t;
#define L4_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
#endif /* __i386__ || __x86_64__ */
-#ifdef __ASSEMBLY__
-#define PAGE_SIZE (1 << L1_PAGETABLE_SHIFT)
-#else
-#ifndef CONFIG_X86_PAE
-#define PAGE_SIZE (1UL << L1_PAGETABLE_SHIFT)
-#else
-#define PAGE_SIZE (1ULL << L1_PAGETABLE_SHIFT)
-#endif
-#endif
-#define PAGE_SHIFT L1_PAGETABLE_SHIFT
+#include "arch_limits.h"
+#define PAGE_SIZE __PAGE_SIZE
+#define PAGE_SHIFT __PAGE_SHIFT
#define PAGE_MASK (~(PAGE_SIZE-1))
#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> L1_PAGETABLE_SHIFT)
@@ -177,9 +170,6 @@ typedef unsigned long pgentry_t;
/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
-#define STACK_SIZE_PAGE_ORDER 1
-#define STACK_SIZE (PAGE_SIZE * (1 << STACK_SIZE_PAGE_ORDER))
-
#ifndef __ASSEMBLY__
/* Definitions for machine and pseudophysical addresses. */
#ifdef CONFIG_X86_PAE
@@ -257,5 +247,11 @@ static __inline__ paddr_t machine_to_phys(maddr_t machine)
#define map_frames(f, n) map_frames_ex(f, n, 1, 0, 1, DOMID_SELF, 0, L1_PROT)
#define map_zero(n, a) map_frames_ex(&mfn_zero, n, 0, 0, a, DOMID_SELF, 0, L1_PROT_RO)
+#ifndef __ASSEMBLY__
+void do_map_frames(unsigned long addr,
+ unsigned long *f, unsigned long n, unsigned long stride,
+ unsigned long increment, domid_t id, int may_fail, unsigned long prot);
+#endif
+#define do_map_zero(start, n) do_map_frames(start, &mfn_zero, n, 0, 0, DOMID_SELF, 0, L1_PROT_RO)
#endif /* _ARCH_MM_H_ */
diff --git a/extras/mini-os/include/x86/arch_sched.h b/extras/mini-os/include/x86/arch_sched.h
index 877440762e..d80323cd37 100644
--- a/extras/mini-os/include/x86/arch_sched.h
+++ b/extras/mini-os/include/x86/arch_sched.h
@@ -2,7 +2,7 @@
#ifndef __ARCH_SCHED_H__
#define __ARCH_SCHED_H__
-#include <arch_mm.h>
+#include <arch_limits.h>
static inline struct thread* get_current(void)
{
@@ -12,7 +12,7 @@ static inline struct thread* get_current(void)
#else
register unsigned long sp asm("rsp");
#endif
- current = (void *)(unsigned long)(sp & ~(STACK_SIZE-1));
+ current = (void *)(unsigned long)(sp & ~(__STACK_SIZE-1));
return *current;
}
diff --git a/extras/mini-os/include/x86/arch_spinlock.h b/extras/mini-os/include/x86/arch_spinlock.h
index a181ed3c92..b711fe473c 100644
--- a/extras/mini-os/include/x86/arch_spinlock.h
+++ b/extras/mini-os/include/x86/arch_spinlock.h
@@ -4,6 +4,7 @@
#define __ARCH_ASM_SPINLOCK_H
#include <lib.h>
+#include "os.h"
#define ARCH_SPIN_LOCK_UNLOCKED (spinlock_t) { 1 }
diff --git a/extras/mini-os/include/x86/os.h b/extras/mini-os/include/x86/os.h
index 7a4433b3f9..7217d0b3ca 100644
--- a/extras/mini-os/include/x86/os.h
+++ b/extras/mini-os/include/x86/os.h
@@ -563,6 +563,7 @@ static __inline__ int synch_var_test_bit(int nr, volatile void * addr)
synch_var_test_bit((nr),(addr)))
+#undef ADDR
#endif /* not assembly */
#endif /* _OS_H_ */