2020-02-15 20:01:48 +00:00
|
|
|
/*On each core, tasks are linked in a
|
|
|
|
circular doubly-linked list queue with
|
2021-07-02 06:04:42 +01:00
|
|
|
the Executive task as the head. On Core0,
|
2020-02-15 20:01:48 +00:00
|
|
|
the queue order represents the front-to-back
|
|
|
|
window stack order with the window mgr
|
|
|
|
as the wallpaper.
|
|
|
|
|
|
|
|
The scheduler is round-robin. It checks
|
|
|
|
if a task is ready and runs it or skips it.
|
|
|
|
Swapping tasks just involves storing and
|
|
|
|
restoring regs (no disk I/O for virtual
|
2020-03-01 01:59:50 +00:00
|
|
|
memory and no addr map changes). It is
|
2020-02-15 20:01:48 +00:00
|
|
|
always fully identity-mapped on all cores.
|
|
|
|
Tasks can be switched in half a microsecond.
|
|
|
|
|
|
|
|
The scheduler checks if a task is
|
|
|
|
waiting for a certain time or waiting
|
|
|
|
on a message and skips if not ready.
|
|
|
|
A task runs until it voluntarily yields ctrl
|
2020-03-01 01:59:50 +00:00
|
|
|
with a call to $LK,"Yield",A="MN:Yield"$(). Tasks waiting on I/O
|
2020-02-15 20:01:48 +00:00
|
|
|
often loop, checking for a status and
|
2020-03-01 01:59:50 +00:00
|
|
|
$LK,"Yield",A="MN:Yield"$ing. This does not really degrade
|
2020-02-15 20:01:48 +00:00
|
|
|
performance, but pegs the CPU Load.
|
|
|
|
|
|
|
|
The scheduler checks for a few keys:
|
|
|
|
|
|
|
|
<CTRL-ALT-x> kill a task.
|
|
|
|
<CTRL-ALT-DEL> reboots.
|
|
|
|
<CTRL-ALT-n> Next task.
|
|
|
|
<CTRL-ALT-c> breaks execution of a program.
|
|
|
|
|
|
|
|
Each core has its own circular task queue.
|
2021-07-02 06:04:42 +01:00
|
|
|
For AP processors, they have an "Executive" task
|
2020-02-15 20:01:48 +00:00
|
|
|
which stays in a loop waiting for jobs or
|
2021-07-02 06:04:42 +01:00
|
|
|
requests to spawn tasks. See $LK,"CoreAPExecutiveTask",A="MN:CoreAPExecutiveTask"$().
|
2020-02-15 20:01:48 +00:00
|
|
|
$HL,1$*/
|
|
|
|
|
|
|
|
U0 TaskFocusNext()
|
|
|
|
{
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
CTask *task, *_task = sys_focus_task;
|
|
|
|
|
|
|
|
sys_focus_task = NULL;
|
|
|
|
if (!_task)
|
2021-07-02 00:53:42 +01:00
|
|
|
_task = sys_task;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
task = _task->next_task;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if (!Bt(&task->win_inhibit, WIf_SELF_FOCUS))
|
|
|
|
{
|
|
|
|
sys_focus_task = task;
|
|
|
|
CallExtNum(EXT_WIN_TO_TOP, task, TRUE);
|
2020-02-20 23:40:10 +00:00
|
|
|
return;
|
|
|
|
}
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
task = task->next_task;
|
|
|
|
}
|
|
|
|
while (task != _task);
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
asm {
|
|
|
|
TASK_CONTEXT_SAVE::
|
|
|
|
//OUT: RSI=FS
|
2020-02-20 23:40:10 +00:00
|
|
|
PUSH RSI
|
|
|
|
PUSHFD
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
XOR RSI, RSI
|
|
|
|
MOV RSI, FS:CTask.addr[RSI]
|
2020-02-20 23:40:10 +00:00
|
|
|
POP U64 CTask.rflags[RSI]
|
|
|
|
POP U64 CTask.rsi[RSI]
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV U64 CTask.rax[RSI], RAX
|
2020-02-15 20:01:48 +00:00
|
|
|
|
2020-02-16 01:19:05 +00:00
|
|
|
/*Divert the stack to the Task memory
|
2020-02-15 20:01:48 +00:00
|
|
|
and push onto it and divert it back.
|
|
|
|
It's a little faster.
|
|
|
|
*/
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, RSP
|
|
|
|
LEA RSP, U64 CTask.r15+8[RSI]
|
2020-02-20 23:40:10 +00:00
|
|
|
PUSH R15
|
|
|
|
PUSH R14
|
|
|
|
PUSH R13
|
|
|
|
PUSH R12
|
|
|
|
PUSH R11
|
|
|
|
PUSH R10
|
|
|
|
PUSH R9
|
|
|
|
PUSH R8
|
|
|
|
PUSH RDI
|
|
|
|
PUSH RBP
|
|
|
|
PUSH RBX
|
|
|
|
PUSH RDX
|
|
|
|
PUSH RCX
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RSP, RAX
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, U64 CTask.fpu_mmx[RSI]
|
|
|
|
FXSAVE U64 [RAX]
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RDX, U64 CTask.bpt_list[RSI]
|
|
|
|
@@05: TEST RDX, RDX
|
2020-02-20 23:40:10 +00:00
|
|
|
JZ @@10
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RDI, U64 CBpt.addr[RDX]
|
|
|
|
MOV AL, U8 CBpt.val[RDX]
|
|
|
|
MOV U8 [RDI], AL
|
|
|
|
MOV RDX, U64 CBpt.next[RDX]
|
2020-02-20 23:40:10 +00:00
|
|
|
JMP @@05
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
@@10: RET
|
|
|
|
|
2020-02-15 20:01:48 +00:00
|
|
|
//************************************
|
|
|
|
_TASK_CONTEXT_RESTORE::
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
XOR RAX, RAX
|
2020-02-20 23:40:10 +00:00
|
|
|
INC U64 GS:CCPU.swap_counter[RAX]
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RSI, FS:CTask.addr[RAX]
|
|
|
|
BT U32 CTask.rflags[RSI], RFLAGf_INT
|
2020-02-20 23:40:10 +00:00
|
|
|
JNC @@05
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BTS U32 GS:CCPU.cpu_flags[RAX], CPUf_RAN_A_TASK
|
|
|
|
@@05: BT U64 CTask.task_flags[RSI], TASKf_DISABLE_BPTS
|
2020-02-20 23:40:10 +00:00
|
|
|
JC @@15
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RDX, U64 CTask.bpt_list[RSI]
|
|
|
|
@@10: TEST RDX, RDX
|
2020-02-20 23:40:10 +00:00
|
|
|
JZ @@15
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RDI, U64 CBpt.addr[RDX]
|
|
|
|
MOV U8 [RDI], OC_BPT
|
|
|
|
MOV RDX, U64 CBpt.next[RDX]
|
2020-02-20 23:40:10 +00:00
|
|
|
JMP @@10
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
@@15: INC U64 CTask.swap_counter[RSI]
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, U64 CTask.fpu_mmx[RSI]
|
|
|
|
FXRSTOR U64 [RAX]
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, RSP
|
|
|
|
LEA RSP, U64 CTask.rcx[RSI]
|
2020-02-20 23:40:10 +00:00
|
|
|
POP RCX
|
|
|
|
POP RDX
|
|
|
|
POP RBX
|
|
|
|
POP RBP
|
|
|
|
POP RDI
|
|
|
|
POP R8
|
|
|
|
POP R9
|
|
|
|
POP R10
|
|
|
|
POP R11
|
|
|
|
POP R12
|
|
|
|
POP R13
|
|
|
|
POP R14
|
|
|
|
POP R15
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RSP, RAX
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, U64 CTask.rax[RSI]
|
2020-02-20 23:40:10 +00:00
|
|
|
PUSH CGDT.ds
|
|
|
|
PUSH U64 CTask.rsp[RSI]
|
|
|
|
PUSH U64 CTask.rflags[RSI]
|
|
|
|
PUSH CGDT.cs64
|
|
|
|
PUSH U64 CTask.rip[RSI]
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RSI, U64 CTask.rsi[RSI]
|
2020-02-20 23:40:10 +00:00
|
|
|
IRET
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
2020-02-15 20:01:48 +00:00
|
|
|
//************************************
|
|
|
|
END_RSI_TASK:
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, RSI
|
2020-02-20 23:40:10 +00:00
|
|
|
CALL SET_FS_BASE
|
2020-02-15 20:01:48 +00:00
|
|
|
_TASK_END_NOW::
|
2020-02-20 23:40:10 +00:00
|
|
|
CALL &TaskEnd
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RSI, RAX
|
2020-02-20 23:40:10 +00:00
|
|
|
CALL SET_FS_BASE
|
|
|
|
JMP I8 RESTORE_RSI_TASK
|
2020-02-15 20:01:48 +00:00
|
|
|
|
|
|
|
_YIELD::
|
2020-02-20 23:40:10 +00:00
|
|
|
PUSHFD
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
TEST U8 [SYS_SEMAS + SEMA_SINGLE_USER * DEFAULT_CACHE_LINE_WIDTH], 1
|
2020-02-20 23:40:10 +00:00
|
|
|
JZ @@05
|
|
|
|
POPFD //If single user, don't change task.
|
|
|
|
RET
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
@@05: CLI
|
2020-02-20 23:40:10 +00:00
|
|
|
CALL TASK_CONTEXT_SAVE
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV EBX, U32 _RET
|
|
|
|
MOV U64 CTask.rip[RSI], RBX
|
2020-02-20 23:40:10 +00:00
|
|
|
POP U64 CTask.rflags[RSI]
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV U64 CTask.rsp[RSI], RSP
|
|
|
|
MOV RSI, U64 CTask.next_task[RSI]
|
2020-02-15 20:01:48 +00:00
|
|
|
|
|
|
|
RESTORE_RSI_TASK:
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
TEST U64 [SYS_CTRL_ALT_FLAGS], 1 << CTRL_ALT_DEL|1 << CTRL_ALT_TAB|1 << CTRL_ALT_X|1 << CTRL_ALT_C
|
2020-02-20 23:40:10 +00:00
|
|
|
JNZ HANDLE_SYSF_KEY_EVENT
|
2020-02-15 20:01:48 +00:00
|
|
|
|
|
|
|
RESTORE_RSI_TASK2:
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
@@20: BT U64 CTask.task_flags[RSI], TASKf_KILL_TASK
|
2020-02-20 23:40:10 +00:00
|
|
|
JC END_RSI_TASK
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
TEST U64 CTask.task_flags[RSI], 1 << TASKf_AWAITING_MESSAGE | 1 << TASKf_SUSPENDED
|
2020-02-20 23:40:10 +00:00
|
|
|
JNZ @@25
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, U64 [&counts.jiffies]
|
|
|
|
CMP U64 CTask.wake_jiffy[RSI], RAX
|
2020-02-20 23:40:10 +00:00
|
|
|
JG @@25 //Jmp if not ready, yet.
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, RSI
|
2020-02-20 23:40:10 +00:00
|
|
|
CALL SET_FS_BASE
|
|
|
|
JMP I32 _TASK_CONTEXT_RESTORE
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
@@25: MOV RSI, U64 CTask.next_task[RSI]
|
|
|
|
XOR RAX, RAX
|
2021-07-02 06:04:42 +01:00
|
|
|
CMP U64 GS:CCPU.executive_task[RAX], RSI
|
|
|
|
JNE @@20 //Jmp if not Executive
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BTR U32 GS:CCPU.cpu_flags[RAX], CPUf_RAN_A_TASK
|
2020-02-20 23:40:10 +00:00
|
|
|
JC @@20 //Jmp if had chance for IRQ already
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, U64 GS:CCPU.idle_task[RAX]
|
|
|
|
MOV RSP, U64 CTask.stack[RAX]
|
|
|
|
ADD RSP, MEM_DEFAULT_STACK + CTaskStack.stack_base //Reset to top
|
2020-02-20 23:40:10 +00:00
|
|
|
CALL SET_FS_BASE
|
|
|
|
STI //Restore idle task so we can unmask IRQs.
|
|
|
|
HLT
|
2020-02-15 20:01:48 +00:00
|
|
|
SYS_IDLE_PT::
|
2020-02-20 23:40:10 +00:00
|
|
|
CLI
|
2020-02-15 20:01:48 +00:00
|
|
|
|
2021-07-02 06:04:42 +01:00
|
|
|
RESTORE_EXECUTIVE_TASK_IF_READY:
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
XOR RAX, RAX
|
2021-07-02 06:04:42 +01:00
|
|
|
MOV RSI, GS:CCPU.executive_task[RAX]
|
2020-02-20 23:40:10 +00:00
|
|
|
JMP RESTORE_RSI_TASK
|
2020-02-15 20:01:48 +00:00
|
|
|
|
|
|
|
HANDLE_SYSF_KEY_EVENT:
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, RSI
|
2020-02-20 23:40:10 +00:00
|
|
|
CALL SET_FS_BASE
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
XOR RBX, RBX
|
|
|
|
MOV RAX, GS:CCPU.num[RBX]
|
|
|
|
TEST RAX, RAX
|
2020-02-20 23:40:10 +00:00
|
|
|
JNZ I32 RESTORE_RSI_TASK2
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV EAX, U32 SYS_CTRL_ALT_FLAGS
|
2020-02-20 23:40:10 +00:00
|
|
|
LOCK
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BTR U32 [RAX], CTRL_ALT_DEL
|
2020-02-20 23:40:10 +00:00
|
|
|
JC I32 &Reboot
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
CMP U64 GS:CCPU.idle_task[RBX], RSI
|
2021-07-02 06:04:42 +01:00
|
|
|
JE RESTORE_EXECUTIVE_TASK_IF_READY
|
2020-02-20 23:40:10 +00:00
|
|
|
|
|
|
|
LOCK
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BTR U32 [RAX], CTRL_ALT_TAB
|
2020-02-20 23:40:10 +00:00
|
|
|
JNC @@05
|
|
|
|
CALL &TaskFocusNext
|
|
|
|
JMP I32 RESTORE_FS_TASK
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
@@05: LOCK
|
|
|
|
BTR U32 [RAX], CTRL_ALT_X
|
2020-02-20 23:40:10 +00:00
|
|
|
JC END_FOCUS_USER
|
|
|
|
LOCK
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BTR U32 [RAX], CTRL_ALT_C
|
2020-02-20 23:40:10 +00:00
|
|
|
JNC I32 RESTORE_RSI_TASK
|
2020-02-15 20:01:48 +00:00
|
|
|
|
|
|
|
BREAK_FOCUS_USER:
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RSI, U64 [SYS_FOCUS_TASK]
|
|
|
|
TEST RSI, RSI
|
2021-07-02 06:04:42 +01:00
|
|
|
JZ RESTORE_EXECUTIVE_TASK_IF_READY
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BT U64 CTask.win_inhibit[RSI], WIf_SELF_FOCUS
|
2020-02-20 23:40:10 +00:00
|
|
|
JC I32 RESTORE_RSI_TASK
|
|
|
|
LOCK
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BTR U64 CTask.task_flags[RSI], TASKf_BREAK_LOCKED
|
2020-02-20 23:40:10 +00:00
|
|
|
JNC @@10
|
|
|
|
LOCK
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BTS U64 CTask.task_flags[RSI], TASKf_PENDING_BREAK
|
2020-02-20 23:40:10 +00:00
|
|
|
JMP I32 RESTORE_RSI_TASK
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
@@10: MOV RAX, &Break
|
|
|
|
MOV U64 CTask.rip[RSI], RAX
|
|
|
|
BT U64 CTask.task_flags[RSI], TASKf_BREAK_TO_SHIFT_ESC
|
2020-02-20 23:40:10 +00:00
|
|
|
JC I32 RESTORE_RSI_TASK
|
2020-02-15 20:01:48 +00:00
|
|
|
|
|
|
|
//Do these now, in case interrupt happens.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV U64 CTask.wake_jiffy[RSI], 0
|
2020-02-20 23:40:10 +00:00
|
|
|
PUSH RSI
|
|
|
|
CALL &TaskResetAwaitingMessage
|
|
|
|
JMP I32 RESTORE_RSI_TASK
|
2020-02-15 20:01:48 +00:00
|
|
|
|
|
|
|
END_FOCUS_USER:
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RSI, U64 [SYS_FOCUS_TASK]
|
2020-02-20 23:40:10 +00:00
|
|
|
CALL &TaskFocusNext
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
TEST RSI, RSI
|
2021-07-02 06:04:42 +01:00
|
|
|
JZ I32 RESTORE_EXECUTIVE_TASK_IF_READY
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
MOV RAX, RSI
|
2020-02-20 23:40:10 +00:00
|
|
|
CALL SET_FS_BASE
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BT U64 CTask.win_inhibit[RSI], WIf_SELF_FOCUS
|
2020-02-20 23:40:10 +00:00
|
|
|
JC I32 RESTORE_RSI_TASK
|
|
|
|
LOCK
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
BTS U64 CTask.task_flags[RSI], TASKf_KILL_TASK
|
2020-02-20 23:40:10 +00:00
|
|
|
JMP I32 END_RSI_TASK
|
2020-02-15 20:01:48 +00:00
|
|
|
|
|
|
|
RESTORE_FS_TASK:
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
XOR RSI, RSI
|
|
|
|
MOV RSI, FS:CTask.addr[RSI]
|
2020-02-20 23:40:10 +00:00
|
|
|
JMP I32 RESTORE_RSI_TASK
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
_extern _TASK_CONTEXT_RESTORE U0 TaskContextRestore(); //Restore a task context.
|
|
|
|
_extern _YIELD U0 Yield(); //Yield cpu to next task.
|
|
|
|
_extern _TASK_END_NOW U0 TaskEndNow(); //Terminate current task.
|
2020-02-15 20:01:48 +00:00
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
U0 TaskQueueIns(CTask *task, CTask *pred=NULL)
|
2020-02-15 20:01:48 +00:00
|
|
|
{//Insert a task in the scheduler running task queue.
|
|
|
|
//You have no business with this, probably.
|
2020-02-20 23:40:10 +00:00
|
|
|
CTask *last;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
PUSHFD
|
|
|
|
CLI
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
if (!pred)
|
|
|
|
pred = Fs;
|
|
|
|
last = pred->last_task;
|
|
|
|
last->next_task = pred->last_task = task;
|
|
|
|
task->last_task = last;
|
|
|
|
task->next_task = pred;
|
2020-02-20 23:40:10 +00:00
|
|
|
POPFD
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
2020-02-15 23:13:27 +00:00
|
|
|
U0 TaskQueueRemove(CTask *task)
|
2020-02-15 20:01:48 +00:00
|
|
|
{//Remove a task from the scheduler running task queue.
|
|
|
|
//Use $LK,"Suspend",A="MN:Suspend"$().
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
CTask *next, *last;
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
PUSHFD
|
|
|
|
CLI
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
next = task->next_task;
|
|
|
|
last = task->last_task;
|
|
|
|
last->next_task = next;
|
|
|
|
next->last_task = last;
|
2020-02-20 23:40:10 +00:00
|
|
|
POPFD
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
2020-02-15 22:53:02 +00:00
|
|
|
U0 TaskQueueInsChild(CTask *task)
|
2020-02-15 20:01:48 +00:00
|
|
|
{
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
CTask *last, *pred;
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
PUSHFD
|
|
|
|
CLI
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
pred = task->parent_task->last_child_task;
|
|
|
|
last = pred->last_sibling_task;
|
|
|
|
last->next_sibling_task = pred->last_sibling_task = task;
|
|
|
|
task->last_sibling_task = last;
|
|
|
|
task->next_sibling_task = pred;
|
2020-02-20 23:40:10 +00:00
|
|
|
POPFD
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|