2
* ARTI -- RTAI-compatible Adeos-based Real-Time Interface. Based on
3
* the original RTAI layer for x86. This file provides user-visible
4
* definitions for compatibility purpose with the legacy RTHAL. Must
5
* be included from rtai_hal.h only.
7
* Original RTAI/x86 layer implementation:
8
* Copyright (C) 2000 Paolo Mantegazza,
9
* Copyright (C) 2000 Steve Papacharalambous,
10
* Copyright (C) 2000 Stuart Hughes,
13
* RTAI/x86 rewrite over Adeos:
14
* Copyright (C) 2002 Philippe Gerum.
16
* This program is free software; you can redistribute it and/or modify
17
* it under the terms of the GNU General Public License as published by
18
* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
19
* USA; either version 2 of the License, or (at your option) any later
22
* This program is distributed in the hope that it will be useful,
23
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
* GNU General Public License for more details.
27
* You should have received a copy of the GNU General Public License
28
* along with this program; if not, write to the Free Software
29
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32
#ifndef _RTAI_ASM_M68KNOMMU_OLDNAMES_H
33
#define _RTAI_ASM_M68KNOMMU_OLDNAMES_H
37
#define IFLAG RTAI_IFLAG
38
#define hard_cli() rtai_cli()
39
#define hard_sti() rtai_sti()
40
#define hard_save_flags_and_cli(x) rtai_save_flags_and_cli(x)
41
#define hard_restore_flags(x) rtai_restore_flags(x)
42
#define hard_save_flags(x) rtai_save_flags(x)
43
#define hard_cpu_id hal_processor_id
45
#endif /* __KERNEL__ */
49
#define tuned rtai_tunables
50
#define NR_RT_CPUS RTAI_NR_CPUS
51
#define RT_TIME_END RTAI_TIME_LIMIT
53
#define CPU_FREQ RTAI_CPU_FREQ
54
#define TIMER_8254_IRQ RTAI_TIMER_LINUX_IRQ
55
#define FREQ_8254 RTAI_FREQ_8254
56
#define LATENCY_8254 RTAI_LATENCY_8254
57
#define SETUP_TIME_8254 RTAI_SETUP_TIME_8254
59
#define CALIBRATED_CPU_FREQ RTAI_CALIBRATED_CPU_FREQ
63
#define rd_CPU_ts() rtai_rdtsc()
65
#define rt_set_rtai_trap_handler rt_set_trap_handler
66
#define rt_mount_rtai rt_mount
67
#define rt_umount_rtai rt_umount
68
#define calibrate_8254 rtai_calibrate_8254
70
#define ulldiv(a,b,c) rtai_ulldiv(a,b,c)
71
#define imuldiv(a,b,c) rtai_imuldiv(a,b,c)
72
#define llimd(a,b,c) rtai_llimd(a,b,c)
73
#define u64div32(a,b,c) rtai_u64div32c(a,b,c)
77
#include <linux/irq.h>
81
extern struct desc_struct idt_table[];
83
static inline struct desc_struct rt_set_full_intr_vect (unsigned vector,
86
void (*handler)(void)) {
87
struct desc_struct e = idt_table[vector];
88
idt_table[vector].a = (__KERNEL_CS << 16) | ((unsigned)handler & 0x0000FFFF);
89
idt_table[vector].b = ((unsigned)handler & 0xFFFF0000) | (0x8000 + (dpl << 13) + (type << 8));
93
static inline void rt_reset_full_intr_vect(unsigned vector,
94
struct desc_struct e) {
95
idt_table[vector] = e;
98
static inline int rt_request_cpu_own_irq (unsigned irq, void (*handler)(void)) {
100
return rt_request_irq(irq, (rt_irq_handler_t)handler, NULL, 0);
103
static inline int rt_free_cpu_own_irq (unsigned irq) {
105
return rt_release_irq(irq);
108
static inline void *get_intr_handler (unsigned vector) {
110
return (void *)((idt_table[vector].b & 0xFFFF0000) |
111
(idt_table[vector].a & 0x0000FFFF));
114
static inline void set_intr_vect (unsigned vector,
115
void (*handler)(void)) {
117
idt_table[vector].a = (idt_table[vector].a & 0xFFFF0000) |
118
((unsigned)handler & 0x0000FFFF);
119
idt_table[vector].b = ((unsigned)handler & 0xFFFF0000) |
120
(idt_table[vector].b & 0x0000FFFF);
123
static inline void *rt_set_intr_handler (unsigned vector,
124
void (*handler)(void)) {
126
void (*saved_handler)(void) = get_intr_handler(vector);
127
set_intr_vect(vector, handler);
128
return saved_handler;
131
static inline void rt_reset_intr_handler (unsigned vector,
132
void (*handler)(void)) {
133
set_intr_vect(vector, handler);
136
static inline unsigned long get_cr2 (void) {
138
unsigned long address;
139
__asm__("movl %%cr2,%0":"=r" (address));
143
#endif /* __KERNEL__ */
145
#endif /* !__cplusplus */
147
#endif /* !__RTAI_HAL__ */
149
#endif /* !_RTAI_ASM_M68KNOMMU_OLDNAMES_H */