source: rtems/cpukit/score/cpu/arm/armv7m-initialize.c @ 9165349d

Last change on this file since 9165349d was 51307919, checked in by Sebastian Huber <sebastian.huber@…>, on 03/20/20 at 08:12:26

arm: ARMv7-M statically initialized vector table

Statically initialize the ARMv7-M vector table to allow a placement in
ROM with read-only MPU settings.

Change licence to BSD-2-Clause in some files.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @brief ARM7M CPU Initialize
7 */
8
9/*
10 * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
11 * Copyright (C) 2011 Sebastian Huber
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 *    notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 *    notice, this list of conditions and the following disclaimer in the
20 *    documentation and/or other materials provided with the distribution.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 */
34
35#ifdef HAVE_CONFIG_H
36#include "config.h"
37#endif
38
39#include <rtems/score/armv7m.h>
40
41#ifdef ARM_MULTILIB_ARCH_V7M
42
43void _CPU_Initialize( void )
44{
45  /*
46   * The exception handler used to carry out the thead dispatching must have
47   * the lowest priority possible.  No other exception handlers must have this
48   * priority if they use services that may lead to a thread dispatch.  See
49   * also "ARMv7-M Architecture Reference Manual, Issue D" section B1.5.4
50   * "Exception priorities and preemption".
51   */
52  _ARMV7M_Set_exception_priority(
53    ARMV7M_VECTOR_SVC,
54    ARMV7M_EXCEPTION_PRIORITY_LOWEST
55  );
56  _ARMV7M_Set_exception_priority(
57    ARMV7M_VECTOR_PENDSV,
58    ARMV7M_EXCEPTION_PRIORITY_LOWEST
59  );
60}
61
62#endif /* ARM_MULTILIB_ARCH_V7M */
Note: See TracBrowser for help on using the repository browser.