/usr/include/rtai/rtai_hal_names.h is in librtai-dev 3.9.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | /*
* Copyright 2005 Paolo Mantegazza <mantegazza@aero.polimi.it>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _RTAI_HAL_NAMES_H
#define _RTAI_HAL_NAMES_H
#include <linux/version.h>
#define TSKEXT0 (HAL_ROOT_NPTDKEYS - 4)
#define TSKEXT1 (HAL_ROOT_NPTDKEYS - 3)
#define TSKEXT2 (HAL_ROOT_NPTDKEYS - 2)
#define TSKEXT3 (HAL_ROOT_NPTDKEYS - 1)
#if !defined(CONFIG_PPC) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,32) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)))
#define HAL_VERSION_STRING ADEOS_VERSION_STRING
#define HAL_NR_CPUS ADEOS_NR_CPUS
#define HAL_NR_FAULTS ADEOS_NR_FAULTS
#define HAL_NR_EVENTS ADEOS_NR_EVENTS
#define HAL_ROOT_NPTDKEYS ADEOS_ROOT_NPTDKEYS
#define HAL_APIC_HIGH_VECTOR ADEOS_SERVICE_VECTOR3
#define HAL_APIC_LOW_VECTOR ADEOS_SERVICE_VECTOR2
#define HAL_SCHEDULE_HEAD ADEOS_SCHEDULE_HEAD
#define HAL_SCHEDULE_TAIL ADEOS_SCHEDULE_TAIL
#define HAL_SYSCALL_PROLOGUE ADEOS_SYSCALL_PROLOGUE
#define HAL_SYSCALL_EPILOGUE 1000000 // invalid for sure, will be rejected, OK ADEOS_SYSCALL_EPILOGUE
#define HAL_EXIT_PROCESS ADEOS_EXIT_PROCESS
#define HAL_KICK_PROCESS ADEOS_KICK_PROCESS
extern struct list_head __adeos_pipeline;
#define hal_pipeline __adeos_pipeline
#define hal_domain_struct adomain
#define hal_root_domain adp_root
#define hal_current_domain(x) adp_cpu_current[x]
#define hal_propagate_irq adeos_propagate_irq
#define hal_schedule_irq adeos_schedule_irq
#define hal_critical_enter adeos_critical_enter
#define hal_critical_exit adeos_critical_exit
#define hal_clear_irq __adeos_clear_irq
#define hal_lock_irq __adeos_lock_irq
#define hal_unlock_irq __adeos_unlock_irq
#define hal_std_irq_dtype __adeos_std_irq_dtype
#define hal_adeos_std_irq_dtype __adeos_std_irq_dtype
#define hal_tick_regs __adeos_tick_regs
#define hal_tick_irq __adeos_tick_irq
#define hal_sync_stage __adeos_sync_stage
#define hal_set_irq_affinity adeos_set_irq_affinity
#define hal_set_irq_handler adeos_set_irq_handler
#define hal_propagate_event adeos_propagate_event
#define hal_get_sysinfo adeos_get_sysinfo
#define INTERCEPT_WAKE_UP_TASK(data) (((struct sig_wakeup_t *)data)->task)
#define FIRST_LINE_OF_RTAI_DOMAIN_ENTRY static void rtai_domain_entry(int iflag) { if (iflag)
#define LAST_LINE_OF_RTAI_DOMAIN_ENTRY }
#ifdef CONFIG_ADEOS_NOTHREADS
#define HAL_TYPE "ADEOS-NOTHREADS"
#define hal_suspend_domain() break
#else
#define HAL_TYPE "ADEOS-THREADS"
#define hal_suspend_domain() adeos_suspend_domain()
#endif
#define hal_alloc_irq adeos_alloc_irq
#define hal_free_irq adeos_free_irq
#define hal_virtualize_irq adeos_virtualize_irq_from
#define hal_irq_hits_pp(irq, domain, cpuid) \
do { \
domain->cpudata[cpuid].irq_hits[irq]++; \
} while (0)
#define hal_sysinfo_struct adsysinfo
#define hal_attr_struct adattr
#define hal_init_attr adeos_init_attr
#define hal_register_domain adeos_register_domain
#define hal_unregister_domain adeos_unregister_domain
#define hal_catch_event adeos_catch_event_from
#define hal_event_handler adeos_event_handler
#define hal_event_handler_fun(e) events[e].handler
#define hal_set_printk_sync adeos_set_printk_sync
#define hal_set_printk_async adeos_set_printk_async
#define hal_schedule_back_root(prev) \
do { \
if ((prev)->rtai_tskext(HAL_ROOT_NPTDKEYS - 1)) { \
__adeos_schedule_back_root((prev)->rtai_tskext(HAL_ROOT_NPTDKEYS - 1)); \
(prev)->rtai_tskext(HAL_ROOT_NPTDKEYS - 1) = NULL; \
} else { \
__adeos_schedule_back_root(prev); \
} \
} while (0)
#define hal_processor_id adeos_processor_id
#define hal_hw_cli adeos_hw_cli
#define hal_hw_sti adeos_hw_sti
#define hal_hw_local_irq_save adeos_hw_local_irq_save
#define hal_hw_local_irq_restore adeos_hw_local_irq_restore
#define hal_hw_local_irq_flags adeos_hw_local_irq_flags
#define hal_unstall_pipeline_from adeos_unstall_pipeline_from
#define hal_ack_system_irq __adeos_ack_system_irq
#define hal_irq_handler adeos_extern_irq_handler
#define hal_tskext ptd
#define hal_set_linux_task_priority __adeos_setscheduler_root
#else
#define HAL_VERSION_STRING IPIPE_VERSION_STRING
#define HAL_NR_CPUS IPIPE_NR_CPUS
#define HAL_NR_FAULTS IPIPE_NR_FAULTS
#define HAL_NR_EVENTS IPIPE_NR_EVENTS
#define HAL_ROOT_NPTDKEYS IPIPE_ROOT_NPTDKEYS
#define HAL_APIC_HIGH_VECTOR IPIPE_SERVICE_VECTOR3
#define HAL_APIC_LOW_VECTOR IPIPE_SERVICE_VECTOR2
#define HAL_SCHEDULE_HEAD IPIPE_EVENT_SCHEDULE
#define HAL_SCHEDULE_TAIL (IPIPE_FIRST_EVENT - 2) // safely unused, cared
#define HAL_SYSCALL_PROLOGUE IPIPE_EVENT_SYSCALL
#define HAL_SYSCALL_EPILOGUE 1000000 // invalid for sure, will be rejected, OK
#define HAL_EXIT_PROCESS IPIPE_EVENT_EXIT
#define HAL_KICK_PROCESS IPIPE_EVENT_SIGWAKE
#define hal_pipeline __ipipe_pipeline
#define hal_domain_struct ipipe_domain
#define hal_root_domain ipipe_root_domain
// temporary fix for using PPC
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) || (defined(CONFIG_PPC) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
#define hal_current_domain(cpuid) per_cpu(ipipe_percpu_domain, cpuid)
#else
#define hal_current_domain(cpuid) (ipipe_percpu_domain[cpuid])
#endif
#define hal_propagate_irq ipipe_propagate_irq
#define hal_schedule_irq ipipe_schedule_irq
#define hal_critical_enter ipipe_critical_enter
#define hal_critical_exit ipipe_critical_exit
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
#define hal_clear_irq __ipipe_clear_irq
#else
#define hal_clear_irq(a, b)
#endif
#define hal_lock_irq __ipipe_lock_irq
#define hal_unlock_irq __ipipe_unlock_irq
#define hal_std_irq_dtype __ipipe_std_irq_dtype
#define hal_ipipe_std_irq_dtype __adeos_std_irq_dtype
#define hal_tick_regs __ipipe_tick_regs
#define hal_tick_irq __ipipe_tick_irq
#define hal_sync_stage __ipipe_sync_stage
#define hal_set_irq_affinity ipipe_set_irq_affinity
#define hal_propagate_event ipipe_propagate_event
#define hal_get_sysinfo ipipe_get_sysinfo
#define HAL_TYPE "IPIPE-NOTHREADS"
#define INTERCEPT_WAKE_UP_TASK(data) ((struct task_struct *)data)
#define FIRST_LINE_OF_RTAI_DOMAIN_ENTRY static void rtai_domain_entry(void) { if (1)
#define LAST_LINE_OF_RTAI_DOMAIN_ENTRY }
#define hal_suspend_domain() break
#define hal_alloc_irq ipipe_alloc_virq
#define hal_free_irq ipipe_free_virq
#if !defined(CONFIG_PPC) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,32) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)))
#define hal_virtualize_irq ipipe_virtualize_irq
#define hal_irq_hits_pp(irq, domain, cpuid) \
do { \
domain->cpudata[cpuid].irq_hits[irq]++; \
} while (0)
#else
#define hal_virtualize_irq(d, n, h, a, m) \
ipipe_virtualize_irq(d, n, (void *)h, NULL, a, m)
#define hal_irq_hits_pp(irq, domain, cpuid) \
do { \
/* domain->cpudata[cpuid].irq_counters[irq].total_hits++; REMIND ME TOO */\
domain->cpudata[cpuid].irq_counters[irq].pending_hits++; \
} while (0)
#endif
#define hal_sysinfo_struct ipipe_sysinfo
#define hal_attr_struct ipipe_domain_attr
#define hal_init_attr ipipe_init_attr
#define hal_register_domain ipipe_register_domain
#define hal_unregister_domain ipipe_unregister_domain
#define hal_catch_event ipipe_catch_event
#define hal_event_handler ipipe_event_handler
#define hal_event_handler_fun(e) evhand[e]
#define hal_set_printk_sync ipipe_set_printk_sync
#define hal_set_printk_async ipipe_set_printk_async
#define hal_schedule_back_root(prev) \
do { \
if ((prev)->rtai_tskext(HAL_ROOT_NPTDKEYS - 1)) { \
ipipe_reenter_root((prev)->rtai_tskext(HAL_ROOT_NPTDKEYS - 1), (prev)->policy, (prev)->rt_priority); \
(prev)->rtai_tskext(HAL_ROOT_NPTDKEYS - 1) = NULL; \
} else { \
ipipe_reenter_root(prev, (prev)->policy, (prev)->rt_priority); \
} \
} while (0)
#define hal_processor_id ipipe_processor_id
#define hal_hw_cli local_irq_disable_hw
#define hal_hw_sti local_irq_enable_hw
#define hal_hw_local_irq_save local_irq_save_hw
#define hal_hw_local_irq_restore local_irq_restore_hw
#define hal_hw_local_irq_flags local_save_flags_hw
#define hal_set_timer(ns) ipipe_tune_timer(ns, 0)
#define hal_reset_timer() ipipe_tune_timer(0, IPIPE_RESET_TIMER)
#define hal_unstall_pipeline_from ipipe_unstall_pipeline_from
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#define hal_ack_system_irq __ipipe_ack_system_irq
#else
#define hal_ack_system_irq __ipipe_ack_apic
#endif
#define hal_irq_handler ipipe_irq_handler
#define hal_tskext ptd
#define hal_set_linux_task_priority ipipe_setscheduler_root
#endif
#if defined(IPIPE_ROOT_NPTDKEYS) && TSKEXT0 < 0
#error *** TSKEXTs WILL CAUSE MEMORY LEAKS, CHECK BOUNDS IN HAL PATCHES ***
#endif
#endif
|