Files
codezero/include/l4/generic/scheduler.h
Bahadir Balban 938672f7c9 Changed the virt-to-phys debug breakpoint name to break_virtual
Changed l4id_t type to integer to recognise negative id values like L4_ANYTHREAD.
Added an extremely simple script that cleans and builds everything in right order.

Increased boot pmds by one:
This is due to the fact that if the 1MB initial allocation area of the kernel is
not 1MB-aligned, it is ought to be mapped from the middle of one MB to next,
which requires 2 pmds.

	modified:   .gdbinit
	modified:   README
	new file:   buildall.sh
	modified:   include/l4/arch/arm/types.h
	modified:   include/l4/generic/scheduler.h
	modified:   loader/kernel.S
	modified:   loader/main.c
	modified:   loader/mylink.lds
	modified:   loader/start.axf.S
	modified:   src/glue/arm/init.c
	modified:   src/glue/arm/memory.c
	modified:   tasks/fs0/src/bdev.c
	modified:   tasks/mm0/include/kdata.h
	modified:   tasks/mm0/include/vm_area.h
	modified:   tasks/mm0/src/init.c
	modified:   tasks/mm0/src/task.c
	modified:   tools/ksym_to_lds.py
	modified:   tools/l4-qemu
2008-02-04 16:44:11 +00:00

56 lines
1.7 KiB
C

/*
* Scheduler and runqueue API definitions.
*
* Copyright (C) 2007 Bahadir Balban
*/
#ifndef __SCHEDULER_H__
#define __SCHEDULER_H__
#include <l4/generic/tcb.h>
#include INC_SUBARCH(mm.h)
#include INC_GLUE(memory.h)
/* Ticks per second, try ticks = 1000 + timeslice = 1 for regressed preemption test. */
#define HZ 100
#define TASK_TIMESLICE_DEFAULT 20
/* #define TASK_TIMESLICE_DEFAULT (HZ/100)*/
static inline struct ktcb *current_task(void)
{
register u32 stack asm("sp");
return (struct ktcb *)(stack & (~PAGE_MASK));
}
#define current current_task()
#define need_resched (current->ts_need_resched)
/* Flags set by kernel to direct the scheduler about future task state. */
#define __SCHED_FL_SUSPEND 1
#define SCHED_FL_SUSPEND (1 << __SCHED_FL_SUSPEND)
#define __SCHED_FL_RESUME 2
#define SCHED_FL_RESUME (1 << __SCHED_FL_RESUME)
#define __SCHED_FL_SLEEP 3
#define SCHED_FL_SLEEP (1 << __SCHED_FL_SLEEP)
#define SCHED_FL_MASK (SCHED_FL_SLEEP | SCHED_FL_RESUME \
| SCHED_FL_SUSPEND)
#define __IPC_FL_WAIT 4
#define IPC_FL_WAIT (1 << __IPC_FL_WAIT)
#define IPC_FL_MASK IPC_FL_WAIT
void sched_runqueue_init(void);
void sched_start_task(struct ktcb *task);
void sched_resume_task(struct ktcb *task);
void sched_suspend_task(struct ktcb *task);
void sched_process_post_ipc(struct ktcb *, struct ktcb *);
void sched_tell(struct ktcb *task, unsigned int flags);
void scheduler_start(void);
void sched_yield(void);
void schedule(void);
/* Asynchronous notifications to scheduler */
void sched_notify_resume(struct ktcb *task);
void sched_notify_sleep(struct ktcb *task);
void sched_notify_suspend(struct ktcb *task);
#endif /* __SCHEDULER_H__ */