proc_p.h File Reference
Internal scheduler structures and definitions for processes. More...
#include "cfg/cfg_proc.h"
#include "cfg/cfg_monitor.h"
#include <cfg/compiler.h>
#include <cpu/types.h>
#include <cpu/irq.h>
#include <kern/proc.h>
Go to the source code of this file.
Defines | |
| #define | SCHED_ENQUEUE(proc) |
| Enqueue a process in the ready list. | |
Flags for Process.flags. | |
| #define | PF_FREESTACK BV(0) |
| Free the stack when process dies. | |
Functions | |
| void | sched_reenqueue (struct Process *proc) |
| Changes the priority of an already enqueued process. | |
| void | proc_switch (void) |
| Schedule another process *without* adding the current one to the ready list. | |
Variables | |
| REGISTER Process * | CurrentProcess |
| Track running processes. | |
| REGISTER List | ProcReadyList |
| Track ready processes. | |
Detailed Description
Internal scheduler structures and definitions for processes.
- Version:
- Id
- proc_p.h 2947 2009-09-15 13:56:38Z lottaviano
Definition in file proc_p.h.
Define Documentation
| #define SCHED_ENQUEUE | ( | proc | ) |
Value:
do { \ IRQ_ASSERT_DISABLED(); \ LIST_ASSERT_VALID(&ProcReadyList); \ SCHED_ENQUEUE_INTERNAL(proc); \ } while (0)
Always use this macro to instert a process in the ready list, as its might vary to implement a different scheduling algorithms.
- Note:
- Access to the scheduler ready list must be performed with interrupts disabled.
Function Documentation
| void sched_reenqueue | ( | struct Process * | proc | ) | [inline] |
Changes the priority of an already enqueued process.
Searches and removes the process from the ready list, then uses LIST_ENQUEUE(() to insert again to fix priority.
No action is performed for processes that aren't in the ready list, eg. in semaphore queues.
- Note:
- Performance could be improved with a different implementation of priority list.
Variable Documentation
| REGISTER Process* CurrentProcess |
| REGISTER List ProcReadyList |
