Add 436413 Warn about realloc of size zero to NEWS
[valgrind.git] / docs / internals / porting-to-ARM.txt
blob8438af0e5dabeb04596b38f003ac40ee6878069a
1 =============================================================================
2 Purpose of this file
3 =============================================================================
4 In late 2004 Nick and Julian spent a little time working on the beginnings of
5 an ARM port.  IIRC it was compiling, but we never got it running at all, or if
6 we did, it didn't get very far.  Most of the required
7 arch/platform-specific functions were still empty stubs.
9 Since then, the code structure has changed a lot.  In particular, the $ARCH and
10 $PLATFORM directories have gone, and everything has been broken into much
11 more well-defined modules.  The ARM code wasn't being kept up with these
12 changes, so it has bit-rotted badly.  So now I'm pulling it all out.  But
13 there is some useful knowledge in the ARM code, and the vki*.h files are
14 fully done.  So I'm putting all the useful stuff in this file in case anyone
15 tries porting to ARM again in the future.
17 -- njn, Jul 2, 2005
19 =============================================================================
20 General
21 =============================================================================
22 You'll need to :
23 - Update Makefile.am files when you add back in the vki*.h files in include/
24   and coregrind/.
25 - Also the valgrind.spec.in file
26 - Add lots of missing cases in lots of places requiring
27   arch-/platform-specific code.  Compile errors should tell you where.
29 =============================================================================
30 configure.in
31 =============================================================================
32 You'll need to:
33 - Add appropriate arm/ test subdirs to memcheck/tests/, none/tests/,
34   cachegrind/tests/.
35 - Add arm to VG_ARCH_ALL and arm-linux to VG_PLATFORM_ALL
36 - Add it to the $VG_ARCH/$VG_PLATFORM case statements in configure.in
37 - Here's the case for the ${host_cpu} case statement:
39      arm*) 
40         AC_MSG_RESULT([ok (${host_cpu})])
41         VG_ARCH="arm"
42         KICKSTART_BASE="0xb0000000"
43         ARCH_CORE_AM_CFLAGS="-fomit-frame-pointer"
44         ARCH_TOOL_AM_CFLAGS="-fomit-frame-pointer"
45         ARCH_CORE_AM_CCASFLAGS=""
46         ;;
48 =============================================================================
49 From cachegrind/cg-arm.c
50 =============================================================================
51 void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
52                            Bool all_caches_clo_defined)
54    // XXX: I1 and D1 are vaguely plausible, although they could really be
55    // anything.  However, most (all?) ARMs don't have an L2 cache.  But
56    // Cachegrind assumes the presence of an L2 cache... so we just copy the
57    // x86 defaults.  Urk.
58    *I1c = (cache_t) {   4096, 2, 32 };
59    *D1c = (cache_t) {   4096, 2, 32 };
60    *L2c = (cache_t) { 262144, 8, 64 };
63 =============================================================================
64 From m_syswrap/syswrap-arm-linux.c
65 =============================================================================
67 /* ---------------------------------------------------------------------
68    The ARM/Linux syscall table
69    ------------------------------------------------------------------ */
71 // Macros for adding ARM/Linux-specific wrappers to the syscall table.  Note
72 // that ARM syscall numbers start at __NR_SYSCALL_BASE.
73 #define PLAX_(const, name) \
74    SYS_WRAPPER_ENTRY_X_(arm_linux, const - __NR_SYSCALL_BASE, name) 
75 #define PLAXY(const, name) \
76    SYS_WRAPPER_ENTRY_XY(arm_linux, const - __NR_SYSCALL_BASE, name) 
78 // This table maps from __NR_xxx syscall numbers (from
79 // linux/include/asm-arm/unistd.h) to the appropriate PRE/POST sys_foo()
80 // wrappers on ARM (as per sys_call_table in linux/arch/arm/kernel/entry.S).
82 // XXX: look at the x86-linux one to see how to do it.
84 const struct SyscallTableEntry ML_(syscall_table)[] = {
85    //   (restart_syscall)                             // 0
86    GENX_(__NR_exit,              sys_exit),           // 1
87    LINX_(__NR_mount,             sys_mount),          // 21
88    PLAX_(__NR_syscall,           sys_syscall),        // 113
89    PLAXY(__NR_ipc,               sys_ipc),            // 117
90    PLAX_(__NR_clone,             sys_clone),          // 120
93 const UInt ML_(syscall_table_size) = 
94             sizeof(ML_(syscall_table)) / sizeof(ML_(syscall_table)[0]);
96 =============================================================================
97 From m_scheduler/scheduler.c
98 =============================================================================
99 #elif defined(VGA_arm)
100 #  define VG_CLREQ_ARGS       guest_R0
101 #  define VG_CLREQ_RET        guest_R0
103 =============================================================================
104 From include/pub_tool_machine.h
105 =============================================================================
106 #elif defined(VGA_arm)
107 #  define VG_MIN_INSTR_SZB          4
108 #  define VG_MAX_INSTR_SZB          4 
109 #  define VG_STACK_REDZONE_SZB      0
111 =============================================================================
112 From include/pub_tool_basics.h
113 =============================================================================
114 #elif defined(VGA_arm)
115 #  define VG_REGPARM(n)            /* */
117 =============================================================================
118 From coregrind/pub_core_machine.h
119 =============================================================================
120 #elif defined(VGA_arm)
121 #  define VG_ELF_ENDIANNESS   ELFDATA2LSB
122 #  define VG_ELF_MACHINE      EM_ARM
123 #  define VG_ELF_CLASS        ELFCLASS32
125 #elif defined(VGA_arm)
126    // XXX: Not sure, but I think:
127    //   r11 = frame pointer
128    //   r12 = "implicit parameter" (neither caller-save, nor callee-save)
129    //   r13 = stack pointer
130    //   r14 = link register
131    //   r15 = program counter
132 #  define VG_INSTR_PTR        guest_R15
133 #  define VG_STACK_PTR        guest_R13
134 #  define VG_FRAME_PTR        guest_R11
136 =============================================================================
137 From coregrind/pub_core_threadstate.h
138 =============================================================================
139 #elif defined(VGA_arm)
140    typedef VexGuestARMState   VexGuestArchState;
142 =============================================================================
143 From coregrind/vki_unistd.h
144 =============================================================================
145 #elif defined(VGP_arm_linux)
146 #  include "vki_unistd-arm-linux.h" 
148 =============================================================================
149 From coregrind/m_signals.c
150 =============================================================================
151 #elif defined(VGP_arm_linux)
152 #  define VG_UCONTEXT_INSTR_PTR(uc)       ((uc)->uc_mcontext.arm_pc)
153 #  define VG_UCONTEXT_STACK_PTR(uc)       ((uc)->uc_mcontext.arm_sp)
154 #  define VG_UCONTEXT_FRAME_PTR(uc)       ((uc)->uc_mcontext.arm_fp)
155 #  define VG_UCONTEXT_SYSCALL_NUM(uc)     ((uc)->uc_mcontext.arm_r0)
156 #  error VG_UCONTEXT_SYSCALL_RET undefined for ARM/Linux
158 =============================================================================
159 From tests/arch_test.c
160 =============================================================================
161 - You'll need to add "arm" to all_archs[].
163 #ifdef __arm__
164 static Bool go(char* cpu)
166    if ( strcmp( cpu, "arm" ) == 0 )
167       return True;
168    else 
169       return False;
171 #endif // __arm__
173 =============================================================================
174 All of include/vki_posixtypes-arm-linux.h
175 =============================================================================
177 /*--------------------------------------------------------------------*/
178 /*--- ARM/Linux-specific kernel interface: posix types.            ---*/
179 /*---                                   vki_posixtypes-arm-linux.h ---*/
180 /*--------------------------------------------------------------------*/
183    This file is part of Valgrind, a dynamic binary instrumentation
184    framework.
186    Copyright (C) 2000-2005 Julian Seward 
187       jseward@acm.org
189    This program is free software; you can redistribute it and/or
190    modify it under the terms of the GNU General Public License as
191    published by the Free Software Foundation; either version 2 of the
192    License, or (at your option) any later version.
194    This program is distributed in the hope that it will be useful, but
195    WITHOUT ANY WARRANTY; without even the implied warranty of
196    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
197    General Public License for more details.
199    You should have received a copy of the GNU General Public License
200    along with this program; if not, see <http://www.gnu.org/licenses/>.
202    The GNU General Public License is contained in the file COPYING.
205 #ifndef __VKI_POSIXTYPES_ARM_LINUX_H
206 #define __VKI_POSIXTYPES_ARM_LINUX_H
208 //----------------------------------------------------------------------
209 // From linux-2.6.8.1/include/asm-i386/posix_types.h
210 //----------------------------------------------------------------------
212 typedef unsigned short          __vki_kernel_mode_t;
213 typedef long                    __vki_kernel_off_t;
214 typedef int                     __vki_kernel_pid_t;
215 typedef unsigned short          __vki_kernel_ipc_pid_t;
216 typedef unsigned short          __vki_kernel_uid_t;
217 typedef unsigned short          __vki_kernel_gid_t;
218 typedef unsigned int            __vki_kernel_size_t;
219 typedef long                    __vki_kernel_time_t;
220 typedef long                    __vki_kernel_suseconds_t;
221 typedef long                    __vki_kernel_clock_t;
222 typedef int                     __vki_kernel_timer_t;
223 typedef int                     __vki_kernel_clockid_t;
224 typedef char *                  __vki_kernel_caddr_t;
225 typedef unsigned int            __vki_kernel_uid32_t;
226 typedef unsigned int            __vki_kernel_gid32_t;
228 typedef unsigned short          __vki_kernel_old_uid_t;
229 typedef unsigned short          __vki_kernel_old_gid_t;
231 typedef long long               __vki_kernel_loff_t;
233 typedef struct {
234         int     val[2];
235 } __vki_kernel_fsid_t;
237 #endif // __VKI_POSIXTYPES_ARM_LINUX_H
239 /*--------------------------------------------------------------------*/
240 /*--- end                                                          ---*/
241 /*--------------------------------------------------------------------*/
243 =============================================================================
244 All of include/vki-arm-linux.h
245 =============================================================================
247 /*--------------------------------------------------------------------*/
248 /*--- ARM/Linux-specific kernel interface.         vki-arm-linux.h ---*/
249 /*--------------------------------------------------------------------*/
252    This file is part of Valgrind, a dynamic binary instrumentation
253    framework.
255    Copyright (C) 2000-2005 Julian Seward 
256       jseward@acm.org
258    This program is free software; you can redistribute it and/or
259    modify it under the terms of the GNU General Public License as
260    published by the Free Software Foundation; either version 2 of the
261    License, or (at your option) any later version.
263    This program is distributed in the hope that it will be useful, but
264    WITHOUT ANY WARRANTY; without even the implied warranty of
265    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
266    General Public License for more details.
268    You should have received a copy of the GNU General Public License
269    along with this program; if not, see <http://www.gnu.org/licenses/>.
271    The GNU General Public License is contained in the file COPYING.
274 #ifndef __VKI_ARM_LINUX_H
275 #define __VKI_ARM_LINUX_H
277 // ARM can be big or little endian;  we're only supporting little endian.  
278 #define VKI_LITTLE_ENDIAN  1
280 //----------------------------------------------------------------------
281 // From linux-2.6.9/include/asm-arm/types.h
282 //----------------------------------------------------------------------
284 typedef unsigned char __vki_u8;
286 typedef __signed__ short __vki_s16;
287 typedef unsigned short __vki_u16;
289 typedef unsigned int __vki_u32;
291 typedef __signed__ long long __vki_s64;
292 typedef unsigned long long __vki_u64;
294 typedef unsigned short vki_u16;
296 typedef unsigned int vki_u32;
298 //----------------------------------------------------------------------
299 // From linux-2.6.9/include/asm-arm/page.h
300 //----------------------------------------------------------------------
302 #define VKI_PAGE_SHIFT          12
303 #define VKI_PAGE_SIZE           (1UL << VKI_PAGE_SHIFT)
305 //----------------------------------------------------------------------
306 // From linux-2.6.9/include/asm-arm/signal.h
307 //----------------------------------------------------------------------
309 #define _VKI_NSIG       64
310 #define _VKI_NSIG_BPW   32
311 #define _VKI_NSIG_WORDS (_VKI_NSIG / _VKI_NSIG_BPW)
313 typedef unsigned long vki_old_sigset_t;         /* at least 32 bits */
315 typedef struct {
316         unsigned long sig[_VKI_NSIG_WORDS];
317 } vki_sigset_t;
319 #define VKI_SIGHUP               1
320 #define VKI_SIGINT               2
321 #define VKI_SIGQUIT              3
322 #define VKI_SIGILL               4
323 #define VKI_SIGTRAP              5
324 #define VKI_SIGABRT              6
325 //#define VKI_SIGIOT             6
326 #define VKI_SIGBUS               7
327 #define VKI_SIGFPE               8
328 #define VKI_SIGKILL              9
329 #define VKI_SIGUSR1             10
330 #define VKI_SIGSEGV             11
331 #define VKI_SIGUSR2             12
332 #define VKI_SIGPIPE             13
333 #define VKI_SIGALRM             14
334 #define VKI_SIGTERM             15
335 #define VKI_SIGSTKFLT   16
336 #define VKI_SIGCHLD             17
337 #define VKI_SIGCONT             18
338 #define VKI_SIGSTOP             19
339 #define VKI_SIGTSTP             20
340 #define VKI_SIGTTIN             21
341 #define VKI_SIGTTOU             22
342 #define VKI_SIGURG              23
343 #define VKI_SIGXCPU             24
344 #define VKI_SIGXFSZ             25
345 #define VKI_SIGVTALRM   26
346 #define VKI_SIGPROF             27
347 #define VKI_SIGWINCH    28
348 #define VKI_SIGIO               29
349 #define VKI_SIGPWR              30
350 #define VKI_SIGSYS              31
351 #define VKI_SIGUNUSED   31
353 /* These should not be considered constants from userland.  */
354 #define VKI_SIGRTMIN    32
355 #define VKI_SIGRTMAX    _VKI_NSIG
357 #define VKI_SIGSWI              32
359 #define VKI_SA_NOCLDSTOP        0x00000001
360 #define VKI_SA_NOCLDWAIT        0x00000002
361 #define VKI_SA_SIGINFO  0x00000004
362 //#define VKI_SA_THIRTYTWO      0x02000000
363 #define VKI_SA_RESTORER 0x04000000
364 #define VKI_SA_ONSTACK  0x08000000
365 #define VKI_SA_RESTART  0x10000000
366 #define VKI_SA_NODEFER  0x40000000
367 #define VKI_SA_RESETHAND        0x80000000
369 #define VKI_SA_NOMASK   VKI_SA_NODEFER
370 #define VKI_SA_ONESHOT  VKI_SA_RESETHAND
371 //#define VKI_SA_INTERRUPT      0x20000000 /* dummy -- ignored */
374 #define VKI_SS_ONSTACK  1
375 #define VKI_SS_DISABLE  2
377 #define VKI_MINSIGSTKSZ 2048
379 #define VKI_SIG_BLOCK          0        /* for blocking signals */
380 #define VKI_SIG_UNBLOCK        1        /* for unblocking signals */
381 #define VKI_SIG_SETMASK        2        /* for setting the signal mask */
383 /* Type of a signal handler.  */
384 typedef void __vki_signalfn_t(int);
385 typedef __vki_signalfn_t __user *__vki_sighandler_t;
387 typedef void __vki_restorefn_t(void);
388 typedef __vki_restorefn_t __user *__vki_sigrestore_t;
390 #define VKI_SIG_DFL     ((__vki_sighandler_t)0) /* default signal handling */
391 #define VKI_SIG_IGN     ((__vki_sighandler_t)1) /* ignore signal */
393 struct vki_old_sigaction {
394         // [[Nb: a 'k' prefix is added to "sa_handler" because
395         // bits/sigaction.h (which gets dragged in somehow via signal.h)
396         // #defines it as something else.  Since that is done for glibc's
397         // purposes, which we don't care about here, we use our own name.]]
398         __vki_sighandler_t ksa_handler;
399         vki_old_sigset_t sa_mask;
400         unsigned long sa_flags;
401         __vki_sigrestore_t sa_restorer;
404 struct vki_sigaction {
405         // [[See comment about extra 'k' above]]
406         __vki_sighandler_t ksa_handler;
407         unsigned long sa_flags;
408         __vki_sigrestore_t sa_restorer;
409         vki_sigset_t sa_mask;           /* mask last for extensibility */
412 typedef struct vki_sigaltstack {
413         void __user *ss_sp;
414         int ss_flags;
415         vki_size_t ss_size;
416 } vki_stack_t;
418 //----------------------------------------------------------------------
419 // From linux-2.6.9/include/asm-arm/sigcontext.h
420 //----------------------------------------------------------------------
422 struct vki_sigcontext {
423         unsigned long trap_no;
424         unsigned long error_code;
425         unsigned long oldmask;
426         unsigned long arm_r0;
427         unsigned long arm_r1;
428         unsigned long arm_r2;
429         unsigned long arm_r3;
430         unsigned long arm_r4;
431         unsigned long arm_r5;
432         unsigned long arm_r6;
433         unsigned long arm_r7;
434         unsigned long arm_r8;
435         unsigned long arm_r9;
436         unsigned long arm_r10;
437         unsigned long arm_fp;
438         unsigned long arm_ip;
439         unsigned long arm_sp;
440         unsigned long arm_lr;
441         unsigned long arm_pc;
442         unsigned long arm_cpsr;
443         unsigned long fault_address;
446 //----------------------------------------------------------------------
447 // From linux-2.6.9/include/asm-arm/mman.h
448 //----------------------------------------------------------------------
450 #define VKI_PROT_READ   0x1             /* page can be read */
451 #define VKI_PROT_WRITE  0x2             /* page can be written */
452 #define VKI_PROT_EXEC   0x4             /* page can be executed */
453 //#define VKI_PROT_SEM  0x8             /* page may be used for atomic ops */
454 //#define VKI_PROT_NONE 0x0             /* page can not be accessed */
456 #define VKI_MAP_SHARED  0x01            /* Share changes */
457 #define VKI_MAP_PRIVATE 0x02            /* Changes are private */
458 #define VKI_MAP_TYPE    0x0f            /* Mask for type of mapping */
459 #define VKI_MAP_FIXED   0x10            /* Interpret addr exactly */
460 #define VKI_MAP_ANONYMOUS       0x20    /* don't use a file */
462 //----------------------------------------------------------------------
463 // From linux-2.6.9/include/asm-arm/fcntl.h
464 //----------------------------------------------------------------------
466 #define VKI_O_RDONLY         00
467 #define VKI_O_WRONLY         01
468 #define VKI_O_CREAT        0100 /* not fcntl */
469 #define VKI_O_EXCL         0200 /* not fcntl */
470 #define VKI_O_TRUNC       01000 /* not fcntl */
471 #define VKI_O_NONBLOCK    04000
473 #define VKI_F_DUPFD     0       /* dup */
474 #define VKI_F_GETFD     1       /* get close_on_exec */
475 #define VKI_F_SETFD     2       /* set/clear close_on_exec */
476 #define VKI_F_GETFL     3       /* get file->f_flags */
477 #define VKI_F_SETFL     4       /* set file->f_flags */
478 #define VKI_F_GETLK     5
479 #define VKI_F_SETLK     6
480 #define VKI_F_SETLKW    7
482 #define VKI_F_SETOWN    8       /*  for sockets. */
483 #define VKI_F_GETOWN    9       /*  for sockets. */
484 #define VKI_F_SETSIG    10      /*  for sockets. */
485 #define VKI_F_GETSIG    11      /*  for sockets. */
487 #define VKI_F_GETLK64   12      /*  using 'struct flock64' */
488 #define VKI_F_SETLK64   13
489 #define VKI_F_SETLKW64  14
491 /* for F_[GET|SET]FL */
492 #define VKI_FD_CLOEXEC  1       /* actually anything with low bit set goes */
494 #define VKI_F_LINUX_SPECIFIC_BASE       1024
496 //----------------------------------------------------------------------
497 // From linux-2.6.9/include/asm-arm/resource.h
498 //----------------------------------------------------------------------
500 #define VKI_RLIMIT_DATA         2       /* max data size */
501 #define VKI_RLIMIT_STACK        3       /* max stack size */
502 #define VKI_RLIMIT_CORE         4       /* max core file size */
503 #define VKI_RLIMIT_NOFILE       7       /* max number of open files */
505 //----------------------------------------------------------------------
506 // From linux-2.6.9/include/asm-arm/socket.h
507 //----------------------------------------------------------------------
509 #define VKI_SOL_SOCKET  1
511 #define VKI_SO_TYPE     3
513 //----------------------------------------------------------------------
514 // From linux-2.6.9/include/asm-arm/sockios.h
515 //----------------------------------------------------------------------
517 #define VKI_SIOCSPGRP   0x8902
518 #define VKI_SIOCGPGRP   0x8904
519 #define VKI_SIOCGSTAMP  0x8906          /* Get stamp */
521 //----------------------------------------------------------------------
522 // From linux-2.6.9/include/asm-arm/stat.h
523 //----------------------------------------------------------------------
525 // [[Nb: resolved some #ifdefs by assuming __ARMEB__ is false, ie. that
526 // we're not big-endian.]]
527 struct vki_stat {
528         unsigned long  st_dev;
529         unsigned long  st_ino;
530         unsigned short st_mode;
531         unsigned short st_nlink;
532         unsigned short st_uid;
533         unsigned short st_gid;
534         unsigned long  st_rdev;
535         unsigned long  st_size;
536         unsigned long  st_blksize;
537         unsigned long  st_blocks;
538         unsigned long  st_atime;
539         unsigned long  st_atime_nsec;
540         unsigned long  st_mtime;
541         unsigned long  st_mtime_nsec;
542         unsigned long  st_ctime;
543         unsigned long  st_ctime_nsec;
544         unsigned long  __unused4;
545         unsigned long  __unused5;
548 struct vki_stat64 {
549         unsigned long long      st_dev;
550         unsigned char   __pad0[4];
552 #define STAT64_HAS_BROKEN_ST_INO        1
553         unsigned long   __st_ino;
554         unsigned int    st_mode;
555         unsigned int    st_nlink;
557         unsigned long   st_uid;
558         unsigned long   st_gid;
560         unsigned long long      st_rdev;
561         unsigned char   __pad3[4];
563         long long       st_size;
564         unsigned long   st_blksize;
566         unsigned long   st_blocks;      /* Number 512-byte blocks allocated. */
567         unsigned long   __pad4;         /* Future possible st_blocks hi bits */
569         unsigned long   st_atime;
570         unsigned long   st_atime_nsec;
572         unsigned long   st_mtime;
573         unsigned long   st_mtime_nsec;
575         unsigned long   st_ctime;
576         unsigned long   st_ctime_nsec;
578         unsigned long long      st_ino;
581 //----------------------------------------------------------------------
582 // From linux-2.6.9/include/asm-arm/statfs.h
583 //----------------------------------------------------------------------
585 // [[Nb: asm-arm/statfs.h just #include asm-generic/statfs.h directly]]
586 struct vki_statfs {
587         __vki_u32 f_type;
588         __vki_u32 f_bsize;
589         __vki_u32 f_blocks;
590         __vki_u32 f_bfree;
591         __vki_u32 f_bavail;
592         __vki_u32 f_files;
593         __vki_u32 f_ffree;
594         __vki_kernel_fsid_t f_fsid;
595         __vki_u32 f_namelen;
596         __vki_u32 f_frsize;
597         __vki_u32 f_spare[5];
600 //----------------------------------------------------------------------
601 // From linux-2.6.9/include/asm-arm/termios.h
602 //----------------------------------------------------------------------
604 struct vki_winsize {
605         unsigned short ws_row;
606         unsigned short ws_col;
607         unsigned short ws_xpixel;
608         unsigned short ws_ypixel;
611 #define VKI_NCC 8
612 struct vki_termio {
613         unsigned short c_iflag;         /* input mode flags */
614         unsigned short c_oflag;         /* output mode flags */
615         unsigned short c_cflag;         /* control mode flags */
616         unsigned short c_lflag;         /* local mode flags */
617         unsigned char c_line;           /* line discipline */
618         unsigned char c_cc[VKI_NCC];    /* control characters */
621 //----------------------------------------------------------------------
622 // From linux-2.6.9/include/asm-arm/termbits.h
623 //----------------------------------------------------------------------
625 typedef unsigned char   vki_cc_t;
626 typedef unsigned int    vki_tcflag_t;
628 #define VKI_NCCS 19
629 struct vki_termios {
630         vki_tcflag_t c_iflag;           /* input mode flags */
631         vki_tcflag_t c_oflag;           /* output mode flags */
632         vki_tcflag_t c_cflag;           /* control mode flags */
633         vki_tcflag_t c_lflag;           /* local mode flags */
634         vki_cc_t c_line;                /* line discipline */
635         vki_cc_t c_cc[VKI_NCCS];        /* control characters */
638 //----------------------------------------------------------------------
639 // From linux-2.6.9/include/asm-arm/ioctl.h
640 //----------------------------------------------------------------------
642 #define _VKI_IOC_NRBITS         8
643 #define _VKI_IOC_TYPEBITS       8
644 #define _VKI_IOC_SIZEBITS       14
645 #define _VKI_IOC_DIRBITS        2
647 #define _VKI_IOC_SIZEMASK       ((1 << _VKI_IOC_SIZEBITS)-1)
648 #define _VKI_IOC_DIRMASK        ((1 << _VKI_IOC_DIRBITS)-1)
650 #define _VKI_IOC_NRSHIFT        0
651 #define _VKI_IOC_TYPESHIFT      (_VKI_IOC_NRSHIFT+_VKI_IOC_NRBITS)
652 #define _VKI_IOC_SIZESHIFT      (_VKI_IOC_TYPESHIFT+_VKI_IOC_TYPEBITS)
653 #define _VKI_IOC_DIRSHIFT       (_VKI_IOC_SIZESHIFT+_VKI_IOC_SIZEBITS)
655 #define _VKI_IOC_NONE   0U
656 #define _VKI_IOC_WRITE  1U
657 #define _VKI_IOC_READ   2U
659 #define _VKI_IOC(dir,type,nr,size) \
660         (((dir)  << _VKI_IOC_DIRSHIFT) | \
661          ((type) << _VKI_IOC_TYPESHIFT) | \
662          ((nr)   << _VKI_IOC_NRSHIFT) | \
663          ((size) << _VKI_IOC_SIZESHIFT))
665 /* used to create numbers */
666 #define _VKI_IO(type,nr)        _VKI_IOC(_VKI_IOC_NONE,(type),(nr),0)
667 #define _VKI_IOR(type,nr,size)  _VKI_IOC(_VKI_IOC_READ,(type),(nr),sizeof(size))
668 #define _VKI_IOW(type,nr,size)  _VKI_IOC(_VKI_IOC_WRITE,(type),(nr),sizeof(size))
669 #define _VKI_IOWR(type,nr,size) _VKI_IOC(_VKI_IOC_READ|_VKI_IOC_WRITE,(type),(nr),sizeof(size))
671 /* used to decode ioctl numbers.. */
672 #define _VKI_IOC_DIR(nr)        (((nr) >> _VKI_IOC_DIRSHIFT) & _VKI_IOC_DIRMASK)
673 #define _VKI_IOC_SIZE(nr)       (((nr) >> _VKI_IOC_SIZESHIFT) & _VKI_IOC_SIZEMASK)
675 //----------------------------------------------------------------------
676 // From linux-2.6.9/include/asm-arm/ioctls.h
677 //----------------------------------------------------------------------
679 #define VKI_TCGETS      0x5401
680 #define VKI_TCSETS      0x5402
681 #define VKI_TCSETSW     0x5403
682 #define VKI_TCSETSF     0x5404
683 #define VKI_TCGETA      0x5405
684 #define VKI_TCSETA      0x5406
685 #define VKI_TCSETAW     0x5407
686 #define VKI_TCSETAF     0x5408
687 #define VKI_TCSBRK      0x5409
688 #define VKI_TCXONC      0x540A
689 #define VKI_TCFLSH      0x540B
690 #define VKI_TIOCSCTTY   0x540E
691 #define VKI_TIOCGPGRP   0x540F
692 #define VKI_TIOCSPGRP   0x5410
693 #define VKI_TIOCOUTQ    0x5411
694 #define VKI_TIOCGWINSZ  0x5413
695 #define VKI_TIOCSWINSZ  0x5414
696 #define VKI_TIOCMBIS    0x5416
697 #define VKI_TIOCMBIC    0x5417
698 #define VKI_TIOCMSET    0x5418
699 #define VKI_FIONREAD    0x541B
700 #define VKI_TIOCLINUX   0x541C
701 #define VKI_FIONBIO     0x5421
702 #define VKI_TCSBRKP     0x5425  /* Needed for POSIX tcsendbreak() */
703 #define VKI_TIOCGPTN    _VKI_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
704 #define VKI_TIOCSPTLCK  _VKI_IOW('T',0x31, int)  /* Lock/unlock Pty */
706 #define VKI_FIOASYNC    0x5452
708 //----------------------------------------------------------------------
709 // From linux-2.6.9/include/asm-arm/poll.h
710 //----------------------------------------------------------------------
712 #define VKI_POLLIN      0x0001
714 struct vki_pollfd {
715         int fd;
716         short events;
717         short revents;
720 //----------------------------------------------------------------------
721 // From linux-2.6.9/include/asm-arm/user.h
722 //----------------------------------------------------------------------
724 // XXX: For x86, had here:
725 //   struct vki_user_i387_struct
726 //   struct vki_user_fxsr_struct
727 //   struct vki_user_regs_struct
729 //----------------------------------------------------------------------
730 // From linux-2.6.9/include/asm-arm/ptrace.h
731 //----------------------------------------------------------------------
733 struct vki_pt_regs {
734         long uregs[18];
737 //----------------------------------------------------------------------
738 // From linux-2.6.9/include/asm-arm/elf.h
739 //----------------------------------------------------------------------
741 typedef unsigned long vki_elf_greg_t;
743 #define VKI_ELF_NGREG (sizeof (struct vki_pt_regs) / sizeof(vki_elf_greg_t))
744 typedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG];
746 //----------------------------------------------------------------------
747 // From linux-2.6.9/include/asm-arm/ucontext.h
748 //----------------------------------------------------------------------
750 struct vki_ucontext {
751         unsigned long           uc_flags;
752         struct vki_ucontext    *uc_link;
753         vki_stack_t             uc_stack;
754         struct vki_sigcontext   uc_mcontext;
755         vki_sigset_t            uc_sigmask;     /* mask last for extensibility */
758 //----------------------------------------------------------------------
759 // From linux-2.6.9/include/asm-arm/ipcbuf.h
760 //----------------------------------------------------------------------
762 struct vki_ipc64_perm
764         __vki_kernel_key_t      key;
765         __vki_kernel_uid32_t    uid;
766         __vki_kernel_gid32_t    gid;
767         __vki_kernel_uid32_t    cuid;
768         __vki_kernel_gid32_t    cgid;
769         __vki_kernel_mode_t     mode;
770         unsigned short          __pad1;
771         unsigned short          seq;
772         unsigned short          __pad2;
773         unsigned long           __unused1;
774         unsigned long           __unused2;
777 //----------------------------------------------------------------------
778 // From linux-2.6.9/include/asm-arm/sembuf.h
779 //----------------------------------------------------------------------
781 struct vki_semid64_ds {
782         struct vki_ipc64_perm sem_perm;         /* permissions .. see ipc.h */
783         __vki_kernel_time_t     sem_otime;              /* last semop time */
784         unsigned long   __unused1;
785         __vki_kernel_time_t     sem_ctime;              /* last change time */
786         unsigned long   __unused2;
787         unsigned long   sem_nsems;              /* no. of semaphores in array */
788         unsigned long   __unused3;
789         unsigned long   __unused4;
793 //----------------------------------------------------------------------
794 // From linux-2.6.9/include/asm-arm/msgbuf.h
795 //----------------------------------------------------------------------
797 struct vki_msqid64_ds {
798         struct vki_ipc64_perm msg_perm;
799         __vki_kernel_time_t msg_stime;  /* last msgsnd time */
800         unsigned long   __unused1;
801         __vki_kernel_time_t msg_rtime;  /* last msgrcv time */
802         unsigned long   __unused2;
803         __vki_kernel_time_t msg_ctime;  /* last change time */
804         unsigned long   __unused3;
805         unsigned long  msg_cbytes;      /* current number of bytes on queue */
806         unsigned long  msg_qnum;        /* number of messages in queue */
807         unsigned long  msg_qbytes;      /* max number of bytes on queue */
808         __vki_kernel_pid_t msg_lspid;   /* pid of last msgsnd */
809         __vki_kernel_pid_t msg_lrpid;   /* last receive pid */
810         unsigned long  __unused4;
811         unsigned long  __unused5;
814 //----------------------------------------------------------------------
815 // From linux-2.6.9/include/asm-arm/ipc.h
816 //----------------------------------------------------------------------
818 struct vki_ipc_kludge {
819         struct vki_msgbuf __user *msgp;
820         long msgtyp;
823 //----------------------------------------------------------------------
824 // From linux-2.6.9/include/asm-arm/shmbuf.h
825 //----------------------------------------------------------------------
827 struct vki_shmid64_ds {
828         struct vki_ipc64_perm   shm_perm;       /* operation perms */
829         vki_size_t              shm_segsz;      /* size of segment (bytes) */
830         __vki_kernel_time_t     shm_atime;      /* last attach time */
831         unsigned long           __unused1;
832         __vki_kernel_time_t     shm_dtime;      /* last detach time */
833         unsigned long           __unused2;
834         __vki_kernel_time_t     shm_ctime;      /* last change time */
835         unsigned long           __unused3;
836         __vki_kernel_pid_t      shm_cpid;       /* pid of creator */
837         __vki_kernel_pid_t      shm_lpid;       /* pid of last operator */
838         unsigned long           shm_nattch;     /* no. of current attaches */
839         unsigned long           __unused4;
840         unsigned long           __unused5;
843 struct vki_shminfo64 {
844         unsigned long   shmmax;
845         unsigned long   shmmin;
846         unsigned long   shmmni;
847         unsigned long   shmseg;
848         unsigned long   shmall;
849         unsigned long   __unused1;
850         unsigned long   __unused2;
851         unsigned long   __unused3;
852         unsigned long   __unused4;
855 //----------------------------------------------------------------------
856 // And that's it!
857 //----------------------------------------------------------------------
859 #endif // __VKI_ARM_LINUX_H
861 /*--------------------------------------------------------------------*/
862 /*--- end                                                          ---*/
863 /*--------------------------------------------------------------------*/
865 =============================================================================
866 All of coregrind/vki_unistd-arm-linux.h
867 =============================================================================
870    This file is part of Valgrind, a dynamic binary instrumentation
871    framework.
873    Copyright (C) 2000-2005 Julian Seward 
874       jseward@acm.org
876    This program is free software; you can redistribute it and/or
877    modify it under the terms of the GNU General Public License as
878    published by the Free Software Foundation; either version 2 of the
879    License, or (at your option) any later version.
881    This program is distributed in the hope that it will be useful, but
882    WITHOUT ANY WARRANTY; without even the implied warranty of
883    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
884    General Public License for more details.
886    You should have received a copy of the GNU General Public License
887    along with this program; if not, see <http://www.gnu.org/licenses/>.
889    The GNU General Public License is contained in the file COPYING.
892 #ifndef __VKI_UNISTD_ARM_LINUX_H
893 #define __VKI_UNISTD_ARM_LINUX_H
895 // From linux-2.6.8.1/include/asm-arm/unistd.h
897 // Nb: ARM Thumb has a different __NR_SYSCALL_BASE, but we don't care about
898 //     that architecture.
899 #define __NR_SYSCALL_BASE       0x900000
901 #define __NR_restart_syscall            (__NR_SYSCALL_BASE+  0)
902 #define __NR_exit                       (__NR_SYSCALL_BASE+  1)
903 #define __NR_fork                       (__NR_SYSCALL_BASE+  2)
904 #define __NR_read                       (__NR_SYSCALL_BASE+  3)
905 #define __NR_write                      (__NR_SYSCALL_BASE+  4)
906 #define __NR_open                       (__NR_SYSCALL_BASE+  5)
907 #define __NR_close                      (__NR_SYSCALL_BASE+  6)
908                                         /* 7 was sys_waitpid */
909 #define __NR_creat                      (__NR_SYSCALL_BASE+  8)
910 #define __NR_link                       (__NR_SYSCALL_BASE+  9)
911 #define __NR_unlink                     (__NR_SYSCALL_BASE+ 10)
912 #define __NR_execve                     (__NR_SYSCALL_BASE+ 11)
913 #define __NR_chdir                      (__NR_SYSCALL_BASE+ 12)
914 #define __NR_time                       (__NR_SYSCALL_BASE+ 13)
915 #define __NR_mknod                      (__NR_SYSCALL_BASE+ 14)
916 #define __NR_chmod                      (__NR_SYSCALL_BASE+ 15)
917 #define __NR_lchown                     (__NR_SYSCALL_BASE+ 16)
918                                         /* 17 was sys_break */
919                                         /* 18 was sys_stat */
920 #define __NR_lseek                      (__NR_SYSCALL_BASE+ 19)
921 #define __NR_getpid                     (__NR_SYSCALL_BASE+ 20)
922 #define __NR_mount                      (__NR_SYSCALL_BASE+ 21)
923 #define __NR_umount                     (__NR_SYSCALL_BASE+ 22)
924 #define __NR_setuid                     (__NR_SYSCALL_BASE+ 23)
925 #define __NR_getuid                     (__NR_SYSCALL_BASE+ 24)
926 #define __NR_stime                      (__NR_SYSCALL_BASE+ 25)
927 #define __NR_ptrace                     (__NR_SYSCALL_BASE+ 26)
928 #define __NR_alarm                      (__NR_SYSCALL_BASE+ 27)
929                                         /* 28 was sys_fstat */
930 #define __NR_pause                      (__NR_SYSCALL_BASE+ 29)
931 #define __NR_utime                      (__NR_SYSCALL_BASE+ 30)
932                                         /* 31 was sys_stty */
933                                         /* 32 was sys_gtty */
934 #define __NR_access                     (__NR_SYSCALL_BASE+ 33)
935 #define __NR_nice                       (__NR_SYSCALL_BASE+ 34)
936                                         /* 35 was sys_ftime */
937 #define __NR_sync                       (__NR_SYSCALL_BASE+ 36)
938 #define __NR_kill                       (__NR_SYSCALL_BASE+ 37)
939 #define __NR_rename                     (__NR_SYSCALL_BASE+ 38)
940 #define __NR_mkdir                      (__NR_SYSCALL_BASE+ 39)
941 #define __NR_rmdir                      (__NR_SYSCALL_BASE+ 40)
942 #define __NR_dup                        (__NR_SYSCALL_BASE+ 41)
943 #define __NR_pipe                       (__NR_SYSCALL_BASE+ 42)
944 #define __NR_times                      (__NR_SYSCALL_BASE+ 43)
945                                         /* 44 was sys_prof */
946 #define __NR_brk                        (__NR_SYSCALL_BASE+ 45)
947 #define __NR_setgid                     (__NR_SYSCALL_BASE+ 46)
948 #define __NR_getgid                     (__NR_SYSCALL_BASE+ 47)
949                                         /* 48 was sys_signal */
950 #define __NR_geteuid                    (__NR_SYSCALL_BASE+ 49)
951 #define __NR_getegid                    (__NR_SYSCALL_BASE+ 50)
952 #define __NR_acct                       (__NR_SYSCALL_BASE+ 51)
953 #define __NR_umount2                    (__NR_SYSCALL_BASE+ 52)
954                                         /* 53 was sys_lock */
955 #define __NR_ioctl                      (__NR_SYSCALL_BASE+ 54)
956 #define __NR_fcntl                      (__NR_SYSCALL_BASE+ 55)
957                                         /* 56 was sys_mpx */
958 #define __NR_setpgid                    (__NR_SYSCALL_BASE+ 57)
959                                         /* 58 was sys_ulimit */
960                                         /* 59 was sys_olduname */
961 #define __NR_umask                      (__NR_SYSCALL_BASE+ 60)
962 #define __NR_chroot                     (__NR_SYSCALL_BASE+ 61)
963 #define __NR_ustat                      (__NR_SYSCALL_BASE+ 62)
964 #define __NR_dup2                       (__NR_SYSCALL_BASE+ 63)
965 #define __NR_getppid                    (__NR_SYSCALL_BASE+ 64)
966 #define __NR_getpgrp                    (__NR_SYSCALL_BASE+ 65)
967 #define __NR_setsid                     (__NR_SYSCALL_BASE+ 66)
968 #define __NR_sigaction                  (__NR_SYSCALL_BASE+ 67)
969                                         /* 68 was sys_sgetmask */
970                                         /* 69 was sys_ssetmask */
971 #define __NR_setreuid                   (__NR_SYSCALL_BASE+ 70)
972 #define __NR_setregid                   (__NR_SYSCALL_BASE+ 71)
973 #define __NR_sigsuspend                 (__NR_SYSCALL_BASE+ 72)
974 #define __NR_sigpending                 (__NR_SYSCALL_BASE+ 73)
975 #define __NR_sethostname                (__NR_SYSCALL_BASE+ 74)
976 #define __NR_setrlimit                  (__NR_SYSCALL_BASE+ 75)
977 #define __NR_getrlimit                  (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
978 #define __NR_getrusage                  (__NR_SYSCALL_BASE+ 77)
979 #define __NR_gettimeofday               (__NR_SYSCALL_BASE+ 78)
980 #define __NR_settimeofday               (__NR_SYSCALL_BASE+ 79)
981 #define __NR_getgroups                  (__NR_SYSCALL_BASE+ 80)
982 #define __NR_setgroups                  (__NR_SYSCALL_BASE+ 81)
983 #define __NR_select                     (__NR_SYSCALL_BASE+ 82)
984 #define __NR_symlink                    (__NR_SYSCALL_BASE+ 83)
985                                         /* 84 was sys_lstat */
986 #define __NR_readlink                   (__NR_SYSCALL_BASE+ 85)
987 #define __NR_uselib                     (__NR_SYSCALL_BASE+ 86)
988 #define __NR_swapon                     (__NR_SYSCALL_BASE+ 87)
989 #define __NR_reboot                     (__NR_SYSCALL_BASE+ 88)
990 #define __NR_readdir                    (__NR_SYSCALL_BASE+ 89)
991 #define __NR_mmap                       (__NR_SYSCALL_BASE+ 90)
992 #define __NR_munmap                     (__NR_SYSCALL_BASE+ 91)
993 #define __NR_truncate                   (__NR_SYSCALL_BASE+ 92)
994 #define __NR_ftruncate                  (__NR_SYSCALL_BASE+ 93)
995 #define __NR_fchmod                     (__NR_SYSCALL_BASE+ 94)
996 #define __NR_fchown                     (__NR_SYSCALL_BASE+ 95)
997 #define __NR_getpriority                (__NR_SYSCALL_BASE+ 96)
998 #define __NR_setpriority                (__NR_SYSCALL_BASE+ 97)
999                                         /* 98 was sys_profil */
1000 #define __NR_statfs                     (__NR_SYSCALL_BASE+ 99)
1001 #define __NR_fstatfs                    (__NR_SYSCALL_BASE+100)
1002                                         /* 101 was sys_ioperm */
1003 #define __NR_socketcall                 (__NR_SYSCALL_BASE+102)
1004 #define __NR_syslog                     (__NR_SYSCALL_BASE+103)
1005 #define __NR_setitimer                  (__NR_SYSCALL_BASE+104)
1006 #define __NR_getitimer                  (__NR_SYSCALL_BASE+105)
1007 #define __NR_stat                       (__NR_SYSCALL_BASE+106)
1008 #define __NR_lstat                      (__NR_SYSCALL_BASE+107)
1009 #define __NR_fstat                      (__NR_SYSCALL_BASE+108)
1010                                         /* 109 was sys_uname */
1011                                         /* 110 was sys_iopl */
1012 #define __NR_vhangup                    (__NR_SYSCALL_BASE+111)
1013                                         /* 112 was sys_idle */
1014 #define __NR_syscall                    (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
1015 #define __NR_wait4                      (__NR_SYSCALL_BASE+114)
1016 #define __NR_swapoff                    (__NR_SYSCALL_BASE+115)
1017 #define __NR_sysinfo                    (__NR_SYSCALL_BASE+116)
1018 #define __NR_ipc                        (__NR_SYSCALL_BASE+117)
1019 #define __NR_fsync                      (__NR_SYSCALL_BASE+118)
1020 #define __NR_sigreturn                  (__NR_SYSCALL_BASE+119)
1021 #define __NR_clone                      (__NR_SYSCALL_BASE+120)
1022 #define __NR_setdomainname              (__NR_SYSCALL_BASE+121)
1023 #define __NR_uname                      (__NR_SYSCALL_BASE+122)
1024                                         /* 123 was sys_modify_ldt */
1025 #define __NR_adjtimex                   (__NR_SYSCALL_BASE+124)
1026 #define __NR_mprotect                   (__NR_SYSCALL_BASE+125)
1027 #define __NR_sigprocmask                (__NR_SYSCALL_BASE+126)
1028                                         /* 127 was sys_create_module */
1029 #define __NR_init_module                (__NR_SYSCALL_BASE+128)
1030 #define __NR_delete_module              (__NR_SYSCALL_BASE+129)
1031                                         /* 130 was sys_get_kernel_syms */
1032 #define __NR_quotactl                   (__NR_SYSCALL_BASE+131)
1033 #define __NR_getpgid                    (__NR_SYSCALL_BASE+132)
1034 #define __NR_fchdir                     (__NR_SYSCALL_BASE+133)
1035 #define __NR_bdflush                    (__NR_SYSCALL_BASE+134)
1036 #define __NR_sysfs                      (__NR_SYSCALL_BASE+135)
1037 #define __NR_personality                (__NR_SYSCALL_BASE+136)
1038                                         /* 137 was sys_afs_syscall */
1039 #define __NR_setfsuid                   (__NR_SYSCALL_BASE+138)
1040 #define __NR_setfsgid                   (__NR_SYSCALL_BASE+139)
1041 #define __NR__llseek                    (__NR_SYSCALL_BASE+140)
1042 #define __NR_getdents                   (__NR_SYSCALL_BASE+141)
1043 #define __NR__newselect                 (__NR_SYSCALL_BASE+142)
1044 #define __NR_flock                      (__NR_SYSCALL_BASE+143)
1045 #define __NR_msync                      (__NR_SYSCALL_BASE+144)
1046 #define __NR_readv                      (__NR_SYSCALL_BASE+145)
1047 #define __NR_writev                     (__NR_SYSCALL_BASE+146)
1048 #define __NR_getsid                     (__NR_SYSCALL_BASE+147)
1049 #define __NR_fdatasync                  (__NR_SYSCALL_BASE+148)
1050 #define __NR__sysctl                    (__NR_SYSCALL_BASE+149)
1051 #define __NR_mlock                      (__NR_SYSCALL_BASE+150)
1052 #define __NR_munlock                    (__NR_SYSCALL_BASE+151)
1053 #define __NR_mlockall                   (__NR_SYSCALL_BASE+152)
1054 #define __NR_munlockall                 (__NR_SYSCALL_BASE+153)
1055 #define __NR_sched_setparam             (__NR_SYSCALL_BASE+154)
1056 #define __NR_sched_getparam             (__NR_SYSCALL_BASE+155)
1057 #define __NR_sched_setscheduler         (__NR_SYSCALL_BASE+156)
1058 #define __NR_sched_getscheduler         (__NR_SYSCALL_BASE+157)
1059 #define __NR_sched_yield                (__NR_SYSCALL_BASE+158)
1060 #define __NR_sched_get_priority_max     (__NR_SYSCALL_BASE+159)
1061 #define __NR_sched_get_priority_min     (__NR_SYSCALL_BASE+160)
1062 #define __NR_sched_rr_get_interval      (__NR_SYSCALL_BASE+161)
1063 #define __NR_nanosleep                  (__NR_SYSCALL_BASE+162)
1064 #define __NR_mremap                     (__NR_SYSCALL_BASE+163)
1065 #define __NR_setresuid                  (__NR_SYSCALL_BASE+164)
1066 #define __NR_getresuid                  (__NR_SYSCALL_BASE+165)
1067                                         /* 166 was sys_vm86 */
1068                                         /* 167 was sys_query_module */
1069 #define __NR_poll                       (__NR_SYSCALL_BASE+168)
1070 #define __NR_nfsservctl                 (__NR_SYSCALL_BASE+169)
1071 #define __NR_setresgid                  (__NR_SYSCALL_BASE+170)
1072 #define __NR_getresgid                  (__NR_SYSCALL_BASE+171)
1073 #define __NR_prctl                      (__NR_SYSCALL_BASE+172)
1074 #define __NR_rt_sigreturn               (__NR_SYSCALL_BASE+173)
1075 #define __NR_rt_sigaction               (__NR_SYSCALL_BASE+174)
1076 #define __NR_rt_sigprocmask             (__NR_SYSCALL_BASE+175)
1077 #define __NR_rt_sigpending              (__NR_SYSCALL_BASE+176)
1078 #define __NR_rt_sigtimedwait            (__NR_SYSCALL_BASE+177)
1079 #define __NR_rt_sigqueueinfo            (__NR_SYSCALL_BASE+178)
1080 #define __NR_rt_sigsuspend              (__NR_SYSCALL_BASE+179)
1081 #define __NR_pread64                    (__NR_SYSCALL_BASE+180)
1082 #define __NR_pwrite64                   (__NR_SYSCALL_BASE+181)
1083 #define __NR_chown                      (__NR_SYSCALL_BASE+182)
1084 #define __NR_getcwd                     (__NR_SYSCALL_BASE+183)
1085 #define __NR_capget                     (__NR_SYSCALL_BASE+184)
1086 #define __NR_capset                     (__NR_SYSCALL_BASE+185)
1087 #define __NR_sigaltstack                (__NR_SYSCALL_BASE+186)
1088 #define __NR_sendfile                   (__NR_SYSCALL_BASE+187)
1089                                         /* 188 reserved */
1090                                         /* 189 reserved */
1091 #define __NR_vfork                      (__NR_SYSCALL_BASE+190)
1092 #define __NR_ugetrlimit                 (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
1093 #define __NR_mmap2                      (__NR_SYSCALL_BASE+192)
1094 #define __NR_truncate64                 (__NR_SYSCALL_BASE+193)
1095 #define __NR_ftruncate64                (__NR_SYSCALL_BASE+194)
1096 #define __NR_stat64                     (__NR_SYSCALL_BASE+195)
1097 #define __NR_lstat64                    (__NR_SYSCALL_BASE+196)
1098 #define __NR_fstat64                    (__NR_SYSCALL_BASE+197)
1099 #define __NR_lchown32                   (__NR_SYSCALL_BASE+198)
1100 #define __NR_getuid32                   (__NR_SYSCALL_BASE+199)
1101 #define __NR_getgid32                   (__NR_SYSCALL_BASE+200)
1102 #define __NR_geteuid32                  (__NR_SYSCALL_BASE+201)
1103 #define __NR_getegid32                  (__NR_SYSCALL_BASE+202)
1104 #define __NR_setreuid32                 (__NR_SYSCALL_BASE+203)
1105 #define __NR_setregid32                 (__NR_SYSCALL_BASE+204)
1106 #define __NR_getgroups32                (__NR_SYSCALL_BASE+205)
1107 #define __NR_setgroups32                (__NR_SYSCALL_BASE+206)
1108 #define __NR_fchown32                   (__NR_SYSCALL_BASE+207)
1109 #define __NR_setresuid32                (__NR_SYSCALL_BASE+208)
1110 #define __NR_getresuid32                (__NR_SYSCALL_BASE+209)
1111 #define __NR_setresgid32                (__NR_SYSCALL_BASE+210)
1112 #define __NR_getresgid32                (__NR_SYSCALL_BASE+211)
1113 #define __NR_chown32                    (__NR_SYSCALL_BASE+212)
1114 #define __NR_setuid32                   (__NR_SYSCALL_BASE+213)
1115 #define __NR_setgid32                   (__NR_SYSCALL_BASE+214)
1116 #define __NR_setfsuid32                 (__NR_SYSCALL_BASE+215)
1117 #define __NR_setfsgid32                 (__NR_SYSCALL_BASE+216)
1118 #define __NR_getdents64                 (__NR_SYSCALL_BASE+217)
1119 #define __NR_pivot_root                 (__NR_SYSCALL_BASE+218)
1120 #define __NR_mincore                    (__NR_SYSCALL_BASE+219)
1121 #define __NR_madvise                    (__NR_SYSCALL_BASE+220)
1122 #define __NR_fcntl64                    (__NR_SYSCALL_BASE+221)
1123                                         /* 222 for tux */
1124                                         /* 223 is unused */
1125 #define __NR_gettid                     (__NR_SYSCALL_BASE+224)
1126 #define __NR_readahead                  (__NR_SYSCALL_BASE+225)
1127 #define __NR_setxattr                   (__NR_SYSCALL_BASE+226)
1128 #define __NR_lsetxattr                  (__NR_SYSCALL_BASE+227)
1129 #define __NR_fsetxattr                  (__NR_SYSCALL_BASE+228)
1130 #define __NR_getxattr                   (__NR_SYSCALL_BASE+229)
1131 #define __NR_lgetxattr                  (__NR_SYSCALL_BASE+230)
1132 #define __NR_fgetxattr                  (__NR_SYSCALL_BASE+231)
1133 #define __NR_listxattr                  (__NR_SYSCALL_BASE+232)
1134 #define __NR_llistxattr                 (__NR_SYSCALL_BASE+233)
1135 #define __NR_flistxattr                 (__NR_SYSCALL_BASE+234)
1136 #define __NR_removexattr                (__NR_SYSCALL_BASE+235)
1137 #define __NR_lremovexattr               (__NR_SYSCALL_BASE+236)
1138 #define __NR_fremovexattr               (__NR_SYSCALL_BASE+237)
1139 #define __NR_tkill                      (__NR_SYSCALL_BASE+238)
1140 #define __NR_sendfile64                 (__NR_SYSCALL_BASE+239)
1141 #define __NR_futex                      (__NR_SYSCALL_BASE+240)
1142 #define __NR_sched_setaffinity          (__NR_SYSCALL_BASE+241)
1143 #define __NR_sched_getaffinity          (__NR_SYSCALL_BASE+242)
1144 #define __NR_io_setup                   (__NR_SYSCALL_BASE+243)
1145 #define __NR_io_destroy                 (__NR_SYSCALL_BASE+244)
1146 #define __NR_io_getevents               (__NR_SYSCALL_BASE+245)
1147 #define __NR_io_submit                  (__NR_SYSCALL_BASE+246)
1148 #define __NR_io_cancel                  (__NR_SYSCALL_BASE+247)
1149 #define __NR_exit_group                 (__NR_SYSCALL_BASE+248)
1150 #define __NR_lookup_dcookie             (__NR_SYSCALL_BASE+249)
1151 #define __NR_epoll_create               (__NR_SYSCALL_BASE+250)
1152 #define __NR_epoll_ctl                  (__NR_SYSCALL_BASE+251)
1153 #define __NR_epoll_wait                 (__NR_SYSCALL_BASE+252)
1154 #define __NR_remap_file_pages           (__NR_SYSCALL_BASE+253)
1155                                         /* 254 for set_thread_area */
1156                                         /* 255 for get_thread_area */
1157                                         /* 256 for set_tid_address */
1158 #define __NR_timer_create               (__NR_SYSCALL_BASE+257)
1159 #define __NR_timer_settime              (__NR_SYSCALL_BASE+258)
1160 #define __NR_timer_gettime              (__NR_SYSCALL_BASE+259)
1161 #define __NR_timer_getoverrun           (__NR_SYSCALL_BASE+260)
1162 #define __NR_timer_delete               (__NR_SYSCALL_BASE+261)
1163 #define __NR_clock_settime              (__NR_SYSCALL_BASE+262)
1164 #define __NR_clock_gettime              (__NR_SYSCALL_BASE+263)
1165 #define __NR_clock_getres               (__NR_SYSCALL_BASE+264)
1166 #define __NR_clock_nanosleep            (__NR_SYSCALL_BASE+265)
1167 #define __NR_statfs64                   (__NR_SYSCALL_BASE+266)
1168 #define __NR_fstatfs64                  (__NR_SYSCALL_BASE+267)
1169 #define __NR_tgkill                     (__NR_SYSCALL_BASE+268)
1170 #define __NR_utimes                     (__NR_SYSCALL_BASE+269)
1171 #define __NR_fadvise64_64               (__NR_SYSCALL_BASE+270)
1172 #define __NR_pciconfig_iobase           (__NR_SYSCALL_BASE+271)
1173 #define __NR_pciconfig_read             (__NR_SYSCALL_BASE+272)
1174 #define __NR_pciconfig_write            (__NR_SYSCALL_BASE+273)
1176 #endif /* __VKI_UNISTD_ARM_LINUX_H */