ia64/xen-unstable

annotate extras/mini-os/include/sched.h @ 13522:e9e327c3e81b

[MINIOS] More cleanups for the ia64 port.
Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
author kfraser@localhost.localdomain
date Fri Jan 19 15:09:39 2007 +0000 (2007-01-19)
parents a3c6479c87ef
children d46265d21dc5
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__)
kaf24@9911 13 unsigned long sp; /* Stack pointer */
kaf24@9911 14 unsigned long ip; /* Instruction pointer */
kfraser@12543 15 #else /* !defined(__ia64__) */
kfraser@12543 16 thread_regs_t regs;
kfraser@12543 17 #endif /* !defined(__ia64__) */
kaf24@6714 18 struct list_head thread_list;
kaf24@6714 19 u32 flags;
kfraser@12473 20 s_time_t wakeup_time;
kaf24@6714 21 };
kaf24@6714 22
kfraser@12543 23 extern struct thread *idle_thread;
kfraser@12543 24 void idle_thread_fn(void *unused);
kaf24@6714 25
kfraser@12543 26 #define RUNNABLE_FLAG 0x00000001
kfraser@12543 27
kfraser@12543 28 #define is_runnable(_thread) (_thread->flags & RUNNABLE_FLAG)
kfraser@12543 29 #define set_runnable(_thread) (_thread->flags |= RUNNABLE_FLAG)
kfraser@12543 30 #define clear_runnable(_thread) (_thread->flags &= ~RUNNABLE_FLAG)
kfraser@12543 31
kfraser@12543 32 #define switch_threads(prev, next) arch_switch_threads(prev, next)
kfraser@12543 33
kfraser@13522 34 /* Architecture specific setup of thread creation. */
kfraser@13522 35 struct thread* arch_create_thread(char *name, void (*function)(void *),
kfraser@13522 36 void *data);
kaf24@6714 37
kaf24@6714 38 void init_sched(void);
kaf24@6714 39 void run_idle_thread(void);
kaf24@6714 40 struct thread* create_thread(char *name, void (*function)(void *), void *data);
kaf24@6714 41 void schedule(void);
kaf24@6714 42
kaf24@6714 43 #define current get_current()
kaf24@6714 44
kaf24@6714 45
kaf24@6714 46 void wake(struct thread *thread);
kaf24@6714 47 void block(struct thread *thread);
kfraser@12473 48 void sleep(u32 millisecs);
kaf24@6714 49
kaf24@6714 50 #endif /* __SCHED_H__ */