source: rtems/cpukit/score/cpu/nios2/nios2-isr-set-level.c @ 63f871f

4.115
Last change on this file since 63f871f was 36c187a0, checked in by Sebastian Huber <sebastian.huber@…>, on 09/02/11 at 07:52:30

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().
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 * Copyright (c) 2011 embedded brains GmbH
3 *
4 * Copyright (c) 2006 Kolja Waschk (rtemsdev/ixo.de)
5 *
6 * COPYRIGHT (c) 1989-2006
7 * On-Line Applications Research Corporation (OAR).
8 *
9 * The license and distribution terms for this file may be
10 * found in the file LICENSE in this distribution or at
11 * http://www.rtems.com/license/LICENSE.
12 *
13 * $Id$
14 */
15
16#ifdef HAVE_CONFIG_H
17  #include "config.h"
18#endif
19
20#include <rtems/score/cpu.h>
21#include <rtems/score/interr.h>
22#include <rtems/score/nios2-utility.h>
23
24uint32_t _Nios2_ISR_Set_level( uint32_t new_level, uint32_t status )
25{
26  switch ( _Nios2_Get_ISR_status_mask() ) {
27    case NIOS2_ISR_STATUS_MASK_IIC:
28      if ( new_level == 0 ) {
29        status |= NIOS2_STATUS_PIE;
30      } else {
31        status &= ~NIOS2_STATUS_PIE;
32      }
33      break;
34    case NIOS2_ISR_STATUS_MASK_EIC_IL:
35      status &= ~NIOS2_STATUS_IL_MASK;
36      status |= (new_level << NIOS2_STATUS_IL_OFFSET) & NIOS2_STATUS_IL_MASK;
37      break;
38    case NIOS2_ISR_STATUS_MASK_EIC_RSIE:
39      if ( new_level == 0 ) {
40        status |= NIOS2_STATUS_RSIE;
41      } else {
42        status &= ~NIOS2_STATUS_RSIE;
43      }
44      break;
45    default:
46      /* FIXME */
47      _Internal_error_Occurred( INTERNAL_ERROR_CORE, false, 0xdeadbeef );
48      break;
49  }
50
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
60  _Nios2_Set_ctlreg_status( status );
61}
Note: See TracBrowser for help on using the repository browser.