📄 tct.s
字号:
# f23 Saved FPR23
# f24 Saved FPR24
# f25 Saved FPR25
# f26 Saved FPR26
# f27 Saved FPR27
# f28 Saved FPR28
# f29 Saved FPR29
# f30 Saved FPR30
# f31 Saved FPR31
# /* save GPR's */
# r14 Saved GPR14
# r15 Saved GPR15
# r16 Saved GPR16
# r17 Saved GPR17
# r18 Saved GPR18
# r19 Saved GPR19
# r20 Saved GPR20
# r21 Saved GPR21
# r22 Saved GPR22
# r23 Saved GPR23
# r24 Saved GPR24
# r25 Saved GPR25
# r26 Saved GPR26
# r27 Saved GPR27
# r28 Saved GPR28
# r29 Saved GPR29
# r30 Saved GPR30
# r31 Saved GPR31
# CTR Saved CTR
# XER Saved XER
# TCT_HISR_Shell Return address
# XXXX Old LR from DIAB/DATA
# (Higher Address) Stack Bottom, old SP (r1)-> XXXX Old SP from DIAB/DATA
# */
#
addi r9,r9,-8 # allow old SP from DIAB/DATA
li r8,0
addis r7,0,TCT_HISR_Shell@ha # This will normally be the LR
addi r7,r7,TCT_HISR_Shell@l
stw r7,0(r9) # Store entry address on stack
stwu r8,-4(r9) # store XER for restore
stwu r8,-4(r9) # store CTR for restore
stwu r8,-4(r9) # store r31 for space only
stwu r8,-4(r9) # store r30 for space only
stwu r8,-4(r9) # store r29 for space only
stwu r8,-4(r9) # store r28 for space only
stwu r8,-4(r9) # store r27 for space only
stwu r8,-4(r9) # store r26 for space only
stwu r8,-4(r9) # store r25 for space only
stwu r8,-4(r9) # store r24 for space only
stwu r8,-4(r9) # store r23 for space only
stwu r8,-4(r9) # store r22 for space only
stwu r8,-4(r9) # store r21 for space only
stwu r8,-4(r9) # store r20 for space only
stwu r8,-4(r9) # store r19 for space only
stwu r8,-4(r9) # store r18 for space only
stwu r8,-4(r9) # store r17 for space only
stwu r8,-4(r9) # store r16 for space only
stwu r8,-4(r9) # store r15 for space only
stwu r8,-4(r9) # store r14 for space only
#
# /* Check for the floating point being enabled */
#
mfmsr r12
ori r11,r12,0
andi. r11,r11,0x2000
beq TCT_BHS_No_FPRS # equal to zero
#
# /* Store the floating point only if enabled. */
#
stwu r8,-4(r9) # store f31 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f30 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f29 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f28 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f27 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f26 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f25 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f24 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f23 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f22 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f21 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f20 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f19 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f18 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f17 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f16 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f15 for space only
stwu r8,-4(r9)
stwu r8,-4(r9) # store f14 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 - 152;
#
addi r10,r10,-152
#
# /* Save the minimum amount of remaining stack memory. */
# /* This is done to save the possible floating registers */
#
stw r10,64(r3) # TWELLER 12.13.2001 orig: r10,60(r3)
#
TCT_BHS_No_FPRS:
#
# /* Store the MSR value for compatibility with SingleStep MTD */
#
stwu r12,-4(r9)
stwu r8,-4(r9) # store solicited stack type
#
# /* Allocate the extra space for the DIAB/DATA C to ASM interface */
#
addi r9,r9,-12
#
# /* Save the new stack pointer into the task's control block. */
# hisr -> tc_stack_pointer = (VOID *) Current_Stack_Top;
#
stw r9,56(r3)
#
# /* Return to caller */
#
blr
#
#}
#
#/*************************************************************************/
#/* */
#/* FUNCTION */
#/* */
#/* TCT_Build_Signal_Frame */
#/* */
#/* DESCRIPTION */
#/* */
#/* This function builds a frame on top of the task's stack to */
#/* cause the task's signal handler to execute the next time */
#/* the task is executed. */
#/* */
#/* CALLED BY */
#/* */
#/* TCC_Send_Signals Send signals to a task */
#/* */
#/* CALLS */
#/* */
#/* None */
#/* */
#/* INPUTS */
#/* */
#/* task (argument in r3) Task control block pointer */
#/* */
#/* OUTPUTS */
#/* */
#/* None */
#/* */
#/* HISTORY */
#/* */
#/* NAME DATE REMARKS */
#/* */
#/* Barry Sellew 06-24-1996 Created initial version 1.0 */
#/* */
#/*************************************************************************/
#VOID TCT_Build_Signal_Frame(TC_TCB *task)
#{
.text
.align 2
TCT_Build_Signal_Frame:
#
# /* Pickup the stack pointer. */
# REG_Stack_Ptr = (BYTE_PTR) task -> tc_stack_pointer;
#
lwz r9,56(r3)
#
# /* Reference the Signal shell. */
# REG_Function_Ptr = (VOID *) TCC_Signal_Shell;
#
# /* Build a signal stack. This signal stack frame facilitates an
# solicited return to the TCC_Signal_Shell function, which in turn
# invokes the appropriate signal handler. 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
# r14 Saved GPR14
# r15 Saved GPR15
# r16 Saved GPR16
# r17 Saved GPR17
# r18 Saved GPR18
# r19 Saved GPR19
# r20 Saved GPR20
# r21 Saved GPR21
# r22 Saved GPR22
# r23 Saved GPR23
# r24 Saved GPR24
# r25 Saved GPR25
# r26 Saved GPR26
# r27 Saved GPR27
# r28 Saved GPR28
# r29 Saved GPR29
# r30 Saved GPR30
# r31 Saved GPR31
# CTR Saved CTR
# CR Saved CR
# TCC_Signal_Shell Return address
# XXXX Old LR from DIAB/DATA
# (Higher Address) Stack Bottom, old SP (r1)-> XXXX Old SP from DIAB/DATA
#
addi r9,r9,-8 # allow old SP and LR from DIAB/DATA
li r8,0
addis r7,0,TCC_Signal_Shell@ha
addi r7,r7,TCC_Signal_Shell@l
stwu r7,0(r9) # Store entry address on stack
stwu r8,-4(r9) # store CR for restore
stwu r8,-4(r9) # store CTR for restore
stwu r8,-4(r9) # store r31 for space only
stwu r8,-4(r9) # store r30 for space only
stwu r8,-4(r9) # store r29 for space only
stwu r8,-4(r9) # store r28 for space only
stwu r8,-4(r9) # store r27 for space only
stwu r8,-4(r9) # store r26 for space only
stwu r8,-4(r9) # store r25 for space only
stwu r8,-4(r9) # store r24 for space only
stwu r8,-4(r9) # store r23 for space only
stwu r8,-4(r9) # store r22 for space only
stwu r8,-4(r9) # store r21 for space only
stwu r8,-4(r9) # store r20 for space only
stwu r8,-4(r9) # store r19 for space only
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -