📄 int_ads.s
字号:
.skip 0x0700-(.-INT_Vectors) # Program error
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,7 # load vector number
ba INT_Shell
.skip 0x0900-(.-INT_Vectors) # Decrementer interrupt
ba INT_Timer_Interrupt
.skip 0x0C00-(.-INT_Vectors) # System call
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,12 # load vector number
ba INT_Shell
.skip 0x0D00-(.-INT_Vectors) # Trace
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,13 # load vector number
ba INT_Shell
.skip 0x1000-(.-INT_Vectors) # Software emulation
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,16 # load vector number
ba INT_Shell
.skip 0x1100-(.-INT_Vectors) # Instruction TLB miss
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,17 # load vector number
ba INT_Shell
.skip 0x1200-(.-INT_Vectors) # Data TLB miss
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,18 # load vector number
ba INT_Shell
.skip 0x1300-(.-INT_Vectors) # Instruction TLB error
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,19 # load vector number
ba INT_Shell
.skip 0x1400-(.-INT_Vectors) # Data TLB error
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,20 # load vector number
ba INT_Shell
.skip 0x1C00-(.-INT_Vectors) # Data breakpoint
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,28 # load vector number
ba INT_Shell
.skip 0x1D00-(.-INT_Vectors) # Instruction breakpoint
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,29 # load vector number
ba INT_Shell
.skip 0x1E00-(.-INT_Vectors) # Peripheral breakpoint
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,30 # load vector number
ba INT_Shell
.skip 0x1F00-(.-INT_Vectors) # Non-maskable development port
addi r1,r1,-8 # subtract 8 bytes for DIAB/DATA
stw r12,0(r1) # save r12
stwu r11,-4(r1) # save r11
stwu r10,-4(r1) # save r10
stwu r9,-4(r1) # save r9
mfspr r12,SRR0 # read the rfi PC value/SRR0
stwu r12,-4(r1) # save on the stack
li r11,31 # load vector number
ba INT_Shell
#
#/*************************************************************************/
#/* */
#/* FUNCTION */
#/* */
#/* INT_Initialize */
#/* */
#/* DESCRIPTION */
#/* */
#/* This function sets up the global system stack variable and */
#/* transfers control to the target independent initialization */
#/* function INC_Initialize. Responsibilities of this function */
#/* include the following: */
#/* */
#/* - Setup necessary processor/system control registers */
#/* - Initialize the vector table */
#/* - Setup the system stack pointers */
#/* - Setup the timer interrupt */
#/* - Calculate the timer HISR stack and priority */
#/* - Calculate the first available memory address */
#/* - Transfer control to INC_Initialize to initialize all of */
#/* the system components. */
#/* */
#/* AUTHOR */
#/* */
#/* Barry Sellew, Accelerated Technology, Inc. */
#/* */
#/* CALLED BY */
#/* */
#/* __init_main ENTRY routine in crt0.s which*/
#/* is supplied by DIABDATA. */
#/* */
#/* CALLS */
#/* */
#/* INC_Initialize Common initialization */
#/* */
#/* INPUTS */
#/* */
#/* None */
#/* */
#/* OUTPUTS */
#/* */
#/* None */
#/* */
#/* HISTORY */
#/* */
#/* NAME DATE REMARKS */
#/* */
#/* Barry Sellew 06-24-1996 Created initial version 1.0 */
#/* */
#/*************************************************************************/
#VOID INT_Initialize(void)
#{
.text
.align 2
INT_Initialize:
main:
__init_main: # global label for DIABDAT crt0.s
#
# /* Disable data cache */
#
lis r3,CACHE_DISABLE
mtspr DC_CST,r3
#
# /* Enable machine check exceptions and set RI bit */
#
mfmsr r3
ori r3,r3,0x1002
mtmsr r3
#
# /* Set ICTRL = 7 to turn off show cycles */
#
lis r3,0x0000
ori r3,r3,0x0007
mtspr ICTRL,r3
#
# /* Set base address of internal memory-mapped registers */
#
lis r4,0x0220
ori r4,r4,0x0000
mtspr IMMR,r4
#
# /* SIUMCR |= 0x00032600 */
#
lwz r3,SIUMCR(r4)
oris r3,r3,0x0163
# ori r3,r3,0x2640
ori r3,r3,0x2440
stw r3,SIUMCR(r4)
#
# /* Enable bus monitor, disable SWT */
#
lis r3,0xffff
ori r3,r3,0xff88
stw r3,SYPCR(r4)
#
# /* Enable decrementer and halt it when FREEZE is asserted */
#
li r3,0x00c3
sth r3,TBSCR(r4)
#
# /* Unlock Real-time clock control register */
#
lis r3,0x55cc
ori r3,r3,0xaa33
stw r3,RTCSCK(r4)
#
# /* Disable real-time clock */
#
li r3,0x00c2
sth r3,RTCSC(r4)
#
# /* Disable periodic timer */
#
li r3,0x0082
sth r3,PISCR(r4)
#
# /* Setup memory controller registers */
#
lis r3,0x0280 # MPC850FADS Flash at 0x02800000 by James Huang
ori r3,r3,0x0001
stw r3,BR0(r4)
lis r3,0xffe0
ori r3,r3,0x0954
stw r3,OR0(r4)
lis r3,0x0210 # BCSR at 0x02100000 MPC850FADS by James Huang
ori r3,r3,0x0001
stw r3,OR1(r4)
lis r3,0xffff
ori r3,r3,0x8110
stw r3,OR1(r4)
lis r3,0x0000 # DRAM at 0x0
ori r3,r3,0x0081
stw r3,BR2(r4)
lis r3,0xffc0
ori r3,r3,0x0800
stw r3,OR2(r4)
# SDRAM MPC850FADS by James Huang
lis r3,0x0300 # SDRAM at 0x03000000
ori r3,r3,0x00c1
stw r3,BR4(r4)
lis r3,0xffc0
ori r3,r3,0x0a00
stw r3,OR4(r4)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -