Bug #6 ยป sys.emulation.diff
ibcs2/i386/ibcs2_fcntl.c 8 Dec 2005 22:31:33 -0000 | ||
---|---|---|
52 | 52 |
static int ioflags2oflags (int); |
53 | 53 | |
54 | 54 |
static int |
55 |
cvt_o_flags(flags) |
|
56 |
int flags; |
|
55 |
cvt_o_flags(int flags) |
|
57 | 56 |
{ |
58 | 57 |
int r = 0; |
59 | 58 | |
... | ... | |
73 | 72 |
} |
74 | 73 | |
75 | 74 |
static void |
76 |
cvt_flock2iflock(flp, iflp) |
|
77 |
struct flock *flp; |
|
78 |
struct ibcs2_flock *iflp; |
|
75 |
cvt_flock2iflock(struct flock *flp, struct ibcs2_flock *iflp) |
|
79 | 76 |
{ |
80 | 77 |
switch (flp->l_type) { |
81 | 78 |
case F_RDLCK: |
... | ... | |
106 | 103 |
#endif |
107 | 104 | |
108 | 105 |
static void |
109 |
cvt_iflock2flock(iflp, flp) |
|
110 |
struct ibcs2_flock *iflp; |
|
111 |
struct flock *flp; |
|
106 |
cvt_iflock2flock(struct ibcs2_flock *iflp, struct flock *flp) |
|
112 | 107 |
{ |
113 | 108 |
flp->l_start = (off_t)iflp->l_start; |
114 | 109 |
flp->l_len = (off_t)iflp->l_len; |
... | ... | |
129 | 124 | |
130 | 125 |
/* convert iBCS2 mode into NetBSD mode */ |
131 | 126 |
static int |
132 |
ioflags2oflags(flags) |
|
133 |
int flags; |
|
127 |
ioflags2oflags(int flags) |
|
134 | 128 |
{ |
135 | 129 |
int r = 0; |
136 | 130 |
|
... | ... | |
150 | 144 | |
151 | 145 |
/* convert NetBSD mode into iBCS2 mode */ |
152 | 146 |
static int |
153 |
oflags2ioflags(flags) |
|
154 |
int flags; |
|
147 |
oflags2ioflags(int flags) |
|
155 | 148 |
{ |
156 | 149 |
int r = 0; |
157 | 150 |
|
ibcs2/i386/ibcs2_ioctl.c 8 Dec 2005 22:34:33 -0000 | ||
---|---|---|
127 | 127 |
}; |
128 | 128 | |
129 | 129 |
static void |
130 |
stios2btios(st, bt) |
|
131 |
struct ibcs2_termios *st; |
|
132 |
struct termios *bt; |
|
130 |
stios2btios(struct ibcs2_termios *st, struct termios *bt) |
|
133 | 131 |
{ |
134 | 132 |
u_long l, r; |
135 | 133 | |
... | ... | |
222 | 220 |
} |
223 | 221 | |
224 | 222 |
static void |
225 |
btios2stios(bt, st) |
|
226 |
struct termios *bt; |
|
227 |
struct ibcs2_termios *st; |
|
223 |
btios2stios(struct termios *bt, struct ibcs2_termios *st) |
|
228 | 224 |
{ |
229 | 225 |
u_long l, r; |
230 | 226 | |
... | ... | |
312 | 308 |
} |
313 | 309 | |
314 | 310 |
static void |
315 |
stios2stio(ts, t) |
|
316 |
struct ibcs2_termios *ts; |
|
317 |
struct ibcs2_termio *t; |
|
311 |
stios2stio(struct ibcs2_termios *ts, struct ibcs2_termio *t) |
|
318 | 312 |
{ |
319 | 313 |
t->c_iflag = ts->c_iflag; |
320 | 314 |
t->c_oflag = ts->c_oflag; |
... | ... | |
325 | 319 |
} |
326 | 320 | |
327 | 321 |
static void |
328 |
stio2stios(t, ts) |
|
329 |
struct ibcs2_termio *t; |
|
330 |
struct ibcs2_termios *ts; |
|
322 |
stio2stios(struct ibcs2_termio *t, struct ibcs2_termios *ts) |
|
331 | 323 |
{ |
332 | 324 |
ts->c_iflag = t->c_iflag; |
333 | 325 |
ts->c_oflag = t->c_oflag; |
ibcs2/i386/ibcs2_ipc.c 8 Dec 2005 22:29:14 -0000 | ||
---|---|---|
65 | 65 |
*/ |
66 | 66 | |
67 | 67 |
static void |
68 |
cvt_msqid2imsqid(bp, ibp) |
|
69 |
struct msqid_ds *bp; |
|
70 |
struct ibcs2_msqid_ds *ibp; |
|
68 |
cvt_msqid2imsqid(struct msqid_ds *bp, struct ibcs2_msqid_ds *ibp) |
|
71 | 69 |
{ |
72 | 70 |
cvt_perm2iperm(&bp->msg_perm, &ibp->msg_perm); |
73 | 71 |
ibp->msg_first = bp->msg_first; |
... | ... | |
84 | 82 |
} |
85 | 83 | |
86 | 84 |
static void |
87 |
cvt_imsqid2msqid(ibp, bp) |
|
88 |
struct ibcs2_msqid_ds *ibp; |
|
89 |
struct msqid_ds *bp; |
|
85 |
cvt_imsqid2msqid(struct ibcs2_msqid_ds *ibp, struct msqid_ds *bp) |
|
90 | 86 |
{ |
91 | 87 |
cvt_iperm2perm(&ibp->msg_perm, &bp->msg_perm); |
92 | 88 |
bp->msg_first = ibp->msg_first; |
... | ... | |
153 | 149 |
*/ |
154 | 150 |
#ifdef unused |
155 | 151 |
static void |
156 |
cvt_sem2isem(bp, ibp) |
|
157 |
struct sem *bp; |
|
158 |
struct ibcs2_sem *ibp; |
|
152 |
cvt_sem2isem(struct sem *bp, struct ibcs2_sem *ibp) |
|
159 | 153 |
{ |
160 | 154 |
ibp->semval = bp->semval; |
161 | 155 |
ibp->sempid = bp->sempid; |
... | ... | |
165 | 159 |
} |
166 | 160 | |
167 | 161 |
static void |
168 |
cvt_isem2sem(ibp, bp) |
|
169 |
struct ibcs2_sem *ibp; |
|
170 |
struct sem *bp; |
|
162 |
cvt_isem2sem(struct ibcs2_sem *ibp, struct sem *bp) |
|
171 | 163 |
{ |
172 | 164 |
bp->semval = ibp->semval; |
173 | 165 |
bp->sempid = ibp->sempid; |
... | ... | |
178 | 170 |
#endif |
179 | 171 | |
180 | 172 |
static void |
181 |
cvt_iperm2perm(ipp, pp) |
|
182 |
struct ibcs2_ipc_perm *ipp; |
|
183 |
struct ipc_perm *pp; |
|
173 |
cvt_iperm2perm(struct ibcs2_ipc_perm *ipp, struct ipc_perm *pp) |
|
184 | 174 |
{ |
185 | 175 |
pp->uid = ipp->uid; |
186 | 176 |
pp->gid = ipp->gid; |
... | ... | |
192 | 182 |
} |
193 | 183 | |
194 | 184 |
static void |
195 |
cvt_perm2iperm(pp, ipp) |
|
196 |
struct ipc_perm *pp; |
|
197 |
struct ibcs2_ipc_perm *ipp; |
|
185 |
cvt_perm2iperm(struct ipc_perm *pp, struct ibcs2_ipc_perm *ipp) |
|
198 | 186 |
{ |
199 | 187 |
ipp->uid = pp->uid; |
200 | 188 |
ipp->gid = pp->gid; |
... | ... | |
206 | 194 |
} |
207 | 195 | |
208 | 196 |
static void |
209 |
cvt_semid2isemid(bp, ibp) |
|
210 |
struct semid_ds *bp; |
|
211 |
struct ibcs2_semid_ds *ibp; |
|
197 |
cvt_semid2isemid(struct semid_ds *bp, struct ibcs2_semid_ds *ibp) |
|
212 | 198 |
{ |
213 | 199 |
cvt_perm2iperm(&bp->sem_perm, &ibp->sem_perm); |
214 | 200 |
ibp->sem_base = (struct ibcs2_sem *)bp->sem_base; |
... | ... | |
219 | 205 |
} |
220 | 206 | |
221 | 207 |
static void |
222 |
cvt_isemid2semid(ibp, bp) |
|
223 |
struct ibcs2_semid_ds *ibp; |
|
224 |
struct semid_ds *bp; |
|
208 |
cvt_isemid2semid(struct ibcs2_semid_ds *ibp, struct semid_ds *bp) |
|
225 | 209 |
{ |
226 | 210 |
cvt_iperm2perm(&ibp->sem_perm, &bp->sem_perm); |
227 | 211 |
bp->sem_base = (struct sem *)ibp->sem_base; |
... | ... | |
308 | 292 |
*/ |
309 | 293 | |
310 | 294 |
static void |
311 |
cvt_shmid2ishmid(bp, ibp) |
|
312 |
struct shmid_ds *bp; |
|
313 |
struct ibcs2_shmid_ds *ibp; |
|
295 |
cvt_shmid2ishmid(struct shmid_ds *bp, struct ibcs2_shmid_ds *ibp) |
|
314 | 296 |
{ |
315 | 297 |
cvt_perm2iperm(&bp->shm_perm, &ibp->shm_perm); |
316 | 298 |
ibp->shm_segsz = bp->shm_segsz; |
... | ... | |
325 | 307 |
} |
326 | 308 | |
327 | 309 |
static void |
328 |
cvt_ishmid2shmid(ibp, bp) |
|
329 |
struct ibcs2_shmid_ds *ibp; |
|
330 |
struct shmid_ds *bp; |
|
310 |
cvt_ishmid2shmid(struct ibcs2_shmid_ds *ibp, struct shmid_ds *bp) |
|
331 | 311 |
{ |
332 | 312 |
cvt_iperm2perm(&ibp->shm_perm, &bp->shm_perm); |
333 | 313 |
bp->shm_segsz = ibp->shm_segsz; |
ibcs2/i386/ibcs2_signal.c 8 Dec 2005 22:33:14 -0000 | ||
---|---|---|
128 | 128 |
}; |
129 | 129 | |
130 | 130 |
void |
131 |
ibcs2_to_bsd_sigset(iss, bss) |
|
132 |
const ibcs2_sigset_t *iss; |
|
133 |
sigset_t *bss; |
|
131 |
ibcs2_to_bsd_sigset(const ibcs2_sigset_t *iss, sigset_t *bss) |
|
134 | 132 |
{ |
135 | 133 |
int i, newsig; |
136 | 134 | |
... | ... | |
145 | 143 |
} |
146 | 144 | |
147 | 145 |
static void |
148 |
bsd_to_ibcs2_sigset(bss, iss) |
|
149 |
const sigset_t *bss; |
|
150 |
ibcs2_sigset_t *iss; |
|
146 |
bsd_to_ibcs2_sigset(const sigset_t *bss, ibcs2_sigset_t *iss) |
|
151 | 147 |
{ |
152 | 148 |
int i, newsig; |
153 | 149 | |
... | ... | |
162 | 158 |
} |
163 | 159 | |
164 | 160 |
static void |
165 |
ibcs2_to_bsd_sigaction(isa, bsa) |
|
166 |
struct ibcs2_sigaction *isa; |
|
167 |
struct sigaction *bsa; |
|
161 |
ibcs2_to_bsd_sigaction(struct ibcs2_sigaction *isa, |
|
162 |
struct sigaction *bsa) |
|
168 | 163 |
{ |
169 | 164 | |
170 | 165 |
bsa->sa_handler = isa->isa_handler; |
... | ... | |
175 | 170 |
} |
176 | 171 | |
177 | 172 |
static void |
178 |
bsd_to_ibcs2_sigaction(bsa, isa) |
|
179 |
struct sigaction *bsa; |
|
180 |
struct ibcs2_sigaction *isa; |
|
173 |
bsd_to_ibcs2_sigaction(struct sigaction *bsa, |
|
174 |
struct ibcs2_sigaction *isa) |
|
181 | 175 |
{ |
182 | 176 | |
183 | 177 |
isa->isa_handler = bsa->sa_handler; |
ibcs2/i386/ibcs2_stat.c 8 Dec 2005 22:30:14 -0000 | ||
---|---|---|
55 | 55 |
static int cvt_statfs (struct statfs *, caddr_t, int); |
56 | 56 | |
57 | 57 |
static void |
58 |
bsd_stat2ibcs_stat(st, st4) |
|
59 |
struct stat *st; |
|
60 |
struct ibcs2_stat *st4; |
|
58 |
bsd_stat2ibcs_stat(struct stat *st, struct ibcs2_stat *st4) |
|
61 | 59 |
{ |
62 | 60 |
bzero(st4, sizeof(*st4)); |
63 | 61 |
st4->st_dev = (ibcs2_dev_t)st->st_dev; |
... | ... | |
77 | 75 |
} |
78 | 76 | |
79 | 77 |
static int |
80 |
cvt_statfs(sp, buf, len) |
|
81 |
struct statfs *sp; |
|
82 |
caddr_t buf; |
|
83 |
int len; |
|
78 |
cvt_statfs(struct statfs *sp, caddr_t buf, int len) |
|
84 | 79 |
{ |
85 | 80 |
struct ibcs2_statfs ssfs; |
86 | 81 |
ibcs2/i386/ibcs2_util.c 9 Dec 2005 00:07:43 -0000 | ||
---|---|---|
51 | 51 |
* If cflag is set, we check if an attempt can be made to create |
52 | 52 |
* the named file, i.e. we check if the directory it should |
53 | 53 |
* be in exists. |
54 |
* |
|
55 |
* Parameters: |
|
56 |
* sgp: Pointer to stackgap memory |
|
54 | 57 |
*/ |
55 | 58 |
int |
56 |
ibcs2_emul_find(sgp, prefix, path, pbuf, cflag) |
|
57 |
caddr_t *sgp; /* Pointer to stackgap memory */ |
|
58 |
const char *prefix; |
|
59 |
char *path; |
|
60 |
char **pbuf; |
|
61 |
int cflag; |
|
59 |
ibcs2_emul_find(caddr_t *sgp, const char *prefix, char *path, |
|
60 |
char **pbuf, int cflag) |
|
62 | 61 |
{ |
63 | 62 |
struct nlookupdata nd; |
64 | 63 |
struct nlookupdata ndroot; |
ibcs2/i386/ibcs2_util.h 8 Dec 2005 22:26:29 -0000 | ||
---|---|---|
59 | 59 |
static __inline void *stackgap_alloc(caddr_t *, size_t); |
60 | 60 | |
61 | 61 |
static __inline caddr_t |
62 |
stackgap_init() |
|
62 |
stackgap_init(void)
|
|
63 | 63 |
{ |
64 | 64 |
#define szsigcode (*(curproc->p_sysent->sv_szsigcode)) |
65 | 65 |
return (caddr_t)(PS_STRINGS - szsigcode - SPARE_USRSPACE); |
66 | 66 |
} |
67 | 67 | |
68 | 68 |
static __inline void * |
69 |
stackgap_alloc(sgp, sz) |
|
70 |
caddr_t *sgp; |
|
71 |
size_t sz; |
|
69 |
stackgap_alloc(caddr_t *sgp, size_t sz) |
|
72 | 70 |
{ |
73 | 71 |
void *p = (void *) *sgp; |
74 | 72 |
*sgp += ALIGN(sz); |
linux/linux_util.h 8 Dec 2005 22:35:17 -0000 | ||
---|---|---|
70 | 70 |
#define szsigcode(p) (*((p)->p_sysent->sv_szsigcode)) |
71 | 71 | |
72 | 72 |
static __inline caddr_t |
73 |
stackgap_init() |
|
73 |
stackgap_init(void)
|
|
74 | 74 |
{ |
75 | 75 |
return (caddr_t)(PS_STRINGS - szsigcode(curproc) - SPARE_USRSPACE); |
76 | 76 |
} |
77 | 77 | |
78 | 78 |
static __inline void * |
79 |
stackgap_alloc(sgp, sz) |
|
80 |
caddr_t *sgp; |
|
81 |
size_t sz; |
|
79 |
stackgap_alloc(caddr_t *sgp, size_t sz) |
|
82 | 80 |
{ |
83 | 81 |
void *p = (void *) *sgp; |
84 | 82 |
linux/i386/imgact_linux.c 8 Dec 2005 22:36:55 -0000 | ||
---|---|---|
56 | 56 |
static int exec_linux_imgact (struct image_params *iparams); |
57 | 57 | |
58 | 58 |
static int |
59 |
exec_linux_imgact(imgp) |
|
60 |
struct image_params *imgp; |
|
59 |
exec_linux_imgact(struct image_params *imgp) |
|
61 | 60 |
{ |
62 | 61 |
const struct exec *a_out = (const struct exec *) imgp->image_header; |
63 | 62 |
struct vmspace *vmspace; |
linux/i386/linux_sysvec.c 8 Dec 2005 22:36:16 -0000 | ||
---|---|---|
733 | 733 |
static int exec_linux_imgact_try (struct image_params *iparams); |
734 | 734 | |
735 | 735 |
static int |
736 |
exec_linux_imgact_try(imgp) |
|
737 |
struct image_params *imgp; |
|
736 |
exec_linux_imgact_try(struct image_params *imgp) |
|
738 | 737 |
{ |
739 | 738 |
const char *head = (const char *)imgp->image_header; |
740 | 739 |
int error = -1; |
linux/i386/linprocfs/linprocfs_misc.c 8 Dec 2005 22:40:57 -0000 | ||
---|---|---|
80 | 80 |
#define P2K(x) ((x) << (PAGE_SHIFT - 10)) /* pages to kbytes */ |
81 | 81 | |
82 | 82 |
int |
83 |
linprocfs_domeminfo(curp, p, pfs, uio) |
|
84 |
struct proc *curp; |
|
85 |
struct proc *p; |
|
86 |
struct pfsnode *pfs; |
|
87 |
struct uio *uio; |
|
83 |
linprocfs_domeminfo(struct proc *curp, struct proc *p, struct pfsnode *pfs, |
|
84 |
struct uio *uio) |
|
88 | 85 |
{ |
89 | 86 |
char *ps; |
90 | 87 |
char psbuf[512]; /* XXX - conservative */ |
... | ... | |
161 | 158 |
} |
162 | 159 | |
163 | 160 |
int |
164 |
linprocfs_docpuinfo(curp, p, pfs, uio) |
|
165 |
struct proc *curp; |
|
166 |
struct proc *p; |
|
167 |
struct pfsnode *pfs; |
|
168 |
struct uio *uio; |
|
161 |
linprocfs_docpuinfo(struct proc *curp, struct proc *p, struct pfsnode *pfs, |
|
162 |
struct uio *uio) |
|
169 | 163 |
{ |
170 | 164 |
char *ps; |
171 | 165 |
char psbuf[512]; /* XXX - conservative */ |
... | ... | |
262 | 256 |
} |
263 | 257 | |
264 | 258 |
int |
265 |
linprocfs_dostat(curp, p, pfs, uio) |
|
266 |
struct proc *curp; |
|
267 |
struct proc *p; |
|
268 |
struct pfsnode *pfs; |
|
269 |
struct uio *uio; |
|
259 |
linprocfs_dostat(struct proc *curp, struct proc *p, struct pfsnode *pfs, |
|
260 |
struct uio *uio) |
|
270 | 261 |
{ |
271 | 262 |
char *ps; |
272 | 263 |
char psbuf[512]; |
... | ... | |
295 | 286 |
} |
296 | 287 | |
297 | 288 |
int |
298 |
linprocfs_douptime(curp, p, pfs, uio) |
|
299 |
struct proc *curp; |
|
300 |
struct proc *p; |
|
301 |
struct pfsnode *pfs; |
|
302 |
struct uio *uio; |
|
289 |
linprocfs_douptime(struct proc *curp, struct proc *p, struct pfsnode *pfs, |
|
290 |
struct uio *uio) |
|
303 | 291 |
{ |
304 | 292 |
char *ps; |
305 | 293 |
char psbuf[64]; |
... | ... | |
314 | 302 |
} |
315 | 303 | |
316 | 304 |
int |
317 |
linprocfs_doversion(curp, p, pfs, uio) |
|
318 |
struct proc *curp; |
|
319 |
struct proc *p; |
|
320 |
struct pfsnode *pfs; |
|
321 |
struct uio *uio; |
|
305 |
linprocfs_doversion(struct proc *curp, struct proc *p, struct pfsnode *pfs, |
|
306 |
struct uio *uio) |
|
322 | 307 |
{ |
323 | 308 |
char *ps; |
324 | 309 |
int xlen; |
... | ... | |
331 | 316 |
} |
332 | 317 | |
333 | 318 |
int |
334 |
linprocfs_doprocstat(curp, p, pfs, uio) |
|
335 |
struct proc *curp; |
|
336 |
struct proc *p; |
|
337 |
struct pfsnode *pfs; |
|
338 |
struct uio *uio; |
|
319 |
linprocfs_doprocstat(struct proc *curp, struct proc *p, struct pfsnode *pfs, |
|
320 |
struct uio *uio) |
|
339 | 321 |
{ |
340 | 322 |
char *ps, psbuf[1024]; |
341 | 323 | |
... | ... | |
398 | 380 |
}; |
399 | 381 | |
400 | 382 |
int |
401 |
linprocfs_doprocstatus(curp, p, pfs, uio) |
|
402 |
struct proc *curp; |
|
403 |
struct proc *p; |
|
404 |
struct pfsnode *pfs; |
|
405 |
struct uio *uio; |
|
383 |
linprocfs_doprocstatus(struct proc *curp, struct proc *p, struct pfsnode *pfs, |
|
384 |
struct uio *uio) |
|
406 | 385 |
{ |
407 | 386 |
char *ps, psbuf[1024]; |
408 | 387 |
char *state; |
linux/i386/linprocfs/linprocfs_subr.c 8 Dec 2005 22:42:37 -0000 | ||
---|---|---|
85 | 85 |
* the vnode free list. |
86 | 86 |
*/ |
87 | 87 |
int |
88 |
linprocfs_allocvp(mp, vpp, pid, pfs_type) |
|
89 |
struct mount *mp; |
|
90 |
struct vnode **vpp; |
|
91 |
long pid; |
|
92 |
pfstype pfs_type; |
|
88 |
linprocfs_allocvp(struct mount *mp, struct vnode **vpp, long pid, |
|
89 |
pfstype pfs_type) |
|
93 | 90 |
{ |
94 | 91 |
struct thread *td = curthread; /* XXX */ |
95 | 92 |
struct pfsnode *pfs; |
... | ... | |
220 | 217 |
} |
221 | 218 | |
222 | 219 |
int |
223 |
linprocfs_freevp(vp) |
|
224 |
struct vnode *vp; |
|
220 |
linprocfs_freevp(struct vnode *vp) |
|
225 | 221 |
{ |
226 | 222 |
struct pfsnode **pfspp; |
227 | 223 |
struct pfsnode *pfs = VTOPFS(vp); |
... | ... | |
238 | 234 |
} |
239 | 235 | |
240 | 236 |
int |
241 |
linprocfs_rw(ap) |
|
242 |
struct vop_read_args *ap; |
|
237 |
linprocfs_rw(struct vop_read_args *ap) |
|
243 | 238 |
{ |
244 | 239 |
struct vnode *vp = ap->a_vp; |
245 | 240 |
struct uio *uio = ap->a_uio; |
... | ... | |
314 | 309 |
* EFAULT: user i/o buffer is not addressable |
315 | 310 |
*/ |
316 | 311 |
int |
317 |
vfs_getuserstr(uio, buf, buflenp) |
|
318 |
struct uio *uio; |
|
319 |
char *buf; |
|
320 |
int *buflenp; |
|
312 |
vfs_getuserstr(struct uio *uio, char *buf, int *buflenp) |
|
321 | 313 |
{ |
322 | 314 |
int xlen; |
323 | 315 |
int error; |
... | ... | |
349 | 341 |
} |
350 | 342 | |
351 | 343 |
vfs_namemap_t * |
352 |
vfs_findname(nm, buf, buflen) |
|
353 |
vfs_namemap_t *nm; |
|
354 |
char *buf; |
|
355 |
int buflen; |
|
344 |
vfs_findname(vfs_namemap_t *nm, char *buf, int buflen) |
|
356 | 345 |
{ |
357 | 346 | |
358 | 347 |
for (; nm->nm_name; nm++) |
linux/i386/linprocfs/linprocfs_vfsops.c 8 Dec 2005 22:44:19 -0000 | ||
---|---|---|
71 | 71 |
*/ |
72 | 72 |
/* ARGSUSED */ |
73 | 73 |
static int |
74 |
linprocfs_mount(mp, path, data, td) |
|
75 |
struct mount *mp; |
|
76 |
char *path; |
|
77 |
caddr_t data; |
|
78 |
struct thread *td; |
|
74 |
linprocfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) |
|
79 | 75 |
{ |
80 | 76 |
size_t size; |
81 | 77 |
int error; |
... | ... | |
107 | 103 |
* unmount system call |
108 | 104 |
*/ |
109 | 105 |
static int |
110 |
linprocfs_unmount(mp, mntflags, td) |
|
111 |
struct mount *mp; |
|
112 |
int mntflags; |
|
113 |
struct thread *td; |
|
106 |
linprocfs_unmount(struct mount *mp, int mntflags, struct thread *td) |
|
114 | 107 |
{ |
115 | 108 |
int error; |
116 | 109 |
int flags = 0; |
... | ... | |
129 | 122 |
} |
130 | 123 | |
131 | 124 |
int |
132 |
linprocfs_root(mp, vpp) |
|
133 |
struct mount *mp; |
|
134 |
struct vnode **vpp; |
|
125 |
linprocfs_root(struct mount *mp, struct vnode **vpp) |
|
135 | 126 |
{ |
136 | 127 | |
137 | 128 |
return (linprocfs_allocvp(mp, vpp, 0, Proot)); |
... | ... | |
141 | 132 |
* Get file system statistics. |
142 | 133 |
*/ |
143 | 134 |
static int |
144 |
linprocfs_statfs(mp, sbp, td) |
|
145 |
struct mount *mp; |
|
146 |
struct statfs *sbp; |
|
147 |
struct thread *td; |
|
135 |
linprocfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) |
|
148 | 136 |
{ |
149 | 137 |
sbp->f_bsize = PAGE_SIZE; |
150 | 138 |
sbp->f_iosize = PAGE_SIZE; |
linux/i386/linprocfs/linprocfs_vnops.c 8 Dec 2005 22:47:52 -0000 | ||
---|---|---|
124 | 124 |
* memory images. |
125 | 125 |
*/ |
126 | 126 |
static int |
127 |
linprocfs_open(ap) |
|
128 |
struct vop_open_args /* { |
|
129 |
struct vnode *a_vp; |
|
130 |
int a_mode; |
|
131 |
struct ucred *a_cred; |
|
132 |
struct thread *a_td; |
|
133 |
} */ *ap; |
|
127 |
linprocfs_open(struct vop_open_args *ap) |
|
134 | 128 |
{ |
135 | 129 |
struct pfsnode *pfs = VTOPFS(ap->a_vp); |
136 | 130 |
struct proc *p2; |
... | ... | |
170 | 164 |
* any exclusive open flag (see _open above). |
171 | 165 |
*/ |
172 | 166 |
static int |
173 |
linprocfs_close(ap) |
|
174 |
struct vop_close_args /* { |
|
175 |
struct vnode *a_vp; |
|
176 |
int a_fflag; |
|
177 |
struct ucred *a_cred; |
|
178 |
struct thread *a_td; |
|
179 |
} */ *ap; |
|
167 |
linprocfs_close(struct vop_close_args *ap) |
|
180 | 168 |
{ |
181 | 169 |
struct pfsnode *pfs = VTOPFS(ap->a_vp); |
182 | 170 |
struct proc *p; |
... | ... | |
214 | 202 |
* (vp) is not locked on entry or exit. |
215 | 203 |
*/ |
216 | 204 |
static int |
217 |
linprocfs_ioctl(ap) |
|
218 |
struct vop_ioctl_args *ap; |
|
205 |
linprocfs_ioctl(struct vop_ioctl_args *ap) |
|
219 | 206 |
{ |
220 | 207 |
struct pfsnode *pfs = VTOPFS(ap->a_vp); |
221 | 208 |
struct proc *procp; |
... | ... | |
307 | 294 |
* (EIO) would be a reasonable alternative. |
308 | 295 |
*/ |
309 | 296 |
static int |
310 |
linprocfs_bmap(ap) |
|
311 |
struct vop_bmap_args /* { |
|
312 |
struct vnode *a_vp; |
|
313 |
daddr_t a_bn; |
|
314 |
struct vnode **a_vpp; |
|
315 |
daddr_t *a_bnp; |
|
316 |
int *a_runp; |
|
317 |
} */ *ap; |
|
297 |
linprocfs_bmap(struct vop_bmap_args *ap) |
|
318 | 298 |
{ |
319 | 299 | |
320 | 300 |
if (ap->a_vpp != NULL) |
... | ... | |
337 | 317 |
* on exit. |
338 | 318 |
*/ |
339 | 319 |
static int |
340 |
linprocfs_inactive(ap) |
|
341 |
struct vop_inactive_args /* { |
|
342 |
struct vnode *a_vp; |
|
343 |
} */ *ap; |
|
320 |
linprocfs_inactive(struct vop_inactive_args *ap) |
|
344 | 321 |
{ |
345 | 322 |
/*struct vnode *vp = ap->a_vp;*/ |
346 | 323 | |
... | ... | |
355 | 332 |
* from any private lists. |
356 | 333 |
*/ |
357 | 334 |
static int |
358 |
linprocfs_reclaim(ap) |
|
359 |
struct vop_reclaim_args /* { |
|
360 |
struct vnode *a_vp; |
|
361 |
} */ *ap; |
|
335 |
linprocfs_reclaim(struct vop_reclaim_args *ap) |
|
362 | 336 |
{ |
363 | 337 |
return (linprocfs_freevp(ap->a_vp)); |
364 | 338 |
} |
... | ... | |
369 | 343 |
* of (vp). |
370 | 344 |
*/ |
371 | 345 |
static int |
372 |
linprocfs_print(ap) |
|
373 |
struct vop_print_args /* { |
|
374 |
struct vnode *a_vp; |
|
375 |
} */ *ap; |
|
346 |
linprocfs_print(struct vop_print_args *ap) |
|
376 | 347 |
{ |
377 | 348 |
struct pfsnode *pfs = VTOPFS(ap->a_vp); |
378 | 349 | |
... | ... | |
385 | 356 |
* generic entry point for unsupported operations |
386 | 357 |
*/ |
387 | 358 |
static int |
388 |
linprocfs_badop() |
|
359 |
linprocfs_badop(void)
|
|
389 | 360 |
{ |
390 | 361 | |
391 | 362 |
return (EIO); |
... | ... | |
401 | 372 |
* this is relatively minimal for procfs. |
402 | 373 |
*/ |
403 | 374 |
static int |
404 |
linprocfs_getattr(ap) |
|
405 |
struct vop_getattr_args /* { |
|
406 |
struct vnode *a_vp; |
|
407 |
struct vattr *a_vap; |
|
408 |
struct ucred *a_cred; |
|
409 |
struct thread *a_td; |
|
410 |
} */ *ap; |
|
375 |
linprocfs_getattr(struct vop_getattr_args *ap) |
|
411 | 376 |
{ |
412 | 377 |
struct pfsnode *pfs = VTOPFS(ap->a_vp); |
413 | 378 |
struct vattr *vap = ap->a_vap; |
... | ... | |
547 | 512 |
} |
548 | 513 | |
549 | 514 |
static int |
550 |
linprocfs_setattr(ap) |
|
551 |
struct vop_setattr_args /* { |
|
552 |
struct vnode *a_vp; |
|
553 |
struct vattr *a_vap; |
|
554 |
struct ucred *a_cred; |
|
555 |
struct thread *a_td; |
|
556 |
} */ *ap; |
|
515 |
linprocfs_setattr(struct vop_setattr_args *ap) |
|
557 | 516 |
{ |
558 | 517 | |
559 | 518 |
if (ap->a_vap->va_flags != VNOVAL) |
... | ... | |
585 | 544 |
* that the operation really does make sense. |
586 | 545 |
*/ |
587 | 546 |
static int |
588 |
linprocfs_access(ap) |
|
589 |
struct vop_access_args /* { |
|
590 |
struct vnode *a_vp; |
|
591 |
int a_mode; |
|
592 |
struct ucred *a_cred; |
|
593 |
struct thread *a_td; |
|
594 |
} */ *ap; |
|
547 |
linprocfs_access(struct vop_access_args *ap) |
|
595 | 548 |
{ |
596 | 549 |
struct vattr *vap; |
597 | 550 |
struct vattr vattr; |
... | ... | |
639 | 592 |
* for most pseudo-filesystems very little needs to be done. |
640 | 593 |
*/ |
641 | 594 |
static int |
642 |
linprocfs_lookup(ap) |
|
643 |
struct vop_old_lookup_args /* { |
|
644 |
struct vnode * a_dvp; |
|
645 |
struct vnode ** a_vpp; |
|
646 |
struct componentname * a_cnp; |
|
647 |
} */ *ap; |
|
595 |
linprocfs_lookup(struct vop_old_lookup_args *ap) |
|
648 | 596 |
{ |
649 | 597 |
struct componentname *cnp = ap->a_cnp; |
650 | 598 |
struct vnode **vpp = ap->a_vpp; |
... | ... | |
785 | 733 |
* Does this process have a text file? |
786 | 734 |
*/ |
787 | 735 |
int |
788 |
linprocfs_validfile(p) |
|
789 |
struct proc *p; |
|
736 |
linprocfs_validfile(struct proc *p) |
|
790 | 737 |
{ |
791 | 738 | |
792 | 739 |
return (procfs_findtextvp(p) != NULLVP); |
... | ... | |
1005 | 952 |
* readlink reads the link of `self' or `exe' |
1006 | 953 |
*/ |
1007 | 954 |
static int |
1008 |
linprocfs_readlink(ap) |
|
1009 |
struct vop_readlink_args *ap; |
|
955 |
linprocfs_readlink(struct vop_readlink_args *ap) |
|
1010 | 956 |
{ |
1011 | 957 |
char buf[16]; /* should be enough */ |
1012 | 958 |
struct proc *procp; |
... | ... | |
1051 | 997 |
* convert decimal ascii to pid_t |
1052 | 998 |
*/ |
1053 | 999 |
static pid_t |
1054 |
atopid(b, len) |
|
1055 |
const char *b; |
|
1056 |
u_int len; |
|
1000 |
atopid(const char *b, u_int len) |
|
1057 | 1001 |
{ |
1058 | 1002 |
pid_t p = 0; |
1059 | 1003 | |
... | ... | |
1101 | 1045 |
{ &vop_ioctl_desc, (void *) linprocfs_ioctl }, |
1102 | 1046 |
{ NULL, NULL } |
1103 | 1047 |
}; |
1104 |
ndis/kern_ndis.c 9 Dec 2005 07:16:00 -0000 | ||
---|---|---|
195 | 195 |
*/ |
196 | 196 | |
197 | 197 |
static void |
198 |
ndis_runq(arg) |
|
199 |
void *arg; |
|
198 |
ndis_runq(void *arg) |
|
200 | 199 |
{ |
201 | 200 |
struct ndis_req *r = NULL, *die = NULL; |
202 | 201 |
struct ndisproc *p; |
... | ... | |
245 | 244 |
} |
246 | 245 | |
247 | 246 |
static int |
248 |
ndis_create_kthreads() |
|
247 |
ndis_create_kthreads(void)
|
|
249 | 248 |
{ |
250 | 249 |
struct ndis_req *r; |
251 | 250 |
int i, error = 0; |
... | ... | |
289 | 288 |
} |
290 | 289 | |
291 | 290 |
static void |
292 |
ndis_destroy_kthreads() |
|
291 |
ndis_destroy_kthreads(void)
|
|
293 | 292 |
{ |
294 | 293 |
struct ndis_req *r; |
295 | 294 | |
... | ... | |
311 | 310 |
} |
312 | 311 | |
313 | 312 |
static void |
314 |
ndis_stop_thread(t) |
|
315 |
int t; |
|
313 |
ndis_stop_thread(int t) |
|
316 | 314 |
{ |
317 | 315 |
struct ndis_req *r; |
318 | 316 |
struct ndisqhead *q; |
... | ... | |
357 | 355 |
} |
358 | 356 | |
359 | 357 |
static int |
360 |
ndis_enlarge_thrqueue(cnt) |
|
361 |
int cnt; |
|
358 |
ndis_enlarge_thrqueue(int cnt) |
|
362 | 359 |
{ |
363 | 360 |
struct ndis_req *r; |
364 | 361 |
int i; |
... | ... | |
376 | 373 |
} |
377 | 374 | |
378 | 375 |
static int |
379 |
ndis_shrink_thrqueue(cnt) |
|
380 |
int cnt; |
|
376 |
ndis_shrink_thrqueue(int cnt) |
|
381 | 377 |
{ |
382 | 378 |
struct ndis_req *r; |
383 | 379 |
int i; |
... | ... | |
400 | 396 |
} |
401 | 397 | |
402 | 398 |
int |
403 |
ndis_unsched(func, arg, t) |
|
404 |
void (*func)(void *); |
|
405 |
void *arg; |
|
406 |
int t; |
|
399 |
ndis_unsched(void (*func)(void *), void *arg, int t) |
|
407 | 400 |
{ |
408 | 401 |
struct ndis_req *r; |
409 | 402 |
struct ndisqhead *q; |
... | ... | |
434 | 427 |
} |
435 | 428 | |
436 | 429 |
int |
437 |
ndis_sched(func, arg, t) |
|
438 |
void (*func)(void *); |
|
439 |
void *arg; |
|
440 |
int t; |
|
430 |
ndis_sched(void (*func)(void *), void *arg, int t) |
|
441 | 431 |
{ |
442 | 432 |
struct ndis_req *r; |
443 | 433 |
struct ndisqhead *q; |
... | ... | |
494 | 484 |
} |
495 | 485 | |
496 | 486 |
int |
497 |
ndis_thsuspend(td, timo) |
|
498 |
thread_t td; |
|
499 |
int timo; |
|
487 |
ndis_thsuspend(thread_t td, int timo) |
|
500 | 488 |
{ |
501 | 489 |
int error; |
502 | 490 | |
... | ... | |
505 | 493 |
} |
506 | 494 | |
507 | 495 |
void |
508 |
ndis_thresume(td) |
|
509 |
struct thread *td; |
|
496 |
ndis_thresume(struct thread *td) |
|
510 | 497 |
{ |
511 | 498 |
wakeup(td); |
512 | 499 |
} |
513 | 500 | |
514 | 501 |
__stdcall static void |
515 |
ndis_sendrsrcavail_func(adapter) |
|
516 |
ndis_handle adapter; |
|
502 |
ndis_sendrsrcavail_func(ndis_handle adapter) |
|
517 | 503 |
{ |
518 | 504 |
return; |
519 | 505 |
} |
520 | 506 | |
521 | 507 |
__stdcall static void |
522 |
ndis_status_func(adapter, status, sbuf, slen) |
|
523 |
ndis_handle adapter; |
|
524 |
ndis_status status; |
|
525 |
void *sbuf; |
|
526 |
uint32_t slen; |
|
508 |
ndis_status_func(ndis_handle adapter, ndis_status status, void *sbuf, |
|
509 |
uint32_t slen) |
|
527 | 510 |
{ |
528 | 511 |
ndis_miniport_block *block; |
529 | 512 |
block = adapter; |
... | ... | |
534 | 517 |
} |
535 | 518 | |
536 | 519 |
__stdcall static void |
537 |
ndis_statusdone_func(adapter) |
|
538 |
ndis_handle adapter; |
|
520 |
ndis_statusdone_func(ndis_handle adapter) |
|
539 | 521 |
{ |
540 | 522 |
ndis_miniport_block *block; |
541 | 523 |
block = adapter; |
... | ... | |
546 | 528 |
} |
547 | 529 | |
548 | 530 |
__stdcall static void |
549 |
ndis_setdone_func(adapter, status) |
|
550 |
ndis_handle adapter; |
|
551 |
ndis_status status; |
|
531 |
ndis_setdone_func(ndis_handle adapter, ndis_status status) |
|
552 | 532 |
{ |
553 | 533 |
ndis_miniport_block *block; |
554 | 534 |
block = adapter; |
... | ... | |
559 | 539 |
} |
560 | 540 | |
561 | 541 |
__stdcall static void |
562 |
ndis_getdone_func(adapter, status) |
|
563 |
ndis_handle adapter; |
|
564 |
ndis_status status; |
|
542 |
ndis_getdone_func(ndis_handle adapter, ndis_status status) |
|
565 | 543 |
{ |
566 | 544 |
ndis_miniport_block *block; |
567 | 545 |
block = adapter; |
... | ... | |
572 | 550 |
} |
573 | 551 | |
574 | 552 |
__stdcall static void |
575 |
ndis_resetdone_func(adapter, status, addressingreset) |
|
576 |
ndis_handle adapter; |
|
577 |
ndis_status status; |
|
578 |
uint8_t addressingreset; |
|
553 |
ndis_resetdone_func(ndis_handle adapter, ndis_status status, |
|
554 |
uint8_t addressingreset) |
|
579 | 555 |
{ |
580 | 556 |
ndis_miniport_block *block; |
581 | 557 |
block = adapter; |
... | ... | |
587 | 563 |
} |
588 | 564 | |
589 | 565 |
int |
590 |
ndis_create_sysctls(arg) |
|
591 |
void *arg; |
|
566 |
ndis_create_sysctls(void *arg) |
|
592 | 567 |
{ |
593 | 568 |
struct ndis_softc *sc; |
594 | 569 |
ndis_cfg *vals; |
... | ... | |
672 | 647 |
} |
673 | 648 | |
674 | 649 |
int |
675 |
ndis_add_sysctl(arg, key, desc, val, flag) |
|
676 |
void *arg; |
|
677 |
char *key; |
|
678 |
char *desc; |
|
679 |
char *val; |
|
680 |
int flag; |
|
650 |
ndis_add_sysctl(void *arg, char *key, char *desc, char *val, int flag) |
|
681 | 651 |
{ |
682 | 652 |
struct ndis_softc *sc; |
683 | 653 |
struct ndis_cfglist *cfg; |
... | ... | |
713 | 683 |
} |
714 | 684 | |
715 | 685 |
int |
716 |
ndis_flush_sysctls(arg) |
|
717 |
void *arg; |
|
686 |
ndis_flush_sysctls(void *arg) |
|
718 | 687 |
{ |
719 | 688 |
struct ndis_softc *sc; |
720 | 689 |
struct ndis_cfglist *cfg; |
... | ... | |
733 | 702 |
} |
734 | 703 | |
735 | 704 |
static void |
736 |
ndis_return(arg) |
|
737 |
void *arg; |
|
705 |
ndis_return(void *arg) |
|
738 | 706 |
{ |
739 | 707 |
struct ndis_softc *sc; |
740 | 708 |
ndis_return_handler returnfunc; |
... | ... | |
792 | 760 |
} |
793 | 761 | |
794 | 762 |
void |
795 |
ndis_free_bufs(b0) |
|
796 |
ndis_buffer *b0; |
|
763 |
ndis_free_bufs(ndis_buffer *b0) |
|
797 | 764 |
{ |
798 | 765 |
ndis_buffer *next; |
799 | 766 | |
... | ... | |
810 | 777 |
} |
811 | 778 | |
812 | 779 |
void |
813 |
ndis_free_packet(p) |
|
814 |
ndis_packet *p; |
|
780 |
ndis_free_packet(ndis_packet *p) |
|
815 | 781 |
{ |
816 | 782 |
if (p == NULL) |
817 | 783 |
return; |
... | ... | |
823 | 789 |
} |
824 | 790 | |
825 | 791 |
int |
826 |
ndis_convert_res(arg) |
|
827 |
void *arg; |
|
792 |
ndis_convert_res(void *arg) |
|
828 | 793 |
{ |
829 | 794 |
struct ndis_softc *sc; |
830 | 795 |
ndis_resource_list *rl = NULL; |
... | ... | |
947 | 912 |
*/ |
948 | 913 | |
949 | 914 |
int |
950 |
ndis_ptom(m0, p) |
|
951 |
struct mbuf **m0; |
|
952 |
ndis_packet *p; |
|
915 |
ndis_ptom(struct mbuf **m0, ndis_packet *p) |
|
953 | 916 |
{ |
954 | 917 |
struct mbuf *m, *prev = NULL; |
955 | 918 |
ndis_buffer *buf; |
... | ... | |
1015 | 978 |
*/ |
1016 | 979 | |
1017 | 980 |
int |
1018 |
ndis_mtop(m0, p) |
|
1019 |
struct mbuf *m0; |
|
1020 |
ndis_packet **p; |
|
981 |
ndis_mtop(struct mbuf *m0, ndis_packet **p) |
|
1021 | 982 |
{ |
1022 | 983 |
struct mbuf *m; |
1023 | 984 |
ndis_buffer *buf = NULL, *prev = NULL; |
... | ... | |
1063 | 1024 |
} |
1064 | 1025 | |
1065 | 1026 |
int |
1066 |
ndis_get_supported_oids(arg, oids, oidcnt) |
|
1067 |
void *arg; |
|
1068 |
ndis_oid **oids; |
|
1069 |
int *oidcnt; |
|
1027 |
ndis_get_supported_oids(void *arg, ndis_oid **oids, int *oidcnt) |
|
1070 | 1028 |
{ |
1071 | 1029 |
int len, rval; |
1072 | 1030 |
ndis_oid *o; |
... | ... | |
1092 | 1050 |
} |
1093 | 1051 | |
1094 | 1052 |
int |
1095 |
ndis_set_info(arg, oid, buf, buflen) |
|
1096 |
void *arg; |
|
1097 |
ndis_oid oid; |
|
1098 |
void *buf; |
|
1099 |
int *buflen; |
|
1053 |
ndis_set_info(void *arg, ndis_oid oid, void *buf, int *buflen) |
|
1100 | 1054 |
{ |
1101 | 1055 |
struct ndis_softc *sc; |
1102 | 1056 |
ndis_status rval; |
... | ... | |
1151 | 1105 |
typedef __stdcall void (*ndis_senddone_func)(ndis_handle, ndis_packet *, ndis_status); |
1152 | 1106 | |
1153 | 1107 |
int |
1154 |
ndis_send_packets(arg, packets, cnt) |
|
1155 |
void *arg; |
|
1156 |
ndis_packet **packets; |
|
1157 |
int cnt; |
|
1108 |
ndis_send_packets(void *arg, ndis_packet **packets, int cnt) |
|
1158 | 1109 |
{ |
1159 | 1110 |
struct ndis_softc *sc; |
1160 | 1111 |
ndis_handle adapter; |
... | ... | |
1191 | 1142 |
} |
1192 | 1143 | |
1193 | 1144 |
int |
1194 |
ndis_send_packet(arg, packet) |
|
1195 |
void *arg; |
|
1196 |
ndis_packet *packet; |
|
1145 |
ndis_send_packet(void *arg, ndis_packet *packet) |
|
1197 | 1146 |
{ |
1198 | 1147 |
struct ndis_softc *sc; |
1199 | 1148 |
ndis_handle adapter; |
... | ... | |
1222 | 1171 |
} |
1223 | 1172 | |
1224 | 1173 |
int |
1225 |
ndis_init_dma(arg) |
|
1226 |
void *arg; |
|
1174 |
ndis_init_dma(void *arg) |
|
1227 | 1175 |
{ |
1228 | 1176 |
struct ndis_softc *sc; |
1229 | 1177 |
int i, error; |
... | ... | |
1246 | 1194 |
} |
1247 | 1195 | |
1248 | 1196 |
int |
1249 |
ndis_destroy_dma(arg) |
|
1250 |
void *arg; |
|
1197 |
ndis_destroy_dma(void *arg) |
|
1251 | 1198 |
{ |
1252 | 1199 |
struct ndis_softc *sc; |
1253 | 1200 |
struct mbuf *m; |
... | ... | |
1274 | 1221 |
} |
1275 | 1222 | |
1276 | 1223 |
int |
1277 |
ndis_reset_nic(arg) |
|
1278 |
void *arg; |
|
1224 |
ndis_reset_nic(void *arg) |
|
1279 | 1225 |
{ |
1280 | 1226 |
struct ndis_softc *sc; |
1281 | 1227 |
ndis_handle adapter; |
... | ... | |
1307 | 1253 |
} |
1308 | 1254 | |
1309 | 1255 |
int |
1310 |
ndis_halt_nic(arg) |
|
1311 |
void *arg; |
|
1256 |
ndis_halt_nic(void *arg) |
|
1312 | 1257 |
{ |
1313 | 1258 |
struct ndis_softc *sc; |
1314 | 1259 |
ndis_handle adapter; |
... | ... | |
1345 | 1290 |
} |
1346 | 1291 | |
1347 | 1292 |
int |
1348 |
ndis_shutdown_nic(arg) |
|
1349 |
void *arg; |
|
1293 |
ndis_shutdown_nic(void *arg) |
|
1350 | 1294 |
{ |
1351 | 1295 |
struct ndis_softc *sc; |
1352 | 1296 |
ndis_handle adapter; |
... | ... | |
1373 | 1317 |
} |
1374 | 1318 | |
1375 | 1319 |
int |
1376 |
ndis_init_nic(arg) |
|
1377 |
void *arg; |
|
1320 |
ndis_init_nic(void *arg) |
|
1378 | 1321 |
{ |
1379 | 1322 |
struct ndis_softc *sc; |
1380 | 1323 |
ndis_miniport_block *block; |
... | ... | |
1417 | 1360 |
} |
1418 | 1361 | |
1419 | 1362 |
void |
1420 |
ndis_enable_intr(arg) |
|
1421 |
void *arg; |
|
1363 |
ndis_enable_intr(void *arg) |
|
1422 | 1364 |
{ |
1423 | 1365 |
struct ndis_softc *sc; |
1424 | 1366 |
ndis_handle adapter; |
... | ... | |
1435 | 1377 |
} |
1436 | 1378 | |
1437 | 1379 |
void |
1438 |
ndis_disable_intr(arg) |
|
1439 |
void *arg; |
|
1380 |
ndis_disable_intr(void *arg) |
|
1440 | 1381 |
{ |
1441 | 1382 |
struct ndis_softc *sc; |
1442 | 1383 |
ndis_handle adapter; |
... | ... | |
1456 | 1397 |
} |
1457 | 1398 | |
1458 | 1399 |
int |
1459 |
ndis_isr(arg, ourintr, callhandler) |
|
1460 |
void *arg; |
|
1461 |
int *ourintr; |
|
1462 |
int *callhandler; |
|
1400 |
ndis_isr(void *arg, int *ourintr, int *callhandler) |
|
1463 | 1401 |
{ |
1464 | 1402 |
struct ndis_softc *sc; |
1465 | 1403 |
ndis_handle adapter; |
... | ... | |
1483 | 1421 |
} |
1484 | 1422 | |
1485 | 1423 |
int |
1486 |
ndis_intrhand(arg) |
|
1487 |
void *arg; |
|
1424 |
ndis_intrhand(void *arg) |
|
1488 | 1425 |
{ |
1489 | 1426 |
struct ndis_softc *sc; |
1490 | 1427 |
ndis_handle adapter; |
... | ... | |
1508 | 1445 |
} |
1509 | 1446 | |
1510 | 1447 |
int |
1511 |
ndis_get_info(arg, oid, buf, buflen) |
|
1512 |
void *arg; |
|
1513 |
ndis_oid oid; |
|
1514 |
void *buf; |
|
1515 |
int *buflen; |
|
1448 |
ndis_get_info(void *arg, ndis_oid oid, void *buf, int *buflen) |
|
1516 | 1449 |
{ |
1517 | 1450 |
struct ndis_softc *sc; |
1518 | 1451 |
ndis_status rval; |
... | ... | |
1568 | 1501 |
} |
1569 | 1502 | |
1570 | 1503 |
int |
1571 |
ndis_unload_driver(arg) |
|
1572 |
void *arg; |
|
1504 |
ndis_unload_driver(void *arg) |
|
1573 | 1505 |
{ |
1574 | 1506 |
struct ndis_softc *sc; |
1575 | 1507 | |
... | ... | |
1588 | 1520 |
#define NDIS_LOADED htonl(0x42534F44) |
1589 | 1521 | |
1590 | 1522 |
int |
1591 |
ndis_load_driver(img, arg) |
|
1592 |
vm_offset_t img; |
|
1593 |
void *arg; |
|
1523 |
ndis_load_driver(vm_offset_t img, void *arg) |
|
1594 | 1524 |
{ |
1595 | 1525 |
driver_entry entry; |
1596 | 1526 |
image_optional_header opt_hdr; |
ndis/subr_hal.c 9 Dec 2005 06:42:56 -0000 | ||
---|---|---|
86 | 86 |
extern struct mtx_pool *ndis_mtxpool; |
87 | 87 | |
88 | 88 |
__stdcall static void |
89 |
hal_stall_exec_cpu(usecs) |
|
90 |
uint32_t usecs; |
|
89 |
hal_stall_exec_cpu(uint32_t usecs) |
|
91 | 90 |
{ |
92 | 91 |
DELAY(usecs); |
93 | 92 |
return; |
94 | 93 |
} |
95 | 94 | |
96 | 95 |
__stdcall static void |
97 |
hal_writeport_ulong(port, val) |
|
98 |
uint32_t *port; |
|
99 |
uint32_t val; |
|
96 |
hal_writeport_ulong(uint32_t *port, uint32_t val) |
|
100 | 97 |
{ |
101 | 98 |
bus_space_write_4(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val); |
102 | 99 |
return; |
103 | 100 |
} |
104 | 101 | |
105 | 102 |
__stdcall static void |
106 |
hal_writeport_ushort(port, val) |
|
107 |
uint16_t *port; |
|
108 |
uint16_t val; |
|
103 |
hal_writeport_ushort(uint16_t *port, uint16_t val) |
|
109 | 104 |
{ |
110 | 105 |
bus_space_write_2(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val); |
111 | 106 |
return; |
112 | 107 |
} |
113 | 108 | |
114 | 109 |
__stdcall static void |
115 |
hal_writeport_uchar(port, val) |
|
116 |
uint8_t *port; |
|
117 |
uint8_t val; |
|
110 |
hal_writeport_uchar(uint8_t *port, uint8_t val) |
|
118 | 111 |
{ |
119 | 112 |
bus_space_write_1(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val); |
120 | 113 |
return; |
121 | 114 |
} |
122 | 115 | |
123 | 116 |
__stdcall static void |
124 |
hal_writeport_buf_ulong(port, val, cnt) |
|
125 |
uint32_t *port; |
|
126 |
uint32_t *val; |
|
127 |
uint32_t cnt; |
|
117 |
hal_writeport_buf_ulong(uint32_t *port, uint32_t *val, uint32_t cnt) |
|
128 | 118 |
{ |
129 | 119 |
bus_space_write_multi_4(NDIS_BUS_SPACE_IO, 0x0, |
130 | 120 |
(bus_size_t)port, val, cnt); |
... | ... | |
132 | 122 |
} |
133 | 123 | |
134 | 124 |
__stdcall static void |
135 |
hal_writeport_buf_ushort(port, val, cnt) |
|
136 |
uint16_t *port; |
|
137 |
uint16_t *val; |
|
138 |
uint32_t cnt; |
|
125 |
hal_writeport_buf_ushort(uint16_t *port, uint16_t *val, uint32_t cnt) |
|
139 | 126 |
{ |
140 | 127 |
bus_space_write_multi_2(NDIS_BUS_SPACE_IO, 0x0, |
141 | 128 |
(bus_size_t)port, val, cnt); |
... | ... | |
143 | 130 |
} |
144 | 131 | |
145 | 132 |
__stdcall static void |
146 |
hal_writeport_buf_uchar(port, val, cnt) |
|
147 |
uint8_t *port; |
|
148 |
uint8_t *val; |
|
149 |
uint32_t cnt; |
|
133 |
hal_writeport_buf_uchar(uint8_t *port, uint8_t *val, uint32_t cnt) |
|
150 | 134 |
{ |
151 | 135 |
bus_space_write_multi_1(NDIS_BUS_SPACE_IO, 0x0, |
152 | 136 |
(bus_size_t)port, val, cnt); |
... | ... | |
154 | 138 |
} |
155 | 139 | |
156 | 140 |
__stdcall static uint16_t |
157 |
hal_readport_ushort(port) |
|
158 |
uint16_t *port; |
|
141 |
hal_readport_ushort(uint16_t *port) |
|
159 | 142 |
{ |
160 | 143 |
return(bus_space_read_2(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port)); |
161 | 144 |
} |
162 | 145 | |
163 | 146 |
__stdcall static uint32_t |
164 |
hal_readport_ulong(port) |
|
165 |
uint32_t *port; |
|
147 |
hal_readport_ulong(uint32_t *port) |
|
166 | 148 |
{ |
167 | 149 |
return(bus_space_read_4(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port)); |
168 | 150 |
} |
169 | 151 | |
170 | 152 |
__stdcall static uint8_t |
171 |
hal_readport_uchar(port) |
|
172 |
uint8_t *port; |
|
153 |
hal_readport_uchar(uint8_t *port) |
|
173 | 154 |
{ |
174 | 155 |
return(bus_space_read_1(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port)); |
175 | 156 |
} |
176 | 157 | |
177 | 158 |
__stdcall static void |
178 |
hal_readport_buf_ulong(port, val, cnt) |
|
179 |
uint32_t *port; |
|
180 |
uint32_t *val; |
|
181 |
uint32_t cnt; |
|
159 |
hal_readport_buf_ulong(uint32_t *port, uint32_t *val, uint32_t cnt) |
|
182 | 160 |
{ |
183 | 161 |
bus_space_read_multi_4(NDIS_BUS_SPACE_IO, 0x0, |
184 | 162 |
(bus_size_t)port, val, cnt); |
... | ... | |
186 | 164 |
} |
187 | 165 | |
188 | 166 |
__stdcall static void |
189 |
hal_readport_buf_ushort(port, val, cnt) |
|
190 |
uint16_t *port; |
|
191 |
uint16_t *val; |
|
192 |
uint32_t cnt; |
|
167 |
hal_readport_buf_ushort(uint16_t *port, uint16_t *val, uint32_t cnt) |
|
193 | 168 |
{ |
194 | 169 |
bus_space_read_multi_2(NDIS_BUS_SPACE_IO, 0x0, |
195 | 170 |
(bus_size_t)port, val, cnt); |
... | ... | |
197 | 172 |
} |
198 | 173 | |
199 | 174 |
__stdcall static void |
200 |
hal_readport_buf_uchar(port, val, cnt) |
|
201 |
uint8_t *port; |
|
202 |
uint8_t *val; |
|
203 |
uint32_t cnt; |
|
175 |
hal_readport_buf_uchar(uint8_t *port, uint8_t *val, uint32_t cnt) |
|
204 | 176 |
{ |
205 | 177 |
bus_space_read_multi_1(NDIS_BUS_SPACE_IO, 0x0, |
206 | 178 |
(bus_size_t)port, val, cnt); |
... | ... | |
287 | 259 |
} |
288 | 260 | |
289 | 261 |
__stdcall static uint64_t |
290 |
hal_perfcount(freq) |
|
291 |
uint64_t *freq; |
|
262 |
hal_perfcount(uint64_t *freq) |
|
292 | 263 |
{ |
293 | 264 |
if (freq != NULL) |
294 | 265 |
*freq = hz; |
... | ... | |
326 | 297 |
} |
327 | 298 | |
328 | 299 |
__stdcall |
329 |
static void dummy() |
|
300 |
static void dummy(void)
|
|
330 | 301 |
{ |
331 | 302 |
printf ("hal dummy called...\n"); |
332 | 303 |
return; |
ndis/subr_ndis.c 9 Dec 2005 00:17:22 -0000 | ||
---|---|---|
293 | 293 |
#define NDIS_POOL_EXTRA 16 |
294 | 294 | |
295 | 295 |
int |
296 |
ndis_libinit() |
|
296 |
ndis_libinit(void)
|
|
297 | 297 |
{ |
298 | 298 |
strcpy(ndis_filepath, "/compat/ndis"); |
299 | 299 |
return(0); |
300 | 300 |
} |
301 | 301 | |
302 | 302 |
int |
303 |
ndis_libfini() |
|
303 |
ndis_libfini(void)
|
|
304 | 304 |
{ |
305 | 305 |
return(0); |
306 | 306 |
} |
... | ... | |
313 | 313 |
*/ |
314 | 314 | |
315 | 315 |
int |
316 |
ndis_ascii_to_unicode(ascii, unicode) |
|
317 |
char *ascii; |
|
318 |
uint16_t **unicode; |
|
316 |
ndis_ascii_to_unicode(char *ascii, uint16_t **unicode) |
|
319 | 317 |
{ |
320 | 318 |
uint16_t *ustr; |
321 | 319 |
int i; |