OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [libgloss/] [or32/] [crt0.S] - Diff between revs 207 and 226

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 207 Rev 226
Line 314... Line 314...
        l.sw    0(r30),r26              /* Patch the instruction */
        l.sw    0(r30),r26              /* Patch the instruction */
        l.j     .L5
        l.j     .L5
        l.addi  r30,r30,4               /* Delay slot: next instruction */
        l.addi  r30,r30,4               /* Delay slot: next instruction */
 
 
.L6:
.L6:
        /* Cache initialisation. Enable IC and/or DC */
        /* Instruction cache enable */
.if IC_ENABLE || DC_ENABLE
        /* Check if IC present and skip enabling otherwise */
        l.mfspr r10,r0,SPR_SR
        l.mfspr r24,r0,SPR_UPR
.if IC_ENABLE
        l.andi  r26,r24,SPR_UPR_ICP
        l.ori   r10,r10,SPR_SR_ICE
        l.sfeq  r26,r0
.endif
        l.bf    .L8
.if DC_ENABLE
        l.nop
        l.ori   r10,r10,SPR_SR_DCE
 
.endif
        /* Disable IC */
        l.mtspr r0,r10,SPR_SR
        l.mfspr r6,r0,SPR_SR
        l.nop                           /* Flush the pipeline. */
        l.addi  r5,r0,-1
 
        l.xori  r5,r5,SPR_SR_ICE
 
        l.and   r5,r6,r5
 
        l.mtspr r0,r5,SPR_SR
 
 
 
        /* Establish cache block size
 
        If BS=0, 16;
 
        If BS=1, 32;
 
        r14 contain block size
 
        */
 
        l.mfspr r24,r0,SPR_ICCFGR
 
        l.andi  r26,r24,SPR_ICCFGR_CBS
 
        l.srli  r28,r26,7
 
        l.ori   r30,r0,16
 
        l.sll   r14,r30,r28
 
 
 
        /* Establish number of cache sets
 
        r16 contains number of cache sets
 
        r28 contains log(# of cache sets)
 
        */
 
        l.andi  r26,r24,SPR_ICCFGR_NCS
 
        l.srli  r28,r26,3
 
        l.ori   r30,r0,1
 
        l.sll   r16,r30,r28
 
 
 
        /* Invalidate IC */
 
        l.addi  r6,r0,0
 
        l.sll   r5,r14,r28
 
 
 
.L7:
 
        l.mtspr r0,r6,SPR_ICBIR
 
        l.sfne  r6,r5
 
        l.bf    .L7
 
        l.add   r6,r6,r14
 
 
 
        /* Enable IC */
 
        l.mfspr r6,r0,SPR_SR
 
        l.ori   r6,r6,SPR_SR_ICE
 
        l.mtspr r0,r6,SPR_SR
        l.nop
        l.nop
        l.nop
        l.nop
        l.nop
        l.nop
        l.nop
        l.nop
.endif
        l.nop
 
        l.nop
 
        l.nop
 
        l.nop
 
 
 
.L8:
 
        /* Data cache enable */
 
        /* Check if DC present and skip enabling otherwise */
 
        l.mfspr r24,r0,SPR_UPR
 
        l.andi  r26,r24,SPR_UPR_DCP
 
        l.sfeq  r26,r0
 
        l.bf    .L10
 
        l.nop
 
        /* Disable DC */
 
        l.mfspr r6,r0,SPR_SR
 
        l.addi  r5,r0,-1
 
        l.xori  r5,r5,SPR_SR_DCE
 
        l.and   r5,r6,r5
 
        l.mtspr r0,r5,SPR_SR
 
        /* Establish cache block size
 
           If BS=0, 16;
 
           If BS=1, 32;
 
           r14 contain block size
 
        */
 
        l.mfspr r24,r0,SPR_DCCFGR
 
        l.andi  r26,r24,SPR_DCCFGR_CBS
 
        l.srli  r28,r26,7
 
        l.ori   r30,r0,16
 
        l.sll   r14,r30,r28
 
        /* Establish number of cache sets
 
           r16 contains number of cache sets
 
           r28 contains log(# of cache sets)
 
        */
 
        l.andi  r26,r24,SPR_DCCFGR_NCS
 
        l.srli  r28,r26,3
 
        l.ori   r30,r0,1
 
        l.sll   r16,r30,r28
 
        /* Invalidate DC */
 
        l.addi  r6,r0,0
 
        l.sll   r5,r14,r28
 
.L9:
 
        l.mtspr r0,r6,SPR_DCBIR
 
        l.sfne  r6,r5
 
        l.bf    .L9
 
        l.add   r6,r6,r14
 
        /* Enable DC */
 
        l.mfspr r6,r0,SPR_SR
 
        l.ori   r6,r6,SPR_SR_DCE
 
        l.mtspr r0,r6,SPR_SR
 
 
 
.L10:
        /* Clear BSS */
        /* Clear BSS */
        l.movhi r28,hi(__bss_start)
        l.movhi r28,hi(__bss_start)
        l.ori   r28,r28,lo(__bss_start)
        l.ori   r28,r28,lo(__bss_start)
        l.movhi r30,hi(end)
        l.movhi r30,hi(end)
        l.ori   r30,r30,lo(end)
        l.ori   r30,r30,lo(end)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.