diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-02 09:12:39 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-02 09:12:39 +0100 |
commit | f08246e1976e3ae483c2568e4e510cb3f2b6e44d (patch) | |
tree | b4a7999be3d4dc10a52652824a3dde2cc767ed29 /extras/mini-os/events.c | |
parent | af8fc368d78db62f9f637e7e433d1a5027ef47b1 (diff) | |
download | xen-f08246e1976e3ae483c2568e4e510cb3f2b6e44d.tar.gz xen-f08246e1976e3ae483c2568e4e510cb3f2b6e44d.tar.bz2 xen-f08246e1976e3ae483c2568e4e510cb3f2b6e44d.zip |
Fix x86/64 version of Mini-OS. It encompasses the following:
a) 64-bit switch_to scheduler macro (by Aravindh Puthiyaparambil)
b) implements 64-bit hypervisor_callback
c) fixes thread creation issues (thread_starter used to perform
initialisation)
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Diffstat (limited to 'extras/mini-os/events.c')
-rw-r--r-- | extras/mini-os/events.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c index b70eae0b1c..e45a1364fe 100644 --- a/extras/mini-os/events.c +++ b/extras/mini-os/events.c @@ -106,6 +106,17 @@ void unbind_virq( u32 port ) unbind_evtchn(port); } +#if defined(__x86_64__) +/* Allocate 4 pages for the irqstack */ +#define STACK_PAGES 4 +char irqstack[1024 * 4 * STACK_PAGES]; + +static struct pda +{ + int irqcount; /* offset 0 (used in x86_64.S) */ + char *irqstackptr; /* 8 */ +} cpu0_pda; +#endif /* * Initially all events are without a handler and disabled @@ -113,7 +124,12 @@ void unbind_virq( u32 port ) void init_events(void) { int i; - +#if defined(__x86_64__) + asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0)); + wrmsrl(0xc0000101, &cpu0_pda); /* 0xc0000101 is MSR_GS_BASE */ + cpu0_pda.irqcount = -1; + cpu0_pda.irqstackptr = irqstack + 1024 * 4 * STACK_PAGES; +#endif /* inintialise event handler */ for ( i = 0; i < NR_EVS; i++ ) { |