1 /*
2  * Copyright 2007-2009 Analog Devices Inc.
3  *                         Philippe Gerum <rpm@xenomai.org>
4  *
5  * Licensed under the GPL-2 or later.
6  */
7 
8 #ifndef _ASM_BLACKFIN_PDA_H
9 #define _ASM_BLACKFIN_PDA_H
10 
11 #include <mach/anomaly.h>
12 
13 #ifndef __ASSEMBLY__
14 
15 struct blackfin_pda {			/* Per-processor Data Area */
16 	struct blackfin_pda *next;
17 
18 	unsigned long syscfg;
19 #ifdef CONFIG_SMP
20 	unsigned long imask;		/* Current IMASK value */
21 #endif
22 
23 	unsigned long *ipdt;		/* Start of switchable I-CPLB table */
24 	unsigned long *ipdt_swapcount;	/* Number of swaps in ipdt */
25 	unsigned long *dpdt;		/* Start of switchable D-CPLB table */
26 	unsigned long *dpdt_swapcount;	/* Number of swaps in dpdt */
27 
28 	/*
29 	 * Single instructions can have multiple faults, which
30 	 * need to be handled by traps.c, in irq5. We store
31 	 * the exception cause to ensure we don't miss a
32 	 * double fault condition
33 	 */
34 	unsigned long ex_iptr;
35 	unsigned long ex_optr;
36 	unsigned long ex_buf[4];
37 	unsigned long ex_imask;		/* Saved imask from exception */
38 	unsigned long ex_ipend;		/* Saved IPEND from exception */
39 	unsigned long *ex_stack;	/* Exception stack space */
40 
41 #ifdef ANOMALY_05000261
42 	unsigned long last_cplb_fault_retx;
43 #endif
44 	unsigned long dcplb_fault_addr;
45 	unsigned long icplb_fault_addr;
46 	unsigned long retx;
47 	unsigned long seqstat;
48 	unsigned int __nmi_count;	/* number of times NMI asserted on this CPU */
49 #ifdef CONFIG_DEBUG_DOUBLEFAULT
50 	unsigned long dcplb_doublefault_addr;
51 	unsigned long icplb_doublefault_addr;
52 	unsigned long retx_doublefault;
53 	unsigned long seqstat_doublefault;
54 #endif
55 };
56 
57 struct blackfin_initial_pda {
58 	void *retx;
59 #ifdef CONFIG_DEBUG_DOUBLEFAULT
60 	void *dcplb_doublefault_addr;
61 	void *icplb_doublefault_addr;
62 	void *retx_doublefault;
63 	unsigned seqstat_doublefault;
64 #endif
65 };
66 
67 extern struct blackfin_pda cpu_pda[];
68 
69 #endif	/* __ASSEMBLY__ */
70 
71 #endif /* _ASM_BLACKFIN_PDA_H */
72