annotate level2/modules/kernel/falltsk.asm @ 3165:2d22d31bc74b

L2 kernel: Minor comment tweaks
author Neal Crook <foofoobedoo@gmail.com>
date Thu, 06 Apr 2017 22:51:54 +0100
parents 039ddb7c8ad7
children 18306d646f71
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
1 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
2 * System Call: F$AllTsk
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
3 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
4 * Function: Allocate process task number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
5 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
6 * Input: X = Process descriptor pointer
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
7 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
8 * Output: None
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
9 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
10 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
11 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
12 FAllTsk ldx R$X,u get pointer to process descriptor
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
13 L0C58 ldb P$Task,x already have a task #?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
14 bne L0C64 yes, return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
15 bsr L0CA6 find a free task
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
16 bcs L0C65 error, couldn't get one, return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
17 stb P$Task,x save task #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
18 bsr L0C79 load MMU with task
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
19 L0C64 clrb clear errors
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
20 L0C65 rts return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
22
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
23 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
24 * System Call: F$DelTsk
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
25 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
26 * Function: Deallocate process task number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
27 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
28 * Input: X = Process descriptor pointer
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
29 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
30 * Output: None
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
31 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
32 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
33 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
34 FDelTsk ldx R$X,u
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
35 L0C68 ldb P$Task,x grab the current task number
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
36 beq L0C64 if system (or released), exit
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
37 clr P$Task,x force the task number to be zero
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
38 bra L0CC3 do a F$RelTsk
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
39
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
40 TstImg equ *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
41 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
42 tim #ImgChg,P$State,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
43 ELSE
1246
c90c8b615f8c Changed register usage from A to B, removed pshs/puls
boisy
parents: 1241
diff changeset
44 * pshs b
c90c8b615f8c Changed register usage from A to B, removed pshs/puls
boisy
parents: 1241
diff changeset
45 ldb P$State,x
c90c8b615f8c Changed register usage from A to B, removed pshs/puls
boisy
parents: 1241
diff changeset
46 bitb #ImgChg
c90c8b615f8c Changed register usage from A to B, removed pshs/puls
boisy
parents: 1241
diff changeset
47 * puls b
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
48 ENDC
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
49 beq L0C65 if not, exit now: don't clear carry, it's not needed
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
50 fcb $8C skip LDX, below
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
51
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
52
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
53 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
54 * System Call: F$SetTsk
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
55 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
56 * Function: Set process task DAT registers
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
57 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
58 * Input: X = Process descriptor pointer
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
59 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
60 * Output: None
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
61 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
62 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
63 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
64 FSetTsk ldx R$X,u get process descriptor pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
65 L0C79 equ *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
66 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
67 aim #^ImgChg,P$State,x flag DAT image change in process descriptor
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
68 ELSE
1246
c90c8b615f8c Changed register usage from A to B, removed pshs/puls
boisy
parents: 1241
diff changeset
69 * pshs b
c90c8b615f8c Changed register usage from A to B, removed pshs/puls
boisy
parents: 1241
diff changeset
70 ldb P$State,x
c90c8b615f8c Changed register usage from A to B, removed pshs/puls
boisy
parents: 1241
diff changeset
71 andb #^ImgChg
c90c8b615f8c Changed register usage from A to B, removed pshs/puls
boisy
parents: 1241
diff changeset
72 stb P$State,x
c90c8b615f8c Changed register usage from A to B, removed pshs/puls
boisy
parents: 1241
diff changeset
73 * puls b
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
74 ENDC
3165
2d22d31bc74b L2 kernel: Minor comment tweaks
Neal Crook <foofoobedoo@gmail.com>
parents: 3123
diff changeset
75 clr <D.Task1N task 1 DAT image has changed
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
76 andcc #^Carry clear carry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
77 pshs cc,d,x,u preserve everything
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
78 ldb P$Task,x get task #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
79 leau <P$DATImg,x point to DAT image
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
80 ldx <D.TskIPt get task image table pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
81 lslb account for 2 bytes/entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
82 stu b,x save DAT image pointer in task table
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
83 cmpb #2 is it either system or GrfDrv?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
84 bhi L0C9F no, return
1241
716c84dca8e4 Source enhancements
boisy
parents: 1239
diff changeset
85 ldx #DAT.Regs update system DAT image
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
86 lbsr L0E93 go bash the hardware
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
87 L0C9F puls cc,d,x,u,pc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
88
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
89
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
90 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
91 * System Call: F$ResTsk
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
92 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
93 * Function: Reserve task number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
94 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
95 * Input: None
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
96 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
97 * Output: B = Task number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
98 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
99 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
100 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
101 FResTsk bsr L0CA6
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
102 stb R$B,u
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
103 L0CA5 rts
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
104
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
105
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
106 * Find a free task in task map
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
107 * Entry: None
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
108 * Exit : B=Task #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
109 L0CA6 pshs x preserve X
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
110 ldb #$02 get starting task # (skip System/Grfdrv)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
111 ldx <D.Tasks get task table pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
112 L0CAC lda b,x task allocated?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
113 beq L0CBA no, allocate it & return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
114 incb move to next task
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
115 cmpb #$20 end of task list?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
116 bne L0CAC no, keep looking
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
117 comb set carry for error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
118 ldb #E$NoTask get error code
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
119 puls x,pc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
120
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
121 L0CBA stb b,x flag task used (1 cycle faster than inc)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
122 * orb <D.SysTsk merge in system task # ??? always 0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
123 clra clear carry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
124 L0CBF puls x,pc restore & return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
125
1345
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
126
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
127 **************************************************
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
128 * System Call: F$RelTsk
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
129 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
130 * Function: Release task number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
131 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
132 * Input: B = Task number
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
133 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
134 * Output: None
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
135 *
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
136 * Error: CC = C bit set; B = error code
1da8ab9ba433 Added consistent comments to each system call
boisy
parents: 1246
diff changeset
137 *
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
138 FRelTsk ldb R$B,u Get task # to release
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
139 L0CC3 pshs b,x Preserve it & X
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
140 * ??? No idea why this stuff is done. D.SysTsk is ALWAYS 0.
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
141 * Even GrfDrv never changes it.
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
142 * ldb <D.SysTsk Get system task #
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
143 * comb Invert it
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
144 * andb ,s Mask with requested task
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
145 tstb check out B
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
146 beq L0CD0 If system task, don't bother deleting the task
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
147 ldx <D.Tasks Get task table ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
148 clr b,x Clear out the task
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
149 L0CD0 puls b,x,pc Restore regs & return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
150
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
151 * Sleeping process update (Gets executed from clock)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
152 * Could move this code into Clock, but what about the call to F$AProc (L0D11)?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
153 * It probably will be OK... but have to check.
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
154 * Possible, move ALL software-clock code into OS9p2, and therefore
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
155 * have it auto-initialize? All hardware clocks would then be called
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
156 * just once a minute.
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
157 L0CD2 ldx <D.SProcQ Get sleeping process Queue ptr
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
158 beq L0CFD None (no one sleeping), so exit
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
159 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
160 tim #TimSleep,P$State,x Is it a timed sleep?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
161 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
162 ldb P$State,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
163 bitb #TimSleep
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
164 ENDC
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
165 beq L0CFD No, exit: waiting for signal/interrupt
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
166 ldu P$SP,x Yes, get his stack pointer
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
167 ldd R$X,u Get his sleep tick count
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
168 IFNE H6309
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
169 decd decrement sleep count
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
170 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
171 subd #$0001
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
172 ENDC
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
173 std R$X,u Save it back
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
174 bne L0CFD Still more ticks to go, so exit
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
175 * Process needs to wake up, update queue pointers
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
176 L0CE7 ldu P$Queue,x Get next process in Queue
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
177 bsr L0D11 activate it
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
178 leax ,u point to new process
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
179 beq L0CFB don't exist, go on
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
180 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
181 tim #TimSleep,P$State,x is it in a timed sleep?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
182 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
183 ldb P$State,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
184 bitb #TimSleep
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
185 ENDC
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
186 beq L0CFB no, go update process table
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
187 ldu P$SP,x get it's stack pointer
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
188 ldd R$X,u any sleep time left?
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
189 beq L0CE7 no, go activate next process in queue
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
190 L0CFB stx <D.SProcQ Store new sleeping process pointer
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
191 L0CFD dec <D.Slice Any time remaining on process?
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
192 bne L0D0D Yes, exit
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
193 inc <D.Slice reset slice count
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
194 ldx <D.Proc Get current process pointer
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
195 beq L0D0D none, return
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
196 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
197 oim #TimOut,P$State,x put him in a timeout state
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
198 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
199 ldb P$State,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
200 orb #TimOut
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
201 stb P$State,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
202 ENDC
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
203 L0D0D clrb
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 1345
diff changeset
204 rts