2 * HNDRTE arm trap handling.
4 * Copyright (C) 2012, Broadcom Corporation. All Rights Reserved.
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * $Id: hndrte_armtrap.h 261365 2011-05-24 20:42:23Z $
21 #ifndef _hndrte_armtrap_h
22 #define _hndrte_armtrap_h
25 /* ARM trap handling */
27 /* Trap types defined by ARM (see arminc.h) */
29 /* Trap locations in lo memory */
31 #define FIRST_TRAP TR_RST
32 #define LAST_TRAP (TR_FIQ * TRAP_STRIDE)
34 #if defined(__ARM_ARCH_4T__)
35 #define MAX_TRAP_TYPE (TR_FIQ + 1)
36 #elif defined(__ARM_ARCH_7M__)
37 #define MAX_TRAP_TYPE (TR_ISR + ARMCM3_NUMINTS)
38 #endif /* __ARM_ARCH_7M__ */
40 /* The trap structure is defined here as offsets for assembly */
46 #define TR_REG(n) (TR_REGS + (n) * 4)
47 #define TR_SP TR_REG(13)
48 #define TR_LR TR_REG(14)
49 #define TR_PC TR_REG(15)
51 #define TRAP_T_SIZE 80
53 #ifndef _LANGUAGE_ASSEMBLY
57 typedef struct _trap_struct
{
71 uint32 r9
; /* sb/v6 */
72 uint32 r10
; /* sl/v7 */
73 uint32 r11
; /* fp/v8 */
80 #endif /* !_LANGUAGE_ASSEMBLY */
82 #endif /* _hndrte_armtrap_h */