Changeset 36c187a0 in rtems


Ignore:
Timestamp:
Sep 2, 2011, 7:52:30 AM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
1c963169
Parents:
cae389ba
Message:

2011-09-02 Sebastian Huber <sebastian.huber@…>

  • rtems/score/nios2-utility.h: Avoid redefines with Altera HAL. Declare _Nios2_ISR_Set_level().
  • nios2-context-initialize.c: Use _Nios2_ISR_Set_level().
  • nios2-isr-set-level.c: Define _Nios2_ISR_Set_level().
Location:
cpukit/score/cpu/nios2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/nios2/ChangeLog

    rcae389ba r36c187a0  
     12011-09-02      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * rtems/score/nios2-utility.h: Avoid redefines with Altera HAL.
     4        Declare _Nios2_ISR_Set_level().
     5        * nios2-context-initialize.c: Use _Nios2_ISR_Set_level().
     6        * nios2-isr-set-level.c: Define _Nios2_ISR_Set_level().
     7
    182011-09-01      Sebastian Huber <sebastian.huber@embedded-brains.de>
    29
  • cpukit/score/cpu/nios2/nios2-context-initialize.c

    rcae389ba r36c187a0  
    1818#endif
    1919
     20#include <string.h>
     21
    2022#include <rtems/score/cpu.h>
    21 #include <string.h>
     23#include <rtems/score/nios2-utility.h>
    2224
    2325void _CPU_Context_Initialize(
     
    3537
    3638  context->fp = stack;
     39  context->status = _Nios2_ISR_Set_level( new_level, NIOS2_STATUS_PIE );
    3740  context->sp = stack;
    3841  context->ra = (uint32_t) entry_point;
    39   /* @todo Add EIC support. */
    40   context->status = new_level ? 0 : 1;
    4142}
  • cpukit/score/cpu/nios2/nios2-isr-set-level.c

    rcae389ba r36c187a0  
    2222#include <rtems/score/nios2-utility.h>
    2323
    24 void _CPU_ISR_Set_level( uint32_t new_level )
     24uint32_t _Nios2_ISR_Set_level( uint32_t new_level, uint32_t status )
    2525{
    26   uint32_t status = _Nios2_Get_ctlreg_status();
    27 
    2826  switch ( _Nios2_Get_ISR_status_mask() ) {
    2927    case NIOS2_ISR_STATUS_MASK_IIC:
     
    5149  }
    5250
     51  return status;
     52}
     53
     54void _CPU_ISR_Set_level( uint32_t new_level )
     55{
     56  uint32_t status = _Nios2_Get_ctlreg_status();
     57
     58  status = _Nios2_ISR_Set_level( new_level, status );
     59
    5360  _Nios2_Set_ctlreg_status( status );
    5461}
  • cpukit/score/cpu/nios2/rtems/score/nios2-utility.h

    rcae389ba r36c187a0  
    104104#define NIOS2_MPUBASE_BASE_MASK (0x1ffffff << NIOS2_MPUBASE_BASE_OFFSET)
    105105#define NIOS2_MPUBASE_INDEX_OFFSET 1
    106 #define NIOS2_MPUBASE_INDEX_MASK (0x1f << NIOS2_MPUBASE_INDEX_OFFSET)
     106
     107/* Avoid redefines with Altera HAL */
     108#ifndef NIOS2_MPUBASE_INDEX_MASK
     109  #define NIOS2_MPUBASE_INDEX_MASK (0x1f << NIOS2_MPUBASE_INDEX_OFFSET)
     110#endif
     111
    107112#define NIOS2_MPUBASE_D (1 << 0)
    108113
    109114#define NIOS2_MPUACC_MASK_OFFSET 6
    110 #define NIOS2_MPUACC_MASK_MASK (0x1ffffff << NIOS2_MPUACC_MASK_OFFSET)
     115
     116/* Avoid redefines with Altera HAL */
     117#ifndef NIOS2_MPUACC_MASK_MASK
     118  #define NIOS2_MPUACC_MASK_MASK (0x1ffffff << NIOS2_MPUACC_MASK_OFFSET)
     119#endif
     120
    111121#define NIOS2_MPUACC_LIMIT_OFFSET 6
    112 #define NIOS2_MPUACC_LIMIT_MASK (0x3ffffff << NIOS2_MPUACC_LIMIT_OFFSET)
     122
     123/* Avoid redefines with Altera HAL */
     124#ifndef NIOS2_MPUACC_LIMIT_MASK
     125  #define NIOS2_MPUACC_LIMIT_MASK (0x3ffffff << NIOS2_MPUACC_LIMIT_OFFSET)
     126#endif
     127
    113128#define NIOS2_MPUACC_C (1 << 5)
    114129#define NIOS2_MPUACC_PERM_OFFSET 2
    115 #define NIOS2_MPUACC_PERM_MASK (0x7 << NIOS2_MPUACC_PERM_OFFSET)
     130
     131/* Avoid redefines with Altera HAL */
     132#ifndef NIOS2_MPUACC_PERM_MASK
     133  #define NIOS2_MPUACC_PERM_MASK (0x7 << NIOS2_MPUACC_PERM_OFFSET)
     134#endif
     135
    116136#define NIOS2_MPUACC_RD (1 << 1)
    117137#define NIOS2_MPUACC_WR (1 << 0)
     
    287307static inline bool _Nios2_Has_internal_interrupt_controller( void )
    288308{
    289   uint32_t isr_status_mask = _Nios2_Get_ISR_status_mask();
    290 
    291   return isr_status_mask == NIOS2_ISR_STATUS_MASK_IIC;
    292 }
     309  return _Nios2_Get_ISR_status_mask() == NIOS2_ISR_STATUS_MASK_IIC;
     310}
     311
     312uint32_t _Nios2_ISR_Set_level( uint32_t new_level, uint32_t status );
    293313
    294314#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.