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

4.115
Last change on this file since cae389ba was e2d0c68, checked in by Sebastian Huber <sebastian.huber@…>, on Sep 1, 2011 at 3:52:12 PM

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

  • cpu.c, cpu_asm.S: Removed files.
  • nios2-context-initialize.c, nios2-context-switch.S, nios2-fatal-halt.c, nios2-initialize-vectors.c, nios2-initialize.c, nios2-isr-get-level.c, nios2-isr-install-raw-handler.c, nios2-isr-install-vector.c, nios2-isr-is-in-progress.c, nios2-isr-set-level.c, nios2-thread-dispatch-disabled.c, rtems/score/nios2-utility.h: New files.
  • Makefile.am, preinstall.am: Reflect changes above.
  • irq.c: Update due to API changes.
  • rtems/score/cpu.h: New functions _CPU_Initialize_vectors(), _CPU_ISR_Set_level(), and _CPU_Fatal_halt() (instead of macros). Support for external interrupt controller (EIC). Documentation changes.
  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[e2d0c68]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
24void _CPU_ISR_Set_level( uint32_t new_level )
25{
26  uint32_t status = _Nios2_Get_ctlreg_status();
27
28  switch ( _Nios2_Get_ISR_status_mask() ) {
29    case NIOS2_ISR_STATUS_MASK_IIC:
30      if ( new_level == 0 ) {
31        status |= NIOS2_STATUS_PIE;
32      } else {
33        status &= ~NIOS2_STATUS_PIE;
34      }
35      break;
36    case NIOS2_ISR_STATUS_MASK_EIC_IL:
37      status &= ~NIOS2_STATUS_IL_MASK;
38      status |= (new_level << NIOS2_STATUS_IL_OFFSET) & NIOS2_STATUS_IL_MASK;
39      break;
40    case NIOS2_ISR_STATUS_MASK_EIC_RSIE:
41      if ( new_level == 0 ) {
42        status |= NIOS2_STATUS_RSIE;
43      } else {
44        status &= ~NIOS2_STATUS_RSIE;
45      }
46      break;
47    default:
48      /* FIXME */
49      _Internal_error_Occurred( INTERNAL_ERROR_CORE, false, 0xdeadbeef );
50      break;
51  }
52
53  _Nios2_Set_ctlreg_status( status );
54}
Note: See TracBrowser for help on using the repository browser.