Resync with broadcom drivers 5.100.138.20 and utilities.
[tomato.git] / release / src-rt / include / hndrte_armtrap.h
blob0002801a21e9f600339827decf4260a6cf40fc7c
1 /*
2 * HNDRTE arm trap handling.
4 * Copyright (C) 2010, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
8 * the contents of this file may not be disclosed to third parties, copied
9 * or duplicated in any form, in whole or in part, without the prior
10 * written permission of Broadcom Corporation.
12 * $Id: hndrte_armtrap.h,v 13.4 2009-07-13 23:25:52 Exp $
15 #ifndef _hndrte_armtrap_h
16 #define _hndrte_armtrap_h
19 /* ARM trap handling */
21 /* Trap types defined by ARM (see arminc.h) */
23 /* Trap locations in lo memory */
24 #define TRAP_STRIDE 4
25 #define FIRST_TRAP TR_RST
26 #define LAST_TRAP (TR_FIQ * TRAP_STRIDE)
28 #if defined(__ARM_ARCH_4T__)
29 #define MAX_TRAP_TYPE (TR_FIQ + 1)
30 #elif defined(__ARM_ARCH_7M__)
31 #define MAX_TRAP_TYPE (TR_ISR + ARMCM3_NUMINTS)
32 #endif /* __ARM_ARCH_7M__ */
34 /* The trap structure is defined here as offsets for assembly */
35 #define TR_TYPE 0x00
36 #define TR_EPC 0x04
37 #define TR_CPSR 0x08
38 #define TR_SPSR 0x0c
39 #define TR_REGS 0x10
40 #define TR_REG(n) (TR_REGS + (n) * 4)
41 #define TR_SP TR_REG(13)
42 #define TR_LR TR_REG(14)
43 #define TR_PC TR_REG(15)
45 #define TRAP_T_SIZE 80
47 #ifndef _LANGUAGE_ASSEMBLY
49 #include <typedefs.h>
51 typedef struct _trap_struct {
52 uint32 type;
53 uint32 epc;
54 uint32 cpsr;
55 uint32 spsr;
56 uint32 r0;
57 uint32 r1;
58 uint32 r2;
59 uint32 r3;
60 uint32 r4;
61 uint32 r5;
62 uint32 r6;
63 uint32 r7;
64 uint32 r8;
65 uint32 r9;
66 uint32 r10;
67 uint32 r11;
68 uint32 r12;
69 uint32 r13;
70 uint32 r14;
71 uint32 pc;
72 } trap_t;
74 #endif /* !_LANGUAGE_ASSEMBLY */
76 #endif /* _hndrte_armtrap_h */