-fckact: mr. r26,r26 ; (TEST/DEBUG)
- bne+ fckact2 ; (TEST/DEBUG)
-
- lwz r28,THREAD_PSTHRN(r28) ; (TEST/DEBUG) Next in line
- subi r27,r27,1 ; (TEST/DEBUG)
- b fcknxtth ; (TEST/DEBUG)
-
-fckact2: lwz r20,ACT_MACT_FPU(r26) ; (TEST/DEBUG) Get FPU chain
- li r29,1 ; (TEST/DEBUG)
- li r22,0 ; (TEST/DEBUG)
-
-fckact3: mr. r20,r20 ; (TEST/DEBUG) Are there any?
- beq+ fckact5 ; (TEST/DEBUG) No...
-
- addi r22,r22,1 ; (TEST/DEBUG) Count chain depth
-
- lwz r21,SAVflags(r20) ; (TEST/DEBUG) Get the flags
- rlwinm. r21,r21,0,1,1 ; (TEST/DEBUG) FP busy?
- bne+ fckact3a ; (TEST/DEBUG) Yeah...
- lis r27,hi16(EXT(DebugWork)) ; (TEST/DEBUG)
- ori r27,r27,lo16(EXT(DebugWork)) ; (TEST/DEBUG)
- stw r27,0(r27) ; (TEST/DEBUG)
- BREAKPOINT_TRAP ; (TEST/DEBUG) Die
-
-fckact3a: cmplwi r22,1 ; (TEST/DEBUG) At first SA?
- beq+ fckact3b ; (TEST/DEBUG) Yeah, invalid is ok...
- lwz r21,SAVlvlfp(r20) ; (TEST/DEBUG) Get level
- cmplwi r21,1 ; (TEST/DEBUG) Is it invalid?
- bne+ fckact3b ; (TEST/DEBUG) Nope, it is ok...
- lis r27,hi16(EXT(DebugWork)) ; (TEST/DEBUG)
- ori r27,r27,lo16(EXT(DebugWork)) ; (TEST/DEBUG)
- stw r27,0(r27) ; (TEST/DEBUG)
- BREAKPOINT_TRAP ; (TEST/DEBUG) Die
-
-fckact3b: lwz r21,SAVact(r20) ; (TEST/DEBUG) Get the owner
- cmplw r21,r26 ; (TEST/DEBUG) Correct activation?
- beq+ fckact3c ; (TEST/DEBUG) Yup...
- lis r27,hi16(EXT(DebugWork)) ; (TEST/DEBUG)
- ori r27,r27,lo16(EXT(DebugWork)) ; (TEST/DEBUG)
- stw r27,0(r27) ; (TEST/DEBUG)
- BREAKPOINT_TRAP ; (TEST/DEBUG) Die
-
-fckact3c: ; (TEST/DEBUG)
- lbz r21,SAVflags+3(r20) ; (TEST/DEBUG) Pick up the test byte
- mr. r21,r21 ; (TEST/DEBUG) marked?
- beq+ fckact4 ; (TEST/DEBUG) No, good...
-
- lis r27,hi16(EXT(DebugWork)) ; (TEST/DEBUG)
- ori r27,r27,lo16(EXT(DebugWork)) ; (TEST/DEBUG)
- stw r27,0(r27) ; (TEST/DEBUG)
- BREAKPOINT_TRAP ; (TEST/DEBUG)
-
-fckact4: stb r29,SAVflags+3(r20) ; (TEST/DEBUG) Set the test byte
- lwz r20,SAVprefp(r20) ; (TEST/DEBUG) Next in list
- b fckact3 ; (TEST/DEBUG) Try it...
-
-fckact5: lwz r20,ACT_MACT_FPU(r26) ; (TEST/DEBUG) Get FPU chain
- li r29,0 ; (TEST/DEBUG)
-
-fckact6: mr. r20,r20 ; (TEST/DEBUG) Are there any?
- beq+ fcknact ; (TEST/DEBUG) No...
-
- stb r29,SAVflags+3(r20) ; (TEST/DEBUG) Clear the test byte
- lwz r20,SAVprefp(r20) ; (TEST/DEBUG) Next in list
- b fckact6 ; (TEST/DEBUG) Try it...
-
-fcknact: lwz r26,ACT_LOWER(r26) ; (TEST/DEBUG) Next activation
- b fckact ; (TEST/DEBUG)
-#endif
-
-
-#if 0
-;
-; Make sure in use count matches found savearea. This is
-; not always accurate. There is a variable "fuzz" factor in count.
-
- lis r28,hi16(EXT(default_pset)) ; (TEST/DEBUG)
- lis r27,hi16(EXT(DebugWork)) ; (TEST/DEBUG)
- ori r28,r28,lo16(EXT(default_pset)) ; (TEST/DEBUG)
- ori r27,r27,lo16(EXT(DebugWork)) ; (TEST/DEBUG)
- li r20,0 ; (TEST/DEBUG)
- lwz r26,0(r27) ; (TEST/DEBUG)
- lwz r27,psthreadcnt(r28) ; (TEST/DEBUG)
- mr. r26,r26 ; (TEST/DEBUG)
- lwz r28,psthreads(r28) ; (TEST/DEBUG)
- bnelr- ; (TEST/DEBUG)
-
-cknxtth: mr. r27,r27 ; (TEST/DEBUG)
- beq- cktotal ; (TEST/DEBUG)
-
- lwz r26,THREAD_TOP_ACT(r28) ; (TEST/DEBUG)
-
-ckact: mr. r26,r26 ; (TEST/DEBUG)
- bne+ ckact2 ; (TEST/DEBUG)
-
- lwz r28,THREAD_PSTHRN(r28) ; (TEST/DEBUG) Next in line
- subi r27,r27,1 ; (TEST/DEBUG)
- b cknxtth ; (TEST/DEBUG)
-
-ckact2: lwz r29,ACT_MACT_PCB(r26) ; (TEST/DEBUG)
-
-cknorm: mr. r29,r29 ; (TEST/DEBUG)
- beq- cknormd ; (TEST/DEBUG)
-
- addi r20,r20,1 ; (TEST/DEBUG) Count normal savearea
-
- lwz r29,SAVprev(r29) ; (TEST/DEBUG)
- b cknorm ; (TEST/DEBUG)
-
-cknormd: lwz r29,ACT_MACT_FPU(r26) ; (TEST/DEBUG)
-
-ckfpu: mr. r29,r29 ; (TEST/DEBUG)
- beq- ckfpud ; (TEST/DEBUG)
-
- lwz r21,SAVflags(r29) ; (TEST/DEBUG)
- rlwinm. r21,r21,0,0,0 ; (TEST/DEBUG) See if already counted
- bne- cknfpu ; (TEST/DEBUG)
-
- addi r20,r20,1 ; (TEST/DEBUG) Count fpu savearea
-
-cknfpu: lwz r29,SAVprefp(r29) ; (TEST/DEBUG)
- b ckfpu ; (TEST/DEBUG)
-
-ckfpud: lwz r29,ACT_MACT_VMX(r26) ; (TEST/DEBUG)
-
-ckvmx: mr. r29,r29 ; (TEST/DEBUG)
- beq- ckvmxd ; (TEST/DEBUG)
-
- lwz r21,SAVflags(r29) ; (TEST/DEBUG)
- rlwinm. r21,r21,0,0,1 ; (TEST/DEBUG) See if already counted
- bne- cknvmx ; (TEST/DEBUG)
-
- addi r20,r20,1 ; (TEST/DEBUG) Count vector savearea
-
-cknvmx: lwz r29,SAVprevec(r29) ; (TEST/DEBUG)
- b ckvmx ; (TEST/DEBUG)
-
-ckvmxd: lwz r26,ACT_LOWER(r26) ; (TEST/DEBUG) Next activation
- b ckact ; (TEST/DEBUG)
-
-cktotal: lis r28,hi16(EXT(saveanchor)) ; (TEST/DEBUG)
- lis r27,hi16(EXT(real_ncpus)) ; (TEST/DEBUG)
- ori r28,r28,lo16(EXT(saveanchor)) ; (TEST/DEBUG)
- ori r27,r27,lo16(EXT(real_ncpus)) ; (TEST/DEBUG)
-
- lwz r21,SVinuse(r28) ; (TEST/DEBUG)
- lwz r27,0(r27) ; (TEST/DEBUG) Get the number of CPUs
- sub. r29,r21,r20 ; (TEST/DEBUG) Get number accounted for
- blt- badsave ; (TEST/DEBUG) Have too many in use...
- sub r26,r29,r27 ; (TEST/DEBUG) Should be 1 unaccounted for for each processor
- cmpwi r26,10 ; (TEST/DEBUG) Allow a 10 area slop factor
- bltlr+ ; (TEST/DEBUG)
-
-badsave: lis r27,hi16(EXT(DebugWork)) ; (TEST/DEBUG)
- ori r27,r27,lo16(EXT(DebugWork)) ; (TEST/DEBUG)
- stw r27,0(r27) ; (TEST/DEBUG)
- BREAKPOINT_TRAP ; (TEST/DEBUG)
-#endif