1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
/*
md.h : Multiple Devices driver compatibility layer for Linux 2.0/2.2
Copyright (C) 1998 Ingo Molnar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
You should have received a copy of the GNU General Public License
(for example /usr/src/linux/COPYING); if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/version.h>
#ifndef _MD_COMPATIBLE_H
#define _MD_COMPATIBLE_H
/** 2.3/2.4 stuff: **/
#include <linux/reboot.h>
#include <linux/vmalloc.h>
#include <linux/blkpg.h>
/* 000 */
#define md__get_free_pages(x,y) __get_free_pages(x,y)
#ifdef __i386__
/* 001 */
extern __inline__ int md_cpu_has_mmx(void)
{
return boot_cpu_data.x86_capability & X86_FEATURE_MMX;
}
#endif
/* 002 */
#define md_clear_page(page) clear_page(page)
/* 003 */
#define MD_EXPORT_SYMBOL(x) EXPORT_SYMBOL(x)
/* 004 */
#define md_copy_to_user(x,y,z) copy_to_user(x,y,z)
/* 005 */
#define md_copy_from_user(x,y,z) copy_from_user(x,y,z)
/* 006 */
#define md_put_user put_user
/* 007 */
extern inline int md_capable_admin(void)
{
return capable(CAP_SYS_ADMIN);
}
/* 008 */
#define MD_FILE_TO_INODE(file) ((file)->f_dentry->d_inode)
/* 009 */
extern inline void md_flush_signals (void)
{
spin_lock(¤t->sigmask_lock);
flush_signals(current);
spin_unlock(¤t->sigmask_lock);
}
/* 010 */
extern inline void md_init_signals (void)
{
current->exit_signal = SIGCHLD;
siginitsetinv(¤t->blocked, sigmask(SIGKILL));
}
/* 011 */
#define md_signal_pending signal_pending
/* 012 - md_set_global_readahead - nowhere used */
/* 013 */
#define md_mdelay(x) mdelay(x)
/* 014 */
#define MD_SYS_DOWN SYS_DOWN
#define MD_SYS_HALT SYS_HALT
#define MD_SYS_POWER_OFF SYS_POWER_OFF
/* 015 */
#define md_register_reboot_notifier register_reboot_notifier
/* 016 */
#define md_test_and_set_bit test_and_set_bit
/* 017 */
#define md_test_and_clear_bit test_and_clear_bit
/* 018 */
#define md_atomic_read atomic_read
#define md_atomic_set atomic_set
/* 019 */
#define md_lock_kernel lock_kernel
#define md_unlock_kernel unlock_kernel
/* 020 */
#include <linux/init.h>
#define md__init __init
#define md__initdata __initdata
#define md__initfunc(__arginit) __initfunc(__arginit)
/* 021 */
/* 022 */
#define md_list_head list_head
#define MD_LIST_HEAD(name) LIST_HEAD(name)
#define MD_INIT_LIST_HEAD(ptr) INIT_LIST_HEAD(ptr)
#define md_list_add list_add
#define md_list_del list_del
#define md_list_empty list_empty
#define md_list_entry(ptr, type, member) list_entry(ptr, type, member)
/* 023 */
#define md_schedule_timeout schedule_timeout
/* 024 */
#define md_need_resched(tsk) ((tsk)->need_resched)
/* 025 */
#define md_spinlock_t spinlock_t
#define MD_SPIN_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED
#define md_spin_lock spin_lock
#define md_spin_unlock spin_unlock
#define md_spin_lock_irq spin_lock_irq
#define md_spin_unlock_irq spin_unlock_irq
#define md_spin_unlock_irqrestore spin_unlock_irqrestore
#define md_spin_lock_irqsave spin_lock_irqsave
/* 026 */
typedef wait_queue_head_t md_wait_queue_head_t;
#define MD_DECLARE_WAITQUEUE(w,t) DECLARE_WAITQUEUE((w),(t))
#define MD_DECLARE_WAIT_QUEUE_HEAD(x) DECLARE_WAIT_QUEUE_HEAD(x)
#define md_init_waitqueue_head init_waitqueue_head
/* END */
#endif _MD_COMPATIBLE_H
|