Deleted Added
full compact
linux.h (78161) linux.h (83221)
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/i386/linux/linux.h 78161 2001-06-13 10:58:39Z peter $
28 * $FreeBSD: head/sys/i386/linux/linux.h 83221 2001-09-08 19:07:04Z marcel $
29 */
30
31#ifndef _I386_LINUX_LINUX_H_
32#define _I386_LINUX_LINUX_H_
33
34#include <sys/signal.h> /* for sigval union */
35
36#include <i386/linux/linux_syscall.h>
37
38/*
39 * debugging support
40 */
29 */
30
31#ifndef _I386_LINUX_LINUX_H_
32#define _I386_LINUX_LINUX_H_
33
34#include <sys/signal.h> /* for sigval union */
35
36#include <i386/linux/linux_syscall.h>
37
38/*
39 * debugging support
40 */
41extern u_char linux_debug_map[];
41extern u_char linux_debug_map[];
42#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
42#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
43#define ARGS(nm, fmt) "Linux-emul(%ld): "#nm"("fmt")\n", (long)p->p_pid
44#define LMSG(fmt) "Linux-emul(%ld): "fmt"\n", (long)p->p_pid
43#define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)p->p_pid
44#define LMSG(fmt) "linux(%ld): "fmt"\n", (long)p->p_pid
45
46#ifdef MALLOC_DECLARE
47MALLOC_DECLARE(M_LINUX);
48#endif
49
50/*
45
46#ifdef MALLOC_DECLARE
47MALLOC_DECLARE(M_LINUX);
48#endif
49
50/*
51 * Provide a seperate set of types for the Linux types.
52 */
53typedef int l_int;
54typedef int32_t l_long;
55typedef int64_t l_longlong;
56typedef short l_short;
57typedef unsigned int l_uint;
58typedef uint32_t l_ulong;
59typedef uint64_t l_ulonglong;
60typedef unsigned short l_ushort;
61
62typedef char *l_caddr_t;
63typedef l_long l_clock_t;
64typedef l_int l_daddr_t;
65typedef l_ushort l_dev_t;
66typedef l_uint l_gid_t;
67typedef l_ushort l_gid16_t;
68typedef l_ulong l_ino_t;
69typedef l_int l_key_t;
70typedef l_longlong l_loff_t;
71typedef l_ushort l_mode_t;
72typedef l_long l_off_t;
73typedef l_int l_pid_t;
74typedef l_uint l_size_t;
75typedef l_long l_suseconds_t;
76typedef l_long l_time_t;
77typedef l_uint l_uid_t;
78typedef l_ushort l_uid16_t;
79
80typedef struct {
81 l_int val[2];
82} l_fsid_t;
83
84typedef struct {
85 l_time_t tv_sec;
86 l_suseconds_t tv_usec;
87} l_timeval;
88
89#define l_fd_set fd_set
90
91/*
51 * Miscellaneous
52 */
53#define LINUX_NAME_MAX 255
54#define LINUX_MAX_UTSNAME 65
55
92 * Miscellaneous
93 */
94#define LINUX_NAME_MAX 255
95#define LINUX_MAX_UTSNAME 65
96
97#define LINUX_CTL_MAXNAME 10
98
99struct l___sysctl_args
100{
101 l_int *name;
102 l_int nlen;
103 void *oldval;
104 l_size_t *oldlenp;
105 void *newval;
106 l_size_t newlen;
107 l_ulong __spare[4];
108};
109
56/* Scheduling policies */
57#define LINUX_SCHED_OTHER 0
58#define LINUX_SCHED_FIFO 1
59#define LINUX_SCHED_RR 2
60
61/* Resource limits */
62#define LINUX_RLIMIT_CPU 0
63#define LINUX_RLIMIT_FSIZE 1
64#define LINUX_RLIMIT_DATA 2
65#define LINUX_RLIMIT_STACK 3
66#define LINUX_RLIMIT_CORE 4
67#define LINUX_RLIMIT_RSS 5
68#define LINUX_RLIMIT_NPROC 6
69#define LINUX_RLIMIT_NOFILE 7
70#define LINUX_RLIMIT_MEMLOCK 8
71#define LINUX_RLIMIT_AS 9 /* address space limit */
72
73#define LINUX_RLIM_NLIMITS 10
74
110/* Scheduling policies */
111#define LINUX_SCHED_OTHER 0
112#define LINUX_SCHED_FIFO 1
113#define LINUX_SCHED_RR 2
114
115/* Resource limits */
116#define LINUX_RLIMIT_CPU 0
117#define LINUX_RLIMIT_FSIZE 1
118#define LINUX_RLIMIT_DATA 2
119#define LINUX_RLIMIT_STACK 3
120#define LINUX_RLIMIT_CORE 4
121#define LINUX_RLIMIT_RSS 5
122#define LINUX_RLIMIT_NPROC 6
123#define LINUX_RLIMIT_NOFILE 7
124#define LINUX_RLIMIT_MEMLOCK 8
125#define LINUX_RLIMIT_AS 9 /* address space limit */
126
127#define LINUX_RLIM_NLIMITS 10
128
129struct l_rlimit {
130 l_ulong rlim_cur;
131 l_ulong rlim_max;
132};
133
75/* mmap options */
76#define LINUX_MAP_SHARED 0x0001
77#define LINUX_MAP_PRIVATE 0x0002
78#define LINUX_MAP_FIXED 0x0010
79#define LINUX_MAP_ANON 0x0020
80#define LINUX_MAP_GROWSDOWN 0x0100
81
134/* mmap options */
135#define LINUX_MAP_SHARED 0x0001
136#define LINUX_MAP_PRIVATE 0x0002
137#define LINUX_MAP_FIXED 0x0010
138#define LINUX_MAP_ANON 0x0020
139#define LINUX_MAP_GROWSDOWN 0x0100
140
82typedef char * linux_caddr_t;
83typedef long linux_clock_t;
84typedef u_short linux_dev_t;
85typedef u_short linux_gid_t;
86typedef u_long linux_ino_t;
87typedef int linux_key_t; /* XXX */
88typedef u_short linux_mode_t;
89typedef u_short linux_nlink_t;
90typedef long linux_off_t;
91typedef int linux_pid_t;
92typedef u_int linux_size_t;
93typedef long linux_time_t;
94typedef u_short linux_uid_t;
141/*
142 * stat family of syscalls
143 */
144struct l_timespec {
145 l_ulong tv_sec;
146 l_ulong tv_nsec;
147};
95
148
96typedef struct {
97 long val[2];
98} linux_fsid_t;
149struct l_newstat {
150 l_ushort st_dev;
151 l_ushort __pad1;
152 l_ulong st_ino;
153 l_ushort st_mode;
154 l_ushort st_nlink;
155 l_ushort st_uid;
156 l_ushort st_gid;
157 l_ushort st_rdev;
158 l_ushort __pad2;
159 l_ulong st_size;
160 l_ulong st_blksize;
161 l_ulong st_blocks;
162 struct l_timespec st_atimespec;
163 struct l_timespec st_mtimespec;
164 struct l_timespec st_ctimespec;
165 l_ulong __unused4;
166 l_ulong __unused5;
167};
99
168
100struct linux_new_utsname {
169struct l_stat64 {
170 l_ushort st_dev;
171 u_char __pad0[10];
172 l_ulong __st_ino;
173 l_uint st_mode;
174 l_uint st_nlink;
175 l_ulong st_uid;
176 l_ulong st_gid;
177 l_ushort st_rdev;
178 u_char __pad3[10];
179 l_longlong st_size;
180 l_ulong st_blksize;
181 l_ulong st_blocks;
182 l_ulong __pad4;
183 struct l_timespec st_atimespec;
184 struct l_timespec st_mtimespec;
185 struct l_timespec st_ctimespec;
186 l_ulonglong st_ino;
187};
188
189struct l_new_utsname {
101 char sysname[LINUX_MAX_UTSNAME];
102 char nodename[LINUX_MAX_UTSNAME];
103 char release[LINUX_MAX_UTSNAME];
104 char version[LINUX_MAX_UTSNAME];
105 char machine[LINUX_MAX_UTSNAME];
106 char domainname[LINUX_MAX_UTSNAME];
107};
108

--- 60 unchanged lines hidden (view full) ---

169#define LINUX_SIGISMEMBER(set, sig) SIGISMEMBER(set, sig)
170#define LINUX_SIGADDSET(set, sig) SIGADDSET(set, sig)
171
172/* sigaltstack */
173#define LINUX_MINSIGSTKSZ 2048
174#define LINUX_SS_ONSTACK 1
175#define LINUX_SS_DISABLE 2
176
190 char sysname[LINUX_MAX_UTSNAME];
191 char nodename[LINUX_MAX_UTSNAME];
192 char release[LINUX_MAX_UTSNAME];
193 char version[LINUX_MAX_UTSNAME];
194 char machine[LINUX_MAX_UTSNAME];
195 char domainname[LINUX_MAX_UTSNAME];
196};
197

--- 60 unchanged lines hidden (view full) ---

258#define LINUX_SIGISMEMBER(set, sig) SIGISMEMBER(set, sig)
259#define LINUX_SIGADDSET(set, sig) SIGADDSET(set, sig)
260
261/* sigaltstack */
262#define LINUX_MINSIGSTKSZ 2048
263#define LINUX_SS_ONSTACK 1
264#define LINUX_SS_DISABLE 2
265
177
178int linux_to_bsd_sigaltstack(int lsa);
179int bsd_to_linux_sigaltstack(int bsa);
180
266int linux_to_bsd_sigaltstack(int lsa);
267int bsd_to_linux_sigaltstack(int bsa);
268
269typedef void (*l_handler_t)(l_int);
270typedef l_ulong l_osigset_t;
181
271
182typedef void (*linux_handler_t)(int);
183typedef u_long linux_osigset_t;
184
185typedef struct {
272typedef struct {
186 u_int __bits[LINUX_NSIG_WORDS];
187} linux_sigset_t;
273 l_uint __bits[LINUX_NSIG_WORDS];
274} l_sigset_t;
188
189typedef struct {
275
276typedef struct {
190 linux_handler_t lsa_handler;
191 linux_osigset_t lsa_mask;
192 u_long lsa_flags;
277 l_handler_t lsa_handler;
278 l_osigset_t lsa_mask;
279 l_ulong lsa_flags;
193 void (*lsa_restorer)(void);
280 void (*lsa_restorer)(void);
194} linux_osigaction_t;
281} l_osigaction_t;
195
196typedef struct {
282
283typedef struct {
197 linux_handler_t lsa_handler;
198 u_long lsa_flags;
284 l_handler_t lsa_handler;
285 l_ulong lsa_flags;
199 void (*lsa_restorer)(void);
286 void (*lsa_restorer)(void);
200 linux_sigset_t lsa_mask;
201} linux_sigaction_t;
287 l_sigset_t lsa_mask;
288} l_sigaction_t;
202
203typedef struct {
289
290typedef struct {
204 void *ss_sp;
205 int ss_flags;
206 linux_size_t ss_size;
207} linux_stack_t;
291 void *ss_sp;
292 l_int ss_flags;
293 l_size_t ss_size;
294} l_stack_t;
208
209/* The Linux sigcontext, pretty much a standard 386 trapframe. */
295
296/* The Linux sigcontext, pretty much a standard 386 trapframe. */
210struct linux_sigcontext {
211 int sc_gs;
212 int sc_fs;
213 int sc_es;
214 int sc_ds;
215 int sc_edi;
216 int sc_esi;
217 int sc_ebp;
218 int sc_esp;
219 int sc_ebx;
220 int sc_edx;
221 int sc_ecx;
222 int sc_eax;
223 int sc_trapno;
224 int sc_err;
225 int sc_eip;
226 int sc_cs;
227 int sc_eflags;
228 int sc_esp_at_signal;
229 int sc_ss;
230 int sc_387;
231 int sc_mask;
232 int sc_cr2;
297struct l_sigcontext {
298 l_int sc_gs;
299 l_int sc_fs;
300 l_int sc_es;
301 l_int sc_ds;
302 l_int sc_edi;
303 l_int sc_esi;
304 l_int sc_ebp;
305 l_int sc_esp;
306 l_int sc_ebx;
307 l_int sc_edx;
308 l_int sc_ecx;
309 l_int sc_eax;
310 l_int sc_trapno;
311 l_int sc_err;
312 l_int sc_eip;
313 l_int sc_cs;
314 l_int sc_eflags;
315 l_int sc_esp_at_signal;
316 l_int sc_ss;
317 l_int sc_387;
318 l_int sc_mask;
319 l_int sc_cr2;
233};
234
320};
321
235struct linux_ucontext {
236 unsigned long uc_flags;
237 void *uc_link;
238 linux_stack_t uc_stack;
239 struct linux_sigcontext uc_mcontext;
240 linux_sigset_t uc_sigmask;
322struct l_ucontext {
323 l_ulong uc_flags;
324 void *uc_link;
325 l_stack_t uc_stack;
326 struct l_sigcontext uc_mcontext;
327 l_sigset_t uc_sigmask;
241};
242
328};
329
243
244#define LINUX_SI_MAX_SIZE 128
330#define LINUX_SI_MAX_SIZE 128
245#define LINUX_SI_PAD_SIZE ((LINUX_SI_MAX_SIZE/sizeof(int)) - 3)
331#define LINUX_SI_PAD_SIZE ((LINUX_SI_MAX_SIZE/sizeof(l_int)) - 3)
246
332
247typedef struct siginfo {
248 int lsi_signo;
249 int lsi_errno;
250 int lsi_code;
251
333typedef struct l_siginfo {
334 l_int lsi_signo;
335 l_int lsi_errno;
336 l_int lsi_code;
252 union {
337 union {
253 int _pad[LINUX_SI_PAD_SIZE];
338 l_int _pad[LINUX_SI_PAD_SIZE];
339
254 struct {
340 struct {
255 linux_pid_t _pid;
256 linux_uid_t _uid;
341 l_pid_t _pid;
342 l_uid16_t _uid;
257 } _kill;
258
259 struct {
343 } _kill;
344
345 struct {
260 unsigned int _timer1;
261 unsigned int _timer2;
346 l_uint _timer1;
347 l_uint _timer2;
262 } _timer;
348 } _timer;
263
349
264 struct {
350 struct {
265 linux_pid_t _pid; /* sender's pid */
266 linux_uid_t _uid; /* sender's uid */
351 l_pid_t _pid; /* sender's pid */
352 l_uid16_t _uid; /* sender's uid */
267 union sigval _sigval;
268 } _rt;
269
270 struct {
353 union sigval _sigval;
354 } _rt;
355
356 struct {
271 linux_pid_t _pid; /* which child */
272 linux_uid_t _uid; /* sender's uid */
273 int _status; /* exit code */
274 linux_clock_t _utime;
275 linux_clock_t _stime;
357 l_pid_t _pid; /* which child */
358 l_uid16_t _uid; /* sender's uid */
359 l_int _status; /* exit code */
360 l_clock_t _utime;
361 l_clock_t _stime;
276 } _sigchld;
277
278 struct {
362 } _sigchld;
363
364 struct {
279 void *_addr; /* faulting insn/memory ref. */
365 void *_addr; /* faulting insn/memory ref. */
280 } _sigfault;
281
282 struct {
366 } _sigfault;
367
368 struct {
283 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
284 int _fd;
369 l_int _band; /* POLL_IN,POLL_OUT,POLL_MSG */
370 l_int _fd;
285 } _sigpoll;
286 } _sifields;
371 } _sigpoll;
372 } _sifields;
287} linux_siginfo_t;
373} l_siginfo_t;
288
289#define lsi_pid _sifields._kill._pid
290#define lsi_uid _sifields._kill._uid
291#define lsi_status _sifields._sigchld._status
292#define lsi_utime _sifields._sigchld._utime
293#define lsi_stime _sifields._sigchld._stime
294#define lsi_value _sifields._rt._sigval
295#define lsi_int _sifields._rt._sigval.sival_int
296#define lsi_ptr _sifields._rt._sigval.sival_ptr
297#define lsi_addr _sifields._sigfault._addr
298#define lsi_band _sifields._sigpoll._band
299#define lsi_fd _sifields._sigpoll._fd
300
374
375#define lsi_pid _sifields._kill._pid
376#define lsi_uid _sifields._kill._uid
377#define lsi_status _sifields._sigchld._status
378#define lsi_utime _sifields._sigchld._utime
379#define lsi_stime _sifields._sigchld._stime
380#define lsi_value _sifields._rt._sigval
381#define lsi_int _sifields._rt._sigval.sival_int
382#define lsi_ptr _sifields._rt._sigval.sival_ptr
383#define lsi_addr _sifields._sigfault._addr
384#define lsi_band _sifields._sigpoll._band
385#define lsi_fd _sifields._sigpoll._fd
386
301struct linux_fpreg {
387struct l_fpreg {
302 u_int16_t significand[4];
303 u_int16_t exponent;
304};
305
388 u_int16_t significand[4];
389 u_int16_t exponent;
390};
391
306struct linux_fpxreg {
392struct l_fpxreg {
307 u_int16_t significand[4];
308 u_int16_t exponent;
309 u_int16_t padding[3];
310};
311
393 u_int16_t significand[4];
394 u_int16_t exponent;
395 u_int16_t padding[3];
396};
397
312struct linux_xmmreg {
398struct l_xmmreg {
313 u_int32_t element[4];
314};
315
399 u_int32_t element[4];
400};
401
316struct linux_fpstate {
402struct l_fpstate {
317 /* Regular FPU environment */
318 u_int32_t cw;
319 u_int32_t sw;
320 u_int32_t tag;
321 u_int32_t ipoff;
322 u_int32_t cssel;
323 u_int32_t dataoff;
324 u_int32_t datasel;
403 /* Regular FPU environment */
404 u_int32_t cw;
405 u_int32_t sw;
406 u_int32_t tag;
407 u_int32_t ipoff;
408 u_int32_t cssel;
409 u_int32_t dataoff;
410 u_int32_t datasel;
325 struct linux_fpreg _st[8];
411 struct l_fpreg _st[8];
326 u_int16_t status;
327 u_int16_t magic; /* 0xffff = regular FPU data */
328
329 /* FXSR FPU environment */
330 u_int32_t _fxsr_env[6]; /* env is ignored */
331 u_int32_t mxcsr;
332 u_int32_t reserved;
412 u_int16_t status;
413 u_int16_t magic; /* 0xffff = regular FPU data */
414
415 /* FXSR FPU environment */
416 u_int32_t _fxsr_env[6]; /* env is ignored */
417 u_int32_t mxcsr;
418 u_int32_t reserved;
333 struct linux_fpxreg _fxsr_st[8]; /* reg data is ignored */
334 struct linux_xmmreg _xmm[8];
419 struct l_fpxreg _fxsr_st[8]; /* reg data is ignored */
420 struct l_xmmreg _xmm[8];
335 u_int32_t padding[56];
336};
337
338/*
339 * We make the stack look like Linux expects it when calling a signal
340 * handler, but use the BSD way of calling the handler and sigreturn().
341 * This means that we need to pass the pointer to the handler too.
342 * It is appended to the frame to not interfere with the rest of it.
343 */
421 u_int32_t padding[56];
422};
423
424/*
425 * We make the stack look like Linux expects it when calling a signal
426 * handler, but use the BSD way of calling the handler and sigreturn().
427 * This means that we need to pass the pointer to the handler too.
428 * It is appended to the frame to not interfere with the rest of it.
429 */
344struct linux_sigframe {
345 int sf_sig;
346 struct linux_sigcontext sf_sc;
347 struct linux_fpstate sf_fpstate;
348 u_int sf_extramask[LINUX_NSIG_WORDS-1];
349 linux_handler_t sf_handler;
430struct l_sigframe {
431 l_int sf_sig;
432 struct l_sigcontext sf_sc;
433 struct l_fpstate sf_fpstate;
434 l_uint sf_extramask[LINUX_NSIG_WORDS-1];
435 l_handler_t sf_handler;
350};
351
436};
437
352struct linux_rt_sigframe {
353 int sf_sig;
354 linux_siginfo_t *sf_siginfo;
355 struct linux_ucontext *sf_ucontext;
356 linux_siginfo_t sf_si;
357 struct linux_ucontext sf_sc;
358 linux_handler_t sf_handler;
438struct l_rt_sigframe {
439 l_int sf_sig;
440 l_siginfo_t *sf_siginfo;
441 struct l_ucontext *sf_ucontext;
442 l_siginfo_t sf_si;
443 struct l_ucontext sf_sc;
444 l_handler_t sf_handler;
359};
360
361extern int bsd_to_linux_signal[];
362extern int linux_to_bsd_signal[];
363extern struct sysentvec linux_sysvec;
364extern struct sysentvec elf_linux_sysvec;
365
366/*

--- 85 unchanged lines hidden (view full) ---

452#define LINUX_GETPID 11
453#define LINUX_GETVAL 12
454#define LINUX_GETALL 13
455#define LINUX_GETNCNT 14
456#define LINUX_GETZCNT 15
457#define LINUX_SETVAL 16
458#define LINUX_SETALL 17
459
445};
446
447extern int bsd_to_linux_signal[];
448extern int linux_to_bsd_signal[];
449extern struct sysentvec linux_sysvec;
450extern struct sysentvec elf_linux_sysvec;
451
452/*

--- 85 unchanged lines hidden (view full) ---

538#define LINUX_GETPID 11
539#define LINUX_GETVAL 12
540#define LINUX_GETALL 13
541#define LINUX_GETNCNT 14
542#define LINUX_GETZCNT 15
543#define LINUX_SETVAL 16
544#define LINUX_SETALL 17
545
546union l_semun {
547 l_int val;
548 struct l_semid_ds *buf;
549 l_ushort *array;
550 struct l_seminfo *__buf;
551 void *__pad;
552};
553
460/*
461 * Socket defines
462 */
463#define LINUX_SOCKET 1
464#define LINUX_BIND 2
465#define LINUX_CONNECT 3
466#define LINUX_LISTEN 4
467#define LINUX_ACCEPT 5

--- 44 unchanged lines hidden (view full) ---

512#define LINUX_IP_OPTIONS 4
513
514#define LINUX_IP_MULTICAST_IF 32
515#define LINUX_IP_MULTICAST_TTL 33
516#define LINUX_IP_MULTICAST_LOOP 34
517#define LINUX_IP_ADD_MEMBERSHIP 35
518#define LINUX_IP_DROP_MEMBERSHIP 36
519
554/*
555 * Socket defines
556 */
557#define LINUX_SOCKET 1
558#define LINUX_BIND 2
559#define LINUX_CONNECT 3
560#define LINUX_LISTEN 4
561#define LINUX_ACCEPT 5

--- 44 unchanged lines hidden (view full) ---

606#define LINUX_IP_OPTIONS 4
607
608#define LINUX_IP_MULTICAST_IF 32
609#define LINUX_IP_MULTICAST_TTL 33
610#define LINUX_IP_MULTICAST_LOOP 34
611#define LINUX_IP_ADD_MEMBERSHIP 35
612#define LINUX_IP_DROP_MEMBERSHIP 36
613
520struct linux_sockaddr {
521 u_short sa_family;
522 char sa_data[14];
614struct l_sockaddr {
615 l_ushort sa_family;
616 char sa_data[14];
523};
524
617};
618
525struct linux_ifmap {
526 u_long mem_start;
527 u_long mem_end;
528 u_short base_addr;
529 u_char irq;
530 u_char dma;
531 u_char port;
619struct l_ifmap {
620 l_ulong mem_start;
621 l_ulong mem_end;
622 l_ushort base_addr;
623 u_char irq;
624 u_char dma;
625 u_char port;
532};
533
534#define LINUX_IFHWADDRLEN 6
535#define LINUX_IFNAMSIZ 16
536
626};
627
628#define LINUX_IFHWADDRLEN 6
629#define LINUX_IFNAMSIZ 16
630
537struct linux_ifreq {
631struct l_ifreq {
538 union {
539 char ifrn_name[LINUX_IFNAMSIZ];
540 } ifr_ifrn;
541
542 union {
632 union {
633 char ifrn_name[LINUX_IFNAMSIZ];
634 } ifr_ifrn;
635
636 union {
543 struct linux_sockaddr ifru_addr;
544 struct linux_sockaddr ifru_dstaddr;
545 struct linux_sockaddr ifru_broadaddr;
546 struct linux_sockaddr ifru_netmask;
547 struct linux_sockaddr ifru_hwaddr;
548 short ifru_flags;
549 int ifru_metric;
550 int ifru_mtu;
551 struct linux_ifmap ifru_map;
552 char ifru_slave[LINUX_IFNAMSIZ]; /* Just fits the size */
553 linux_caddr_t ifru_data;
637 struct l_sockaddr ifru_addr;
638 struct l_sockaddr ifru_dstaddr;
639 struct l_sockaddr ifru_broadaddr;
640 struct l_sockaddr ifru_netmask;
641 struct l_sockaddr ifru_hwaddr;
642 l_short ifru_flags;
643 l_int ifru_metric;
644 l_int ifru_mtu;
645 struct l_ifmap ifru_map;
646 char ifru_slave[LINUX_IFNAMSIZ];
647 l_caddr_t ifru_data;
554 } ifr_ifru;
555};
556
557#define ifr_name ifr_ifrn.ifrn_name /* interface name */
558#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
559
648 } ifr_ifru;
649};
650
651#define ifr_name ifr_ifrn.ifrn_name /* interface name */
652#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
653
654/*
655 * poll()
656 */
657#define LINUX_POLLIN 0x0001
658#define LINUX_POLLPRI 0x0002
659#define LINUX_POLLOUT 0x0004
660#define LINUX_POLLERR 0x0008
661#define LINUX_POLLHUP 0x0010
662#define LINUX_POLLNVAL 0x0020
663#define LINUX_POLLRDNORM 0x0040
664#define LINUX_POLLRDBAND 0x0080
665#define LINUX_POLLWRNORM 0x0100
666#define LINUX_POLLWRBAND 0x0200
667#define LINUX_POLLMSG 0x0400
668
669struct l_pollfd {
670 l_int fd;
671 l_short events;
672 l_short revents;
673};
674
560#endif /* !_I386_LINUX_LINUX_H_ */
675#endif /* !_I386_LINUX_LINUX_H_ */