4.115
Last change
on this file since e2d0c68 was
e2d0c68,
checked in by Sebastian Huber <sebastian.huber@…>, on 09/01/11 at 15:52:12
|
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.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 | |
---|
24 | uint32_t _CPU_ISR_Get_level( void ) |
---|
25 | { |
---|
26 | uint32_t status = _Nios2_Get_ctlreg_status(); |
---|
27 | uint32_t level = 0; |
---|
28 | |
---|
29 | switch ( _Nios2_Get_ISR_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.