annotate level2/modules/kernel/faproc.asm @ 2118:7fca19b7c923

ChangeLog udpated FSRqMem optimization added
author boisy
date Fri, 24 Aug 2007 03:30:33 +0000
parents ca83286ded5b
children 039ddb7c8ad7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
1 **************************************************
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
2 * System Call: F$AProc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
3 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
4 * Function: Insert process into active process queue
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
5 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
6 * Input: X = Address of process descriptor
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
7 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
8 * Output: None
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
9 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
10 * Error: CC = C bit set; B = error code
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
11 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
12 FAProc ldx R$X,u Get ptr to process to activate
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
13 L0D11 clrb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
14 pshs cc,b,x,y,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
15 lda P$Prior,x Get process priority
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
16 sta P$Age,x Save it as age (How long it's been around)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
17 orcc #IntMasks Shut down IRQ's
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
18 ldu #(D.AProcQ-P$Queue) Get ptr to active process queue
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
19 bra L0D29 Go through the chain
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
20 * Update active process queue
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21 * X=Process to activate
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
22 * U=Current process in queue links
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
23 L0D1F inc P$Age,u update current process age
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
24 bne L0D25 wrap?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
25 dec P$Age,u yes, reset it to max.
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
26 L0D25 cmpa P$Age,u match process ages??
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
27 bhi L0D2B no, skip update
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
28 L0D29 leay ,u point Y to current process
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
29 L0D2B ldu P$Queue,u get pointer to next process in chain
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
30 bne L0D1F Still more in chain, keep going
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
31 ldd P$Queue,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
32 stx P$Queue,y save new process to chain
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
33 std P$Queue,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
34 puls cc,b,x,y,u,pc