Xenomai  3.0.8
thread.h
1 /*
2  * Copyright (C) 2005, 2012 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * Xenomai is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * Xenomai is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Xenomai; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  */
19 #ifndef _COBALT_BLACKFIN_ASM_THREAD_H
20 #define _COBALT_BLACKFIN_ASM_THREAD_H
21 
22 #include <asm-generic/xenomai/thread.h>
23 
24 struct xnarchtcb {
25  struct xntcb core;
26  struct {
27  unsigned long pc;
28  unsigned long p0;
29  unsigned long r5;
30  } mayday;
31 };
32 
33 #define xnarch_fpu_ptr(tcb) NULL
34 
35 #define xnarch_fault_regs(d) ((d)->regs)
36 #define xnarch_fault_trap(d) ((d)->exception)
37 #define xnarch_fault_code(d) (0) /* None on this arch. */
38 #define xnarch_fault_pc(d) ((d)->regs->retx)
39 #define xnarch_fault_fpu_p(d) (0) /* Can't be. */
40 
41 #define xnarch_fault_pf_p(d) (0) /* No page faults. */
42 #define xnarch_fault_bp_p(d) ((current->ptrace & PT_PTRACED) && \
43  ((d)->exception == VEC_STEP || \
44  (d)->exception == VEC_EXCPT01 || \
45  (d)->exception == VEC_WATCH))
46 
47 #define xnarch_fault_notify(d) (!xnarch_fault_bp_p(d))
48 
49 void xnarch_switch_to(struct xnthread *out, struct xnthread *in);
50 
51 int xnarch_escalate(void);
52 
53 static inline void xnarch_init_root_tcb(struct xnthread *thread) { }
54 static inline void xnarch_init_shadow_tcb(struct xnthread *thread) { }
55 static inline void xnarch_enter_root(struct xnthread *root) { }
56 static inline void xnarch_leave_root(struct xnthread *root) { }
57 static inline void
58 xnarch_switch_fpu(struct xnthread *from, struct xnthread *thread)
59 {
60 }
61 
62 static inline int
63 xnarch_handle_fpu_fault(struct xnthread *from,
64  struct xnthread *to, struct ipipe_trap_data *d)
65 {
66  return 0;
67 }
68 
69 #endif /* !_COBALT_BLACKFIN_ASM_THREAD_H */