00001 #ifndef __DDE26_LOCAL_H
00002 #define __DDE26_LOCAL_H
00003
00004 #include <linux/sched.h>
00005
00006 #include <l4/dde/ddekit/assert.h>
00007 #include <l4/dde/ddekit/condvar.h>
00008 #include <l4/dde/ddekit/debug.h>
00009 #include <l4/dde/ddekit/initcall.h>
00010 #include <l4/dde/ddekit/interrupt.h>
00011 #include <l4/dde/ddekit/lock.h>
00012 #include <l4/dde/ddekit/memory.h>
00013 #include <l4/dde/ddekit/panic.h>
00014 #include <l4/dde/ddekit/pci.h>
00015 #include <l4/dde/ddekit/pgtab.h>
00016 #include <l4/dde/ddekit/printf.h>
00017 #include <l4/dde/ddekit/resources.h>
00018 #include <l4/dde/ddekit/semaphore.h>
00019 #include <l4/dde/ddekit/thread.h>
00020 #include <l4/dde/ddekit/types.h>
00021 #include <l4/dde/ddekit/timer.h>
00022
00023 #include <l4/dde/linux26/dde26.h>
00024
00025 #define DDE_DEBUG 1
00026 #define DDE_FERRET 0
00027
00028
00029
00030 #if DDE_FERRET
00031 #include <l4/ferret/maj_min.h>
00032 #include <l4/ferret/client.h>
00033 #include <l4/ferret/clock.h>
00034 #include <l4/ferret/types.h>
00035 #include <l4/ferret/sensors/list_producer.h>
00036 #include <l4/ferret/sensors/list_producer_wrap.h>
00037 extern ferret_list_local_t *ferret_ore_sensor;
00038 #endif
00039
00040
00041
00042
00043
00044 typedef struct dde26_thread_data
00045 {
00046
00047 struct thread_info _thread_info;
00048 ddekit_thread_t *_ddekit_thread;
00049 ddekit_sem_t *_sleep_lock;
00050 struct pid _vpid;
00051 } dde26_thread_data;
00052
00053 #define LX_THREAD(thread_data) ((thread_data)->_thread_info)
00054 #define LX_TASK(thread_data) ((thread_data)->_thread_info.task)
00055 #define DDEKIT_THREAD(thread_data) ((thread_data)->_ddekit_thread)
00056 #define SLEEP_LOCK(thread_data) ((thread_data)->_sleep_lock)
00057 #define VPID_P(thread_data) (&(thread_data)->_vpid)
00058
00059 #if DDE_DEBUG
00060 #define WARN_UNIMPL printk("unimplemented: %s\n", __FUNCTION__)
00061 #define DEBUG_MSG(msg, ...) printk("%s: \033[36m"msg"\033[0m\n", __FUNCTION__, ##__VA_ARGS__)
00062
00063 #define DECLARE_INITVAR(name) \
00064 static struct { \
00065 int _initialized; \
00066 char *name; \
00067 } init_##name = {0, #name,}
00068
00069 #define INITIALIZE_INITVAR(name) init_##name._initialized = 1
00070
00071 #define CHECK_INITVAR(name) \
00072 if (init_##name._initialized == 0) { \
00073 printk("DDE26: \033[31;1mUsing uninitialized subsystem: "#name"\033[0m\n"); \
00074 BUG(); \
00075 }
00076
00077 #else
00078
00079 #define WARN_UNIMPL do {} while(0)
00080 #define DEBUG_MSG(...) do {} while(0)
00081 #define DECLARE_INITVAR(name)
00082 #define CHECK_INITVAR(name) do {} while(0)
00083 #define INITIALIZE_INITVAR(name) do {} while(0)
00084
00085 #endif
00086
00087
00088
00089
00090
00091 static dde26_thread_data *lxtask_to_ddethread(struct task_struct *t)
00092 {
00093 return (dde26_thread_data *)(task_thread_info(t));
00094 }
00095
00096 extern struct thread_info init_thread;
00097 extern struct task_struct init_task;
00098
00099 #endif