1
0
Fork 0
forked from len0rd/rockbox
foxbox/firmware/target/arm/vectors-arm-micro.S
Aidan MacDonald 3ed9fb3115 arm: add initial ARM Cortex-M support
M-profile cores manage interrupts differently from classic cores
and lack the FIQ. Split the interrupt management parts out into
separate headers but keep the endian swapping routines (which are
not profile-dependent) in the common system-arm header.

The initial part of the vector table is common to all Cortex-M
CPUs and is intended to be included by the target linker script,
with the vendor-specific part of the vector table appended to it.

Change-Id: Ib2ad5b9dc41db27940e39033cfef4308923db66d
2025-04-18 13:19:42 -04:00

64 lines
2.6 KiB
ArmAsm

/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2025 by Aidan MacDonald
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "config.h"
#if ARCH_VERSION < 7
# define memmanage_handler UIE
# define busfault_handler UIE
# define usagefault_handler UIE
#endif
#if ARCH_VERSION < 8
# define securefault_handler UIE
#endif
.syntax unified
.text
/*
* Architecturally defined exception vectors for ARMv6/7/8-M.
*
* The target linker script is expected to place these in the
* correct location and then append the implementation-specific
* vector table entries, which would normally be defined at the
* manufacturer level of the target tree.
*/
.section .vectors.arm,"ax",%progbits
.global __vectors_arm
__vectors_arm:
.word irqstackend /* [ 0] Stack pointer */
.word reset_handler /* [ 1] Reset */
.word nmi_handler /* [ 2] Non-maskable interrupt */
.word hardfault_handler /* [ 3] */
.word memmanage_handler /* [ 4] (ARMv7-M and later only) */
.word busfault_handler /* [ 5] (ARMv7-M and later only) */
.word usagefault_handler /* [ 6] (ARMv7-M and later only) */
.word securefault_handler /* [ 7] (ARMv8-M only) */
.word UIE /* [ 8] Reserved */
.word UIE /* [ 9] Reserved */
.word UIE /* [10] Reserved */
.word svcall_handler /* [11] */
.word debugmonitor_handler /* [12] (ARMv7-M and later only) */
.word UIE /* [13] Reserved */
.word pendsv_handler /* [14] */
.word systick_handler /* [15] (Optional on ARMv6-M) */