2 * Copyright (c) 2010 Broadcom Corporation
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef _hndrte_armtrap_h
18 #define _hndrte_armtrap_h
20 /* ARM trap handling */
22 /* Trap types defined by ARM (see arminc.h) */
24 /* Trap locations in lo memory */
26 #define FIRST_TRAP TR_RST
27 #define LAST_TRAP (TR_FIQ * TRAP_STRIDE)
29 #if defined(__ARM_ARCH_4T__)
30 #define MAX_TRAP_TYPE (TR_FIQ + 1)
31 #elif defined(__ARM_ARCH_7M__)
32 #define MAX_TRAP_TYPE (TR_ISR + ARMCM3_NUMINTS)
33 #endif /* __ARM_ARCH_7M__ */
35 /* The trap structure is defined here as offsets for assembly */
41 #define TR_REG(n) (TR_REGS + (n) * 4)
42 #define TR_SP TR_REG(13)
43 #define TR_LR TR_REG(14)
44 #define TR_PC TR_REG(15)
46 #define TRAP_T_SIZE 80
48 #ifndef _LANGUAGE_ASSEMBLY
50 typedef struct _trap_struct {
73 #endif /* !_LANGUAGE_ASSEMBLY */
75 #endif /* _hndrte_armtrap_h */