source: buchla-68k/orig/MT/MTDEFS.S@ 0170798

Last change on this file since 0170798 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 4.9 KB
RevLine 
[3ae31e9]1* ------------------------------------------------------------------------------
2* mtdefs.s -- Multi-Tasker variable definitions
3* Version 17 -- 1988-04-17 -- D.N. Lynx Crowe
4* (c) Copyright 1988 -- D.N. Lynx Crowe
5* ------------------------------------------------------------------------------
6DEBUGGER .equ 0 * define non-zero for debug
7* ------------------------------------------------------------------------------
8 .bss
9* ------------------------------------------------------------------------------
10 .xdef MTStruct * multi-takser system RAM
11 .xdef MT_END * end of multi-tasker system RAM
12*
13 .xdef _MSG_Vid * video mailbox structure
14*
15 .xdef _MT_TCBs * pointer to base of TCB pool
16 .xdef _MT_CurP * current TCB pointer
17 .xdef _MT_RdyQ * ready queue pointer
18 .xdef _MT_IDct * task ID counter
19*
20 .xdef MT_ITCB1 * Interrupt level 1 TCB
21 .xdef MT_ITCB2 * Interrupt level 2 TCB
22 .xdef MT_ITCB3 * Interrupt level 3 TCB
23 .xdef MT_ITCB4 * Interrupt level 4 TCB
24 .xdef MT_ITCB5 * Interrupt level 5 TCB
25 .xdef __MTptcb * Private TCBs
26*
27 .xdef MT_ISEM1 * Interrupt level 1 semaphore
28 .xdef _MTISem1
29 .xdef MT_ISEM2 * Interrupt level 2 semaphore
30 .xdef _MTISem2
31 .xdef MT_ISEM3 * Interrupt level 3 semaphore
32 .xdef _MTISem3
33 .xdef MT_ISEM4 * Interrupt level 4 semaphore
34 .xdef _MTISem4
35 .xdef MT_ISEM5 * Interrupt level 5 semaphore
36 .xdef _MTISem5
37 .xdef _SemTick * Timer semaphore (1MS ticks)
38 .xdef _SemFCLK * Score frame clock semaphore
39 .xdef _SemAPI * Analog FIFO not-empty semaphore
40 .xdef _SemQuit
41*
42 .xdef __MT_Vc1 * Saved TRAP 8 vector
43 .xdef __MT_Vc2 * Saved TRAP 9 vector
44 .xdef _MT_NTpc * Logged PC for 'next' trap
45 .xdef _MT_STpc * Logged PC for 'swap' trap
46 .xdef _MT_LTCB * Last TCB address from MT_CurP
47 .xdef _MT_LSpc * Last PC from SM_Sig
48 .xdef _MT_LWpc * Last PC from SM_Wait
49*
50 .xdef _sr1_ior * Serial port 1 iorec
51 .xdef _sr2_ior * Serial port 2 iorec
52 .xdef _mc1_ior * MIDI port 1 iorec
53 .xdef _mc2_ior * MIDI port 2 iorec
54*
55 .page
56*
57 .ifeq DEBUGGER
58*
59 .xdef MTVARS * second part of MT variables
60*
61 .endc
62*
63* ------------------------------------------------------------------------------
64TCBLEN_B .equ 96 * length of a TCB in bytes
65TCBLEN_W .equ (TCBLEN_B/2) * length of a TCB in words
66*
67IORECLN .equ 56 * length of an iorec structure in bytes
68MBOXLEN .equ 16 * length of an MBOX structure in bytes
69* ------------------------------------------------------------------------------
70 .page
71*
72 .ifne DEBUGGER
73*
74MT_base .equ $50000 * base of Multi-Tasker RAM area
75*
76 .endc
77*
78 .ifeq DEBUGGER
79*
80MT_base: .ds.w 7 * base of Multi-Tasker RAM area
81*
82 .endc
83*
84* Multi-Tasker control variables (MTStruct)
85* ------------------------------
86_MT_TCBs .equ MT_base * LONG - TCB pool chain pointer
87_MT_CurP .equ _MT_TCBs+4 * LONG - pointer to current TCB
88_MT_RdyQ .equ _MT_CurP+4 * LONG - head of ready queue
89_MT_IDct .equ _MT_RdyQ+4 * WORD - task ID counter
90*
91* Interrupt level TCBs
92* --------------------
93MT_ITCB1 .equ _MT_IDct+2 * Level 1 -- VSDD
94MT_ITCB2 .equ MT_ITCB1+TCBLEN_B * Level 2 -- FPU
95MT_ITCB3 .equ MT_ITCB2+TCBLEN_B * Level 3 -- Analog
96MT_ITCB4 .equ MT_ITCB3+TCBLEN_B * Level 4 -- Timer
97MT_ITCB5 .equ MT_ITCB4+TCBLEN_B * Level 5 -- Serial I/O
98*
99__MTptcb .equ MT_ITCB5+TCBLEN_B * Private TCBs
100*
101* Interrupt level sempahores
102* --------------------------
103MT_ISEM1 .equ __MTptcb+(2*TCBLEN_B) * LONG - VSDD
104MT_ISEM2 .equ MT_ISEM1+4 * LONG - FPU
105MT_ISEM3 .equ MT_ISEM2+4 * LONG - analog
106MT_ISEM4 .equ MT_ISEM3+4 * LONG - timer
107MT_ISEM5 .equ MT_ISEM4+4 * LONG - serial I/O
108*
109* Other multi-tasker variables
110* ----------------------------
111_SemTick .equ MT_ISEM5+4 * LONG - 1 Ms Timer semaphore
112_SemFCLK .equ _SemTick+4 * LONG - Frame clock semaphore
113_SemAPI .equ _SemFCLK+4 * LONG - Analog FIFO semaphore
114_SemQuit .equ _SemAPI+4 * LONG - Terminate semaphore
115*
116_MSG_Vid .equ _SemQuit+4 * STRUCT - Video mailbox
117*
118__MT_Vc1 .equ _MSG_Vid+MBOXLEN * LONG - Save TRAP 8 vector
119__MT_Vc2 .equ __MT_Vc1+4 * LONG - Save TRAP 8 vector
120_MT_NTpc .equ __MT_Vc2+4 * LONG - Logged PC for 'next'
121_MT_STpc .equ _MT_NTpc+4 * LONG - Logged PC for 'swap'
122_MT_LTCB .equ _MT_STpc+4 * LONG - Last TCB address
123_MT_LSpc .equ _MT_LTCB+4 * LONG - Last PC from SM_Sig
124_MT_LWpc .equ _MT_LSpc+4 * LONG - Last PC from SM_Wait
125*
126_sr1_ior .equ _MT_LWpc+4 * STRUCT - Serial-1 iorec
127_sr2_ior .equ _sr1_ior+IORECLN * STRUCT - Serial-2 iorec
128_mc1_ior .equ _sr2_ior+IORECLN * STRUCT - MIDI-1 iorec
129_mc2_ior .equ _mc1_ior+IORECLN * STRUCT - MIDI-2 iorec
130*
131MT_END .equ _mc2_ior+IORECLN
132MT_LEN .equ MT_END-MT_base
133*
134_MTISem1 .equ MT_ISEM1
135_MTISem2 .equ MT_ISEM2
136_MTISem3 .equ MT_ISEM3
137_MTISem4 .equ MT_ISEM4
138_MTISem5 .equ MT_ISEM5
139*
140MTStruct .equ MT_base
141* ------------------------------------------------------------------------------
142*
143 .ifeq DEBUGGER
144*
145MTVARS: .ds.b MT_LEN-14
146*
147 .endc
148*
149 .end
Note: See TracBrowser for help on using the repository browser.