Commit | Line | Data |
---|---|---|
6a01f230 | 1 | /* -*- linux-c -*- |
9bd50df6 | 2 | * include/asm-blackfin/ipipe_base.h |
6a01f230 YL |
3 | * |
4 | * Copyright (C) 2007 Philippe Gerum. | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, | |
9 | * USA; either version 2 of the License, or (at your option) any later | |
10 | * version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program; if not, write to the Free Software | |
19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
20 | */ | |
21 | ||
22 | #ifndef __ASM_BLACKFIN_IPIPE_BASE_H | |
23 | #define __ASM_BLACKFIN_IPIPE_BASE_H | |
24 | ||
25 | #ifdef CONFIG_IPIPE | |
26 | ||
27 | #define IPIPE_NR_XIRQS NR_IRQS | |
28 | #define IPIPE_IRQ_ISHIFT 5 /* 2^5 for 32bits arch. */ | |
29 | ||
9bd50df6 PG |
30 | /* Blackfin-specific, per-cpu pipeline status */ |
31 | #define IPIPE_SYNCDEFER_FLAG 15 | |
32 | #define IPIPE_SYNCDEFER_MASK (1L << IPIPE_SYNCDEFER_MASK) | |
6a01f230 YL |
33 | |
34 | /* Blackfin traps -- i.e. exception vector numbers */ | |
35 | #define IPIPE_NR_FAULTS 52 /* We leave a gap after VEC_ILL_RES. */ | |
36 | /* Pseudo-vectors used for kernel events */ | |
37 | #define IPIPE_FIRST_EVENT IPIPE_NR_FAULTS | |
38 | #define IPIPE_EVENT_SYSCALL (IPIPE_FIRST_EVENT) | |
39 | #define IPIPE_EVENT_SCHEDULE (IPIPE_FIRST_EVENT + 1) | |
40 | #define IPIPE_EVENT_SIGWAKE (IPIPE_FIRST_EVENT + 2) | |
41 | #define IPIPE_EVENT_SETSCHED (IPIPE_FIRST_EVENT + 3) | |
42 | #define IPIPE_EVENT_INIT (IPIPE_FIRST_EVENT + 4) | |
43 | #define IPIPE_EVENT_EXIT (IPIPE_FIRST_EVENT + 5) | |
44 | #define IPIPE_EVENT_CLEANUP (IPIPE_FIRST_EVENT + 6) | |
45 | #define IPIPE_LAST_EVENT IPIPE_EVENT_CLEANUP | |
46 | #define IPIPE_NR_EVENTS (IPIPE_LAST_EVENT + 1) | |
47 | ||
48 | #define IPIPE_TIMER_IRQ IRQ_CORETMR | |
49 | ||
50 | #ifndef __ASSEMBLY__ | |
51 | ||
6a01f230 YL |
52 | extern unsigned long __ipipe_root_status; /* Alias to ipipe_root_cpudom_var(status) */ |
53 | ||
54 | static inline void __ipipe_stall_root(void) | |
55 | { | |
56 | volatile unsigned long *p = &__ipipe_root_status; | |
57 | set_bit(0, p); | |
58 | } | |
59 | ||
60 | static inline unsigned long __ipipe_test_and_stall_root(void) | |
61 | { | |
62 | volatile unsigned long *p = &__ipipe_root_status; | |
63 | return test_and_set_bit(0, p); | |
64 | } | |
65 | ||
66 | static inline unsigned long __ipipe_test_root(void) | |
67 | { | |
68 | const unsigned long *p = &__ipipe_root_status; | |
69 | return test_bit(0, p); | |
70 | } | |
71 | ||
72 | #endif /* !__ASSEMBLY__ */ | |
73 | ||
74 | #endif /* CONFIG_IPIPE */ | |
75 | ||
76 | #endif /* !__ASM_BLACKFIN_IPIPE_BASE_H */ |