proc.c File Reference
Simple realtime multitasking scheduler. More...
#include "proc_p.h"
#include "proc.h"
#include <mware/event.h>
#include <cpu/irq.h>
#include <cpu/types.h>
#include <cpu/attr.h>
#include <cfg/debug.h>
#include <cfg/module.h>
#include <cfg/arch_config.h>
#include <cfg/macros.h>
#include <string.h>
Go to the source code of this file.
Functions | |
| EXTERN_C void | asm_switch_context (cpustack_t **new_sp, cpustack_t **save_sp) |
| CPU dependent context switching routines. | |
| struct Process * | proc_new_with_name (UNUSED(const char *, name), void(*entry)(void), iptr_t data, size_t stacksize, cpustack_t *stack_base) |
| Create a new process, starting at the provided entry point. | |
| void | proc_rename (struct Process *proc, const char *name) |
| Rename a process. | |
| void | proc_schedule (void) |
| System scheduler: pass CPU control to the next process in the ready queue. | |
| void | proc_exit (void) |
| Terminate the current process. | |
| void | proc_switch (void) |
| Co-operative context switch. | |
| struct Process * | proc_current (void) |
| Get the pointer to the current process. | |
| iptr_t | proc_current_user_data (void) |
| Get the pointer to the user data of the current process. | |
Variables | |
| REGISTER Process * | CurrentProcess |
| Track running processes. | |
| REGISTER List | ProcReadyList |
| Track ready processes. | |
| struct Process | MainProcess |
| The main process (the one that executes main()). | |
Detailed Description
Simple realtime multitasking scheduler.Context switching is only done cooperatively.
- Version:
- Id
- proc.c 1230 2008-04-09 16:17:58Z batt
Definition in file proc.c.
Function Documentation
| EXTERN_C void asm_switch_context | ( | cpustack_t ** | new_sp, | |
| cpustack_t ** | save_sp | |||
| ) |
CPU dependent context switching routines.
- Note:
- This function *MUST* preserve also the status of the interrupts.
| struct Process* proc_new_with_name | ( | UNUSED(const char *, name) | , | |
| void(*)(void) | entry, | |||
| iptr_t | data, | |||
| size_t | stacksize, | |||
| cpustack_t * | stack_base | |||
| ) | [read] |
| void proc_schedule | ( | void | ) |
System scheduler: pass CPU control to the next process in the ready queue.
Schedule to another process *without* adding the current to the ready list.
Saving and restoring the context on the stack is done by a CPU-dependent support routine which must usually be written in assembly.
Variable Documentation
| REGISTER Process* CurrentProcess |
| struct Process MainProcess |
| REGISTER List ProcReadyList |
