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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [openrisc/] [arch/] [current/] [src/] [context.S] - Diff between revs 786 and 790

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

Rev 786 Rev 790
Line 68... Line 68...
 
 
        # Store General Purpose Registers (GPRs).
        # Store General Purpose Registers (GPRs).
        l.sw     2 * OR1K_GPRSIZE(sp), r2
        l.sw     2 * OR1K_GPRSIZE(sp), r2
        l.sw     9 * OR1K_GPRSIZE(sp), r9
        l.sw     9 * OR1K_GPRSIZE(sp), r9
        l.sw    10 * OR1K_GPRSIZE(sp), r10
        l.sw    10 * OR1K_GPRSIZE(sp), r10
        l.sw    12 * OR1K_GPRSIZE(sp), r12
 
        l.sw    14 * OR1K_GPRSIZE(sp), r14
        l.sw    14 * OR1K_GPRSIZE(sp), r14
        l.sw    16 * OR1K_GPRSIZE(sp), r16
        l.sw    16 * OR1K_GPRSIZE(sp), r16
        l.sw    18 * OR1K_GPRSIZE(sp), r18
        l.sw    18 * OR1K_GPRSIZE(sp), r18
        l.sw    20 * OR1K_GPRSIZE(sp), r20
        l.sw    20 * OR1K_GPRSIZE(sp), r20
        l.sw    22 * OR1K_GPRSIZE(sp), r22
        l.sw    22 * OR1K_GPRSIZE(sp), r22
        l.sw    24 * OR1K_GPRSIZE(sp), r24
        l.sw    24 * OR1K_GPRSIZE(sp), r24
        l.sw    26 * OR1K_GPRSIZE(sp), r26
        l.sw    26 * OR1K_GPRSIZE(sp), r26
        l.sw    28 * OR1K_GPRSIZE(sp), r28
        l.sw    28 * OR1K_GPRSIZE(sp), r28
        l.sw    30 * OR1K_GPRSIZE(sp), r30
        l.sw    30 * OR1K_GPRSIZE(sp), r30
 
 
#undef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
 
#ifndef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
#ifndef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
 
 
        # R0 is not typically stored because it is always zero-valued,
        # R0 is not typically stored because it is always zero-valued,
        # but we store it here for consistency when examining registers
        # but we store it here for consistency when examining registers
        # in the debugger.
        # in the debugger.
        l.sw     0 * OR1K_GPRSIZE(sp), r0
        l.sw     0 * OR1K_GPRSIZE(sp), r0
 
 
        # Caller-saved regs don't need to be preserved across
        # Caller-saved temporary regs don't need to be preserved across
        # context switches, but we do so to make debugging easier.
        # context switches, but we do so to make debugging easier.
 
 
        l.sw     3 * OR1K_GPRSIZE(sp), r3
        l.sw     3 * OR1K_GPRSIZE(sp), r3
        l.sw     4 * OR1K_GPRSIZE(sp), r4
        l.sw     4 * OR1K_GPRSIZE(sp), r4
        l.sw     5 * OR1K_GPRSIZE(sp), r5
        l.sw     5 * OR1K_GPRSIZE(sp), r5
        l.sw     6 * OR1K_GPRSIZE(sp), r6
        l.sw     6 * OR1K_GPRSIZE(sp), r6
        l.sw     7 * OR1K_GPRSIZE(sp), r7
        l.sw     7 * OR1K_GPRSIZE(sp), r7
        l.sw     8 * OR1K_GPRSIZE(sp), r8
        l.sw     8 * OR1K_GPRSIZE(sp), r8
        l.sw    11 * OR1K_GPRSIZE(sp), r11
        l.sw    11 * OR1K_GPRSIZE(sp), r11
 
        l.sw    12 * OR1K_GPRSIZE(sp), r12
        l.sw    13 * OR1K_GPRSIZE(sp), r13
        l.sw    13 * OR1K_GPRSIZE(sp), r13
        l.sw    15 * OR1K_GPRSIZE(sp), r15
        l.sw    15 * OR1K_GPRSIZE(sp), r15
        l.sw    17 * OR1K_GPRSIZE(sp), r17
        l.sw    17 * OR1K_GPRSIZE(sp), r17
        l.sw    19 * OR1K_GPRSIZE(sp), r19
        l.sw    19 * OR1K_GPRSIZE(sp), r19
        l.sw    21 * OR1K_GPRSIZE(sp), r21
        l.sw    21 * OR1K_GPRSIZE(sp), r21
Line 108... Line 107...
        l.sw    25 * OR1K_GPRSIZE(sp), r25
        l.sw    25 * OR1K_GPRSIZE(sp), r25
        l.sw    27 * OR1K_GPRSIZE(sp), r27
        l.sw    27 * OR1K_GPRSIZE(sp), r27
        l.sw    29 * OR1K_GPRSIZE(sp), r29
        l.sw    29 * OR1K_GPRSIZE(sp), r29
        l.sw    31 * OR1K_GPRSIZE(sp), r31
        l.sw    31 * OR1K_GPRSIZE(sp), r31
 
 
 
#endif
 
 
        # save MAC LO and HI regs
        # save MAC LO and HI regs
        l.mfspr r5,r0,SPR_MACLO
        l.mfspr r5,r0,SPR_MACLO
        l.sw    OR1KREG_MACLO(sp),r5
        l.sw    OR1KREG_MACLO(sp),r5
        l.mfspr r5,r0,SPR_MACHI
        l.mfspr r5,r0,SPR_MACHI
        l.sw    OR1KREG_MACHI(sp),r5
        l.sw    OR1KREG_MACHI(sp),r5
 
 
#endif
 
 
 
#ifdef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
#ifdef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
        # Make the thread context look like an exception context if thread-
        # Make the thread context look like an exception context if thread-
        # aware debugging is required. This state does not need restoring.
        # aware debugging is required. This state does not need restoring.
        l.sw    OR1KREG_PC(sp),r9
        l.sw    OR1KREG_PC(sp),r9
Line 153... Line 153...
        # Restore General Purpose Registers (GPRs).
        # Restore General Purpose Registers (GPRs).
        # R0 is not restored because it is always zero-valued.
        # R0 is not restored because it is always zero-valued.
        l.lwz   r2,   2 * OR1K_GPRSIZE(sp)
        l.lwz   r2,   2 * OR1K_GPRSIZE(sp)
        l.lwz   r9,   9 * OR1K_GPRSIZE(sp)
        l.lwz   r9,   9 * OR1K_GPRSIZE(sp)
        l.lwz   r10, 10 * OR1K_GPRSIZE(sp)
        l.lwz   r10, 10 * OR1K_GPRSIZE(sp)
        l.lwz   r12, 12 * OR1K_GPRSIZE(sp)
 
        l.lwz   r14, 14 * OR1K_GPRSIZE(sp)
        l.lwz   r14, 14 * OR1K_GPRSIZE(sp)
        l.lwz   r16, 16 * OR1K_GPRSIZE(sp)
        l.lwz   r16, 16 * OR1K_GPRSIZE(sp)
        l.lwz   r18, 18 * OR1K_GPRSIZE(sp)
        l.lwz   r18, 18 * OR1K_GPRSIZE(sp)
        l.lwz   r20, 20 * OR1K_GPRSIZE(sp)
        l.lwz   r20, 20 * OR1K_GPRSIZE(sp)
        l.lwz   r22, 22 * OR1K_GPRSIZE(sp)
        l.lwz   r22, 22 * OR1K_GPRSIZE(sp)
Line 174... Line 173...
        l.lwz   r5,  OR1KREG_SR(sp)
        l.lwz   r5,  OR1KREG_SR(sp)
        l.andi  r5, r5, (SPR_SR_TEE|SPR_SR_IEE)
        l.andi  r5, r5, (SPR_SR_TEE|SPR_SR_IEE)
        l.or    r5, r5, r6
        l.or    r5, r5, r6
        l.mtspr r0, r5, SPR_SR
        l.mtspr r0, r5, SPR_SR
 
 
#undef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
 
#ifndef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
 
 
 
        # Caller-saved regs don't need to be preserved across
 
        # context switches, but we do so here to make debugging
 
        # easier.
 
 
 
        # Restore MAC LO and HI regs
        # Restore MAC LO and HI regs
        l.lwz   r5, OR1KREG_MACLO(sp)
        l.lwz   r5, OR1KREG_MACLO(sp)
        l.mtspr r0,r5,SPR_MACLO
        l.mtspr r0,r5,SPR_MACLO
        l.lwz   r5, OR1KREG_MACHI(sp)
        l.lwz   r5, OR1KREG_MACHI(sp)
        l.mtspr r0,r5,SPR_MACHI
        l.mtspr r0,r5,SPR_MACHI
 
 
 
#ifndef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
 
 
 
        # Caller-saved temporary regs don't need to be preserved across
 
        # context switches, but we do so here to make debugging
 
        # easier.
 
 
        l.lwz    r4,  4 * OR1K_GPRSIZE(sp)
        l.lwz    r4,  4 * OR1K_GPRSIZE(sp)
        l.lwz    r5,  5 * OR1K_GPRSIZE(sp)
        l.lwz    r5,  5 * OR1K_GPRSIZE(sp)
        l.lwz    r6,  6 * OR1K_GPRSIZE(sp)
        l.lwz    r6,  6 * OR1K_GPRSIZE(sp)
        l.lwz    r7,  7 * OR1K_GPRSIZE(sp)
        l.lwz    r7,  7 * OR1K_GPRSIZE(sp)
        l.lwz    r8,  8 * OR1K_GPRSIZE(sp)
        l.lwz    r8,  8 * OR1K_GPRSIZE(sp)
        l.lwz   r11, 11 * OR1K_GPRSIZE(sp)
        l.lwz   r11, 11 * OR1K_GPRSIZE(sp)
 
        l.lwz   r12, 12 * OR1K_GPRSIZE(sp)
        l.lwz   r13, 13 * OR1K_GPRSIZE(sp)
        l.lwz   r13, 13 * OR1K_GPRSIZE(sp)
        l.lwz   r15, 15 * OR1K_GPRSIZE(sp)
        l.lwz   r15, 15 * OR1K_GPRSIZE(sp)
        l.lwz   r17, 17 * OR1K_GPRSIZE(sp)
        l.lwz   r17, 17 * OR1K_GPRSIZE(sp)
        l.lwz   r19, 19 * OR1K_GPRSIZE(sp)
        l.lwz   r19, 19 * OR1K_GPRSIZE(sp)
        l.lwz   r21, 21 * OR1K_GPRSIZE(sp)
        l.lwz   r21, 21 * OR1K_GPRSIZE(sp)

powered by: WebSVN 2.1.0

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