source: rtems/cpukit/score/cpu/nios2/nios2-isr-get-level.c @ 67518231

4.115
Last change on this file since 67518231 was 67518231, checked in by Sebastian Huber <sebastian.huber@…>, on Sep 2, 2011 at 3:06:00 PM

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

  • rtems/score/nios2-utility.h, nios2-isr-set-level.c, nios2-isr-get-level.c: Renamed functions.
  • Property mode set to 100644
File size: 1.1 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 _CPU_ISR_Get_level( void )
25{
26  uint32_t status = _Nios2_Get_ctlreg_status();
27  uint32_t level = 0;
28
29  switch ( _Nios2_ISR_Get_status_mask() ) {
30    case NIOS2_ISR_STATUS_MASK_IIC:
31      level = (status & NIOS2_STATUS_PIE) == 0;
32      break;
33    case NIOS2_ISR_STATUS_MASK_EIC_IL:
34      level = (status & NIOS2_STATUS_IL_MASK) >> NIOS2_STATUS_IL_OFFSET;
35      break;
36    case NIOS2_ISR_STATUS_MASK_EIC_RSIE:
37      level = (status & NIOS2_STATUS_RSIE) == 0;
38      break;
39    default:
40      /* FIXME */
41      _Internal_error_Occurred( INTERNAL_ERROR_CORE, false, 0xdeadbeef );
42      break;
43  }
44
45  return level;
46}
Note: See TracBrowser for help on using the repository browser.