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

4.115
Last change on this file since 43e0599 was 43e0599, checked in by Mathew Kallada <matkallada@…>, on 12/02/12 at 21:23:57

score misc: Clean up Doxygen #13 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/8013205

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