Xenomai  3.0-rc3
machine.h
1 
19 #ifndef _COBALT_ASM_GENERIC_MACHINE_H
20 #define _COBALT_ASM_GENERIC_MACHINE_H
21 
22 #include <linux/ipipe.h>
23 #include <linux/percpu.h>
24 #include <asm/byteorder.h>
25 #include <asm/xenomai/wrappers.h>
26 
27 struct vm_area_struct;
28 
29 struct xnarch_machdesc {
30  const char *name;
31  int (*init)(void);
32  void (*cleanup)(void);
33  void (*prefault)(struct vm_area_struct *vma);
34  unsigned long (*calibrate)(void);
35  const char *const *fault_labels;
36 };
37 
38 extern struct xnarch_machdesc xnarch_machdesc;
39 
40 struct xnarch_percpu_machdata {
41  unsigned long apc_pending;
42  unsigned long apc_shots[BITS_PER_LONG];
43  unsigned int faults[IPIPE_NR_FAULTS];
44 };
45 
46 DECLARE_PER_CPU(struct xnarch_percpu_machdata, xnarch_percpu_machdata);
47 
48 struct xnarch_machdata {
49  struct ipipe_domain domain;
50  unsigned long timer_freq;
51  unsigned long clock_freq;
52  unsigned int apc_virq;
53  unsigned long apc_map;
54  unsigned int escalate_virq;
55  struct {
56  void (*handler)(void *cookie);
57  void *cookie;
58  const char *name;
59  } apc_table[BITS_PER_LONG];
60 #ifdef CONFIG_SMP
61  cpumask_t supported_cpus;
62 #endif
63 };
64 
65 extern struct xnarch_machdata xnarch_machdata;
66 
67 static inline unsigned long xnarch_timer_calibrate(void)
68 {
69  return xnarch_machdesc.calibrate();
70 }
71 
72 #ifndef xnarch_cache_aliasing
73 #define xnarch_cache_aliasing() 0
74 #endif
75 
76 #endif /* !_COBALT_ASM_GENERIC_MACHINE_H */