#include <tigcclib.h>
Include dependency graph for opale_fake.c:
Go to the source code of this file.
Functions | |
void | op_KernelStart (void) |
void | op_KernelStop (void) |
Variables | |
unsigned long | op_idleCounter |
|
Starts the kernel by launching the highest priority task ready to run. If there's been no call to op_TaskStart before entering op_KernelStart, the idle task will be made ready to run and the system will be freezed waiting for an interrupt or anything. So don't forget to create at least one task before calling op_KernelStart.
section op_KernelStart op_KernelStart: movem.l d0-a6,-(a7) lea.l idleTask(pc),a0 move.l a0,currentTask ;currentTask = &idleTask; move.l a7,exitSP ; saves SP move.l (a0),a7 addq.l #6,a7 movem.l (a7) ,d0-a6 lea.l op_idleCounter(pc),a0 clr.l (a0) move.l (a0),op_tickCounter move.l (a0),numberOfNestedShedulerHalts ; numberOfNestedShedulerHalts = 0; trap #6 ; calls scheduler IdleTaskFunction: addq.l #1,op_idleCounter |
|
Stops all running tasks, and exits the kernel multithreading. The effect is just that op_KernelStart seemes to return, and so the code after the call to op_KernelStart will be executed.
section op_KernelStop op_KernelStop: trap #7 ;op_EnterCriticalSection(); move.l exitSP(pc),a7 ; restores sp movem.l (a7) ,d0-a6 ; restores regs bra RestoreIntVectors(pc) ; never returns |
|
counter incremented by the idle task. Useful to compute CPU load. section op_idleCounter: op_idleCounter: ds.l 1 |