~ubuntu-branches/debian/jessie/rtai/jessie

« back to all changes in this revision

Viewing changes to base/include/asm-m68knommu/rtai_oldnames.h

  • Committer: Bazaar Package Importer
  • Author(s): Roland Stigge
  • Date: 2009-07-04 11:47:08 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090704114708-0ivbkccfaawz2pby
Tags: 3.7.1-1
* New upstream release
* debian/control: Standards-Version: 3.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
6
 *
 
7
 *   Original RTAI/x86 layer implementation:
 
8
 *   Copyright (C) 2000 Paolo Mantegazza,
 
9
 *   Copyright (C) 2000 Steve Papacharalambous,
 
10
 *   Copyright (C) 2000 Stuart Hughes,
 
11
 *   and others.
 
12
 *
 
13
 *   RTAI/x86 rewrite over Adeos:
 
14
 *   Copyright (C) 2002 Philippe Gerum.
 
15
 *
 
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
 
20
 *   version.
 
21
 *
 
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.
 
26
 *
 
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.
 
30
 */
 
31
 
 
32
#ifndef _RTAI_ASM_M68KNOMMU_OLDNAMES_H
 
33
#define _RTAI_ASM_M68KNOMMU_OLDNAMES_H
 
34
 
 
35
#ifdef __KERNEL__
 
36
 
 
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
 
44
 
 
45
#endif /* __KERNEL__ */
 
46
 
 
47
#ifndef __RTAI_HAL__
 
48
 
 
49
#define tuned           rtai_tunables
 
50
#define NR_RT_CPUS      RTAI_NR_CPUS
 
51
#define RT_TIME_END     RTAI_TIME_LIMIT
 
52
 
 
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
 
58
 
 
59
#define CALIBRATED_CPU_FREQ   RTAI_CALIBRATED_CPU_FREQ
 
60
 
 
61
#ifdef __KERNEL__
 
62
 
 
63
#define rd_CPU_ts() rtai_rdtsc()
 
64
 
 
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
 
69
 
 
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)
 
74
 
 
75
#ifndef __cplusplus
 
76
 
 
77
#include <linux/irq.h>
 
78
/*
 
79
#include <asm/desc.h>
 
80
 
 
81
extern struct desc_struct idt_table[];
 
82
 
 
83
static inline struct desc_struct rt_set_full_intr_vect (unsigned vector,
 
84
                                                        int type,
 
85
                                                        int dpl,
 
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));
 
90
    return e;
 
91
}
 
92
 
 
93
static inline void rt_reset_full_intr_vect(unsigned vector,
 
94
                                           struct desc_struct e) {
 
95
    idt_table[vector] = e;
 
96
}
 
97
*/
 
98
static inline int rt_request_cpu_own_irq (unsigned irq, void (*handler)(void)) {
 
99
 
 
100
    return rt_request_irq(irq, (rt_irq_handler_t)handler, NULL, 0);
 
101
}
 
102
 
 
103
static inline int rt_free_cpu_own_irq (unsigned irq) {
 
104
 
 
105
    return rt_release_irq(irq);
 
106
}
 
107
/*
 
108
static inline void *get_intr_handler (unsigned vector) {
 
109
 
 
110
    return (void *)((idt_table[vector].b & 0xFFFF0000) | 
 
111
                    (idt_table[vector].a & 0x0000FFFF));
 
112
}
 
113
 
 
114
static inline void set_intr_vect (unsigned vector,
 
115
                                  void (*handler)(void)) {
 
116
 
 
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);
 
121
}
 
122
 
 
123
static inline void *rt_set_intr_handler (unsigned vector,
 
124
                                         void (*handler)(void)) {
 
125
 
 
126
    void (*saved_handler)(void) = get_intr_handler(vector);
 
127
    set_intr_vect(vector, handler);
 
128
    return saved_handler;
 
129
}
 
130
 
 
131
static inline void rt_reset_intr_handler (unsigned vector,
 
132
                                          void (*handler)(void)) {
 
133
    set_intr_vect(vector, handler);
 
134
}
 
135
 
 
136
static inline unsigned long get_cr2 (void) {
 
137
 
 
138
    unsigned long address;
 
139
    __asm__("movl %%cr2,%0":"=r" (address));
 
140
    return address;
 
141
}
 
142
*/
 
143
#endif /* __KERNEL__ */
 
144
 
 
145
#endif /* !__cplusplus */
 
146
 
 
147
#endif /* !__RTAI_HAL__ */
 
148
 
 
149
#endif /* !_RTAI_ASM_M68KNOMMU_OLDNAMES_H */