diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-01-17 14:41:44 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-01-17 14:41:44 +0000 |
commit | 22e39d084eaa3b058ec34964156511fe963ce4d4 (patch) | |
tree | 0566e56ab0131abd998692127a2deea8d845a17d /extras/mini-os/include/x86 | |
parent | e2edfe6c73a287989911630a070c3e6c1137446f (diff) | |
download | xen-22e39d084eaa3b058ec34964156511fe963ce4d4.tar.gz xen-22e39d084eaa3b058ec34964156511fe963ce4d4.tar.bz2 xen-22e39d084eaa3b058ec34964156511fe963ce4d4.zip |
minios: make stack size configurable
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Diffstat (limited to 'extras/mini-os/include/x86')
-rw-r--r-- | extras/mini-os/include/x86/arch_mm.h | 18 | ||||
-rw-r--r-- | extras/mini-os/include/x86/arch_sched.h | 3 |
2 files changed, 20 insertions, 1 deletions
diff --git a/extras/mini-os/include/x86/arch_mm.h b/extras/mini-os/include/x86/arch_mm.h index 795ef070a7..ddf132f1be 100644 --- a/extras/mini-os/include/x86/arch_mm.h +++ b/extras/mini-os/include/x86/arch_mm.h @@ -25,6 +25,8 @@ #ifndef _ARCH_MM_H_ #define _ARCH_MM_H_ +#ifndef __ASSEMBLY__ +#include <xen/xen.h> #if defined(__i386__) #include <xen/arch-x86_32.h> #elif defined(__x86_64__) @@ -32,6 +34,7 @@ #else #error "Unsupported architecture" #endif +#endif #define L1_FRAME 1 #define L2_FRAME 2 @@ -53,7 +56,9 @@ #define NOT_L1_FRAMES 1 #define PRIpte "08lx" +#ifndef __ASSEMBLY__ typedef unsigned long pgentry_t; +#endif #else /* defined(CONFIG_X86_PAE) */ @@ -76,7 +81,9 @@ typedef unsigned long pgentry_t; */ #define NOT_L1_FRAMES 3 #define PRIpte "016llx" +#ifndef __ASSEMBLY__ typedef uint64_t pgentry_t; +#endif #endif /* !defined(CONFIG_X86_PAE) */ @@ -102,7 +109,9 @@ typedef uint64_t pgentry_t; #define NOT_L1_FRAMES 3 #define PRIpte "016lx" +#ifndef __ASSEMBLY__ typedef unsigned long pgentry_t; +#endif #endif @@ -146,11 +155,15 @@ 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 #define PAGE_MASK (~(PAGE_SIZE-1)) @@ -162,6 +175,10 @@ 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 typedef unsigned long long paddr_t; @@ -188,6 +205,7 @@ static __inline__ paddr_t machine_to_phys(maddr_t machine) phys = (phys << PAGE_SHIFT) | (machine & ~PAGE_MASK); return phys; } +#endif #define VIRT_START ((unsigned long)&_text) diff --git a/extras/mini-os/include/x86/arch_sched.h b/extras/mini-os/include/x86/arch_sched.h index 35a4344efd..b2b2556ffb 100644 --- a/extras/mini-os/include/x86/arch_sched.h +++ b/extras/mini-os/include/x86/arch_sched.h @@ -2,6 +2,7 @@ #ifndef __ARCH_SCHED_H__ #define __ARCH_SCHED_H__ +#include <arch_mm.h> static inline struct thread* get_current(void) { @@ -11,7 +12,7 @@ static inline struct thread* get_current(void) #else register unsigned long sp asm("rsp"); #endif - current = (void *)(sp & ~8191UL); + current = (void *)(sp & ~(STACK_SIZE-1)); return *current; } |