aboutsummaryrefslogtreecommitdiffstats
path: root/src/kdata.asm
blob: ba395f1a5fffc3d593595e8a562c7c4cd756cae6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
; =============================================================================
; kdata.asm - kernel globals in fixed WRAM0 (always mapped, never swapped)
; =============================================================================
INCLUDE "include/gbos.inc"

SECTION "kernel_bss", WRAM0[$C000]

wProcTable::  DS MAX_PROCS * PROC_SIZE  ; the process table
wCurProc::    DS 2                      ; pointer to running PCB
wCurPid::     DS 1                      ; running pid (reserved)
wNextPid::    DS 1                      ; pid allocator
wSchedNext::  DS 1                      ; round-robin cursor (slot index)
wKernelPCB::  DS PROC_SIZE              ; outgoing-context holder for 1st switch
                                        ; (kernel/idle context; never resumed)

; scratch used by ProcCreate
wTmpEntry::   DS 2
wTmpRamB::    DS 1
wTmpWramB::   DS 1
wTmpSlot::    DS 1
wTmpPid::     DS 1
wTmpSP::      DS 2

; cart-RAM bank allocator (bump; bank 0 taken by the init task)
wNextRamBank:: DS 1

; scratch used by sys_fork
wForkUserSP::    DS 2      ; parent user SP at fork entry (= Uafter)
wForkChildSlot:: DS 1
wForkChildPid::  DS 1
wForkParentBank::DS 1
wForkChildBank:: DS 1
wCopyBuf::       DS 256    ; bank-copy bounce buffer (WRAM0, always mapped)