Xenomai  3.1
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 cobalt_machine {
30  const char *name;
31  int (*init)(void);
32  int (*late_init)(void);
33  void (*cleanup)(void);
34  void (*prefault)(struct vm_area_struct *vma);
35  unsigned long (*calibrate)(void);
36  const char *const *fault_labels;
37 };
38 
39 extern struct cobalt_machine cobalt_machine;
40 
41 struct cobalt_machine_cpudata {
42  unsigned long apc_pending;
43  unsigned long apc_shots[BITS_PER_LONG];
44  unsigned int faults[IPIPE_NR_FAULTS];
45 };
46 
47 DECLARE_PER_CPU(struct cobalt_machine_cpudata, cobalt_machine_cpudata);
48 
49 struct cobalt_pipeline {
50  struct ipipe_domain domain;
51  unsigned long timer_freq;
52  unsigned long clock_freq;
53  unsigned int apc_virq;
54  unsigned long apc_map;
55  unsigned int escalate_virq;
56  struct {
57  void (*handler)(void *cookie);
58  void *cookie;
59  const char *name;
60  } apc_table[BITS_PER_LONG];
61 #ifdef CONFIG_SMP
62  cpumask_t supported_cpus;
63 #endif
64 };
65 
66 extern struct cobalt_pipeline cobalt_pipeline;
67 
68 static inline unsigned long xnarch_timer_calibrate(void)
69 {
70  return cobalt_machine.calibrate();
71 }
72 
73 #ifndef xnarch_cache_aliasing
74 #define xnarch_cache_aliasing() 0
75 #endif
76 
77 #endif /* !_COBALT_ASM_GENERIC_MACHINE_H */