📄 tct.s
字号:
stwu r8,-4(r9) # store r11 zero for space only
stwu r8,-4(r9) # store r10 zero for space only
stwu r8,-4(r9) # store r9 zero for space only
#
# /* Save the PC, MSR, LR, CR, XTR, and CTR registers */
#
addis r7,0,TCC_Task_Shell@ha
addi r7,r7,TCC_Task_Shell@l
stwu r7,-4(r9) # save SRR0/TCC_Task_Shell address
mfmsr r7 # read current MSR value
stwu r7,-4(r9) # store MSR for SRR1 restore
stwu r8,-4(r9) # save LR for restore
stwu r8,-4(r9) # save CR for restore
stwu r8,-4(r9) # save XTR for restore
stwu r8,-4(r9) # save CTR for restore
#
# /* Store GPR's */
#
stwu r8,-4(r9) # store r31 zero for space only
stwu r8,-4(r9) # store r30 zero for space only
stwu r8,-4(r9) # store r29 zero for space only
stwu r8,-4(r9) # store r28 zero for space only
stwu r8,-4(r9) # store r27 zero for space only
stwu r8,-4(r9) # store r26 zero for space only
stwu r8,-4(r9) # store r25 zero for space only
stwu r8,-4(r9) # store r24 zero for space only
stwu r8,-4(r9) # store r23 zero for space only
stwu r8,-4(r9) # store r22 zero for space only
stwu r8,-4(r9) # store r21 zero for space only
stwu r8,-4(r9) # store r20 zero for space only
stwu r8,-4(r9) # store r19 zero for space only
stwu r8,-4(r9) # store r18 zero for space only
stwu r8,-4(r9) # store r17 zero for space only
stwu r8,-4(r9) # store r16 zero for space only
stwu r8,-4(r9) # store r15 zero for space only
stwu r8,-4(r9) # store r14 zero for space only
stwu r8,-4(r9) # store r8 zero for space only
stwu r8,-4(r9) # store r7 zero for space only
stwu r8,-4(r9) # store r6 zero for space only
stwu r8,-4(r9) # store r5 zero for space only
stwu r8,-4(r9) # store r4 zero for space only
stwu r8,-4(r9) # store r3 zero for space only
stwu r8,-4(r9) # store r0 zero for space only
#
# /* Check to see if floating point is enabled */
#
ori r11,r7,0
andi. r11,r11,0x2000
beq TCT_BTS_No_FPRS # equal to zero
#
# /* Store the floating point registers only if enabled. */
#
stwu r8,-4(r9) # store f31 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f30 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f29 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f28 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f27 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f26 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f25 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f24 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f23 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f22 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f21 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f20 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f19 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f18 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f17 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f16 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f15 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f14 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f13 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f12 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f11 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f10 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f9 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f8 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f7 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f6 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f5 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f4 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f3 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f2 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f1 zero for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f0 zero for space only
stwu r8,-4(r9)
mffs f0 # get value of FPSCR
stfdu f0,-8(r9) # save FPSCR on stack
#
# /* Save the extra amount for FPR's on stack memory. */
# task -> tc_stack_minimum = REG_Stack_Size - 264;
#
addi r10,r10,-264
#
TCT_BTS_No_FPRS:
#
# /* Store the MSR which will be used to test for floating point */
# /* Store the MSR for compatibility with SingleStep MTD */
#
stwu r7,-4(r9)
#
# /* Set interrupt stack type flag */
#
li r8,1
stwu r8,-4(r9) # store the stack flag type
addi r9,r9,-12 # subtract 12 bytes for DIAB/DATA
# location which will be used
# by the C to ASM calling convetion
# and next available space.
#
# /* Save the new stack pointer into the task's control block. */
# task -> tc_stack_pointer = (VOID *) Current_Stack_Top;
#
stw r9,56(r3)
#
# /* Return to caller */
#
blr
#}
#
#/*************************************************************************/
#/* */
#/* FUNCTION */
#/* */
#/* TCT_Build_HISR_Stack */
#/* */
#/* DESCRIPTION */
#/* */
#/* This function builds an HISR stack frame that allows quick */
#/* scheduling of the HISR. */
#/* */
#/* CALLED BY */
#/* */
#/* TCC_Create_HISR Create HISR function */
#/* */
#/* CALLS */
#/* */
#/* None */
#/* */
#/* INPUTS */
#/* */
#/* hisr (argument in r3) HISR control block pointer */
#/* */
#/* OUTPUTS */
#/* */
#/* None */
#/* */
#/* HISTORY */
#/* */
#/* NAME DATE REMARKS */
#/* */
#/* Barry Sellew 06-24-1996 Created initial version 1.0 */
#/* */
#/*************************************************************************/
#VOID TCT_Build_HISR_Stack(TC_HCB *hisr)
#{
.text
.align 2
TCT_Build_HISR_Stack:
#
# /* Pickup the stack base. */
# REG_Stack_Base = (BYTE_PTR) hisr -> tc_stack_start;
#
lwz r11,48(r3)
#
# /* Pickup the stack size. */
# REG_Stack_Size = hisr -> tc_stack_size;
#
lwz r10,60(r3)
#
# /* Calculate the stack ending address. */
# REG_Stack_End = REG_Stack_Base + REG_Stack_Size;
#
add r9,r11,r10
rlwinm r9,r9,0,0,29 # word alignment
#
# /* Save the stack ending address. */
# hisr -> tc_stack_end = REG_Stack_End;
#
subi r9,r9,0x10
stw r9,52(r3)
#
addi r10,r10,-112
#
# /* Save the minimum amount of remaining stack memory. */
# task -> tc_stack_minimum = REG_Stack_Size - 112;
#
stw r10,64(r3)
#
# /* Reference the HISR shell. */
# REG_Function_Ptr = (VOID *) TCT_HISR_Shell;
#
#
# /* Build an initial stack. This initial stack frame facilitates an
# solicited return to the TCT_HISR_Shell function, which in turn
# invokes the appropriate HISR. The initial HISR stack frame has the
# following format:
#
# (Lower Address) Stack Top, new SP (r9) -> XXXX Empty space for store
# XXXX DIAB/DATA LR
# XXXX DIAB/DATA SP
# 0 (Solicited stack type)
# MSR Current MSR value
# Note: The floating point registers are only saved if the
# MSR[FP] bit is set/enabled.
# FPSCR Saved FPSCR
# f14 Saved FPR14
# f15 Saved FPR15
# f16 Saved FPR16
# f17 Saved FPR17
# f18 Saved FPR18
# f19 Saved FPR19
# f20 Saved FPR20
# f21 Saved FPR21
# f22 Saved FPR22
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -