2 /*--------------------------------------------------------------------*/
3 /*--- PPC64/Linux-specific kernel interface. vki-ppc64-linux.h ---*/
4 /*--------------------------------------------------------------------*/
7 This file is part of Valgrind, a dynamic binary instrumentation
10 Copyright (C) 2005-2010 Julian Seward
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
28 The GNU General Public License is contained in the file COPYING.
31 #ifndef __VKI_PPC64_LINUX_H
32 #define __VKI_PPC64_LINUX_H
34 // ppc64 is big-endian.
35 #define VKI_BIG_ENDIAN 1
37 //----------------------------------------------------------------------
38 // From linux-2.6.13/include/asm-ppc64/types.h
39 //----------------------------------------------------------------------
41 typedef __signed__ char __vki_s8;
42 typedef unsigned char __vki_u8;
44 typedef __signed__ short __vki_s16;
45 typedef unsigned short __vki_u16;
47 typedef __signed__ int __vki_s32;
48 typedef unsigned int __vki_u32;
50 typedef __signed__ long __vki_s64;
51 typedef unsigned long __vki_u64;
55 } __attribute((aligned(16))) __vki_vector128;
57 typedef unsigned short vki_u16;
59 typedef unsigned int vki_u32;
61 //----------------------------------------------------------------------
62 // From linux-2.6.13/include/asm-ppc64/page.h
63 //----------------------------------------------------------------------
65 /* PAGE_SHIFT determines the page size, unfortunately
66 page size might vary between 32-bit and 64-bit ppc kernels */
67 extern unsigned long VKI_PAGE_SHIFT;
68 extern unsigned long VKI_PAGE_SIZE;
69 #define VKI_MAX_PAGE_SHIFT 16
70 #define VKI_MAX_PAGE_SIZE (1UL << VKI_MAX_PAGE_SHIFT)
72 //----------------------------------------------------------------------
73 // From linux-2.6.13/include/asm-ppc64/signal.h
74 //----------------------------------------------------------------------
76 #define VKI_MINSIGSTKSZ 2048
78 /* Next 9 non-blank lines asm-generic/signal.h */
79 #define VKI_SIG_BLOCK 0 /* for blocking signals */
80 #define VKI_SIG_UNBLOCK 1 /* for unblocking signals */
81 #define VKI_SIG_SETMASK 2 /* for setting the signal mask */
83 typedef void __vki_signalfn_t(int);
84 typedef __vki_signalfn_t __user *__vki_sighandler_t;
86 typedef void __vki_restorefn_t(void);
87 typedef __vki_restorefn_t __user *__vki_sigrestore_t;
89 #define VKI_SIG_DFL ((__vki_sighandler_t)0) /* default signal handling */
90 #define VKI_SIG_IGN ((__vki_sighandler_t)1) /* ignore signal */
92 /* Back in asm-ppc64/signal.h */
94 #define _VKI_NSIG_BPW 64
95 #define _VKI_NSIG_WORDS (_VKI_NSIG / _VKI_NSIG_BPW)
97 typedef unsigned long vki_old_sigset_t; /* at least 32 bits */
100 unsigned long sig[_VKI_NSIG_WORDS];
105 #define VKI_SIGQUIT 3
107 #define VKI_SIGTRAP 5
108 #define VKI_SIGABRT 6
112 #define VKI_SIGKILL 9
113 #define VKI_SIGUSR1 10
114 #define VKI_SIGSEGV 11
115 #define VKI_SIGUSR2 12
116 #define VKI_SIGPIPE 13
117 #define VKI_SIGALRM 14
118 #define VKI_SIGTERM 15
119 #define VKI_SIGSTKFLT 16
120 #define VKI_SIGCHLD 17
121 #define VKI_SIGCONT 18
122 #define VKI_SIGSTOP 19
123 #define VKI_SIGTSTP 20
124 #define VKI_SIGTTIN 21
125 #define VKI_SIGTTOU 22
126 #define VKI_SIGURG 23
127 #define VKI_SIGXCPU 24
128 #define VKI_SIGXFSZ 25
129 #define VKI_SIGVTALRM 26
130 #define VKI_SIGPROF 27
131 #define VKI_SIGWINCH 28
133 #define VKI_SIGPOLL VKI_SIGIO
134 #define VKI_SIGPWR 30
135 #define VKI_SIGSYS 31
136 #define VKI_SIGUNUSED 31
138 /* These should not be considered constants from userland. */
139 #define VKI_SIGRTMIN 32
140 #define VKI_SIGRTMAX _VKI_NSIG
142 #define VKI_SA_NOCLDSTOP 0x00000001u
143 #define VKI_SA_NOCLDWAIT 0x00000002u
144 #define VKI_SA_SIGINFO 0x00000004u
145 #define VKI_SA_ONSTACK 0x08000000u
146 #define VKI_SA_RESTART 0x10000000u
147 #define VKI_SA_NODEFER 0x40000000u
148 #define VKI_SA_RESETHAND 0x80000000u
150 #define VKI_SA_NOMASK VKI_SA_NODEFER
151 #define VKI_SA_ONESHOT VKI_SA_RESETHAND
152 //#define VKI_SA_INTERRUPT 0x20000000u /* dummy -- ignored */
154 #define VKI_SA_RESTORER 0x04000000u
156 #define VKI_SS_ONSTACK 1
157 #define VKI_SS_DISABLE 2
159 // See comments on corresponding decls in vki-x86-linux.h re ksa_handler
160 struct vki_old_sigaction {
161 __vki_sighandler_t ksa_handler;
162 vki_old_sigset_t sa_mask;
163 unsigned long sa_flags;
164 __vki_sigrestore_t sa_restorer;
167 struct vki_sigaction_base {
168 __vki_sighandler_t ksa_handler;
169 unsigned long sa_flags;
170 __vki_sigrestore_t sa_restorer;
171 vki_sigset_t sa_mask; /* mask last for extensibility */
174 /* On Linux we use the same type for passing sigactions to
175 and from the kernel. Hence: */
176 typedef struct vki_sigaction_base vki_sigaction_toK_t;
177 typedef struct vki_sigaction_base vki_sigaction_fromK_t;
180 typedef struct vki_sigaltstack {
186 //----------------------------------------------------------------------
187 // From linux-2.6.13/include/asm-ppc64/ptrace.h
188 //----------------------------------------------------------------------
190 #define VKI_PPC_REG unsigned long
195 VKI_PPC_REG orig_gpr3; /* Used for restarting system calls */
200 VKI_PPC_REG softe; /* Soft enabled/disabled */
201 VKI_PPC_REG trap; /* Reason for being here */
202 VKI_PPC_REG dar; /* Fault registers */
204 VKI_PPC_REG result; /* Result of a system call */
206 /* Not in kernel's definition, but apparently needed to stop
207 assertion at coredump-elf.c:267 firing. These padding words make
208 the struct have the same size as a 'vki_elf_greg_t'. See message
209 from Ghassan Hammouri on valgrind-developers on 6 April 06, and
210 also the analogous kludge for ppc32-linux (svn r5852 and bug
212 unsigned long pad[4];
215 /* Kludge? I don't know where this came from or if it is right. */
216 #define vki_user_regs_struct vki_pt_regs
228 #define VKI_PT_R10 10
229 #define VKI_PT_R11 11
230 #define VKI_PT_R12 12
231 #define VKI_PT_R13 13
232 #define VKI_PT_R14 14
233 #define VKI_PT_R15 15
234 #define VKI_PT_R16 16
235 #define VKI_PT_R17 17
236 #define VKI_PT_R18 18
237 #define VKI_PT_R19 19
238 #define VKI_PT_R20 20
239 #define VKI_PT_R21 21
240 #define VKI_PT_R22 22
241 #define VKI_PT_R23 23
242 #define VKI_PT_R24 24
243 #define VKI_PT_R25 25
244 #define VKI_PT_R26 26
245 #define VKI_PT_R27 27
246 #define VKI_PT_R28 28
247 #define VKI_PT_R29 29
248 #define VKI_PT_R30 30
249 #define VKI_PT_R31 31
250 #define VKI_PT_NIP 32
251 #define VKI_PT_MSR 33
252 #define VKI_PT_ORIG_R3 34
253 #define VKI_PT_CTR 35
254 #define VKI_PT_LNK 36
255 #define VKI_PT_XER 37
256 #define VKI_PT_CCR 38
257 #define VKI_PT_SOFTE 39
258 #define VKI_PT_RESULT 43
260 //----------------------------------------------------------------------
261 // From linux-2.6.13/include/asm-ppc64/elf.h
262 //----------------------------------------------------------------------
264 #define VKI_ELF_NGREG 48 /* includes nip, msr, lr, etc. */
265 #define VKI_ELF_NFPREG 33 /* includes fpscr */
266 #define VKI_ELF_NVRREG 34 /* includes vscr & vrsave in split vectors */
268 typedef unsigned long vki_elf_greg_t64;
269 typedef vki_elf_greg_t64 vki_elf_gregset_t64[VKI_ELF_NGREG];
271 typedef vki_elf_gregset_t64 vki_elf_gregset_t;
273 typedef double vki_elf_fpreg_t;
274 typedef vki_elf_fpreg_t vki_elf_fpregset_t[VKI_ELF_NFPREG];
276 /* Altivec registers */
278 * The entries with indexes 0-31 contain the corresponding vector registers.
279 * The entry with index 32 contains the vscr as the last word (offset 12)
280 * within the quadword. This allows the vscr to be stored as either a
281 * quadword (since it must be copied via a vector register to/from storage)
282 * or as a word. The entry with index 33 contains the vrsave as the first
283 * word (offset 0) within the quadword.
285 * This definition of the VMX state is compatible with the current PPC32
286 * ptrace interface. This allows signal handling and ptrace to use the same
287 * structures. This also simplifies the implementation of a bi-arch
288 * (combined (32- and 64-bit) gdb.
290 * Note that it's _not_ compatible with 32 bits ucontext which stuffs the
291 * vrsave along with vscr and so only uses 33 vectors for the register set
293 typedef __vki_vector128 vki_elf_vrreg_t;
294 typedef vki_elf_vrreg_t vki_elf_vrregset_t[VKI_ELF_NVRREG];
296 //----------------------------------------------------------------------
297 // From linux-2.6.13/include/asm-ppc64/sigcontext.h
298 //----------------------------------------------------------------------
300 struct vki_sigcontext {
301 unsigned long _unused[4];
304 unsigned long handler;
305 unsigned long oldmask;
306 struct vki_pt_regs __user *regs;
307 vki_elf_gregset_t gp_regs;
308 vki_elf_fpregset_t fp_regs;
310 * To maintain compatibility with current implementations the sigcontext is
311 * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t)
312 * followed by an unstructured (vmx_reserve) field of 69 doublewords. This
313 * allows the array of vector registers to be quadword aligned independent of
314 * the alignment of the containing sigcontext or ucontext. It is the
315 * responsibility of the code setting the sigcontext to set this pointer to
316 * either NULL (if this processor does not support the VMX feature) or the
317 * address of the first quadword within the allocated (vmx_reserve) area.
319 * The pointer (v_regs) of vector type (elf_vrreg_t) is type compatible with
320 * an array of 34 quadword entries (elf_vrregset_t). The entries with
321 * indexes 0-31 contain the corresponding vector registers. The entry with
322 * index 32 contains the vscr as the last word (offset 12) within the
323 * quadword. This allows the vscr to be stored as either a quadword (since
324 * it must be copied via a vector register to/from storage) or as a word.
325 * The entry with index 33 contains the vrsave as the first word (offset 0)
326 * within the quadword.
328 vki_elf_vrreg_t __user *v_regs;
329 long vmx_reserve[VKI_ELF_NVRREG+VKI_ELF_NVRREG+1];
332 //----------------------------------------------------------------------
333 // From linux-2.6.13/include/asm-ppc64/mman.h
334 //----------------------------------------------------------------------
336 #define VKI_PROT_NONE 0x0 /* page can not be accessed */
337 #define VKI_PROT_READ 0x1 /* page can be read */
338 #define VKI_PROT_WRITE 0x2 /* page can be written */
339 #define VKI_PROT_EXEC 0x4 /* page can be executed */
340 #define VKI_PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend
343 #define VKI_PROT_GROWSUP 0x02000000 /* mprotect flag: extend
347 #define VKI_MAP_SHARED 0x01 /* Share changes */
348 #define VKI_MAP_PRIVATE 0x02 /* Changes are private */
349 #define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
350 #define VKI_MAP_ANONYMOUS 0x20 /* don't use a file */
351 #define VKI_MAP_NORESERVE 0x40 /* don't reserve swap pages */
353 //----------------------------------------------------------------------
354 // From linux-2.6.13/include/asm-ppc64/fcntl.h
355 //----------------------------------------------------------------------
357 #define VKI_O_RDONLY 00
358 #define VKI_O_WRONLY 01
359 #define VKI_O_RDWR 02
360 #define VKI_O_CREAT 0100 /* not fcntl */
361 #define VKI_O_EXCL 0200 /* not fcntl */
362 #define VKI_O_TRUNC 01000 /* not fcntl */
363 #define VKI_O_APPEND 02000
364 #define VKI_O_NONBLOCK 04000
365 #define VKI_O_LARGEFILE 0200000
367 #define VKI_AT_FDCWD -100
369 #define VKI_F_DUPFD 0 /* dup */
370 #define VKI_F_GETFD 1 /* get close_on_exec */
371 #define VKI_F_SETFD 2 /* set/clear close_on_exec */
372 #define VKI_F_GETFL 3 /* get file->f_flags */
373 #define VKI_F_SETFL 4 /* set file->f_flags */
374 #define VKI_F_GETLK 5
375 #define VKI_F_SETLK 6
376 #define VKI_F_SETLKW 7
378 #define VKI_F_SETOWN 8 /* for sockets. */
379 #define VKI_F_GETOWN 9 /* for sockets. */
380 #define VKI_F_SETSIG 10 /* for sockets. */
381 #define VKI_F_GETSIG 11 /* for sockets. */
383 /* for F_[GET|SET]FL */
384 #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */
386 #define VKI_F_LINUX_SPECIFIC_BASE 1024
388 //----------------------------------------------------------------------
389 // From linux-2.6.13/include/asm-ppc64/resource.h
390 //----------------------------------------------------------------------
392 // which just does #include <asm-generic/resource.h>
394 #define VKI_RLIMIT_DATA 2 /* max data size */
395 #define VKI_RLIMIT_STACK 3 /* max stack size */
396 #define VKI_RLIMIT_CORE 4 /* max core file size */
397 #define VKI_RLIMIT_NOFILE 7 /* max number of open files */
399 //----------------------------------------------------------------------
400 // From linux-2.6.13/include/asm-ppc64/socket.h
401 //----------------------------------------------------------------------
403 #define VKI_SOL_SOCKET 1
405 #define VKI_SO_TYPE 3
407 //----------------------------------------------------------------------
408 // From linux-2.6.13/include/asm-ppc64/sockios.h
409 //----------------------------------------------------------------------
411 #define VKI_SIOCSPGRP 0x8902
412 #define VKI_SIOCGPGRP 0x8904
413 #define VKI_SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
414 #define VKI_SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
416 //----------------------------------------------------------------------
417 // From linux-2.6.13/include/asm-ppc64/stat.h
418 //----------------------------------------------------------------------
421 unsigned long st_dev;
422 unsigned long st_ino;
423 unsigned long st_nlink;
424 unsigned int st_mode;
427 unsigned long st_rdev;
429 unsigned long st_blksize;
430 unsigned long st_blocks;
431 unsigned long st_atime;
432 unsigned long st_atime_nsec;
433 unsigned long st_mtime;
434 unsigned long st_mtime_nsec;
435 unsigned long st_ctime;
436 unsigned long st_ctime_nsec;
437 unsigned long __unused4;
438 unsigned long __unused5;
439 unsigned long __unused6;
442 #define VKI_STAT_HAVE_NSEC 1
444 /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
446 unsigned long st_dev; /* Device. */
447 unsigned long st_ino; /* File serial number. */
448 unsigned int st_mode; /* File mode. */
449 unsigned int st_nlink; /* Link count. */
450 unsigned int st_uid; /* User ID of the file's owner. */
451 unsigned int st_gid; /* Group ID of the file's group. */
452 unsigned long st_rdev; /* Device number, if device. */
453 unsigned short __pad2;
454 long st_size; /* Size of file, in bytes. */
455 int st_blksize; /* Optimal block size for I/O. */
457 long st_blocks; /* Number 512-byte blocks allocated. */
458 int st_atime; /* Time of last access. */
460 int st_mtime; /* Time of last modification. */
462 int st_ctime; /* Time of last status change. */
464 unsigned int __unused4;
465 unsigned int __unused5;
468 //----------------------------------------------------------------------
469 // From linux-2.6.13/include/asm-ppc64/statfs.h
470 //----------------------------------------------------------------------
480 __vki_kernel_fsid_t f_fsid;
486 //----------------------------------------------------------------------
487 // From linux-2.6.13/include/asm-ppc64/termios.h
488 //----------------------------------------------------------------------
491 unsigned short ws_row;
492 unsigned short ws_col;
493 unsigned short ws_xpixel;
494 unsigned short ws_ypixel;
499 unsigned short c_iflag; /* input mode flags */
500 unsigned short c_oflag; /* output mode flags */
501 unsigned short c_cflag; /* control mode flags */
502 unsigned short c_lflag; /* local mode flags */
503 unsigned char c_line; /* line discipline */
504 unsigned char c_cc[VKI_NCC]; /* control characters */
507 //----------------------------------------------------------------------
508 // From linux-2.6.13/include/asm-ppc64/termbits.h
509 //----------------------------------------------------------------------
511 typedef unsigned char vki_cc_t;
512 typedef unsigned int vki_speed_t;
513 typedef unsigned int vki_tcflag_t;
517 vki_tcflag_t c_iflag; /* input mode flags */
518 vki_tcflag_t c_oflag; /* output mode flags */
519 vki_tcflag_t c_cflag; /* control mode flags */
520 vki_tcflag_t c_lflag; /* local mode flags */
521 vki_cc_t c_cc[VKI_NCCS]; /* control characters */
522 vki_cc_t c_line; /* line discipline (== c_cc[19]) */
523 vki_speed_t c_ispeed; /* input speed */
524 vki_speed_t c_ospeed; /* output speed */
527 //----------------------------------------------------------------------
528 // From linux-2.6.13/include/asm-ppc64/ioctl.h
529 //----------------------------------------------------------------------
531 #define _VKI_IOC_NRBITS 8
532 #define _VKI_IOC_TYPEBITS 8
533 #define _VKI_IOC_SIZEBITS 13
534 #define _VKI_IOC_DIRBITS 3
536 #define _VKI_IOC_NRMASK ((1 << _VKI_IOC_NRBITS)-1)
537 #define _VKI_IOC_TYPEMASK ((1 << _VKI_IOC_TYPEBITS)-1)
538 #define _VKI_IOC_SIZEMASK ((1 << _VKI_IOC_SIZEBITS)-1)
539 #define _VKI_IOC_DIRMASK ((1 << _VKI_IOC_DIRBITS)-1)
541 #define _VKI_IOC_NRSHIFT 0
542 #define _VKI_IOC_TYPESHIFT (_VKI_IOC_NRSHIFT+_VKI_IOC_NRBITS)
543 #define _VKI_IOC_SIZESHIFT (_VKI_IOC_TYPESHIFT+_VKI_IOC_TYPEBITS)
544 #define _VKI_IOC_DIRSHIFT (_VKI_IOC_SIZESHIFT+_VKI_IOC_SIZEBITS)
547 * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
548 * And this turns out useful to catch old ioctl numbers in header
551 #define _VKI_IOC_NONE 1U
552 #define _VKI_IOC_READ 2U
553 #define _VKI_IOC_WRITE 4U
555 #define _VKI_IOC(dir,type,nr,size) \
556 (((dir) << _VKI_IOC_DIRSHIFT) | \
557 ((type) << _VKI_IOC_TYPESHIFT) | \
558 ((nr) << _VKI_IOC_NRSHIFT) | \
559 ((size) << _VKI_IOC_SIZESHIFT))
561 /* provoke compile error for invalid uses of size argument */
562 #define _VKI_IOC_TYPECHECK(t) \
563 ((sizeof(t) == sizeof(t[1]) && \
564 sizeof(t) < (1 << _VKI_IOC_SIZEBITS)) \
566 : /*cause gcc to complain about division by zero*/(1/0) )
568 /* used to create numbers */
569 #define _VKI_IO(type,nr) _VKI_IOC(_VKI_IOC_NONE,(type),(nr),0)
570 #define _VKI_IOR(type,nr,size) _VKI_IOC(_VKI_IOC_READ,(type),(nr), \
571 (_VKI_IOC_TYPECHECK(size)))
572 #define _VKI_IOW(type,nr,size) _VKI_IOC(_VKI_IOC_WRITE,(type),(nr), \
573 (_VKI_IOC_TYPECHECK(size)))
574 #define _VKI_IOWR(type,nr,size) _VKI_IOC(_VKI_IOC_READ|_VKI_IOC_WRITE, \
575 (type),(nr),(_VKI_IOC_TYPECHECK(size)))
576 #define _VKI_IOR_BAD(type,nr,size) _VKI_IOC(_VKI_IOC_READ,(type),(nr), \
578 #define _VKI_IOW_BAD(type,nr,size) _VKI_IOC(_VKI_IOC_WRITE,(type),(nr), \
580 #define _VKI_IOWR_BAD(type,nr,size) _VKI_IOC(_VKI_IOC_READ|_VKI_IOC_WRITE, \
581 (type),(nr),sizeof(size))
583 /* used to decode them.. */
584 #define _VKI_IOC_DIR(nr) (((nr) >> _VKI_IOC_DIRSHIFT) & _VKI_IOC_DIRMASK)
585 #define _VKI_IOC_TYPE(nr) (((nr) >> _VKI_IOC_TYPESHIFT) & _VKI_IOC_TYPEMASK)
586 #define _VKI_IOC_NR(nr) (((nr) >> _VKI_IOC_NRSHIFT) & _VKI_IOC_NRMASK)
587 #define _VKI_IOC_SIZE(nr) (((nr) >> _VKI_IOC_SIZESHIFT) & _VKI_IOC_SIZEMASK)
589 //----------------------------------------------------------------------
590 // From linux-2.6.13/include/asm-ppc64/ioctls.h
591 //----------------------------------------------------------------------
593 #define VKI_TCGETS _VKI_IOR('t', 19, struct vki_termios)
594 #define VKI_TCSETS _VKI_IOW('t', 20, struct vki_termios)
595 #define VKI_TCSETSW _VKI_IOW('t', 21, struct vki_termios)
596 #define VKI_TCSETSF _VKI_IOW('t', 22, struct vki_termios)
597 #define VKI_TCGETA _VKI_IOR('t', 23, struct vki_termio)
598 #define VKI_TCSETA _VKI_IOW('t', 24, struct vki_termio)
599 #define VKI_TCSETAW _VKI_IOW('t', 25, struct vki_termio)
600 #define VKI_TCSETAF _VKI_IOW('t', 28, struct vki_termio)
601 #define VKI_TCSBRK _VKI_IO('t', 29)
602 #define VKI_TCXONC _VKI_IO('t', 30)
603 #define VKI_TCFLSH _VKI_IO('t', 31)
604 #define VKI_TIOCSCTTY 0x540E
605 #define VKI_TIOCGPGRP _VKI_IOR('t', 119, int)
606 #define VKI_TIOCSPGRP _VKI_IOW('t', 118, int)
607 #define VKI_TIOCOUTQ _VKI_IOR('t', 115, int) /* output queue size */
608 #define VKI_TIOCGWINSZ _VKI_IOR('t', 104, struct vki_winsize)
609 #define VKI_TIOCSWINSZ _VKI_IOW('t', 103, struct vki_winsize)
610 #define VKI_TIOCMGET 0x5415
611 #define VKI_TIOCMBIS 0x5416
612 #define VKI_TIOCMBIC 0x5417
613 #define VKI_TIOCMSET 0x5418
614 #define VKI_FIONREAD _VKI_IOR('f', 127, int)
615 #define VKI_TIOCLINUX 0x541C
616 #define VKI_FIONBIO _VKI_IOW('f', 126, int)
617 #define VKI_TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
618 #define VKI_TIOCGPTN _VKI_IOR('T',0x30, unsigned int)
619 /* Get Pty Number (of pty-mux device) */
620 #define VKI_TIOCSPTLCK _VKI_IOW('T',0x31, int) /* Lock/unlock Pty */
621 #define VKI_FIOASYNC _VKI_IOW('f', 125, int)
622 #define VKI_TIOCSERGETLSR 0x5459 /* Get line status register */
623 #define VKI_TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
625 //----------------------------------------------------------------------
626 // From linux-2.6.13/include/asm-ppc64/poll.h
627 //----------------------------------------------------------------------
629 #define VKI_POLLIN 0x0001
637 //----------------------------------------------------------------------
638 // From linux-2.6.13/include/asm-ppc64/user.h
639 //----------------------------------------------------------------------
641 // Not sure what's needed from here
643 //----------------------------------------------------------------------
644 // From linux-2.6.13/include/asm-ppc64/elf.h
645 //----------------------------------------------------------------------
647 // Not sure what's needed from here
649 //----------------------------------------------------------------------
650 // From linux-2.6.13/include/asm-ppc64/ucontext.h
651 //----------------------------------------------------------------------
653 struct vki_ucontext {
654 unsigned long uc_flags;
655 struct vki_ucontext *uc_link;
656 vki_stack_t uc_stack;
657 vki_sigset_t uc_sigmask;
658 vki_sigset_t __unused[15]; /* Allow for uc_sigmask growth */
659 struct vki_sigcontext uc_mcontext; /* last for extensibility */
662 //----------------------------------------------------------------------
663 // From linux-2.6.13/include/asm-ppc64/ipcbuf.h
664 //----------------------------------------------------------------------
666 struct vki_ipc64_perm
668 __vki_kernel_key_t key;
669 __vki_kernel_uid_t uid;
670 __vki_kernel_gid_t gid;
671 __vki_kernel_uid_t cuid;
672 __vki_kernel_gid_t cgid;
673 __vki_kernel_mode_t mode;
676 unsigned long __unused1;
677 unsigned long __unused2;
680 //----------------------------------------------------------------------
681 // From linux-2.6.13/include/asm-ppc64/sembuf.h
682 //----------------------------------------------------------------------
684 struct vki_semid64_ds {
685 struct vki_ipc64_perm sem_perm; /* permissions .. see ipc.h */
686 __vki_kernel_time_t sem_otime; /* last semop time */
687 __vki_kernel_time_t sem_ctime; /* last change time */
688 unsigned long sem_nsems; /* no. of semaphores in array */
689 unsigned long __unused1;
690 unsigned long __unused2;
693 //----------------------------------------------------------------------
694 // From linux-2.6.13/include/asm-ppc64/msgbuf.h
695 //----------------------------------------------------------------------
697 struct vki_msqid64_ds {
698 struct vki_ipc64_perm msg_perm;
699 __vki_kernel_time_t msg_stime; /* last msgsnd time */
700 __vki_kernel_time_t msg_rtime; /* last msgrcv time */
701 __vki_kernel_time_t msg_ctime; /* last change time */
702 unsigned long msg_cbytes; /* current number of bytes on queue */
703 unsigned long msg_qnum; /* number of messages in queue */
704 unsigned long msg_qbytes; /* max number of bytes on queue */
705 __vki_kernel_pid_t msg_lspid; /* pid of last msgsnd */
706 __vki_kernel_pid_t msg_lrpid; /* last receive pid */
707 unsigned long __unused1;
708 unsigned long __unused2;
711 //----------------------------------------------------------------------
712 // From linux-2.6.13/include/asm-ppc64/ipc.h
713 //----------------------------------------------------------------------
715 // this just does #include <asm-generic/ipc.h>
717 struct vki_ipc_kludge {
718 struct vki_msgbuf __user *msgp;
725 #define VKI_SEMTIMEDOP 4
726 #define VKI_MSGSND 11
727 #define VKI_MSGRCV 12
728 #define VKI_MSGGET 13
729 #define VKI_MSGCTL 14
732 #define VKI_SHMGET 23
733 #define VKI_SHMCTL 24
735 //----------------------------------------------------------------------
736 // From linux-2.6.13/include/asm-ppc64/shmbuf.h
737 //----------------------------------------------------------------------
739 struct vki_shmid64_ds {
740 struct vki_ipc64_perm shm_perm; /* operation perms */
741 __vki_kernel_time_t shm_atime; /* last attach time */
742 __vki_kernel_time_t shm_dtime; /* last detach time */
743 __vki_kernel_time_t shm_ctime; /* last change time */
744 vki_size_t shm_segsz; /* size of segment (bytes) */
745 __vki_kernel_pid_t shm_cpid; /* pid of creator */
746 __vki_kernel_pid_t shm_lpid; /* pid of last operator */
747 unsigned long shm_nattch; /* no. of current attaches */
748 unsigned long __unused1;
749 unsigned long __unused2;
752 struct vki_shminfo64 {
753 unsigned long shmmax;
754 unsigned long shmmin;
755 unsigned long shmmni;
756 unsigned long shmseg;
757 unsigned long shmall;
758 unsigned long __unused1;
759 unsigned long __unused2;
760 unsigned long __unused3;
761 unsigned long __unused4;
764 //----------------------------------------------------------------------
766 //----------------------------------------------------------------------
768 #endif // __VKI_PPC64_LINUX_H
770 /*--------------------------------------------------------------------*/
772 /*--------------------------------------------------------------------*/