base/include/asm-m68knommu/rtai_oldnames.h

Go to the documentation of this file.
00001 /*
00002  *   ARTI -- RTAI-compatible Adeos-based Real-Time Interface. Based on
00003  *   the original RTAI layer for x86. This file provides user-visible
00004  *   definitions for compatibility purpose with the legacy RTHAL. Must
00005  *   be included from rtai_hal.h only.
00006  *
00007  *   Original RTAI/x86 layer implementation:
00008  *   Copyright (C) 2000 Paolo Mantegazza,
00009  *   Copyright (C) 2000 Steve Papacharalambous,
00010  *   Copyright (C) 2000 Stuart Hughes,
00011  *   and others.
00012  *
00013  *   RTAI/x86 rewrite over Adeos:
00014  *   Copyright (C) 2002 Philippe Gerum.
00015  *
00016  *   This program is free software; you can redistribute it and/or modify
00017  *   it under the terms of the GNU General Public License as published by
00018  *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
00019  *   USA; either version 2 of the License, or (at your option) any later
00020  *   version.
00021  *
00022  *   This program is distributed in the hope that it will be useful,
00023  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00024  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025  *   GNU General Public License for more details.
00026  *
00027  *   You should have received a copy of the GNU General Public License
00028  *   along with this program; if not, write to the Free Software
00029  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00030  */
00031 
00032 #ifndef _RTAI_ASM_M68KNOMMU_OLDNAMES_H
00033 #define _RTAI_ASM_M68KNOMMU_OLDNAMES_H
00034 
00035 #ifdef __KERNEL__
00036 
00037 #define IFLAG                        RTAI_IFLAG
00038 #define hard_cli()                   rtai_cli()
00039 #define hard_sti()                   rtai_sti()
00040 #define hard_save_flags_and_cli(x)   rtai_save_flags_and_cli(x)
00041 #define hard_restore_flags(x)        rtai_restore_flags(x)
00042 #define hard_save_flags(x)           rtai_save_flags(x)
00043 #define hard_cpu_id                  hal_processor_id
00044 
00045 #endif /* __KERNEL__ */
00046 
00047 #ifndef __RTAI_HAL__
00048 
00049 #define tuned           rtai_tunables
00050 #define NR_RT_CPUS      RTAI_NR_CPUS
00051 #define RT_TIME_END     RTAI_TIME_LIMIT
00052 
00053 #define CPU_FREQ        RTAI_CPU_FREQ
00054 #define TIMER_8254_IRQ  RTAI_TIMER_LINUX_IRQ
00055 #define FREQ_8254       RTAI_FREQ_8254
00056 #define LATENCY_8254    RTAI_LATENCY_8254
00057 #define SETUP_TIME_8254 RTAI_SETUP_TIME_8254
00058 
00059 #define CALIBRATED_CPU_FREQ   RTAI_CALIBRATED_CPU_FREQ
00060 
00061 #ifdef __KERNEL__
00062 
00063 #define rd_CPU_ts() rtai_rdtsc()
00064 
00065 #define rt_set_rtai_trap_handler  rt_set_trap_handler
00066 #define rt_mount_rtai   rt_mount
00067 #define rt_umount_rtai  rt_umount
00068 #define calibrate_8254  rtai_calibrate_8254
00069 
00070 #define ulldiv(a,b,c)   rtai_ulldiv(a,b,c)
00071 #define imuldiv(a,b,c)  rtai_imuldiv(a,b,c)
00072 #define llimd(a,b,c)    rtai_llimd(a,b,c)
00073 #define u64div32(a,b,c) rtai_u64div32c(a,b,c)
00074 
00075 #ifndef __cplusplus
00076 
00077 #include <linux/irq.h>
00078 /*
00079 #include <asm/desc.h>
00080 
00081 extern struct desc_struct idt_table[];
00082 
00083 static inline struct desc_struct rt_set_full_intr_vect (unsigned vector,
00084                             int type,
00085                             int dpl,
00086                             void (*handler)(void)) {
00087     struct desc_struct e = idt_table[vector];
00088     idt_table[vector].a = (__KERNEL_CS << 16) | ((unsigned)handler & 0x0000FFFF);
00089     idt_table[vector].b = ((unsigned)handler & 0xFFFF0000) | (0x8000 + (dpl << 13) + (type << 8));
00090     return e;
00091 }
00092 
00093 static inline void rt_reset_full_intr_vect(unsigned vector,
00094                        struct desc_struct e) {
00095     idt_table[vector] = e;
00096 }
00097 */
00098 static inline int rt_request_cpu_own_irq (unsigned irq, void (*handler)(void)) {
00099 
00100     return rt_request_irq(irq, (rt_irq_handler_t)handler, NULL, 0);
00101 }
00102 
00103 static inline int rt_free_cpu_own_irq (unsigned irq) {
00104 
00105     return rt_release_irq(irq);
00106 }
00107 /*
00108 static inline void *get_intr_handler (unsigned vector) {
00109 
00110     return (void *)((idt_table[vector].b & 0xFFFF0000) | 
00111             (idt_table[vector].a & 0x0000FFFF));
00112 }
00113 
00114 static inline void set_intr_vect (unsigned vector,
00115                   void (*handler)(void)) {
00116 
00117     idt_table[vector].a = (idt_table[vector].a & 0xFFFF0000) | 
00118     ((unsigned)handler & 0x0000FFFF);
00119     idt_table[vector].b = ((unsigned)handler & 0xFFFF0000) | 
00120     (idt_table[vector].b & 0x0000FFFF);
00121 }
00122 
00123 static inline void *rt_set_intr_handler (unsigned vector,
00124                      void (*handler)(void)) {
00125 
00126     void (*saved_handler)(void) = get_intr_handler(vector);
00127     set_intr_vect(vector, handler);
00128     return saved_handler;
00129 }
00130 
00131 static inline void rt_reset_intr_handler (unsigned vector,
00132                       void (*handler)(void)) {
00133     set_intr_vect(vector, handler);
00134 }
00135 
00136 static inline unsigned long get_cr2 (void) {
00137 
00138     unsigned long address;
00139     __asm__("movl %%cr2,%0":"=r" (address));
00140     return address;
00141 }
00142 */
00143 #endif /* __KERNEL__ */
00144 
00145 #endif /* !__cplusplus */
00146 
00147 #endif /* !__RTAI_HAL__ */
00148 
00149 #endif /* !_RTAI_ASM_M68KNOMMU_OLDNAMES_H */

Generated on Tue Feb 2 17:46:04 2010 for RTAI API by  doxygen 1.4.7