diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2013-11-11 16:01:46 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2013-11-12 15:05:12 +0800 |
commit | 7b0de5ae35083554f258e68dcfb0c9ada702e70a (patch) | |
tree | 6db6ed333d1275a724874c1f9d9d28d200397706 /9/platforms/android-16/arch-mips/usr/include/sys | |
parent | e9808d310fa92e2aa27a9208fe59144a43a8d4b6 (diff) | |
download | prebuilts_ndk-7b0de5ae35083554f258e68dcfb0c9ada702e70a.zip prebuilts_ndk-7b0de5ae35083554f258e68dcfb0c9ada702e70a.tar.gz prebuilts_ndk-7b0de5ae35083554f258e68dcfb0c9ada702e70a.tar.bz2 |
Refresh prebuilts/ndk/9/platforms with r9b+, part 2/2
Part 2: add new API level 12, 13, 15, 16, 17 and 19
Change-Id: I305970f7766b3ed3e5faf2532952eaa03398fcbd
Diffstat (limited to '9/platforms/android-16/arch-mips/usr/include/sys')
58 files changed, 5866 insertions, 0 deletions
diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/_errdefs.h b/9/platforms/android-16/arch-mips/usr/include/sys/_errdefs.h new file mode 100644 index 0000000..e27ab7a --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/_errdefs.h @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* the following corresponds to the error codes of the Linux kernel used by the Android platform + * these are distinct from the OpenBSD ones, which is why we need to redeclare them here + * + * this file may be included several times to define either error constants or their + * string representation + */ + +#ifndef __BIONIC_ERRDEF +#error "__BIONIC_ERRDEF must be defined before including this file" +#endif +__BIONIC_ERRDEF( EPERM , 1, "Operation not permitted" ) +__BIONIC_ERRDEF( ENOENT , 2, "No such file or directory" ) +__BIONIC_ERRDEF( ESRCH , 3, "No such process" ) +__BIONIC_ERRDEF( EINTR , 4, "Interrupted system call" ) +__BIONIC_ERRDEF( EIO , 5, "I/O error" ) +__BIONIC_ERRDEF( ENXIO , 6, "No such device or address" ) +__BIONIC_ERRDEF( E2BIG , 7, "Argument list too long" ) +__BIONIC_ERRDEF( ENOEXEC , 8, "Exec format error" ) +__BIONIC_ERRDEF( EBADF , 9, "Bad file number" ) +__BIONIC_ERRDEF( ECHILD , 10, "No child processes" ) +__BIONIC_ERRDEF( EAGAIN , 11, "Try again" ) +__BIONIC_ERRDEF( ENOMEM , 12, "Out of memory" ) +__BIONIC_ERRDEF( EACCES , 13, "Permission denied" ) +__BIONIC_ERRDEF( EFAULT , 14, "Bad address" ) +__BIONIC_ERRDEF( ENOTBLK , 15, "Block device required" ) +__BIONIC_ERRDEF( EBUSY , 16, "Device or resource busy" ) +__BIONIC_ERRDEF( EEXIST , 17, "File exists" ) +__BIONIC_ERRDEF( EXDEV , 18, "Cross-device link" ) +__BIONIC_ERRDEF( ENODEV , 19, "No such device" ) +__BIONIC_ERRDEF( ENOTDIR , 20, "Not a directory" ) +__BIONIC_ERRDEF( EISDIR , 21, "Is a directory" ) +__BIONIC_ERRDEF( EINVAL , 22, "Invalid argument" ) +__BIONIC_ERRDEF( ENFILE , 23, "File table overflow" ) +__BIONIC_ERRDEF( EMFILE , 24, "Too many open files" ) +__BIONIC_ERRDEF( ENOTTY , 25, "Not a typewriter" ) +__BIONIC_ERRDEF( ETXTBSY , 26, "Text file busy" ) +__BIONIC_ERRDEF( EFBIG , 27, "File too large" ) +__BIONIC_ERRDEF( ENOSPC , 28, "No space left on device" ) +__BIONIC_ERRDEF( ESPIPE , 29, "Illegal seek" ) +__BIONIC_ERRDEF( EROFS , 30, "Read-only file system" ) +__BIONIC_ERRDEF( EMLINK , 31, "Too many links" ) +__BIONIC_ERRDEF( EPIPE , 32, "Broken pipe" ) +__BIONIC_ERRDEF( EDOM , 33, "Math argument out of domain of func" ) +__BIONIC_ERRDEF( ERANGE , 34, "Math result not representable" ) +__BIONIC_ERRDEF( EDEADLK , 35, "Resource deadlock would occur" ) +__BIONIC_ERRDEF( ENAMETOOLONG , 36, "File name too long" ) +__BIONIC_ERRDEF( ENOLCK , 37, "No record locks available" ) +__BIONIC_ERRDEF( ENOSYS , 38, "Function not implemented" ) +__BIONIC_ERRDEF( ENOTEMPTY , 39, "Directory not empty" ) +__BIONIC_ERRDEF( ELOOP , 40, "Too many symbolic links encountered" ) +__BIONIC_ERRDEF( ENOMSG , 42, "No message of desired type" ) +__BIONIC_ERRDEF( EIDRM , 43, "Identifier removed" ) +__BIONIC_ERRDEF( ECHRNG , 44, "Channel number out of range" ) +__BIONIC_ERRDEF( EL2NSYNC , 45, "Level 2 not synchronized" ) +__BIONIC_ERRDEF( EL3HLT , 46, "Level 3 halted" ) +__BIONIC_ERRDEF( EL3RST , 47, "Level 3 reset" ) +__BIONIC_ERRDEF( ELNRNG , 48, "Link number out of range" ) +__BIONIC_ERRDEF( EUNATCH , 49, "Protocol driver not attached" ) +__BIONIC_ERRDEF( ENOCSI , 50, "No CSI structure available" ) +__BIONIC_ERRDEF( EL2HLT , 51, "Level 2 halted" ) +__BIONIC_ERRDEF( EBADE , 52, "Invalid exchange" ) +__BIONIC_ERRDEF( EBADR , 53, "Invalid request descriptor" ) +__BIONIC_ERRDEF( EXFULL , 54, "Exchange full" ) +__BIONIC_ERRDEF( ENOANO , 55, "No anode" ) +__BIONIC_ERRDEF( EBADRQC , 56, "Invalid request code" ) +__BIONIC_ERRDEF( EBADSLT , 57, "Invalid slot" ) +__BIONIC_ERRDEF( EBFONT , 59, "Bad font file format" ) +__BIONIC_ERRDEF( ENOSTR , 60, "Device not a stream" ) +__BIONIC_ERRDEF( ENODATA , 61, "No data available" ) +__BIONIC_ERRDEF( ETIME , 62, "Timer expired" ) +__BIONIC_ERRDEF( ENOSR , 63, "Out of streams resources" ) +__BIONIC_ERRDEF( ENONET , 64, "Machine is not on the network" ) +__BIONIC_ERRDEF( ENOPKG , 65, "Package not installed" ) +__BIONIC_ERRDEF( EREMOTE , 66, "Object is remote" ) +__BIONIC_ERRDEF( ENOLINK , 67, "Link has been severed" ) +__BIONIC_ERRDEF( EADV , 68, "Advertise error" ) +__BIONIC_ERRDEF( ESRMNT , 69, "Srmount error" ) +__BIONIC_ERRDEF( ECOMM , 70, "Communication error on send" ) +__BIONIC_ERRDEF( EPROTO , 71, "Protocol error" ) +__BIONIC_ERRDEF( EMULTIHOP , 72, "Multihop attempted" ) +__BIONIC_ERRDEF( EDOTDOT , 73, "RFS specific error" ) +__BIONIC_ERRDEF( EBADMSG , 74, "Not a data message" ) +__BIONIC_ERRDEF( EOVERFLOW , 75, "Value too large for defined data type" ) +__BIONIC_ERRDEF( ENOTUNIQ , 76, "Name not unique on network" ) +__BIONIC_ERRDEF( EBADFD , 77, "File descriptor in bad state" ) +__BIONIC_ERRDEF( EREMCHG , 78, "Remote address changed" ) +__BIONIC_ERRDEF( ELIBACC , 79, "Can not access a needed shared library" ) +__BIONIC_ERRDEF( ELIBBAD , 80, "Accessing a corrupted shared library" ) +__BIONIC_ERRDEF( ELIBSCN , 81, ".lib section in a.out corrupted" ) +__BIONIC_ERRDEF( ELIBMAX , 82, "Attempting to link in too many shared libraries" ) +__BIONIC_ERRDEF( ELIBEXEC , 83, "Cannot exec a shared library directly" ) +__BIONIC_ERRDEF( EILSEQ , 84, "Illegal byte sequence" ) +__BIONIC_ERRDEF( ERESTART , 85, "Interrupted system call should be restarted" ) +__BIONIC_ERRDEF( ESTRPIPE , 86, "Streams pipe error" ) +__BIONIC_ERRDEF( EUSERS , 87, "Too many users" ) +__BIONIC_ERRDEF( ENOTSOCK , 88, "Socket operation on non-socket" ) +__BIONIC_ERRDEF( EDESTADDRREQ , 89, "Destination address required" ) +__BIONIC_ERRDEF( EMSGSIZE , 90, "Message too long" ) +__BIONIC_ERRDEF( EPROTOTYPE , 91, "Protocol wrong type for socket" ) +__BIONIC_ERRDEF( ENOPROTOOPT , 92, "Protocol not available" ) +__BIONIC_ERRDEF( EPROTONOSUPPORT, 93, "Protocol not supported" ) +__BIONIC_ERRDEF( ESOCKTNOSUPPORT, 94, "Socket type not supported" ) +__BIONIC_ERRDEF( EOPNOTSUPP , 95, "Operation not supported on transport endpoint" ) +__BIONIC_ERRDEF( EPFNOSUPPORT , 96, "Protocol family not supported" ) +__BIONIC_ERRDEF( EAFNOSUPPORT , 97, "Address family not supported by protocol" ) +__BIONIC_ERRDEF( EADDRINUSE , 98, "Address already in use" ) +__BIONIC_ERRDEF( EADDRNOTAVAIL , 99, "Cannot assign requested address" ) +__BIONIC_ERRDEF( ENETDOWN , 100, "Network is down" ) +__BIONIC_ERRDEF( ENETUNREACH , 101, "Network is unreachable" ) +__BIONIC_ERRDEF( ENETRESET , 102, "Network dropped connection because of reset" ) +__BIONIC_ERRDEF( ECONNABORTED , 103, "Software caused connection abort" ) +__BIONIC_ERRDEF( ECONNRESET , 104, "Connection reset by peer" ) +__BIONIC_ERRDEF( ENOBUFS , 105, "No buffer space available" ) +__BIONIC_ERRDEF( EISCONN , 106, "Transport endpoint is already connected" ) +__BIONIC_ERRDEF( ENOTCONN , 107, "Transport endpoint is not connected" ) +__BIONIC_ERRDEF( ESHUTDOWN , 108, "Cannot send after transport endpoint shutdown" ) +__BIONIC_ERRDEF( ETOOMANYREFS , 109, "Too many references: cannot splice" ) +__BIONIC_ERRDEF( ETIMEDOUT , 110, "Connection timed out" ) +__BIONIC_ERRDEF( ECONNREFUSED , 111, "Connection refused" ) +__BIONIC_ERRDEF( EHOSTDOWN , 112, "Host is down" ) +__BIONIC_ERRDEF( EHOSTUNREACH , 113, "No route to host" ) +__BIONIC_ERRDEF( EALREADY , 114, "Operation already in progress" ) +__BIONIC_ERRDEF( EINPROGRESS , 115, "Operation now in progress" ) +__BIONIC_ERRDEF( ESTALE , 116, "Stale NFS file handle" ) +__BIONIC_ERRDEF( EUCLEAN , 117, "Structure needs cleaning" ) +__BIONIC_ERRDEF( ENOTNAM , 118, "Not a XENIX named type file" ) +__BIONIC_ERRDEF( ENAVAIL , 119, "No XENIX semaphores available" ) +__BIONIC_ERRDEF( EISNAM , 120, "Is a named type file" ) +__BIONIC_ERRDEF( EREMOTEIO , 121, "Remote I/O error" ) +__BIONIC_ERRDEF( EDQUOT , 122, "Quota exceeded" ) +__BIONIC_ERRDEF( ENOMEDIUM , 123, "No medium found" ) +__BIONIC_ERRDEF( EMEDIUMTYPE , 124, "Wrong medium type" ) +__BIONIC_ERRDEF( ECANCELED , 125, "Operation Canceled" ) +__BIONIC_ERRDEF( ENOKEY , 126, "Required key not available" ) +__BIONIC_ERRDEF( EKEYEXPIRED , 127, "Key has expired" ) +__BIONIC_ERRDEF( EKEYREVOKED , 128, "Key has been revoked" ) +__BIONIC_ERRDEF( EKEYREJECTED , 129, "Key was rejected by service" ) +__BIONIC_ERRDEF( EOWNERDEAD , 130, "Owner died" ) +__BIONIC_ERRDEF( ENOTRECOVERABLE, 131, "State not recoverable" ) + +/* the following is not defined by Linux but needed for the BSD portions of the C library */ +__BIONIC_ERRDEF( EFTYPE, 1000, "Stupid C library hack !!" ) + +#undef __BIONIC_ERRDEF diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/_sigdefs.h b/9/platforms/android-16/arch-mips/usr/include/sys/_sigdefs.h new file mode 100644 index 0000000..6b47a03 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/_sigdefs.h @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * this header is used to define signal constants and names; + * it might be included several times + */ + +#ifndef __BIONIC_SIGDEF +#error __BIONIC_SIGDEF not defined +#endif + +__BIONIC_SIGDEF(HUP,1,"Hangup") +__BIONIC_SIGDEF(INT,2,"Interrupt") +__BIONIC_SIGDEF(QUIT,3,"Quit") +__BIONIC_SIGDEF(ILL,4,"Illegal instruction") +__BIONIC_SIGDEF(TRAP,5,"Trap") +__BIONIC_SIGDEF(ABRT,6,"Aborted") +#ifdef __mips__ +__BIONIC_SIGDEF(EMT,7,"EMT") +#else +__BIONIC_SIGDEF(BUS,7,"Bus error") +#endif +__BIONIC_SIGDEF(FPE,8,"Floating point exception") +__BIONIC_SIGDEF(KILL,9,"Killed") +#ifdef __mips__ +__BIONIC_SIGDEF(BUS,10,"Bus error") +#else +__BIONIC_SIGDEF(USR1,10,"User signal 1") +#endif +__BIONIC_SIGDEF(SEGV,11,"Segmentation fault") +#ifdef __mips__ +__BIONIC_SIGDEF(SYS,12,"Bad system call") +#else +__BIONIC_SIGDEF(USR2,12,"User signal 2") +#endif +__BIONIC_SIGDEF(PIPE,13,"Broken pipe") +__BIONIC_SIGDEF(ALRM,14,"Alarm clock") +__BIONIC_SIGDEF(TERM,15,"Terminated") +#ifdef __mips__ +__BIONIC_SIGDEF(USR1,16,"User signal 1") +__BIONIC_SIGDEF(USR2,17,"User signal 2") +__BIONIC_SIGDEF(CHLD,18,"Child exited") +__BIONIC_SIGDEF(PWR,19,"Power failure") +__BIONIC_SIGDEF(WINCH,20,"Window size changed") +__BIONIC_SIGDEF(URG,21,"Urgent I/O condition") +__BIONIC_SIGDEF(IO,22,"I/O possible") +__BIONIC_SIGDEF(STOP,23,"Stopped (signal)") +__BIONIC_SIGDEF(TSTP,24,"Stopped") +__BIONIC_SIGDEF(CONT,25,"Continue") +__BIONIC_SIGDEF(TTIN,26,"Stopped (tty input)") +__BIONIC_SIGDEF(TTOU,27,"Stopped (tty output)") +__BIONIC_SIGDEF(VTALRM,28,"Virtual timer expired") +__BIONIC_SIGDEF(PROF,29,"Profiling timer expired") +__BIONIC_SIGDEF(XCPU,30,"CPU time limit exceeded") +__BIONIC_SIGDEF(XFSZ,31,"File size limit exceeded") +#else +__BIONIC_SIGDEF(STKFLT,16,"Stack fault") +__BIONIC_SIGDEF(CHLD,17,"Child exited") +__BIONIC_SIGDEF(CONT,18,"Continue") +__BIONIC_SIGDEF(STOP,19,"Stopped (signal)") +__BIONIC_SIGDEF(TSTP,20,"Stopped") +__BIONIC_SIGDEF(TTIN,21,"Stopped (tty input)") +__BIONIC_SIGDEF(TTOU,22,"Stopper (tty output)") +__BIONIC_SIGDEF(URG,23,"Urgent I/O condition") +__BIONIC_SIGDEF(XCPU,24,"CPU time limit exceeded") +__BIONIC_SIGDEF(XFSZ,25,"File size limit exceeded") +__BIONIC_SIGDEF(VTALRM,26,"Virtual timer expired") +__BIONIC_SIGDEF(PROF,27,"Profiling timer expired") +__BIONIC_SIGDEF(WINCH,28,"Window size changed") +__BIONIC_SIGDEF(IO,29,"I/O possible") +__BIONIC_SIGDEF(PWR,30,"Power failure") +__BIONIC_SIGDEF(SYS,31,"Bad system call") +#endif + +#undef __BIONIC_SIGDEF diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/_system_properties.h b/9/platforms/android-16/arch-mips/usr/include/sys/_system_properties.h new file mode 100644 index 0000000..42a7f6c --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/_system_properties.h @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _INCLUDE_SYS__SYSTEM_PROPERTIES_H +#define _INCLUDE_SYS__SYSTEM_PROPERTIES_H + +#ifndef _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ +#error you should #include <sys/system_properties.h> instead +#else +#include <sys/system_properties.h> + +typedef struct prop_area prop_area; +typedef struct prop_msg prop_msg; + +#define PROP_AREA_MAGIC 0x504f5250 +#define PROP_AREA_VERSION 0x45434f76 + +#define PROP_SERVICE_NAME "property_service" + +/* #define PROP_MAX_ENTRIES 247 */ +/* 247 -> 32620 bytes (<32768) */ + +#define TOC_NAME_LEN(toc) ((toc) >> 24) +#define TOC_TO_INFO(area, toc) ((prop_info*) (((char*) area) + ((toc) & 0xFFFFFF))) + +struct prop_area { + unsigned volatile count; + unsigned volatile serial; + unsigned magic; + unsigned version; + unsigned reserved[4]; + unsigned toc[1]; +}; + +#define SERIAL_VALUE_LEN(serial) ((serial) >> 24) +#define SERIAL_DIRTY(serial) ((serial) & 1) + +struct prop_info { + char name[PROP_NAME_MAX]; + unsigned volatile serial; + char value[PROP_VALUE_MAX]; +}; + +struct prop_msg +{ + unsigned cmd; + char name[PROP_NAME_MAX]; + char value[PROP_VALUE_MAX]; +}; + +#define PROP_MSG_SETPROP 1 + +/* +** Rules: +** +** - there is only one writer, but many readers +** - prop_area.count will never decrease in value +** - once allocated, a prop_info's name will not change +** - once allocated, a prop_info's offset will not change +** - reading a value requires the following steps +** 1. serial = pi->serial +** 2. if SERIAL_DIRTY(serial), wait*, then goto 1 +** 3. memcpy(local, pi->value, SERIAL_VALUE_LEN(serial) + 1) +** 4. if pi->serial != serial, goto 2 +** +** - writing a value requires the following steps +** 1. pi->serial = pi->serial | 1 +** 2. memcpy(pi->value, local_value, value_len) +** 3. pi->serial = (value_len << 24) | ((pi->serial + 1) & 0xffffff) +** +** Improvements: +** - maintain the toc sorted by pi->name to allow lookup +** by binary search +** +*/ + +#define PROP_PATH_RAMDISK_DEFAULT "/default.prop" +#define PROP_PATH_SYSTEM_BUILD "/system/build.prop" +#define PROP_PATH_SYSTEM_DEFAULT "/system/default.prop" +#define PROP_PATH_LOCAL_OVERRIDE "/data/local.prop" + +#endif +#endif diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/_types.h b/9/platforms/android-16/arch-mips/usr/include/sys/_types.h new file mode 100644 index 0000000..7b99e06 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/_types.h @@ -0,0 +1,77 @@ +/* $OpenBSD: _types.h,v 1.1 2006/01/06 18:53:05 millert Exp $ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)types.h 8.3 (Berkeley) 1/5/94 + */ + +#ifndef _SYS__TYPES_H_ +#define _SYS__TYPES_H_ + +#undef __KERNEL_STRICT_NAMES +#define __KERNEL_STRICT_NAMES 1 + +#include <machine/_types.h> + +typedef unsigned long __cpuid_t; /* CPU id */ +typedef __int32_t __dev_t; /* device number */ +typedef __uint32_t __fixpt_t; /* fixed point number */ +typedef __uint32_t __gid_t; /* group id */ +typedef __uint32_t __id_t; /* may contain pid, uid or gid */ +typedef __uint32_t __in_addr_t; /* base type for internet address */ +typedef __uint16_t __in_port_t; /* IP port type */ +typedef __uint32_t __ino_t; /* inode number */ +typedef long __key_t; /* IPC key (for Sys V IPC) */ +typedef __uint32_t __mode_t; /* permissions */ +typedef __uint32_t __nlink_t; /* link count */ +typedef __int32_t __pid_t; /* process id */ +typedef __uint64_t __rlim_t; /* resource limit */ +typedef __uint16_t __sa_family_t; /* sockaddr address family type */ +typedef __int32_t __segsz_t; /* segment size */ +typedef __uint32_t __socklen_t; /* length type for network syscalls */ +typedef __int32_t __swblk_t; /* swap offset */ +typedef __uint32_t __uid_t; /* user id */ +typedef __uint32_t __useconds_t; /* microseconds */ +typedef __int32_t __suseconds_t; /* microseconds (signed) */ + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t __mbstateL; /* for alignment */ +} __mbstate_t; + +/* BIONIC: if we're using non-cleaned up user-level kernel headers, + * this will prevent many type declaration conflicts + */ +#define __KERNEL_STRICT_NAMES 1 + +#endif /* !_SYS__TYPES_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/_wchar_limits.h b/9/platforms/android-16/arch-mips/usr/include/sys/_wchar_limits.h new file mode 100644 index 0000000..644792f --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/_wchar_limits.h @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS__WCHAR_LIMITS_H +#define _SYS__WCHAR_LIMITS_H + +#include <android/api-level.h> + +/* WCHAR_MIN / WCHAR_MAX can be defined by <stdint.h> or <wchar.h>. + * Due to historical reasons, their definition is a bit complex. + * + * - In NDK r8e and older, all definitions of WCHAR_MIN and WCHAR_MAX + * where 32-bit signed values (with one exception described below), + * despite the fact that wchar_t is 'unsigned' on ARM. + * See http://b.android.com/57749 + * + * This is no longer the case, unless you define _WCHAR_IS_ALWAYS_SIGNED + * at compile time to restore the old (broken) behaviour. This doesn't + * affect other CPU ABIs. + * + * - Before API level 9, on ARM, wchar_t was typedef to 'char' when + * compiling C (not C++). Also, the definitions of WCHAR_MIN and + * WCHAR_MAX differed between <stdint.h> and <wchar.h>: + * + * <stdint.h> conditionally defined them to INT32_MIN / INT32_MAX. + * <wchar.h> conditionally defined them to 0 and 255 instead. + * + * <stdint.h> would only define WCHAR_MIN and WCHAR_MAX when: + * - Compiling C sources. + * - Compiling C++ sources with __STDC_LIMIT_MACROS being defined. + * + * <wchar.h> always ends up including <stdint.h> indirectly. This + * means that: + * + * - When compiling C sources, WCHAR_MIN / WCHAR_MAX were always + * defined as INT32_MIN / INT32_MAX. + * + * - When compiling C++ sources with __STDC_LIMIT_MACROS defined, + * they were always defined to INT32_MIN / INT32_MAX + * + * - When compiling C++ sources without __STDC_LIMIT_MACROS defined, + * they were defined by <wchar.h> as 0 and 255, respectively. + * + * Keep in mind that this was ARM-specific, only for API level < 9. + * + * If _WCHAR_IS_8BIT is defined, the same broken behaviour will + * be restored. See http://b.android.com/57267 + */ +#if !defined(WCHAR_MIN) + +# if defined(_WCHAR_IS_8BIT) && defined(__arm__) && __ANDROID_API__ < 9 +# if defined(__cplusplus) && !defined(__STDC_LIMIT_MACROS) +# define WCHAR_MIN 0 +# define WCHAR_MAX 255 +# else +# define WCHAR_MIN (-2147483647 - 1) +# define WCHAR_MAX (2147483647) +# endif +# elif defined(_WCHAR_IS_ALWAYS_SIGNED) +# define WCHAR_MIN (-2147483647 - 1) +# define WCHAR_MAX (2147483647) +# else + /* Otherwise, the value is derived from the toolchain configuration. + * to avoid putting explicit CPU checks in this header. */ +# ifndef __WCHAR_MAX__ +# error "__WCHAR_MAX__ is not defined. Check your toolchain!" +# endif + /* Clang does define __WCHAR_MAX__, but not __WCHAR_MIN__ */ +# ifndef __WCHAR_MIN__ +# if __WCHAR_MAX__ == 4294967295 +# define __WCHAR_MIN__ (0U) +# elif __WCHAR_MAX__ == 2147483647 +# define __WCHAR_MIN__ (-2147483647 - 1) +# else +# error "Invalid __WCHAR_MAX__ value. Check your toolchain!" +# endif +# endif /* !__WCHAR_MIN__ */ +# define WCHAR_MIN __WCHAR_MIN__ +# define WCHAR_MAX __WCHAR_MAX__ +# endif /* !_WCHAR_IS_ALWAYS_SIGNED */ + +#endif /* !WCHAR_MIN */ + +#endif /* _SYS__WCHAR_LIMITS_H */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/atomics.h b/9/platforms/android-16/arch-mips/usr/include/sys/atomics.h new file mode 100644 index 0000000..3ada8de --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/atomics.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_ATOMICS_H +#define _SYS_ATOMICS_H + +#include <sys/cdefs.h> +#include <sys/time.h> + +__BEGIN_DECLS + +/* Note: atomic operations that were exported by the C library didn't + * provide any memory barriers, which created potential issues on + * multi-core devices. We now define them as inlined calls to + * GCC sync builtins, which always provide a full barrier. + * + * NOTE: The C library still exports atomic functions by the same + * name to ensure ABI stability for existing NDK machine code. + * + * If you are an NDK developer, we encourage you to rebuild your + * unmodified sources against this header as soon as possible. + */ +#define __ATOMIC_INLINE__ static __inline__ __attribute__((always_inline)) + +__ATOMIC_INLINE__ int +__atomic_cmpxchg(int old, int _new, volatile int *ptr) +{ + /* We must return 0 on success */ + return __sync_val_compare_and_swap(ptr, old, _new) != old; +} + +__ATOMIC_INLINE__ int +__atomic_swap(int _new, volatile int *ptr) +{ + int prev; + do { + prev = *ptr; + } while (__sync_val_compare_and_swap(ptr, prev, _new) != prev); + return prev; +} + +__ATOMIC_INLINE__ int +__atomic_dec(volatile int *ptr) +{ + return __sync_fetch_and_sub (ptr, 1); +} + +__ATOMIC_INLINE__ int +__atomic_inc(volatile int *ptr) +{ + return __sync_fetch_and_add (ptr, 1); +} + + +int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout); +int __futex_wake(volatile void *ftx, int count); + +__END_DECLS + +#endif /* _SYS_ATOMICS_H */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/cachectl.h b/9/platforms/android-16/arch-mips/usr/include/sys/cachectl.h new file mode 100644 index 0000000..51b3266 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/cachectl.h @@ -0,0 +1,10 @@ +#ifndef _SYS_CACHECTL_H +#define _SYS_CACHECTL_H 1 + +#ifdef __mips__ +#include <asm/cachectl.h> +extern int __cachectl (void *addr, __const int nbytes, __const int op); +extern int _flush_cache (char *addr, __const int nbytes, __const int op); +#endif + +#endif /* sys/cachectl.h */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/cdefs.h b/9/platforms/android-16/arch-mips/usr/include/sys/cdefs.h new file mode 100644 index 0000000..beb35c4 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/cdefs.h @@ -0,0 +1,529 @@ +/* $NetBSD: cdefs.h,v 1.58 2004/12/11 05:59:00 christos Exp $ */ + +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Berkeley Software Design, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 + */ + +#ifndef _SYS_CDEFS_H_ +#define _SYS_CDEFS_H_ + +/* + * Macro to test if we're using a GNU C compiler of a specific vintage + * or later, for e.g. features that appeared in a particular version + * of GNU C. Usage: + * + * #if __GNUC_PREREQ__(major, minor) + * ...cool feature... + * #else + * ...delete feature... + * #endif + */ +#ifdef __GNUC__ +#define __GNUC_PREREQ__(x, y) \ + ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \ + (__GNUC__ > (x))) +#else +#define __GNUC_PREREQ__(x, y) 0 +#endif + +#include <sys/cdefs_elf.h> + +#if defined(__cplusplus) +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#define __static_cast(x,y) static_cast<x>(y) +#else +#define __BEGIN_DECLS +#define __END_DECLS +#define __static_cast(x,y) (x)y +#endif + +/* + * The __CONCAT macro is used to concatenate parts of symbol names, e.g. + * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. + * The __CONCAT macro is a bit tricky -- make sure you don't put spaces + * in between its arguments. __CONCAT can also concatenate double-quoted + * strings produced by the __STRING macro, but this only works with ANSI C. + */ + +#define ___STRING(x) __STRING(x) +#define ___CONCAT(x,y) __CONCAT(x,y) + +#if defined(__STDC__) || defined(__cplusplus) +#define __P(protos) protos /* full-blown ANSI C */ +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +#define __const const /* define reserved names to standard */ +#define __signed signed +#define __volatile volatile +#if defined(__cplusplus) +#define __inline inline /* convert to C++ keyword */ +#else +#if !defined(__GNUC__) && !defined(__lint__) +#define __inline /* delete GCC keyword */ +#endif /* !__GNUC__ && !__lint__ */ +#endif /* !__cplusplus */ + +#else /* !(__STDC__ || __cplusplus) */ +#define __P(protos) () /* traditional C preprocessor */ +#define __CONCAT(x,y) x/**/y +#define __STRING(x) "x" + +#ifndef __GNUC__ +#define __const /* delete pseudo-ANSI C keywords */ +#define __inline +#define __signed +#define __volatile +#endif /* !__GNUC__ */ + +/* + * In non-ANSI C environments, new programs will want ANSI-only C keywords + * deleted from the program and old programs will want them left alone. + * Programs using the ANSI C keywords const, inline etc. as normal + * identifiers should define -DNO_ANSI_KEYWORDS. + */ +#ifndef NO_ANSI_KEYWORDS +#define const __const /* convert ANSI C keywords */ +#define inline __inline +#define signed __signed +#define volatile __volatile +#endif /* !NO_ANSI_KEYWORDS */ +#endif /* !(__STDC__ || __cplusplus) */ + +/* + * Used for internal auditing of the NetBSD source tree. + */ +#ifdef __AUDIT__ +#define __aconst __const +#else +#define __aconst +#endif + +/* + * The following macro is used to remove const cast-away warnings + * from gcc -Wcast-qual; it should be used with caution because it + * can hide valid errors; in particular most valid uses are in + * situations where the API requires it, not to cast away string + * constants. We don't use *intptr_t on purpose here and we are + * explicit about unsigned long so that we don't have additional + * dependencies. + */ +#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) + +/* + * GCC2 provides __extension__ to suppress warnings for various GNU C + * language extensions under "-ansi -pedantic". + */ +#if !__GNUC_PREREQ__(2, 0) +#define __extension__ /* delete __extension__ if non-gcc or gcc1 */ +#endif + +/* + * GCC1 and some versions of GCC2 declare dead (non-returning) and + * pure (no side effects) functions using "volatile" and "const"; + * unfortunately, these then cause warnings under "-ansi -pedantic". + * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of + * these work for GNU C++ (modulo a slight glitch in the C++ grammar + * in the distribution version of 2.5.5). + */ +#if !__GNUC_PREREQ__(2, 5) +#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#define __dead __volatile +#define __pure __const +#endif +#endif + +/* Delete pseudo-keywords wherever they are not available or needed. */ +#ifndef __dead +#define __dead +#define __pure +#endif + +#if __GNUC_PREREQ__(2, 7) +#define __unused __attribute__((__unused__)) +#else +#define __unused /* delete */ +#endif + +#if __GNUC_PREREQ__(3, 1) +#define __used __attribute__((__used__)) +#else +#define __used /* delete */ +#endif + +#if __GNUC_PREREQ__(2, 7) +#define __packed __attribute__((__packed__)) +#define __aligned(x) __attribute__((__aligned__(x))) +#define __section(x) __attribute__((__section__(x))) +#elif defined(__lint__) +#define __packed /* delete */ +#define __aligned(x) /* delete */ +#define __section(x) /* delete */ +#else +#define __packed error: no __packed for this compiler +#define __aligned(x) error: no __aligned for this compiler +#define __section(x) error: no __section for this compiler +#endif + +#if !__GNUC_PREREQ__(2, 8) +#define __extension__ +#endif + +#if __GNUC_PREREQ__(2, 8) +#define __statement(x) __extension__(x) +#elif defined(lint) +#define __statement(x) (0) +#else +#define __statement(x) (x) +#endif + +/* + * C99 defines the restrict type qualifier keyword, which was made available + * in GCC 2.92. + */ +#if defined(__STDC__VERSION__) && __STDC_VERSION__ >= 199901L +#define __restrict restrict +#else +#if !__GNUC_PREREQ__(2, 92) +#define __restrict /* delete __restrict when not supported */ +#endif +#endif + +/* + * C99 defines __func__ predefined identifier, which was made available + * in GCC 2.95. + */ +#if !defined(__STDC_VERSION__) || !(__STDC_VERSION__ >= 199901L) +#if __GNUC_PREREQ__(2, 6) +#define __func__ __PRETTY_FUNCTION__ +#elif __GNUC_PREREQ__(2, 4) +#define __func__ __FUNCTION__ +#else +#define __func__ "" +#endif +#endif /* !(__STDC_VERSION__ >= 199901L) */ + +#if defined(_KERNEL) +#if defined(NO_KERNEL_RCSIDS) +#undef __KERNEL_RCSID +#define __KERNEL_RCSID(_n, _s) /* nothing */ +#endif /* NO_KERNEL_RCSIDS */ +#endif /* _KERNEL */ + +#if !defined(_STANDALONE) && !defined(_KERNEL) +#ifdef __GNUC__ +#define __RENAME(x) ___RENAME(x) +#else +#ifdef __lint__ +#define __RENAME(x) __symbolrename(x) +#else +#error "No function renaming possible" +#endif /* __lint__ */ +#endif /* __GNUC__ */ +#else /* _STANDALONE || _KERNEL */ +#define __RENAME(x) no renaming in kernel or standalone environment +#endif + +/* + * A barrier to stop the optimizer from moving code or assume live + * register values. This is gcc specific, the version is more or less + * arbitrary, might work with older compilers. + */ +#if __GNUC_PREREQ__(2, 95) +#define __insn_barrier() __asm __volatile("":::"memory") +#else +#define __insn_barrier() /* */ +#endif + +/* + * GNU C version 2.96 adds explicit branch prediction so that + * the CPU back-end can hint the processor and also so that + * code blocks can be reordered such that the predicted path + * sees a more linear flow, thus improving cache behavior, etc. + * + * The following two macros provide us with a way to use this + * compiler feature. Use __predict_true() if you expect the expression + * to evaluate to true, and __predict_false() if you expect the + * expression to evaluate to false. + * + * A few notes about usage: + * + * * Generally, __predict_false() error condition checks (unless + * you have some _strong_ reason to do otherwise, in which case + * document it), and/or __predict_true() `no-error' condition + * checks, assuming you want to optimize for the no-error case. + * + * * Other than that, if you don't know the likelihood of a test + * succeeding from empirical or other `hard' evidence, don't + * make predictions. + * + * * These are meant to be used in places that are run `a lot'. + * It is wasteful to make predictions in code that is run + * seldomly (e.g. at subsystem initialization time) as the + * basic block reordering that this affects can often generate + * larger code. + */ +#if __GNUC_PREREQ__(2, 96) +#define __predict_true(exp) __builtin_expect((exp) != 0, 1) +#define __predict_false(exp) __builtin_expect((exp) != 0, 0) +#else +#define __predict_true(exp) (exp) +#define __predict_false(exp) (exp) +#endif + +#if __GNUC_PREREQ__(2, 96) +#define __noreturn __attribute__((__noreturn__)) +#define __mallocfunc __attribute__((malloc)) +#else +#define __noreturn +#define __mallocfunc +#endif + +/* + * Macros for manipulating "link sets". Link sets are arrays of pointers + * to objects, which are gathered up by the linker. + * + * Object format-specific code has provided us with the following macros: + * + * __link_set_add_text(set, sym) + * Add a reference to the .text symbol `sym' to `set'. + * + * __link_set_add_rodata(set, sym) + * Add a reference to the .rodata symbol `sym' to `set'. + * + * __link_set_add_data(set, sym) + * Add a reference to the .data symbol `sym' to `set'. + * + * __link_set_add_bss(set, sym) + * Add a reference to the .bss symbol `sym' to `set'. + * + * __link_set_decl(set, ptype) + * Provide an extern declaration of the set `set', which + * contains an array of the pointer type `ptype'. This + * macro must be used by any code which wishes to reference + * the elements of a link set. + * + * __link_set_start(set) + * This points to the first slot in the link set. + * + * __link_set_end(set) + * This points to the (non-existent) slot after the last + * entry in the link set. + * + * __link_set_count(set) + * Count the number of entries in link set `set'. + * + * In addition, we provide the following macros for accessing link sets: + * + * __link_set_foreach(pvar, set) + * Iterate over the link set `set'. Because a link set is + * an array of pointers, pvar must be declared as "type **pvar", + * and the actual entry accessed as "*pvar". + * + * __link_set_entry(set, idx) + * Access the link set entry at index `idx' from set `set'. + */ +#define __link_set_foreach(pvar, set) \ + for (pvar = __link_set_start(set); pvar < __link_set_end(set); pvar++) + +#define __link_set_entry(set, idx) (__link_set_begin(set)[idx]) + +/* + * Some of the recend FreeBSD sources used in Bionic need this. + * Originally, this is used to embed the rcs versions of each source file + * in the generated binary. We certainly don't want this in Bionic. + */ +#define __FBSDID(s) struct __hack + +/*- + * The following definitions are an extension of the behavior originally + * implemented in <sys/_posix.h>, but with a different level of granularity. + * POSIX.1 requires that the macros we test be defined before any standard + * header file is included. + * + * Here's a quick run-down of the versions: + * defined(_POSIX_SOURCE) 1003.1-1988 + * _POSIX_C_SOURCE == 1 1003.1-1990 + * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option + * _POSIX_C_SOURCE == 199309 1003.1b-1993 + * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + * _POSIX_C_SOURCE == 200112 1003.1-2001 + * _POSIX_C_SOURCE == 200809 1003.1-2008 + * + * In addition, the X/Open Portability Guide, which is now the Single UNIX + * Specification, defines a feature-test macro which indicates the version of + * that specification, and which subsumes _POSIX_C_SOURCE. + * + * Our macros begin with two underscores to avoid namespace screwage. + */ + +/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 +#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ +#define _POSIX_C_SOURCE 199009 +#endif + +/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199209 +#endif + +/* Deal with various X/Open Portability Guides and Single UNIX Spec. */ +#ifdef _XOPEN_SOURCE +#if _XOPEN_SOURCE - 0 >= 700 +#define __XSI_VISIBLE 700 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809 +#elif _XOPEN_SOURCE - 0 >= 600 +#define __XSI_VISIBLE 600 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200112 +#elif _XOPEN_SOURCE - 0 >= 500 +#define __XSI_VISIBLE 500 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199506 +#endif +#endif + +/* + * Deal with all versions of POSIX. The ordering relative to the tests above is + * important. + */ +#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) +#define _POSIX_C_SOURCE 198808 +#endif +#ifdef _POSIX_C_SOURCE +#if _POSIX_C_SOURCE >= 200809 +#define __POSIX_VISIBLE 200809 +#define __ISO_C_VISIBLE 1999 +#elif _POSIX_C_SOURCE >= 200112 +#define __POSIX_VISIBLE 200112 +#define __ISO_C_VISIBLE 1999 +#elif _POSIX_C_SOURCE >= 199506 +#define __POSIX_VISIBLE 199506 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199309 +#define __POSIX_VISIBLE 199309 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199209 +#define __POSIX_VISIBLE 199209 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199009 +#define __POSIX_VISIBLE 199009 +#define __ISO_C_VISIBLE 1990 +#else +#define __POSIX_VISIBLE 198808 +#define __ISO_C_VISIBLE 0 +#endif /* _POSIX_C_SOURCE */ +#else +/*- + * Deal with _ANSI_SOURCE: + * If it is defined, and no other compilation environment is explicitly + * requested, then define our internal feature-test macros to zero. This + * makes no difference to the preprocessor (undefined symbols in preprocessing + * expressions are defined to have value zero), but makes it more convenient for + * a test program to print out the values. + * + * If a program mistakenly defines _ANSI_SOURCE and some other macro such as + * _POSIX_C_SOURCE, we will assume that it wants the broader compilation + * environment (and in fact we will never get here). + */ +#if defined(_ANSI_SOURCE) /* Hide almost everything. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 1990 +#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 1999 +#else /* Default environment: show everything. */ +#define __POSIX_VISIBLE 200809 +#define __XSI_VISIBLE 700 +#define __BSD_VISIBLE 1 +#define __ISO_C_VISIBLE 1999 +#endif +#endif + +/* + * Default values. + */ +#ifndef __XPG_VISIBLE +# define __XPG_VISIBLE 700 +#endif +#ifndef __POSIX_VISIBLE +# define __POSIX_VISIBLE 200809 +#endif +#ifndef __ISO_C_VISIBLE +# define __ISO_C_VISIBLE 1999 +#endif +#ifndef __BSD_VISIBLE +# define __BSD_VISIBLE 1 +#endif + +#define __BIONIC__ 1 +#include <android/api-level.h> + +/* __NDK_FPABI__ or __NDK_FPABI_MATH__ are applied to APIs taking or returning float or + [long] double, to ensure even at the presence of -mhard-float (which implies + -mfloat-abi=hard), calling to 32-bit Android native APIs still follow -mfloat-abi=softfp. + + __NDK_FPABI_MATH__ is applied to APIs in math.h. It normally equals to __NDK_FPABI__, + but allows use of customized libm.a compiled with -mhard-float by -D_NDK_MATH_NO_SOFTFP=1 + + NOTE: Disable for clang for now unless _NDK_MATH_NO_SOFTFP=1, because clang before 3.4 doesn't + allow change of calling convension for builtin and produces error message reads: + + a.i:564:6: error: function declared 'aapcs' here was previously declared without calling convention + int sin(double d) __attribute__((pcs("aapcs"))); + ^ + a.i:564:6: note: previous declaration is here + */ +#if defined(__ANDROID__) && !__LP64__ && defined( __arm__) +#define __NDK_FPABI__ __attribute__((pcs("aapcs"))) +#else +#define __NDK_FPABI__ +#endif + +#if (!defined(_NDK_MATH_NO_SOFTFP) || _NDK_MATH_NO_SOFTFP != 1) && !defined(__clang__) +#define __NDK_FPABI_MATH__ __NDK_FPABI__ +#else +#define __NDK_FPABI_MATH__ /* nothing */ +#endif + +#endif /* !_SYS_CDEFS_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/cdefs_elf.h b/9/platforms/android-16/arch-mips/usr/include/sys/cdefs_elf.h new file mode 100644 index 0000000..5d2e0f3 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/cdefs_elf.h @@ -0,0 +1,156 @@ +/* $NetBSD: cdefs_elf.h,v 1.22 2005/02/26 22:25:34 perry Exp $ */ + +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#ifndef _SYS_CDEFS_ELF_H_ +#define _SYS_CDEFS_ELF_H_ + +#ifdef __LEADING_UNDERSCORE +#define _C_LABEL(x) __CONCAT(_,x) +#define _C_LABEL_STRING(x) "_" x +#else +#define _C_LABEL(x) x +#define _C_LABEL_STRING(x) x +#endif + +#if __STDC__ +#define ___RENAME(x) __asm__(___STRING(_C_LABEL(x))) +#else +#ifdef __LEADING_UNDERSCORE +#define ___RENAME(x) ____RENAME(_/**/x) +#define ____RENAME(x) __asm__(___STRING(x)) +#else +#define ___RENAME(x) __asm__(___STRING(x)) +#endif +#endif + +#define __indr_reference(sym,alias) /* nada, since we do weak refs */ + +#if __STDC__ +#define __strong_alias(alias,sym) \ + __asm__(".global " _C_LABEL_STRING(#alias) "\n" \ + _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym)); + +#define __weak_alias(alias,sym) \ + __asm__(".weak " _C_LABEL_STRING(#alias) "\n" \ + _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym)); +#define __weak_extern(sym) \ + __asm__(".weak " _C_LABEL_STRING(#sym)); +#define __warn_references(sym,msg) \ + __asm__(".section .gnu.warning." #sym "\n\t.ascii \"" msg "\"\n\t.text"); + +#else /* !__STDC__ */ + +#ifdef __LEADING_UNDERSCORE +#define __weak_alias(alias,sym) ___weak_alias(_/**/alias,_/**/sym) +#define ___weak_alias(alias,sym) \ + __asm__(".weak alias\nalias = sym"); +#else +#define __weak_alias(alias,sym) \ + __asm__(".weak alias\nalias = sym"); +#endif +#ifdef __LEADING_UNDERSCORE +#define __weak_extern(sym) ___weak_extern(_/**/sym) +#define ___weak_extern(sym) \ + __asm__(".weak sym"); +#else +#define __weak_extern(sym) \ + __asm__(".weak sym"); +#endif +#define __warn_references(sym,msg) \ + __asm__(".section .gnu.warning.sym\n\t.ascii msg ; .text"); + +#endif /* !__STDC__ */ + +#if __STDC__ +#define __SECTIONSTRING(_sec, _str) \ + __asm__(".section " #_sec "\n\t.asciz \"" _str "\"\n\t.previous") +#else +#define __SECTIONSTRING(_sec, _str) \ + __asm__(".section _sec\n\t.asciz _str\n\t.previous") +#endif + +/* GCC visibility helper macro */ +#define __LIBC_HIDDEN__ \ + __attribute__ ((visibility ("hidden"))) + +#define __IDSTRING(_n,_s) __SECTIONSTRING(.ident,_s) + +#define __RCSID(_s) __IDSTRING(rcsid,_s) +#define __SCCSID(_s) +#define __SCCSID2(_s) +#if 0 /* XXX userland __COPYRIGHTs have \ns in them */ +#define __COPYRIGHT(_s) __SECTIONSTRING(.copyright,_s) +#else +#define __COPYRIGHT(_s) \ + static const char copyright[] \ + __attribute__((__unused__,__section__(".copyright"))) = _s +#endif + +#define __KERNEL_RCSID(_n, _s) __RCSID(_s) +#define __KERNEL_SCCSID(_n, _s) +#if 0 /* XXX see above */ +#define __KERNEL_COPYRIGHT(_n, _s) __COPYRIGHT(_s) +#else +#define __KERNEL_COPYRIGHT(_n, _s) __SECTIONSTRING(.copyright, _s) +#endif + +#ifndef __lint__ +#define __link_set_make_entry(set, sym) \ + static void const * const __link_set_##set##_sym_##sym \ + __section("link_set_" #set) __used = &sym +#define __link_set_make_entry2(set, sym, n) \ + static void const * const __link_set_##set##_sym_##sym##_##n \ + __section("link_set_" #set) __used = &sym[n] +#else +#define __link_set_make_entry(set, sym) \ + extern void const * const __link_set_##set##_sym_##sym +#define __link_set_make_entry2(set, sym, n) \ + extern void const * const __link_set_##set##_sym_##sym##_##n +#endif /* __lint__ */ + +#define __link_set_add_text(set, sym) __link_set_make_entry(set, sym) +#define __link_set_add_rodata(set, sym) __link_set_make_entry(set, sym) +#define __link_set_add_data(set, sym) __link_set_make_entry(set, sym) +#define __link_set_add_bss(set, sym) __link_set_make_entry(set, sym) +#define __link_set_add_text2(set, sym, n) __link_set_make_entry2(set, sym, n) +#define __link_set_add_rodata2(set, sym, n) __link_set_make_entry2(set, sym, n) +#define __link_set_add_data2(set, sym, n) __link_set_make_entry2(set, sym, n) +#define __link_set_add_bss2(set, sym, n) __link_set_make_entry2(set, sym, n) + +#define __link_set_decl(set, ptype) \ + extern ptype * const __start_link_set_##set[]; \ + extern ptype * const __stop_link_set_##set[] \ + +#define __link_set_start(set) (__start_link_set_##set) +#define __link_set_end(set) (__stop_link_set_##set) + +#define __link_set_count(set) \ + (__link_set_end(set) - __link_set_start(set)) + +#endif /* !_SYS_CDEFS_ELF_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/dirent.h b/9/platforms/android-16/arch-mips/usr/include/sys/dirent.h new file mode 100644 index 0000000..da96f5e --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/dirent.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_DIRENT_H_ +#define _SYS_DIRENT_H_ + +#include <stdint.h> +#include <sys/cdefs.h> + +__BEGIN_DECLS + +/* this corresponds to the kernel dirent64 */ +struct dirent { + uint64_t d_ino; + int64_t d_off; + unsigned short d_reclen; + unsigned char d_type; + char d_name[256]; +}; + +extern int getdents(unsigned int, struct dirent *, unsigned int); + +__END_DECLS + +#endif /* _SYS_DIRENT_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/endian.h b/9/platforms/android-16/arch-mips/usr/include/sys/endian.h new file mode 100644 index 0000000..2a0c658 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/endian.h @@ -0,0 +1,274 @@ +/* $OpenBSD: endian.h,v 1.17 2006/01/06 18:53:05 millert Exp $ */ + +/*- + * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Generic definitions for little- and big-endian systems. Other endianesses + * has to be dealt with in the specific machine/endian.h file for that port. + * + * This file is meant to be included from a little- or big-endian port's + * machine/endian.h after setting _BYTE_ORDER to either 1234 for little endian + * or 4321 for big.. + */ + +#ifndef _SYS_ENDIAN_H_ +#define _SYS_ENDIAN_H_ + +#include <sys/cdefs.h> +#include <machine/endian.h> +#include <machine/_types.h> + +#define _LITTLE_ENDIAN 1234 +#define _BIG_ENDIAN 4321 +#define _PDP_ENDIAN 3412 + +#if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER +#endif + +#ifdef __GNUC__ + +#define __swap16gen(x) __statement({ \ + __uint16_t __swap16gen_x = (x); \ + \ + (__uint16_t)((__swap16gen_x & 0xff) << 8 | \ + (__swap16gen_x & 0xff00) >> 8); \ +}) + +#define __swap32gen(x) __statement({ \ + __uint32_t __swap32gen_x = (x); \ + \ + (__uint32_t)((__swap32gen_x & 0xff) << 24 | \ + (__swap32gen_x & 0xff00) << 8 | \ + (__swap32gen_x & 0xff0000) >> 8 | \ + (__swap32gen_x & 0xff000000) >> 24); \ +}) + +#define __swap64gen(x) __statement({ \ + __uint64_t __swap64gen_x = (x); \ + \ + (__uint64_t)((__swap64gen_x & 0xff) << 56 | \ + (__swap64gen_x & 0xff00ULL) << 40 | \ + (__swap64gen_x & 0xff0000ULL) << 24 | \ + (__swap64gen_x & 0xff000000ULL) << 8 | \ + (__swap64gen_x & 0xff00000000ULL) >> 8 | \ + (__swap64gen_x & 0xff0000000000ULL) >> 24 | \ + (__swap64gen_x & 0xff000000000000ULL) >> 40 | \ + (__swap64gen_x & 0xff00000000000000ULL) >> 56); \ +}) + +#else /* __GNUC__ */ + +/* Note that these macros evaluate their arguments several times. */ +#define __swap16gen(x) \ + (__uint16_t)(((__uint16_t)(x) & 0xff) << 8 | ((__uint16_t)(x) & 0xff00) >> 8) + +#define __swap32gen(x) \ + (__uint32_t)(((__uint32_t)(x) & 0xff) << 24 | \ + ((__uint32_t)(x) & 0xff00) << 8 | ((__uint32_t)(x) & 0xff0000) >> 8 |\ + ((__uint32_t)(x) & 0xff000000) >> 24) + +#define __swap64gen(x) \ + (__uint64_t)((((__uint64_t)(x) & 0xff) << 56) | \ + ((__uint64_t)(x) & 0xff00ULL) << 40 | \ + ((__uint64_t)(x) & 0xff0000ULL) << 24 | \ + ((__uint64_t)(x) & 0xff000000ULL) << 8 | \ + ((__uint64_t)(x) & 0xff00000000ULL) >> 8 | \ + ((__uint64_t)(x) & 0xff0000000000ULL) >> 24 | \ + ((__uint64_t)(x) & 0xff000000000000ULL) >> 40 | \ + ((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) + +#endif /* __GNUC__ */ + +/* + * Define MD_SWAP if you provide swap{16,32}md functions/macros that are + * optimized for your architecture, These will be used for swap{16,32} + * unless the argument is a constant and we are using GCC, where we can + * take advantage of the CSE phase much better by using the generic version. + */ +#ifdef MD_SWAP +#if __GNUC__ + +#define __swap16(x) __statement({ \ + __uint16_t __swap16_x = (x); \ + \ + __builtin_constant_p(x) ? __swap16gen(__swap16_x) : \ + __swap16md(__swap16_x); \ +}) + +#define __swap32(x) __statement({ \ + __uint32_t __swap32_x = (x); \ + \ + __builtin_constant_p(x) ? __swap32gen(__swap32_x) : \ + __swap32md(__swap32_x); \ +}) + +#define __swap64(x) __statement({ \ + __uint64_t __swap64_x = (x); \ + \ + __builtin_constant_p(x) ? __swap64gen(__swap64_x) : \ + __swap64md(__swap64_x); \ +}) + +#endif /* __GNUC__ */ + +#else /* MD_SWAP */ +#define __swap16 __swap16gen +#define __swap32 __swap32gen +#define __swap64 __swap64gen +#endif /* MD_SWAP */ + +#define __swap16_multi(v, n) do { \ + __size_t __swap16_multi_n = (n); \ + __uint16_t *__swap16_multi_v = (v); \ + \ + while (__swap16_multi_n) { \ + *__swap16_multi_v = swap16(*__swap16_multi_v); \ + __swap16_multi_v++; \ + __swap16_multi_n--; \ + } \ +} while (0) + +#if __BSD_VISIBLE +#define swap16 __swap16 +#define swap32 __swap32 +#define swap64 __swap64 +#define swap16_multi __swap16_multi + +__BEGIN_DECLS +__uint64_t htobe64(__uint64_t); +__uint32_t htobe32(__uint32_t); +__uint16_t htobe16(__uint16_t); +__uint64_t betoh64(__uint64_t); +__uint32_t betoh32(__uint32_t); +__uint16_t betoh16(__uint16_t); + +__uint64_t htole64(__uint64_t); +__uint32_t htole32(__uint32_t); +__uint16_t htole16(__uint16_t); +__uint64_t letoh64(__uint64_t); +__uint32_t letoh32(__uint32_t); +__uint16_t letoh16(__uint16_t); +__END_DECLS +#endif /* __BSD_VISIBLE */ + +#if _BYTE_ORDER == _LITTLE_ENDIAN + +/* Can be overridden by machine/endian.h before inclusion of this file. */ +#ifndef _QUAD_HIGHWORD +#define _QUAD_HIGHWORD 1 +#endif +#ifndef _QUAD_LOWWORD +#define _QUAD_LOWWORD 0 +#endif + +#if __BSD_VISIBLE +#define htobe16 __swap16 +#define htobe32 __swap32 +#define htobe64 __swap64 +#define betoh16 __swap16 +#define betoh32 __swap32 +#define betoh64 __swap64 + +#define htole16(x) (x) +#define htole32(x) (x) +#define htole64(x) (x) +#define letoh16(x) (x) +#define letoh32(x) (x) +#define letoh64(x) (x) +#endif /* __BSD_VISIBLE */ + +#define htons(x) __swap16(x) +#define htonl(x) __swap32(x) +#define ntohs(x) __swap16(x) +#define ntohl(x) __swap32(x) + +/* Bionic additions */ +#define ntohq(x) __swap64(x) +#define htonq(x) __swap64(x) + +#define __LITTLE_ENDIAN_BITFIELD + +#endif /* _BYTE_ORDER */ + +#if _BYTE_ORDER == _BIG_ENDIAN + +/* Can be overridden by machine/endian.h before inclusion of this file. */ +#ifndef _QUAD_HIGHWORD +#define _QUAD_HIGHWORD 0 +#endif +#ifndef _QUAD_LOWWORD +#define _QUAD_LOWWORD 1 +#endif + +#if __BSD_VISIBLE +#define htole16 __swap16 +#define htole32 __swap32 +#define htole64 __swap64 +#define letoh16 __swap16 +#define letoh32 __swap32 +#define letoh64 __swap64 + +#define htobe16(x) (x) +#define htobe32(x) (x) +#define htobe64(x) (x) +#define betoh16(x) (x) +#define betoh32(x) (x) +#define betoh64(x) (x) +#endif /* __BSD_VISIBLE */ + +#define htons(x) (x) +#define htonl(x) (x) +#define ntohs(x) (x) +#define ntohl(x) (x) + +/* Bionic additions */ +#define ntohq(x) (x) +#define htonq(x) (x) + +#define __BIG_ENDIAN_BITFIELD + +#endif /* _BYTE_ORDER */ + +#if __BSD_VISIBLE +#define NTOHL(x) (x) = ntohl((u_int32_t)(x)) +#define NTOHS(x) (x) = ntohs((u_int16_t)(x)) +#define HTONL(x) (x) = htonl((u_int32_t)(x)) +#define HTONS(x) (x) = htons((u_int16_t)(x)) +#endif + + +#define __BYTE_ORDER _BYTE_ORDER +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN _LITTLE_ENDIAN +#endif +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN _BIG_ENDIAN +#endif + +#endif /* _SYS_ENDIAN_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/epoll.h b/9/platforms/android-16/arch-mips/usr/include/sys/epoll.h new file mode 100644 index 0000000..decdb46 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/epoll.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_EPOLL_H_ +#define _SYS_EPOLL_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#define EPOLLIN 0x00000001 +#define EPOLLPRI 0x00000002 +#define EPOLLOUT 0x00000004 +#define EPOLLERR 0x00000008 +#define EPOLLHUP 0x00000010 +#define EPOLLRDNORM 0x00000040 +#define EPOLLRDBAND 0x00000080 +#define EPOLLWRNORM 0x00000100 +#define EPOLLWRBAND 0x00000200 +#define EPOLLMSG 0x00000400 +#define EPOLLET 0x80000000 + +#define EPOLL_CTL_ADD 1 +#define EPOLL_CTL_DEL 2 +#define EPOLL_CTL_MOD 3 + +typedef union epoll_data +{ + void *ptr; + int fd; + unsigned int u32; + unsigned long long u64; +} epoll_data_t; + +struct epoll_event +{ + unsigned int events; + epoll_data_t data; +}; + +int epoll_create(int size); +int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); +int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout); + +__END_DECLS + +#endif /* _SYS_EPOLL_H_ */ + diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/errno.h b/9/platforms/android-16/arch-mips/usr/include/sys/errno.h new file mode 100644 index 0000000..339f4fc --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/errno.h @@ -0,0 +1 @@ +#include <errno.h> diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/eventfd.h b/9/platforms/android-16/arch-mips/usr/include/sys/eventfd.h new file mode 100644 index 0000000..19244a5 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/eventfd.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_EVENTFD_H +#define _SYS_EVENTFD_H + +#include <sys/cdefs.h> +#include <fcntl.h> + +__BEGIN_DECLS + +#define EFD_CLOEXEC O_CLOEXEC +#define EFD_NONBLOCK O_NONBLOCK + +/* type of event counter */ +typedef uint64_t eventfd_t; + +extern int eventfd(unsigned int initval, int flags); + +/* Compatibility with GLibc */ +extern int eventfd_read(int fd, eventfd_t *counter); +extern int eventfd_write(int fd, const eventfd_t counter); + +__END_DECLS + +#endif /* _SYS_EVENTFD_H */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/exec_elf.h b/9/platforms/android-16/arch-mips/usr/include/sys/exec_elf.h new file mode 100644 index 0000000..f72f81e --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/exec_elf.h @@ -0,0 +1,625 @@ +/* $OpenBSD: exec_elf.h,v 1.41 2006/01/06 18:53:05 millert Exp $ */ +/* + * Copyright (c) 1995, 1996 Erik Theisen. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This is the ELF ABI header file + * formerly known as "elf_abi.h". + */ + +#ifndef _SYS_EXEC_ELF_H_ +#define _SYS_EXEC_ELF_H_ + +#include <machine/_types.h> +#include <machine/exec.h> + +typedef __uint8_t Elf_Byte; + +typedef __uint32_t Elf32_Addr; /* Unsigned program address */ +typedef __uint32_t Elf32_Off; /* Unsigned file offset */ +typedef __int32_t Elf32_Sword; /* Signed large integer */ +typedef __uint32_t Elf32_Word; /* Unsigned large integer */ +typedef __uint16_t Elf32_Half; /* Unsigned medium integer */ + +typedef __uint64_t Elf64_Addr; +typedef __uint64_t Elf64_Off; +typedef __int32_t Elf64_Shalf; + +#ifdef __alpha__ +typedef __int64_t Elf64_Sword; +typedef __uint64_t Elf64_Word; +#else +typedef __int32_t Elf64_Sword; +typedef __uint32_t Elf64_Word; +#endif + +typedef __int64_t Elf64_Sxword; +typedef __uint64_t Elf64_Xword; + +typedef __uint32_t Elf64_Half; +typedef __uint16_t Elf64_Quarter; + +/* + * e_ident[] identification indexes + * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html + */ +#define EI_MAG0 0 /* file ID */ +#define EI_MAG1 1 /* file ID */ +#define EI_MAG2 2 /* file ID */ +#define EI_MAG3 3 /* file ID */ +#define EI_CLASS 4 /* file class */ +#define EI_DATA 5 /* data encoding */ +#define EI_VERSION 6 /* ELF header version */ +#define EI_OSABI 7 /* OS/ABI ID */ +#define EI_ABIVERSION 8 /* ABI version */ +#define EI_PAD 9 /* start of pad bytes */ +#define EI_NIDENT 16 /* Size of e_ident[] */ + +/* e_ident[] magic number */ +#define ELFMAG0 0x7f /* e_ident[EI_MAG0] */ +#define ELFMAG1 'E' /* e_ident[EI_MAG1] */ +#define ELFMAG2 'L' /* e_ident[EI_MAG2] */ +#define ELFMAG3 'F' /* e_ident[EI_MAG3] */ +#define ELFMAG "\177ELF" /* magic */ +#define SELFMAG 4 /* size of magic */ + +/* e_ident[] file class */ +#define ELFCLASSNONE 0 /* invalid */ +#define ELFCLASS32 1 /* 32-bit objs */ +#define ELFCLASS64 2 /* 64-bit objs */ +#define ELFCLASSNUM 3 /* number of classes */ + +/* e_ident[] data encoding */ +#define ELFDATANONE 0 /* invalid */ +#define ELFDATA2LSB 1 /* Little-Endian */ +#define ELFDATA2MSB 2 /* Big-Endian */ +#define ELFDATANUM 3 /* number of data encode defines */ + +/* e_ident[] Operating System/ABI */ +#define ELFOSABI_SYSV 0 /* UNIX System V ABI */ +#define ELFOSABI_HPUX 1 /* HP-UX operating system */ +#define ELFOSABI_NETBSD 2 /* NetBSD */ +#define ELFOSABI_LINUX 3 /* GNU/Linux */ +#define ELFOSABI_HURD 4 /* GNU/Hurd */ +#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */ +#define ELFOSABI_SOLARIS 6 /* Solaris */ +#define ELFOSABI_MONTEREY 7 /* Monterey */ +#define ELFOSABI_IRIX 8 /* IRIX */ +#define ELFOSABI_FREEBSD 9 /* FreeBSD */ +#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ +#define ELFOSABI_MODESTO 11 /* Novell Modesto */ +#define ELFOSABI_OPENBSD 12 /* OpenBSD */ +#define ELFOSABI_ARM 97 /* ARM */ +#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ + +/* e_ident */ +#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ + (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ + (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ + (ehdr).e_ident[EI_MAG3] == ELFMAG3) + +/* ELF Header */ +typedef struct elfhdr { + unsigned char e_ident[EI_NIDENT]; /* ELF Identification */ + Elf32_Half e_type; /* object file type */ + Elf32_Half e_machine; /* machine */ + Elf32_Word e_version; /* object file version */ + Elf32_Addr e_entry; /* virtual entry point */ + Elf32_Off e_phoff; /* program header table offset */ + Elf32_Off e_shoff; /* section header table offset */ + Elf32_Word e_flags; /* processor-specific flags */ + Elf32_Half e_ehsize; /* ELF header size */ + Elf32_Half e_phentsize; /* program header entry size */ + Elf32_Half e_phnum; /* number of program header entries */ + Elf32_Half e_shentsize; /* section header entry size */ + Elf32_Half e_shnum; /* number of section header entries */ + Elf32_Half e_shstrndx; /* section header table's "section + header string table" entry offset */ +} Elf32_Ehdr; + +typedef struct { + unsigned char e_ident[EI_NIDENT]; /* Id bytes */ + Elf64_Quarter e_type; /* file type */ + Elf64_Quarter e_machine; /* machine type */ + Elf64_Half e_version; /* version number */ + Elf64_Addr e_entry; /* entry point */ + Elf64_Off e_phoff; /* Program hdr offset */ + Elf64_Off e_shoff; /* Section hdr offset */ + Elf64_Half e_flags; /* Processor flags */ + Elf64_Quarter e_ehsize; /* sizeof ehdr */ + Elf64_Quarter e_phentsize; /* Program header entry size */ + Elf64_Quarter e_phnum; /* Number of program headers */ + Elf64_Quarter e_shentsize; /* Section header entry size */ + Elf64_Quarter e_shnum; /* Number of section headers */ + Elf64_Quarter e_shstrndx; /* String table index */ +} Elf64_Ehdr; + +/* e_type */ +#define ET_NONE 0 /* No file type */ +#define ET_REL 1 /* relocatable file */ +#define ET_EXEC 2 /* executable file */ +#define ET_DYN 3 /* shared object file */ +#define ET_CORE 4 /* core file */ +#define ET_NUM 5 /* number of types */ +#define ET_LOPROC 0xff00 /* reserved range for processor */ +#define ET_HIPROC 0xffff /* specific e_type */ + +/* e_machine */ +#define EM_NONE 0 /* No Machine */ +#define EM_M32 1 /* AT&T WE 32100 */ +#define EM_SPARC 2 /* SPARC */ +#define EM_386 3 /* Intel 80386 */ +#define EM_68K 4 /* Motorola 68000 */ +#define EM_88K 5 /* Motorola 88000 */ +#define EM_486 6 /* Intel 80486 - unused? */ +#define EM_860 7 /* Intel 80860 */ +#define EM_MIPS 8 /* MIPS R3000 Big-Endian only */ +/* + * Don't know if EM_MIPS_RS4_BE, + * EM_SPARC64, EM_PARISC, + * or EM_PPC are ABI compliant + */ +#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ +#define EM_SPARC64 11 /* SPARC v9 64-bit unoffical */ +#define EM_PARISC 15 /* HPPA */ +#define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */ +#define EM_PPC 20 /* PowerPC */ +#define EM_ARM 40 /* Advanced RISC Machines ARM */ +#define EM_ALPHA 41 /* DEC ALPHA */ +#define EM_SPARCV9 43 /* SPARC version 9 */ +#define EM_ALPHA_EXP 0x9026 /* DEC ALPHA */ +#define EM_AMD64 62 /* AMD64 architecture */ +#define EM_VAX 75 /* DEC VAX */ +#define EM_NUM 15 /* number of machine types */ + +/* Version */ +#define EV_NONE 0 /* Invalid */ +#define EV_CURRENT 1 /* Current */ +#define EV_NUM 2 /* number of versions */ + +/* Section Header */ +typedef struct { + Elf32_Word sh_name; /* name - index into section header + string table section */ + Elf32_Word sh_type; /* type */ + Elf32_Word sh_flags; /* flags */ + Elf32_Addr sh_addr; /* address */ + Elf32_Off sh_offset; /* file offset */ + Elf32_Word sh_size; /* section size */ + Elf32_Word sh_link; /* section header table index link */ + Elf32_Word sh_info; /* extra information */ + Elf32_Word sh_addralign; /* address alignment */ + Elf32_Word sh_entsize; /* section entry size */ +} Elf32_Shdr; + +typedef struct { + Elf64_Half sh_name; /* section name */ + Elf64_Half sh_type; /* section type */ + Elf64_Xword sh_flags; /* section flags */ + Elf64_Addr sh_addr; /* virtual address */ + Elf64_Off sh_offset; /* file offset */ + Elf64_Xword sh_size; /* section size */ + Elf64_Half sh_link; /* link to another */ + Elf64_Half sh_info; /* misc info */ + Elf64_Xword sh_addralign; /* memory alignment */ + Elf64_Xword sh_entsize; /* table entry size */ +} Elf64_Shdr; + +/* Special Section Indexes */ +#define SHN_UNDEF 0 /* undefined */ +#define SHN_LORESERVE 0xff00 /* lower bounds of reserved indexes */ +#define SHN_LOPROC 0xff00 /* reserved range for processor */ +#define SHN_HIPROC 0xff1f /* specific section indexes */ +#define SHN_ABS 0xfff1 /* absolute value */ +#define SHN_COMMON 0xfff2 /* common symbol */ +#define SHN_HIRESERVE 0xffff /* upper bounds of reserved indexes */ + +/* sh_type */ +#define SHT_NULL 0 /* inactive */ +#define SHT_PROGBITS 1 /* program defined information */ +#define SHT_SYMTAB 2 /* symbol table section */ +#define SHT_STRTAB 3 /* string table section */ +#define SHT_RELA 4 /* relocation section with addends*/ +#define SHT_HASH 5 /* symbol hash table section */ +#define SHT_DYNAMIC 6 /* dynamic section */ +#define SHT_NOTE 7 /* note section */ +#define SHT_NOBITS 8 /* no space section */ +#define SHT_REL 9 /* relation section without addends */ +#define SHT_SHLIB 10 /* reserved - purpose unknown */ +#define SHT_DYNSYM 11 /* dynamic symbol table section */ +#define SHT_NUM 12 /* number of section types */ +#define SHT_LOPROC 0x70000000 /* reserved range for processor */ +#define SHT_HIPROC 0x7fffffff /* specific section header types */ +#define SHT_LOUSER 0x80000000 /* reserved range for application */ +#define SHT_HIUSER 0xffffffff /* specific indexes */ + +/* Section names */ +#define ELF_BSS ".bss" /* uninitialized data */ +#define ELF_DATA ".data" /* initialized data */ +#define ELF_DEBUG ".debug" /* debug */ +#define ELF_DYNAMIC ".dynamic" /* dynamic linking information */ +#define ELF_DYNSTR ".dynstr" /* dynamic string table */ +#define ELF_DYNSYM ".dynsym" /* dynamic symbol table */ +#define ELF_FINI ".fini" /* termination code */ +#define ELF_GOT ".got" /* global offset table */ +#define ELF_HASH ".hash" /* symbol hash table */ +#define ELF_INIT ".init" /* initialization code */ +#define ELF_REL_DATA ".rel.data" /* relocation data */ +#define ELF_REL_FINI ".rel.fini" /* relocation termination code */ +#define ELF_REL_INIT ".rel.init" /* relocation initialization code */ +#define ELF_REL_DYN ".rel.dyn" /* relocaltion dynamic link info */ +#define ELF_REL_RODATA ".rel.rodata" /* relocation read-only data */ +#define ELF_REL_TEXT ".rel.text" /* relocation code */ +#define ELF_RODATA ".rodata" /* read-only data */ +#define ELF_SHSTRTAB ".shstrtab" /* section header string table */ +#define ELF_STRTAB ".strtab" /* string table */ +#define ELF_SYMTAB ".symtab" /* symbol table */ +#define ELF_TEXT ".text" /* code */ + + +/* Section Attribute Flags - sh_flags */ +#define SHF_WRITE 0x1 /* Writable */ +#define SHF_ALLOC 0x2 /* occupies memory */ +#define SHF_EXECINSTR 0x4 /* executable */ +#define SHF_MASKPROC 0xf0000000 /* reserved bits for processor */ + /* specific section attributes */ + +/* Symbol Table Entry */ +typedef struct elf32_sym { + Elf32_Word st_name; /* name - index into string table */ + Elf32_Addr st_value; /* symbol value */ + Elf32_Word st_size; /* symbol size */ + unsigned char st_info; /* type and binding */ + unsigned char st_other; /* 0 - no defined meaning */ + Elf32_Half st_shndx; /* section header index */ +} Elf32_Sym; + +typedef struct { + Elf64_Half st_name; /* Symbol name index in str table */ + Elf_Byte st_info; /* type / binding attrs */ + Elf_Byte st_other; /* unused */ + Elf64_Quarter st_shndx; /* section index of symbol */ + Elf64_Xword st_value; /* value of symbol */ + Elf64_Xword st_size; /* size of symbol */ +} Elf64_Sym; + +/* Symbol table index */ +#define STN_UNDEF 0 /* undefined */ + +/* Extract symbol info - st_info */ +#define ELF32_ST_BIND(x) ((x) >> 4) +#define ELF32_ST_TYPE(x) (((unsigned int) x) & 0xf) +#define ELF32_ST_INFO(b,t) (((b) << 4) + ((t) & 0xf)) + +#define ELF64_ST_BIND(x) ((x) >> 4) +#define ELF64_ST_TYPE(x) (((unsigned int) x) & 0xf) +#define ELF64_ST_INFO(b,t) (((b) << 4) + ((t) & 0xf)) + +/* Symbol Binding - ELF32_ST_BIND - st_info */ +#define STB_LOCAL 0 /* Local symbol */ +#define STB_GLOBAL 1 /* Global symbol */ +#define STB_WEAK 2 /* like global - lower precedence */ +#define STB_NUM 3 /* number of symbol bindings */ +#define STB_LOPROC 13 /* reserved range for processor */ +#define STB_HIPROC 15 /* specific symbol bindings */ + +/* Symbol type - ELF32_ST_TYPE - st_info */ +#define STT_NOTYPE 0 /* not specified */ +#define STT_OBJECT 1 /* data object */ +#define STT_FUNC 2 /* function */ +#define STT_SECTION 3 /* section */ +#define STT_FILE 4 /* file */ +#define STT_NUM 5 /* number of symbol types */ +#define STT_LOPROC 13 /* reserved range for processor */ +#define STT_HIPROC 15 /* specific symbol types */ + +/* Relocation entry with implicit addend */ +typedef struct { + Elf32_Addr r_offset; /* offset of relocation */ + Elf32_Word r_info; /* symbol table index and type */ +} Elf32_Rel; + +/* Relocation entry with explicit addend */ +typedef struct { + Elf32_Addr r_offset; /* offset of relocation */ + Elf32_Word r_info; /* symbol table index and type */ + Elf32_Sword r_addend; +} Elf32_Rela; + +/* Extract relocation info - r_info */ +#define ELF32_R_SYM(i) ((i) >> 8) +#define ELF32_R_TYPE(i) ((unsigned char) (i)) +#define ELF32_R_INFO(s,t) (((s) << 8) + (unsigned char)(t)) + +typedef struct { + Elf64_Xword r_offset; /* where to do it */ + Elf64_Xword r_info; /* index & type of relocation */ +} Elf64_Rel; + +typedef struct { + Elf64_Xword r_offset; /* where to do it */ + Elf64_Xword r_info; /* index & type of relocation */ + Elf64_Sxword r_addend; /* adjustment value */ +} Elf64_Rela; + +#define ELF64_R_SYM(info) ((info) >> 32) +#define ELF64_R_TYPE(info) ((info) & 0xFFFFFFFF) +#define ELF64_R_INFO(s,t) (((s) << 32) + (__uint32_t)(t)) + +/* Program Header */ +typedef struct { + Elf32_Word p_type; /* segment type */ + Elf32_Off p_offset; /* segment offset */ + Elf32_Addr p_vaddr; /* virtual address of segment */ + Elf32_Addr p_paddr; /* physical address - ignored? */ + Elf32_Word p_filesz; /* number of bytes in file for seg. */ + Elf32_Word p_memsz; /* number of bytes in mem. for seg. */ + Elf32_Word p_flags; /* flags */ + Elf32_Word p_align; /* memory alignment */ +} Elf32_Phdr; + +typedef struct { + Elf64_Half p_type; /* entry type */ + Elf64_Half p_flags; /* flags */ + Elf64_Off p_offset; /* offset */ + Elf64_Addr p_vaddr; /* virtual address */ + Elf64_Addr p_paddr; /* physical address */ + Elf64_Xword p_filesz; /* file size */ + Elf64_Xword p_memsz; /* memory size */ + Elf64_Xword p_align; /* memory & file alignment */ +} Elf64_Phdr; + +/* Segment types - p_type */ +#define PT_NULL 0 /* unused */ +#define PT_LOAD 1 /* loadable segment */ +#define PT_DYNAMIC 2 /* dynamic linking section */ +#define PT_INTERP 3 /* the RTLD */ +#define PT_NOTE 4 /* auxiliary information */ +#define PT_SHLIB 5 /* reserved - purpose undefined */ +#define PT_PHDR 6 /* program header */ +#define PT_NUM 7 /* Number of segment types */ +#define PT_LOOS 0x60000000 /* reserved range for OS */ +#define PT_HIOS 0x6fffffff /* specific segment types */ +#define PT_LOPROC 0x70000000 /* reserved range for processor */ +#define PT_HIPROC 0x7fffffff /* specific segment types */ + +/* Segment flags - p_flags */ +#define PF_X 0x1 /* Executable */ +#define PF_W 0x2 /* Writable */ +#define PF_R 0x4 /* Readable */ +#define PF_MASKPROC 0xf0000000 /* reserved bits for processor */ + /* specific segment flags */ + +/* Dynamic structure */ +typedef struct { + Elf32_Sword d_tag; /* controls meaning of d_val */ + union { + Elf32_Word d_val; /* Multiple meanings - see d_tag */ + Elf32_Addr d_ptr; /* program virtual address */ + } d_un; +} Elf32_Dyn; + +typedef struct { + Elf64_Xword d_tag; /* controls meaning of d_val */ + union { + Elf64_Addr d_ptr; + Elf64_Xword d_val; + } d_un; +} Elf64_Dyn; + +/* Dynamic Array Tags - d_tag */ +#define DT_NULL 0 /* marks end of _DYNAMIC array */ +#define DT_NEEDED 1 /* string table offset of needed lib */ +#define DT_PLTRELSZ 2 /* size of relocation entries in PLT */ +#define DT_PLTGOT 3 /* address PLT/GOT */ +#define DT_HASH 4 /* address of symbol hash table */ +#define DT_STRTAB 5 /* address of string table */ +#define DT_SYMTAB 6 /* address of symbol table */ +#define DT_RELA 7 /* address of relocation table */ +#define DT_RELASZ 8 /* size of relocation table */ +#define DT_RELAENT 9 /* size of relocation entry */ +#define DT_STRSZ 10 /* size of string table */ +#define DT_SYMENT 11 /* size of symbol table entry */ +#define DT_INIT 12 /* address of initialization func. */ +#define DT_FINI 13 /* address of termination function */ +#define DT_SONAME 14 /* string table offset of shared obj */ +#define DT_RPATH 15 /* string table offset of library + search path */ +#define DT_SYMBOLIC 16 /* start sym search in shared obj. */ +#define DT_REL 17 /* address of rel. tbl. w addends */ +#define DT_RELSZ 18 /* size of DT_REL relocation table */ +#define DT_RELENT 19 /* size of DT_REL relocation entry */ +#define DT_PLTREL 20 /* PLT referenced relocation entry */ +#define DT_DEBUG 21 /* bugger */ +#define DT_TEXTREL 22 /* Allow rel. mod. to unwritable seg */ +#define DT_JMPREL 23 /* add. of PLT's relocation entries */ +#define DT_BIND_NOW 24 /* Bind now regardless of env setting */ +#define DT_NUM 25 /* Number used. */ +#define DT_LOPROC 0x70000000 /* reserved range for processor */ +#define DT_HIPROC 0x7fffffff /* specific dynamic array tags */ + +/* Standard ELF hashing function */ +unsigned int elf_hash(const unsigned char *name); + +/* + * Note Definitions + */ +typedef struct { + Elf32_Word namesz; + Elf32_Word descsz; + Elf32_Word type; +} Elf32_Note; + +typedef struct { + Elf64_Half namesz; + Elf64_Half descsz; + Elf64_Half type; +} Elf64_Note; + +/* + * XXX - these _KERNEL items aren't part of the ABI! + */ +#if defined(_KERNEL) || defined(_DYN_LOADER) + +#define ELF32_NO_ADDR ((u_long) ~0) /* Indicates addr. not yet filled in */ +#define ELF_AUX_ENTRIES 8 /* Size of aux array passed to loader */ + +typedef struct { + Elf32_Sword au_id; /* 32-bit id */ + Elf32_Word au_v; /* 32-bit value */ +} Aux32Info; + +#define ELF64_NO_ADDR ((__uint64_t) ~0)/* Indicates addr. not yet filled in */ +#define ELF64_AUX_ENTRIES 8 /* Size of aux array passed to loader */ + +typedef struct { + Elf64_Shalf au_id; /* 32-bit id */ + Elf64_Xword au_v; /* 64-bit id */ +} Aux64Info; + +enum AuxID { + AUX_null = 0, + AUX_ignore = 1, + AUX_execfd = 2, + AUX_phdr = 3, /* &phdr[0] */ + AUX_phent = 4, /* sizeof(phdr[0]) */ + AUX_phnum = 5, /* # phdr entries */ + AUX_pagesz = 6, /* PAGESIZE */ + AUX_base = 7, /* ld.so base addr */ + AUX_flags = 8, /* processor flags */ + AUX_entry = 9, /* a.out entry */ + AUX_sun_uid = 2000, /* euid */ + AUX_sun_ruid = 2001, /* ruid */ + AUX_sun_gid = 2002, /* egid */ + AUX_sun_rgid = 2003 /* rgid */ +}; + +struct elf_args { + u_long arg_entry; /* program entry point */ + u_long arg_interp; /* Interpreter load address */ + u_long arg_phaddr; /* program header address */ + u_long arg_phentsize; /* Size of program header */ + u_long arg_phnum; /* Number of program headers */ + u_long arg_os; /* OS tag */ +}; + +#endif + +#if !defined(ELFSIZE) && defined(ARCH_ELFSIZE) +#define ELFSIZE ARCH_ELFSIZE +#endif + +#if defined(ELFSIZE) +#define CONCAT(x,y) __CONCAT(x,y) +#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x))) +#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) +#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) +#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) +#endif + +#if defined(ELFSIZE) && (ELFSIZE == 32) +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Phdr Elf32_Phdr +#define Elf_Shdr Elf32_Shdr +#define Elf_Sym Elf32_Sym +#define Elf_Rel Elf32_Rel +#define Elf_RelA Elf32_Rela +#define Elf_Dyn Elf32_Dyn +#define Elf_Half Elf32_Half +#define Elf_Word Elf32_Word +#define Elf_Sword Elf32_Sword +#define Elf_Addr Elf32_Addr +#define Elf_Off Elf32_Off +#define Elf_Nhdr Elf32_Nhdr +#define Elf_Note Elf32_Note + +#define ELF_R_SYM ELF32_R_SYM +#define ELF_R_TYPE ELF32_R_TYPE +#define ELF_R_INFO ELF32_R_INFO +#define ELFCLASS ELFCLASS32 + +#define ELF_ST_BIND ELF32_ST_BIND +#define ELF_ST_TYPE ELF32_ST_TYPE +#define ELF_ST_INFO ELF32_ST_INFO + +#define AuxInfo Aux32Info +#elif defined(ELFSIZE) && (ELFSIZE == 64) +#define Elf_Ehdr Elf64_Ehdr +#define Elf_Phdr Elf64_Phdr +#define Elf_Shdr Elf64_Shdr +#define Elf_Sym Elf64_Sym +#define Elf_Rel Elf64_Rel +#define Elf_RelA Elf64_Rela +#define Elf_Dyn Elf64_Dyn +#define Elf_Half Elf64_Half +#define Elf_Word Elf64_Word +#define Elf_Sword Elf64_Sword +#define Elf_Addr Elf64_Addr +#define Elf_Off Elf64_Off +#define Elf_Nhdr Elf64_Nhdr +#define Elf_Note Elf64_Note + +#define ELF_R_SYM ELF64_R_SYM +#define ELF_R_TYPE ELF64_R_TYPE +#define ELF_R_INFO ELF64_R_INFO +#define ELFCLASS ELFCLASS64 + +#define ELF_ST_BIND ELF64_ST_BIND +#define ELF_ST_TYPE ELF64_ST_TYPE +#define ELF_ST_INFO ELF64_ST_INFO + +#define AuxInfo Aux64Info +#endif + +#ifndef _KERNEL +extern Elf_Dyn _DYNAMIC[]; +#endif + +#ifdef _KERNEL +#ifdef _KERN_DO_ELF64 +int exec_elf64_makecmds(struct proc *, struct exec_package *); +void *elf64_copyargs(struct exec_package *, struct ps_strings *, + void *, void *); +int exec_elf64_fixup(struct proc *, struct exec_package *); +char *elf64_check_brand(Elf64_Ehdr *); +int elf64_os_pt_note(struct proc *, struct exec_package *, Elf64_Ehdr *, + char *, size_t, size_t); +#endif +#ifdef _KERN_DO_ELF +int exec_elf32_makecmds(struct proc *, struct exec_package *); +void *elf32_copyargs(struct exec_package *, struct ps_strings *, + void *, void *); +int exec_elf32_fixup(struct proc *, struct exec_package *); +char *elf32_check_brand(Elf32_Ehdr *); +int elf32_os_pt_note(struct proc *, struct exec_package *, Elf32_Ehdr *, + char *, size_t, size_t); +#endif + +#endif /* _KERNEL */ + +#define ELF_TARG_VER 1 /* The ver for which this code is intended */ + +#endif /* _SYS_EXEC_ELF_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/file.h b/9/platforms/android-16/arch-mips/usr/include/sys/file.h new file mode 100644 index 0000000..cf2f4b1 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/file.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_FILE_H_ +#define _SYS_FILE_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +/* ANDROID: needed for flock() */ +#include <unistd.h> +#include <fcntl.h> + +#endif /* _SYS_FILE_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/fsuid.h b/9/platforms/android-16/arch-mips/usr/include/sys/fsuid.h new file mode 100644 index 0000000..bc47e3d --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/fsuid.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_FSUID_H_ +#define _SYS_FSUID_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +__BEGIN_DECLS + +#if 0 /* MISSING FROM BIONIC */ +extern int setfsuid(uid_t); +extern int setfsgid(gid_t); +#endif /* MISSING */ + +__END_DECLS + +#endif /* _SYS_FSUID_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/inotify.h b/9/platforms/android-16/arch-mips/usr/include/sys/inotify.h new file mode 100644 index 0000000..33f9e74 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/inotify.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_INOTIFY_H_ +#define _SYS_INOTIFY_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/inotify.h> + +__BEGIN_DECLS + +extern int inotify_init(void); +extern int inotify_add_watch(int, const char *, __u32); +extern int inotify_rm_watch(int, __u32); + +__END_DECLS + +#endif /* _SYS_INOTIFY_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/ioctl.h b/9/platforms/android-16/arch-mips/usr/include/sys/ioctl.h new file mode 100644 index 0000000..9f68510 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/ioctl.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_IOCTL_H_ +#define _SYS_IOCTL_H_ + +#include <sys/cdefs.h> +#include <linux/ioctl.h> +#include <asm/ioctls.h> +#include <asm/termbits.h> +#include <sys/ioctl_compat.h> + +__BEGIN_DECLS + +extern int ioctl(int, int, ...); + +__END_DECLS + +#endif /* _SYS_IOCTL_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/ioctl_compat.h b/9/platforms/android-16/arch-mips/usr/include/sys/ioctl_compat.h new file mode 100644 index 0000000..d9ba4c7 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/ioctl_compat.h @@ -0,0 +1,174 @@ +/* $NetBSD: ioctl_compat.h,v 1.15 2005/12/03 17:10:46 christos Exp $ */ + +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ioctl_compat.h 8.4 (Berkeley) 1/21/94 + */ + +#ifndef _SYS_IOCTL_COMPAT_H_ +#define _SYS_IOCTL_COMPAT_H_ + +/*#include <sys/ttychars.h>*/ +/*#include <sys/ttydev.h>*/ + +#if !defined(__mips__) +struct tchars { + char t_intrc; /* interrupt */ + char t_quitc; /* quit */ + char t_startc; /* start output */ + char t_stopc; /* stop output */ + char t_eofc; /* end-of-file */ + char t_brkc; /* input delimiter (like nl) */ +}; + +struct ltchars { + char t_suspc; /* stop process signal */ + char t_dsuspc; /* delayed stop process signal */ + char t_rprntc; /* reprint line */ + char t_flushc; /* flush output (toggles) */ + char t_werasc; /* word erase */ + char t_lnextc; /* literal next character */ +}; + +/* + * Structure for TIOCGETP and TIOCSETP ioctls. + */ +#ifndef _SGTTYB_ +#define _SGTTYB_ +struct sgttyb { + char sg_ispeed; /* input speed */ + char sg_ospeed; /* output speed */ + char sg_erase; /* erase character */ + char sg_kill; /* kill character */ + short sg_flags; /* mode flags */ +}; +#endif +#endif + +#ifdef USE_OLD_TTY +# undef TIOCGETD +# define TIOCGETD _IOR('t', 0, int) /* get line discipline */ +# undef TIOCSETD +# define TIOCSETD _IOW('t', 1, int) /* set line discipline */ +#else +# define OTIOCGETD _IOR('t', 0, int) /* get line discipline */ +# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ +#endif +#define TIOCHPCL _IO('t', 2) /* hang up on last close */ +#if !defined(__mips__) +#define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */ +#define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */ +#define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/ +#endif +#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ +#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ +#if 0 +/* BUG: a bunch of these conflict with #defines in asm/termbits.h */ +#define TANDEM 0x00000001 /* send stopc on out q full */ +#define CBREAK 0x00000002 /* half-cooked mode */ +#define LCASE 0x00000004 /* simulate lower case */ +#define ECHO 0x00000008 /* enable echoing */ +#define CRMOD 0x00000010 /* map \r to \r\n on output */ +#define RAW 0x00000020 /* no i/o processing */ +#define ODDP 0x00000040 /* get/send odd parity */ +#define EVENP 0x00000080 /* get/send even parity */ +#define ANYP 0x000000c0 /* get any parity/send none */ +#define NLDELAY 0x00000300 /* \n delay */ +#define NL0 0x00000000 +#define NL1 0x00000100 /* tty 37 */ +#define NL2 0x00000200 /* vt05 */ +#define NL3 0x00000300 +#define TBDELAY 0x00000c00 /* horizontal tab delay */ +#define TAB0 0x00000000 +#define TAB1 0x00000400 /* tty 37 */ +#define TAB2 0x00000800 +#define XTABS 0x00000c00 /* expand tabs on output */ +#define CRDELAY 0x00003000 /* \r delay */ +#define CR0 0x00000000 +#define CR1 0x00001000 /* tn 300 */ +#define CR2 0x00002000 /* tty 37 */ +#define CR3 0x00003000 /* concept 100 */ +#define VTDELAY 0x00004000 /* vertical tab delay */ +#define FF0 0x00000000 +#define FF1 0x00004000 /* tty 37 */ +#define BSDELAY 0x00008000 /* \b delay */ +#define BS0 0x00000000 +#define BS1 0x00008000 +#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) +#define CRTBS 0x00010000 /* do backspacing for crt */ +#define PRTERA 0x00020000 /* \ ... / erase */ +#define CRTERA 0x00040000 /* " \b " to wipe out char */ +#define TILDE 0x00080000 /* hazeltine tilde kludge */ +#define MDMBUF 0x00100000 /* DTR/DCD hardware flow control */ +#define LITOUT 0x00200000 /* literal output */ +#define TOSTOP 0x00400000 /* stop background jobs on output */ +#define FLUSHO 0x00800000 /* output being flushed (state) */ +#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ +#define L001000 0x02000000 +#define CRTKIL 0x04000000 /* kill line with " \b " */ +#define PASS8 0x08000000 +#define CTLECH 0x10000000 /* echo control chars as ^X */ +#define PENDIN 0x20000000 /* re-echo input buffer at next read */ +#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ +#define NOFLSH 0x80000000 /* don't flush output on signal */ +#endif +#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ +#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */ +#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */ +#define TIOCLGET _IOR('t', 124, int) /* get local modes */ +#define LCRTBS (CRTBS>>16) +#define LPRTERA (PRTERA>>16) +#define LCRTERA (CRTERA>>16) +#define LTILDE (TILDE>>16) +#define LMDMBUF (MDMBUF>>16) +#define LLITOUT (LITOUT>>16) +#define LTOSTOP (TOSTOP>>16) +#define LFLUSHO (FLUSHO>>16) +#define LNOHANG (NOHANG>>16) +#define LCRTKIL (CRTKIL>>16) +#define LPASS8 (PASS8>>16) +#define LCTLECH (CTLECH>>16) +#define LPENDIN (PENDIN>>16) +#define LDECCTQ (DECCTQ>>16) +#define LNOFLSH (NOFLSH>>16) +#if !defined(__mips__) +#define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/ +#define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/ +#endif +#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ +#define OTTYDISC 0 +#define NETLDISC 1 +#define NTTYDISC 2 + +#endif /* !_SYS_IOCTL_COMPAT_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/ipc.h b/9/platforms/android-16/arch-mips/usr/include/sys/ipc.h new file mode 100644 index 0000000..c0ae0ba --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/ipc.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_IPC_H +#define _SYS_IPC_H + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/ipc.h> + +__BEGIN_DECLS + +extern key_t ftok(const char* path, int id); + +__END_DECLS + +#endif /* _SYS_IPC_H */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/klog.h b/9/platforms/android-16/arch-mips/usr/include/sys/klog.h new file mode 100644 index 0000000..21bb7d9 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/klog.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_KLOG_H_ +#define _SYS_KLOG_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#define KLOG_CLOSE 0 +#define KLOG_OPEN 1 +#define KLOG_READ 2 +#define KLOG_READ_ALL 3 +#define KLOG_READ_CLEAR 4 +#define KLOG_CLEAR 5 +#define KLOG_DISABLE 6 +#define KLOG_ENABLE 7 +#define KLOG_SETLEVEL 8 +#define KLOG_UNREADSIZE 9 +#define KLOG_WRITE 10 + +extern int klogctl(int, char *, int); + +__END_DECLS + +#endif /* _SYS_KLOG_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/limits.h b/9/platforms/android-16/arch-mips/usr/include/sys/limits.h new file mode 100644 index 0000000..5b127eb --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/limits.h @@ -0,0 +1,180 @@ +/* $OpenBSD: limits.h,v 1.6 2005/12/13 00:35:23 millert Exp $ */ +/* + * Copyright (c) 2002 Marc Espie. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD + * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SYS_LIMITS_H_ +#define _SYS_LIMITS_H_ + +#include <sys/cdefs.h> +#include <linux/limits.h> + +/* Common definitions for limits.h. */ + +/* + * <machine/internal_types.h> is meant to describe a specific architecture, + * but to be a safe include, that doesn't ever define anything that is + * user-visible (only typedefs and #define names that stays in the __xxx + * namespace). + * + * __machine_has_unsigned_chars (default is signed chars) + * __FLT_xxx/__DBL_xxx non standard values for floating + * points limits. + */ +#include <machine/internal_types.h> + +/* Legacy */ +#include <machine/limits.h> + +#define CHAR_BIT 8 /* number of bits in a char */ + +#define SCHAR_MAX 0x7f /* max value for a signed char */ +#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ + +#define UCHAR_MAX 0xffU /* max value for an unsigned char */ +#ifdef __machine_has_unsigned_chars +# define CHAR_MIN 0 /* min value for a char */ +# define CHAR_MAX 0xff /* max value for a char */ +#else +# define CHAR_MAX 0x7f +# define CHAR_MIN (-0x7f-1) +#endif + +#define USHRT_MAX 0xffffU /* max value for an unsigned short */ +#define SHRT_MAX 0x7fff /* max value for a short */ +#define SHRT_MIN (-0x7fff-1) /* min value for a short */ + +#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ +#define INT_MAX 0x7fffffff /* max value for an int */ +#define INT_MIN (-0x7fffffff-1) /* min value for an int */ + +#ifdef __LP64__ +# define ULONG_MAX 0xffffffffffffffffUL + /* max value for unsigned long */ +# define LONG_MAX 0x7fffffffffffffffL + /* max value for a signed long */ +# define LONG_MIN (-0x7fffffffffffffffL-1) + /* min value for a signed long */ +#else +# define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ +# define LONG_MAX 0x7fffffffL /* max value for a long */ +# define LONG_MIN (-0x7fffffffL-1)/* min value for a long */ +#endif + +#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 +# define ULLONG_MAX 0xffffffffffffffffULL + /* max value for unsigned long long */ +# define LLONG_MAX 0x7fffffffffffffffLL + /* max value for a signed long long */ +# define LLONG_MIN (-0x7fffffffffffffffLL-1) + /* min value for a signed long long */ +#endif + +#if __BSD_VISIBLE +# define UID_MAX UINT_MAX /* max value for a uid_t */ +# define GID_MAX UINT_MAX /* max value for a gid_t */ +#endif + + +#ifdef __LP64__ +# define LONG_BIT 64 +#else +# define LONG_BIT 32 +#endif + +/* float.h defines these as well */ +# if !defined(DBL_DIG) +# if defined(__DBL_DIG) +# define DBL_DIG __DBL_DIG +# define DBL_MAX __DBL_MAX +# define DBL_MIN __DBL_MIN + +# define FLT_DIG __FLT_DIG +# define FLT_MAX __FLT_MAX +# define FLT_MIN __FLT_MIN +# else +# define DBL_DIG 15 +# define DBL_MAX 1.7976931348623157E+308 +# define DBL_MIN 2.2250738585072014E-308 + +# define FLT_DIG 6 +# define FLT_MAX 3.40282347E+38F +# define FLT_MIN 1.17549435E-38F +# endif +# endif + +/* Bionic: the following has been optimized out from our processed kernel headers */ + +#define CHILD_MAX 999 +#define OPEN_MAX 256 + +/* Bionic-specific definitions */ + +#define _POSIX_VERSION 200112L /* Posix C language bindings version */ +#define _POSIX2_VERSION -1 /* we don't support Posix command-line tools */ +#define _POSIX2_C_VERSION _POSIX_VERSION +#define _XOPEN_VERSION 500 /* by Posix definition */ +#define _XOPEN_XCU_VERSION -1 /* we don't support command-line utilities */ + +/* tell what we implement legacy stuff when appropriate */ +#if _POSIX_VERSION > 0 +#define _XOPEN_XPG2 1 +#define _XOPEN_XPG3 1 +#define _XOPEN_XPG4 1 +#define _XOPEN_UNIX 1 +#endif + +#define _XOPEN_ENH_I18N -1 /* we don't support internationalization in the C library */ +#define _XOPEN_CRYPT -1 /* don't support X/Open Encryption */ +#define _XOPEN_LEGACY -1 /* don't claim we support these, we have some of them but not all */ +#define _XOPEN_REALTIME -1 /* we don't support all these functions */ +#define _XOPEN_REALTIME_THREADS -1 /* same here */ + +#define _POSIX_REALTIME_SIGNALS -1 /* for now, this is not supported */ +#define _POSIX_PRIORITY_SCHEDULING 1 /* priority scheduling is a Linux feature */ +#define _POSIX_TIMERS 1 /* Posix timers are supported */ +#undef _POSIX_ASYNCHRONOUS_IO /* aio_ functions are not supported */ +#define _POSIX_SYNCHRONIZED_IO 1 /* synchronized i/o supported */ +#define _POSIX_FSYNC 1 /* fdatasync() supported */ +#define _POSIX_MAPPED_FILES 1 /* mmap-ed files supported */ + +/* XXX: TODO: complete and check list here */ + + +#define _POSIX_THREADS 1 /* we support threads */ +#define _POSIX_THREAD_STACKADDR 1 /* we support thread stack address */ +#define _POSIX_THREAD_STACKSIZE 1 /* we support thread stack size */ +#define _POSIX_THREAD_PRIO_INHERIT 200112L /* linux feature */ +#define _POSIX_THREAD_PRIO_PROTECT 200112L /* linux feature */ + +#undef _POSIX_PROCESS_SHARED /* we don't support process-shared synchronization */ +#undef _POSIX_THREAD_SAFE_FUNCTIONS /* most functions are, but not everything yet */ +#define _POSIX_CHOWN_RESTRICTED 1 /* yes, chown requires appropriate privileges */ +#define _POSIX_MONOTONIC_CLOCK 0 /* the monotonic clock may be available; ask sysconf */ +#define _POSIX_NO_TRUNC 1 /* very long pathnames generate an error */ +#define _POSIX_SAVED_IDS 1 /* saved user ids is a Linux feature */ +#define _POSIX_JOB_CONTROL 1 /* job control is a Linux feature */ + + + +#endif diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/linux-syscalls.h b/9/platforms/android-16/arch-mips/usr/include/sys/linux-syscalls.h new file mode 100644 index 0000000..f913d40 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/linux-syscalls.h @@ -0,0 +1,508 @@ +/* auto-generated by gensyscalls.py, do not touch */ +#ifndef _BIONIC_LINUX_SYSCALLS_H_ + +#if !defined __ASM_ARM_UNISTD_H && !defined __ASM_I386_UNISTD_H && !defined __ASM_MIPS_UNISTD_H +#if defined __arm__ && !defined __ARM_EABI__ && !defined __thumb__ +# define __NR_SYSCALL_BASE 0x900000 +#elif defined(__mips__) +# define __NR_SYSCALL_BASE 4000 +#else +# define __NR_SYSCALL_BASE 0 +#endif + +#define __NR_exit (__NR_SYSCALL_BASE + 1) +#define __NR_fork (__NR_SYSCALL_BASE + 2) +#define __NR_read (__NR_SYSCALL_BASE + 3) +#define __NR_write (__NR_SYSCALL_BASE + 4) +#define __NR_open (__NR_SYSCALL_BASE + 5) +#define __NR_close (__NR_SYSCALL_BASE + 6) +#define __NR_link (__NR_SYSCALL_BASE + 9) +#define __NR_unlink (__NR_SYSCALL_BASE + 10) +#define __NR_execve (__NR_SYSCALL_BASE + 11) +#define __NR_chdir (__NR_SYSCALL_BASE + 12) +#define __NR_mknod (__NR_SYSCALL_BASE + 14) +#define __NR_chmod (__NR_SYSCALL_BASE + 15) +#define __NR_lseek (__NR_SYSCALL_BASE + 19) +#define __NR_getpid (__NR_SYSCALL_BASE + 20) +#define __NR_mount (__NR_SYSCALL_BASE + 21) +#define __NR_ptrace (__NR_SYSCALL_BASE + 26) +#define __NR_pause (__NR_SYSCALL_BASE + 29) +#define __NR_access (__NR_SYSCALL_BASE + 33) +#define __NR_sync (__NR_SYSCALL_BASE + 36) +#define __NR_rename (__NR_SYSCALL_BASE + 38) +#define __NR_mkdir (__NR_SYSCALL_BASE + 39) +#define __NR_rmdir (__NR_SYSCALL_BASE + 40) +#define __NR_dup (__NR_SYSCALL_BASE + 41) +#define __NR_times (__NR_SYSCALL_BASE + 43) +#define __NR_brk (__NR_SYSCALL_BASE + 45) +#define __NR_acct (__NR_SYSCALL_BASE + 51) +#define __NR_umount2 (__NR_SYSCALL_BASE + 52) +#define __NR_ioctl (__NR_SYSCALL_BASE + 54) +#define __NR_fcntl (__NR_SYSCALL_BASE + 55) +#define __NR_setpgid (__NR_SYSCALL_BASE + 57) +#define __NR_umask (__NR_SYSCALL_BASE + 60) +#define __NR_chroot (__NR_SYSCALL_BASE + 61) +#define __NR_dup2 (__NR_SYSCALL_BASE + 63) +#define __NR_getppid (__NR_SYSCALL_BASE + 64) +#define __NR_setsid (__NR_SYSCALL_BASE + 66) +#define __NR_sigaction (__NR_SYSCALL_BASE + 67) +#define __NR_sigsuspend (__NR_SYSCALL_BASE + 72) +#define __NR_sigpending (__NR_SYSCALL_BASE + 73) +#define __NR_setrlimit (__NR_SYSCALL_BASE + 75) +#define __NR_getrusage (__NR_SYSCALL_BASE + 77) +#define __NR_gettimeofday (__NR_SYSCALL_BASE + 78) +#define __NR_settimeofday (__NR_SYSCALL_BASE + 79) +#define __NR_symlink (__NR_SYSCALL_BASE + 83) +#define __NR_readlink (__NR_SYSCALL_BASE + 85) +#define __NR_reboot (__NR_SYSCALL_BASE + 88) +#define __NR_munmap (__NR_SYSCALL_BASE + 91) +#define __NR_truncate (__NR_SYSCALL_BASE + 92) +#define __NR_ftruncate (__NR_SYSCALL_BASE + 93) +#define __NR_fchmod (__NR_SYSCALL_BASE + 94) +#define __NR_getpriority (__NR_SYSCALL_BASE + 96) +#define __NR_setpriority (__NR_SYSCALL_BASE + 97) +#define __NR_syslog (__NR_SYSCALL_BASE + 103) +#define __NR_syslog (__NR_SYSCALL_BASE + 103) +#define __NR_setitimer (__NR_SYSCALL_BASE + 104) +#define __NR_getitimer (__NR_SYSCALL_BASE + 105) +#define __NR_wait4 (__NR_SYSCALL_BASE + 114) +#define __NR_sysinfo (__NR_SYSCALL_BASE + 116) +#define __NR_fsync (__NR_SYSCALL_BASE + 118) +#define __NR_clone (__NR_SYSCALL_BASE + 120) +#define __NR_uname (__NR_SYSCALL_BASE + 122) +#define __NR_mprotect (__NR_SYSCALL_BASE + 125) +#define __NR_sigprocmask (__NR_SYSCALL_BASE + 126) +#define __NR_init_module (__NR_SYSCALL_BASE + 128) +#define __NR_delete_module (__NR_SYSCALL_BASE + 129) +#define __NR_getpgid (__NR_SYSCALL_BASE + 132) +#define __NR_fchdir (__NR_SYSCALL_BASE + 133) +#define __NR__llseek (__NR_SYSCALL_BASE + 140) +#define __NR__newselect (__NR_SYSCALL_BASE + 142) +#define __NR_flock (__NR_SYSCALL_BASE + 143) +#define __NR_msync (__NR_SYSCALL_BASE + 144) +#define __NR_readv (__NR_SYSCALL_BASE + 145) +#define __NR_writev (__NR_SYSCALL_BASE + 146) + +#ifdef __arm__ +#define __NR_pipe (__NR_SYSCALL_BASE + 42) +#define __NR_fdatasync (__NR_SYSCALL_BASE + 148) +#define __NR_mlock (__NR_SYSCALL_BASE + 150) +#define __NR_munlock (__NR_SYSCALL_BASE + 151) +#define __NR_sched_setparam (__NR_SYSCALL_BASE + 154) +#define __NR_sched_getparam (__NR_SYSCALL_BASE + 155) +#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 156) +#define __NR_sched_getscheduler (__NR_SYSCALL_BASE + 157) +#define __NR_sched_yield (__NR_SYSCALL_BASE + 158) +#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE + 159) +#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE + 160) +#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE + 161) +#define __NR_nanosleep (__NR_SYSCALL_BASE + 162) +#define __NR_mremap (__NR_SYSCALL_BASE + 163) +#define __NR_poll (__NR_SYSCALL_BASE + 168) +#define __NR_prctl (__NR_SYSCALL_BASE + 172) +#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174) +#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175) +#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177) +#define __NR_pread64 (__NR_SYSCALL_BASE + 180) +#define __NR_pwrite64 (__NR_SYSCALL_BASE + 181) +#define __NR_getcwd (__NR_SYSCALL_BASE + 183) +#define __NR_capget (__NR_SYSCALL_BASE + 184) +#define __NR_capset (__NR_SYSCALL_BASE + 185) +#define __NR_sigaltstack (__NR_SYSCALL_BASE + 186) +#define __NR_sendfile (__NR_SYSCALL_BASE + 187) +#define __NR_vfork (__NR_SYSCALL_BASE + 190) +#define __NR_ugetrlimit (__NR_SYSCALL_BASE + 191) +#define __NR_mmap2 (__NR_SYSCALL_BASE + 192) +#define __NR_ftruncate64 (__NR_SYSCALL_BASE + 194) +#define __NR_stat64 (__NR_SYSCALL_BASE + 195) +#define __NR_lstat64 (__NR_SYSCALL_BASE + 196) +#define __NR_fstat64 (__NR_SYSCALL_BASE + 197) +#define __NR_lchown32 (__NR_SYSCALL_BASE + 198) +#define __NR_getuid32 (__NR_SYSCALL_BASE + 199) +#define __NR_getgid32 (__NR_SYSCALL_BASE + 200) +#define __NR_geteuid32 (__NR_SYSCALL_BASE + 201) +#define __NR_getegid32 (__NR_SYSCALL_BASE + 202) +#define __NR_setreuid32 (__NR_SYSCALL_BASE + 203) +#define __NR_setregid32 (__NR_SYSCALL_BASE + 204) +#define __NR_getgroups32 (__NR_SYSCALL_BASE + 205) +#define __NR_setgroups32 (__NR_SYSCALL_BASE + 206) +#define __NR_fchown32 (__NR_SYSCALL_BASE + 207) +#define __NR_setresuid32 (__NR_SYSCALL_BASE + 208) +#define __NR_getresuid32 (__NR_SYSCALL_BASE + 209) +#define __NR_setresgid32 (__NR_SYSCALL_BASE + 210) +#define __NR_getresgid32 (__NR_SYSCALL_BASE + 211) +#define __NR_chown32 (__NR_SYSCALL_BASE + 212) +#define __NR_setuid32 (__NR_SYSCALL_BASE + 213) +#define __NR_setgid32 (__NR_SYSCALL_BASE + 214) +#define __NR_getdents64 (__NR_SYSCALL_BASE + 217) +#define __NR_mincore (__NR_SYSCALL_BASE + 219) +#define __NR_madvise (__NR_SYSCALL_BASE + 220) +#define __NR_fcntl64 (__NR_SYSCALL_BASE + 221) +#define __NR_gettid (__NR_SYSCALL_BASE + 224) +#define __NR_futex (__NR_SYSCALL_BASE + 240) +#define __NR_sched_setaffinity (__NR_SYSCALL_BASE + 241) +#define __NR_sched_getaffinity (__NR_SYSCALL_BASE + 242) +#define __NR_exit_group (__NR_SYSCALL_BASE + 248) +#define __NR_epoll_create (__NR_SYSCALL_BASE + 250) +#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 251) +#define __NR_epoll_wait (__NR_SYSCALL_BASE + 252) +#define __NR_timer_create (__NR_SYSCALL_BASE + 257) +#define __NR_timer_settime (__NR_SYSCALL_BASE + 258) +#define __NR_timer_gettime (__NR_SYSCALL_BASE + 259) +#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 260) +#define __NR_timer_delete (__NR_SYSCALL_BASE + 261) +#define __NR_clock_settime (__NR_SYSCALL_BASE + 262) +#define __NR_clock_gettime (__NR_SYSCALL_BASE + 263) +#define __NR_clock_getres (__NR_SYSCALL_BASE + 264) +#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 265) +#define __NR_statfs64 (__NR_SYSCALL_BASE + 266) +#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 267) +#define __NR_utimes (__NR_SYSCALL_BASE + 269) +#define __NR_waitid (__NR_SYSCALL_BASE + 280) +#define __NR_socket (__NR_SYSCALL_BASE + 281) +#define __NR_bind (__NR_SYSCALL_BASE + 282) +#define __NR_connect (__NR_SYSCALL_BASE + 283) +#define __NR_listen (__NR_SYSCALL_BASE + 284) +#define __NR_accept (__NR_SYSCALL_BASE + 285) +#define __NR_getsockname (__NR_SYSCALL_BASE + 286) +#define __NR_getpeername (__NR_SYSCALL_BASE + 287) +#define __NR_socketpair (__NR_SYSCALL_BASE + 288) +#define __NR_sendto (__NR_SYSCALL_BASE + 290) +#define __NR_recvfrom (__NR_SYSCALL_BASE + 292) +#define __NR_shutdown (__NR_SYSCALL_BASE + 293) +#define __NR_setsockopt (__NR_SYSCALL_BASE + 294) +#define __NR_getsockopt (__NR_SYSCALL_BASE + 295) +#define __NR_sendmsg (__NR_SYSCALL_BASE + 296) +#define __NR_recvmsg (__NR_SYSCALL_BASE + 297) +#define __NR_ioprio_set (__NR_SYSCALL_BASE + 314) +#define __NR_ioprio_get (__NR_SYSCALL_BASE + 315) +#define __NR_inotify_init (__NR_SYSCALL_BASE + 316) +#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 317) +#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 318) +#define __NR_openat (__NR_SYSCALL_BASE + 322) +#define __NR_mkdirat (__NR_SYSCALL_BASE + 323) +#define __NR_fchownat (__NR_SYSCALL_BASE + 325) +#define __NR_fstatat64 (__NR_SYSCALL_BASE + 327) +#define __NR_unlinkat (__NR_SYSCALL_BASE + 328) +#define __NR_renameat (__NR_SYSCALL_BASE + 329) +#define __NR_fchmodat (__NR_SYSCALL_BASE + 333) +#define __NR_getcpu (__NR_SYSCALL_BASE + 345) +#define __NR_utimensat (__NR_SYSCALL_BASE + 348) +#define __NR_eventfd2 (__NR_SYSCALL_BASE + 356) +#define __NR_pipe2 (__NR_SYSCALL_BASE + 359) +#define __NR_ARM_cacheflush (__NR_SYSCALL_BASE + 983042) +#define __NR_ARM_set_tls (__NR_SYSCALL_BASE + 983045) +#endif + +#ifdef __i386__ +#define __NR_waitpid (__NR_SYSCALL_BASE + 7) +#define __NR_kill (__NR_SYSCALL_BASE + 37) +#define __NR_pipe (__NR_SYSCALL_BASE + 42) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_fdatasync (__NR_SYSCALL_BASE + 148) +#define __NR_mlock (__NR_SYSCALL_BASE + 150) +#define __NR_munlock (__NR_SYSCALL_BASE + 151) +#define __NR_sched_setparam (__NR_SYSCALL_BASE + 154) +#define __NR_sched_getparam (__NR_SYSCALL_BASE + 155) +#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 156) +#define __NR_sched_getscheduler (__NR_SYSCALL_BASE + 157) +#define __NR_sched_yield (__NR_SYSCALL_BASE + 158) +#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE + 159) +#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE + 160) +#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE + 161) +#define __NR_nanosleep (__NR_SYSCALL_BASE + 162) +#define __NR_mremap (__NR_SYSCALL_BASE + 163) +#define __NR_poll (__NR_SYSCALL_BASE + 168) +#define __NR_prctl (__NR_SYSCALL_BASE + 172) +#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174) +#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175) +#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177) +#define __NR_pread64 (__NR_SYSCALL_BASE + 180) +#define __NR_pwrite64 (__NR_SYSCALL_BASE + 181) +#define __NR_getcwd (__NR_SYSCALL_BASE + 183) +#define __NR_capget (__NR_SYSCALL_BASE + 184) +#define __NR_capset (__NR_SYSCALL_BASE + 185) +#define __NR_sigaltstack (__NR_SYSCALL_BASE + 186) +#define __NR_sendfile (__NR_SYSCALL_BASE + 187) +#define __NR_ugetrlimit (__NR_SYSCALL_BASE + 191) +#define __NR_mmap2 (__NR_SYSCALL_BASE + 192) +#define __NR_ftruncate64 (__NR_SYSCALL_BASE + 194) +#define __NR_stat64 (__NR_SYSCALL_BASE + 195) +#define __NR_lstat64 (__NR_SYSCALL_BASE + 196) +#define __NR_fstat64 (__NR_SYSCALL_BASE + 197) +#define __NR_lchown32 (__NR_SYSCALL_BASE + 198) +#define __NR_getuid32 (__NR_SYSCALL_BASE + 199) +#define __NR_getgid32 (__NR_SYSCALL_BASE + 200) +#define __NR_geteuid32 (__NR_SYSCALL_BASE + 201) +#define __NR_getegid32 (__NR_SYSCALL_BASE + 202) +#define __NR_setreuid32 (__NR_SYSCALL_BASE + 203) +#define __NR_setregid32 (__NR_SYSCALL_BASE + 204) +#define __NR_getgroups32 (__NR_SYSCALL_BASE + 205) +#define __NR_setgroups32 (__NR_SYSCALL_BASE + 206) +#define __NR_fchown32 (__NR_SYSCALL_BASE + 207) +#define __NR_setresuid32 (__NR_SYSCALL_BASE + 208) +#define __NR_getresuid32 (__NR_SYSCALL_BASE + 209) +#define __NR_setresgid32 (__NR_SYSCALL_BASE + 210) +#define __NR_getresgid32 (__NR_SYSCALL_BASE + 211) +#define __NR_chown32 (__NR_SYSCALL_BASE + 212) +#define __NR_setuid32 (__NR_SYSCALL_BASE + 213) +#define __NR_setgid32 (__NR_SYSCALL_BASE + 214) +#define __NR_mincore (__NR_SYSCALL_BASE + 218) +#define __NR_madvise (__NR_SYSCALL_BASE + 219) +#define __NR_getdents64 (__NR_SYSCALL_BASE + 220) +#define __NR_fcntl64 (__NR_SYSCALL_BASE + 221) +#define __NR_gettid (__NR_SYSCALL_BASE + 224) +#define __NR_tkill (__NR_SYSCALL_BASE + 238) +#define __NR_futex (__NR_SYSCALL_BASE + 240) +#define __NR_sched_setaffinity (__NR_SYSCALL_BASE + 241) +#define __NR_sched_getaffinity (__NR_SYSCALL_BASE + 242) +#define __NR_set_thread_area (__NR_SYSCALL_BASE + 243) +#define __NR_exit_group (__NR_SYSCALL_BASE + 252) +#define __NR_epoll_create (__NR_SYSCALL_BASE + 254) +#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 255) +#define __NR_epoll_wait (__NR_SYSCALL_BASE + 256) +#define __NR_timer_create (__NR_SYSCALL_BASE + 259) +#define __NR_timer_settime (__NR_SYSCALL_BASE + 260) +#define __NR_timer_gettime (__NR_SYSCALL_BASE + 261) +#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 262) +#define __NR_timer_delete (__NR_SYSCALL_BASE + 263) +#define __NR_clock_settime (__NR_SYSCALL_BASE + 264) +#define __NR_clock_gettime (__NR_SYSCALL_BASE + 265) +#define __NR_clock_getres (__NR_SYSCALL_BASE + 266) +#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 267) +#define __NR_statfs64 (__NR_SYSCALL_BASE + 268) +#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 269) +#define __NR_utimes (__NR_SYSCALL_BASE + 271) +#define __NR_waitid (__NR_SYSCALL_BASE + 284) +#define __NR_ioprio_set (__NR_SYSCALL_BASE + 289) +#define __NR_ioprio_get (__NR_SYSCALL_BASE + 290) +#define __NR_inotify_init (__NR_SYSCALL_BASE + 291) +#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 292) +#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 293) +#define __NR_openat (__NR_SYSCALL_BASE + 295) +#define __NR_mkdirat (__NR_SYSCALL_BASE + 296) +#define __NR_fchownat (__NR_SYSCALL_BASE + 298) +#define __NR_fstatat64 (__NR_SYSCALL_BASE + 300) +#define __NR_unlinkat (__NR_SYSCALL_BASE + 301) +#define __NR_renameat (__NR_SYSCALL_BASE + 302) +#define __NR_fchmodat (__NR_SYSCALL_BASE + 306) +#define __NR_getcpu (__NR_SYSCALL_BASE + 318) +#define __NR_utimensat (__NR_SYSCALL_BASE + 320) +#define __NR_eventfd2 (__NR_SYSCALL_BASE + 328) +#define __NR_pipe2 (__NR_SYSCALL_BASE + 331) +#endif + +#if defined(__SH3__) || defined(__SH4__) +#define __NR_waitpid (__NR_SYSCALL_BASE + 7) +#define __NR_kill (__NR_SYSCALL_BASE + 37) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_fdatasync (__NR_SYSCALL_BASE + 148) +#define __NR_mlock (__NR_SYSCALL_BASE + 150) +#define __NR_munlock (__NR_SYSCALL_BASE + 151) +#define __NR_sched_setparam (__NR_SYSCALL_BASE + 154) +#define __NR_sched_getparam (__NR_SYSCALL_BASE + 155) +#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 156) +#define __NR_sched_getscheduler (__NR_SYSCALL_BASE + 157) +#define __NR_sched_yield (__NR_SYSCALL_BASE + 158) +#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE + 159) +#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE + 160) +#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE + 161) +#define __NR_nanosleep (__NR_SYSCALL_BASE + 162) +#define __NR_mremap (__NR_SYSCALL_BASE + 163) +#define __NR_poll (__NR_SYSCALL_BASE + 168) +#define __NR_prctl (__NR_SYSCALL_BASE + 172) +#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174) +#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175) +#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177) +#define __NR_pread64 (__NR_SYSCALL_BASE + 180) +#define __NR_pwrite64 (__NR_SYSCALL_BASE + 181) +#define __NR_getcwd (__NR_SYSCALL_BASE + 183) +#define __NR_capget (__NR_SYSCALL_BASE + 184) +#define __NR_capset (__NR_SYSCALL_BASE + 185) +#define __NR_sigaltstack (__NR_SYSCALL_BASE + 186) +#define __NR_sendfile (__NR_SYSCALL_BASE + 187) +#define __NR_vfork (__NR_SYSCALL_BASE + 190) +#define __NR_ugetrlimit (__NR_SYSCALL_BASE + 191) +#define __NR_mmap2 (__NR_SYSCALL_BASE + 192) +#define __NR_ftruncate64 (__NR_SYSCALL_BASE + 194) +#define __NR_stat64 (__NR_SYSCALL_BASE + 195) +#define __NR_lstat64 (__NR_SYSCALL_BASE + 196) +#define __NR_fstat64 (__NR_SYSCALL_BASE + 197) +#define __NR_lchown32 (__NR_SYSCALL_BASE + 198) +#define __NR_getuid32 (__NR_SYSCALL_BASE + 199) +#define __NR_getgid32 (__NR_SYSCALL_BASE + 200) +#define __NR_geteuid32 (__NR_SYSCALL_BASE + 201) +#define __NR_getegid32 (__NR_SYSCALL_BASE + 202) +#define __NR_setreuid32 (__NR_SYSCALL_BASE + 203) +#define __NR_setregid32 (__NR_SYSCALL_BASE + 204) +#define __NR_getgroups32 (__NR_SYSCALL_BASE + 205) +#define __NR_setgroups32 (__NR_SYSCALL_BASE + 206) +#define __NR_fchown32 (__NR_SYSCALL_BASE + 207) +#define __NR_setresuid32 (__NR_SYSCALL_BASE + 208) +#define __NR_getresuid32 (__NR_SYSCALL_BASE + 209) +#define __NR_setresgid32 (__NR_SYSCALL_BASE + 210) +#define __NR_getresgid32 (__NR_SYSCALL_BASE + 211) +#define __NR_chown32 (__NR_SYSCALL_BASE + 212) +#define __NR_setuid32 (__NR_SYSCALL_BASE + 213) +#define __NR_setgid32 (__NR_SYSCALL_BASE + 214) +#define __NR_mincore (__NR_SYSCALL_BASE + 218) +#define __NR_madvise (__NR_SYSCALL_BASE + 219) +#define __NR_getdents64 (__NR_SYSCALL_BASE + 220) +#define __NR_fcntl64 (__NR_SYSCALL_BASE + 221) +#define __NR_gettid (__NR_SYSCALL_BASE + 224) +#define __NR_tkill (__NR_SYSCALL_BASE + 238) +#define __NR_futex (__NR_SYSCALL_BASE + 240) +#define __NR_sched_setaffinity (__NR_SYSCALL_BASE + 241) +#define __NR_sched_getaffinity (__NR_SYSCALL_BASE + 242) +#define __NR_set_thread_area (__NR_SYSCALL_BASE + 243) +#define __NR_exit_group (__NR_SYSCALL_BASE + 252) +#define __NR_epoll_create (__NR_SYSCALL_BASE + 254) +#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 255) +#define __NR_epoll_wait (__NR_SYSCALL_BASE + 256) +#define __NR_timer_create (__NR_SYSCALL_BASE + 259) +#define __NR_timer_settime (__NR_SYSCALL_BASE + 260) +#define __NR_timer_gettime (__NR_SYSCALL_BASE + 261) +#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 262) +#define __NR_timer_delete (__NR_SYSCALL_BASE + 263) +#define __NR_clock_settime (__NR_SYSCALL_BASE + 264) +#define __NR_clock_gettime (__NR_SYSCALL_BASE + 265) +#define __NR_clock_getres (__NR_SYSCALL_BASE + 266) +#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 267) +#define __NR_statfs64 (__NR_SYSCALL_BASE + 268) +#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 269) +#define __NR_utimes (__NR_SYSCALL_BASE + 271) +#define __NR_waitid (__NR_SYSCALL_BASE + 284) +#define __NR_ioprio_set (__NR_SYSCALL_BASE + 288) +#define __NR_ioprio_get (__NR_SYSCALL_BASE + 289) +#define __NR_inotify_init (__NR_SYSCALL_BASE + 290) +#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 291) +#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 292) +#define __NR_openat (__NR_SYSCALL_BASE + 295) +#define __NR_mkdirat (__NR_SYSCALL_BASE + 296) +#define __NR_fchownat (__NR_SYSCALL_BASE + 298) +#define __NR_fstatat64 (__NR_SYSCALL_BASE + 300) +#define __NR_unlinkat (__NR_SYSCALL_BASE + 301) +#define __NR_renameat (__NR_SYSCALL_BASE + 302) +#define __NR_fchmodat (__NR_SYSCALL_BASE + 306) +#define __NR_getcpu (__NR_SYSCALL_BASE + 318) +#define __NR_utimensat (__NR_SYSCALL_BASE + 320) +#define __NR_eventfd2 (__NR_SYSCALL_BASE + 328) +#define __NR_pipe2 (__NR_SYSCALL_BASE + 331) +#endif + +#ifdef __mips__ +#define __NR_syscall (__NR_SYSCALL_BASE + 0) +#define __NR_waitpid (__NR_SYSCALL_BASE + 7) +#define __NR_lchown (__NR_SYSCALL_BASE + 16) +#define __NR_setuid (__NR_SYSCALL_BASE + 23) +#define __NR_getuid (__NR_SYSCALL_BASE + 24) +#define __NR_kill (__NR_SYSCALL_BASE + 37) +#define __NR_setgid (__NR_SYSCALL_BASE + 46) +#define __NR_getgid (__NR_SYSCALL_BASE + 47) +#define __NR_geteuid (__NR_SYSCALL_BASE + 49) +#define __NR_getegid (__NR_SYSCALL_BASE + 50) +#define __NR_setreuid (__NR_SYSCALL_BASE + 70) +#define __NR_setregid (__NR_SYSCALL_BASE + 71) +#define __NR_getrlimit (__NR_SYSCALL_BASE + 76) +#define __NR_getgroups (__NR_SYSCALL_BASE + 80) +#define __NR_setgroups (__NR_SYSCALL_BASE + 81) +#define __NR_fchown (__NR_SYSCALL_BASE + 95) +#define __NR_cacheflush (__NR_SYSCALL_BASE + 147) +#define __NR_fdatasync (__NR_SYSCALL_BASE + 152) +#define __NR_mlock (__NR_SYSCALL_BASE + 154) +#define __NR_munlock (__NR_SYSCALL_BASE + 155) +#define __NR_sched_setparam (__NR_SYSCALL_BASE + 158) +#define __NR_sched_getparam (__NR_SYSCALL_BASE + 159) +#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 160) +#define __NR_sched_getscheduler (__NR_SYSCALL_BASE + 161) +#define __NR_sched_yield (__NR_SYSCALL_BASE + 162) +#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE + 163) +#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE + 164) +#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE + 165) +#define __NR_nanosleep (__NR_SYSCALL_BASE + 166) +#define __NR_mremap (__NR_SYSCALL_BASE + 167) +#define __NR_accept (__NR_SYSCALL_BASE + 168) +#define __NR_bind (__NR_SYSCALL_BASE + 169) +#define __NR_connect (__NR_SYSCALL_BASE + 170) +#define __NR_getpeername (__NR_SYSCALL_BASE + 171) +#define __NR_getsockname (__NR_SYSCALL_BASE + 172) +#define __NR_getsockopt (__NR_SYSCALL_BASE + 173) +#define __NR_listen (__NR_SYSCALL_BASE + 174) +#define __NR_recvfrom (__NR_SYSCALL_BASE + 176) +#define __NR_recvmsg (__NR_SYSCALL_BASE + 177) +#define __NR_sendmsg (__NR_SYSCALL_BASE + 179) +#define __NR_sendto (__NR_SYSCALL_BASE + 180) +#define __NR_setsockopt (__NR_SYSCALL_BASE + 181) +#define __NR_shutdown (__NR_SYSCALL_BASE + 182) +#define __NR_socket (__NR_SYSCALL_BASE + 183) +#define __NR_socketpair (__NR_SYSCALL_BASE + 184) +#define __NR_setresuid (__NR_SYSCALL_BASE + 185) +#define __NR_getresuid (__NR_SYSCALL_BASE + 186) +#define __NR_poll (__NR_SYSCALL_BASE + 188) +#define __NR_setresgid (__NR_SYSCALL_BASE + 190) +#define __NR_getresgid (__NR_SYSCALL_BASE + 191) +#define __NR_prctl (__NR_SYSCALL_BASE + 192) +#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 194) +#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 195) +#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 197) +#define __NR_pread64 (__NR_SYSCALL_BASE + 200) +#define __NR_pwrite64 (__NR_SYSCALL_BASE + 201) +#define __NR_chown (__NR_SYSCALL_BASE + 202) +#define __NR_getcwd (__NR_SYSCALL_BASE + 203) +#define __NR_capget (__NR_SYSCALL_BASE + 204) +#define __NR_capset (__NR_SYSCALL_BASE + 205) +#define __NR_sigaltstack (__NR_SYSCALL_BASE + 206) +#define __NR_sendfile (__NR_SYSCALL_BASE + 207) +#define __NR_mmap2 (__NR_SYSCALL_BASE + 210) +#define __NR_ftruncate64 (__NR_SYSCALL_BASE + 212) +#define __NR_stat64 (__NR_SYSCALL_BASE + 213) +#define __NR_lstat64 (__NR_SYSCALL_BASE + 214) +#define __NR_fstat64 (__NR_SYSCALL_BASE + 215) +#define __NR_mincore (__NR_SYSCALL_BASE + 217) +#define __NR_madvise (__NR_SYSCALL_BASE + 218) +#define __NR_getdents64 (__NR_SYSCALL_BASE + 219) +#define __NR_fcntl64 (__NR_SYSCALL_BASE + 220) +#define __NR_gettid (__NR_SYSCALL_BASE + 222) +#define __NR_tkill (__NR_SYSCALL_BASE + 236) +#define __NR_futex (__NR_SYSCALL_BASE + 238) +#define __NR_sched_setaffinity (__NR_SYSCALL_BASE + 239) +#define __NR_sched_getaffinity (__NR_SYSCALL_BASE + 240) +#define __NR_exit_group (__NR_SYSCALL_BASE + 246) +#define __NR_epoll_create (__NR_SYSCALL_BASE + 248) +#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 249) +#define __NR_epoll_wait (__NR_SYSCALL_BASE + 250) +#define __NR_statfs64 (__NR_SYSCALL_BASE + 255) +#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 256) +#define __NR_timer_create (__NR_SYSCALL_BASE + 257) +#define __NR_timer_settime (__NR_SYSCALL_BASE + 258) +#define __NR_timer_gettime (__NR_SYSCALL_BASE + 259) +#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 260) +#define __NR_timer_delete (__NR_SYSCALL_BASE + 261) +#define __NR_clock_settime (__NR_SYSCALL_BASE + 262) +#define __NR_clock_gettime (__NR_SYSCALL_BASE + 263) +#define __NR_clock_getres (__NR_SYSCALL_BASE + 264) +#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 265) +#define __NR_utimes (__NR_SYSCALL_BASE + 267) +#define __NR_waitid (__NR_SYSCALL_BASE + 278) +#define __NR_set_thread_area (__NR_SYSCALL_BASE + 283) +#define __NR_inotify_init (__NR_SYSCALL_BASE + 284) +#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 285) +#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 286) +#define __NR_openat (__NR_SYSCALL_BASE + 288) +#define __NR_mkdirat (__NR_SYSCALL_BASE + 289) +#define __NR_fchownat (__NR_SYSCALL_BASE + 291) +#define __NR_fstatat64 (__NR_SYSCALL_BASE + 293) +#define __NR_unlinkat (__NR_SYSCALL_BASE + 294) +#define __NR_renameat (__NR_SYSCALL_BASE + 295) +#define __NR_fchmodat (__NR_SYSCALL_BASE + 299) +#define __NR_getcpu (__NR_SYSCALL_BASE + 312) +#define __NR_ioprio_set (__NR_SYSCALL_BASE + 314) +#define __NR_ioprio_get (__NR_SYSCALL_BASE + 315) +#define __NR_utimensat (__NR_SYSCALL_BASE + 316) +#define __NR_eventfd2 (__NR_SYSCALL_BASE + 325) +#define __NR_pipe2 (__NR_SYSCALL_BASE + 328) +#endif + +#endif + +#endif /* _BIONIC_LINUX_SYSCALLS_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/mman.h b/9/platforms/android-16/arch-mips/usr/include/sys/mman.h new file mode 100644 index 0000000..7a32974 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/mman.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_MMAN_H_ +#define _SYS_MMAN_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <asm/mman.h> +#include <asm/page.h> + +__BEGIN_DECLS + +#ifndef MAP_ANON +#define MAP_ANON MAP_ANONYMOUS +#endif + +#define MAP_FAILED ((void *)-1) + +#define MREMAP_MAYMOVE 1 +#define MREMAP_FIXED 2 + +extern void* mmap(void *, size_t, int, int, int, off_t); +extern int munmap(void *, size_t); +extern int msync(const void *, size_t, int); +extern int mprotect(const void *, size_t, int); +extern void* mremap(void *, size_t, size_t, unsigned long); + +extern int mlockall(int); +extern int munlockall(void); +extern int mlock(const void *, size_t); +extern int munlock(const void *, size_t); +extern int madvise(const void *, size_t, int); + +extern int mlock(const void *addr, size_t len); +extern int munlock(const void *addr, size_t len); + +extern int mincore(void* start, size_t length, unsigned char* vec); + +__END_DECLS + +#endif /* _SYS_MMAN_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/mount.h b/9/platforms/android-16/arch-mips/usr/include/sys/mount.h new file mode 100644 index 0000000..ba88447 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/mount.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_MOUNT_H +#define _SYS_MOUNT_H + +#include <sys/cdefs.h> +#include <sys/ioctl.h> + +__BEGIN_DECLS + +/* + * These are the fs-independent mount-flags: up to 32 flags are supported + */ +#define MS_RDONLY 1 /* Mount read-only */ +#define MS_NOSUID 2 /* Ignore suid and sgid bits */ +#define MS_NODEV 4 /* Disallow access to device special files */ +#define MS_NOEXEC 8 /* Disallow program execution */ +#define MS_SYNCHRONOUS 16 /* Writes are synced at once */ +#define MS_REMOUNT 32 /* Alter flags of a mounted FS */ +#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */ +#define MS_DIRSYNC 128 /* Directory modifications are synchronous */ +#define MS_NOATIME 1024 /* Do not update access times. */ +#define MS_NODIRATIME 2048 /* Do not update directory access times */ +#define MS_BIND 4096 +#define MS_MOVE 8192 +#define MS_REC 16384 +#define MS_VERBOSE 32768 +#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ +#define MS_ONE_SECOND (1<<17) /* fs has 1 sec a/m/ctime resolution */ +#define MS_ACTIVE (1<<30) +#define MS_NOUSER (1<<31) + +/* + * Superblock flags that can be altered by MS_REMOUNT + */ +#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME) + +/* + * Old magic mount flag and mask + */ +#define MS_MGC_VAL 0xC0ED0000 +#define MS_MGC_MSK 0xffff0000 + +/* + * umount2() flags + */ +#define MNT_FORCE 1 /* Forcibly unmount */ +#define MNT_DETACH 2 /* Detach from tree only */ +#define MNT_EXPIRE 4 /* Mark for expiry */ + +/* + * Block device ioctls + */ +#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */ +#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */ +#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */ +#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */ +#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */ +#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */ +#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */ + +/* + * Prototypes + */ +extern int mount(const char *, const char *, + const char *, unsigned long, + const void *); +extern int umount(const char *); +extern int umount2(const char *, int); + +#if 0 /* MISSING FROM BIONIC */ +extern int pivot_root(const char *, const char *); +#endif /* MISSING */ + +__END_DECLS + +#endif /* _SYS_MOUNT_H */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/param.h b/9/platforms/android-16/arch-mips/usr/include/sys/param.h new file mode 100644 index 0000000..3a815cb --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/param.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_PARAM_H_ +#define _SYS_PARAM_H_ + +#include <limits.h> +#include <linux/param.h> + +#define MAXPATHLEN PATH_MAX +#define MAXSYMLINKS 8 + +#define ALIGNBYTES 3 +#define ALIGN(p) (((unsigned int)(p) + ALIGNBYTES) &~ ALIGNBYTES) + +#endif /* _SYS_PARAM_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/poll.h b/9/platforms/android-16/arch-mips/usr/include/sys/poll.h new file mode 100644 index 0000000..779ec77 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/poll.h @@ -0,0 +1 @@ +#include <poll.h> diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/prctl.h b/9/platforms/android-16/arch-mips/usr/include/sys/prctl.h new file mode 100644 index 0000000..359d684 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/prctl.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_PRCTL_H +#define _SYS_PRCTL_H + +#include <linux/prctl.h> + +__BEGIN_DECLS + +/* IMPORTANT NOTE: This function is declared as taking a variable number + * of arguments to match the GLibc definition. However + * its declaration inside SYSCALLS.TXT *must* make it + * take 6 arguments to ensure consistency with the kernel + * implementation. + */ +extern int prctl(int option, ...); + +__END_DECLS + +#endif /* _SYS_PRCTL_H */ + diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/ptrace.h b/9/platforms/android-16/arch-mips/usr/include/sys/ptrace.h new file mode 100644 index 0000000..848416b --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/ptrace.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_PTRACE_H_ +#define _SYS_PTRACE_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +/* For all of the defines */ +#include <linux/ptrace.h> + +__BEGIN_DECLS + +#define PTRACE_POKEUSER PTRACE_POKEUSR +#define PTRACE_PEEKUSER PTRACE_PEEKUSR + +extern long ptrace(int request, pid_t pid, void *addr, void *data); + +__END_DECLS + +#endif /* _SYS_PTRACE_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/queue.h b/9/platforms/android-16/arch-mips/usr/include/sys/queue.h new file mode 100644 index 0000000..b0e6b38 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/queue.h @@ -0,0 +1,557 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + */ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_ + +/* + * This file defines five types of data structures: singly-linked lists, + * lists, simple queues, tail queues, and circular queues. + * + * A singly-linked list is headed by a single forward pointer. The + * elements are singly linked for minimum space and pointer manipulation + * overhead at the expense of O(n) removal for arbitrary elements. New + * elements can be added to the list after an existing element or at the + * head of the list. Elements being removed from the head of the list + * should use the explicit macro for this purpose for optimum + * efficiency. A singly-linked list may only be traversed in the forward + * direction. Singly-linked lists are ideal for applications with large + * datasets and few or no removals or for implementing a LIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may only be traversed in the forward direction. + * + * A simple queue is headed by a pair of pointers, one the head of the + * list and the other to the tail of the list. The elements are singly + * linked to save space, so elements can only be removed from the + * head of the list. New elements can be added to the list after + * an existing element, at the head of the list, or at the end of the + * list. A simple queue may only be traversed in the forward direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + * + * A circle queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or after + * an existing element, at the head of the list, or at the end of the list. + * A circle queue may be traversed in either direction, but has a more + * complex end of list detection. + * + * For details on the use of these macros, see the queue(3) manual page. + */ + +/* + * List definitions. + */ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ +} + +#define LIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define LIST_ENTRY(type) \ +struct { \ + struct type *le_next; /* next element */ \ + struct type **le_prev; /* address of previous next element */ \ +} + +/* + * List functions. + */ +#define LIST_INIT(head) do { \ + (head)->lh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_AFTER(listelm, elm, field) do { \ + if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ + (listelm)->field.le_next->field.le_prev = \ + &(elm)->field.le_next; \ + (listelm)->field.le_next = (elm); \ + (elm)->field.le_prev = &(listelm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.le_prev = (listelm)->field.le_prev; \ + (elm)->field.le_next = (listelm); \ + *(listelm)->field.le_prev = (elm); \ + (listelm)->field.le_prev = &(elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.le_next = (head)->lh_first) != NULL) \ + (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ + (head)->lh_first = (elm); \ + (elm)->field.le_prev = &(head)->lh_first; \ +} while (/*CONSTCOND*/0) + +#define LIST_REMOVE(elm, field) do { \ + if ((elm)->field.le_next != NULL) \ + (elm)->field.le_next->field.le_prev = \ + (elm)->field.le_prev; \ + *(elm)->field.le_prev = (elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_FOREACH(var, head, field) \ + for ((var) = ((head)->lh_first); \ + (var); \ + (var) = ((var)->field.le_next)) + +/* + * List access methods. + */ +#define LIST_EMPTY(head) ((head)->lh_first == NULL) +#define LIST_FIRST(head) ((head)->lh_first) +#define LIST_NEXT(elm, field) ((elm)->field.le_next) + + +/* + * Singly-linked List definitions. + */ +#define SLIST_HEAD(name, type) \ +struct name { \ + struct type *slh_first; /* first element */ \ +} + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define SLIST_ENTRY(type) \ +struct { \ + struct type *sle_next; /* next element */ \ +} + +/* + * Singly-linked List functions. + */ +#define SLIST_INIT(head) do { \ + (head)->slh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ + (elm)->field.sle_next = (slistelm)->field.sle_next; \ + (slistelm)->field.sle_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.sle_next = (head)->slh_first; \ + (head)->slh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE_HEAD(head, field) do { \ + (head)->slh_first = (head)->slh_first->field.sle_next; \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE(head, elm, type, field) do { \ + if ((head)->slh_first == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } \ + else { \ + struct type *curelm = (head)->slh_first; \ + while(curelm->field.sle_next != (elm)) \ + curelm = curelm->field.sle_next; \ + curelm->field.sle_next = \ + curelm->field.sle_next->field.sle_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SLIST_FOREACH(var, head, field) \ + for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) + +/* + * Singly-linked List access methods. + */ +#define SLIST_EMPTY(head) ((head)->slh_first == NULL) +#define SLIST_FIRST(head) ((head)->slh_first) +#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) + + +/* + * Singly-linked Tail queue declarations. + */ +#define STAILQ_HEAD(name, type) \ +struct name { \ + struct type *stqh_first; /* first element */ \ + struct type **stqh_last; /* addr of last next element */ \ +} + +#define STAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).stqh_first } + +#define STAILQ_ENTRY(type) \ +struct { \ + struct type *stqe_next; /* next element */ \ +} + +/* + * Singly-linked Tail queue functions. + */ +#define STAILQ_INIT(head) do { \ + (head)->stqh_first = NULL; \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (head)->stqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.stqe_next = NULL; \ + *(head)->stqh_last = (elm); \ + (head)->stqh_last = &(elm)->field.stqe_next; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (listelm)->field.stqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE_HEAD(head, field) do { \ + if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE(head, elm, type, field) do { \ + if ((head)->stqh_first == (elm)) { \ + STAILQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->stqh_first; \ + while (curelm->field.stqe_next != (elm)) \ + curelm = curelm->field.stqe_next; \ + if ((curelm->field.stqe_next = \ + curelm->field.stqe_next->field.stqe_next) == NULL) \ + (head)->stqh_last = &(curelm)->field.stqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define STAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->stqh_first); \ + (var); \ + (var) = ((var)->field.stqe_next)) + +/* + * Singly-linked Tail queue access methods. + */ +#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) +#define STAILQ_FIRST(head) ((head)->stqh_first) +#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) + + +/* + * Simple queue definitions. + */ +#define SIMPLEQ_HEAD(name, type) \ +struct name { \ + struct type *sqh_first; /* first element */ \ + struct type **sqh_last; /* addr of last next element */ \ +} + +#define SIMPLEQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).sqh_first } + +#define SIMPLEQ_ENTRY(type) \ +struct { \ + struct type *sqe_next; /* next element */ \ +} + +/* + * Simple queue functions. + */ +#define SIMPLEQ_INIT(head) do { \ + (head)->sqh_first = NULL; \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (head)->sqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.sqe_next = NULL; \ + *(head)->sqh_last = (elm); \ + (head)->sqh_last = &(elm)->field.sqe_next; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (listelm)->field.sqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ + if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ + if ((head)->sqh_first == (elm)) { \ + SIMPLEQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->sqh_first; \ + while (curelm->field.sqe_next != (elm)) \ + curelm = curelm->field.sqe_next; \ + if ((curelm->field.sqe_next = \ + curelm->field.sqe_next->field.sqe_next) == NULL) \ + (head)->sqh_last = &(curelm)->field.sqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->sqh_first); \ + (var); \ + (var) = ((var)->field.sqe_next)) + +/* + * Simple queue access methods. + */ +#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) +#define SIMPLEQ_FIRST(head) ((head)->sqh_first) +#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) + + +/* + * Tail queue definitions. + */ +#define _TAILQ_HEAD(name, type, qual) \ +struct name { \ + qual type *tqh_first; /* first element */ \ + qual type *qual *tqh_last; /* addr of last next element */ \ +} +#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) + +#define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } + +#define _TAILQ_ENTRY(type, qual) \ +struct { \ + qual type *tqe_next; /* next element */ \ + qual type *qual *tqe_prev; /* address of previous next element */\ +} +#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) + +/* + * Tail queue functions. + */ +#define TAILQ_INIT(head) do { \ + (head)->tqh_first = NULL; \ + (head)->tqh_last = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ + (head)->tqh_first->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (head)->tqh_first = (elm); \ + (elm)->field.tqe_prev = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.tqe_next = NULL; \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ + (elm)->field.tqe_next->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (listelm)->field.tqe_next = (elm); \ + (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + (elm)->field.tqe_next = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_REMOVE(head, elm, field) do { \ + if (((elm)->field.tqe_next) != NULL) \ + (elm)->field.tqe_next->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->tqh_first); \ + (var); \ + (var) = ((var)->field.tqe_next)) + +#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ + (var); \ + (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) + +/* + * Tail queue access methods. + */ +#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) +#define TAILQ_FIRST(head) ((head)->tqh_first) +#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) + +#define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) +#define TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) + + +/* + * Circular queue definitions. + */ +#define CIRCLEQ_HEAD(name, type) \ +struct name { \ + struct type *cqh_first; /* first element */ \ + struct type *cqh_last; /* last element */ \ +} + +#define CIRCLEQ_HEAD_INITIALIZER(head) \ + { (void *)&head, (void *)&head } + +#define CIRCLEQ_ENTRY(type) \ +struct { \ + struct type *cqe_next; /* next element */ \ + struct type *cqe_prev; /* previous element */ \ +} + +/* + * Circular queue functions. + */ +#define CIRCLEQ_INIT(head) do { \ + (head)->cqh_first = (void *)(head); \ + (head)->cqh_last = (void *)(head); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm)->field.cqe_next; \ + (elm)->field.cqe_prev = (listelm); \ + if ((listelm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (listelm)->field.cqe_next->field.cqe_prev = (elm); \ + (listelm)->field.cqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm); \ + (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ + if ((listelm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (listelm)->field.cqe_prev->field.cqe_next = (elm); \ + (listelm)->field.cqe_prev = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.cqe_next = (head)->cqh_first; \ + (elm)->field.cqe_prev = (void *)(head); \ + if ((head)->cqh_last == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (head)->cqh_first->field.cqe_prev = (elm); \ + (head)->cqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.cqe_next = (void *)(head); \ + (elm)->field.cqe_prev = (head)->cqh_last; \ + if ((head)->cqh_first == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (head)->cqh_last->field.cqe_next = (elm); \ + (head)->cqh_last = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_REMOVE(head, elm, field) do { \ + if ((elm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm)->field.cqe_prev; \ + else \ + (elm)->field.cqe_next->field.cqe_prev = \ + (elm)->field.cqe_prev; \ + if ((elm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm)->field.cqe_next; \ + else \ + (elm)->field.cqe_prev->field.cqe_next = \ + (elm)->field.cqe_next; \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->cqh_first); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_next)) + +#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ + for ((var) = ((head)->cqh_last); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_prev)) + +/* + * Circular queue access methods. + */ +#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) +#define CIRCLEQ_FIRST(head) ((head)->cqh_first) +#define CIRCLEQ_LAST(head) ((head)->cqh_last) +#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) +#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) + +#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ + (((elm)->field.cqe_next == (void *)(head)) \ + ? ((head)->cqh_first) \ + : (elm->field.cqe_next)) +#define CIRCLEQ_LOOP_PREV(head, elm, field) \ + (((elm)->field.cqe_prev == (void *)(head)) \ + ? ((head)->cqh_last) \ + : (elm->field.cqe_prev)) + +#endif /* sys/queue.h */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/reboot.h b/9/platforms/android-16/arch-mips/usr/include/sys/reboot.h new file mode 100644 index 0000000..df81139 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/reboot.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_REBOOT_H_ +#define _SYS_REBOOT_H_ + +#include <sys/cdefs.h> +#include <linux/reboot.h> + +__BEGIN_DECLS + +/* use glibc names as well */ + +#define RB_AUTOBOOT LINUX_REBOOT_CMD_RESTART +#define RB_HALT_SYSTEM LINUX_REBOOT_CMD_HALT +#define RB_ENABLE_CAD LINUX_REBOOT_CMD_CAD_ON +#define RB_DISABLE_CAD LINUX_REBOOT_CMD_CAD_OFF +#define RB_POWER_OFF LINUX_REBOOT_CMD_POWER_OFF + +extern int reboot(int reboot_type); +extern int __reboot(int, int, int, void *); + +__END_DECLS + +#endif /* _SYS_REBOOT_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/resource.h b/9/platforms/android-16/arch-mips/usr/include/sys/resource.h new file mode 100644 index 0000000..ef325c7 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/resource.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_RESOURCE_H_ +#define _SYS_RESOURCE_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> /* MUST be included before linux/resource.h */ + +/* TRICK AHEAD: <linux/resource.h> defines a getrusage function with + * a non-standard signature. this is surprising because the + * syscall seems to use the standard one instead. + * once again, creative macro usage saves the days + */ +#define getrusage __kernel_getrusage +#include <linux/resource.h> +#undef getrusage + +typedef unsigned long rlim_t; + +__BEGIN_DECLS + +extern int getpriority(int, int); +extern int setpriority(int, int, int); +extern int getrlimit(int resource, struct rlimit *rlp); +extern int setrlimit(int resource, const struct rlimit *rlp); +extern int getrusage(int who, struct rusage* r_usage); + +__END_DECLS + +#endif /* _SYS_RESOURCE_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/select.h b/9/platforms/android-16/arch-mips/usr/include/sys/select.h new file mode 100644 index 0000000..9d11ee8 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/select.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SELECT_H_ +#define _SYS_SELECT_H_ + +#include <sys/cdefs.h> +#include <sys/time.h> +#include <sys/types.h> +#include <signal.h> + +__BEGIN_DECLS + +typedef __kernel_fd_set fd_set; + +extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); +extern int pselect(int n, fd_set *readfds, fd_set *writefds, fd_set *errfds, + const struct timespec *timeout, const sigset_t *sigmask); + +__END_DECLS + +#endif /* _SYS_SELECT_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/sendfile.h b/9/platforms/android-16/arch-mips/usr/include/sys/sendfile.h new file mode 100644 index 0000000..d5aba26 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/sendfile.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SENDFILE_H_ +#define _SYS_SENDFILE_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +__BEGIN_DECLS + +extern ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count); + +__END_DECLS + +#endif /* _SYS_SENDFILE_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/socket.h b/9/platforms/android-16/arch-mips/usr/include/sys/socket.h new file mode 100644 index 0000000..348ae0a --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/socket.h @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SOCKET_H_ +#define _SYS_SOCKET_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/socket.h> + +__BEGIN_DECLS + +#ifdef __mips__ +#define SOCK_DGRAM 1 +#define SOCK_STREAM 2 +#define SOCK_RAW 3 +#define SOCK_RDM 4 +#define SOCK_SEQPACKET 5 +#define SOCK_DCCP 6 +#define SOCK_PACKET 10 +#else +#define SOCK_STREAM 1 +#define SOCK_DGRAM 2 +#define SOCK_RAW 3 +#define SOCK_RDM 4 +#define SOCK_SEQPACKET 5 +#define SOCK_PACKET 10 +#endif + +#ifdef __i386__ +# define __socketcall extern __attribute__((__cdecl__)) +#else +# define __socketcall extern +#endif + +/* BIONIC: second argument to shutdown() */ +enum { + SHUT_RD = 0, /* no more receptions */ +#define SHUT_RD SHUT_RD + SHUT_WR, /* no more transmissions */ +#define SHUT_WR SHUT_WR + SHUT_RDWR /* no more receptions or transmissions */ +#define SHUT_RDWR SHUT_RDWR +}; + + +typedef int socklen_t; + +__socketcall int socket(int, int, int); +__socketcall int bind(int, const struct sockaddr *, int); +__socketcall int connect(int, const struct sockaddr *, socklen_t); +__socketcall int listen(int, int); +__socketcall int accept(int, struct sockaddr *, socklen_t *); +__socketcall int getsockname(int, struct sockaddr *, socklen_t *); +__socketcall int getpeername(int, struct sockaddr *, socklen_t *); +__socketcall int socketpair(int, int, int, int *); +__socketcall int shutdown(int, int); +__socketcall int setsockopt(int, int, int, const void *, socklen_t); +__socketcall int getsockopt(int, int, int, void *, socklen_t *); +__socketcall int sendmsg(int, const struct msghdr *, unsigned int); +__socketcall int recvmsg(int, struct msghdr *, unsigned int); + +extern ssize_t send(int, const void *, size_t, unsigned int); +extern ssize_t recv(int, void *, size_t, unsigned int); + +__socketcall ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); +__socketcall ssize_t recvfrom(int, void *, size_t, unsigned int, const struct sockaddr *, socklen_t *); + +#undef __socketcall + +__END_DECLS + +#endif /* _SYS_SOCKET_H */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/socketcalls.h b/9/platforms/android-16/arch-mips/usr/include/sys/socketcalls.h new file mode 100644 index 0000000..c74f463 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/socketcalls.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SOCKETCALLS_H_ +#define _SYS_SOCKETCALLS_H_ + +/* socketcalls by number */ + +#define SYS_SOCKET 1 /* sys_socket(2) */ +#define SYS_BIND 2 /* sys_bind(2) */ +#define SYS_CONNECT 3 /* sys_connect(2) */ +#define SYS_LISTEN 4 /* sys_listen(2) */ +#define SYS_ACCEPT 5 /* sys_accept(2) */ +#define SYS_GETSOCKNAME 6 /* sys_getsockname(2) */ +#define SYS_GETPEERNAME 7 /* sys_getpeername(2) */ +#define SYS_SOCKETPAIR 8 /* sys_socketpair(2) */ +#define SYS_SEND 9 /* sys_send(2) */ +#define SYS_RECV 10 /* sys_recv(2) */ +#define SYS_SENDTO 11 /* sys_sendto(2) */ +#define SYS_RECVFROM 12 /* sys_recvfrom(2) */ +#define SYS_SHUTDOWN 13 /* sys_shutdown(2) */ +#define SYS_SETSOCKOPT 14 /* sys_setsockopt(2) */ +#define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */ +#define SYS_SENDMSG 16 /* sys_sendmsg(2) */ +#define SYS_RECVMSG 17 /* sys_recvmsg(2) */ + +#endif /* _SYS_SOCKETCALLS_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/stat.h b/9/platforms/android-16/arch-mips/usr/include/sys/stat.h new file mode 100644 index 0000000..497f404 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/stat.h @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_STAT_H_ +#define _SYS_STAT_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <sys/time.h> +#include <linux/stat.h> + +#include <endian.h> + +__BEGIN_DECLS + +/* really matches stat64 in the kernel, hence the padding + * Note: The kernel zero's the padded region because glibc might read them + * in the hope that the kernel has stretched to using larger sizes. + */ +struct stat { + unsigned long long st_dev; + unsigned char __pad0[4]; + + unsigned long __st_ino; + unsigned int st_mode; + unsigned int st_nlink; + + unsigned long st_uid; + unsigned long st_gid; + + unsigned long long st_rdev; + unsigned char __pad3[4]; + + long long st_size; + unsigned long st_blksize; + unsigned long long st_blocks; + + unsigned long st_atime; + unsigned long st_atime_nsec; + + unsigned long st_mtime; + unsigned long st_mtime_nsec; + + unsigned long st_ctime; + unsigned long st_ctime_nsec; + + unsigned long long st_ino; +}; + +/* For compatibility with GLibc, we provide macro aliases + * for the non-Posix nano-seconds accessors. + */ +#define st_atimensec st_atime_nsec +#define st_mtimensec st_mtime_nsec +#define st_ctimensec st_ctime_nsec + +extern int chmod(const char *, mode_t); +extern int fchmod(int, mode_t); +extern int mkdir(const char *, mode_t); + +extern int stat(const char *, struct stat *); +extern int fstat(int, struct stat *); +extern int lstat(const char *, struct stat *); +extern int mknod(const char *, mode_t, dev_t); +extern mode_t umask(mode_t); + +#define stat64 stat +#define fstat64 fstat +#define lstat64 lstat + +static __inline__ int mkfifo(const char *__p, mode_t __m) +{ + return mknod(__p, (__m & ~S_IFMT) | S_IFIFO, (dev_t)0); +} + +extern int fstatat(int dirfd, const char *path, struct stat *buf, int flags); +extern int mkdirat(int dirfd, const char *pathname, mode_t mode); +extern int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags); +extern int fchmodat(int dirfd, const char *path, mode_t mode, int flags); +extern int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath); + +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +extern int utimensat(int fd, const char *path, const struct timespec times[2], int flags); + +__END_DECLS + +#endif /* _SYS_STAT_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/statfs.h b/9/platforms/android-16/arch-mips/usr/include/sys/statfs.h new file mode 100644 index 0000000..53b3b5e --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/statfs.h @@ -0,0 +1 @@ +#include <sys/vfs.h> diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/syscall.h b/9/platforms/android-16/arch-mips/usr/include/sys/syscall.h new file mode 100644 index 0000000..7055518 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/syscall.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SYSCALL_H_ +#define _SYS_SYSCALL_H_ + +#include <errno.h> +#include <sys/cdefs.h> +#include <sys/types.h> +#include <asm/unistd.h> + +__BEGIN_DECLS + +int syscall(int number, ...); + +__END_DECLS + +#endif /* _SYS_SYSCALL_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/sysconf.h b/9/platforms/android-16/arch-mips/usr/include/sys/sysconf.h new file mode 100644 index 0000000..0a46e7a --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/sysconf.h @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SYSCONF_H_ +#define _SYS_SYSCONF_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +/* as listed by Posix sysconf() description */ +/* most of these will return -1 and ENOSYS */ + +#define _SC_ARG_MAX 0x0000 +#define _SC_BC_BASE_MAX 0x0001 +#define _SC_BC_DIM_MAX 0x0002 +#define _SC_BC_SCALE_MAX 0x0003 +#define _SC_BC_STRING_MAX 0x0004 +#define _SC_CHILD_MAX 0x0005 +#define _SC_CLK_TCK 0x0006 +#define _SC_COLL_WEIGHTS_MAX 0x0007 +#define _SC_EXPR_NEST_MAX 0x0008 +#define _SC_LINE_MAX 0x0009 +#define _SC_NGROUPS_MAX 0x000a +#define _SC_OPEN_MAX 0x000b +#define _SC_PASS_MAX 0x000c +#define _SC_2_C_BIND 0x000d +#define _SC_2_C_DEV 0x000e +#define _SC_2_C_VERSION 0x000f +#define _SC_2_CHAR_TERM 0x0010 +#define _SC_2_FORT_DEV 0x0011 +#define _SC_2_FORT_RUN 0x0012 +#define _SC_2_LOCALEDEF 0x0013 +#define _SC_2_SW_DEV 0x0014 +#define _SC_2_UPE 0x0015 +#define _SC_2_VERSION 0x0016 +#define _SC_JOB_CONTROL 0x0017 +#define _SC_SAVED_IDS 0x0018 +#define _SC_VERSION 0x0019 +#define _SC_RE_DUP_MAX 0x001a +#define _SC_STREAM_MAX 0x001b +#define _SC_TZNAME_MAX 0x001c +#define _SC_XOPEN_CRYPT 0x001d +#define _SC_XOPEN_ENH_I18N 0x001e +#define _SC_XOPEN_SHM 0x001f +#define _SC_XOPEN_VERSION 0x0020 +#define _SC_XOPEN_XCU_VERSION 0x0021 +#define _SC_XOPEN_REALTIME 0x0022 +#define _SC_XOPEN_REALTIME_THREADS 0x0023 +#define _SC_XOPEN_LEGACY 0x0024 +#define _SC_ATEXIT_MAX 0x0025 +#define _SC_IOV_MAX 0x0026 +#define _SC_PAGESIZE 0x0027 +#define _SC_PAGE_SIZE 0x0028 +#define _SC_XOPEN_UNIX 0x0029 +#define _SC_XBS5_ILP32_OFF32 0x002a +#define _SC_XBS5_ILP32_OFFBIG 0x002b +#define _SC_XBS5_LP64_OFF64 0x002c +#define _SC_XBS5_LPBIG_OFFBIG 0x002d +#define _SC_AIO_LISTIO_MAX 0x002e +#define _SC_AIO_MAX 0x002f +#define _SC_AIO_PRIO_DELTA_MAX 0x0030 +#define _SC_DELAYTIMER_MAX 0x0031 +#define _SC_MQ_OPEN_MAX 0x0032 +#define _SC_MQ_PRIO_MAX 0x0033 +#define _SC_RTSIG_MAX 0x0034 +#define _SC_SEM_NSEMS_MAX 0x0035 +#define _SC_SEM_VALUE_MAX 0x0036 +#define _SC_SIGQUEUE_MAX 0x0037 +#define _SC_TIMER_MAX 0x0038 +#define _SC_ASYNCHRONOUS_IO 0x0039 +#define _SC_FSYNC 0x003a +#define _SC_MAPPED_FILES 0x003b +#define _SC_MEMLOCK 0x003c +#define _SC_MEMLOCK_RANGE 0x003d +#define _SC_MEMORY_PROTECTION 0x003e +#define _SC_MESSAGE_PASSING 0x003f +#define _SC_PRIORITIZED_IO 0x0040 +#define _SC_PRIORITY_SCHEDULING 0x0041 +#define _SC_REALTIME_SIGNALS 0x0042 +#define _SC_SEMAPHORES 0x0043 +#define _SC_SHARED_MEMORY_OBJECTS 0x0044 +#define _SC_SYNCHRONIZED_IO 0x0045 +#define _SC_TIMERS 0x0046 +#define _SC_GETGR_R_SIZE_MAX 0x0047 +#define _SC_GETPW_R_SIZE_MAX 0x0048 +#define _SC_LOGIN_NAME_MAX 0x0049 +#define _SC_THREAD_DESTRUCTOR_ITERATIONS 0x004a +#define _SC_THREAD_KEYS_MAX 0x004b +#define _SC_THREAD_STACK_MIN 0x004c +#define _SC_THREAD_THREADS_MAX 0x004d +#define _SC_TTY_NAME_MAX 0x004e + +#define _SC_THREADS 0x004f +#define _SC_THREAD_ATTR_STACKADDR 0x0050 +#define _SC_THREAD_ATTR_STACKSIZE 0x0051 +#define _SC_THREAD_PRIORITY_SCHEDULING 0x0052 +#define _SC_THREAD_PRIO_INHERIT 0x0053 +#define _SC_THREAD_PRIO_PROTECT 0x0054 +#define _SC_THREAD_SAFE_FUNCTIONS 0x0055 + +#define _SC_NPROCESSORS_CONF 0x0060 +#define _SC_NPROCESSORS_ONLN 0x0061 +#define _SC_PHYS_PAGES 0x0062 +#define _SC_AVPHYS_PAGES 0x0063 +#define _SC_MONOTONIC_CLOCK 0x0064 + +extern int sysconf(int name); + +__END_DECLS + +#endif /* _SYS_SYSCONF_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/sysinfo.h b/9/platforms/android-16/arch-mips/usr/include/sys/sysinfo.h new file mode 100644 index 0000000..c7e46e6 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/sysinfo.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SYSINFO_H_ +#define _SYS_SYSINFO_H_ + +#include <sys/cdefs.h> +#include <linux/kernel.h> + +__BEGIN_DECLS + +extern int sysinfo (struct sysinfo *info); + +__END_DECLS + +#endif /* _SYS_SYSINFO_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/syslimits.h b/9/platforms/android-16/arch-mips/usr/include/sys/syslimits.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/syslimits.h diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/sysmacros.h b/9/platforms/android-16/arch-mips/usr/include/sys/sysmacros.h new file mode 100644 index 0000000..6f053a8 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/sysmacros.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SYSMACROS_H_ +#define _SYS_SYSMACROS_H_ + +/* some rogue code includes this file directly :-( */ +#ifndef _SYS_TYPES_H_ +# include <sys/types.h> +#endif + +static __inline__ int major(dev_t _dev) +{ + return (_dev >> 8) & 0xfff; +} + +static __inline__ int minor(dev_t _dev) +{ + return (_dev & 0xff) | ((_dev >> 12) & 0xfff00); +} + +static __inline__ dev_t makedev(int __ma, int __mi) +{ + return ((__ma & 0xfff) << 8) | (__mi & 0xff) | ((__mi & 0xfff00) << 12); +} + +#endif /* _SYS_SYSMACROS_H_ */ + diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/system_properties.h b/9/platforms/android-16/arch-mips/usr/include/sys/system_properties.h new file mode 100644 index 0000000..4fdc944 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/system_properties.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _INCLUDE_SYS_SYSTEM_PROPERTIES_H +#define _INCLUDE_SYS_SYSTEM_PROPERTIES_H + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +typedef struct prop_info prop_info; + +#define PROP_NAME_MAX 32 +#define PROP_VALUE_MAX 92 + +/* Look up a system property by name, copying its value and a +** \0 terminator to the provided pointer. The total bytes +** copied will be no greater than PROP_VALUE_MAX. Returns +** the string length of the value. A property that is not +** defined is identical to a property with a length 0 value. +*/ +int __system_property_get(const char *name, char *value); + +/* Return a pointer to the system property named name, if it +** exists, or NULL if there is no such property. Use +** __system_property_read() to obtain the string value from +** the returned prop_info pointer. +** +** It is safe to cache the prop_info pointer to avoid future +** lookups. These returned pointers will remain valid for +** the lifetime of the system. +*/ +const prop_info *__system_property_find(const char *name); + +/* Read the value of a system property. Returns the length +** of the value. Copies the value and \0 terminator into +** the provided value pointer. Total length (including +** terminator) will be no greater that PROP_VALUE_MAX. +** +** If name is nonzero, up to PROP_NAME_MAX bytes will be +** copied into the provided name pointer. The name will +** be \0 terminated. +*/ +int __system_property_read(const prop_info *pi, char *name, char *value); + +/* Return a prop_info for the nth system property, or NULL if +** there is no nth property. Use __system_property_read() to +** read the value of this property. +** +** This method is for inspecting and debugging the property +** system. Please use __system_property_find() instead. +** +** Order of results may change from call to call. This is +** not a bug. +*/ +const prop_info *__system_property_find_nth(unsigned n); + +__END_DECLS + +#endif diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/time.h b/9/platforms/android-16/arch-mips/usr/include/sys/time.h new file mode 100644 index 0000000..1f010d4 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/time.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_TIME_H_ +#define _SYS_TIME_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/time.h> + +__BEGIN_DECLS + +extern int gettimeofday(struct timeval *, struct timezone *); +extern int settimeofday(const struct timeval *, const struct timezone *); + +extern int getitimer(int, struct itimerval *); +extern int setitimer(int, const struct itimerval *, struct itimerval *); + +extern int utimes(const char *, const struct timeval *); + +#define timerclear(a) \ + ((a)->tv_sec = (a)->tv_usec = 0) + +#define timerisset(a) \ + ((a)->tv_sec != 0 || (a)->tv_usec != 0) + +#define timercmp(a, b, op) \ + ((a)->tv_sec == (b)->tv_sec \ + ? (a)->tv_usec op (b)->tv_usec \ + : (a)->tv_sec op (b)->tv_sec) + +#define timeradd(a, b, res) \ + do { \ + (res)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ + (res)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ + if ((res)->tv_usec >= 1000000) { \ + (res)->tv_usec -= 1000000; \ + (res)->tv_sec += 1; \ + } \ + } while (0) + +#define timersub(a, b, res) \ + do { \ + (res)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (res)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((res)->tv_usec < 0) { \ + (res)->tv_usec += 1000000; \ + (res)->tv_sec -= 1; \ + } \ + } while (0) + +__END_DECLS + +#endif /* _SYS_TIME_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/timeb.h b/9/platforms/android-16/arch-mips/usr/include/sys/timeb.h new file mode 100644 index 0000000..f2cc39c --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/timeb.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_TIMEB_H +#define _SYS_TIMEB_H + +#include <sys/time.h> + +__BEGIN_DECLS + +struct timeb { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; +}; + +extern int ftime(struct timeb* timebuf); + +__END_DECLS + +#endif /* _SYS_TIMEB_H */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/times.h b/9/platforms/android-16/arch-mips/usr/include/sys/times.h new file mode 100644 index 0000000..1b9b8b2 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/times.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_TIMES_H_ +#define _SYS_TIMES_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/times.h> + +__BEGIN_DECLS + +extern clock_t times(struct tms *); + +__END_DECLS + +#endif /* _SYS_TIMES_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/ttychars.h b/9/platforms/android-16/arch-mips/usr/include/sys/ttychars.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/ttychars.h diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/ttydev.h b/9/platforms/android-16/arch-mips/usr/include/sys/ttydev.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/ttydev.h diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/types.h b/9/platforms/android-16/arch-mips/usr/include/sys/types.h new file mode 100644 index 0000000..15ecb37 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/types.h @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_TYPES_H_ +#define _SYS_TYPES_H_ + +#define __need_size_t +#define __need_ptrdiff_t +#include <stddef.h> +#include <stdint.h> +#include <sys/cdefs.h> + +#include <linux/posix_types.h> +#include <asm/types.h> +#include <linux/types.h> +#include <machine/kernel.h> + +typedef __u32 __kernel_dev_t; + +/* be careful with __kernel_gid_t and __kernel_uid_t + * these are defined as 16-bit for legacy reason, but + * the kernel uses 32-bits instead. + * + * 32-bit valuea are required for Android, so use + * __kernel_uid32_t and __kernel_gid32_t + */ + +typedef __kernel_blkcnt_t blkcnt_t; +typedef __kernel_blksize_t blksize_t; +typedef __kernel_clock_t clock_t; +typedef __kernel_clockid_t clockid_t; +typedef __kernel_dev_t dev_t; +typedef __kernel_fsblkcnt_t fsblkcnt_t; +typedef __kernel_fsfilcnt_t fsfilcnt_t; +typedef __kernel_gid32_t gid_t; +typedef __kernel_id_t id_t; +typedef __kernel_ino_t ino_t; +typedef __kernel_key_t key_t; +typedef __kernel_mode_t mode_t; +typedef __kernel_nlink_t nlink_t; +#ifndef _OFF_T_DEFINED_ +#define _OFF_T_DEFINED_ +typedef __kernel_off_t off_t; +#endif +typedef __kernel_loff_t loff_t; +typedef loff_t off64_t; /* GLibc-specific */ + +typedef __kernel_pid_t pid_t; + +/* while POSIX wants these in <sys/types.h>, we + * declare then in <pthread.h> instead */ +#if 0 +typedef .... pthread_attr_t; +typedef .... pthread_cond_t; +typedef .... pthread_condattr_t; +typedef .... pthread_key_t; +typedef .... pthread_mutex_t; +typedef .... pthread_once_t; +typedef .... pthread_rwlock_t; +typedef .... pthread_rwlock_attr_t; +typedef .... pthread_t; +#endif + +#ifndef _SSIZE_T_DEFINED_ +#define _SSIZE_T_DEFINED_ +typedef long int ssize_t; +#endif + +typedef __kernel_suseconds_t suseconds_t; +typedef __kernel_time_t time_t; +typedef __kernel_uid32_t uid_t; +typedef signed long useconds_t; + +typedef __kernel_daddr_t daddr_t; +typedef __kernel_timer_t timer_t; +typedef __kernel_mqd_t mqd_t; + +typedef __kernel_caddr_t caddr_t; +typedef unsigned int uint_t; +typedef unsigned int uint; + +/* for some applications */ +#include <sys/sysmacros.h> + +#ifdef __BSD_VISIBLE +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +typedef unsigned long u_long; + +typedef uint32_t u_int32_t; +typedef uint16_t u_int16_t; +typedef uint8_t u_int8_t; +typedef uint64_t u_int64_t; +#endif + +#endif diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/uio.h b/9/platforms/android-16/arch-mips/usr/include/sys/uio.h new file mode 100644 index 0000000..0251716 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/uio.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_UIO_H_ +#define _SYS_UIO_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/uio.h> + +__BEGIN_DECLS + +int readv(int, const struct iovec *, int); +int writev(int, const struct iovec *, int); + +__END_DECLS + +#endif /* _SYS_UIO_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/un.h b/9/platforms/android-16/arch-mips/usr/include/sys/un.h new file mode 100644 index 0000000..f89ead3 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/un.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_UN_H_ +#define _SYS_UN_H_ + +#include <sys/_types.h> +typedef __sa_family_t sa_family_t; + +#include <linux/un.h> + +#endif /* _SYS_UN_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/utime.h b/9/platforms/android-16/arch-mips/usr/include/sys/utime.h new file mode 100644 index 0000000..9f8810e --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/utime.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_UTIME_H_ +#define _SYS_UTIME_H_ + +#include <linux/utime.h> + +#endif /* _SYS_UTIME_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/utsname.h b/9/platforms/android-16/arch-mips/usr/include/sys/utsname.h new file mode 100644 index 0000000..d54a994 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/utsname.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_UTSNAME_H_ +#define _SYS_UTSNAME_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#define SYS_NMLN 65 + +struct utsname { + char sysname [SYS_NMLN]; + char nodename [SYS_NMLN]; + char release [SYS_NMLN]; + char version [SYS_NMLN]; + char machine [SYS_NMLN]; + char domainname[SYS_NMLN]; +}; + +extern int uname(struct utsname *); + +__END_DECLS + +#endif /* _SYS_UTSNAME_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/vfs.h b/9/platforms/android-16/arch-mips/usr/include/sys/vfs.h new file mode 100644 index 0000000..4ec0e0d --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/vfs.h @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_VFS_H_ +#define _SYS_VFS_H_ + +#include <stdint.h> +#include <sys/cdefs.h> +#include <sys/types.h> + +__BEGIN_DECLS + +/* The kernel's __kernel_fsid_t has a 'val' member but glibc uses '__val'. */ +typedef struct { int __val[2]; } __fsid_t; + +/* Our struct statfs corresponds to the kernel's statfs64 type. */ +#ifdef __mips__ +struct statfs { + uint32_t f_type; + uint32_t f_bsize; + uint32_t f_frsize; + uint32_t __pad; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_files; + uint64_t f_ffree; + uint64_t f_bavail; + __fsid_t f_fsid; + uint32_t f_namelen; + uint32_t f_flags; + uint32_t f_spare[5]; +}; +#else +struct statfs { + uint32_t f_type; + uint32_t f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + __fsid_t f_fsid; + uint32_t f_namelen; + uint32_t f_frsize; + uint32_t f_flags; + uint32_t f_spare[4]; +}; +#endif + +#define ADFS_SUPER_MAGIC 0xadf5 +#define AFFS_SUPER_MAGIC 0xADFF +#define BEFS_SUPER_MAGIC 0x42465331 +#define BFS_MAGIC 0x1BADFACE +#define CIFS_MAGIC_NUMBER 0xFF534D42 +#define CODA_SUPER_MAGIC 0x73757245 +#define COH_SUPER_MAGIC 0x012FF7B7 +#define CRAMFS_MAGIC 0x28cd3d45 +#define DEVFS_SUPER_MAGIC 0x1373 +#define EFS_SUPER_MAGIC 0x00414A53 +#define EXT_SUPER_MAGIC 0x137D +#define EXT2_OLD_SUPER_MAGIC 0xEF51 +#define EXT2_SUPER_MAGIC 0xEF53 +#define EXT3_SUPER_MAGIC 0xEF53 +#define HFS_SUPER_MAGIC 0x4244 +#define HPFS_SUPER_MAGIC 0xF995E849 +#define HUGETLBFS_MAGIC 0x958458f6 +#define ISOFS_SUPER_MAGIC 0x9660 +#define JFFS2_SUPER_MAGIC 0x72b6 +#define JFS_SUPER_MAGIC 0x3153464a +#define MINIX_SUPER_MAGIC 0x137F /* orig. minix */ +#define MINIX_SUPER_MAGIC2 0x138F /* 30 char minix */ +#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 */ +#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2, 30 char names */ +#define MSDOS_SUPER_MAGIC 0x4d44 +#define NCP_SUPER_MAGIC 0x564c +#define NFS_SUPER_MAGIC 0x6969 +#define NTFS_SB_MAGIC 0x5346544e +#define OPENPROM_SUPER_MAGIC 0x9fa1 +#define PROC_SUPER_MAGIC 0x9fa0 +#define QNX4_SUPER_MAGIC 0x002f +#define REISERFS_SUPER_MAGIC 0x52654973 +#define ROMFS_MAGIC 0x7275 +#define SMB_SUPER_MAGIC 0x517B +#define SYSV2_SUPER_MAGIC 0x012FF7B6 +#define SYSV4_SUPER_MAGIC 0x012FF7B5 +#define TMPFS_MAGIC 0x01021994 +#define UDF_SUPER_MAGIC 0x15013346 +#define UFS_MAGIC 0x00011954 +#define USBDEVICE_SUPER_MAGIC 0x9fa2 +#define VXFS_SUPER_MAGIC 0xa501FCF5 +#define XENIX_SUPER_MAGIC 0x012FF7B4 +#define XFS_SUPER_MAGIC 0x58465342 +#define _XIAFS_SUPER_MAGIC 0x012FD16D + +extern int statfs(const char *, struct statfs *); +extern int fstatfs(int, struct statfs *); + +__END_DECLS + +#endif /* _SYS_VFS_H_ */ diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/vt.h b/9/platforms/android-16/arch-mips/usr/include/sys/vt.h new file mode 100644 index 0000000..b37a869 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/vt.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include <linux/vt.h> diff --git a/9/platforms/android-16/arch-mips/usr/include/sys/wait.h b/9/platforms/android-16/arch-mips/usr/include/sys/wait.h new file mode 100644 index 0000000..da29734 --- /dev/null +++ b/9/platforms/android-16/arch-mips/usr/include/sys/wait.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_WAIT_H_ +#define _SYS_WAIT_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <sys/resource.h> +#include <linux/wait.h> +#include <signal.h> + +__BEGIN_DECLS + +#define WEXITSTATUS(s) (((s) & 0xff00) >> 8) +#define WCOREDUMP(s) ((s) & 0x80) +#define WTERMSIG(s) ((s) & 0x7f) +#define WSTOPSIG(s) WEXITSTATUS(s) + +#define WIFEXITED(s) (WTERMSIG(s) == 0) +#define WIFSTOPPED(s) (WTERMSIG(s) == 0x7f) +#define WIFSIGNALED(s) (WTERMSIG((s)+1) >= 2) + +extern pid_t wait(int *); +extern pid_t waitpid(pid_t, int *, int); +extern pid_t wait3(int *, int, struct rusage *); +static __inline__ pid_t wait4(pid_t p, int *s, int o, struct rusage *r) +{ + extern pid_t __wait4(pid_t, int *, int, struct rusage *); + return __wait4(p,s,o,r); +} + +/* Posix states that idtype_t should be an enumeration type, but + * the kernel headers define P_ALL, P_PID and P_PGID as constant macros + * instead. + */ +typedef int idtype_t; + +extern int waitid(idtype_t which, id_t id, siginfo_t *info, int options); + +__END_DECLS + +#endif /* _SYS_WAIT_H_ */ |