Lines Matching refs:stack
73 * If pcb.ksp == 0 then the kernel stack is already busy,
74 * we make a stack frame
77 * its stack pointer.
79 * otherwise we make a stack frame and
80 * the kernel stack (setting pcb.ksp to 0)
83 * and pcb.ksp is set to the top of stack
86 /* TRAP_SPACE_NEEDED is the space assumed free on the kernel stack when
90 * may be much more). We're trying to catch kernel stack overflows :-)
104 lwz r1,PP_ISTACKPTR(r25) ; Get interrupt stack pointer
106 cmpwi cr0,r1,0 ; Are we on interrupt stack?
108 beq- cr0,EXT(ihandler) ; If on interrupt stack, treat this as interrupt...
112 lwz r1,ACT_MACT_KSP(r13) ; Get the top of kernel stack
121 lwz r9,THREAD_KERNEL_STACK(r6) ; Get our kernel stack start
122 cmpwi cr1,r1,0 ; Are we already on kernel stack?
124 lwz r26,saver1+4(r4) ; Get the stack at interrupt time
126 bne+ cr1,.L_kstackfree ; We are not on kernel stack yet...
128 subi r1,r26,FM_REDZONE ; Make a red zone on interrupt time kernel stack
132 sub r9,r1,r9 ; Get displacment into the kernel stack
134 rlwinm. r0,r9,0,28,31 ; Verify that we have a 16-byte aligned stack (and get a 0)
135 cmplwi cr2,r9,KERNEL_STACK_SIZE ; Do we still have room on the stack?
136 beq cr1,.L_state_on_kstack ; using above test for pcb/stack
138 stw r0,ACT_MACT_KSP(r13) ; Show that we have taken the stack
144 subi r1,r1,FM_SIZE ; Push a header onto the current stack
145 bgt-- cr2,kernelStackBad ; Kernel stack is bogus...
252 stw r11,SAVflags(r3) ; Save back the flags (with reset stack cleared)
254 lwz r5,THREAD_KERNEL_STACK(r1) ; Get the base pointer to the stack
260 stw r5,ACT_MACT_KSP(r8) ; Save the empty stack pointer
265 ; Here is where we go when we detect that the kernel stack is all messed up.
271 lwz r3,PP_DEBSTACK_TOP_SS(r25) ; Pick up debug stack top
272 subi r3,r3,KERNEL_STACK_SIZE-FM_SIZE ; Adjust to start of stack
273 sub r3,r1,r3 ; Get displacement into debug stack
274 cmplwi cr2,r3,KERNEL_STACK_SIZE-FM_SIZE ; Check if we are on debug stack
279 li r3,failStack ; Bad stack code
285 li r3,failUnalignedStk ; Unaligned stack code
300 * If pcb.ksp == 0 then the kernel stack is already busy,
308 * and pcb.ksp is set to the top of stack.
327 lwz r17,PP_ISTACKPTR(r25) ; Get interrupt stack pointer
329 mr. r17,r17 ; Are we on interrupt stack?
331 beq-- EXT(ihandler) ; On interrupt stack, not allowed...
362 lwz r1,ACT_MACT_KSP(r13) ; Get the kernel stack pointer
364 mr. r1,r1 ; Are we already on the kernel stack?
379 lwz r15,saver1+4(r4) ; Grab interrupt time stack
381 stw r0,ACT_MACT_KSP(r13) ; Mark stack as busy with 0 val
382 stw r15,FM_BACKPTR(r1) ; Link stack frame backwards
420 stwu r1,-(FM_SIZE+ARG_SIZE+MUNGE_ARGS_SIZE)(r1) ; Make a stack frame
757 lwz r5,THREAD_KERNEL_STACK(r31) ; Get the base pointer to the stack
763 stw r5,ACT_MACT_KSP(r8) ; Save the empty stack pointer
894 * interrupt stack.
903 lwz r1,PP_ISTACKPTR(r25) ; Get the interrupt stack
915 lwz r9,saver1+4(r4) ; Pick up the rupt time stack
924 /* We're already on the interrupt stack, get back the old
925 * stack pointer and make room for a frame
928 lwz r10,PP_INTSTACK_TOP_SS(r25) ; Get the top of the interrupt stack
929 addi r5,r9,INTSTACK_SIZE-FM_SIZE ; Shift stack for bounds check
931 sub r5,r5,r10 ; Get displacement into stack
932 cmplwi r5,INTSTACK_SIZE-FM_SIZE ; Is the stack actually invalid?
933 blt+ ihsetback ; The stack is ok...
935 lwz r5,PP_DEBSTACK_TOP_SS(r25) ; Pick up debug stack top
936 subi r5,r5,KERNEL_STACK_SIZE-FM_SIZE ; Adjust to start of stack
937 sub r5,r1,r5 ; Get displacement into debug stack
938 cmplwi cr2,r5,KERNEL_STACK_SIZE-FM_SIZE ; Check if we are on debug stack
943 li r3,failStack ; Bad stack code
949 li r3,failUnalignedStk ; Unaligned stack code
955 rlwinm. r0,r1,0,28,31 ; Check if stack is aligned (and get 0)
958 stw r0,PP_ISTACKPTR(r25) ; Mark the stack in use
959 oris r10,r10,hi16(SAVrststk) ; Indicate we reset stack when we return from this one
964 * the stack is marked as busy. We now generate a small
965 * stack frame with backpointers to follow the calling
1045 andis. r11,r7,hi16(SAVrststk) ; Is this the first on the stack?
1048 beq .L_no_int_ast2 ; Get going if not the top-o-stack...
1051 /* We're the last frame on the stack. Restore istackptr to empty state.
1057 lwz r9,PP_INTSTACK_TOP_SS(r10) ; Get the empty stack value
1058 andc r7,r7,r11 ; Remove the stack reset bit in case we pass this one
1109 ; R4 = New top of savearea stack (could be 0)
1654 stw r11,SAVflags(r3) ; Save back the flags (with reset stack cleared)
1658 lwz r5,THREAD_KERNEL_STACK(r1) ; Get the base pointer to the stack
1660 stw r5,ACT_MACT_KSP(r8) ; Save the empty stack pointer
1674 ; or stack guardpage violations.
1676 ; Note that we can not set a back chain in the stack when we come
1692 lwz r1,PP_DEBSTACKPTR(r25) ; Get debug stack pointer
1705 mr. r1,r1 ; See if we are on debug stack yet
1708 bne chokestart ; We are not on the debug stack yet...
1710 lwz r2,PP_DEBSTACK_TOP_SS(r25) ; Get debug stack top
1711 sub r11,r2,r10 ; Get stack depth
1713 cmplwi r11,KERNEL_STACK_SIZE-FM_SIZE-TRAP_SPACE_NEEDED ; Check if stack pointer is ok
1714 bgt chokespin ; Bad stack pointer or too little left, just die...