Changeset f665f13 in rtems


Ignore:
Timestamp:
Nov 19, 2012, 7:37:04 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
d33f743
Parents:
4bd4c9e
git-author:
Sebastian Huber <sebastian.huber@…> (11/19/12 07:37:04)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/03/12 12:17:08)
Message:

bsps/powerpc: Add PPC_EXC_CONFIG_BOOKE_ONLY

In combination with the PPC_EXC_CONFIG_USE_FIXED_HANDLER option this
removes all dependencies on valid read-write data. The exception
handling must be statically configured and all components reside in
read-only sections.

Location:
c/src/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/shared/src/ppc-exc-handler-table.c

    r4bd4c9e rf665f13  
    1717#ifdef PPC_EXC_CONFIG_USE_FIXED_HANDLER
    1818
     19#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
    1920static int ppc_exc_interrupt_dispatch(BSP_Exception_frame *f, unsigned vector)
    2021{
     
    2324  return 0;
    2425}
     26#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    2527
    2628const ppc_exc_handler_t ppc_exc_handler_table [LAST_VALID_EXC + 1] = {
     
    3032  ppc_exc_handler_default,
    3133  ppc_exc_handler_default,
     34#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
    3235  ppc_exc_interrupt_dispatch,
     36#else /* PPC_EXC_CONFIG_BOOKE_ONLY */
     37  ppc_exc_handler_default,
     38#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    3339  ppc_exc_handler_default,
    3440  ppc_exc_handler_default,
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_asm_macros.h

    r4bd4c9e rf665f13  
    280280        .macro  RECOVER_CHECK_std _FLVR
    281281
     282#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     283
    282284        /* Check if exception is recoverable */
    283285        lwz     SCRATCH_REGISTER_0, SRR1_FRAME_OFFSET(FRAME_REGISTER)
     
    291293        bne     recover_check_twiddle_std_\_FLVR
    292294
     295#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
     296
    293297        .endm
    294298
     
    302306/* Machine check */
    303307        .macro  RECOVER_CHECK_mchk _FLVR
     308
     309#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
    304310
    305311        /* Check if exception is recoverable */
     
    313319        /* Not recoverable? */
    314320        bne     recover_check_twiddle_mchk_\_FLVR
     321
     322#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    315323
    316324        .endm
     
    521529        stw     VECTOR_REGISTER, EXCEPTION_NUMBER_OFFSET(FRAME_REGISTER)
    522530
     531#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     532
    523533        /* Load MSR bit mask */
    524534        lwz     SCRATCH_REGISTER_0, ppc_exc_msr_bits@sdarel(r13)
     
    532542
    533543wrap_change_msr_done_\_FLVR:
     544
     545#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    534546
    535547#ifdef __ALTIVEC__
     
    661673#endif
    662674
     675#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     676
    663677        /* Restore MSR? */
    664678        bne     CR_MSR, wrap_restore_msr_\_FLVR
    665679
    666680wrap_restore_msr_done_\_FLVR:
     681
     682#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    667683
    668684        /*
     
    726742        \_RFI
    727743
     744#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     745
    728746wrap_change_msr_\_FLVR:
    729747
     
    744762        isync
    745763        b       wrap_restore_msr_done_\_FLVR
     764
     765#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    746766
    747767wrap_save_non_volatile_regs_\_FLVR:
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_hdl.c

    r4bd4c9e rf665f13  
    3232uint32_t ppc_exc_vector_register_mchk = 0;
    3333
     34#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     35
    3436/* MSR bits to enable once critical status info is saved and the stack
    3537 * is switched; must be set depending on CPU type
     
    3941 */
    4042uint32_t ppc_exc_msr_bits = MSR_IR | MSR_DR | MSR_RI;
     43
     44#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    4145
    4246int ppc_exc_handler_default(BSP_Exception_frame *f, unsigned int vector)
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c

    r4bd4c9e rf665f13  
    193193  ppc_interrupt_set_disable_mask(interrupt_disable_mask);
    194194
     195#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     196
    195197  /* Use current MMU / RI settings when running C exception handlers */
    196198  ppc_exc_msr_bits = ppc_machine_state_register() & (MSR_DR | MSR_IR | MSR_RI);
     
    200202  ppc_exc_msr_bits |= MSR_VE;
    201203#endif
    202  
     204
     205#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
     206
    203207  if (ppc_cpu_is_bookE() == PPC_BOOKE_STD || ppc_cpu_is_bookE() == PPC_BOOKE_E500) {
    204208    ppc_exc_initialize_booke();
     
    222226  }
    223227
     228#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
    224229  /* If we are on a classic PPC with MSR_DR enabled then
    225230   * assert that the mapping for at least this task's
     
    253258    /* If we make it thru here then things seem to be OK */
    254259  }
     260#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    255261}
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_naked.S

    r4bd4c9e rf665f13  
    7777        stw     SCRATCH_REGISTER_0, EXC_LR_OFFSET(r1)
    7878
     79#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     80
    7981        /* Load MSR bit mask */
    8082        lwz     SCRATCH_REGISTER_0, ppc_exc_msr_bits@sdarel(r13)
     
    8890
    8991wrap_change_msr_done_naked:
     92
     93#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    9094
    9195        /*
     
    128132        bctrl
    129133
     134#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     135
    130136        /* Restore MSR? */
    131137        bne     CR_MSR, wrap_restore_msr_naked
    132138
    133139wrap_restore_msr_done_naked:
     140
     141#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    134142
    135143        /* Restore XER and CTR */
     
    176184        rfi
    177185
     186#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     187
    178188wrap_change_msr_naked:
    179189
     
    194204        isync
    195205        b       wrap_restore_msr_done_naked
     206
     207#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h

    r4bd4c9e rf665f13  
    411411int ppc_exc_handler_default(BSP_Exception_frame *f, unsigned int vector);
    412412
     413#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
     414
    413415/**
    414416 * @brief Bits for MSR update.
     
    422424 */
    423425extern uint32_t ppc_exc_msr_bits;
     426
     427#endif /* PPC_EXC_CONFIG_BOOKE_ONLY */
    424428
    425429/**
Note: See TracChangeset for help on using the changeset viewer.