00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MOST_COMMON_RT_H
00022 #define MOST_COMMON_RT_H
00023
00031 #ifdef HAVE_CONFIG_H
00032 #include "config/config.h"
00033 #endif
00034 #include <linux/spinlock.h>
00035 #include <linux/rwsem.h>
00036 #include <linux/list.h>
00037
00038 #ifndef RT_RTDM
00039 # warning "This file is only usable with RTDM driver."
00040 #endif
00041
00048 struct rt_spin_locked_list {
00049 struct list_head list;
00050 rtdm_lock_t lock;
00051 };
00052
00053
00060 #define RT_SPIN_LOCKED_LIST(name) \
00061 struct rt_spin_locked_list name = { \
00062 .list = LIST_HEAD_INIT(name.list), \
00063 .lock = RTDM_LOCK_UNLOCKED \
00064 }
00065
00066
00081 #define copy_from_user_or_kernel(err, user_info, dst, src, size) \
00082 do { \
00083 if (user_info) { \
00084 err = rtdm_copy_from_user(user_info, dst, src, size); \
00085 } else { \
00086 memcpy(dst, src, size); \
00087 err = 0; \
00088 } \
00089 } while (0)
00090
00091 #endif
00092
00093
00094