ia64/xen-unstable

annotate extras/mini-os/include/sched.h @ 17042:a905c582a406

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>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Feb 12 14:35:39 2008 +0000 (2008-02-12)
parents 945820bfedb6
children 707e10c9a487
rev   line source
kaf24@6714 1 #ifndef __SCHED_H__
kaf24@6714 2 #define __SCHED_H__
kaf24@6714 3
kaf24@6714 4 #include <list.h>
kfraser@12473 5 #include <time.h>
kfraser@12543 6 #include <arch_sched.h>
kaf24@6714 7
kaf24@6714 8 struct thread
kaf24@6714 9 {
kaf24@6714 10 char *name;
kaf24@6714 11 char *stack;
kfraser@12543 12 #if !defined(__ia64__)
keir@16434 13 /* keep in that order */
kaf24@9911 14 unsigned long sp; /* Stack pointer */
kaf24@9911 15 unsigned long ip; /* Instruction pointer */
kfraser@12543 16 #else /* !defined(__ia64__) */
kfraser@12543 17 thread_regs_t regs;
kfraser@12543 18 #endif /* !defined(__ia64__) */
kaf24@6714 19 struct list_head thread_list;
kaf24@6714 20 u32 flags;
kfraser@12473 21 s_time_t wakeup_time;
keir@17042 22 #ifdef HAVE_LIBC
keir@17042 23 struct _reent reent;
keir@17042 24 #endif
kaf24@6714 25 };
kaf24@6714 26
kfraser@12543 27 extern struct thread *idle_thread;
kfraser@12543 28 void idle_thread_fn(void *unused);
kaf24@6714 29
kfraser@12543 30 #define RUNNABLE_FLAG 0x00000001
kfraser@12543 31
kfraser@12543 32 #define is_runnable(_thread) (_thread->flags & RUNNABLE_FLAG)
kfraser@12543 33 #define set_runnable(_thread) (_thread->flags |= RUNNABLE_FLAG)
kfraser@12543 34 #define clear_runnable(_thread) (_thread->flags &= ~RUNNABLE_FLAG)
kfraser@12543 35
kfraser@12543 36 #define switch_threads(prev, next) arch_switch_threads(prev, next)
kfraser@12543 37
kfraser@13522 38 /* Architecture specific setup of thread creation. */
kfraser@13522 39 struct thread* arch_create_thread(char *name, void (*function)(void *),
kfraser@13522 40 void *data);
kaf24@6714 41
kaf24@6714 42 void init_sched(void);
kaf24@6714 43 void run_idle_thread(void);
kaf24@6714 44 struct thread* create_thread(char *name, void (*function)(void *), void *data);
keir@16732 45 void exit_thread(void) __attribute__((noreturn));
kaf24@6714 46 void schedule(void);
kaf24@6714 47
kaf24@6714 48 #define current get_current()
kaf24@6714 49
kaf24@6714 50
kaf24@6714 51 void wake(struct thread *thread);
kaf24@6714 52 void block(struct thread *thread);
keir@16838 53 void msleep(u32 millisecs);
kaf24@6714 54
kaf24@6714 55 #endif /* __SCHED_H__ */