source: rtems/cpukit/score/cpu/nios2/nios2-mpu-reset.c @ 24bf11e

4.115
Last change on this file since 24bf11e was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 * Copyright (c) 2011 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Obere Lagerstr. 30
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.com/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems/score/nios2-utility.h>
20
21void _Nios2_MPU_Reset( const Nios2_MPU_Configuration *config )
22{
23  uint32_t data_mpubase = (1U << config->data_region_size_log2)
24    | NIOS2_MPUBASE_D;
25  uint32_t inst_mpubase = 1U << config->instruction_region_size_log2;
26  uint32_t mpuacc = NIOS2_MPUACC_WR;
27  int data_count = config->data_region_count;
28  int inst_count = config->instruction_region_count;
29  int i = 0;
30
31  _Nios2_MPU_Disable();
32
33  for ( i = 0; i < data_count; ++i ) {
34    uint32_t index = ((uint32_t) i) << NIOS2_MPUBASE_INDEX_OFFSET;
35
36    _Nios2_Set_ctlreg_mpubase( data_mpubase | index );
37    _Nios2_Set_ctlreg_mpuacc( mpuacc );
38  }
39
40  for ( i = 0; i < inst_count; ++i ) {
41    uint32_t index = ((uint32_t) i) << NIOS2_MPUBASE_INDEX_OFFSET;
42
43    _Nios2_Set_ctlreg_mpubase( inst_mpubase | index );
44    _Nios2_Set_ctlreg_mpuacc( mpuacc );
45  }
46}
Note: See TracBrowser for help on using the repository browser.