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