am 152e978f: Merge "Put stdin/stdout/stderr symbols in place." into lmp-mr1-dev
* commit '152e978f73fc6cd37d0d82de69f1cf8134b34b90':
Put stdin/stdout/stderr symbols in place.
diff --git a/HACKING.txt b/HACKING.txt
deleted file mode 100644
index 27e1368..0000000
--- a/HACKING.txt
+++ /dev/null
@@ -1,162 +0,0 @@
-Working on bionic
-=================
-
-What are the big pieces of bionic?
-----------------------------------
-
-libc/ --- libc.so, libc.a
- The C library. Stuff like fopen(3) and kill(2).
-libm/ --- libm.so, libm.a
- The math library. Traditionally Unix systems kept stuff like sin(3) and
- cos(3) in a separate library to save space in the days before shared
- libraries.
-libdl/ --- libdl.so
- The dynamic linker interface library. This is actually just a bunch of
- stubs that the dynamic linker replaces with pointers to its own
- implementation at runtime. This is where stuff like dlopen(3) lives.
-libstdc++/ --- libstdc++.so
- The C++ ABI support functions. The C++ compiler doesn't know how to
- implement thread-safe static initialization and the like, so it just calls
- functions that are supplied by the system. Stuff like __cxa_guard_acquire
- and __cxa_pure_virtual live here.
-
-linker/ --- /system/bin/linker and /system/bin/linker64
- The dynamic linker. When you run a dynamically-linked executable, its ELF
- file has a DT_INTERP entry that says "use the following program to start me".
- On Android, that's either linker or linker64 (depending on whether it's a
- 32-bit or 64-bit executable). It's responsible for loading the ELF executable
- into memory and resolving references to symbols (so that when your code tries
- to jump to fopen(3), say, it lands in the right place).
-
-tests/ --- unit tests
- The tests/ directory contains unit tests. Roughly arranged as one file per
- publicly-exported header file.
-benchmarks/ --- benchmarks
- The benchmarks/ directory contains benchmarks.
-
-
-What's in libc/?
-----------------
-
-libc/
- arch-arm/
- arch-arm64/
- arch-common/
- arch-mips/
- arch-mips64/
- arch-x86/
- arch-x86_64/
- # Each architecture has its own subdirectory for stuff that isn't shared
- # because it's architecture-specific. There will be a .mk file in here that
- # drags in all the architecture-specific files.
- bionic/
- # Every architecture needs a handful of machine-specific assembler files.
- # They live here.
- include/
- machine/
- # The majority of header files are actually in libc/include/, but many
- # of them pull in a <machine/something.h> for things like limits,
- # endianness, and how floating point numbers are represented. Those
- # headers live here.
- string/
- # Most architectures have a handful of optional assembler files
- # implementing optimized versions of various routines. The <string.h>
- # functions are particular favorites.
- syscalls/
- # The syscalls directories contain script-generated assembler files.
- # See 'Adding system calls' later.
-
- include/
- # The public header files on everyone's include path. These are a mixture of
- # files written by us and files taken from BSD.
-
- kernel/
- # The kernel uapi header files. These are scrubbed copies of the originals
- # in external/kernel-headers/. These files must not be edited directly. The
- # generate_uapi_headers.sh script should be used to go from a kernel tree to
- # external/kernel-headers/ --- this takes care of the architecture-specific
- # details. The update_all.py script should be used to regenerate bionic's
- # scrubbed headers from external/kernel-headers/.
-
- private/
- # These are private header files meant for use within bionic itself.
-
- dns/
- # Contains the DNS resolver (originates from NetBSD code).
-
- upstream-dlmalloc/
- upstream-freebsd/
- upstream-netbsd/
- upstream-openbsd/
- # These directories contain unmolested upstream source. Any time we can
- # just use a BSD implementation of something unmodified, we should.
- # The structure under these directories mimics the upstream tree,
- # but there's also...
- android/
- include/
- # This is where we keep the hacks necessary to build BSD source
- # in our world. The *-compat.h files are automatically included
- # using -include, but we also provide equivalents for missing
- # header/source files needed by the BSD implementation.
-
- bionic/
- # This is the biggest mess. The C++ files are files we own, typically
- # because the Linux kernel interface is sufficiently different that we
- # can't use any of the BSD implementations. The C files are usually
- # legacy mess that needs to be sorted out, either by replacing it with
- # current upstream source in one of the upstream directories or by
- # switching the file to C++ and cleaning it up.
-
- stdio/
- # These are legacy files of dubious provenance. We're working to clean
- # this mess up, and this directory should disappear.
-
- tools/
- # Various tools used to maintain bionic.
-
- tzcode/
- # A modified superset of the IANA tzcode. Most of the modifications relate
- # to Android's use of a single file (with corresponding index) to contain
- # time zone data.
- zoneinfo/
- # Android-format time zone data.
- # See 'Updating tzdata' later.
-
-
-Adding system calls
--------------------
-
-Adding a system call usually involves:
-
- 1. Add entries to SYSCALLS.TXT.
- See SYSCALLS.TXT itself for documentation on the format.
- 2. Run the gensyscalls.py script.
- 3. Add constants (and perhaps types) to the appropriate header file.
- Note that you should check to see whether the constants are already in
- kernel uapi header files, in which case you just need to make sure that
- the appropriate POSIX header file in libc/include/ includes the
- relevant file or files.
- 4. Add function declarations to the appropriate header file.
- 5. Add at least basic tests. Even a test that deliberately supplies
- an invalid argument helps check that we're generating the right symbol
- and have the right declaration in the header file. (And strace(1) can
- confirm that the correct system call is being made.)
-
-
-Updating kernel header files
-----------------------------
-
-As mentioned above, this is currently a two-step process:
-
- 1. Use generate_uapi_headers.sh to go from a Linux source tree to appropriate
- contents for external/kernel-headers/.
- 2. Run update_all.py to scrub those headers and import them into bionic.
-
-
-Updating tzdata
----------------
-
-This is fully automated:
-
- 1. Run update-tzdata.py.
-
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a031fbc
--- /dev/null
+++ b/README.md
@@ -0,0 +1,258 @@
+Working on bionic
+=================
+
+What are the big pieces of bionic?
+----------------------------------
+
+#### libc/ --- libc.so, libc.a
+
+The C library. Stuff like `fopen(3)` and `kill(2)`.
+
+#### libm/ --- libm.so, libm.a
+
+The math library. Traditionally Unix systems kept stuff like `sin(3)` and
+`cos(3)` in a separate library to save space in the days before shared
+libraries.
+
+#### libdl/ --- libdl.so
+
+The dynamic linker interface library. This is actually just a bunch of stubs
+that the dynamic linker replaces with pointers to its own implementation at
+runtime. This is where stuff like `dlopen(3)` lives.
+
+#### libstdc++/ --- libstdc++.so
+
+The C++ ABI support functions. The C++ compiler doesn't know how to implement
+thread-safe static initialization and the like, so it just calls functions that
+are supplied by the system. Stuff like `__cxa_guard_acquire` and
+`__cxa_pure_virtual` live here.
+
+#### linker/ --- /system/bin/linker and /system/bin/linker64
+
+The dynamic linker. When you run a dynamically-linked executable, its ELF file
+has a `DT_INTERP` entry that says "use the following program to start me". On
+Android, that's either `linker` or `linker64` (depending on whether it's a
+32-bit or 64-bit executable). It's responsible for loading the ELF executable
+into memory and resolving references to symbols (so that when your code tries to
+jump to `fopen(3)`, say, it lands in the right place).
+
+#### tests/ --- unit tests
+
+The `tests/` directory contains unit tests. Roughly arranged as one file per
+publicly-exported header file.
+
+#### benchmarks/ --- benchmarks
+
+The `benchmarks/` directory contains benchmarks.
+
+
+What's in libc/?
+----------------
+
+<pre>
+libc/
+ arch-arm/
+ arch-arm64/
+ arch-common/
+ arch-mips/
+ arch-mips64/
+ arch-x86/
+ arch-x86_64/
+ # Each architecture has its own subdirectory for stuff that isn't shared
+ # because it's architecture-specific. There will be a .mk file in here that
+ # drags in all the architecture-specific files.
+ bionic/
+ # Every architecture needs a handful of machine-specific assembler files.
+ # They live here.
+ include/
+ machine/
+ # The majority of header files are actually in libc/include/, but many
+ # of them pull in a <machine/something.h> for things like limits,
+ # endianness, and how floating point numbers are represented. Those
+ # headers live here.
+ string/
+ # Most architectures have a handful of optional assembler files
+ # implementing optimized versions of various routines. The <string.h>
+ # functions are particular favorites.
+ syscalls/
+ # The syscalls directories contain script-generated assembler files.
+ # See 'Adding system calls' later.
+
+ include/
+ # The public header files on everyone's include path. These are a mixture of
+ # files written by us and files taken from BSD.
+
+ kernel/
+ # The kernel uapi header files. These are scrubbed copies of the originals
+ # in external/kernel-headers/. These files must not be edited directly. The
+ # generate_uapi_headers.sh script should be used to go from a kernel tree to
+ # external/kernel-headers/ --- this takes care of the architecture-specific
+ # details. The update_all.py script should be used to regenerate bionic's
+ # scrubbed headers from external/kernel-headers/.
+
+ private/
+ # These are private header files meant for use within bionic itself.
+
+ dns/
+ # Contains the DNS resolver (originates from NetBSD code).
+
+ upstream-dlmalloc/
+ upstream-freebsd/
+ upstream-netbsd/
+ upstream-openbsd/
+ # These directories contain unmolested upstream source. Any time we can
+ # just use a BSD implementation of something unmodified, we should.
+ # The structure under these directories mimics the upstream tree,
+ # but there's also...
+ android/
+ include/
+ # This is where we keep the hacks necessary to build BSD source
+ # in our world. The *-compat.h files are automatically included
+ # using -include, but we also provide equivalents for missing
+ # header/source files needed by the BSD implementation.
+
+ bionic/
+ # This is the biggest mess. The C++ files are files we own, typically
+ # because the Linux kernel interface is sufficiently different that we
+ # can't use any of the BSD implementations. The C files are usually
+ # legacy mess that needs to be sorted out, either by replacing it with
+ # current upstream source in one of the upstream directories or by
+ # switching the file to C++ and cleaning it up.
+
+ stdio/
+ # These are legacy files of dubious provenance. We're working to clean
+ # this mess up, and this directory should disappear.
+
+ tools/
+ # Various tools used to maintain bionic.
+
+ tzcode/
+ # A modified superset of the IANA tzcode. Most of the modifications relate
+ # to Android's use of a single file (with corresponding index) to contain
+ # time zone data.
+ zoneinfo/
+ # Android-format time zone data.
+ # See 'Updating tzdata' later.
+</pre>
+
+
+Adding system calls
+-------------------
+
+Adding a system call usually involves:
+
+ 1. Add entries to SYSCALLS.TXT.
+ See SYSCALLS.TXT itself for documentation on the format.
+ 2. Run the gensyscalls.py script.
+ 3. Add constants (and perhaps types) to the appropriate header file.
+ Note that you should check to see whether the constants are already in
+ kernel uapi header files, in which case you just need to make sure that
+ the appropriate POSIX header file in libc/include/ includes the
+ relevant file or files.
+ 4. Add function declarations to the appropriate header file.
+ 5. Add at least basic tests. Even a test that deliberately supplies
+ an invalid argument helps check that we're generating the right symbol
+ and have the right declaration in the header file. (And strace(1) can
+ confirm that the correct system call is being made.)
+
+
+Updating kernel header files
+----------------------------
+
+As mentioned above, this is currently a two-step process:
+
+ 1. Use generate_uapi_headers.sh to go from a Linux source tree to appropriate
+ contents for external/kernel-headers/.
+ 2. Run update_all.py to scrub those headers and import them into bionic.
+
+
+Updating tzdata
+---------------
+
+This is fully automated:
+
+ 1. Run update-tzdata.py.
+
+
+Verifying changes
+-----------------
+
+If you make a change that is likely to have a wide effect on the tree (such as a
+libc header change), you should run `make checkbuild`. A regular `make` will
+_not_ build the entire tree; just the minimum number of projects that are
+required for the device. Tests, additional developer tools, and various other
+modules will not be built. Note that `make checkbuild` will not be complete
+either, as `make tests` covers a few additional modules, but generally speaking
+`make checkbuild` is enough.
+
+
+Running the tests
+-----------------
+
+The tests are all built from the tests/ directory.
+
+### Device tests
+
+ $ mma
+ $ adb sync
+ $ adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
+ $ adb shell \
+ /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
+ # Only for 64-bit targets
+ $ adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
+ $ adb shell \
+ /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
+
+### Host tests
+
+The host tests require that you have `lunch`ed either an x86 or x86_64 target.
+
+ $ mma
+ # 64-bit tests for 64-bit targets, 32-bit otherwise.
+ $ mm bionic-unit-tests-run-on-host
+ # Only exists for 64-bit targets.
+ $ mm bionic-unit-tests-run-on-host32
+
+### Against glibc
+
+As a way to check that our tests do in fact test the correct behavior (and not
+just the behavior we think is correct), it is possible to run the tests against
+the host's glibc.
+
+ $ mma
+ $ bionic-unit-tests-glibc32 # already in your path
+ $ bionic-unit-tests-glibc64
+
+
+Gathering test coverage
+-----------------------
+
+For either host or target coverage, you must first:
+
+ * `$ export NATIVE_COVERAGE=true`
+ * Note that the build system is ignorant to this flag being toggled, i.e. if
+ you change this flag, you will have to manually rebuild bionic.
+ * Set `bionic_coverage=true` in `libc/Android.mk` and `libm/Android.mk`.
+
+### Coverage from device tests
+
+ $ mma
+ $ adb sync
+ $ adb shell \
+ GCOV_PREFIX=/data/local/tmp/gcov \
+ GCOV_PREFIX_STRIP=`echo $ANDROID_BUILD_TOP | grep -o / | wc -l` \
+ /data/nativetest/bionic-unit-tests/bionic-unit-tests32
+ $ acov
+
+`acov` will pull all coverage information from the device, push it to the right
+directories, run `lcov`, and open the coverage report in your browser.
+
+### Coverage from host tests
+
+First, build and run the host tests as usual (see above).
+
+ $ croot
+ $ lcov -c -d $ANDROID_PRODUCT_OUT -o coverage.info
+ $ genhtml -o covreport coverage.info # or lcov --list coverage.info
+
+The coverage report is now available at `covreport/index.html`.
diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk
index 4d7ad96..f163463 100644
--- a/benchmarks/Android.mk
+++ b/benchmarks/Android.mk
@@ -32,7 +32,6 @@
benchmark_src_files = \
benchmark_main.cpp \
math_benchmark.cpp \
- property_benchmark.cpp \
pthread_benchmark.cpp \
semaphore_benchmark.cpp \
stdio_benchmark.cpp \
@@ -41,7 +40,8 @@
unistd_benchmark.cpp \
# Build benchmarks for the device (with bionic's .so). Run with:
-# adb shell bionic-benchmarks
+# adb shell bionic-benchmarks32
+# adb shell bionic-benchmarks64
include $(CLEAR_VARS)
LOCAL_MODULE := bionic-benchmarks
LOCAL_MODULE_STEM_32 := bionic-benchmarks32
@@ -49,11 +49,29 @@
LOCAL_MULTILIB := both
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_CFLAGS += $(benchmark_c_flags)
-LOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include
-LOCAL_SHARED_LIBRARIES += libstlport
-LOCAL_SRC_FILES := $(benchmark_src_files)
+LOCAL_SRC_FILES := $(benchmark_src_files) property_benchmark.cpp
+LOCAL_CXX_STL := libc++
include $(BUILD_EXECUTABLE)
+# We don't build a static benchmark executable because it's not usually
+# useful. If you're trying to run the current benchmarks on an older
+# release, it's (so far at least) always because you want to measure the
+# performance of the old release's libc, and a static benchmark isn't
+# going to let you do that.
+
+# Build benchmarks for the host (against glibc!). Run with:
+include $(CLEAR_VARS)
+LOCAL_MODULE := bionic-benchmarks-glibc
+LOCAL_MODULE_STEM_32 := bionic-benchmarks-glibc32
+LOCAL_MODULE_STEM_64 := bionic-benchmarks-glibc64
+LOCAL_MULTILIB := both
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_CFLAGS += $(benchmark_c_flags)
+LOCAL_LDFLAGS += -lrt
+LOCAL_SRC_FILES := $(benchmark_src_files)
+LOCAL_CXX_STL := libc++
+include $(BUILD_HOST_EXECUTABLE)
+
ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
ifeq ($(TARGET_ARCH),x86)
LINKER = linker
@@ -64,13 +82,13 @@
endif
bionic-benchmarks-run-on-host: bionic-benchmarks $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh
- if [ ! -d /system -o ! -d /system/bin ]; then \
- echo "Attempting to create /system/bin"; \
- sudo mkdir -p -m 0777 /system/bin; \
+ if [ ! -d /system ]; then \
+ echo "Attempting to create /system"; \
+ sudo mkdir -p -m 0777 /system; \
fi
mkdir -p $(TARGET_OUT_DATA)/local/tmp
- cp $(TARGET_OUT_EXECUTABLES)/$(LINKER) /system/bin
- cp $(TARGET_OUT_EXECUTABLES)/sh /system/bin
+ ln -fs `realpath $(TARGET_OUT)/bin` /system/
+ ln -fs `realpath $(TARGET_OUT)/etc` /system/
ANDROID_DATA=$(TARGET_OUT_DATA) \
ANDROID_ROOT=$(TARGET_OUT) \
LD_LIBRARY_PATH=$(TARGET_OUT_SHARED_LIBRARIES) \
diff --git a/benchmarks/benchmark_main.cpp b/benchmarks/benchmark_main.cpp
index d60670b..815d56b 100644
--- a/benchmarks/benchmark_main.cpp
+++ b/benchmarks/benchmark_main.cpp
@@ -19,6 +19,7 @@
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
+#include <time.h>
#include <string>
#include <map>
diff --git a/benchmarks/math_benchmark.cpp b/benchmarks/math_benchmark.cpp
index a9748cd..8d6dd10 100644
--- a/benchmarks/math_benchmark.cpp
+++ b/benchmarks/math_benchmark.cpp
@@ -20,8 +20,8 @@
#include <math.h>
// Avoid optimization.
-double d;
-double v;
+volatile double d;
+volatile double v;
static void BM_math_sqrt(int iters) {
StartBenchmarkTiming();
diff --git a/benchmarks/pthread_benchmark.cpp b/benchmarks/pthread_benchmark.cpp
index c010dd2..92e5998 100644
--- a/benchmarks/pthread_benchmark.cpp
+++ b/benchmarks/pthread_benchmark.cpp
@@ -80,7 +80,7 @@
static void BM_pthread_mutex_lock_ERRORCHECK(int iters) {
StopBenchmarkTiming();
- pthread_mutex_t mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER;
+ pthread_mutex_t mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
StartBenchmarkTiming();
for (int i = 0; i < iters; ++i) {
@@ -94,7 +94,7 @@
static void BM_pthread_mutex_lock_RECURSIVE(int iters) {
StopBenchmarkTiming();
- pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+ pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
StartBenchmarkTiming();
for (int i = 0; i < iters; ++i) {
@@ -105,3 +105,35 @@
StopBenchmarkTiming();
}
BENCHMARK(BM_pthread_mutex_lock_RECURSIVE);
+
+static void BM_pthread_rw_lock_read(int iters) {
+ StopBenchmarkTiming();
+ pthread_rwlock_t lock;
+ pthread_rwlock_init(&lock, NULL);
+ StartBenchmarkTiming();
+
+ for (int i = 0; i < iters; ++i) {
+ pthread_rwlock_rdlock(&lock);
+ pthread_rwlock_unlock(&lock);
+ }
+
+ StopBenchmarkTiming();
+ pthread_rwlock_destroy(&lock);
+}
+BENCHMARK(BM_pthread_rw_lock_read);
+
+static void BM_pthread_rw_lock_write(int iters) {
+ StopBenchmarkTiming();
+ pthread_rwlock_t lock;
+ pthread_rwlock_init(&lock, NULL);
+ StartBenchmarkTiming();
+
+ for (int i = 0; i < iters; ++i) {
+ pthread_rwlock_wrlock(&lock);
+ pthread_rwlock_unlock(&lock);
+ }
+
+ StopBenchmarkTiming();
+ pthread_rwlock_destroy(&lock);
+}
+BENCHMARK(BM_pthread_rw_lock_write);
diff --git a/benchmarks/stdio_benchmark.cpp b/benchmarks/stdio_benchmark.cpp
index e899df7..386ea04 100644
--- a/benchmarks/stdio_benchmark.cpp
+++ b/benchmarks/stdio_benchmark.cpp
@@ -25,14 +25,19 @@
Arg(1)->Arg(2)->Arg(3)->Arg(4)->Arg(8)->Arg(16)->Arg(32)->Arg(64)->Arg(512)-> \
Arg(1*KB)->Arg(4*KB)->Arg(8*KB)->Arg(16*KB)->Arg(64*KB)
-static void BM_stdio_fread(int iters, int chunk_size) {
+template <typename Fn>
+static void ReadWriteTest(int iters, int chunk_size, Fn f, bool buffered) {
StopBenchmarkTiming();
FILE* fp = fopen("/dev/zero", "rw");
char* buf = new char[chunk_size];
StartBenchmarkTiming();
+ if (!buffered) {
+ setvbuf(fp, 0, _IONBF, 0);
+ }
+
for (int i = 0; i < iters; ++i) {
- fread(buf, chunk_size, 1, fp);
+ f(buf, chunk_size, 1, fp);
}
StopBenchmarkTiming();
@@ -40,22 +45,23 @@
delete[] buf;
fclose(fp);
}
+
+static void BM_stdio_fread(int iters, int chunk_size) {
+ ReadWriteTest(iters, chunk_size, fread, true);
+}
BENCHMARK(BM_stdio_fread)->AT_COMMON_SIZES;
-
static void BM_stdio_fwrite(int iters, int chunk_size) {
- StopBenchmarkTiming();
- FILE* fp = fopen("/dev/zero", "rw");
- char* buf = new char[chunk_size];
- StartBenchmarkTiming();
-
- for (int i = 0; i < iters; ++i) {
- fwrite(buf, chunk_size, 1, fp);
- }
-
- StopBenchmarkTiming();
- SetBenchmarkBytesProcessed(int64_t(iters) * int64_t(chunk_size));
- delete[] buf;
- fclose(fp);
+ ReadWriteTest(iters, chunk_size, fwrite, true);
}
BENCHMARK(BM_stdio_fwrite)->AT_COMMON_SIZES;
+
+static void BM_stdio_fread_unbuffered(int iters, int chunk_size) {
+ ReadWriteTest(iters, chunk_size, fread, false);
+}
+BENCHMARK(BM_stdio_fread_unbuffered)->AT_COMMON_SIZES;
+
+static void BM_stdio_fwrite_unbuffered(int iters, int chunk_size) {
+ ReadWriteTest(iters, chunk_size, fwrite, false);
+}
+BENCHMARK(BM_stdio_fwrite_unbuffered)->AT_COMMON_SIZES;
diff --git a/benchmarks/time_benchmark.cpp b/benchmarks/time_benchmark.cpp
index 22f6e8e..f093ec1 100644
--- a/benchmarks/time_benchmark.cpp
+++ b/benchmarks/time_benchmark.cpp
@@ -16,7 +16,9 @@
#include "benchmark.h"
+#include <unistd.h>
#include <sys/syscall.h>
+#include <sys/time.h>
#include <time.h>
static void BM_time_clock_gettime(int iters) {
diff --git a/benchmarks/unistd_benchmark.cpp b/benchmarks/unistd_benchmark.cpp
index 7e2ac30..94be1dd 100644
--- a/benchmarks/unistd_benchmark.cpp
+++ b/benchmarks/unistd_benchmark.cpp
@@ -41,6 +41,8 @@
}
BENCHMARK(BM_unistd_getpid_syscall);
+#if defined(__BIONIC__)
+
// Stop GCC optimizing out our pure function.
/* Must not be static! */ pid_t (*gettid_fp)() = gettid;
@@ -55,6 +57,8 @@
}
BENCHMARK(BM_unistd_gettid);
+#endif
+
static void BM_unistd_gettid_syscall(int iters) {
StartBenchmarkTiming();
diff --git a/libc/Android.mk b/libc/Android.mk
index 045556e..13fc297 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -1,5 +1,7 @@
LOCAL_PATH := $(call my-dir)
+bionic_coverage := false
+
# Make everything depend on any changes to included makefiles.
libc_common_additional_dependencies := $(LOCAL_PATH)/Android.mk
@@ -38,12 +40,9 @@
# =========================================================
libc_common_src_files := \
bionic/bindresvport.c \
- bionic/daemon.c \
- bionic/err.c \
bionic/ether_aton.c \
bionic/ether_ntoa.c \
bionic/fts.c \
- bionic/gethostname.c \
bionic/getpriority.c \
bionic/if_indextoname.c \
bionic/if_nametoindex.c \
@@ -51,11 +50,9 @@
bionic/ioctl.c \
bionic/isatty.c \
bionic/memmem.c \
- bionic/pathconf.c \
bionic/pututline.c \
bionic/sched_cpualloc.c \
bionic/sched_cpucount.c \
- bionic/semaphore.c \
bionic/sigblock.c \
bionic/siginterrupt.c \
bionic/sigsetmask.c \
@@ -63,6 +60,7 @@
stdio/findfp.c \
stdio/snprintf.c\
stdio/sprintf.c \
+ stdio/stdio_ext.cpp \
# Fortify implementations of libc functions.
libc_common_src_files += \
@@ -91,6 +89,7 @@
bionic/access.cpp \
bionic/assert.cpp \
bionic/atof.cpp \
+ bionic/bionic_systrace.cpp \
bionic/bionic_time_conversions.cpp \
bionic/brk.cpp \
bionic/c16rtomb.cpp \
@@ -99,6 +98,8 @@
bionic/chown.cpp \
bionic/clearenv.cpp \
bionic/clock.cpp \
+ bionic/clock_getcpuclockid.cpp \
+ bionic/clock_nanosleep.cpp \
bionic/clone.cpp \
bionic/__cmsg_nxthdr.cpp \
bionic/connect.cpp \
@@ -119,9 +120,11 @@
bionic/getauxval.cpp \
bionic/getcwd.cpp \
bionic/getentropy_linux.c \
+ bionic/gethostname.cpp \
bionic/getpgrp.cpp \
bionic/getpid.cpp \
bionic/gettid.cpp \
+ bionic/__gnu_basename.cpp \
bionic/inotify_init.cpp \
bionic/lchown.cpp \
bionic/lfs64_support.cpp \
@@ -133,6 +136,7 @@
bionic/link.cpp \
bionic/locale.cpp \
bionic/lstat.cpp \
+ bionic/malloc_info.cpp \
bionic/mbrtoc16.cpp \
bionic/mbrtoc32.cpp \
bionic/mbstate.cpp \
@@ -142,6 +146,7 @@
bionic/mntent.cpp \
bionic/NetdClientDispatch.cpp \
bionic/open.cpp \
+ bionic/pathconf.cpp \
bionic/pause.cpp \
bionic/pipe.cpp \
bionic/poll.cpp \
@@ -181,6 +186,7 @@
bionic/scandir.cpp \
bionic/sched_getaffinity.cpp \
bionic/sched_getcpu.cpp \
+ bionic/semaphore.cpp \
bionic/send.cpp \
bionic/setegid.cpp \
bionic/__set_errno.cpp \
@@ -201,19 +207,14 @@
bionic/socket.cpp \
bionic/stat.cpp \
bionic/statvfs.cpp \
- bionic/strcoll_l.cpp \
bionic/strerror.cpp \
bionic/strerror_r.cpp \
- bionic/strftime_l.cpp \
bionic/strsignal.cpp \
bionic/strtold.cpp \
- bionic/strtold_l.cpp \
- bionic/strtoll_l.cpp \
- bionic/strtoull_l.cpp \
- bionic/strxfrm_l.cpp \
bionic/stubs.cpp \
bionic/symlink.cpp \
bionic/sysconf.cpp \
+ bionic/sysinfo.cpp \
bionic/syslog.cpp \
bionic/sys_siglist.c \
bionic/sys_signame.c \
@@ -239,9 +240,6 @@
upstream-freebsd/lib/libc/gen/ldexp.c \
upstream-freebsd/lib/libc/gen/sleep.c \
upstream-freebsd/lib/libc/gen/usleep.c \
- upstream-freebsd/lib/libc/stdio/fclose.c \
- upstream-freebsd/lib/libc/stdio/flags.c \
- upstream-freebsd/lib/libc/stdio/fopen.c \
upstream-freebsd/lib/libc/stdlib/abs.c \
upstream-freebsd/lib/libc/stdlib/getopt_long.c \
upstream-freebsd/lib/libc/stdlib/imaxabs.c \
@@ -287,8 +285,8 @@
upstream-netbsd/lib/libc/stdlib/div.c \
upstream-netbsd/lib/libc/stdlib/drand48.c \
upstream-netbsd/lib/libc/stdlib/erand48.c \
- upstream-netbsd/lib/libc/stdlib/insque.c \
upstream-netbsd/lib/libc/stdlib/jrand48.c \
+ upstream-netbsd/lib/libc/stdlib/lcong48.c \
upstream-netbsd/lib/libc/stdlib/ldiv.c \
upstream-netbsd/lib/libc/stdlib/lldiv.c \
upstream-netbsd/lib/libc/stdlib/lrand48.c \
@@ -296,14 +294,12 @@
upstream-netbsd/lib/libc/stdlib/nrand48.c \
upstream-netbsd/lib/libc/stdlib/_rand48.c \
upstream-netbsd/lib/libc/stdlib/rand_r.c \
- upstream-netbsd/lib/libc/stdlib/remque.c \
upstream-netbsd/lib/libc/stdlib/seed48.c \
upstream-netbsd/lib/libc/stdlib/srand48.c \
upstream-netbsd/lib/libc/string/memccpy.c \
upstream-netbsd/lib/libc/string/strcasestr.c \
upstream-netbsd/lib/libc/string/strcoll.c \
upstream-netbsd/lib/libc/string/strxfrm.c \
- upstream-netbsd/lib/libc/unistd/killpg.c \
libc_upstream_openbsd_gdtoa_src_files := \
upstream-openbsd/android/gdtoa_support.cpp \
@@ -333,10 +329,14 @@
upstream-openbsd/lib/libc/gdtoa/strtorQ.c \
libc_upstream_openbsd_src_files := \
+ upstream-openbsd/lib/libc/compat-43/killpg.c \
upstream-openbsd/lib/libc/crypt/arc4random.c \
upstream-openbsd/lib/libc/crypt/arc4random_uniform.c \
upstream-openbsd/lib/libc/gen/alarm.c \
upstream-openbsd/lib/libc/gen/ctype_.c \
+ upstream-openbsd/lib/libc/gen/daemon.c \
+ upstream-openbsd/lib/libc/gen/err.c \
+ upstream-openbsd/lib/libc/gen/errx.c \
upstream-openbsd/lib/libc/gen/exec.c \
upstream-openbsd/lib/libc/gen/fnmatch.c \
upstream-openbsd/lib/libc/gen/ftok.c \
@@ -346,6 +346,12 @@
upstream-openbsd/lib/libc/gen/time.c \
upstream-openbsd/lib/libc/gen/tolower_.c \
upstream-openbsd/lib/libc/gen/toupper_.c \
+ upstream-openbsd/lib/libc/gen/verr.c \
+ upstream-openbsd/lib/libc/gen/verrx.c \
+ upstream-openbsd/lib/libc/gen/vwarn.c \
+ upstream-openbsd/lib/libc/gen/vwarnx.c \
+ upstream-openbsd/lib/libc/gen/warn.c \
+ upstream-openbsd/lib/libc/gen/warnx.c \
upstream-openbsd/lib/libc/locale/btowc.c \
upstream-openbsd/lib/libc/locale/mbrlen.c \
upstream-openbsd/lib/libc/locale/mbstowcs.c \
@@ -379,6 +385,7 @@
upstream-openbsd/lib/libc/stdio/asprintf.c \
upstream-openbsd/lib/libc/stdio/clrerr.c \
upstream-openbsd/lib/libc/stdio/dprintf.c \
+ upstream-openbsd/lib/libc/stdio/fclose.c \
upstream-openbsd/lib/libc/stdio/fdopen.c \
upstream-openbsd/lib/libc/stdio/feof.c \
upstream-openbsd/lib/libc/stdio/ferror.c \
@@ -390,6 +397,9 @@
upstream-openbsd/lib/libc/stdio/fgetwc.c \
upstream-openbsd/lib/libc/stdio/fgetws.c \
upstream-openbsd/lib/libc/stdio/fileno.c \
+ upstream-openbsd/lib/libc/stdio/flags.c \
+ upstream-openbsd/lib/libc/stdio/fmemopen.c \
+ upstream-openbsd/lib/libc/stdio/fopen.c \
upstream-openbsd/lib/libc/stdio/fprintf.c \
upstream-openbsd/lib/libc/stdio/fpurge.c \
upstream-openbsd/lib/libc/stdio/fputc.c \
@@ -418,6 +428,8 @@
upstream-openbsd/lib/libc/stdio/getwchar.c \
upstream-openbsd/lib/libc/stdio/makebuf.c \
upstream-openbsd/lib/libc/stdio/mktemp.c \
+ upstream-openbsd/lib/libc/stdio/open_memstream.c \
+ upstream-openbsd/lib/libc/stdio/open_wmemstream.c \
upstream-openbsd/lib/libc/stdio/perror.c \
upstream-openbsd/lib/libc/stdio/printf.c \
upstream-openbsd/lib/libc/stdio/putc.c \
@@ -466,7 +478,10 @@
upstream-openbsd/lib/libc/stdlib/atoll.c \
upstream-openbsd/lib/libc/stdlib/exit.c \
upstream-openbsd/lib/libc/stdlib/getenv.c \
+ upstream-openbsd/lib/libc/stdlib/insque.c \
upstream-openbsd/lib/libc/stdlib/lsearch.c \
+ upstream-openbsd/lib/libc/stdlib/reallocarray.c \
+ upstream-openbsd/lib/libc/stdlib/remque.c \
upstream-openbsd/lib/libc/stdlib/setenv.c \
upstream-openbsd/lib/libc/stdlib/strtoimax.c \
upstream-openbsd/lib/libc/stdlib/strtol.c \
@@ -535,13 +550,6 @@
libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT)
endif
-# Define ANDROID_SMP appropriately.
-ifeq ($(TARGET_CPU_SMP),true)
- libc_common_cflags += -DANDROID_SMP=1
-else
- libc_common_cflags += -DANDROID_SMP=0
-endif
-
# Define some common conlyflags
libc_common_conlyflags := \
-std=gnu99
@@ -586,7 +594,10 @@
LOCAL_MODULE := libc_stack_protector
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
include $(BUILD_STATIC_LIBRARY)
@@ -624,7 +635,10 @@
LOCAL_MODULE := libc_tzcode
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
include $(BUILD_STATIC_LIBRARY)
@@ -642,7 +656,13 @@
upstream-netbsd/lib/libc/isc/ev_timers.c \
upstream-netbsd/lib/libc/resolv/mtctxres.c \
-LOCAL_CFLAGS := \
+# We use the OpenBSD res_random.
+LOCAL_CFLAGS += \
+ -Dres_randomid=__res_randomid
+LOCAL_SRC_FILES += \
+ upstream-openbsd/lib/libc/net/res_random.c \
+
+LOCAL_CFLAGS += \
$(libc_common_cflags) \
-DANDROID_CHANGES \
-DINET6 \
@@ -660,7 +680,10 @@
LOCAL_MODULE := libc_dns
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
include $(BUILD_STATIC_LIBRARY)
@@ -689,7 +712,10 @@
LOCAL_MODULE := libc_freebsd
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_freebsd_src_files))
@@ -720,7 +746,10 @@
LOCAL_MODULE := libc_netbsd
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_netbsd_src_files))
@@ -746,7 +775,9 @@
LOCAL_CFLAGS := \
$(libc_common_cflags) \
- -Wno-sign-compare -Wno-uninitialized -Wno-unused-parameter \
+ -Wno-sign-compare \
+ -Wno-uninitialized \
+ -Wno-unused-parameter \
-I$(LOCAL_PATH)/private \
-I$(LOCAL_PATH)/upstream-openbsd/android/include \
-I$(LOCAL_PATH)/upstream-openbsd/lib/libc/include \
@@ -758,7 +789,10 @@
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_openbsd
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_openbsd_src_files))
@@ -797,7 +831,10 @@
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_gdtoa
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
include $(BUILD_STATIC_LIBRARY)
@@ -813,18 +850,23 @@
LOCAL_CFLAGS := $(libc_common_cflags) \
-Wframe-larger-than=2048 \
-ifeq ($(TARGET_ARCH),x86_64)
- # Clang assembler has problem with ssse3-strcmp-slm.S, http://b/17302991
- LOCAL_CLANG_ASFLAGS += -no-integrated-as
-endif
+# ssse3-strcmp-slm.S does not compile with Clang.
+LOCAL_CLANG_ASFLAGS_x86_64 += -no-integrated-as
+
+# memcpy.S, memchr.S, etc. do not compile with Clang.
+LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
+LOCAL_CLANG_ASFLAGS_arm64 += -no-integrated-as
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)
-LOCAL_C_INCLUDES := $(libc_common_c_includes)
+LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
LOCAL_MODULE := libc_bionic
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_src_files))
@@ -843,12 +885,14 @@
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)
-LOCAL_C_INCLUDES := $(libc_common_c_includes)
+LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
LOCAL_MODULE := libc_cxa
-# GCC refuses to hide new/delete
-LOCAL_CLANG := true
+LOCAL_CLANG := true # GCC refuses to hide new/delete
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY)
@@ -866,7 +910,10 @@
LOCAL_MODULE := libc_syscalls
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY)
@@ -885,7 +932,10 @@
LOCAL_CLANG := $(use_clang)
LOCAL_CFLAGS := $(libc_common_cflags) -fno-builtin
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY)
@@ -922,10 +972,13 @@
LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
endif
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
# TODO: split out the asflags.
LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_common_src_files))
@@ -961,7 +1014,10 @@
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_static_src_files))
@@ -982,6 +1038,9 @@
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_malloc
LOCAL_CLANG := $(use_clang)
+LOCAL_CXX_STL := none
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
include $(BUILD_STATIC_LIBRARY)
@@ -1007,7 +1066,10 @@
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_static_src_files))
@@ -1049,6 +1111,7 @@
LOCAL_SHARED_LIBRARIES := libdl
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
# We'd really like to do this for all architectures, but since this wasn't done
@@ -1068,6 +1131,8 @@
arch-common/bionic/crtbegin_so.c \
arch-arm/bionic/atexit_legacy.c \
arch-common/bionic/crtend_so.S
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_SHARED_LIBRARY)
@@ -1085,10 +1150,7 @@
# ========================================================
include $(CLEAR_VARS)
-LOCAL_CFLAGS := \
- $(libc_common_cflags) \
- -DMALLOC_LEAK_CHECK \
-
+LOCAL_CFLAGS := $(libc_common_cflags)
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)
@@ -1108,14 +1170,17 @@
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_SHARED_LIBRARIES := libc libdl
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
# Only need this for arm since libc++ uses its own unwind code that
# doesn't mix with the other default unwind code.
-LOCAL_STATIC_LIBRARIES_arm := libc++
+LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
# Don't install on release build
LOCAL_MODULE_TAGS := eng debug
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
include $(BUILD_SHARED_LIBRARY)
@@ -1144,10 +1209,13 @@
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_SHARED_LIBRARIES := libc libdl
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
# Don't install on release build
LOCAL_MODULE_TAGS := eng debug
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
include $(BUILD_SHARED_LIBRARY)
@@ -1164,26 +1232,32 @@
bionic/libc_logging.cpp \
include $(CLEAR_VARS)
-LOCAL_C_INCLUDES := $(libc_common_c_includes)
+LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
LOCAL_CFLAGS := $(libc_common_cflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)
LOCAL_SRC_FILES := $(libstdcxx_common_src_files)
LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_SHARED_LIBRARY)
# ========================================================
# libstdc++.a
# ========================================================
include $(CLEAR_VARS)
-LOCAL_C_INCLUDES := $(libc_common_c_includes)
+LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
LOCAL_CFLAGS := $(libc_common_cflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)
LOCAL_SRC_FILES := $(libstdcxx_common_src_files)
LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
+LOCAL_ADDRESS_SANITIZER := false
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY)
diff --git a/libc/NOTICE b/libc/NOTICE
index 80d9a27..697b8fc 100644
--- a/libc/NOTICE
+++ b/libc/NOTICE
@@ -2511,35 +2511,6 @@
-------------------------------------------------------------------
Copyright (c) 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.
-
--------------------------------------------------------------------
-
-Copyright (c) 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -3131,38 +3102,6 @@
-------------------------------------------------------------------
-Copyright (c) 1999 Kungliga Tekniska Högskolan
-(Royal Institute of Technology, Stockholm, Sweden).
-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 KTH 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 KTH AND ITS 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 KTH OR ITS 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
-
--------------------------------------------------------------------
-
Copyright (c) 2000 Ben Harris.
Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
All rights reserved.
@@ -4422,6 +4361,39 @@
-------------------------------------------------------------------
+Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+-------------------------------------------------------------------
+
+Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
+Copyright (c) 2009 Ted Unangst
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+-------------------------------------------------------------------
+
Copyright (c) 2011 The Android Open Source Project
Copyright (c) 2008 ARM Ltd
All rights reserved.
@@ -4853,6 +4825,42 @@
-------------------------------------------------------------------
+Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
+Copyright 2008 Damien Miller <djm@openbsd.org>
+All rights reserved.
+
+Theo de Raadt <deraadt@openbsd.org> came up with the idea of using
+such a mathematical system to generate more random (yet non-repeating)
+ids to solve the resolver/named problem. But Niels designed the
+actual system based on the constraints.
+
+Later modified by Damien Miller to wrap the LCG output in a 15-bit
+permutation generator based on a Luby-Rackoff block cipher. This
+ensures the output is non-repeating and preserves the MSB twiddle
+trick, but makes it more resistant to LCG prediction.
+
+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.
+
+-------------------------------------------------------------------
+
Copyright 2000 David E. O'Brien, John D. Polstra.
All rights reserved.
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index c3b7bab..39ff37d 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -202,9 +202,9 @@
int settimeofday(const struct timeval*, const struct timezone*) all
clock_t times(struct tms*) all
int nanosleep(const struct timespec*, struct timespec*) all
-int clock_settime(clockid_t clk_id, const struct timespec* tp) all
-int clock_getres(clockid_t clk_id, struct timespec* res) all
-int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec* req, struct timespec* rem) all
+int clock_settime(clockid_t, const struct timespec*) all
+int clock_getres(clockid_t, struct timespec*) all
+int __clock_nanosleep:clock_nanosleep(clockid_t, int, const struct timespec*, struct timespec*) all
int getitimer(int, const struct itimerval*) all
int setitimer(int, const struct itimerval*, struct itimerval*) all
int __timer_create:timer_create(clockid_t clockid, struct sigevent* evp, __kernel_timer_t* timerid) all
@@ -313,6 +313,8 @@
int setfsgid(gid_t) all
int setfsuid(uid_t) all
+int sethostname(const char*, size_t) all
+
pid_t wait4(pid_t, int*, int, struct rusage*) all
int __waitid:waitid(int, pid_t, struct siginfo_t*, int, void*) all
@@ -321,7 +323,7 @@
int cacheflush:__ARM_NR_cacheflush(long start, long end, long flags) arm
# MIPS-specific
-int _flush_cache:cacheflush(char* addr, const int nbytes, const int op) mips,mips64
+int _flush_cache:cacheflush(char* addr, const int nbytes, const int op) mips
int __set_tls:set_thread_area(void*) mips,mips64
# x86-specific
diff --git a/libc/arch-arm/bionic/__aeabi.c b/libc/arch-arm/bionic/__aeabi.c
index 3254f64..254c7a6 100644
--- a/libc/arch-arm/bionic/__aeabi.c
+++ b/libc/arch-arm/bionic/__aeabi.c
@@ -39,6 +39,9 @@
extern int __cxa_atexit(void (*)(void*), void*, void*);
+// All of these are weak symbols to avoid multiple definition errors when
+// linking with libstdc++-v3 or compiler-rt.
+
/* The "C++ ABI for ARM" document states that static C++ constructors,
* which are called from the .init_array, should manually call
* __aeabi_atexit() to register static destructors explicitly.
@@ -47,35 +50,35 @@
* variable from the shared object that contains the constructor/destructor
*/
-// Make this a weak symbol to avoid a multiple definition error when linking with libstdc++-v3.
int __attribute__((weak))
__aeabi_atexit(void *object, void (*destructor) (void *), void *dso_handle) {
return __cxa_atexit(destructor, object, dso_handle);
}
-void __aeabi_memcpy8(void *dest, const void *src, size_t n) {
+void __attribute__((weak))
+__aeabi_memcpy8(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
-void __aeabi_memcpy4(void *dest, const void *src, size_t n) {
+void __attribute__((weak)) __aeabi_memcpy4(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
-void __aeabi_memcpy(void *dest, const void *src, size_t n) {
+void __attribute__((weak)) __aeabi_memcpy(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
-void __aeabi_memmove8(void *dest, const void *src, size_t n) {
+void __attribute__((weak)) __aeabi_memmove8(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
-void __aeabi_memmove4(void *dest, const void *src, size_t n) {
+void __attribute__((weak)) __aeabi_memmove4(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
-void __aeabi_memmove(void *dest, const void *src, size_t n) {
+void __attribute__((weak)) __aeabi_memmove(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
@@ -84,27 +87,27 @@
* This allows __aeabi_memclr to tail-call __aeabi_memset
*/
-void __aeabi_memset8(void *dest, size_t n, int c) {
+void __attribute__((weak)) __aeabi_memset8(void *dest, size_t n, int c) {
memset(dest, c, n);
}
-void __aeabi_memset4(void *dest, size_t n, int c) {
+void __attribute__((weak)) __aeabi_memset4(void *dest, size_t n, int c) {
memset(dest, c, n);
}
-void __aeabi_memset(void *dest, size_t n, int c) {
+void __attribute__((weak)) __aeabi_memset(void *dest, size_t n, int c) {
memset(dest, c, n);
}
-void __aeabi_memclr8(void *dest, size_t n) {
+void __attribute__((weak)) __aeabi_memclr8(void *dest, size_t n) {
__aeabi_memset8(dest, n, 0);
}
-void __aeabi_memclr4(void *dest, size_t n) {
+void __attribute__((weak)) __aeabi_memclr4(void *dest, size_t n) {
__aeabi_memset4(dest, n, 0);
}
-void __aeabi_memclr(void *dest, size_t n) {
+void __attribute__((weak)) __aeabi_memclr(void *dest, size_t n) {
__aeabi_memset(dest, n, 0);
}
diff --git a/libc/arch-arm/bionic/_setjmp.S b/libc/arch-arm/bionic/_setjmp.S
index 64a0a31..7d637fd 100644
--- a/libc/arch-arm/bionic/_setjmp.S
+++ b/libc/arch-arm/bionic/_setjmp.S
@@ -107,7 +107,7 @@
/* validation failed, die die die. */
botch:
- bl PIC_SYM(longjmperror, PLT)
- bl PIC_SYM(abort, PLT)
+ bl longjmperror
+ bl abort
b . - 8 /* Cannot get here */
END(_longjmp)
diff --git a/libc/arch-arm/bionic/abort_arm.S b/libc/arch-arm/bionic/abort_arm.S
index 6b181ef..1039502 100644
--- a/libc/arch-arm/bionic/abort_arm.S
+++ b/libc/arch-arm/bionic/abort_arm.S
@@ -40,5 +40,5 @@
.cfi_def_cfa_offset 8
.cfi_rel_offset r3, 0
.cfi_rel_offset r14, 4
- bl PIC_SYM(__libc_android_abort, PLT)
+ bl __libc_android_abort
END(abort)
diff --git a/libc/arch-arm/bionic/setjmp.S b/libc/arch-arm/bionic/setjmp.S
index ed59d07..0c9082c 100644
--- a/libc/arch-arm/bionic/setjmp.S
+++ b/libc/arch-arm/bionic/setjmp.S
@@ -56,7 +56,7 @@
.cfi_rel_offset r14, 4
mov r0, #0x00000000
- bl PIC_SYM(sigblock, PLT)
+ bl sigblock
mov r1, r0
ldmfd sp!, {r0, r14}
@@ -108,7 +108,7 @@
.cfi_adjust_cfa_offset 4
mov r0, r2
- bl PIC_SYM(sigsetmask, PLT)
+ bl sigsetmask
add sp, sp, #4 /* unalign the stack */
.cfi_adjust_cfa_offset -4
@@ -147,7 +147,7 @@
/* validation failed, die die die. */
botch:
- bl PIC_SYM(longjmperror, PLT)
- bl PIC_SYM(abort, PLT)
+ bl longjmperror
+ bl abort
b . - 8 /* Cannot get here */
END(longjmp)
diff --git a/libc/arch-arm/bionic/sigsetjmp.S b/libc/arch-arm/bionic/sigsetjmp.S
index 7016f50..6a25a12 100644
--- a/libc/arch-arm/bionic/sigsetjmp.S
+++ b/libc/arch-arm/bionic/sigsetjmp.S
@@ -33,8 +33,6 @@
* SUCH DAMAGE.
*/
-#define _ALIGN_TEXT .align 0
-
#include <private/bionic_asm.h>
#include <machine/setjmp.h>
@@ -50,8 +48,8 @@
ENTRY(sigsetjmp)
teq r1, #0
- beq PIC_SYM(_setjmp, PLT)
- b PIC_SYM(setjmp, PLT)
+ beq _setjmp
+ b setjmp
END(sigsetjmp)
.L_setjmp_magic:
@@ -61,6 +59,6 @@
ldr r2, .L_setjmp_magic
ldr r3, [r0]
teq r2, r3
- beq PIC_SYM(_longjmp, PLT)
- b PIC_SYM(longjmp, PLT)
+ beq _longjmp
+ b longjmp
END(siglongjmp)
diff --git a/libc/arch-arm/denver/bionic/memset.S b/libc/arch-arm/denver/bionic/memset.S
index bf3d9ad..d77c244 100644
--- a/libc/arch-arm/denver/bionic/memset.S
+++ b/libc/arch-arm/denver/bionic/memset.S
@@ -37,6 +37,7 @@
* memset() returns its first argument.
*/
+ .cpu cortex-a15
.fpu neon
.syntax unified
diff --git a/libc/arch-arm/include/machine/asm.h b/libc/arch-arm/include/machine/asm.h
index 7954f05..70dbe67 100644
--- a/libc/arch-arm/include/machine/asm.h
+++ b/libc/arch-arm/include/machine/asm.h
@@ -38,9 +38,7 @@
#ifndef _ARM32_ASM_H_
#define _ARM32_ASM_H_
-#ifndef _ALIGN_TEXT
-# define _ALIGN_TEXT .align 0
-#endif
+#define __bionic_asm_align 0
#undef __bionic_asm_custom_entry
#undef __bionic_asm_custom_end
@@ -50,10 +48,4 @@
#undef __bionic_asm_function_type
#define __bionic_asm_function_type #function
-#if defined(__ELF__) && defined(PIC)
-#define PIC_SYM(x,y) x ## ( ## y ## )
-#else
-#define PIC_SYM(x,y) x
-#endif
-
#endif /* !_ARM_ASM_H_ */
diff --git a/libc/arch-arm/include/machine/endian.h b/libc/arch-arm/include/machine/endian.h
index 8d9723d..04bba20 100644
--- a/libc/arch-arm/include/machine/endian.h
+++ b/libc/arch-arm/include/machine/endian.h
@@ -67,11 +67,7 @@
#endif /* __GNUC__ */
-#if defined(__ARMEB__)
-#define _BYTE_ORDER _BIG_ENDIAN
-#else
#define _BYTE_ORDER _LITTLE_ENDIAN
-#endif
#define __STRICT_ALIGNMENT
#include <sys/types.h>
#include <sys/endian.h>
diff --git a/libc/arch-arm/syscalls/clock_nanosleep.S b/libc/arch-arm/syscalls/__clock_nanosleep.S
similarity index 85%
rename from libc/arch-arm/syscalls/clock_nanosleep.S
rename to libc/arch-arm/syscalls/__clock_nanosleep.S
index 80295bb..ba7ffc4 100644
--- a/libc/arch-arm/syscalls/clock_nanosleep.S
+++ b/libc/arch-arm/syscalls/__clock_nanosleep.S
@@ -2,7 +2,7 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
+ENTRY(__clock_nanosleep)
mov ip, r7
ldr r7, =__NR_clock_nanosleep
swi #0
@@ -11,4 +11,4 @@
bxls lr
neg r0, r0
b __set_errno_internal
-END(clock_nanosleep)
+END(__clock_nanosleep)
diff --git a/libc/arch-arm/syscalls/clock_nanosleep.S b/libc/arch-arm/syscalls/sethostname.S
similarity index 73%
copy from libc/arch-arm/syscalls/clock_nanosleep.S
copy to libc/arch-arm/syscalls/sethostname.S
index 80295bb..0a98fd3 100644
--- a/libc/arch-arm/syscalls/clock_nanosleep.S
+++ b/libc/arch-arm/syscalls/sethostname.S
@@ -2,13 +2,13 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
+ENTRY(sethostname)
mov ip, r7
- ldr r7, =__NR_clock_nanosleep
+ ldr r7, =__NR_sethostname
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno_internal
-END(clock_nanosleep)
+END(sethostname)
diff --git a/libc/arch-arm64/bionic/_setjmp.S b/libc/arch-arm64/bionic/_setjmp.S
index 3836899..e11ef68 100644
--- a/libc/arch-arm64/bionic/_setjmp.S
+++ b/libc/arch-arm64/bionic/_setjmp.S
@@ -105,7 +105,7 @@
/* validation failed, die die die */
.L_fail:
- bl PIC_SYM(longjmperror, PLT)
- bl PIC_SYM(abort, PLT)
+ bl longjmperror
+ bl abort
b . - 8 /* Cannot get here */
END(_longjmp)
diff --git a/libc/arch-arm64/bionic/setjmp.S b/libc/arch-arm64/bionic/setjmp.S
index f9d2266..35815a6 100644
--- a/libc/arch-arm64/bionic/setjmp.S
+++ b/libc/arch-arm64/bionic/setjmp.S
@@ -45,7 +45,7 @@
stp x0, x30, [sp, #-16]!
mov x0, xzr
- bl PIC_SYM(sigblock, PLT)
+ bl sigblock
mov w1, w0
ldp x0, x30, [sp], #16
@@ -117,7 +117,7 @@
/* validation failed, die die die */
.L_fail:
- bl PIC_SYM(longjmperror, PLT)
- bl PIC_SYM(abort, PLT)
+ bl longjmperror
+ bl abort
b . - 8 /* Cannot get here */
END(longjmp)
diff --git a/libc/arch-arm64/bionic/sigsetjmp.S b/libc/arch-arm64/bionic/sigsetjmp.S
index 4fdb367..be7cecb 100644
--- a/libc/arch-arm64/bionic/sigsetjmp.S
+++ b/libc/arch-arm64/bionic/sigsetjmp.S
@@ -35,8 +35,8 @@
*/
ENTRY(sigsetjmp)
- cbz w1, PIC_SYM(_setjmp, PLT)
- b PIC_SYM(setjmp, PLT)
+ cbz w1, _setjmp
+ b setjmp
END(sigsetjmp)
.L_setjmp_magic:
@@ -46,6 +46,6 @@
ldr w2, .L_setjmp_magic
ldr w3, [x0]
cmp w2, w3
- b.eq PIC_SYM(_longjmp, PLT)
- b PIC_SYM(longjmp, PLT)
+ b.eq _longjmp
+ b longjmp
END(siglongjmp)
diff --git a/libc/arch-arm64/include/machine/asm.h b/libc/arch-arm64/include/machine/asm.h
index 4bfabaf..2bea043 100644
--- a/libc/arch-arm64/include/machine/asm.h
+++ b/libc/arch-arm64/include/machine/asm.h
@@ -38,17 +38,9 @@
#ifndef _AARCH64_ASM_H_
#define _AARCH64_ASM_H_
-#ifndef _ALIGN_TEXT
-# define _ALIGN_TEXT .align 0
-#endif
+#define __bionic_asm_align 0
#undef __bionic_asm_function_type
#define __bionic_asm_function_type %function
-#if defined(__ELF__) && defined(PIC)
-#define PIC_SYM(x,y) x ## ( ## y ## )
-#else
-#define PIC_SYM(x,y) x
-#endif
-
#endif /* _AARCH64_ASM_H_ */
diff --git a/libc/arch-arm64/include/machine/endian.h b/libc/arch-arm64/include/machine/endian.h
index 87a038d..4743733 100644
--- a/libc/arch-arm64/include/machine/endian.h
+++ b/libc/arch-arm64/include/machine/endian.h
@@ -29,9 +29,6 @@
#ifndef _AARCH64_ENDIAN_H_
#define _AARCH64_ENDIAN_H_
-#include <sys/types.h>
-#include <sys/endian.h>
-
#ifdef __GNUC__
#define __swap16md(x) ({ \
@@ -49,10 +46,8 @@
#endif /* __GNUC__ */
-#if defined(__AARCH64EB__)
-#define _BYTE_ORDER _BIG_ENDIAN
-#else
#define _BYTE_ORDER _LITTLE_ENDIAN
-#endif
+#include <sys/types.h>
+#include <sys/endian.h>
#endif /* _AARCH64_ENDIAN_H_ */
diff --git a/libc/arch-arm64/syscalls/clock_nanosleep.S b/libc/arch-arm64/syscalls/__clock_nanosleep.S
similarity index 76%
rename from libc/arch-arm64/syscalls/clock_nanosleep.S
rename to libc/arch-arm64/syscalls/__clock_nanosleep.S
index 349c5cc..1df15d6 100644
--- a/libc/arch-arm64/syscalls/clock_nanosleep.S
+++ b/libc/arch-arm64/syscalls/__clock_nanosleep.S
@@ -2,7 +2,7 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
+ENTRY(__clock_nanosleep)
mov x8, __NR_clock_nanosleep
svc #0
@@ -11,4 +11,5 @@
b.hi __set_errno_internal
ret
-END(clock_nanosleep)
+END(__clock_nanosleep)
+.hidden __clock_nanosleep
diff --git a/libc/arch-arm64/syscalls/clock_nanosleep.S b/libc/arch-arm64/syscalls/sethostname.S
similarity index 70%
copy from libc/arch-arm64/syscalls/clock_nanosleep.S
copy to libc/arch-arm64/syscalls/sethostname.S
index 349c5cc..2dea457 100644
--- a/libc/arch-arm64/syscalls/clock_nanosleep.S
+++ b/libc/arch-arm64/syscalls/sethostname.S
@@ -2,8 +2,8 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
- mov x8, __NR_clock_nanosleep
+ENTRY(sethostname)
+ mov x8, __NR_sethostname
svc #0
cmn x0, #(MAX_ERRNO + 1)
@@ -11,4 +11,4 @@
b.hi __set_errno_internal
ret
-END(clock_nanosleep)
+END(sethostname)
diff --git a/libc/arch-mips/bionic/_setjmp.S b/libc/arch-mips/bionic/_setjmp.S
index d237e6d..052dacb 100644
--- a/libc/arch-mips/bionic/_setjmp.S
+++ b/libc/arch-mips/bionic/_setjmp.S
@@ -30,13 +30,11 @@
*/
#include <private/bionic_asm.h>
-#include <machine/regnum.h>
#include <machine/signal.h>
/*
* _setjmp, _longjmp (not restoring signal state)
*
- * XXX FPSET should probably be taken from SR setting. hmmm...
* GPOFF and FRAMESIZE must be the same for both _setjmp and _longjmp!
*
*/
@@ -48,103 +46,127 @@
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, _setjmp)
SAVE_GP(GPOFF)
- .set noreorder
-#if defined(__mips64)
- dli v0, 0xACEDBADE # sigcontext magic number
-#else
- li v0, 0xACEDBADE # sigcontext magic number
-#endif
- REG_S v0, SC_REGS+ZERO*REGSZ(a0)
- REG_S s0, SC_REGS+S0*REGSZ(a0)
- REG_S s1, SC_REGS+S1*REGSZ(a0)
- REG_S s2, SC_REGS+S2*REGSZ(a0)
- REG_S s3, SC_REGS+S3*REGSZ(a0)
- REG_S s4, SC_REGS+S4*REGSZ(a0)
- REG_S s5, SC_REGS+S5*REGSZ(a0)
- REG_S s6, SC_REGS+S6*REGSZ(a0)
- REG_S s7, SC_REGS+S7*REGSZ(a0)
- REG_S s8, SC_REGS+S8*REGSZ(a0)
- REG_L v0, GPOFF(sp)
- REG_S v0, SC_REGS+GP*REGSZ(a0)
- PTR_ADDU v0, sp, FRAMESZ
- REG_S v0, SC_REGS+SP*REGSZ(a0)
- REG_S ra, SC_PC(a0)
+ .set reorder
-#if !defined(SOFTFLOAT)
- li v0, 1 # be nice if we could tell
- REG_S v0, SC_FPUSED(a0) # sc_fpused = 1
- cfc1 v0, $31
- s.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
- s.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
- s.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
- s.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
- s.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
- s.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
-#if _MIPS_FPSET == 32
- s.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
- s.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
- s.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
- s.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
- s.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
- s.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
+#ifndef __LP64__
+ addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
+ li t0, ~7
+ and a0, t0
#endif
- REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
-#endif /* !SOFTFLOAT */
+
+ # SC_MASK is unused here
+
+ li v0, 0xACEDBADE # sigcontext magic number
+ sw v0, SC_MAGIC(a0)
+ # callee-saved long-sized regs:
+ REG_S ra, SC_REGS+0*REGSZ(a0)
+ REG_S s0, SC_REGS+1*REGSZ(a0)
+ REG_S s1, SC_REGS+2*REGSZ(a0)
+ REG_S s2, SC_REGS+3*REGSZ(a0)
+ REG_S s3, SC_REGS+4*REGSZ(a0)
+ REG_S s4, SC_REGS+5*REGSZ(a0)
+ REG_S s5, SC_REGS+6*REGSZ(a0)
+ REG_S s6, SC_REGS+7*REGSZ(a0)
+ REG_S s7, SC_REGS+8*REGSZ(a0)
+ REG_S s8, SC_REGS+9*REGSZ(a0)
+ REG_L v0, GPOFF(sp)
+ REG_S v0, SC_REGS+10*REGSZ(a0)
+ PTR_ADDU v0, sp, FRAMESZ
+ REG_S v0, SC_REGS+11*REGSZ(a0)
+
+ cfc1 v0, $31
+
+#ifdef __LP64__
+ # callee-saved fp regs on mips n64 ABI are $f24..$f31
+ s.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
+ s.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
+ s.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
+ s.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
+ s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ s.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
+ s.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
+ s.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
+#else
+ # callee-saved fp regs on mips o32 ABI are
+ # the even-numbered fp regs $f20,$f22,...$f30
+ s.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
+ s.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
+ s.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
+ s.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
+ s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ s.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
+#endif
+ sw v0, SC_FPSR(a0)
+ move v0, zero
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
j ra
- move v0, zero
END(_setjmp)
+
LEAF(_longjmp, FRAMESZ)
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, _longjmp)
SAVE_GP(GPOFF)
- .set noreorder
- REG_L v0, SC_REGS+ZERO*REGSZ(a0)
- bne v0, 0xACEDBADE, botch # jump if error
- REG_L ra, SC_PC(a0)
- REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
- REG_L s0, SC_REGS+S0*REGSZ(a0)
- REG_L s1, SC_REGS+S1*REGSZ(a0)
- REG_L s2, SC_REGS+S2*REGSZ(a0)
- REG_L s3, SC_REGS+S3*REGSZ(a0)
- REG_L s4, SC_REGS+S4*REGSZ(a0)
- REG_L s5, SC_REGS+S5*REGSZ(a0)
- REG_L s6, SC_REGS+S6*REGSZ(a0)
- REG_L s7, SC_REGS+S7*REGSZ(a0)
- REG_L s8, SC_REGS+S8*REGSZ(a0)
- REG_L gp, SC_REGS+GP*REGSZ(a0)
- REG_L sp, SC_REGS+SP*REGSZ(a0)
-#if !defined(SOFTFLOAT)
- ctc1 v0, $31
- l.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
- l.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
- l.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
- l.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
- l.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
- l.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
-#if _MIPS_FPSET == 32
- l.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
- l.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
- l.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
- l.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
- l.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
- l.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
+ .set reorder
+
+#ifndef __LP64__
+ addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
+ li t0, ~7
+ and a0, t0
#endif
-#endif /* !SOFTFLOAT */
+
+ # SC_MASK is unused here
+
+ lw v0, SC_MAGIC(a0)
+ li t0, 0xACEDBADE
+ bne v0, t0, botch # jump if error
+
+ # callee-saved long-sized regs:
+ REG_L ra, SC_REGS+0*REGSZ(a0)
+ REG_L s0, SC_REGS+1*REGSZ(a0)
+ REG_L s1, SC_REGS+2*REGSZ(a0)
+ REG_L s2, SC_REGS+3*REGSZ(a0)
+ REG_L s3, SC_REGS+4*REGSZ(a0)
+ REG_L s4, SC_REGS+5*REGSZ(a0)
+ REG_L s5, SC_REGS+6*REGSZ(a0)
+ REG_L s6, SC_REGS+7*REGSZ(a0)
+ REG_L s7, SC_REGS+8*REGSZ(a0)
+ REG_L s8, SC_REGS+9*REGSZ(a0)
+ REG_L gp, SC_REGS+10*REGSZ(a0)
+ REG_L sp, SC_REGS+11*REGSZ(a0)
+
+ lw v0, SC_FPSR(a0)
+ ctc1 v0, $31
+#ifdef __LP64__
+ # callee-saved fp regs on mips n64 ABI are $f24..$f31
+ l.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
+ l.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
+ l.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
+ l.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
+ l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ l.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
+ l.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
+ l.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
+#else
+ # callee-saved fp regs on mips o32 ABI are
+ # the even-numbered fp regs $f20,$f22,...$f30
+ l.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
+ l.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
+ l.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
+ l.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
+ l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ l.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
+#endif
bne a1, zero, 1f
- nop
li a1, 1 # never return 0!
1:
+ move v0, a1
j ra
- move v0, a1
botch:
jal longjmperror
- nop
jal abort
- nop
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
END(_longjmp)
diff --git a/libc/arch-mips/bionic/atexit.h b/libc/arch-mips/bionic/atexit.h
deleted file mode 100644
index 759008c..0000000
--- a/libc/arch-mips/bionic/atexit.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.
- */
-
-extern void *__dso_handle;
-extern int __cxa_atexit(void (*func)(void *), void *arg, void *dso);
-
-__attribute__ ((visibility ("hidden")))
-int atexit(void (*func)(void))
-{
- return (__cxa_atexit((void (*)(void *))func, (void *)0, &__dso_handle));
-}
diff --git a/libc/arch-mips/bionic/crtbegin.c b/libc/arch-mips/bionic/crtbegin.c
index 28e8817..50e9eeb 100644
--- a/libc/arch-mips/bionic/crtbegin.c
+++ b/libc/arch-mips/bionic/crtbegin.c
@@ -91,4 +91,4 @@
);
#include "../../arch-common/bionic/__dso_handle.h"
-#include "atexit.h"
+#include "../../arch-common/bionic/atexit.h"
diff --git a/libc/arch-mips/bionic/setjmp.S b/libc/arch-mips/bionic/setjmp.S
index 31786be..a1d4695 100644
--- a/libc/arch-mips/bionic/setjmp.S
+++ b/libc/arch-mips/bionic/setjmp.S
@@ -30,12 +30,12 @@
*/
#include <private/bionic_asm.h>
-#include <machine/regnum.h>
#include <machine/signal.h>
/*
- * setjmp, longjmp implementation for libc. this code depends
- * on the layout of the struct sigcontext in machine/signal.h.
+ * _setjmp, _longjmp (restoring signal state)
+ *
+ * GPOFF and FRAMESIZE must be the same for both _setjmp and _longjmp!
*
*/
@@ -51,124 +51,139 @@
SETUP_GP64(GPOFF, setjmp)
SAVE_GP(GPOFF)
.set reorder
+
+#ifndef __LP64__
+ addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
+ li t0, ~7
+ and a0, t0
+#endif
+
REG_S ra, RAOFF(sp) # save state
REG_S a0, A0OFF(sp)
-
move a0, zero # get current signal mask
jal sigblock
-
- REG_L v1, A0OFF(sp) # v1 = jmpbuf
- REG_S v0, SC_MASK(v1) # save sc_mask = sigblock(0)
-
- REG_L a0, A0OFF(sp) # restore jmpbuf
+ REG_L a0, A0OFF(sp)
REG_L ra, RAOFF(sp)
- REG_S ra, SC_PC(a0) # sc_pc = return address
-#if defined(__mips64)
- dli v0, 0xACEDBADE # sigcontext magic number
-#else
- li v0, 0xACEDBADE # sigcontext magic number
-#endif
- REG_S v0, SC_REGS+ZERO*REGSZ(a0)
- REG_S s0, SC_REGS+S0*REGSZ(a0)
- REG_S s1, SC_REGS+S1*REGSZ(a0)
- REG_S s2, SC_REGS+S2*REGSZ(a0)
- REG_S s3, SC_REGS+S3*REGSZ(a0)
- REG_S s4, SC_REGS+S4*REGSZ(a0)
- REG_S s5, SC_REGS+S5*REGSZ(a0)
- REG_S s6, SC_REGS+S6*REGSZ(a0)
- REG_S s7, SC_REGS+S7*REGSZ(a0)
- REG_S s8, SC_REGS+S8*REGSZ(a0)
- REG_L v0, GPOFF(sp)
- REG_S v0, SC_REGS+GP*REGSZ(a0)
- PTR_ADDU v0, sp, FRAMESZ
- REG_S v0, SC_REGS+SP*REGSZ(a0)
-#if !defined(SOFTFLOAT)
- li v0, 1 # be nice if we could tell
- REG_S v0, SC_FPUSED(a0) # sc_fpused = 1
+ REG_S v0, SC_MASK(a0) # save sc_mask = sigblock(0)
+
+ li v0, 0xACEDBADE # sigcontext magic number
+ sw v0, SC_MAGIC(a0)
+ # callee-saved long-sized regs:
+ REG_S ra, SC_REGS+0*REGSZ(a0)
+ REG_S s0, SC_REGS+1*REGSZ(a0)
+ REG_S s1, SC_REGS+2*REGSZ(a0)
+ REG_S s2, SC_REGS+3*REGSZ(a0)
+ REG_S s3, SC_REGS+4*REGSZ(a0)
+ REG_S s4, SC_REGS+5*REGSZ(a0)
+ REG_S s5, SC_REGS+6*REGSZ(a0)
+ REG_S s6, SC_REGS+7*REGSZ(a0)
+ REG_S s7, SC_REGS+8*REGSZ(a0)
+ REG_S s8, SC_REGS+9*REGSZ(a0)
+ REG_L v0, GPOFF(sp)
+ REG_S v0, SC_REGS+10*REGSZ(a0)
+ PTR_ADDU v0, sp, FRAMESZ
+ REG_S v0, SC_REGS+11*REGSZ(a0)
+
cfc1 v0, $31
- s.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
- s.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
- s.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
- s.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
- s.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
- s.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
-#if _MIPS_FPSET == 32
- s.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
- s.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
- s.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
- s.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
- s.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
- s.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
+
+#ifdef __LP64__
+ # callee-saved fp regs on mips n64 ABI are $f24..$f31
+ s.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
+ s.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
+ s.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
+ s.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
+ s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ s.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
+ s.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
+ s.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
+#else
+ # callee-saved fp regs on mips o32 ABI are
+ # the even-numbered fp regs $f20,$f22,...$f30
+ s.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
+ s.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
+ s.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
+ s.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
+ s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ s.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
#endif
- REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
-#endif /* !SOFTFLOAT */
+ sw v0, SC_FPSR(a0)
move v0, zero
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
j ra
+END(setjmp)
+
+
+NON_LEAF(longjmp, FRAMESZ, ra)
+ .mask 0x80000000, RAOFF
+ PTR_SUBU sp, FRAMESZ
+ SETUP_GP64(GPOFF, longjmp)
+ SAVE_GP(GPOFF)
+ .set reorder
+
+#ifndef __LP64__
+ addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
+ li t0, ~7
+ and a0, t0
+#endif
+
+ REG_S a1, A1OFF(sp)
+ REG_S a0, A0OFF(sp)
+ lw a0, SC_MASK(a0)
+ jal sigsetmask
+ REG_L a0, A0OFF(sp)
+ REG_L a1, A1OFF(sp)
+
+ lw v0, SC_MAGIC(a0)
+ li t0, 0xACEDBADE
+ bne v0, t0, botch # jump if error
+
+ # callee-saved long-sized regs:
+ REG_L ra, SC_REGS+0*REGSZ(a0)
+ REG_L s0, SC_REGS+1*REGSZ(a0)
+ REG_L s1, SC_REGS+2*REGSZ(a0)
+ REG_L s2, SC_REGS+3*REGSZ(a0)
+ REG_L s3, SC_REGS+4*REGSZ(a0)
+ REG_L s4, SC_REGS+5*REGSZ(a0)
+ REG_L s5, SC_REGS+6*REGSZ(a0)
+ REG_L s6, SC_REGS+7*REGSZ(a0)
+ REG_L s7, SC_REGS+8*REGSZ(a0)
+ REG_L s8, SC_REGS+9*REGSZ(a0)
+ REG_L gp, SC_REGS+10*REGSZ(a0)
+ REG_L sp, SC_REGS+11*REGSZ(a0)
+
+ lw v0, SC_FPSR(a0)
+ ctc1 v0, $31
+#ifdef __LP64__
+ # callee-saved fp regs on mips n64 ABI are $f24..$f31
+ l.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
+ l.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
+ l.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
+ l.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
+ l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ l.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
+ l.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
+ l.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
+#else
+ # callee-saved fp regs on mips o32 ABI are
+ # the even-numbered fp regs $f20,$f22,...$f30
+ l.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
+ l.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
+ l.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
+ l.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
+ l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ l.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
+#endif
+ bne a1, zero, 1f
+ li a1, 1 # never return 0!
+1:
+ move v0, a1
+ j ra
botch:
jal longjmperror
jal abort
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
-END(setjmp)
-
-
-LEAF(longjmp, FRAMESZ)
- PTR_SUBU sp, FRAMESZ
- SETUP_GP64(GPOFF, longjmp)
- SAVE_GP(GPOFF)
- .set reorder
- sw a1, A1OFF(sp)
- sw a0, A0OFF(sp)
-
- lw a0, SC_MASK(a0)
- jal sigsetmask
-
- lw a0, A0OFF(sp)
- lw a1, A1OFF(sp)
-
- .set noreorder
- REG_L v0, SC_REGS+ZERO*REGSZ(a0)
- bne v0, 0xACEDBADE, botch # jump if error
- REG_L ra, SC_PC(a0)
- REG_L s0, SC_REGS+S0*REGSZ(a0)
- REG_L s1, SC_REGS+S1*REGSZ(a0)
- REG_L s2, SC_REGS+S2*REGSZ(a0)
- REG_L s3, SC_REGS+S3*REGSZ(a0)
- REG_L s4, SC_REGS+S4*REGSZ(a0)
- REG_L s5, SC_REGS+S5*REGSZ(a0)
- REG_L s6, SC_REGS+S6*REGSZ(a0)
- REG_L s7, SC_REGS+S7*REGSZ(a0)
- REG_L s8, SC_REGS+S8*REGSZ(a0)
- REG_L gp, SC_REGS+GP*REGSZ(a0)
- REG_L sp, SC_REGS+SP*REGSZ(a0)
-
-#if !defined(SOFTFLOAT)
- REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
- ctc1 v0, $31
- l.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
- l.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
- l.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
- l.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
- l.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
- l.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
-#if _MIPS_FPSET == 32
- l.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
- l.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
- l.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
- l.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
- l.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
- l.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
-#endif
-#endif /* !SOFTFLOAT */
- bne a1, zero, 1f
- nop
- li a1, 1 # never return 0!
-1:
- j ra
- move v0, a1
-
END(longjmp)
diff --git a/libc/arch-mips/bionic/sigsetjmp.S b/libc/arch-mips/bionic/sigsetjmp.S
index 9d2e5ea..3ef0a6f 100644
--- a/libc/arch-mips/bionic/sigsetjmp.S
+++ b/libc/arch-mips/bionic/sigsetjmp.S
@@ -32,7 +32,6 @@
*/
#include <private/bionic_asm.h>
-#include <machine/regnum.h>
#include <machine/setjmp.h>
/*
@@ -46,7 +45,7 @@
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, sigsetjmp)
.set reorder
- REG_S a1, (_JBLEN*REGSZ)(a0) # save "savemask"
+ sw a1, _JBLEN*REGSZ(a0) # save "savemask"
bne a1, 0x0, 1f # do saving of signal mask?
LA t9, _setjmp
RESTORE_GP64
@@ -63,7 +62,7 @@
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, siglongjmp)
.set reorder
- REG_L t0, (_JBLEN*REGSZ)(a0) # get "savemask"
+ lw t0, _JBLEN*REGSZ(a0) # get "savemask"
bne t0, 0x0, 1f # restore signal mask?
LA t9, _longjmp
RESTORE_GP64
diff --git a/libc/arch-mips/include/machine/asm.h b/libc/arch-mips/include/machine/asm.h
index 5eacde3..cdc7914 100644
--- a/libc/arch-mips/include/machine/asm.h
+++ b/libc/arch-mips/include/machine/asm.h
@@ -28,9 +28,7 @@
#ifndef _MIPS64_ASM_H
#define _MIPS64_ASM_H
-#ifndef _ALIGN_TEXT
-# define _ALIGN_TEXT .align 4
-#endif
+#define __bionic_asm_align 4
#undef __bionic_asm_custom_entry
#undef __bionic_asm_custom_end
diff --git a/libc/arch-mips/include/machine/endian.h b/libc/arch-mips/include/machine/endian.h
index 41a9004..9270e9d 100644
--- a/libc/arch-mips/include/machine/endian.h
+++ b/libc/arch-mips/include/machine/endian.h
@@ -58,11 +58,7 @@
#endif /* __mips32r2__ */
#endif /* __GNUC__ */
-#if defined(__MIPSEB__)
-#define _BYTE_ORDER _BIG_ENDIAN
-#else
#define _BYTE_ORDER _LITTLE_ENDIAN
-#endif
#define __STRICT_ALIGNMENT
#include <sys/types.h>
#include <sys/endian.h>
diff --git a/libc/arch-mips/include/machine/regdef.h b/libc/arch-mips/include/machine/regdef.h
index ae18392..3a7cd68 100644
--- a/libc/arch-mips/include/machine/regdef.h
+++ b/libc/arch-mips/include/machine/regdef.h
@@ -37,6 +37,13 @@
#ifndef _MIPS_REGDEF_H_
#define _MIPS_REGDEF_H_
+#if (_MIPS_SIM == _ABI64) && !defined(__mips_n64)
+#define __mips_n64 1
+#endif
+#if (_MIPS_SIM == _ABIN32) && !defined(__mips_n32)
+#define __mips_n32 1
+#endif
+
#define zero $0 /* always zero */
#define AT $at /* assembler temp */
#define v0 $2 /* return value */
diff --git a/libc/arch-mips/include/machine/regnum.h b/libc/arch-mips/include/machine/regnum.h
deleted file mode 100644
index bfe1280..0000000
--- a/libc/arch-mips/include/machine/regnum.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* $OpenBSD: regnum.h,v 1.3 2004/08/10 20:28:13 deraadt Exp $ */
-
-/*
- * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
- *
- * 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.
- *
- */
-
-#ifndef _MIPS64_REGNUM_H_
-#define _MIPS64_REGNUM_H_
-
-/*
- * Location of the saved registers relative to ZERO.
- * Usage is p->p_regs[XX].
- */
-#define ZERO 0
-#define AST 1
-#define V0 2
-#define V1 3
-#define A0 4
-#define A1 5
-#define A2 6
-#define A3 7
-#define T0 8
-#define T1 9
-#define T2 10
-#define T3 11
-#define T4 12
-#define T5 13
-#define T6 14
-#define T7 15
-#define S0 16
-#define S1 17
-#define S2 18
-#define S3 19
-#define S4 20
-#define S5 21
-#define S6 22
-#define S7 23
-#define T8 24
-#define T9 25
-#define K0 26
-#define K1 27
-#define GP 28
-#define SP 29
-#define S8 30
-#define RA 31
-#define SR 32
-#define PS SR /* alias for SR */
-#define MULLO 33
-#define MULHI 34
-#define BADVADDR 35
-#define CAUSE 36
-#define PC 37
-#define IC 38
-#define CPL 39
-
-#define NUMSAVEREGS 40 /* Number of registers saved in trap */
-
-#define FPBASE NUMSAVEREGS
-#define F0 (FPBASE+0)
-#define F1 (FPBASE+1)
-#define F2 (FPBASE+2)
-#define F3 (FPBASE+3)
-#define F4 (FPBASE+4)
-#define F5 (FPBASE+5)
-#define F6 (FPBASE+6)
-#define F7 (FPBASE+7)
-#define F8 (FPBASE+8)
-#define F9 (FPBASE+9)
-#define F10 (FPBASE+10)
-#define F11 (FPBASE+11)
-#define F12 (FPBASE+12)
-#define F13 (FPBASE+13)
-#define F14 (FPBASE+14)
-#define F15 (FPBASE+15)
-#define F16 (FPBASE+16)
-#define F17 (FPBASE+17)
-#define F18 (FPBASE+18)
-#define F19 (FPBASE+19)
-#define F20 (FPBASE+20)
-#define F21 (FPBASE+21)
-#define F22 (FPBASE+22)
-#define F23 (FPBASE+23)
-#define F24 (FPBASE+24)
-#define F25 (FPBASE+25)
-#define F26 (FPBASE+26)
-#define F27 (FPBASE+27)
-#define F28 (FPBASE+28)
-#define F29 (FPBASE+29)
-#define F30 (FPBASE+30)
-#define F31 (FPBASE+31)
-#define FSR (FPBASE+32)
-
-#define NUMFPREGS 33
-
-#define NREGS (NUMSAVEREGS + NUMFPREGS)
-
-#endif /* !_MIPS64_REGNUM_H_ */
diff --git a/libc/arch-mips/include/machine/setjmp.h b/libc/arch-mips/include/machine/setjmp.h
index 55ba7be..a9707dc 100644
--- a/libc/arch-mips/include/machine/setjmp.h
+++ b/libc/arch-mips/include/machine/setjmp.h
@@ -5,6 +5,10 @@
#ifndef _MIPS_SETJMP_H_
#define _MIPS_SETJMP_H_
-#define _JBLEN 157 /* size, in longs, of a jmp_buf */
+#ifdef __LP64__
+#define _JBLEN 22 /* size, in 8-byte longs, of a mips64 jmp_buf */
+#else
+#define _JBLEN 29 /* size, in 4-byte longs, of a mips32 jmp_buf */
+#endif
#endif /* !_MIPS_SETJMP_H_ */
diff --git a/libc/arch-mips/include/machine/signal.h b/libc/arch-mips/include/machine/signal.h
index b31715c..b9c1367 100644
--- a/libc/arch-mips/include/machine/signal.h
+++ b/libc/arch-mips/include/machine/signal.h
@@ -37,15 +37,42 @@
#ifndef _MIPS_SIGNAL_H_
#define _MIPS_SIGNAL_H_
-#define SC_REGMASK (0*REGSZ)
-#define SC_STATUS (1*REGSZ)
-#define SC_PC (2*REGSZ)
-#define SC_REGS (SC_PC+8)
-#define SC_FPREGS (SC_REGS+32*8)
-#define SC_ACX (SC_FPREGS+32*REGSZ_FP)
-#define SC_USED_MATH (SC_ACX+3*REGSZ)
-/* OpenBSD compatibility */
-#define SC_MASK SC_REGMASK
-#define SC_FPUSED SC_USED_MATH
+/* On Mips32, jmpbuf begins with optional 4-byte filler so that
+ * all saved FP regs are aligned on 8-byte boundary, despite this whole
+ * struct being mis-declared to users as an array of (4-byte) longs.
+ * All the following offsets are then from the rounded-up base addr
+ */
+
+/* Fields of same size on all MIPS abis: */
+#define SC_MAGIC (0*4) /* 4 bytes, identify jmpbuf */
+#define SC_MASK (1*4) /* 4 bytes, saved signal mask */
+#define SC_FPSR (2*4) /* 4 bytes, floating point control/status reg */
+/* filler2 (3*4) 4 bytes, pad to 8-byte boundary */
+
+/* Registers that are 4-byte on mips32 o32, and 8-byte on mips64 n64 abi */
+#define SC_REGS_SAVED 12 /* ra,gp,sp,s0-s8 */
+#define SC_REGS (4*4) /* SC_REGS_SAVED*REGSZ bytes */
+
+/* Floating pt registers are 8-bytes on all abis,
+ * but the number of saved fp regs varies for o32/n32 versus n64 abis:
+ */
+
+#ifdef __LP64__
+#define SC_FPREGS_SAVED 8 /* all fp regs f24,f25,f26,f27,f28,f29,f30,f31 */
+#else
+#define SC_FPREGS_SAVED 6 /* even fp regs f20,f22,f24,f26,f28,f30 */
+#endif
+
+#define SC_FPREGS (SC_REGS + SC_REGS_SAVED*REGSZ) /* SC_FPREGS_SAVED*REGSZ_FP bytes */
+
+#define SC_BYTES (SC_FPREGS + SC_FPREGS_SAVED*REGSZ_FP)
+#define SC_LONGS (SC_BYTES/REGSZ)
+
+#ifdef __LP64__
+/* SC_LONGS is 22, so _JBLEN should be 22 or larger */
+#else
+/* SC_LONGS is 28, but must also allocate dynamic-roundup filler.
+ so _JBLEN should be 29 or larger */
+#endif
#endif /* !_MIPS_SIGNAL_H_ */
diff --git a/libc/include/sgidefs.h b/libc/arch-mips/include/sgidefs.h
similarity index 100%
rename from libc/include/sgidefs.h
rename to libc/arch-mips/include/sgidefs.h
diff --git a/libc/arch-mips/string/mips_strlen.c b/libc/arch-mips/string/mips_strlen.c
index 9fb7e6a..45fc4b4 100644
--- a/libc/arch-mips/string/mips_strlen.c
+++ b/libc/arch-mips/string/mips_strlen.c
@@ -30,6 +30,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <string.h>
#include "mips-string-ops.h"
#define do_strlen_word(__av) {\
@@ -47,8 +48,8 @@
#define strlen my_strlen
#endif
-int
-strlen (const void *_a)
+size_t
+strlen (const char *_a)
{
int cnt = 0;
unsigned x;
diff --git a/libc/arch-mips/syscalls/clock_nanosleep.S b/libc/arch-mips/syscalls/__clock_nanosleep.S
similarity index 85%
rename from libc/arch-mips/syscalls/clock_nanosleep.S
rename to libc/arch-mips/syscalls/__clock_nanosleep.S
index 6002ab4..97bfa27 100644
--- a/libc/arch-mips/syscalls/clock_nanosleep.S
+++ b/libc/arch-mips/syscalls/__clock_nanosleep.S
@@ -2,7 +2,7 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
+ENTRY(__clock_nanosleep)
.set noreorder
.cpload t9
li v0, __NR_clock_nanosleep
@@ -16,4 +16,4 @@
j t9
nop
.set reorder
-END(clock_nanosleep)
+END(__clock_nanosleep)
diff --git a/libc/arch-mips/syscalls/clock_nanosleep.S b/libc/arch-mips/syscalls/sethostname.S
similarity index 76%
copy from libc/arch-mips/syscalls/clock_nanosleep.S
copy to libc/arch-mips/syscalls/sethostname.S
index 6002ab4..2987b52 100644
--- a/libc/arch-mips/syscalls/clock_nanosleep.S
+++ b/libc/arch-mips/syscalls/sethostname.S
@@ -2,10 +2,10 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
+ENTRY(sethostname)
.set noreorder
.cpload t9
- li v0, __NR_clock_nanosleep
+ li v0, __NR_sethostname
syscall
bnez a3, 1f
move a0, v0
@@ -16,4 +16,4 @@
j t9
nop
.set reorder
-END(clock_nanosleep)
+END(sethostname)
diff --git a/libc/arch-mips64/bionic/_setjmp.S b/libc/arch-mips64/bionic/_setjmp.S
index d237e6d..052dacb 100644
--- a/libc/arch-mips64/bionic/_setjmp.S
+++ b/libc/arch-mips64/bionic/_setjmp.S
@@ -30,13 +30,11 @@
*/
#include <private/bionic_asm.h>
-#include <machine/regnum.h>
#include <machine/signal.h>
/*
* _setjmp, _longjmp (not restoring signal state)
*
- * XXX FPSET should probably be taken from SR setting. hmmm...
* GPOFF and FRAMESIZE must be the same for both _setjmp and _longjmp!
*
*/
@@ -48,103 +46,127 @@
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, _setjmp)
SAVE_GP(GPOFF)
- .set noreorder
-#if defined(__mips64)
- dli v0, 0xACEDBADE # sigcontext magic number
-#else
- li v0, 0xACEDBADE # sigcontext magic number
-#endif
- REG_S v0, SC_REGS+ZERO*REGSZ(a0)
- REG_S s0, SC_REGS+S0*REGSZ(a0)
- REG_S s1, SC_REGS+S1*REGSZ(a0)
- REG_S s2, SC_REGS+S2*REGSZ(a0)
- REG_S s3, SC_REGS+S3*REGSZ(a0)
- REG_S s4, SC_REGS+S4*REGSZ(a0)
- REG_S s5, SC_REGS+S5*REGSZ(a0)
- REG_S s6, SC_REGS+S6*REGSZ(a0)
- REG_S s7, SC_REGS+S7*REGSZ(a0)
- REG_S s8, SC_REGS+S8*REGSZ(a0)
- REG_L v0, GPOFF(sp)
- REG_S v0, SC_REGS+GP*REGSZ(a0)
- PTR_ADDU v0, sp, FRAMESZ
- REG_S v0, SC_REGS+SP*REGSZ(a0)
- REG_S ra, SC_PC(a0)
+ .set reorder
-#if !defined(SOFTFLOAT)
- li v0, 1 # be nice if we could tell
- REG_S v0, SC_FPUSED(a0) # sc_fpused = 1
- cfc1 v0, $31
- s.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
- s.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
- s.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
- s.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
- s.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
- s.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
-#if _MIPS_FPSET == 32
- s.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
- s.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
- s.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
- s.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
- s.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
- s.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
+#ifndef __LP64__
+ addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
+ li t0, ~7
+ and a0, t0
#endif
- REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
-#endif /* !SOFTFLOAT */
+
+ # SC_MASK is unused here
+
+ li v0, 0xACEDBADE # sigcontext magic number
+ sw v0, SC_MAGIC(a0)
+ # callee-saved long-sized regs:
+ REG_S ra, SC_REGS+0*REGSZ(a0)
+ REG_S s0, SC_REGS+1*REGSZ(a0)
+ REG_S s1, SC_REGS+2*REGSZ(a0)
+ REG_S s2, SC_REGS+3*REGSZ(a0)
+ REG_S s3, SC_REGS+4*REGSZ(a0)
+ REG_S s4, SC_REGS+5*REGSZ(a0)
+ REG_S s5, SC_REGS+6*REGSZ(a0)
+ REG_S s6, SC_REGS+7*REGSZ(a0)
+ REG_S s7, SC_REGS+8*REGSZ(a0)
+ REG_S s8, SC_REGS+9*REGSZ(a0)
+ REG_L v0, GPOFF(sp)
+ REG_S v0, SC_REGS+10*REGSZ(a0)
+ PTR_ADDU v0, sp, FRAMESZ
+ REG_S v0, SC_REGS+11*REGSZ(a0)
+
+ cfc1 v0, $31
+
+#ifdef __LP64__
+ # callee-saved fp regs on mips n64 ABI are $f24..$f31
+ s.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
+ s.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
+ s.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
+ s.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
+ s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ s.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
+ s.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
+ s.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
+#else
+ # callee-saved fp regs on mips o32 ABI are
+ # the even-numbered fp regs $f20,$f22,...$f30
+ s.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
+ s.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
+ s.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
+ s.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
+ s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ s.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
+#endif
+ sw v0, SC_FPSR(a0)
+ move v0, zero
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
j ra
- move v0, zero
END(_setjmp)
+
LEAF(_longjmp, FRAMESZ)
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, _longjmp)
SAVE_GP(GPOFF)
- .set noreorder
- REG_L v0, SC_REGS+ZERO*REGSZ(a0)
- bne v0, 0xACEDBADE, botch # jump if error
- REG_L ra, SC_PC(a0)
- REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
- REG_L s0, SC_REGS+S0*REGSZ(a0)
- REG_L s1, SC_REGS+S1*REGSZ(a0)
- REG_L s2, SC_REGS+S2*REGSZ(a0)
- REG_L s3, SC_REGS+S3*REGSZ(a0)
- REG_L s4, SC_REGS+S4*REGSZ(a0)
- REG_L s5, SC_REGS+S5*REGSZ(a0)
- REG_L s6, SC_REGS+S6*REGSZ(a0)
- REG_L s7, SC_REGS+S7*REGSZ(a0)
- REG_L s8, SC_REGS+S8*REGSZ(a0)
- REG_L gp, SC_REGS+GP*REGSZ(a0)
- REG_L sp, SC_REGS+SP*REGSZ(a0)
-#if !defined(SOFTFLOAT)
- ctc1 v0, $31
- l.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
- l.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
- l.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
- l.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
- l.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
- l.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
-#if _MIPS_FPSET == 32
- l.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
- l.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
- l.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
- l.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
- l.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
- l.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
+ .set reorder
+
+#ifndef __LP64__
+ addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
+ li t0, ~7
+ and a0, t0
#endif
-#endif /* !SOFTFLOAT */
+
+ # SC_MASK is unused here
+
+ lw v0, SC_MAGIC(a0)
+ li t0, 0xACEDBADE
+ bne v0, t0, botch # jump if error
+
+ # callee-saved long-sized regs:
+ REG_L ra, SC_REGS+0*REGSZ(a0)
+ REG_L s0, SC_REGS+1*REGSZ(a0)
+ REG_L s1, SC_REGS+2*REGSZ(a0)
+ REG_L s2, SC_REGS+3*REGSZ(a0)
+ REG_L s3, SC_REGS+4*REGSZ(a0)
+ REG_L s4, SC_REGS+5*REGSZ(a0)
+ REG_L s5, SC_REGS+6*REGSZ(a0)
+ REG_L s6, SC_REGS+7*REGSZ(a0)
+ REG_L s7, SC_REGS+8*REGSZ(a0)
+ REG_L s8, SC_REGS+9*REGSZ(a0)
+ REG_L gp, SC_REGS+10*REGSZ(a0)
+ REG_L sp, SC_REGS+11*REGSZ(a0)
+
+ lw v0, SC_FPSR(a0)
+ ctc1 v0, $31
+#ifdef __LP64__
+ # callee-saved fp regs on mips n64 ABI are $f24..$f31
+ l.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
+ l.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
+ l.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
+ l.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
+ l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ l.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
+ l.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
+ l.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
+#else
+ # callee-saved fp regs on mips o32 ABI are
+ # the even-numbered fp regs $f20,$f22,...$f30
+ l.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
+ l.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
+ l.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
+ l.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
+ l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ l.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
+#endif
bne a1, zero, 1f
- nop
li a1, 1 # never return 0!
1:
+ move v0, a1
j ra
- move v0, a1
botch:
jal longjmperror
- nop
jal abort
- nop
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
END(_longjmp)
diff --git a/libc/arch-mips64/bionic/atexit.h b/libc/arch-mips64/bionic/atexit.h
deleted file mode 100644
index 759008c..0000000
--- a/libc/arch-mips64/bionic/atexit.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.
- */
-
-extern void *__dso_handle;
-extern int __cxa_atexit(void (*func)(void *), void *arg, void *dso);
-
-__attribute__ ((visibility ("hidden")))
-int atexit(void (*func)(void))
-{
- return (__cxa_atexit((void (*)(void *))func, (void *)0, &__dso_handle));
-}
diff --git a/libc/arch-mips64/bionic/crtbegin.c b/libc/arch-mips64/bionic/crtbegin.c
index 2ea31ad..1374fea 100644
--- a/libc/arch-mips64/bionic/crtbegin.c
+++ b/libc/arch-mips64/bionic/crtbegin.c
@@ -91,4 +91,4 @@
);
#include "../../arch-common/bionic/__dso_handle.h"
-#include "atexit.h"
+#include "../../arch-common/bionic/atexit.h"
diff --git a/libc/arch-mips64/bionic/crtbegin_so.c b/libc/arch-mips64/bionic/crtbegin_so.c
deleted file mode 100644
index d664ce6..0000000
--- a/libc/arch-mips64/bionic/crtbegin_so.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.
- */
-
-extern void __cxa_finalize(void *);
-extern void *__dso_handle;
-
-__attribute__((visibility("hidden"),destructor))
-void __on_dlclose() {
- __cxa_finalize(&__dso_handle);
-}
-
-#include "../../arch-common/bionic/__dso_handle_so.h"
-#include "atexit.h"
diff --git a/libc/arch-mips64/bionic/setjmp.S b/libc/arch-mips64/bionic/setjmp.S
index 31786be..a1d4695 100644
--- a/libc/arch-mips64/bionic/setjmp.S
+++ b/libc/arch-mips64/bionic/setjmp.S
@@ -30,12 +30,12 @@
*/
#include <private/bionic_asm.h>
-#include <machine/regnum.h>
#include <machine/signal.h>
/*
- * setjmp, longjmp implementation for libc. this code depends
- * on the layout of the struct sigcontext in machine/signal.h.
+ * _setjmp, _longjmp (restoring signal state)
+ *
+ * GPOFF and FRAMESIZE must be the same for both _setjmp and _longjmp!
*
*/
@@ -51,124 +51,139 @@
SETUP_GP64(GPOFF, setjmp)
SAVE_GP(GPOFF)
.set reorder
+
+#ifndef __LP64__
+ addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
+ li t0, ~7
+ and a0, t0
+#endif
+
REG_S ra, RAOFF(sp) # save state
REG_S a0, A0OFF(sp)
-
move a0, zero # get current signal mask
jal sigblock
-
- REG_L v1, A0OFF(sp) # v1 = jmpbuf
- REG_S v0, SC_MASK(v1) # save sc_mask = sigblock(0)
-
- REG_L a0, A0OFF(sp) # restore jmpbuf
+ REG_L a0, A0OFF(sp)
REG_L ra, RAOFF(sp)
- REG_S ra, SC_PC(a0) # sc_pc = return address
-#if defined(__mips64)
- dli v0, 0xACEDBADE # sigcontext magic number
-#else
- li v0, 0xACEDBADE # sigcontext magic number
-#endif
- REG_S v0, SC_REGS+ZERO*REGSZ(a0)
- REG_S s0, SC_REGS+S0*REGSZ(a0)
- REG_S s1, SC_REGS+S1*REGSZ(a0)
- REG_S s2, SC_REGS+S2*REGSZ(a0)
- REG_S s3, SC_REGS+S3*REGSZ(a0)
- REG_S s4, SC_REGS+S4*REGSZ(a0)
- REG_S s5, SC_REGS+S5*REGSZ(a0)
- REG_S s6, SC_REGS+S6*REGSZ(a0)
- REG_S s7, SC_REGS+S7*REGSZ(a0)
- REG_S s8, SC_REGS+S8*REGSZ(a0)
- REG_L v0, GPOFF(sp)
- REG_S v0, SC_REGS+GP*REGSZ(a0)
- PTR_ADDU v0, sp, FRAMESZ
- REG_S v0, SC_REGS+SP*REGSZ(a0)
-#if !defined(SOFTFLOAT)
- li v0, 1 # be nice if we could tell
- REG_S v0, SC_FPUSED(a0) # sc_fpused = 1
+ REG_S v0, SC_MASK(a0) # save sc_mask = sigblock(0)
+
+ li v0, 0xACEDBADE # sigcontext magic number
+ sw v0, SC_MAGIC(a0)
+ # callee-saved long-sized regs:
+ REG_S ra, SC_REGS+0*REGSZ(a0)
+ REG_S s0, SC_REGS+1*REGSZ(a0)
+ REG_S s1, SC_REGS+2*REGSZ(a0)
+ REG_S s2, SC_REGS+3*REGSZ(a0)
+ REG_S s3, SC_REGS+4*REGSZ(a0)
+ REG_S s4, SC_REGS+5*REGSZ(a0)
+ REG_S s5, SC_REGS+6*REGSZ(a0)
+ REG_S s6, SC_REGS+7*REGSZ(a0)
+ REG_S s7, SC_REGS+8*REGSZ(a0)
+ REG_S s8, SC_REGS+9*REGSZ(a0)
+ REG_L v0, GPOFF(sp)
+ REG_S v0, SC_REGS+10*REGSZ(a0)
+ PTR_ADDU v0, sp, FRAMESZ
+ REG_S v0, SC_REGS+11*REGSZ(a0)
+
cfc1 v0, $31
- s.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
- s.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
- s.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
- s.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
- s.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
- s.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
-#if _MIPS_FPSET == 32
- s.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
- s.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
- s.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
- s.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
- s.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
- s.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
+
+#ifdef __LP64__
+ # callee-saved fp regs on mips n64 ABI are $f24..$f31
+ s.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
+ s.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
+ s.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
+ s.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
+ s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ s.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
+ s.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
+ s.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
+#else
+ # callee-saved fp regs on mips o32 ABI are
+ # the even-numbered fp regs $f20,$f22,...$f30
+ s.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
+ s.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
+ s.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
+ s.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
+ s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ s.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
#endif
- REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
-#endif /* !SOFTFLOAT */
+ sw v0, SC_FPSR(a0)
move v0, zero
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
j ra
+END(setjmp)
+
+
+NON_LEAF(longjmp, FRAMESZ, ra)
+ .mask 0x80000000, RAOFF
+ PTR_SUBU sp, FRAMESZ
+ SETUP_GP64(GPOFF, longjmp)
+ SAVE_GP(GPOFF)
+ .set reorder
+
+#ifndef __LP64__
+ addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
+ li t0, ~7
+ and a0, t0
+#endif
+
+ REG_S a1, A1OFF(sp)
+ REG_S a0, A0OFF(sp)
+ lw a0, SC_MASK(a0)
+ jal sigsetmask
+ REG_L a0, A0OFF(sp)
+ REG_L a1, A1OFF(sp)
+
+ lw v0, SC_MAGIC(a0)
+ li t0, 0xACEDBADE
+ bne v0, t0, botch # jump if error
+
+ # callee-saved long-sized regs:
+ REG_L ra, SC_REGS+0*REGSZ(a0)
+ REG_L s0, SC_REGS+1*REGSZ(a0)
+ REG_L s1, SC_REGS+2*REGSZ(a0)
+ REG_L s2, SC_REGS+3*REGSZ(a0)
+ REG_L s3, SC_REGS+4*REGSZ(a0)
+ REG_L s4, SC_REGS+5*REGSZ(a0)
+ REG_L s5, SC_REGS+6*REGSZ(a0)
+ REG_L s6, SC_REGS+7*REGSZ(a0)
+ REG_L s7, SC_REGS+8*REGSZ(a0)
+ REG_L s8, SC_REGS+9*REGSZ(a0)
+ REG_L gp, SC_REGS+10*REGSZ(a0)
+ REG_L sp, SC_REGS+11*REGSZ(a0)
+
+ lw v0, SC_FPSR(a0)
+ ctc1 v0, $31
+#ifdef __LP64__
+ # callee-saved fp regs on mips n64 ABI are $f24..$f31
+ l.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
+ l.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
+ l.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
+ l.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
+ l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ l.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
+ l.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
+ l.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
+#else
+ # callee-saved fp regs on mips o32 ABI are
+ # the even-numbered fp regs $f20,$f22,...$f30
+ l.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
+ l.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
+ l.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
+ l.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
+ l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
+ l.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
+#endif
+ bne a1, zero, 1f
+ li a1, 1 # never return 0!
+1:
+ move v0, a1
+ j ra
botch:
jal longjmperror
jal abort
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
-END(setjmp)
-
-
-LEAF(longjmp, FRAMESZ)
- PTR_SUBU sp, FRAMESZ
- SETUP_GP64(GPOFF, longjmp)
- SAVE_GP(GPOFF)
- .set reorder
- sw a1, A1OFF(sp)
- sw a0, A0OFF(sp)
-
- lw a0, SC_MASK(a0)
- jal sigsetmask
-
- lw a0, A0OFF(sp)
- lw a1, A1OFF(sp)
-
- .set noreorder
- REG_L v0, SC_REGS+ZERO*REGSZ(a0)
- bne v0, 0xACEDBADE, botch # jump if error
- REG_L ra, SC_PC(a0)
- REG_L s0, SC_REGS+S0*REGSZ(a0)
- REG_L s1, SC_REGS+S1*REGSZ(a0)
- REG_L s2, SC_REGS+S2*REGSZ(a0)
- REG_L s3, SC_REGS+S3*REGSZ(a0)
- REG_L s4, SC_REGS+S4*REGSZ(a0)
- REG_L s5, SC_REGS+S5*REGSZ(a0)
- REG_L s6, SC_REGS+S6*REGSZ(a0)
- REG_L s7, SC_REGS+S7*REGSZ(a0)
- REG_L s8, SC_REGS+S8*REGSZ(a0)
- REG_L gp, SC_REGS+GP*REGSZ(a0)
- REG_L sp, SC_REGS+SP*REGSZ(a0)
-
-#if !defined(SOFTFLOAT)
- REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
- ctc1 v0, $31
- l.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
- l.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
- l.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
- l.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
- l.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
- l.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
-#if _MIPS_FPSET == 32
- l.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
- l.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
- l.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
- l.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
- l.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
- l.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
-#endif
-#endif /* !SOFTFLOAT */
- bne a1, zero, 1f
- nop
- li a1, 1 # never return 0!
-1:
- j ra
- move v0, a1
-
END(longjmp)
diff --git a/libc/arch-mips64/bionic/sigsetjmp.S b/libc/arch-mips64/bionic/sigsetjmp.S
index 9d2e5ea..3ef0a6f 100644
--- a/libc/arch-mips64/bionic/sigsetjmp.S
+++ b/libc/arch-mips64/bionic/sigsetjmp.S
@@ -32,7 +32,6 @@
*/
#include <private/bionic_asm.h>
-#include <machine/regnum.h>
#include <machine/setjmp.h>
/*
@@ -46,7 +45,7 @@
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, sigsetjmp)
.set reorder
- REG_S a1, (_JBLEN*REGSZ)(a0) # save "savemask"
+ sw a1, _JBLEN*REGSZ(a0) # save "savemask"
bne a1, 0x0, 1f # do saving of signal mask?
LA t9, _setjmp
RESTORE_GP64
@@ -63,7 +62,7 @@
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, siglongjmp)
.set reorder
- REG_L t0, (_JBLEN*REGSZ)(a0) # get "savemask"
+ lw t0, _JBLEN*REGSZ(a0) # get "savemask"
bne t0, 0x0, 1f # restore signal mask?
LA t9, _longjmp
RESTORE_GP64
diff --git a/libc/arch-mips64/bionic/syscall.S b/libc/arch-mips64/bionic/syscall.S
index 924741d..4c739fd 100644
--- a/libc/arch-mips64/bionic/syscall.S
+++ b/libc/arch-mips64/bionic/syscall.S
@@ -52,7 +52,7 @@
#else
move a3, a4
move a4, a5
- REG_L a5, FRAMESZ(sp)
+ move a5, a6
#endif
syscall
move a0, v0
diff --git a/libc/arch-mips64/include/machine/asm.h b/libc/arch-mips64/include/machine/asm.h
index 5eacde3..cdc7914 100644
--- a/libc/arch-mips64/include/machine/asm.h
+++ b/libc/arch-mips64/include/machine/asm.h
@@ -28,9 +28,7 @@
#ifndef _MIPS64_ASM_H
#define _MIPS64_ASM_H
-#ifndef _ALIGN_TEXT
-# define _ALIGN_TEXT .align 4
-#endif
+#define __bionic_asm_align 4
#undef __bionic_asm_custom_entry
#undef __bionic_asm_custom_end
diff --git a/libc/arch-mips64/include/machine/endian.h b/libc/arch-mips64/include/machine/endian.h
index 41a9004..9270e9d 100644
--- a/libc/arch-mips64/include/machine/endian.h
+++ b/libc/arch-mips64/include/machine/endian.h
@@ -58,11 +58,7 @@
#endif /* __mips32r2__ */
#endif /* __GNUC__ */
-#if defined(__MIPSEB__)
-#define _BYTE_ORDER _BIG_ENDIAN
-#else
#define _BYTE_ORDER _LITTLE_ENDIAN
-#endif
#define __STRICT_ALIGNMENT
#include <sys/types.h>
#include <sys/endian.h>
diff --git a/libc/arch-mips64/include/machine/regnum.h b/libc/arch-mips64/include/machine/regnum.h
deleted file mode 100644
index bfe1280..0000000
--- a/libc/arch-mips64/include/machine/regnum.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* $OpenBSD: regnum.h,v 1.3 2004/08/10 20:28:13 deraadt Exp $ */
-
-/*
- * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
- *
- * 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.
- *
- */
-
-#ifndef _MIPS64_REGNUM_H_
-#define _MIPS64_REGNUM_H_
-
-/*
- * Location of the saved registers relative to ZERO.
- * Usage is p->p_regs[XX].
- */
-#define ZERO 0
-#define AST 1
-#define V0 2
-#define V1 3
-#define A0 4
-#define A1 5
-#define A2 6
-#define A3 7
-#define T0 8
-#define T1 9
-#define T2 10
-#define T3 11
-#define T4 12
-#define T5 13
-#define T6 14
-#define T7 15
-#define S0 16
-#define S1 17
-#define S2 18
-#define S3 19
-#define S4 20
-#define S5 21
-#define S6 22
-#define S7 23
-#define T8 24
-#define T9 25
-#define K0 26
-#define K1 27
-#define GP 28
-#define SP 29
-#define S8 30
-#define RA 31
-#define SR 32
-#define PS SR /* alias for SR */
-#define MULLO 33
-#define MULHI 34
-#define BADVADDR 35
-#define CAUSE 36
-#define PC 37
-#define IC 38
-#define CPL 39
-
-#define NUMSAVEREGS 40 /* Number of registers saved in trap */
-
-#define FPBASE NUMSAVEREGS
-#define F0 (FPBASE+0)
-#define F1 (FPBASE+1)
-#define F2 (FPBASE+2)
-#define F3 (FPBASE+3)
-#define F4 (FPBASE+4)
-#define F5 (FPBASE+5)
-#define F6 (FPBASE+6)
-#define F7 (FPBASE+7)
-#define F8 (FPBASE+8)
-#define F9 (FPBASE+9)
-#define F10 (FPBASE+10)
-#define F11 (FPBASE+11)
-#define F12 (FPBASE+12)
-#define F13 (FPBASE+13)
-#define F14 (FPBASE+14)
-#define F15 (FPBASE+15)
-#define F16 (FPBASE+16)
-#define F17 (FPBASE+17)
-#define F18 (FPBASE+18)
-#define F19 (FPBASE+19)
-#define F20 (FPBASE+20)
-#define F21 (FPBASE+21)
-#define F22 (FPBASE+22)
-#define F23 (FPBASE+23)
-#define F24 (FPBASE+24)
-#define F25 (FPBASE+25)
-#define F26 (FPBASE+26)
-#define F27 (FPBASE+27)
-#define F28 (FPBASE+28)
-#define F29 (FPBASE+29)
-#define F30 (FPBASE+30)
-#define F31 (FPBASE+31)
-#define FSR (FPBASE+32)
-
-#define NUMFPREGS 33
-
-#define NREGS (NUMSAVEREGS + NUMFPREGS)
-
-#endif /* !_MIPS64_REGNUM_H_ */
diff --git a/libc/arch-mips64/include/machine/setjmp.h b/libc/arch-mips64/include/machine/setjmp.h
index 55ba7be..a9707dc 100644
--- a/libc/arch-mips64/include/machine/setjmp.h
+++ b/libc/arch-mips64/include/machine/setjmp.h
@@ -5,6 +5,10 @@
#ifndef _MIPS_SETJMP_H_
#define _MIPS_SETJMP_H_
-#define _JBLEN 157 /* size, in longs, of a jmp_buf */
+#ifdef __LP64__
+#define _JBLEN 22 /* size, in 8-byte longs, of a mips64 jmp_buf */
+#else
+#define _JBLEN 29 /* size, in 4-byte longs, of a mips32 jmp_buf */
+#endif
#endif /* !_MIPS_SETJMP_H_ */
diff --git a/libc/arch-mips64/include/machine/signal.h b/libc/arch-mips64/include/machine/signal.h
index b31715c..b9c1367 100644
--- a/libc/arch-mips64/include/machine/signal.h
+++ b/libc/arch-mips64/include/machine/signal.h
@@ -37,15 +37,42 @@
#ifndef _MIPS_SIGNAL_H_
#define _MIPS_SIGNAL_H_
-#define SC_REGMASK (0*REGSZ)
-#define SC_STATUS (1*REGSZ)
-#define SC_PC (2*REGSZ)
-#define SC_REGS (SC_PC+8)
-#define SC_FPREGS (SC_REGS+32*8)
-#define SC_ACX (SC_FPREGS+32*REGSZ_FP)
-#define SC_USED_MATH (SC_ACX+3*REGSZ)
-/* OpenBSD compatibility */
-#define SC_MASK SC_REGMASK
-#define SC_FPUSED SC_USED_MATH
+/* On Mips32, jmpbuf begins with optional 4-byte filler so that
+ * all saved FP regs are aligned on 8-byte boundary, despite this whole
+ * struct being mis-declared to users as an array of (4-byte) longs.
+ * All the following offsets are then from the rounded-up base addr
+ */
+
+/* Fields of same size on all MIPS abis: */
+#define SC_MAGIC (0*4) /* 4 bytes, identify jmpbuf */
+#define SC_MASK (1*4) /* 4 bytes, saved signal mask */
+#define SC_FPSR (2*4) /* 4 bytes, floating point control/status reg */
+/* filler2 (3*4) 4 bytes, pad to 8-byte boundary */
+
+/* Registers that are 4-byte on mips32 o32, and 8-byte on mips64 n64 abi */
+#define SC_REGS_SAVED 12 /* ra,gp,sp,s0-s8 */
+#define SC_REGS (4*4) /* SC_REGS_SAVED*REGSZ bytes */
+
+/* Floating pt registers are 8-bytes on all abis,
+ * but the number of saved fp regs varies for o32/n32 versus n64 abis:
+ */
+
+#ifdef __LP64__
+#define SC_FPREGS_SAVED 8 /* all fp regs f24,f25,f26,f27,f28,f29,f30,f31 */
+#else
+#define SC_FPREGS_SAVED 6 /* even fp regs f20,f22,f24,f26,f28,f30 */
+#endif
+
+#define SC_FPREGS (SC_REGS + SC_REGS_SAVED*REGSZ) /* SC_FPREGS_SAVED*REGSZ_FP bytes */
+
+#define SC_BYTES (SC_FPREGS + SC_FPREGS_SAVED*REGSZ_FP)
+#define SC_LONGS (SC_BYTES/REGSZ)
+
+#ifdef __LP64__
+/* SC_LONGS is 22, so _JBLEN should be 22 or larger */
+#else
+/* SC_LONGS is 28, but must also allocate dynamic-roundup filler.
+ so _JBLEN should be 29 or larger */
+#endif
#endif /* !_MIPS_SIGNAL_H_ */
diff --git a/libc/arch-mips64/mips64.mk b/libc/arch-mips64/mips64.mk
index 0d4b727..b962283 100644
--- a/libc/arch-mips64/mips64.mk
+++ b/libc/arch-mips64/mips64.mk
@@ -49,7 +49,6 @@
libc_bionic_src_files_mips64 += \
arch-mips64/bionic/__bionic_clone.S \
arch-mips64/bionic/_exit_with_stack_teardown.S \
- arch-mips64/bionic/__get_sp.S \
arch-mips64/bionic/_setjmp.S \
arch-mips64/bionic/setjmp.S \
arch-mips64/bionic/sigsetjmp.S \
diff --git a/libc/arch-mips64/syscalls/clock_nanosleep.S b/libc/arch-mips64/syscalls/__clock_nanosleep.S
similarity index 83%
rename from libc/arch-mips64/syscalls/clock_nanosleep.S
rename to libc/arch-mips64/syscalls/__clock_nanosleep.S
index c958a10..204675f 100644
--- a/libc/arch-mips64/syscalls/clock_nanosleep.S
+++ b/libc/arch-mips64/syscalls/__clock_nanosleep.S
@@ -2,7 +2,7 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
+ENTRY(__clock_nanosleep)
.set push
.set noreorder
li v0, __NR_clock_nanosleep
@@ -22,4 +22,5 @@
j t9
move ra, t0
.set pop
-END(clock_nanosleep)
+END(__clock_nanosleep)
+.hidden __clock_nanosleep
diff --git a/libc/arch-mips64/syscalls/_flush_cache.S b/libc/arch-mips64/syscalls/sethostname.S
similarity index 83%
rename from libc/arch-mips64/syscalls/_flush_cache.S
rename to libc/arch-mips64/syscalls/sethostname.S
index a9e4842..2f132a2 100644
--- a/libc/arch-mips64/syscalls/_flush_cache.S
+++ b/libc/arch-mips64/syscalls/sethostname.S
@@ -2,10 +2,10 @@
#include <private/bionic_asm.h>
-ENTRY(_flush_cache)
+ENTRY(sethostname)
.set push
.set noreorder
- li v0, __NR_cacheflush
+ li v0, __NR_sethostname
syscall
bnez a3, 1f
move a0, v0
@@ -22,4 +22,4 @@
j t9
move ra, t0
.set pop
-END(_flush_cache)
+END(sethostname)
diff --git a/libc/arch-x86/atom/string/sse2-wcslen-atom.S b/libc/arch-x86/atom/string/sse2-wcslen-atom.S
index 6a6ad51..2f10db4 100644
--- a/libc/arch-x86/atom/string/sse2-wcslen-atom.S
+++ b/libc/arch-x86/atom/string/sse2-wcslen-atom.S
@@ -65,21 +65,21 @@
ENTRY (wcslen)
mov STR(%esp), %edx
#endif
- cmp $0, (%edx)
+ cmpl $0, (%edx)
jz L(exit_tail0)
- cmp $0, 4(%edx)
+ cmpl $0, 4(%edx)
jz L(exit_tail1)
- cmp $0, 8(%edx)
+ cmpl $0, 8(%edx)
jz L(exit_tail2)
- cmp $0, 12(%edx)
+ cmpl $0, 12(%edx)
jz L(exit_tail3)
- cmp $0, 16(%edx)
+ cmpl $0, 16(%edx)
jz L(exit_tail4)
- cmp $0, 20(%edx)
+ cmpl $0, 20(%edx)
jz L(exit_tail5)
- cmp $0, 24(%edx)
+ cmpl $0, 24(%edx)
jz L(exit_tail6)
- cmp $0, 28(%edx)
+ cmpl $0, 28(%edx)
jz L(exit_tail7)
pxor %xmm0, %xmm0
diff --git a/libc/arch-x86/atom/string/ssse3-wcscat-atom.S b/libc/arch-x86/atom/string/ssse3-wcscat-atom.S
index 17b0843..8a389a3 100644
--- a/libc/arch-x86/atom/string/ssse3-wcscat-atom.S
+++ b/libc/arch-x86/atom/string/ssse3-wcscat-atom.S
@@ -98,13 +98,13 @@
mov STR2(%esp), %ecx
lea (%edi, %eax), %edx
- cmp $0, (%ecx)
+ cmpl $0, (%ecx)
jz L(Exit4)
- cmp $0, 4(%ecx)
+ cmpl $0, 4(%ecx)
jz L(Exit8)
- cmp $0, 8(%ecx)
+ cmpl $0, 8(%ecx)
jz L(Exit12)
- cmp $0, 12(%ecx)
+ cmpl $0, 12(%ecx)
jz L(Exit16)
#undef RETURN
diff --git a/libc/arch-x86/atom/string/ssse3-wcscpy-atom.S b/libc/arch-x86/atom/string/ssse3-wcscpy-atom.S
index 8ba84bc..27cb61e 100644
--- a/libc/arch-x86/atom/string/ssse3-wcscpy-atom.S
+++ b/libc/arch-x86/atom/string/ssse3-wcscpy-atom.S
@@ -92,13 +92,13 @@
mov STR1(%esp), %edx
mov STR2(%esp), %ecx
- cmp $0, (%ecx)
+ cmpl $0, (%ecx)
jz L(ExitTail4)
- cmp $0, 4(%ecx)
+ cmpl $0, 4(%ecx)
jz L(ExitTail8)
- cmp $0, 8(%ecx)
+ cmpl $0, 8(%ecx)
jz L(ExitTail12)
- cmp $0, 12(%ecx)
+ cmpl $0, 12(%ecx)
jz L(ExitTail16)
PUSH (%edi)
diff --git a/libc/arch-x86/include/machine/asm.h b/libc/arch-x86/include/machine/asm.h
index 672493d..943f9dd 100644
--- a/libc/arch-x86/include/machine/asm.h
+++ b/libc/arch-x86/include/machine/asm.h
@@ -49,15 +49,6 @@
#define PIC_GOT(x) x@GOT(%ebx)
#define PIC_GOTOFF(x) x@GOTOFF(%ebx)
-/* let kernels and others override entrypoint alignment */
-#if !defined(_ALIGN_TEXT) && !defined(_KERNEL)
-# ifdef _STANDALONE
-# define _ALIGN_TEXT .align 1
-# elif defined __ELF__
-# define _ALIGN_TEXT .align 16
-# else
-# define _ALIGN_TEXT .align 4
-# endif
-#endif
+#define __bionic_asm_align 16
#endif /* !_I386_ASM_H_ */
diff --git a/libc/arch-x86/syscalls/clock_nanosleep.S b/libc/arch-x86/syscalls/__clock_nanosleep.S
similarity index 93%
rename from libc/arch-x86/syscalls/clock_nanosleep.S
rename to libc/arch-x86/syscalls/__clock_nanosleep.S
index 5e2cc03..75a54d1 100644
--- a/libc/arch-x86/syscalls/clock_nanosleep.S
+++ b/libc/arch-x86/syscalls/__clock_nanosleep.S
@@ -2,7 +2,7 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
+ENTRY(__clock_nanosleep)
pushl %ebx
.cfi_def_cfa_offset 8
.cfi_rel_offset ebx, 0
@@ -33,4 +33,4 @@
popl %ecx
popl %ebx
ret
-END(clock_nanosleep)
+END(__clock_nanosleep)
diff --git a/libc/arch-x86/syscalls/sethostname.S b/libc/arch-x86/syscalls/sethostname.S
new file mode 100644
index 0000000..bfcfd73
--- /dev/null
+++ b/libc/arch-x86/syscalls/sethostname.S
@@ -0,0 +1,26 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <private/bionic_asm.h>
+
+ENTRY(sethostname)
+ pushl %ebx
+ .cfi_def_cfa_offset 8
+ .cfi_rel_offset ebx, 0
+ pushl %ecx
+ .cfi_adjust_cfa_offset 4
+ .cfi_rel_offset ecx, 0
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_sethostname, %eax
+ int $0x80
+ cmpl $-MAX_ERRNO, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno_internal
+ addl $4, %esp
+1:
+ popl %ecx
+ popl %ebx
+ ret
+END(sethostname)
diff --git a/libc/arch-x86_64/include/machine/asm.h b/libc/arch-x86_64/include/machine/asm.h
index 06da39a..28cd08f 100644
--- a/libc/arch-x86_64/include/machine/asm.h
+++ b/libc/arch-x86_64/include/machine/asm.h
@@ -40,13 +40,6 @@
#define PIC_PLT(x) x@PLT
#define PIC_GOT(x) x@GOTPCREL(%rip)
-/* let kernels and others override entrypoint alignment */
-#ifndef _ALIGN_TEXT
-# ifdef _STANDALONE
-# define _ALIGN_TEXT .align 4
-# else
-# define _ALIGN_TEXT .align 16
-# endif
-#endif
+#define __bionic_asm_align 16
#endif /* !_AMD64_ASM_H_ */
diff --git a/libc/arch-x86_64/include/machine/endian.h b/libc/arch-x86_64/include/machine/endian.h
index 7889a37..8a3b0c5 100644
--- a/libc/arch-x86_64/include/machine/endian.h
+++ b/libc/arch-x86_64/include/machine/endian.h
@@ -56,6 +56,7 @@
#endif /* __GNUC__ */
#define _BYTE_ORDER _LITTLE_ENDIAN
+#include <sys/types.h>
#include <sys/endian.h>
#endif /* _MACHINE_ENDIAN_H_ */
diff --git a/libc/arch-x86_64/string/sse2-strlcat-slm.S b/libc/arch-x86_64/string/sse2-strlcat-slm.S
new file mode 100644
index 0000000..d79e8c1
--- /dev/null
+++ b/libc/arch-x86_64/string/sse2-strlcat-slm.S
@@ -0,0 +1,37 @@
+/*
+Copyright (c) 2014, Intel Corporation
+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.
+
+ * Neither the name of Intel Corporation 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 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.
+*/
+
+#define USE_AS_STRLCAT
+
+#ifndef STRLCPY
+# define STRLCPY strlcat
+#endif
+
+#include "sse2-strlcpy-slm.S"
diff --git a/libc/arch-x86_64/string/sse2-strlcpy-slm.S b/libc/arch-x86_64/string/sse2-strlcpy-slm.S
new file mode 100755
index 0000000..9d4b52f
--- /dev/null
+++ b/libc/arch-x86_64/string/sse2-strlcpy-slm.S
@@ -0,0 +1,1062 @@
+/*
+Copyright (c) 2014, Intel Corporation
+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.
+
+ * Neither the name of Intel Corporation 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 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 L
+# define L(label) .L##label
+#endif
+
+#ifndef cfi_startproc
+# define cfi_startproc .cfi_startproc
+#endif
+
+#ifndef cfi_endproc
+# define cfi_endproc .cfi_endproc
+#endif
+
+#ifndef ENTRY
+# define ENTRY(name) \
+ .type name, @function; \
+ .globl name; \
+ .p2align 4; \
+name: \
+ cfi_startproc
+#endif
+
+#ifndef END
+# define END(name) \
+ cfi_endproc; \
+ .size name, .-name
+#endif
+
+
+#ifndef STRLCPY
+# define STRLCPY strlcpy
+#endif
+
+#define JMPTBL(I, B) I - B
+#define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
+ lea TABLE(%rip), %r11; \
+ movslq (%r11, INDEX, SCALE), %rcx; \
+ lea (%r11, %rcx), %rcx; \
+ jmp *%rcx
+
+#define RETURN \
+ add %r9, %rax; \
+ ret
+
+.text
+ENTRY (STRLCPY)
+ xor %rax, %rax
+ xor %r9, %r9
+ mov %rdx, %r8
+ cmp $0, %r8
+ jz L(CalculateSrcLen)
+
+#ifdef USE_AS_STRLCAT
+ xor %rcx, %rcx
+ pxor %xmm0, %xmm0
+
+ movdqu (%rdi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %rdx
+
+ cmp $17, %r8
+ jb L(SizeEndCase1)
+ test %rdx, %rdx
+ jnz L(StringEndCase1)
+
+ add $16, %rax
+ movdqu 16(%rdi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %rdx
+
+ cmp $33, %r8
+ jb L(SizeEndCase1)
+ test %rdx, %rdx
+ jnz L(StringEndCase1)
+
+ mov %rdi, %rcx
+ and $15, %rcx
+ and $-16, %rdi
+
+ add %rcx, %r8
+ sub $16, %r8
+
+L(DstLenLoop):
+ movdqa (%rdi, %rax), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %rdx
+ sub $16, %r8
+ jbe L(SizeEndCase2)
+ test %rdx, %rdx
+ jnz L(StringEndCase2)
+ add $16, %rax
+ jmp L(DstLenLoop)
+
+L(StringEndCase2):
+ add $16, %r8
+ bsf %rdx, %rdx
+ sub %rdx, %r8
+ add %rdx, %rax
+ sub %rcx, %r9
+ add %rax, %rdi
+ jmp L(CopySrcString)
+
+L(SizeEndCase1):
+ test %rdx, %rdx
+ jz L(SizeEnd)
+ bsf %rdx, %rdx
+ add %rdx, %rax
+ cmp %r8, %rax
+ jb L(StringEnd)
+L(SizeEnd):
+ mov %r8, %r9
+ jmp L(CalculateSrcLenCase1)
+
+L(SizeEndCase2):
+ add $16, %r8
+ test %rdx, %rdx
+ jz L(StringEndCase4)
+ bsf %rdx, %rdx
+ cmp %r8, %rdx
+ jb L(StringEndCase3)
+L(StringEndCase4):
+ add %r8, %rax
+ sub %rcx, %rax
+ mov %rax, %r9
+ jmp L(CalculateSrcLenCase1)
+
+L(StringEndCase3):
+ add %rdx, %rax
+ sub %rcx, %r9
+ add %rax, %rdi
+ sub %rdx, %r8
+ jmp L(CopySrcString)
+
+L(StringEndCase1):
+ bsf %rdx, %rdx
+ add %rdx, %rax
+ sub %rcx, %rax
+L(StringEnd):
+ add %rax, %rdi
+ sub %rax, %r8
+#endif
+
+ mov %rsi, %rcx
+ and $63, %rcx
+ cmp $32, %rcx
+ jbe L(CopySrcString)
+
+ and $-16, %rsi
+ and $15, %rcx
+ pxor %xmm0, %xmm0
+ pxor %xmm1, %xmm1
+
+ pcmpeqb (%rsi), %xmm1
+ pmovmskb %xmm1, %rdx
+ shr %cl, %rdx
+ mov $16, %r10
+ sub %rcx, %r10
+ cmp %r10, %r8
+ jbe L(CopyFrom1To16BytesTailCase2OrCase3)
+ test %rdx, %rdx
+ jnz L(CopyFrom1To16BytesTail)
+
+ pcmpeqb 16(%rsi), %xmm0
+ pmovmskb %xmm0, %rdx
+ add $16, %r10
+ cmp %r10, %r8
+ jbe L(CopyFrom1To32BytesCase2OrCase3)
+ test %rdx, %rdx
+ jnz L(CopyFrom1To32Bytes)
+
+ movdqu (%rsi, %rcx), %xmm1
+ movdqu %xmm1, (%rdi)
+#ifdef USE_AS_STRLCAT
+ add %rax, %r9
+#endif
+ jmp L(LoopStart)
+
+ .p2align 4
+L(CopySrcString):
+#ifdef USE_AS_STRLCAT
+ add %rax, %r9
+ xor %rax, %rax
+#endif
+ pxor %xmm0, %xmm0
+ movdqu (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %rdx
+
+ cmp $17, %r8
+ jb L(CopyFrom1To16BytesTail1Case2OrCase3)
+ test %rdx, %rdx
+ jnz L(CopyFrom1To16BytesTail1)
+
+ movdqu 16(%rsi), %xmm2
+ pcmpeqb %xmm2, %xmm0
+ movdqu %xmm1, (%rdi)
+ pmovmskb %xmm0, %rdx
+ add $16, %rax
+
+ cmp $33, %r8
+ jb L(CopyFrom1To32Bytes1Case2OrCase3)
+ test %rdx, %rdx
+ jnz L(CopyFrom1To32Bytes1)
+
+ mov %rsi, %rcx
+ and $15, %rcx
+ and $-16, %rsi
+
+L(LoopStart):
+ sub %rcx, %rdi
+ add %rcx, %r8
+ sub $16, %r8
+ mov $16, %rax
+
+L(16Loop):
+ movdqa (%rsi, %rax), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %rdx
+ sub $16, %r8
+ jbe L(CopyFrom1To16BytesCase2OrCase3)
+ test %rdx, %rdx
+ jnz L(CopyFrom1To16BytesXmmExit)
+ movdqu %xmm1, (%rdi, %rax)
+ add $16, %rax
+ jmp L(16Loop)
+
+/*------End of main part with loops---------------------*/
+
+/* Case1 */
+ .p2align 4
+L(CopyFrom1To16Bytes):
+ add %rcx, %rdi
+ add %rcx, %rsi
+ bsf %rdx, %rdx
+ add %rdx, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitStringTailTable), %rdx, 4)
+
+ .p2align 4
+L(CopyFrom1To16BytesTail):
+ add %rcx, %rsi
+ bsf %rdx, %rdx
+ add %rdx, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitStringTailTable), %rdx, 4)
+
+ .p2align 4
+L(CopyFrom1To32Bytes1):
+ add $16, %rsi
+ add $16, %rdi
+ sub $16, %r8
+L(CopyFrom1To16BytesTail1):
+ bsf %rdx, %rdx
+ add %rdx, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitStringTailTable), %rdx, 4)
+
+ .p2align 4
+L(CopyFrom1To32Bytes):
+ bsf %rdx, %rdx
+ add %rcx, %rsi
+ add $16, %rdx
+ sub %rcx, %rdx
+ add %rdx, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitStringTailTable), %rdx, 4)
+
+ .p2align 4
+L(CopyFrom1To16BytesExit):
+ add %rdx, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitStringTailTable), %rdx, 4)
+
+/* Case2 */
+
+ .p2align 4
+L(CopyFrom1To16BytesCase2):
+ add $16, %r8
+ add %rax, %rdi
+ add %rax, %rsi
+ bsf %rdx, %rdx
+ sub %rcx, %rax
+ cmp %r8, %rdx
+ jb L(CopyFrom1To16BytesExit)
+ add %r8, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitTable), %r8, 4)
+
+ .p2align 4
+L(CopyFrom1To32BytesCase2):
+ add %rcx, %rsi
+ bsf %rdx, %rdx
+ add $16, %rdx
+ sub %rcx, %rdx
+ cmp %r8, %rdx
+ jb L(CopyFrom1To16BytesExit)
+ add %r8, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitTable), %r8, 4)
+
+L(CopyFrom1To16BytesTailCase2):
+ add %rcx, %rsi
+ bsf %rdx, %rdx
+ cmp %r8, %rdx
+ jb L(CopyFrom1To16BytesExit)
+ add %r8, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitTable), %r8, 4)
+
+ .p2align 4
+L(CopyFrom1To16BytesTail1Case2):
+ bsf %rdx, %rdx
+ cmp %r8, %rdx
+ jb L(CopyFrom1To16BytesExit)
+ add %r8, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitTable), %r8, 4)
+
+/* Case2 or Case3, Case3 */
+
+ .p2align 4
+L(CopyFrom1To16BytesCase2OrCase3):
+ test %rdx, %rdx
+ jnz L(CopyFrom1To16BytesCase2)
+ add $16, %r8
+ add %rax, %rdi
+ add %rax, %rsi
+ add %r8, %rax
+ sub %rcx, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitTable), %r8, 4)
+
+ .p2align 4
+L(CopyFrom1To32BytesCase2OrCase3):
+ test %rdx, %rdx
+ jnz L(CopyFrom1To32BytesCase2)
+ add %rcx, %rsi
+ add %r8, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitTable), %r8, 4)
+
+ .p2align 4
+L(CopyFrom1To16BytesTailCase2OrCase3):
+ test %rdx, %rdx
+ jnz L(CopyFrom1To16BytesTailCase2)
+ add %rcx, %rsi
+ add %r8, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitTable), %r8, 4)
+
+ .p2align 4
+L(CopyFrom1To32Bytes1Case2OrCase3):
+ add $16, %rdi
+ add $16, %rsi
+ sub $16, %r8
+L(CopyFrom1To16BytesTail1Case2OrCase3):
+ test %rdx, %rdx
+ jnz L(CopyFrom1To16BytesTail1Case2)
+ add %r8, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitTable), %r8, 4)
+
+ .p2align 4
+L(CopyFrom1To16BytesXmmExit):
+ bsf %rdx, %rdx
+ add %rax, %rdi
+ add %rax, %rsi
+ add %rdx, %rax
+ sub %rcx, %rax
+ BRANCH_TO_JMPTBL_ENTRY (L(ExitStringTailTable), %rdx, 4)
+
+/*------------End labels regarding with copying 1-16 bytes--and 1-32 bytes----*/
+
+
+ .p2align 4
+L(Exit0):
+ RETURN
+
+ .p2align 4
+L(Exit1):
+ movb $0, (%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit2):
+ movb (%rsi), %dh
+ movb %dh, (%rdi)
+ movb $0, 1(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit3):
+ movw (%rsi), %dx
+ movw %dx, (%rdi)
+ movb $0, 2(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit4):
+ movw (%rsi), %cx
+ movb 2(%rsi), %dh
+ movw %cx, (%rdi)
+ movb %dh, 2(%rdi)
+ movb $0, 3(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit5):
+ movl (%rsi), %edx
+ movl %edx, (%rdi)
+ movb $0, 4(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit6):
+ movl (%rsi), %ecx
+ movb 4(%rsi), %dh
+ movl %ecx, (%rdi)
+ movb %dh, 4(%rdi)
+ movb $0, 5(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit7):
+ movl (%rsi), %ecx
+ movw 4(%rsi), %dx
+ movl %ecx, (%rdi)
+ movw %dx, 4(%rdi)
+ movb $0, 6(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit8):
+ movl (%rsi), %ecx
+ movl 3(%rsi), %edx
+ movl %ecx, (%rdi)
+ movl %edx, 3(%rdi)
+ movb $0, 7(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit9):
+ movq (%rsi), %rdx
+ movq %rdx, (%rdi)
+ movb $0, 8(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit10):
+ movq (%rsi), %rcx
+ movb 8(%rsi), %dh
+ movq %rcx, (%rdi)
+ movb %dh, 8(%rdi)
+ movb $0, 9(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit11):
+ movq (%rsi), %rcx
+ movw 8(%rsi), %dx
+ movq %rcx, (%rdi)
+ movw %dx, 8(%rdi)
+ movb $0, 10(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit12):
+ movq (%rsi), %rcx
+ movl 7(%rsi), %edx
+ movq %rcx, (%rdi)
+ movl %edx, 7(%rdi)
+ movb $0, 11(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit13):
+ movq (%rsi), %rcx
+ movl 8(%rsi), %edx
+ movq %rcx, (%rdi)
+ movl %edx, 8(%rdi)
+ movb $0, 12(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit14):
+ movq (%rsi), %rcx
+ movq 5(%rsi), %rdx
+ movq %rcx, (%rdi)
+ movq %rdx, 5(%rdi)
+ movb $0, 13(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit15):
+ movq (%rsi), %rcx
+ movq 6(%rsi), %rdx
+ movq %rcx, (%rdi)
+ movq %rdx, 6(%rdi)
+ movb $0, 14(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit16):
+ movq (%rsi), %rcx
+ movq 7(%rsi), %rdx
+ movq %rcx, (%rdi)
+ movq %rdx, 7(%rdi)
+ movb $0, 15(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit17):
+ movdqu (%rsi), %xmm0
+ movdqu %xmm0, (%rdi)
+ movb $0, 16(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit18):
+ movdqu (%rsi), %xmm0
+ movb 16(%rsi), %dh
+ movdqu %xmm0, (%rdi)
+ movb %dh, 16(%rdi)
+ movb $0, 17(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit19):
+ movdqu (%rsi), %xmm0
+ movw 16(%rsi), %cx
+ movdqu %xmm0, (%rdi)
+ movw %cx, 16(%rdi)
+ movb $0, 18(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit20):
+ movdqu (%rsi), %xmm0
+ movl 15(%rsi), %ecx
+ movdqu %xmm0, (%rdi)
+ movl %ecx, 15(%rdi)
+ movb $0, 19(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit21):
+ movdqu (%rsi), %xmm0
+ movl 16(%rsi), %ecx
+ movdqu %xmm0, (%rdi)
+ movl %ecx, 16(%rdi)
+ movb $0, 20(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit22):
+ movdqu (%rsi), %xmm0
+ movl 16(%rsi), %ecx
+ movb 20(%rsi), %dh
+ movdqu %xmm0, (%rdi)
+ movl %ecx, 16(%rdi)
+ movb %dh, 20(%rdi)
+ movb $0, 21(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit23):
+ movdqu (%rsi), %xmm0
+ movq 14(%rsi), %rcx
+ movdqu %xmm0, (%rdi)
+ movq %rcx, 14(%rdi)
+ movb $0, 22(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit24):
+ movdqu (%rsi), %xmm0
+ movq 15(%rsi), %rcx
+ movdqu %xmm0, (%rdi)
+ movq %rcx, 15(%rdi)
+ movb $0, 23(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit25):
+ movdqu (%rsi), %xmm0
+ movq 16(%rsi), %rcx
+ movdqu %xmm0, (%rdi)
+ movq %rcx, 16(%rdi)
+ movb $0, 24(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit26):
+ movdqu (%rsi), %xmm0
+ movq 16(%rsi), %rcx
+ movb 24(%rsi), %dh
+ movdqu %xmm0, (%rdi)
+ movq %rcx, 16(%rdi)
+ mov %dh, 24(%rdi)
+ movb $0, 25(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit27):
+ movdqu (%rsi), %xmm0
+ movq 16(%rsi), %rdx
+ movw 24(%rsi), %cx
+ movdqu %xmm0, (%rdi)
+ movq %rdx, 16(%rdi)
+ movw %cx, 24(%rdi)
+ movb $0, 26(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit28):
+ movdqu (%rsi), %xmm0
+ movq 16(%rsi), %rdx
+ movl 23(%rsi), %ecx
+ movdqu %xmm0, (%rdi)
+ movq %rdx, 16(%rdi)
+ movl %ecx, 23(%rdi)
+ movb $0, 27(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit29):
+ movdqu (%rsi), %xmm0
+ movq 16(%rsi), %rdx
+ movl 24(%rsi), %ecx
+ movdqu %xmm0, (%rdi)
+ movq %rdx, 16(%rdi)
+ movl %ecx, 24(%rdi)
+ movb $0, 28(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit30):
+ movdqu (%rsi), %xmm0
+ movdqu 13(%rsi), %xmm2
+ movdqu %xmm0, (%rdi)
+ movdqu %xmm2, 13(%rdi)
+ movb $0, 29(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit31):
+ movdqu (%rsi), %xmm0
+ movdqu 14(%rsi), %xmm2
+ movdqu %xmm0, (%rdi)
+ movdqu %xmm2, 14(%rdi)
+ movb $0, 30(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(Exit32):
+ movdqu (%rsi), %xmm0
+ movdqu 15(%rsi), %xmm2
+ movdqu %xmm0, (%rdi)
+ movdqu %xmm2, 15(%rdi)
+ movb $0, 31(%rdi)
+ jmp L(CalculateSrcLen)
+
+ .p2align 4
+L(StringTail0):
+ mov (%rsi), %dl
+ mov %dl, (%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail1):
+ mov (%rsi), %dx
+ mov %dx, (%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail2):
+ mov (%rsi), %cx
+ mov 2(%rsi), %dl
+ mov %cx, (%rdi)
+ mov %dl, 2(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail3):
+ mov (%rsi), %edx
+ mov %edx, (%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail4):
+ mov (%rsi), %ecx
+ mov 4(%rsi), %dl
+ mov %ecx, (%rdi)
+ mov %dl, 4(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail5):
+ mov (%rsi), %ecx
+ mov 4(%rsi), %dx
+ mov %ecx, (%rdi)
+ mov %dx, 4(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail6):
+ mov (%rsi), %ecx
+ mov 3(%rsi), %edx
+ mov %ecx, (%rdi)
+ mov %edx, 3(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail7):
+ mov (%rsi), %rdx
+ mov %rdx, (%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail8):
+ mov (%rsi), %rcx
+ mov 8(%rsi), %dl
+ mov %rcx, (%rdi)
+ mov %dl, 8(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail9):
+ mov (%rsi), %rcx
+ mov 8(%rsi), %dx
+ mov %rcx, (%rdi)
+ mov %dx, 8(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail10):
+ mov (%rsi), %rcx
+ mov 7(%rsi), %edx
+ mov %rcx, (%rdi)
+ mov %edx, 7(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail11):
+ mov (%rsi), %rcx
+ mov 8(%rsi), %edx
+ mov %rcx, (%rdi)
+ mov %edx, 8(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail12):
+ mov (%rsi), %rcx
+ mov 5(%rsi), %rdx
+ mov %rcx, (%rdi)
+ mov %rdx, 5(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail13):
+ mov (%rsi), %rcx
+ mov 6(%rsi), %rdx
+ mov %rcx, (%rdi)
+ mov %rdx, 6(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail14):
+ mov (%rsi), %rcx
+ mov 7(%rsi), %rdx
+ mov %rcx, (%rdi)
+ mov %rdx, 7(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail15):
+ movdqu (%rsi), %xmm0
+ movdqu %xmm0, (%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail16):
+ movdqu (%rsi), %xmm0
+ mov 16(%rsi), %cl
+ movdqu %xmm0, (%rdi)
+ mov %cl, 16(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail17):
+ movdqu (%rsi), %xmm0
+ mov 16(%rsi), %cx
+ movdqu %xmm0, (%rdi)
+ mov %cx, 16(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail18):
+ movdqu (%rsi), %xmm0
+ mov 15(%rsi), %ecx
+ movdqu %xmm0, (%rdi)
+ mov %ecx, 15(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail19):
+ movdqu (%rsi), %xmm0
+ mov 16(%rsi), %ecx
+ movdqu %xmm0, (%rdi)
+ mov %ecx, 16(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail20):
+ movdqu (%rsi), %xmm0
+ mov 16(%rsi), %ecx
+ mov 20(%rsi), %dl
+ movdqu %xmm0, (%rdi)
+ mov %ecx, 16(%rdi)
+ mov %dl, 20(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail21):
+ movdqu (%rsi), %xmm0
+ mov 14(%rsi), %rcx
+ movdqu %xmm0, (%rdi)
+ mov %rcx, 14(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail22):
+ movdqu (%rsi), %xmm0
+ mov 15(%rsi), %rcx
+ movdqu %xmm0, (%rdi)
+ mov %rcx, 15(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail23):
+ movdqu (%rsi), %xmm0
+ mov 16(%rsi), %rcx
+ movdqu %xmm0, (%rdi)
+ mov %rcx, 16(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail24):
+ movdqu (%rsi), %xmm0
+ mov 16(%rsi), %rdx
+ mov 24(%rsi), %cl
+ movdqu %xmm0, (%rdi)
+ mov %rdx, 16(%rdi)
+ mov %cl, 24(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail25):
+ movdqu (%rsi), %xmm0
+ mov 16(%rsi), %rdx
+ mov 24(%rsi), %cx
+ movdqu %xmm0, (%rdi)
+ mov %rdx, 16(%rdi)
+ mov %cx, 24(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail26):
+ movdqu (%rsi), %xmm0
+ mov 16(%rsi), %rdx
+ mov 23(%rsi), %ecx
+ movdqu %xmm0, (%rdi)
+ mov %rdx, 16(%rdi)
+ mov %ecx, 23(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail27):
+ movdqu (%rsi), %xmm0
+ mov 16(%rsi), %rdx
+ mov 24(%rsi), %ecx
+ movdqu %xmm0, (%rdi)
+ mov %rdx, 16(%rdi)
+ mov %ecx, 24(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail28):
+ movdqu (%rsi), %xmm0
+ movdqu 13(%rsi), %xmm2
+ movdqu %xmm0, (%rdi)
+ movdqu %xmm2, 13(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail29):
+ movdqu (%rsi), %xmm0
+ movdqu 14(%rsi), %xmm2
+ movdqu %xmm0, (%rdi)
+ movdqu %xmm2, 14(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail30):
+ movdqu (%rsi), %xmm0
+ movdqu 15(%rsi), %xmm2
+ movdqu %xmm0, (%rdi)
+ movdqu %xmm2, 15(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail31):
+ movdqu (%rsi), %xmm0
+ movdqu 16(%rsi), %xmm2
+ movdqu %xmm0, (%rdi)
+ movdqu %xmm2, 16(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail32):
+ movdqu (%rsi), %xmm0
+ movdqu 16(%rsi), %xmm2
+ mov 32(%rsi), %cl
+ movdqu %xmm0, (%rdi)
+ movdqu %xmm2, 16(%rdi)
+ mov %cl, 32(%rdi)
+ RETURN
+
+ .p2align 4
+L(StringTail33):
+ movdqu (%rsi), %xmm0
+ movdqu 16(%rsi), %xmm2
+ mov 32(%rsi), %cl
+ movdqu %xmm0, (%rdi)
+ movdqu %xmm2, 16(%rdi)
+ mov %cl, 32(%rdi)
+ RETURN
+
+ .p2align 4
+L(CalculateSrcLenCase1):
+ xor %r8, %r8
+ xor %rax, %rax
+L(CalculateSrcLen):
+ pxor %xmm0, %xmm0
+ xor %rcx, %rcx
+ add %r8, %rsi
+ movdqu (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %rdx
+ test %rdx, %rdx
+ jnz L(SrcLenLoopEnd)
+
+ add %rax, %r9
+ mov $16, %rax
+ mov %rsi, %rcx
+ and $15, %rcx
+ and $-16, %rsi
+L(SrcLenLoop):
+ movdqa (%rsi, %rax), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %rdx
+ test %rdx, %rdx
+ jnz L(SrcLenLoopEnd)
+ add $16, %rax
+ jmp L(SrcLenLoop)
+
+ .p2align 4
+L(SrcLenLoopEnd):
+ bsf %rdx, %rdx
+ add %rdx, %rax
+ sub %rcx, %rax
+ RETURN
+
+END (STRLCPY)
+
+ .p2align 4
+ .section .rodata
+L(ExitTable):
+ .int JMPTBL(L(Exit0), L(ExitTable))
+ .int JMPTBL(L(Exit1), L(ExitTable))
+ .int JMPTBL(L(Exit2), L(ExitTable))
+ .int JMPTBL(L(Exit3), L(ExitTable))
+ .int JMPTBL(L(Exit4), L(ExitTable))
+ .int JMPTBL(L(Exit5), L(ExitTable))
+ .int JMPTBL(L(Exit6), L(ExitTable))
+ .int JMPTBL(L(Exit7), L(ExitTable))
+ .int JMPTBL(L(Exit8), L(ExitTable))
+ .int JMPTBL(L(Exit9), L(ExitTable))
+ .int JMPTBL(L(Exit10), L(ExitTable))
+ .int JMPTBL(L(Exit11), L(ExitTable))
+ .int JMPTBL(L(Exit12), L(ExitTable))
+ .int JMPTBL(L(Exit13), L(ExitTable))
+ .int JMPTBL(L(Exit14), L(ExitTable))
+ .int JMPTBL(L(Exit15), L(ExitTable))
+ .int JMPTBL(L(Exit16), L(ExitTable))
+ .int JMPTBL(L(Exit17), L(ExitTable))
+ .int JMPTBL(L(Exit18), L(ExitTable))
+ .int JMPTBL(L(Exit19), L(ExitTable))
+ .int JMPTBL(L(Exit20), L(ExitTable))
+ .int JMPTBL(L(Exit21), L(ExitTable))
+ .int JMPTBL(L(Exit22), L(ExitTable))
+ .int JMPTBL(L(Exit23), L(ExitTable))
+ .int JMPTBL(L(Exit24), L(ExitTable))
+ .int JMPTBL(L(Exit25), L(ExitTable))
+ .int JMPTBL(L(Exit26), L(ExitTable))
+ .int JMPTBL(L(Exit27), L(ExitTable))
+ .int JMPTBL(L(Exit28), L(ExitTable))
+ .int JMPTBL(L(Exit29), L(ExitTable))
+ .int JMPTBL(L(Exit30), L(ExitTable))
+ .int JMPTBL(L(Exit31), L(ExitTable))
+ .int JMPTBL(L(Exit32), L(ExitTable))
+L(ExitStringTailTable):
+ .int JMPTBL(L(StringTail0), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail1), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail2), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail3), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail4), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail5), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail6), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail7), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail8), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail9), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail10), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail11), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail12), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail13), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail14), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail15), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail16), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail17), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail18), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail19), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail20), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail21), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail22), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail23), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail24), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail25), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail26), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail27), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail28), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail29), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail30), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail31), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail32), L(ExitStringTailTable))
+ .int JMPTBL(L(StringTail33), L(ExitStringTailTable))
diff --git a/libc/arch-x86_64/syscalls/clock_nanosleep.S b/libc/arch-x86_64/syscalls/__clock_nanosleep.S
similarity index 79%
rename from libc/arch-x86_64/syscalls/clock_nanosleep.S
rename to libc/arch-x86_64/syscalls/__clock_nanosleep.S
index 2a79bdd..37726c0 100644
--- a/libc/arch-x86_64/syscalls/clock_nanosleep.S
+++ b/libc/arch-x86_64/syscalls/__clock_nanosleep.S
@@ -2,7 +2,7 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
+ENTRY(__clock_nanosleep)
movq %rcx, %r10
movl $__NR_clock_nanosleep, %eax
syscall
@@ -13,4 +13,5 @@
call __set_errno_internal
1:
ret
-END(clock_nanosleep)
+END(__clock_nanosleep)
+.hidden __clock_nanosleep
diff --git a/libc/arch-x86_64/syscalls/clock_nanosleep.S b/libc/arch-x86_64/syscalls/sethostname.S
similarity index 67%
copy from libc/arch-x86_64/syscalls/clock_nanosleep.S
copy to libc/arch-x86_64/syscalls/sethostname.S
index 2a79bdd..4bcd12d 100644
--- a/libc/arch-x86_64/syscalls/clock_nanosleep.S
+++ b/libc/arch-x86_64/syscalls/sethostname.S
@@ -2,9 +2,8 @@
#include <private/bionic_asm.h>
-ENTRY(clock_nanosleep)
- movq %rcx, %r10
- movl $__NR_clock_nanosleep, %eax
+ENTRY(sethostname)
+ movl $__NR_sethostname, %eax
syscall
cmpq $-MAX_ERRNO, %rax
jb 1f
@@ -13,4 +12,4 @@
call __set_errno_internal
1:
ret
-END(clock_nanosleep)
+END(sethostname)
diff --git a/libc/arch-x86_64/x86_64.mk b/libc/arch-x86_64/x86_64.mk
index 8675ef4..00a3763 100644
--- a/libc/arch-x86_64/x86_64.mk
+++ b/libc/arch-x86_64/x86_64.mk
@@ -25,10 +25,6 @@
upstream-freebsd/lib/libc/string/wmemcmp.c \
upstream-freebsd/lib/libc/string/wmemmove.c \
-libc_openbsd_src_files_x86_64 += \
- upstream-openbsd/lib/libc/string/strlcat.c \
- upstream-openbsd/lib/libc/string/strlcpy.c \
-
#
# Inherently architecture-specific code.
#
@@ -56,6 +52,8 @@
arch-x86_64/string/sse2-stpncpy-slm.S \
arch-x86_64/string/sse2-strcat-slm.S \
arch-x86_64/string/sse2-strcpy-slm.S \
+ arch-x86_64/string/sse2-strlcat-slm.S \
+ arch-x86_64/string/sse2-strlcpy-slm.S \
arch-x86_64/string/sse2-strlen-slm.S \
arch-x86_64/string/sse2-strncat-slm.S \
arch-x86_64/string/sse2-strncpy-slm.S \
diff --git a/libc/bionic/strxfrm_l.cpp b/libc/bionic/__gnu_basename.cpp
similarity index 88%
rename from libc/bionic/strxfrm_l.cpp
rename to libc/bionic/__gnu_basename.cpp
index afe3b96..1eb3f65 100644
--- a/libc/bionic/strxfrm_l.cpp
+++ b/libc/bionic/__gnu_basename.cpp
@@ -26,8 +26,10 @@
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE 1
#include <string.h>
-size_t strxfrm_l(char *dest, const char *src, size_t n, locale_t) {
- return strxfrm(dest, src, n);
+extern "C" const char* __gnu_basename(const char* path) {
+ const char* last_slash = strrchr(path, '/');
+ return (last_slash != NULL) ? last_slash + 1 : path;
}
diff --git a/libc/bionic/bionic_systrace.cpp b/libc/bionic/bionic_systrace.cpp
new file mode 100644
index 0000000..f5be415
--- /dev/null
+++ b/libc/bionic/bionic_systrace.cpp
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <cutils/trace.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "private/bionic_systrace.h"
+#include "private/libc_logging.h"
+
+#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
+#include <sys/_system_properties.h>
+
+#define WRITE_OFFSET 32
+
+static const prop_info* g_pinfo = NULL;
+static uint32_t g_serial = -1;
+static uint64_t g_tags = 0;
+static int g_trace_marker_fd = -1;
+
+static bool should_trace() {
+ // If g_pinfo is null, this means that systrace hasn't been run and it's safe to
+ // assume that no trace writing will need to take place. However, to avoid running
+ // this costly find check each time, we set it to a non-tracing value so that next
+ // time, it will just check the serial to see if the value has been changed.
+ // this function also deals with the bootup case, during which the call to property
+ // set will fail if the property server hasn't yet started.
+ if (g_pinfo == NULL) {
+ g_pinfo = __system_property_find("debug.atrace.tags.enableflags");
+ if (g_pinfo == NULL) {
+ __system_property_set("debug.atrace.tags.enableflags", "0");
+ g_pinfo = __system_property_find("debug.atrace.tags.enableflags");
+ if (g_pinfo == NULL) {
+ return false;
+ }
+ }
+ }
+
+ // Find out which tags have been enabled on the command line and set
+ // the value of tags accordingly. If the value of the property changes,
+ // the serial will also change, so the costly system_property_read function
+ // can be avoided by calling the much cheaper system_property_serial
+ // first. The values within pinfo may change, but its location is guaranteed
+ // not to move.
+ const uint32_t cur_serial = __system_property_serial(g_pinfo);
+ if (cur_serial != g_serial) {
+ g_serial = cur_serial;
+ char value[PROP_VALUE_MAX];
+ __system_property_read(g_pinfo, 0, value);
+ g_tags = strtoull(value, NULL, 0);
+ }
+
+ // Finally, verify that this tag value enables bionic tracing.
+ return ((g_tags & ATRACE_TAG_BIONIC) != 0);
+}
+
+ScopedTrace::ScopedTrace(const char* message) {
+ if (!should_trace()) {
+ return;
+ }
+
+ if (g_trace_marker_fd == -1) {
+ g_trace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_CLOEXEC | O_WRONLY);
+ if (g_trace_marker_fd == -1) {
+ __libc_fatal("Could not open kernel trace file: %s\n", strerror(errno));
+ }
+ }
+
+ // If bionic tracing has been enabled, then write the message to the
+ // kernel trace_marker.
+ int length = strlen(message);
+ char buf[length + WRITE_OFFSET];
+ size_t len = snprintf(buf, length + WRITE_OFFSET, "B|%d|%s", getpid(), message);
+ ssize_t wbytes = TEMP_FAILURE_RETRY(write(g_trace_marker_fd, buf, len));
+
+ // Error while writing
+ if (static_cast<size_t>(wbytes) != len) {
+ __libc_fatal("Could not write to kernel trace file: %s\n", strerror(errno));
+ }
+}
+
+ScopedTrace::~ScopedTrace() {
+ if (!should_trace()) {
+ return;
+ }
+
+ ssize_t wbytes = TEMP_FAILURE_RETRY(write(g_trace_marker_fd, "E", 1));
+
+ // Error while writing
+ if (static_cast<size_t>(wbytes) != 1) {
+ __libc_fatal("Could not write to kernel trace file: %s\n", strerror(errno));
+ }
+}
diff --git a/libc/bionic/bionic_time_conversions.cpp b/libc/bionic/bionic_time_conversions.cpp
index 7f3c026..75e8d49 100644
--- a/libc/bionic/bionic_time_conversions.cpp
+++ b/libc/bionic/bionic_time_conversions.cpp
@@ -28,6 +28,8 @@
#include "private/bionic_time_conversions.h"
+#include "private/bionic_constants.h"
+
bool timespec_from_timeval(timespec& ts, const timeval& tv) {
// Whole seconds can just be copied.
ts.tv_sec = tv.tv_sec;
@@ -49,3 +51,19 @@
tv.tv_sec = ts.tv_sec;
tv.tv_usec = ts.tv_nsec / 1000;
}
+
+// Initializes 'ts' with the difference between 'abs_ts' and the current time
+// according to 'clock'. Returns false if abstime already expired, true otherwise.
+bool timespec_from_absolute_timespec(timespec& ts, const timespec& abs_ts, clockid_t clock) {
+ clock_gettime(clock, &ts);
+ ts.tv_sec = abs_ts.tv_sec - ts.tv_sec;
+ ts.tv_nsec = abs_ts.tv_nsec - ts.tv_nsec;
+ if (ts.tv_nsec < 0) {
+ ts.tv_sec--;
+ ts.tv_nsec += NS_PER_S;
+ }
+ if (ts.tv_nsec < 0 || ts.tv_sec < 0) {
+ return false;
+ }
+ return true;
+}
diff --git a/libc/bionic/clock.cpp b/libc/bionic/clock.cpp
index 5bd32f9..053e9e7 100644
--- a/libc/bionic/clock.cpp
+++ b/libc/bionic/clock.cpp
@@ -30,7 +30,7 @@
#include <sys/sysconf.h>
#include <sys/times.h>
-#define NS_PER_S 1000000000 // No "private/bionic_constants.h" in lmp-dev.
+#include "private/bionic_constants.h"
// http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock.html
clock_t clock() {
diff --git a/libc/bionic/strftime_l.cpp b/libc/bionic/clock_getcpuclockid.cpp
similarity index 72%
copy from libc/bionic/strftime_l.cpp
copy to libc/bionic/clock_getcpuclockid.cpp
index fb01da5..5511eb4 100644
--- a/libc/bionic/strftime_l.cpp
+++ b/libc/bionic/clock_getcpuclockid.cpp
@@ -26,9 +26,25 @@
* SUCH DAMAGE.
*/
+#include <errno.h>
#include <time.h>
-size_t strftime_l(char *s, size_t max, const char *format, const struct tm *tm,
- locale_t) {
- return strftime(s, max, format, tm);
+#include "private/ErrnoRestorer.h"
+
+int clock_getcpuclockid(pid_t pid, clockid_t* clockid) {
+ ErrnoRestorer errno_restorer;
+
+ // The tid is stored in the top bits, but negated.
+ clockid_t result = ~static_cast<clockid_t>(pid) << 3;
+ // Bits 0 and 1: clock type (0 = CPUCLOCK_PROF, 1 = CPUCLOCK_VIRT, 2 = CPUCLOCK_SCHED).
+ result |= 2;
+ // Bit 2: thread (set) or process (clear). Bit 2 already 0.
+
+ timespec ts;
+ if (clock_getres(result, &ts) == -1) {
+ return ESRCH;
+ }
+
+ *clockid = result;
+ return 0;
}
diff --git a/libc/bionic/strftime_l.cpp b/libc/bionic/clock_nanosleep.cpp
similarity index 81%
rename from libc/bionic/strftime_l.cpp
rename to libc/bionic/clock_nanosleep.cpp
index fb01da5..15b8fe7 100644
--- a/libc/bionic/strftime_l.cpp
+++ b/libc/bionic/clock_nanosleep.cpp
@@ -28,7 +28,11 @@
#include <time.h>
-size_t strftime_l(char *s, size_t max, const char *format, const struct tm *tm,
- locale_t) {
- return strftime(s, max, format, tm);
+#include "private/ErrnoRestorer.h"
+
+extern "C" int __clock_nanosleep(clockid_t, int, const timespec*, timespec*);
+
+int clock_nanosleep(clockid_t clock_id, int flags, const timespec* in, timespec* out) {
+ ErrnoRestorer errno_restorer;
+ return (__clock_nanosleep(clock_id, flags, in, out) == 0) ? 0 : errno;
}
diff --git a/libc/bionic/clone.cpp b/libc/bionic/clone.cpp
index 0a0fdd5..9b5c9e7 100644
--- a/libc/bionic/clone.cpp
+++ b/libc/bionic/clone.cpp
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
-#define __GNU_SOURCE 1
+#define _GNU_SOURCE 1
#include <sched.h>
#include <stdlib.h>
#include <stdarg.h>
diff --git a/libc/bionic/daemon.c b/libc/bionic/daemon.c
deleted file mode 100644
index 8181d16..0000000
--- a/libc/bionic/daemon.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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 <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-int daemon( int nochdir, int noclose )
-{
- pid_t pid;
-
- if ( !nochdir && chdir("/") != 0 )
- return -1;
-
- if ( !noclose )
- {
- int fd = open("/dev/null", O_RDWR);
-
- if ( fd < 0 )
- return -1;
-
- if ( dup2( fd, 0 ) < 0 ||
- dup2( fd, 1 ) < 0 ||
- dup2( fd, 2 ) < 0 )
- {
- close(fd);
- return -1;
- }
- close(fd);
- }
-
- pid = fork();
- if (pid < 0)
- return -1;
-
- if (pid > 0)
- _exit(0);
-
- if ( setsid() < 0 )
- return -1;
-
- return 0;
-}
-
diff --git a/libc/bionic/debug_mapinfo.cpp b/libc/bionic/debug_mapinfo.cpp
index d83799a..698ab6b 100644
--- a/libc/bionic/debug_mapinfo.cpp
+++ b/libc/bionic/debug_mapinfo.cpp
@@ -71,7 +71,7 @@
struct mapinfo_t* milist = NULL;
char data[1024]; // Used to read lines as well as to construct the filename.
snprintf(data, sizeof(data), "/proc/%d/maps", pid);
- FILE* fp = fopen(data, "r");
+ FILE* fp = fopen(data, "re");
if (fp != NULL) {
while (fgets(data, sizeof(data), fp) != NULL) {
mapinfo_t* mi = parse_maps_line(data);
diff --git a/libc/bionic/dirent.cpp b/libc/bionic/dirent.cpp
index 7abc7f3..6d87097 100644
--- a/libc/bionic/dirent.cpp
+++ b/libc/bionic/dirent.cpp
@@ -43,6 +43,7 @@
int fd_;
size_t available_bytes_;
dirent* next_;
+ long current_pos_;
pthread_mutex_t mutex_;
dirent buff_[15];
};
@@ -55,6 +56,7 @@
d->fd_ = fd;
d->available_bytes_ = 0;
d->next_ = NULL;
+ d->current_pos_ = 0L;
pthread_mutex_init(&d->mutex_, NULL);
return d;
}
@@ -78,7 +80,7 @@
}
DIR* opendir(const char* path) {
- int fd = open(path, O_RDONLY | O_DIRECTORY);
+ int fd = open(path, O_CLOEXEC | O_DIRECTORY | O_RDONLY);
return (fd != -1) ? __allocate_DIR(fd) : NULL;
}
@@ -100,6 +102,9 @@
dirent* entry = d->next_;
d->next_ = reinterpret_cast<dirent*>(reinterpret_cast<char*>(entry) + entry->d_reclen);
d->available_bytes_ -= entry->d_reclen;
+ // The directory entry offset uses 0, 1, 2 instead of real file offset,
+ // so the value range of long type is enough.
+ d->current_pos_ = static_cast<long>(entry->d_off);
return entry;
}
@@ -146,6 +151,20 @@
ScopedPthreadMutexLocker locker(&d->mutex_);
lseek(d->fd_, 0, SEEK_SET);
d->available_bytes_ = 0;
+ d->current_pos_ = 0L;
+}
+
+void seekdir(DIR* d, long offset) {
+ ScopedPthreadMutexLocker locker(&d->mutex_);
+ off_t ret = lseek(d->fd_, offset, SEEK_SET);
+ if (ret != -1L) {
+ d->available_bytes_ = 0;
+ d->current_pos_ = ret;
+ }
+}
+
+long telldir(DIR* d) {
+ return d->current_pos_;
}
int alphasort(const dirent** a, const dirent** b) {
diff --git a/libc/bionic/dlmalloc.c b/libc/bionic/dlmalloc.c
index e89c5d1..5853e7c 100644
--- a/libc/bionic/dlmalloc.c
+++ b/libc/bionic/dlmalloc.c
@@ -16,6 +16,7 @@
#include "dlmalloc.h"
+#include "malloc.h"
#include "private/bionic_prctl.h"
#include "private/libc_logging.h"
@@ -54,3 +55,25 @@
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map, length, "libc_malloc");
return map;
}
+
+// Since dlmalloc isn't the default, we'll leave this unimplemented for now. If
+// we decide we need it later, we can fill it in.
+size_t __mallinfo_narenas() {
+ return 0;
+}
+
+size_t __mallinfo_nbins() {
+ return 0;
+}
+
+struct mallinfo __mallinfo_arena_info(size_t aidx __unused) {
+ struct mallinfo mi;
+ memset(&mi, 0, sizeof(mi));
+ return mi;
+}
+
+struct mallinfo __mallinfo_bin_info(size_t aidx __unused, size_t bidx __unused) {
+ struct mallinfo mi;
+ memset(&mi, 0, sizeof(mi));
+ return mi;
+}
diff --git a/libc/bionic/err.c b/libc/bionic/err.c
deleted file mode 100644
index 84a3d85..0000000
--- a/libc/bionic/err.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * Copyright (c) 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.
- */
-
-#include <sys/cdefs.h>
-#include <err.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-
-extern const char* __progname;
-
-__noreturn void
-err(int eval, const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- verr(eval, fmt, ap);
- va_end(ap);
-}
-
-__noreturn void
-errx(int eval, const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- verrx(eval, fmt, ap);
- va_end(ap);
-}
-
-__noreturn void
-verr(int eval, const char *fmt, va_list ap)
-{
- int sverrno;
-
- sverrno = errno;
- (void)fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL) {
- (void)vfprintf(stderr, fmt, ap);
- (void)fprintf(stderr, ": ");
- }
- (void)fprintf(stderr, "%s\n", strerror(sverrno));
- exit(eval);
-}
-
-
-__noreturn void
-verrx(int eval, const char *fmt, va_list ap)
-{
- (void)fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL)
- (void)vfprintf(stderr, fmt, ap);
- (void)fprintf(stderr, "\n");
- exit(eval);
-}
-
-void
-warn(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- vwarn(fmt, ap);
- va_end(ap);
-}
-
-void
-warnx(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- vwarnx(fmt, ap);
- va_end(ap);
-}
-
-void
-vwarn(const char *fmt, va_list ap)
-{
- int sverrno;
-
- sverrno = errno;
- (void)fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL) {
- (void)vfprintf(stderr, fmt, ap);
- (void)fprintf(stderr, ": ");
- }
- (void)fprintf(stderr, "%s\n", strerror(sverrno));
-}
-
-void
-vwarnx(const char *fmt, va_list ap)
-{
- (void)fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL)
- (void)vfprintf(stderr, fmt, ap);
- (void)fprintf(stderr, "\n");
-}
diff --git a/libc/bionic/fts.c b/libc/bionic/fts.c
index c491b6a..31a4b2f 100644
--- a/libc/bionic/fts.c
+++ b/libc/bionic/fts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fts.c,v 1.46 2014/05/25 17:47:04 tedu Exp $ */
+/* $OpenBSD: fts.c,v 1.48 2014/11/20 04:14:15 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -49,11 +49,12 @@
static void fts_padjust(FTS *, FTSENT *);
static int fts_palloc(FTS *, size_t);
static FTSENT *fts_sort(FTS *, FTSENT *, int);
-static u_short fts_stat(FTS *, FTSENT *, int);
+static u_short fts_stat(FTS *, FTSENT *, int, int);
static int fts_safe_changedir(FTS *, FTSENT *, int, char *);
#define ALIGNBYTES (sizeof(uintptr_t) - 1)
#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) &~ ALIGNBYTES)
+void* reallocarray(void*, size_t, size_t);
#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
@@ -119,7 +120,7 @@
p->fts_level = FTS_ROOTLEVEL;
p->fts_parent = parent;
p->fts_accpath = p->fts_name;
- p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
+ p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW), -1);
/* Command-line "." and ".." are real directories. */
if (p->fts_info == FTS_DOT)
@@ -273,7 +274,7 @@
/* Any type of file may be re-visited; re-stat and re-turn. */
if (instr == FTS_AGAIN) {
- p->fts_info = fts_stat(sp, p, 0);
+ p->fts_info = fts_stat(sp, p, 0, -1);
return (p);
}
@@ -285,7 +286,7 @@
*/
if (instr == FTS_FOLLOW &&
(p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
- p->fts_info = fts_stat(sp, p, 1);
+ p->fts_info = fts_stat(sp, p, 1, -1);
if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
p->fts_errno = errno;
@@ -374,7 +375,7 @@
if (p->fts_instr == FTS_SKIP)
goto next;
if (p->fts_instr == FTS_FOLLOW) {
- p->fts_info = fts_stat(sp, p, 1);
+ p->fts_info = fts_stat(sp, p, 1, -1);
if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
if ((p->fts_symfd =
open(".", O_RDONLY, 0)) < 0) {
@@ -719,10 +720,11 @@
if (ISSET(FTS_NOCHDIR)) {
p->fts_accpath = p->fts_path;
memmove(cp, p->fts_name, p->fts_namelen + 1);
- } else
+ p->fts_info = fts_stat(sp, p, 0, dirfd(dirp));
+ } else {
p->fts_accpath = p->fts_name;
- /* Stat it. */
- p->fts_info = fts_stat(sp, p, 0);
+ p->fts_info = fts_stat(sp, p, 0, -1);
+ }
/* Decrement link count if applicable. */
if (nlinks > 0 && (p->fts_info == FTS_D ||
@@ -789,13 +791,20 @@
}
static u_short
-fts_stat(FTS *sp, FTSENT *p, int follow)
+fts_stat(FTS *sp, FTSENT *p, int follow, int dfd)
{
FTSENT *t;
dev_t dev;
ino_t ino;
struct stat *sbp, sb;
int saved_errno;
+ const char *path;
+
+ if (dfd == -1) {
+ path = p->fts_accpath;
+ dfd = AT_FDCWD;
+ } else
+ path = p->fts_name;
/* If user needs stat info, stat buffer already allocated. */
sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
@@ -806,16 +815,16 @@
* fail, set the errno from the stat call.
*/
if (ISSET(FTS_LOGICAL) || follow) {
- if (stat(p->fts_accpath, sbp)) {
+ if (fstatat(dfd, path, sbp, 0)) {
saved_errno = errno;
- if (!lstat(p->fts_accpath, sbp)) {
+ if (!fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) {
errno = 0;
return (FTS_SLNONE);
}
p->fts_errno = saved_errno;
goto err;
}
- } else if (lstat(p->fts_accpath, sbp)) {
+ } else if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) {
p->fts_errno = errno;
err: memset(sbp, 0, sizeof(struct stat));
return (FTS_NS);
@@ -873,8 +882,8 @@
struct _ftsent **a;
sp->fts_nitems = nitems + 40;
- if ((a = realloc(sp->fts_array,
- sp->fts_nitems * sizeof(FTSENT *))) == NULL) {
+ if ((a = reallocarray(sp->fts_array,
+ sp->fts_nitems, sizeof(FTSENT *))) == NULL) {
if (sp->fts_array)
free(sp->fts_array);
sp->fts_array = NULL;
diff --git a/libc/bionic/gethostname.c b/libc/bionic/gethostname.cpp
similarity index 78%
rename from libc/bionic/gethostname.c
rename to libc/bionic/gethostname.cpp
index 5d3d7d9..962fea1 100644
--- a/libc/bionic/gethostname.c
+++ b/libc/bionic/gethostname.cpp
@@ -25,27 +25,24 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#include <errno.h>
-#include <unistd.h>
#include <string.h>
#include <sys/utsname.h>
+#include <unistd.h>
-int gethostname(char* buff, size_t buflen)
-{
- struct utsname name;
- int result = 0;
+int gethostname(char* buf, size_t n) {
+ struct utsname name;
+ if (uname(&name) == -1) {
+ return -1;
+ }
- result = uname(&name);
- if (result != -1)
- {
- int namelen = strlen(name.nodename);
+ size_t name_length = static_cast<size_t>(strlen(name.nodename) + 1);
+ if (name_length > n) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
- if ((int)buflen < namelen+1) {
- errno = EINVAL;
- result = -1;
- } else {
- memcpy( buff, name.nodename, namelen+1 );
- }
- }
- return result;
+ memcpy(buf, name.nodename, name_length);
+ return 0;
}
diff --git a/libc/bionic/hash.h b/libc/bionic/hash.h
deleted file mode 100644
index 3b483f1..0000000
--- a/libc/bionic/hash.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * 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 KTH 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 KTH AND ITS 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 KTH OR ITS 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. */
-
-/* $Heimdal: hash.h,v 1.1 1999/03/22 19:16:25 joda Exp $
- $NetBSD: hash.h,v 1.1.1.3 2002/09/12 12:41:42 joda Exp $ */
-
-/* stuff in common between md4, md5, and sha1 */
-
-#ifndef __hash_h__
-#define __hash_h__
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef min
-#define min(a,b) (((a)>(b))?(b):(a))
-#endif
-
-/* Vector Crays doesn't have a good 32-bit type, or more precisely,
- int32_t as defined by <bind/bitypes.h> isn't 32 bits, and we don't
- want to depend in being able to redefine this type. To cope with
- this we have to clamp the result in some places to [0,2^32); no
- need to do this on other machines. Did I say this was a mess?
- */
-
-#ifdef _CRAY
-#define CRAYFIX(X) ((X) & 0xffffffff)
-#else
-#define CRAYFIX(X) (X)
-#endif
-
-static inline u_int32_t
-cshift (u_int32_t x, unsigned int n)
-{
- x = CRAYFIX(x);
- return CRAYFIX((x << n) | (x >> (32 - n)));
-}
-
-#endif /* __hash_h__ */
diff --git a/libc/bionic/lfs64_support.cpp b/libc/bionic/lfs64_support.cpp
index ab795f5..45d4f7f 100644
--- a/libc/bionic/lfs64_support.cpp
+++ b/libc/bionic/lfs64_support.cpp
@@ -17,11 +17,20 @@
#include <ftw.h>
#include <stdlib.h>
-int mkstemp64(char* filename) {
- // Delegation will work in this case because all the transitive dependencies
- // are already 64-bit ready. In particular, we don't have non-O_LARGEFILE
- // open (our open is actually open64) and stat and stat64 are the same.
- return mkstemp(filename);
+// Delegation will work in these cases because all the transitive dependencies
+// are already 64-bit ready. In particular, we don't have non-O_LARGEFILE
+// open (our open is actually open64) and stat and stat64 are the same.
+int mkstemp64(char* path) {
+ return mkstemp(path);
+}
+int mkostemp64(char* path, int flags) {
+ return mkostemp(path, flags);
+}
+int mkstemps64(char* path, int suffix_length) {
+ return mkstemps(path, suffix_length);
+}
+int mkostemps64(char* path, int suffix_length, int flags) {
+ return mkostemps(path, suffix_length, flags);
}
typedef int (*ftw_fn)(const char*, const struct stat*, int);
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index 950073a..2a6a03b 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -49,7 +49,7 @@
extern "C" int __set_tls(void* ptr);
extern "C" int __set_tid_address(int* tid_address);
-void __libc_init_vdso();
+__LIBC_HIDDEN__ void __libc_init_vdso();
// Not public, but well-known in the BSDs.
const char* __progname;
diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp
index 5655526..49a3762 100644
--- a/libc/bionic/libc_logging.cpp
+++ b/libc/bionic/libc_logging.cpp
@@ -75,10 +75,12 @@
len = strlen(data);
}
+ total += len;
+
while (len > 0) {
int avail = end_ - pos_;
if (avail == 0) {
- break;
+ return;
}
if (avail > len) {
avail = len;
@@ -87,11 +89,10 @@
pos_ += avail;
pos_[0] = '\0';
len -= avail;
- total += avail;
}
}
- int total;
+ size_t total;
private:
char* buffer_;
@@ -109,18 +110,19 @@
len = strlen(data);
}
+ total += len;
+
while (len > 0) {
int rc = TEMP_FAILURE_RETRY(write(fd_, data, len));
if (rc == -1) {
- break;
+ return;
}
data += rc;
len -= rc;
- total += rc;
}
}
- int total;
+ size_t total;
private:
int fd_;
diff --git a/libc/bionic/locale.cpp b/libc/bionic/locale.cpp
index ddb49ce..90aa7b8 100644
--- a/libc/bionic/locale.cpp
+++ b/libc/bionic/locale.cpp
@@ -26,9 +26,14 @@
* SUCH DAMAGE.
*/
+#include <errno.h>
#include <locale.h>
#include <pthread.h>
#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <time.h>
+#include <wchar.h>
#include "private/bionic_macros.h"
@@ -123,8 +128,8 @@
}
locale_t newlocale(int category_mask, const char* locale_name, locale_t /*base*/) {
- // Is 'category_mask' valid?
- if ((category_mask & ~LC_ALL_MASK) != 0) {
+ // Are 'category_mask' and 'locale_name' valid?
+ if ((category_mask & ~LC_ALL_MASK) != 0 || locale_name == NULL) {
errno = EINVAL;
return NULL;
}
@@ -171,3 +176,47 @@
return old_locale;
}
+
+int strcasecmp_l(const char* s1, const char* s2, locale_t) {
+ return strcasecmp(s1, s2);
+}
+
+int strcoll_l(const char* s1, const char* s2, locale_t) {
+ return strcoll(s1, s2);
+}
+
+char* strerror_l(int error, locale_t) {
+ return strerror(error);
+}
+
+size_t strftime_l(char* s, size_t max, const char* format, const struct tm* tm, locale_t) {
+ return strftime(s, max, format, tm);
+}
+
+int strncasecmp_l(const char* s1, const char* s2, size_t n, locale_t) {
+ return strncasecmp(s1, s2, n);
+}
+
+long double strtold_l(const char* s, char** end_ptr, locale_t) {
+ return strtold(s, end_ptr);
+}
+
+long long strtoll_l(const char* s, char** end_ptr, int base, locale_t) {
+ return strtoll(s, end_ptr, base);
+}
+
+unsigned long long strtoull_l(const char* s, char** end_ptr, int base, locale_t) {
+ return strtoull(s, end_ptr, base);
+}
+
+size_t strxfrm_l(char* dst, const char* src, size_t n, locale_t) {
+ return strxfrm(dst, src, n);
+}
+
+int wcscasecmp_l(const wchar_t* ws1, const wchar_t* ws2, locale_t) {
+ return wcscasecmp(ws1, ws2);
+}
+
+int wcsncasecmp_l(const wchar_t* ws1, const wchar_t* ws2, size_t n, locale_t) {
+ return wcsncasecmp(ws1, ws2, n);
+}
diff --git a/libc/bionic/malloc_debug_common.cpp b/libc/bionic/malloc_debug_common.cpp
index 0b6a142..38c6583 100644
--- a/libc/bionic/malloc_debug_common.cpp
+++ b/libc/bionic/malloc_debug_common.cpp
@@ -29,14 +29,13 @@
// Contains definition of structures, global variables, and implementation of
// routines that are used by malloc leak detection code and other components in
// the system. The trick is that some components expect these data and
-// routines to be defined / implemented in libc.so library, regardless
-// whether or not MALLOC_LEAK_CHECK macro is defined. To make things even
-// more tricky, malloc leak detection code, implemented in
-// libc_malloc_debug.so also requires access to these variables and routines
-// (to fill allocation entry hash table, for example). So, all relevant
-// variables and routines are defined / implemented here and exported
-// to all, leak detection code and other components via dynamic (libc.so),
-// or static (libc.a) linking.
+// routines to be defined / implemented in libc.so, regardless whether or not
+// malloc leak detection code is going to run. To make things even more tricky,
+// malloc leak detection code, implemented in libc_malloc_debug.so also
+// requires access to these variables and routines (to fill allocation entry
+// hash table, for example). So, all relevant variables and routines are
+// defined / implemented here and exported to all, leak detection code and
+// other components via dynamic (libc.so), or static (libc.a) linking.
#include "malloc_debug_common.h"
diff --git a/libc/bionic/malloc_debug_leak.cpp b/libc/bionic/malloc_debug_leak.cpp
index df0f997..64f2112 100644
--- a/libc/bionic/malloc_debug_leak.cpp
+++ b/libc/bionic/malloc_debug_leak.cpp
@@ -55,13 +55,6 @@
#include "private/libc_logging.h"
#include "private/ScopedPthreadMutexLocker.h"
-// This file should be included into the build only when
-// MALLOC_LEAK_CHECK, or MALLOC_QEMU_INSTRUMENT, or both
-// macros are defined.
-#ifndef MALLOC_LEAK_CHECK
-#error MALLOC_LEAK_CHECK is not defined.
-#endif // !MALLOC_LEAK_CHECK
-
extern int gMallocLeakZygoteChild;
extern HashTable* g_hash_table;
extern const MallocDebug* g_malloc_dispatch;
diff --git a/libc/bionic/malloc_debug_qemu.cpp b/libc/bionic/malloc_debug_qemu.cpp
index b3b604d..2f4949b 100644
--- a/libc/bionic/malloc_debug_qemu.cpp
+++ b/libc/bionic/malloc_debug_qemu.cpp
@@ -606,7 +606,7 @@
* the memory mapped spaces into writes to an I/O port that emulator
* "listens to" on the other end. Note that until we open and map that
* device, logging to emulator's stdout will not be available. */
- int fd = open("/dev/qemu_trace", O_RDWR);
+ int fd = open("/dev/qemu_trace", O_CLOEXEC | O_RDWR);
if (fd < 0) {
error_log("Unable to open /dev/qemu_trace");
return false;
diff --git a/libc/bionic/malloc_info.cpp b/libc/bionic/malloc_info.cpp
new file mode 100644
index 0000000..99caedb
--- /dev/null
+++ b/libc/bionic/malloc_info.cpp
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "malloc_info.h"
+
+#include <errno.h>
+#include "private/bionic_macros.h"
+
+class __LIBC_HIDDEN__ Elem {
+public:
+ // name must be valid throughout lifetime of the object.
+ explicit Elem(FILE* fp, const char* name,
+ const char* attr_fmt = nullptr, ...) {
+ this->fp = fp;
+ this->name = name;
+
+ fprintf(fp, "<%s", name);
+ if (attr_fmt != nullptr) {
+ va_list args;
+ va_start(args, attr_fmt);
+ fputc(' ', fp);
+ vfprintf(fp, attr_fmt, args);
+ va_end(args);
+ }
+ fputc('>', fp);
+ }
+
+ ~Elem() noexcept {
+ fprintf(fp, "</%s>", name);
+ }
+
+ void contents(const char* fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(fp, fmt, args);
+ va_end(args);
+ }
+
+private:
+ FILE* fp;
+ const char* name;
+
+ DISALLOW_COPY_AND_ASSIGN(Elem);
+};
+
+int malloc_info(int options, FILE* fp) {
+ if (options != 0) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ Elem root(fp, "malloc", "version=\"jemalloc-1\"");
+
+ // Dump all of the large allocations in the arenas.
+ for (size_t i = 0; i < __mallinfo_narenas(); i++) {
+ struct mallinfo mi = __mallinfo_arena_info(i);
+ if (mi.hblkhd != 0) {
+ Elem arena_elem(fp, "heap", "nr=\"%d\"", i);
+ {
+ Elem(fp, "allocated-large").contents("%zu", mi.ordblks);
+ Elem(fp, "allocated-huge").contents("%zu", mi.uordblks);
+ Elem(fp, "allocated-bins").contents("%zu", mi.fsmblks);
+
+ size_t total = 0;
+ for (size_t j = 0; j < __mallinfo_nbins(); j++) {
+ struct mallinfo mi = __mallinfo_bin_info(i, j);
+ if (mi.ordblks != 0) {
+ Elem bin_elem(fp, "bin", "nr=\"%d\"", j);
+ Elem(fp, "allocated").contents("%zu", mi.ordblks);
+ Elem(fp, "nmalloc").contents("%zu", mi.uordblks);
+ Elem(fp, "ndalloc").contents("%zu", mi.fordblks);
+ total += mi.ordblks;
+ }
+ }
+ Elem(fp, "bins-total").contents("%zu", total);
+ }
+ }
+ }
+
+ return 0;
+}
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/libc/bionic/malloc_info.h
similarity index 60%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to libc/bionic/malloc_info.h
index a4d7504..5fffae9 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/libc/bionic/malloc_info.h
@@ -14,12 +14,19 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
-}
+#ifndef LIBC_BIONIC_MALLOC_INFO_H_
+#define LIBC_BIONIC_MALLOC_INFO_H_
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
-}
-#endif
+#include <malloc.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+__LIBC_HIDDEN__ size_t __mallinfo_narenas();
+__LIBC_HIDDEN__ size_t __mallinfo_nbins();
+__LIBC_HIDDEN__ struct mallinfo __mallinfo_arena_info(size_t);
+__LIBC_HIDDEN__ struct mallinfo __mallinfo_bin_info(size_t, size_t);
+
+__END_DECLS
+
+#endif // LIBC_BIONIC_MALLOC_INFO_H_
diff --git a/libc/bionic/mkfifo.cpp b/libc/bionic/mkfifo.cpp
index 08ffad1..a98b350 100644
--- a/libc/bionic/mkfifo.cpp
+++ b/libc/bionic/mkfifo.cpp
@@ -28,6 +28,12 @@
#include <sys/stat.h>
+#include <fcntl.h>
+
int mkfifo(const char* path, mode_t mode) {
- return mknod(path, (mode & ~S_IFMT) | S_IFIFO, 0);
+ return mkfifoat(AT_FDCWD, path, mode);
+}
+
+int mkfifoat(int fd, const char* path, mode_t mode) {
+ return mknodat(fd, path, (mode & ~S_IFMT) | S_IFIFO, 0);
}
diff --git a/libc/bionic/mntent.cpp b/libc/bionic/mntent.cpp
index 93b6915..4afacda 100644
--- a/libc/bionic/mntent.cpp
+++ b/libc/bionic/mntent.cpp
@@ -27,12 +27,44 @@
*/
#include <mntent.h>
+#include <string.h>
-mntent* getmntent(FILE*) {
- return NULL;
+#include "private/ThreadLocalBuffer.h"
+
+GLOBAL_INIT_THREAD_LOCAL_BUFFER(getmntent_mntent);
+GLOBAL_INIT_THREAD_LOCAL_BUFFER(getmntent_strings);
+
+mntent* getmntent(FILE* fp) {
+ LOCAL_INIT_THREAD_LOCAL_BUFFER(mntent*, getmntent_mntent, sizeof(mntent));
+ LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, getmntent_strings, BUFSIZ);
+ return getmntent_r(fp, getmntent_mntent_tls_buffer,
+ getmntent_strings_tls_buffer, getmntent_strings_tls_buffer_size);
}
-mntent* getmntent_r(FILE*, struct mntent*, char*, int) {
+mntent* getmntent_r(FILE* fp, struct mntent* e, char* buf, int buf_len) {
+ memset(e, 0, sizeof(*e));
+ while (fgets(buf, buf_len, fp) != NULL) {
+ // Entries look like "proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0".
+ // That is: mnt_fsname mnt_dir mnt_type mnt_opts 0 0.
+ int fsname0, fsname1, dir0, dir1, type0, type1, opts0, opts1;
+ if (sscanf(buf, " %n%*s%n %n%*s%n %n%*s%n %n%*s%n %d %d",
+ &fsname0, &fsname1, &dir0, &dir1, &type0, &type1, &opts0, &opts1,
+ &e->mnt_freq, &e->mnt_passno) == 2) {
+ e->mnt_fsname = &buf[fsname0];
+ buf[fsname1] = '\0';
+
+ e->mnt_dir = &buf[dir0];
+ buf[dir1] = '\0';
+
+ e->mnt_type = &buf[type0];
+ buf[type1] = '\0';
+
+ e->mnt_opts = &buf[opts0];
+ buf[opts1] = '\0';
+
+ return e;
+ }
+ }
return NULL;
}
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp
index 7600817..18a4a14 100644
--- a/libc/bionic/ndk_cruft.cpp
+++ b/libc/bionic/ndk_cruft.cpp
@@ -320,6 +320,11 @@
return malloc_usable_size(ptr);
}
+// In L we added a public pthread_gettid_np, but some apps were using the private API.
+extern "C" pid_t __pthread_gettid(pthread_t t) {
+ return pthread_gettid_np(t);
+}
+
// Older versions of appportable used dlmalloc directly instead of malloc,
// so export this compatibility shim that simply calls malloc.
extern "C" void* dlmalloc(size_t size) {
diff --git a/libc/bionic/new.cpp b/libc/bionic/new.cpp
index fcfd1bd..cd84c2e 100644
--- a/libc/bionic/new.cpp
+++ b/libc/bionic/new.cpp
@@ -38,11 +38,11 @@
return p;
}
-void operator delete(void* ptr) {
+void operator delete(void* ptr) throw() {
free(ptr);
}
-void operator delete[](void* ptr) {
+void operator delete[](void* ptr) throw() {
free(ptr);
}
@@ -54,10 +54,10 @@
return malloc(size);
}
-void operator delete(void* ptr, const std::nothrow_t&) {
+void operator delete(void* ptr, const std::nothrow_t&) throw() {
free(ptr);
}
-void operator delete[](void* ptr, const std::nothrow_t&) {
+void operator delete[](void* ptr, const std::nothrow_t&) throw() {
free(ptr);
}
diff --git a/libc/bionic/pathconf.c b/libc/bionic/pathconf.c
deleted file mode 100644
index cf81272..0000000
--- a/libc/bionic/pathconf.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * 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 <pathconf.h>
-#include <sys/vfs.h>
-#include <sys/limits.h>
-#include <errno.h>
-
-/* these may not be defined yet by our headers */
-#ifndef _POSIX_VDISABLE
-#define _POSIX_VDISABLE -1
-#endif
-
-#ifndef _POSIX_SYNC_IO
-#define _POSIX_SYNC_IO -1
-#endif
-
-#ifndef _POSIX_PRIO_IO
-#define _POSIX_PRIO_IO -1
-#endif
-
-#ifndef _POSIX_ASYNC_IO
-#define _POSIX_ASYNC_IO -1
-#endif
-
-
-static long
-__filesizebits( struct statfs* s )
-{
-#define EOL_MAGIC 0x0000U
-
- /* list of known 64-bit aware filesystems */
- static const uint32_t known64[] = {
- EXT2_SUPER_MAGIC,
- UFS_MAGIC,
- REISERFS_SUPER_MAGIC,
- XFS_SUPER_MAGIC,
- SMB_SUPER_MAGIC,
- UDF_SUPER_MAGIC,
- JFS_SUPER_MAGIC,
- NTFS_SB_MAGIC,
- VXFS_SUPER_MAGIC,
- EOL_MAGIC
- };
- int nn = 0;
-
- for (; known64[nn] != EOL_MAGIC; ++nn) {
- if (known64[nn] == s->f_type) {
- return 64;
- }
- }
- return 32;
-}
-
-
-static long
-__link_max( struct statfs* s )
-{
- // These constant values were taken from kernel headers.
- // They're not available in uapi headers.
- static const struct { uint32_t type; int max; } knownMax[] =
- {
- { EXT2_SUPER_MAGIC, 32000 },
- { EXT3_SUPER_MAGIC, 32000 },
- { MINIX_SUPER_MAGIC, 250 },
- { MINIX2_SUPER_MAGIC, 65530 },
- { REISERFS_SUPER_MAGIC, 0xffff - 1000 },
- { UFS_MAGIC, 32000 },
- { EOL_MAGIC, 0 }
- };
- int nn = 0;
-
- for (; knownMax[nn].type != EOL_MAGIC; ++nn) {
- if (knownMax[nn].type == s->f_type) {
- return knownMax[nn].max;
- }
- }
- return LINK_MAX;
-}
-
-static long
-__2_symlinks( struct statfs* s )
-{
- /* list of know filesystems that don't support symlinks */
- static const uint32_t knownNoSymlinks[] = {
- ADFS_SUPER_MAGIC, BFS_MAGIC, CRAMFS_MAGIC,
- EFS_SUPER_MAGIC, MSDOS_SUPER_MAGIC, NTFS_SB_MAGIC,
- QNX4_SUPER_MAGIC,
- EOL_MAGIC
- };
- int nn = 0;
-
- for (; knownNoSymlinks[nn] != EOL_MAGIC; ++nn) {
- if (knownNoSymlinks[nn] == s->f_type) {
- return 0;
- }
- }
- return 1;
-}
-
-static long
-__name_max( struct statfs* s )
-{
- return s->f_namelen;
-}
-
-long
-pathconf(const char *path, int name)
-{
- struct statfs buf;
- int ret = statfs( path, &buf );
-
- if (ret < 0)
- return -1;
-
- switch (name) {
- case _PC_FILESIZEBITS:
- return __filesizebits(&buf);
-
- case _PC_LINK_MAX:
- return __link_max(&buf);
-
- case _PC_MAX_CANON:
- return MAX_CANON;
-
- case _PC_MAX_INPUT:
- return MAX_INPUT;
-
- case _PC_NAME_MAX:
- return __name_max(&buf);
-
- case _PC_PATH_MAX:
- return PATH_MAX;
-
- case _PC_PIPE_BUF:
- return PIPE_BUF;
-
- case _PC_2_SYMLINKS:
- return __2_symlinks(&buf);
-
-#if 0 /* don't know what to do there, the specs are really weird */
- case _PC_ALLOC_SIZE_MIN:
- case _PC_REC_INCR_XFER_SIZE:
- case _PC_REC_MAX_XFER_SIZE:
- case _PC_REC_MIN_XFER_SIZE:
- case _PC_REC_XFER_ALIGN:
-#endif
-
- case _PC_SYMLINK_MAX:
- return -1; /* no limit */
-
- case _PC_CHOWN_RESTRICTED:
- return _POSIX_CHOWN_RESTRICTED;
-
- case _PC_NO_TRUNC:
- return _POSIX_NO_TRUNC;
-
- case _PC_VDISABLE:
- return _POSIX_VDISABLE;
-
- case _PC_ASYNC_IO:
- return _POSIX_ASYNC_IO;
-
- case _PC_PRIO_IO:
- return _POSIX_PRIO_IO;
-
- case _PC_SYNC_IO:
- return _POSIX_SYNC_IO;
-
- default:
- errno = EINVAL;
- return -1;
- }
-}
-
-long fpathconf(int fildes, int name)
-{
- struct statfs buf;
- int ret = fstatfs(fildes, &buf);
-
- if (ret < 0)
- return -1;
-
- switch (name) {
- case _PC_FILESIZEBITS:
- return __filesizebits(&buf);
-
- case _PC_LINK_MAX:
- return __link_max(&buf);
-
- case _PC_MAX_CANON:
- return MAX_CANON;
-
- case _PC_MAX_INPUT:
- return MAX_INPUT;
-
- case _PC_NAME_MAX:
- return __name_max(&buf);
-
- case _PC_PATH_MAX:
- return PATH_MAX;
-
- case _PC_PIPE_BUF:
- return PIPE_BUF;
-
- case _PC_2_SYMLINKS:
- return __2_symlinks(&buf);
-
-#if 0 /* don't know what to do there, the specs are really weird */
- case _PC_ALLOC_SIZE_MIN:
- case _PC_REC_INCR_XFER_SIZE:
- case _PC_REC_MAX_XFER_SIZE:
- case _PC_REC_MIN_XFER_SIZE:
- case _PC_REC_XFER_ALIGN:
-#endif
-
- case _PC_SYMLINK_MAX:
- return -1; /* no limit */
-
- case _PC_CHOWN_RESTRICTED:
- return _POSIX_CHOWN_RESTRICTED;
-
- case _PC_NO_TRUNC:
- return _POSIX_NO_TRUNC;
-
- case _PC_VDISABLE:
- return _POSIX_VDISABLE;
-
- case _PC_ASYNC_IO:
- return _POSIX_ASYNC_IO;
-
- case _PC_PRIO_IO:
- return _POSIX_PRIO_IO;
-
- case _PC_SYNC_IO:
- return _POSIX_SYNC_IO;
-
- default:
- errno = EINVAL;
- return -1;
- }
-}
diff --git a/libc/bionic/pathconf.cpp b/libc/bionic/pathconf.cpp
new file mode 100644
index 0000000..e6f5742
--- /dev/null
+++ b/libc/bionic/pathconf.cpp
@@ -0,0 +1,156 @@
+/*
+ * 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 <unistd.h>
+
+#include <errno.h>
+#include <sys/limits.h>
+#include <sys/vfs.h>
+
+static long __filesizebits(const struct statfs& s) {
+ switch (s.f_type) {
+ case JFFS2_SUPER_MAGIC:
+ case MSDOS_SUPER_MAGIC:
+ case NCP_SUPER_MAGIC:
+ return 32;
+ }
+ // There won't be any new 32-bit file systems.
+ return 64;
+}
+
+static long __link_max(const struct statfs& s) {
+ // These constant values were taken from kernel headers.
+ // They're not available in uapi headers.
+ switch (s.f_type) {
+ case EXT2_SUPER_MAGIC:
+ return 32000;
+ case MINIX_SUPER_MAGIC:
+ return 250;
+ case MINIX2_SUPER_MAGIC:
+ return 65530;
+ case REISERFS_SUPER_MAGIC:
+ return 0xffff - 1000;
+ case UFS_MAGIC:
+ return 32000;
+ }
+ return LINK_MAX;
+}
+
+static long __2_symlinks(const struct statfs& s) {
+ switch (s.f_type) {
+ case ADFS_SUPER_MAGIC:
+ case BFS_MAGIC:
+ case CRAMFS_MAGIC:
+ case EFS_SUPER_MAGIC:
+ case MSDOS_SUPER_MAGIC:
+ case QNX4_SUPER_MAGIC:
+ return 0;
+ }
+ return 1;
+}
+
+static long __pathconf(const struct statfs& s, int name) {
+ switch (name) {
+ case _PC_FILESIZEBITS:
+ return __filesizebits(s);
+
+ case _PC_LINK_MAX:
+ return __link_max(s);
+
+ case _PC_MAX_CANON:
+ return MAX_CANON;
+
+ case _PC_MAX_INPUT:
+ return MAX_INPUT;
+
+ case _PC_NAME_MAX:
+ return s.f_namelen;
+
+ case _PC_PATH_MAX:
+ return PATH_MAX;
+
+ case _PC_PIPE_BUF:
+ return PIPE_BUF;
+
+ case _PC_2_SYMLINKS:
+ return __2_symlinks(s);
+
+ case _PC_ALLOC_SIZE_MIN: /* fall through */
+ case _PC_REC_XFER_ALIGN:
+ return s.f_frsize;
+
+ case _PC_REC_MIN_XFER_SIZE:
+ return s.f_bsize;
+
+#if 0
+ case _PC_REC_INCR_XFER_SIZE:
+ case _PC_REC_MAX_XFER_SIZE:
+#endif
+
+ case _PC_SYMLINK_MAX:
+ return -1; /* no limit */
+
+ case _PC_CHOWN_RESTRICTED:
+ return _POSIX_CHOWN_RESTRICTED;
+
+ case _PC_NO_TRUNC:
+ return _POSIX_NO_TRUNC;
+
+ case _PC_VDISABLE:
+ return _POSIX_VDISABLE;
+
+ case _PC_ASYNC_IO:
+ return -1;
+
+ case _PC_PRIO_IO:
+ return -1;
+
+ case _PC_SYNC_IO:
+ return -1;
+
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+}
+
+long pathconf(const char* path, int name) {
+ struct statfs sb;
+ if (statfs(path, &sb) == -1) {
+ return -1;
+ }
+ return __pathconf(sb, name);
+}
+
+long fpathconf(int fd, int name) {
+ struct statfs sb;
+ if (fstatfs(fd, &sb) == -1) {
+ return -1;
+ }
+ return __pathconf(sb, name);
+}
diff --git a/libc/bionic/pthread_atfork.cpp b/libc/bionic/pthread_atfork.cpp
index b845f7d..d1c4ad0 100644
--- a/libc/bionic/pthread_atfork.cpp
+++ b/libc/bionic/pthread_atfork.cpp
@@ -28,6 +28,7 @@
#include <errno.h>
#include <pthread.h>
+#include <stdlib.h>
struct atfork_t {
atfork_t* next;
@@ -43,7 +44,7 @@
atfork_t* last;
};
-static pthread_mutex_t g_atfork_list_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+static pthread_mutex_t g_atfork_list_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static atfork_list_t g_atfork_list = { NULL, NULL };
void __bionic_atfork_run_prepare() {
@@ -72,7 +73,7 @@
}
}
- g_atfork_list_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+ g_atfork_list_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
}
void __bionic_atfork_run_parent() {
diff --git a/libc/bionic/pthread_cond.cpp b/libc/bionic/pthread_cond.cpp
index e623b62..32ff81a 100644
--- a/libc/bionic/pthread_cond.cpp
+++ b/libc/bionic/pthread_cond.cpp
@@ -163,12 +163,12 @@
}
__LIBC_HIDDEN__
-int __pthread_cond_timedwait(pthread_cond_t* cond, pthread_mutex_t* mutex, const timespec* abstime, clockid_t clock) {
+int __pthread_cond_timedwait(pthread_cond_t* cond, pthread_mutex_t* mutex, const timespec* abs_ts, clockid_t clock) {
timespec ts;
timespec* tsp;
- if (abstime != NULL) {
- if (__timespec_from_absolute(&ts, abstime, clock) < 0) {
+ if (abs_ts != NULL) {
+ if (!timespec_from_absolute_timespec(ts, *abs_ts, clock)) {
return ETIMEDOUT;
}
tsp = &ts;
diff --git a/libc/bionic/pthread_gettid_np.cpp b/libc/bionic/pthread_gettid_np.cpp
index f4663a7..c996a05 100644
--- a/libc/bionic/pthread_gettid_np.cpp
+++ b/libc/bionic/pthread_gettid_np.cpp
@@ -27,13 +27,7 @@
*/
#include "pthread_internal.h"
-#include "private/bionic_pthread.h"
pid_t pthread_gettid_np(pthread_t t) {
return reinterpret_cast<pthread_internal_t*>(t)->tid;
}
-
-// TODO: move callers over to pthread_gettid_np and remove this.
-pid_t __pthread_gettid(pthread_t t) {
- return pthread_gettid_np(t);
-}
diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h
index a5b3002..392e781 100644
--- a/libc/bionic/pthread_internal.h
+++ b/libc/bionic/pthread_internal.h
@@ -117,8 +117,6 @@
__LIBC_HIDDEN__ extern pthread_internal_t* g_thread_list;
__LIBC_HIDDEN__ extern pthread_mutex_t g_thread_list_lock;
-__LIBC_HIDDEN__ int __timespec_from_absolute(timespec*, const timespec*, clockid_t);
-
/* Needed by fork. */
__LIBC_HIDDEN__ extern void __bionic_atfork_run_prepare();
__LIBC_HIDDEN__ extern void __bionic_atfork_run_child();
diff --git a/libc/bionic/pthread_internals.cpp b/libc/bionic/pthread_internals.cpp
index 4c08ba8..2270d96 100644
--- a/libc/bionic/pthread_internals.cpp
+++ b/libc/bionic/pthread_internals.cpp
@@ -28,6 +28,8 @@
#include "pthread_internal.h"
+#include <stdlib.h>
+
#include "private/bionic_futex.h"
#include "private/bionic_tls.h"
#include "private/ScopedPthreadMutexLocker.h"
@@ -67,19 +69,3 @@
pthread_internal_t* __get_thread(void) {
return reinterpret_cast<pthread_internal_t*>(__get_tls()[TLS_SLOT_THREAD_ID]);
}
-
-// Initialize 'ts' with the difference between 'abstime' and the current time
-// according to 'clock'. Returns -1 if abstime already expired, or 0 otherwise.
-int __timespec_from_absolute(timespec* ts, const timespec* abstime, clockid_t clock) {
- clock_gettime(clock, ts);
- ts->tv_sec = abstime->tv_sec - ts->tv_sec;
- ts->tv_nsec = abstime->tv_nsec - ts->tv_nsec;
- if (ts->tv_nsec < 0) {
- ts->tv_sec--;
- ts->tv_nsec += 1000000000;
- }
- if ((ts->tv_nsec < 0) || (ts->tv_sec < 0)) {
- return -1;
- }
- return 0;
-}
diff --git a/libc/bionic/pthread_key.cpp b/libc/bionic/pthread_key.cpp
index 27eab27..b47ef22 100644
--- a/libc/bionic/pthread_key.cpp
+++ b/libc/bionic/pthread_key.cpp
@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
+#include <errno.h>
#include <pthread.h>
#include "private/bionic_tls.h"
diff --git a/libc/bionic/pthread_mutex.cpp b/libc/bionic/pthread_mutex.cpp
index ae2557f..40f1ed2 100644
--- a/libc/bionic/pthread_mutex.cpp
+++ b/libc/bionic/pthread_mutex.cpp
@@ -36,9 +36,13 @@
#include "pthread_internal.h"
#include "private/bionic_atomic_inline.h"
+#include "private/bionic_constants.h"
#include "private/bionic_futex.h"
+#include "private/bionic_time_conversions.h"
#include "private/bionic_tls.h"
+#include "private/bionic_systrace.h"
+
extern void pthread_debug_mutex_lock_check(pthread_mutex_t *mutex);
extern void pthread_debug_mutex_unlock_check(pthread_mutex_t *mutex);
@@ -333,6 +337,10 @@
* that the mutex is in state 2 when we go to sleep on it, which
* guarantees a wake-up call.
*/
+
+ ScopedTrace trace("Contending for pthread mutex");
+
+
while (__bionic_swap(locked_contended, &mutex->value) != unlocked) {
__futex_wait_ex(&mutex->value, shared, locked_contended, NULL);
}
@@ -440,12 +448,6 @@
}
int pthread_mutex_lock(pthread_mutex_t* mutex) {
-#if !defined(__LP64__)
- if (mutex == NULL) {
- return EINVAL;
- }
-#endif
-
int mvalue, mtype, tid, shared;
mvalue = mutex->value;
@@ -479,6 +481,8 @@
mvalue = mutex->value;
}
+ ScopedTrace trace("Contending for pthread mutex");
+
for (;;) {
int newval;
@@ -522,12 +526,6 @@
}
int pthread_mutex_unlock(pthread_mutex_t* mutex) {
-#if !defined(__LP64__)
- if (mutex == NULL) {
- return EINVAL;
- }
-#endif
-
int mvalue, mtype, tid, shared;
mvalue = mutex->value;
@@ -580,15 +578,12 @@
}
int pthread_mutex_trylock(pthread_mutex_t* mutex) {
- int mvalue, mtype, tid, shared;
+ int mvalue = mutex->value;
+ int mtype = (mvalue & MUTEX_TYPE_MASK);
+ int shared = (mvalue & MUTEX_SHARED_MASK);
- mvalue = mutex->value;
- mtype = (mvalue & MUTEX_TYPE_MASK);
- shared = (mvalue & MUTEX_SHARED_MASK);
-
- /* Handle common case first */
- if ( __predict_true(mtype == MUTEX_TYPE_BITS_NORMAL) )
- {
+ // Handle common case first.
+ if (__predict_true(mtype == MUTEX_TYPE_BITS_NORMAL)) {
if (__bionic_cmpxchg(shared|MUTEX_STATE_BITS_UNLOCKED,
shared|MUTEX_STATE_BITS_LOCKED_UNCONTENDED,
&mutex->value) == 0) {
@@ -599,10 +594,14 @@
return EBUSY;
}
- /* Do we already own this recursive or error-check mutex ? */
- tid = __get_thread()->tid;
- if ( tid == MUTEX_OWNER_FROM_BITS(mvalue) )
+ // Do we already own this recursive or error-check mutex?
+ pid_t tid = __get_thread()->tid;
+ if (tid == MUTEX_OWNER_FROM_BITS(mvalue)) {
+ if (mtype == MUTEX_TYPE_BITS_ERRORCHECK) {
+ return EBUSY;
+ }
return _recursive_increment(mutex, mvalue, mtype);
+ }
/* Same as pthread_mutex_lock, except that we don't want to wait, and
* the only operation that can succeed is a single cmpxchg to acquire the
@@ -619,7 +618,7 @@
return EBUSY;
}
-static int __pthread_mutex_timedlock(pthread_mutex_t* mutex, const timespec* abs_timeout, clockid_t clock) {
+static int __pthread_mutex_timedlock(pthread_mutex_t* mutex, const timespec* abs_ts, clockid_t clock) {
timespec ts;
int mvalue = mutex->value;
@@ -638,9 +637,11 @@
return 0;
}
+ ScopedTrace trace("Contending for timed pthread mutex");
+
// Loop while needed.
while (__bionic_swap(locked_contended, &mutex->value) != unlocked) {
- if (__timespec_from_absolute(&ts, abs_timeout, clock) < 0) {
+ if (!timespec_from_absolute_timespec(ts, *abs_ts, clock)) {
return ETIMEDOUT;
}
__futex_wait_ex(&mutex->value, shared, locked_contended, &ts);
@@ -670,6 +671,8 @@
mvalue = mutex->value;
}
+ ScopedTrace trace("Contending for timed pthread mutex");
+
while (true) {
// If the value is 'unlocked', try to acquire it directly.
// NOTE: put state to 2 since we know there is contention.
@@ -681,7 +684,7 @@
}
// The value changed before we could lock it. We need to check
// the time to avoid livelocks, reload the value, then loop again.
- if (__timespec_from_absolute(&ts, abs_timeout, clock) < 0) {
+ if (!timespec_from_absolute_timespec(ts, *abs_ts, clock)) {
return ETIMEDOUT;
}
@@ -703,7 +706,7 @@
}
// Check time and update 'ts'.
- if (__timespec_from_absolute(&ts, abs_timeout, clock) < 0) {
+ if (timespec_from_absolute_timespec(ts, *abs_ts, clock)) {
return ETIMEDOUT;
}
@@ -726,9 +729,9 @@
clock_gettime(CLOCK_MONOTONIC, &abs_timeout);
abs_timeout.tv_sec += ms / 1000;
abs_timeout.tv_nsec += (ms % 1000) * 1000000;
- if (abs_timeout.tv_nsec >= 1000000000) {
+ if (abs_timeout.tv_nsec >= NS_PER_S) {
abs_timeout.tv_sec++;
- abs_timeout.tv_nsec -= 1000000000;
+ abs_timeout.tv_nsec -= NS_PER_S;
}
int error = __pthread_mutex_timedlock(mutex, &abs_timeout, CLOCK_MONOTONIC);
diff --git a/libc/bionic/pthread_rwlock.cpp b/libc/bionic/pthread_rwlock.cpp
index 063137b..0d63457 100644
--- a/libc/bionic/pthread_rwlock.cpp
+++ b/libc/bionic/pthread_rwlock.cpp
@@ -30,6 +30,7 @@
#include "pthread_internal.h"
#include "private/bionic_futex.h"
+#include "private/bionic_time_conversions.h"
/* Technical note:
*
@@ -71,7 +72,7 @@
static bool timespec_from_absolute(timespec* rel_timeout, const timespec* abs_timeout) {
if (abs_timeout != NULL) {
- if (__timespec_from_absolute(rel_timeout, abs_timeout, CLOCK_REALTIME) < 0) {
+ if (!timespec_from_absolute_timespec(*rel_timeout, *abs_timeout, CLOCK_REALTIME)) {
return false;
}
}
diff --git a/libc/bionic/pthread_setname_np.cpp b/libc/bionic/pthread_setname_np.cpp
index 1ddf810..93d4b2f 100644
--- a/libc/bionic/pthread_setname_np.cpp
+++ b/libc/bionic/pthread_setname_np.cpp
@@ -61,13 +61,13 @@
{
pthread_accessor thread(t);
if (thread.get() == NULL) {
- return ESRCH;
+ return ENOENT;
}
tid = thread->tid;
}
char comm_name[sizeof(TASK_COMM_FMT) + 8];
snprintf(comm_name, sizeof(comm_name), TASK_COMM_FMT, tid);
- int fd = open(comm_name, O_WRONLY);
+ int fd = open(comm_name, O_CLOEXEC | O_WRONLY);
if (fd == -1) {
return errno;
}
diff --git a/libc/bionic/pututline.c b/libc/bionic/pututline.c
index c8427f7..8cbf470 100644
--- a/libc/bionic/pututline.c
+++ b/libc/bionic/pututline.c
@@ -36,7 +36,7 @@
struct utmp u;
long i;
- if (!(f = fopen(_PATH_UTMP, "w+")))
+ if (!(f = fopen(_PATH_UTMP, "w+e")))
return;
while (fread(&u, sizeof(struct utmp), 1, f) == 1)
@@ -55,7 +55,7 @@
fclose(f);
- if (!(f = fopen(_PATH_UTMP, "w+")))
+ if (!(f = fopen(_PATH_UTMP, "w+e")))
return;
fwrite(utmp, sizeof(struct utmp), 1, f);
diff --git a/libc/bionic/raise.cpp b/libc/bionic/raise.cpp
index f69d90b..0dd0ad7 100644
--- a/libc/bionic/raise.cpp
+++ b/libc/bionic/raise.cpp
@@ -27,6 +27,7 @@
*/
#include <pthread.h>
+#include <signal.h>
int raise(int sig) {
int rc = pthread_kill(pthread_self(), sig);
diff --git a/libc/bionic/semaphore.c b/libc/bionic/semaphore.c
deleted file mode 100644
index 1fa019e..0000000
--- a/libc/bionic/semaphore.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- * 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 <semaphore.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <time.h>
-#include <limits.h>
-
-#include "private/bionic_atomic_inline.h"
-#include "private/bionic_futex.h"
-
-/* In this implementation, a semaphore contains a
- * 31-bit signed value and a 1-bit 'shared' flag
- * (for process-sharing purpose).
- *
- * We use the value -1 to indicate contention on the
- * semaphore, 0 or more to indicate uncontended state,
- * any value lower than -2 is invalid at runtime.
- *
- * State diagram:
- *
- * post(1) ==> 2
- * post(0) ==> 1
- * post(-1) ==> 1, then wake all waiters
- *
- * wait(2) ==> 1
- * wait(1) ==> 0
- * wait(0) ==> -1 then wait for a wake up + loop
- * wait(-1) ==> -1 then wait for a wake up + loop
- *
- */
-
-/* Use the upper 31-bits for the counter, and the lower one
- * for the shared flag.
- */
-#define SEMCOUNT_SHARED_MASK 0x00000001
-#define SEMCOUNT_VALUE_MASK 0xfffffffe
-#define SEMCOUNT_VALUE_SHIFT 1
-
-/* Maximum unsigned value that can be stored in the semaphore.
- * One bit is used for the shared flag, another one for the
- * sign bit, leaving us with only 30 bits.
- */
-#define SEM_MAX_VALUE 0x3fffffff
-
-/* convert a value into the corresponding sem->count bit pattern */
-#define SEMCOUNT_FROM_VALUE(val) (((val) << SEMCOUNT_VALUE_SHIFT) & SEMCOUNT_VALUE_MASK)
-
-/* convert a sem->count bit pattern into the corresponding signed value */
-#define SEMCOUNT_TO_VALUE(sval) ((int)(sval) >> SEMCOUNT_VALUE_SHIFT)
-
-/* the value +1 as a sem->count bit-pattern. */
-#define SEMCOUNT_ONE SEMCOUNT_FROM_VALUE(1)
-
-/* the value -1 as a sem->count bit-pattern. */
-#define SEMCOUNT_MINUS_ONE SEMCOUNT_FROM_VALUE(-1)
-
-#define SEMCOUNT_DECREMENT(sval) (((sval) - (1U << SEMCOUNT_VALUE_SHIFT)) & SEMCOUNT_VALUE_MASK)
-#define SEMCOUNT_INCREMENT(sval) (((sval) + (1U << SEMCOUNT_VALUE_SHIFT)) & SEMCOUNT_VALUE_MASK)
-
-/* return the shared bitflag from a semaphore */
-#define SEM_GET_SHARED(sem) ((sem)->count & SEMCOUNT_SHARED_MASK)
-
-
-int sem_init(sem_t *sem, int pshared, unsigned int value)
-{
- if (sem == NULL) {
- errno = EINVAL;
- return -1;
- }
-
- /* ensure that 'value' can be stored in the semaphore */
- if (value > SEM_MAX_VALUE) {
- errno = EINVAL;
- return -1;
- }
-
- sem->count = SEMCOUNT_FROM_VALUE(value);
- if (pshared != 0)
- sem->count |= SEMCOUNT_SHARED_MASK;
-
- return 0;
-}
-
-
-int sem_destroy(sem_t *sem)
-{
- int count;
-
- if (sem == NULL) {
- errno = EINVAL;
- return -1;
- }
- count = SEMCOUNT_TO_VALUE(sem->count);
- if (count < 0) {
- errno = EBUSY;
- return -1;
- }
- sem->count = 0;
- return 0;
-}
-
-
-sem_t *sem_open(const char *name __unused, int oflag __unused, ...)
-{
- errno = ENOSYS;
- return SEM_FAILED;
-}
-
-
-int sem_close(sem_t *sem)
-{
- if (sem == NULL) {
- errno = EINVAL;
- return -1;
- }
- errno = ENOSYS;
- return -1;
-}
-
-
-int sem_unlink(const char* name __unused)
-{
- errno = ENOSYS;
- return -1;
-}
-
-
-/* Decrement a semaphore's value atomically,
- * and return the old one. As a special case,
- * this returns immediately if the value is
- * negative (i.e. -1)
- */
-static int
-__sem_dec(volatile unsigned int *pvalue)
-{
- unsigned int shared = (*pvalue & SEMCOUNT_SHARED_MASK);
- unsigned int old, new;
- int ret;
-
- do {
- old = (*pvalue & SEMCOUNT_VALUE_MASK);
- ret = SEMCOUNT_TO_VALUE(old);
- if (ret < 0)
- break;
-
- new = SEMCOUNT_DECREMENT(old);
- }
- while (__bionic_cmpxchg((int)(old|shared),
- (int)(new|shared),
- (volatile int *)pvalue) != 0);
- return ret;
-}
-
-/* Same as __sem_dec, but will not touch anything if the
- * value is already negative *or* 0. Returns the old value.
- */
-static int
-__sem_trydec(volatile unsigned int *pvalue)
-{
- unsigned int shared = (*pvalue & SEMCOUNT_SHARED_MASK);
- unsigned int old, new;
- int ret;
-
- do {
- old = (*pvalue & SEMCOUNT_VALUE_MASK);
- ret = SEMCOUNT_TO_VALUE(old);
- if (ret <= 0)
- break;
-
- new = SEMCOUNT_DECREMENT(old);
- }
- while (__bionic_cmpxchg((int)(old|shared),
- (int)(new|shared),
- (volatile int *)pvalue) != 0);
-
- return ret;
-}
-
-
-/* "Increment" the value of a semaphore atomically and
- * return its old value. Note that this implements
- * the special case of "incrementing" any negative
- * value to +1 directly.
- *
- * NOTE: The value will _not_ wrap above SEM_VALUE_MAX
- */
-static int
-__sem_inc(volatile unsigned int *pvalue)
-{
- unsigned int shared = (*pvalue & SEMCOUNT_SHARED_MASK);
- unsigned int old, new;
- int ret;
-
- do {
- old = (*pvalue & SEMCOUNT_VALUE_MASK);
- ret = SEMCOUNT_TO_VALUE(old);
-
- /* Can't go higher than SEM_MAX_VALUE */
- if (ret == SEM_MAX_VALUE)
- break;
-
- /* If the counter is negative, go directly to +1,
- * otherwise just increment */
- if (ret < 0)
- new = SEMCOUNT_ONE;
- else
- new = SEMCOUNT_INCREMENT(old);
- }
- while ( __bionic_cmpxchg((int)(old|shared),
- (int)(new|shared),
- (volatile int*)pvalue) != 0);
-
- return ret;
-}
-
-/* lock a semaphore */
-int sem_wait(sem_t *sem)
-{
- unsigned shared;
-
- if (sem == NULL) {
- errno = EINVAL;
- return -1;
- }
-
- shared = SEM_GET_SHARED(sem);
-
- for (;;) {
- if (__sem_dec(&sem->count) > 0)
- break;
-
- __futex_wait_ex(&sem->count, shared, shared|SEMCOUNT_MINUS_ONE, NULL);
- }
- ANDROID_MEMBAR_FULL();
- return 0;
-}
-
-int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout)
-{
- unsigned int shared;
-
- if (sem == NULL) {
- errno = EINVAL;
- return -1;
- }
-
- /* POSIX says we need to try to decrement the semaphore
- * before checking the timeout value. Note that if the
- * value is currently 0, __sem_trydec() does nothing.
- */
- if (__sem_trydec(&sem->count) > 0) {
- ANDROID_MEMBAR_FULL();
- return 0;
- }
-
- /* Check it as per Posix */
- if (abs_timeout == NULL ||
- abs_timeout->tv_sec < 0 ||
- abs_timeout->tv_nsec < 0 ||
- abs_timeout->tv_nsec >= 1000000000)
- {
- errno = EINVAL;
- return -1;
- }
-
- shared = SEM_GET_SHARED(sem);
-
- for (;;) {
- struct timespec ts;
- int ret;
-
- /* Posix mandates CLOCK_REALTIME here */
- clock_gettime( CLOCK_REALTIME, &ts );
- ts.tv_sec = abs_timeout->tv_sec - ts.tv_sec;
- ts.tv_nsec = abs_timeout->tv_nsec - ts.tv_nsec;
- if (ts.tv_nsec < 0) {
- ts.tv_nsec += 1000000000;
- ts.tv_sec -= 1;
- }
-
- if (ts.tv_sec < 0 || ts.tv_nsec < 0) {
- errno = ETIMEDOUT;
- return -1;
- }
-
- /* Try to grab the semaphore. If the value was 0, this
- * will also change it to -1 */
- if (__sem_dec(&sem->count) > 0) {
- ANDROID_MEMBAR_FULL();
- break;
- }
-
- /* Contention detected. wait for a wakeup event */
- ret = __futex_wait_ex(&sem->count, shared, shared|SEMCOUNT_MINUS_ONE, &ts);
-
- /* return in case of timeout or interrupt */
- if (ret == -ETIMEDOUT || ret == -EINTR) {
- errno = -ret;
- return -1;
- }
- }
- return 0;
-}
-
-/* Unlock a semaphore */
-int sem_post(sem_t *sem)
-{
- unsigned int shared;
- int old;
-
- if (sem == NULL)
- return EINVAL;
-
- shared = SEM_GET_SHARED(sem);
-
- ANDROID_MEMBAR_FULL();
- old = __sem_inc(&sem->count);
- if (old < 0) {
- /* contention on the semaphore, wake up all waiters */
- __futex_wake_ex(&sem->count, shared, INT_MAX);
- }
- else if (old == SEM_MAX_VALUE) {
- /* overflow detected */
- errno = EOVERFLOW;
- return -1;
- }
-
- return 0;
-}
-
-int sem_trywait(sem_t *sem)
-{
- if (sem == NULL) {
- errno = EINVAL;
- return -1;
- }
-
- if (__sem_trydec(&sem->count) > 0) {
- ANDROID_MEMBAR_FULL();
- return 0;
- } else {
- errno = EAGAIN;
- return -1;
- }
-}
-
-/* Note that Posix requires that sem_getvalue() returns, in
- * case of contention, the negative of the number of waiting
- * threads.
- *
- * However, code that depends on this negative value to be
- * meaningful is most probably racy. The GLibc sem_getvalue()
- * only returns the semaphore value, which is 0, in case of
- * contention, so we will mimick this behaviour here instead
- * for better compatibility.
- */
-int sem_getvalue(sem_t *sem, int *sval)
-{
- int val;
-
- if (sem == NULL || sval == NULL) {
- errno = EINVAL;
- return -1;
- }
-
- val = SEMCOUNT_TO_VALUE(sem->count);
- if (val < 0)
- val = 0;
-
- *sval = val;
- return 0;
-}
diff --git a/libc/bionic/semaphore.cpp b/libc/bionic/semaphore.cpp
new file mode 100644
index 0000000..dabfea0
--- /dev/null
+++ b/libc/bionic/semaphore.cpp
@@ -0,0 +1,289 @@
+/*
+ * 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 <semaphore.h>
+#include <errno.h>
+#include <limits.h>
+#include <sys/time.h>
+#include <time.h>
+
+#include "private/bionic_atomic_inline.h"
+#include "private/bionic_constants.h"
+#include "private/bionic_futex.h"
+#include "private/bionic_time_conversions.h"
+
+// In this implementation, a semaphore contains a
+// 31-bit signed value and a 1-bit 'shared' flag
+// (for process-sharing purpose).
+//
+// We use the value -1 to indicate contention on the
+// semaphore, 0 or more to indicate uncontended state,
+// any value lower than -2 is invalid at runtime.
+//
+// State diagram:
+//
+// post(1) ==> 2
+// post(0) ==> 1
+// post(-1) ==> 1, then wake all waiters
+//
+// wait(2) ==> 1
+// wait(1) ==> 0
+// wait(0) ==> -1 then wait for a wake up + loop
+// wait(-1) ==> -1 then wait for a wake up + loop
+
+// Use the upper 31-bits for the counter, and the lower one
+// for the shared flag.
+#define SEMCOUNT_SHARED_MASK 0x00000001
+#define SEMCOUNT_VALUE_MASK 0xfffffffe
+#define SEMCOUNT_VALUE_SHIFT 1
+
+// Convert a value into the corresponding sem->count bit pattern.
+#define SEMCOUNT_FROM_VALUE(val) (((val) << SEMCOUNT_VALUE_SHIFT) & SEMCOUNT_VALUE_MASK)
+
+// Convert a sem->count bit pattern into the corresponding signed value.
+static inline int SEMCOUNT_TO_VALUE(uint32_t sval) {
+ return (static_cast<int>(sval) >> SEMCOUNT_VALUE_SHIFT);
+}
+
+// The value +1 as a sem->count bit-pattern.
+#define SEMCOUNT_ONE SEMCOUNT_FROM_VALUE(1)
+
+// The value -1 as a sem->count bit-pattern.
+#define SEMCOUNT_MINUS_ONE SEMCOUNT_FROM_VALUE(-1)
+
+#define SEMCOUNT_DECREMENT(sval) (((sval) - (1U << SEMCOUNT_VALUE_SHIFT)) & SEMCOUNT_VALUE_MASK)
+#define SEMCOUNT_INCREMENT(sval) (((sval) + (1U << SEMCOUNT_VALUE_SHIFT)) & SEMCOUNT_VALUE_MASK)
+
+// Return the shared bitflag from a semaphore.
+static inline uint32_t SEM_GET_SHARED(sem_t* sem) {
+ return (sem->count & SEMCOUNT_SHARED_MASK);
+}
+
+
+int sem_init(sem_t* sem, int pshared, unsigned int value) {
+ // Ensure that 'value' can be stored in the semaphore.
+ if (value > SEM_VALUE_MAX) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ sem->count = SEMCOUNT_FROM_VALUE(value);
+ if (pshared != 0) {
+ sem->count |= SEMCOUNT_SHARED_MASK;
+ }
+ return 0;
+}
+
+int sem_destroy(sem_t*) {
+ return 0;
+}
+
+sem_t* sem_open(const char*, int, ...) {
+ errno = ENOSYS;
+ return SEM_FAILED;
+}
+
+int sem_close(sem_t*) {
+ errno = ENOSYS;
+ return -1;
+}
+
+int sem_unlink(const char*) {
+ errno = ENOSYS;
+ return -1;
+}
+
+// Decrement a semaphore's value atomically,
+// and return the old one. As a special case,
+// this returns immediately if the value is
+// negative (i.e. -1)
+static int __sem_dec(volatile uint32_t* sem) {
+ volatile int32_t* ptr = reinterpret_cast<volatile int32_t*>(sem);
+ uint32_t shared = (*sem & SEMCOUNT_SHARED_MASK);
+ uint32_t old_value, new_value;
+ int ret;
+
+ do {
+ old_value = (*sem & SEMCOUNT_VALUE_MASK);
+ ret = SEMCOUNT_TO_VALUE(old_value);
+ if (ret < 0) {
+ break;
+ }
+
+ new_value = SEMCOUNT_DECREMENT(old_value);
+ } while (__bionic_cmpxchg((old_value|shared), (new_value|shared), ptr) != 0);
+
+ return ret;
+}
+
+// Same as __sem_dec, but will not touch anything if the
+// value is already negative *or* 0. Returns the old value.
+static int __sem_trydec(volatile uint32_t* sem) {
+ volatile int32_t* ptr = reinterpret_cast<volatile int32_t*>(sem);
+ uint32_t shared = (*sem & SEMCOUNT_SHARED_MASK);
+ uint32_t old_value, new_value;
+ int ret;
+
+ do {
+ old_value = (*sem & SEMCOUNT_VALUE_MASK);
+ ret = SEMCOUNT_TO_VALUE(old_value);
+ if (ret <= 0) {
+ break;
+ }
+
+ new_value = SEMCOUNT_DECREMENT(old_value);
+ } while (__bionic_cmpxchg((old_value|shared), (new_value|shared), ptr) != 0);
+
+ return ret;
+}
+
+
+// "Increment" the value of a semaphore atomically and
+// return its old value. Note that this implements
+// the special case of "incrementing" any negative
+// value to +1 directly.
+//
+// NOTE: The value will _not_ wrap above SEM_VALUE_MAX
+static int __sem_inc(volatile uint32_t* sem) {
+ volatile int32_t* ptr = reinterpret_cast<volatile int32_t*>(sem);
+ uint32_t shared = (*sem & SEMCOUNT_SHARED_MASK);
+ uint32_t old_value, new_value;
+ int ret;
+
+ do {
+ old_value = (*sem & SEMCOUNT_VALUE_MASK);
+ ret = SEMCOUNT_TO_VALUE(old_value);
+
+ // Can't go higher than SEM_VALUE_MAX.
+ if (ret == SEM_VALUE_MAX) {
+ break;
+ }
+
+ // If the counter is negative, go directly to +1, otherwise just increment.
+ if (ret < 0) {
+ new_value = SEMCOUNT_ONE;
+ } else {
+ new_value = SEMCOUNT_INCREMENT(old_value);
+ }
+ } while (__bionic_cmpxchg((old_value|shared), (new_value|shared), ptr) != 0);
+
+ return ret;
+}
+
+int sem_wait(sem_t* sem) {
+ uint32_t shared = SEM_GET_SHARED(sem);
+
+ while (true) {
+ if (__sem_dec(&sem->count) > 0) {
+ ANDROID_MEMBAR_FULL();
+ return 0;
+ }
+
+ __futex_wait_ex(&sem->count, shared, shared|SEMCOUNT_MINUS_ONE, NULL);
+ }
+}
+
+int sem_timedwait(sem_t* sem, const timespec* abs_timeout) {
+ // POSIX says we need to try to decrement the semaphore
+ // before checking the timeout value. Note that if the
+ // value is currently 0, __sem_trydec() does nothing.
+ if (__sem_trydec(&sem->count) > 0) {
+ ANDROID_MEMBAR_FULL();
+ return 0;
+ }
+
+ // Check it as per POSIX.
+ if (abs_timeout == NULL || abs_timeout->tv_sec < 0 || abs_timeout->tv_nsec < 0 || abs_timeout->tv_nsec >= NS_PER_S) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ uint32_t shared = SEM_GET_SHARED(sem);
+
+ while (true) {
+ // POSIX mandates CLOCK_REALTIME here.
+ timespec ts;
+ if (!timespec_from_absolute_timespec(ts, *abs_timeout, CLOCK_REALTIME)) {
+ errno = ETIMEDOUT;
+ return -1;
+ }
+
+ // Try to grab the semaphore. If the value was 0, this will also change it to -1.
+ if (__sem_dec(&sem->count) > 0) {
+ ANDROID_MEMBAR_FULL();
+ break;
+ }
+
+ // Contention detected. Wait for a wakeup event.
+ int ret = __futex_wait_ex(&sem->count, shared, shared|SEMCOUNT_MINUS_ONE, &ts);
+
+ // Return in case of timeout or interrupt.
+ if (ret == -ETIMEDOUT || ret == -EINTR) {
+ errno = -ret;
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int sem_post(sem_t* sem) {
+ uint32_t shared = SEM_GET_SHARED(sem);
+
+ ANDROID_MEMBAR_FULL();
+ int old_value = __sem_inc(&sem->count);
+ if (old_value < 0) {
+ // Contention on the semaphore. Wake up all waiters.
+ __futex_wake_ex(&sem->count, shared, INT_MAX);
+ } else if (old_value == SEM_VALUE_MAX) {
+ // Overflow detected.
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+ return 0;
+}
+
+int sem_trywait(sem_t* sem) {
+ if (__sem_trydec(&sem->count) > 0) {
+ ANDROID_MEMBAR_FULL();
+ return 0;
+ } else {
+ errno = EAGAIN;
+ return -1;
+ }
+}
+
+int sem_getvalue(sem_t* sem, int* sval) {
+ int val = SEMCOUNT_TO_VALUE(sem->count);
+ if (val < 0) {
+ val = 0;
+ }
+
+ *sval = val;
+ return 0;
+}
diff --git a/libc/bionic/strcoll_l.cpp b/libc/bionic/strcoll_l.cpp
deleted file mode 100644
index 7d7c28b..0000000
--- a/libc/bionic/strcoll_l.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2014 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 <string.h>
-
-int strcoll_l(const char *s1, const char *s2, locale_t) {
- return strcoll(s1, s2);
-}
diff --git a/libc/bionic/strerror_r.cpp b/libc/bionic/strerror_r.cpp
index 1e57cc0..d419fb1 100644
--- a/libc/bionic/strerror_r.cpp
+++ b/libc/bionic/strerror_r.cpp
@@ -1,11 +1,16 @@
/* $OpenBSD: strerror_r.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
/* Public Domain <marc@snafu.org> */
+// G++ automatically defines _GNU_SOURCE, which then means that <string.h>
+// gives us the GNU variant.
+#undef _GNU_SOURCE
+
+#include <string.h>
+
#include <errno.h>
#include <limits.h>
#include <signal.h>
#include <stdio.h>
-#include <string.h>
#include "private/ErrnoRestorer.h"
#include "private/libc_logging.h"
@@ -62,6 +67,12 @@
return 0;
}
+extern "C" char* __gnu_strerror_r(int error_number, char* buf, size_t buf_len) {
+ ErrnoRestorer errno_restorer; // The glibc strerror_r doesn't set errno if it truncates...
+ strerror_r(error_number, buf, buf_len);
+ return buf; // ...and just returns whatever fit.
+}
+
extern "C" __LIBC_HIDDEN__ const char* __strsignal(int signal_number, char* buf, size_t buf_len) {
const char* signal_name = __strsignal_lookup(signal_number);
if (signal_name != NULL) {
diff --git a/libc/bionic/strtold_l.cpp b/libc/bionic/strtold_l.cpp
deleted file mode 100644
index 4b230b9..0000000
--- a/libc/bionic/strtold_l.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2014 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 <stdlib.h>
-
-long double strtold_l(const char *nptr, char **endptr, locale_t) {
- return strtold(nptr, endptr);
-}
diff --git a/libc/bionic/strtoll_l.cpp b/libc/bionic/strtoll_l.cpp
deleted file mode 100644
index 47b126e..0000000
--- a/libc/bionic/strtoll_l.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2014 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 <stdlib.h>
-
-long long strtoll_l(const char *nptr, char **endptr, int base, locale_t) {
- return strtoll(nptr, endptr, base);
-}
diff --git a/libc/bionic/strtoull_l.cpp b/libc/bionic/strtoull_l.cpp
deleted file mode 100644
index 398ba0e..0000000
--- a/libc/bionic/strtoull_l.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2014 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 <stdlib.h>
-
-unsigned long long strtoull_l(const char *nptr, char **endptr, int base,
- locale_t) {
- return strtoull(nptr, endptr, base);
-}
diff --git a/libc/bionic/stubs.cpp b/libc/bionic/stubs.cpp
index b1e38be..88e5ac5 100644
--- a/libc/bionic/stubs.cpp
+++ b/libc/bionic/stubs.cpp
@@ -40,10 +40,10 @@
#include "private/android_filesystem_config.h"
#include "private/ErrnoRestorer.h"
#include "private/libc_logging.h"
+#include "private/ThreadLocalBuffer.h"
-// Thread-specific state for the non-reentrant functions.
-static pthread_once_t stubs_once = PTHREAD_ONCE_INIT;
-static pthread_key_t stubs_key;
+GLOBAL_INIT_THREAD_LOCAL_BUFFER(stubs);
+
struct stubs_state_t {
passwd passwd_;
group group_;
@@ -113,39 +113,14 @@
return do_getpw_r(0, NULL, uid, pwd, buf, byte_count, result);
}
-static stubs_state_t* stubs_state_alloc() {
- stubs_state_t* s = static_cast<stubs_state_t*>(calloc(1, sizeof(*s)));
- if (s != NULL) {
- s->group_.gr_mem = s->group_members_;
- }
- return s;
-}
-
-static void stubs_state_free(void* ptr) {
- stubs_state_t* state = static_cast<stubs_state_t*>(ptr);
- free(state);
-}
-
-static void __stubs_key_init() {
- pthread_key_create(&stubs_key, stubs_state_free);
-}
-
static stubs_state_t* __stubs_state() {
- pthread_once(&stubs_once, __stubs_key_init);
- stubs_state_t* s = static_cast<stubs_state_t*>(pthread_getspecific(stubs_key));
- if (s == NULL) {
- s = stubs_state_alloc();
- if (s == NULL) {
- errno = ENOMEM; // Just in case.
- } else {
- if (pthread_setspecific(stubs_key, s) != 0) {
- stubs_state_free(s);
- errno = ENOMEM;
- s = NULL;
- }
- }
+ LOCAL_INIT_THREAD_LOCAL_BUFFER(stubs_state_t*, stubs, sizeof(stubs_state_t));
+
+ if (stubs_tls_buffer != NULL) {
+ memset(stubs_tls_buffer, 0, sizeof(stubs_state_t));
+ stubs_tls_buffer->group_.gr_mem = stubs_tls_buffer->group_members_;
}
- return s;
+ return stubs_tls_buffer;
}
static passwd* android_iinfo_to_passwd(stubs_state_t* state,
@@ -167,7 +142,6 @@
gr->gr_name = (char*) iinfo->name;
gr->gr_gid = iinfo->aid;
gr->gr_mem[0] = gr->gr_name;
- gr->gr_mem[1] = NULL;
return gr;
}
@@ -208,18 +182,27 @@
}
// Translate a user/group name to the corresponding user/group id.
+// all_a1234 -> 0 * AID_USER + AID_SHARED_GID_START + 1234 (group name only)
// u0_a1234 -> 0 * AID_USER + AID_APP + 1234
// u2_i1000 -> 2 * AID_USER + AID_ISOLATED_START + 1000
// u1_system -> 1 * AID_USER + android_ids['system']
// returns 0 and sets errno to ENOENT in case of error
-static unsigned app_id_from_name(const char* name) {
- if (name[0] != 'u' || !isdigit(name[1])) {
+static unsigned app_id_from_name(const char* name, bool is_group) {
+ char* end;
+ unsigned long userid;
+ bool is_shared_gid = false;
+
+ if (is_group && name[0] == 'a' && name[1] == 'l' && name[2] == 'l') {
+ end = const_cast<char*>(name+3);
+ userid = 0;
+ is_shared_gid = true;
+ } else if (name[0] == 'u' && isdigit(name[1])) {
+ userid = strtoul(name+1, &end, 10);
+ } else {
errno = ENOENT;
return 0;
}
- char* end;
- unsigned long userid = strtoul(name+1, &end, 10);
if (end[0] != '_' || end[1] == 0) {
errno = ENOENT;
return 0;
@@ -227,8 +210,17 @@
unsigned long appid = 0;
if (end[1] == 'a' && isdigit(end[2])) {
- // end will point to \0 if the strtoul below succeeds.
- appid = strtoul(end+2, &end, 10) + AID_APP;
+ if (is_shared_gid) {
+ // end will point to \0 if the strtoul below succeeds.
+ appid = strtoul(end+2, &end, 10) + AID_SHARED_GID_START;
+ if (appid > AID_SHARED_GID_END) {
+ errno = ENOENT;
+ return 0;
+ }
+ } else {
+ // end will point to \0 if the strtoul below succeeds.
+ appid = strtoul(end+2, &end, 10) + AID_APP;
+ }
} else if (end[1] == 'i' && isdigit(end[2])) {
// end will point to \0 if the strtoul below succeeds.
appid = strtoul(end+2, &end, 10) + AID_ISOLATED_START;
@@ -263,12 +255,11 @@
return (unsigned)(appid + userid*AID_USER);
}
-static void print_app_name_from_appid_userid(const uid_t appid,
- const uid_t userid, char* buffer, const int bufferlen) {
+static void print_app_name_from_uid(const uid_t uid, char* buffer, const int bufferlen) {
+ const uid_t appid = uid % AID_USER;
+ const uid_t userid = uid / AID_USER;
if (appid >= AID_ISOLATED_START) {
snprintf(buffer, bufferlen, "u%u_i%u", userid, appid - AID_ISOLATED_START);
- } else if (userid == 0 && appid >= AID_SHARED_GID_START) {
- snprintf(buffer, bufferlen, "all_a%u", appid - AID_SHARED_GID_START);
} else if (appid < AID_APP) {
for (size_t n = 0; n < android_id_count; n++) {
if (android_ids[n].aid == appid) {
@@ -281,10 +272,23 @@
}
}
-static void print_app_name_from_uid(const uid_t uid, char* buffer, const int bufferlen) {
- const uid_t appid = uid % AID_USER;
- const uid_t userid = uid / AID_USER;
- return print_app_name_from_appid_userid(appid, userid, buffer, bufferlen);
+static void print_app_name_from_gid(const gid_t gid, char* buffer, const int bufferlen) {
+ const uid_t appid = gid % AID_USER;
+ const uid_t userid = gid / AID_USER;
+ if (appid >= AID_ISOLATED_START) {
+ snprintf(buffer, bufferlen, "u%u_i%u", userid, appid - AID_ISOLATED_START);
+ } else if (userid == 0 && appid >= AID_SHARED_GID_START && appid <= AID_SHARED_GID_END) {
+ snprintf(buffer, bufferlen, "all_a%u", appid - AID_SHARED_GID_START);
+ } else if (appid < AID_APP) {
+ for (size_t n = 0; n < android_id_count; n++) {
+ if (android_ids[n].aid == appid) {
+ snprintf(buffer, bufferlen, "u%u_%s", userid, android_ids[n].name);
+ return;
+ }
+ }
+ } else {
+ snprintf(buffer, bufferlen, "u%u_a%u", userid, appid - AID_APP);
+ }
}
// Translate a uid into the corresponding name.
@@ -301,12 +305,9 @@
return NULL;
}
+ print_app_name_from_uid(uid, state->app_name_buffer_, sizeof(state->app_name_buffer_));
+
const uid_t appid = uid % AID_USER;
- const uid_t userid = uid / AID_USER;
-
- print_app_name_from_appid_userid(appid, userid, state->app_name_buffer_,
- sizeof(state->app_name_buffer_));
-
if (appid < AID_APP) {
snprintf(state->dir_buffer_, sizeof(state->dir_buffer_), "/");
} else {
@@ -332,14 +333,13 @@
return NULL;
}
- print_app_name_from_uid(gid, state->group_name_buffer_,
- sizeof(state->group_name_buffer_));
+ print_app_name_from_gid(gid, state->group_name_buffer_, sizeof(state->group_name_buffer_));
group* gr = &state->group_;
gr->gr_name = state->group_name_buffer_;
gr->gr_gid = gid;
gr->gr_mem[0] = gr->gr_name;
- gr->gr_mem[1] = NULL;
+
return gr;
}
@@ -367,7 +367,7 @@
if (pw != NULL) {
return pw;
}
- return app_id_to_passwd(app_id_from_name(login), state);
+ return app_id_to_passwd(app_id_from_name(login, false), state);
}
// All users are in just one group, the one passed in.
@@ -395,7 +395,6 @@
if (gr != NULL) {
return gr;
}
-
return app_id_to_group(gid, state);
}
@@ -408,8 +407,7 @@
if (android_name_to_group(&state->group_, name) != 0) {
return &state->group_;
}
-
- return app_id_to_group(app_id_from_name(name), state);
+ return app_id_to_group(app_id_from_name(name, true), state);
}
// We don't have an /etc/networks, so all inputs return NULL.
diff --git a/libc/bionic/sysconf.cpp b/libc/bionic/sysconf.cpp
index 7734e40..67f48e7 100644
--- a/libc/bionic/sysconf.cpp
+++ b/libc/bionic/sysconf.cpp
@@ -26,123 +26,19 @@
* SUCH DAMAGE.
*/
-#include <ctype.h>
-#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
+#include <linux/uio.h> // For UIO_MAXIOV.
#include <pthread.h>
#include <stdio.h> // For FOPEN_MAX.
-#include <string.h>
+#include <sys/auxv.h>
#include <sys/sysconf.h>
+#include <sys/sysinfo.h>
#include <time.h>
#include <unistd.h>
#include "private/bionic_tls.h"
-#include "private/ScopedReaddir.h"
-
-/* seems to be the default on Linux, per the GLibc sources and my own digging */
-
-#define SYSTEM_CLK_TCK 100
-#define SYSTEM_IOV_MAX 1024
-#define SYSTEM_DELAYTIMER_MAX 2147483647
-#define SYSTEM_MQ_OPEN_MAX 8
-#define SYSTEM_MQ_PRIO_MAX 32768
-#define SYSTEM_SEM_NSEMS_MAX 256
-#define SYSTEM_SEM_VALUE_MAX 0x3fffffff /* see bionic/semaphore.c */
-#define SYSTEM_SIGQUEUE_MAX 32
-#define SYSTEM_TIMER_MAX 32
-#define SYSTEM_LOGIN_NAME_MAX 256
-#define SYSTEM_TTY_NAME_MAX 32
-
-/* the following depends on our implementation */
-#define SYSTEM_ATEXIT_MAX 65536 /* our implementation is unlimited */
-#define SYSTEM_THREAD_THREADS_MAX 2048 /* really unlimited */
-
-#define SYSTEM_2_C_BIND _POSIX_VERSION /* Posix C binding version */
-#define SYSTEM_2_C_VER _POSIX2_C_VERSION
-#define SYSTEM_2_C_DEV -1 /* Posix C development tools unsupported on the device */
-#define SYSTEM_2_FORT_DEV -1 /* Fortran development unsupported */
-#define SYSTEM_2_FORT_RUN -1 /* Fortran runtime unsupported */
-#define SYSTEM_2_SW_DEV -1 /* posix software dev utilities unsupported */
-#define SYSTEM_2_LOCALEDEF -1 /* localedef() unimplemented */
-#define SYSTEM_2_UPE -1 /* No UPE for you ! (User Portability Utilities) */
-#define SYSTEM_2_VERSION -1 /* No posix command-line tools */
-
-static bool __matches_cpuN(const char* s) {
- // The %c trick is to ensure that we have the anchored match "^cpu[0-9]+$".
- unsigned cpu;
- char dummy;
- return (sscanf(s, "cpu%u%c", &cpu, &dummy) == 1);
-}
-
-static int __sysconf_nprocessors_conf() {
- // On x86 kernels you can use /proc/cpuinfo for this, but on ARM kernels offline CPUs disappear
- // from there. This method works on both.
- ScopedReaddir reader("/sys/devices/system/cpu");
- if (reader.IsBad()) {
- return 1;
- }
-
- int result = 0;
- dirent* entry;
- while ((entry = reader.ReadEntry()) != NULL) {
- if (entry->d_type == DT_DIR && __matches_cpuN(entry->d_name)) {
- ++result;
- }
- }
- return result;
-}
-
-static int __sysconf_nprocessors_onln() {
- FILE* fp = fopen("/proc/stat", "r");
- if (fp == NULL) {
- return 1;
- }
-
- int result = 0;
- char buf[256];
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- // Extract just the first word from the line.
- // 'cpu0 7976751 1364388 3116842 469770388 8629405 0 49047 0 0 0'
- char* p = strchr(buf, ' ');
- if (p != NULL) {
- *p = 0;
- }
- if (__matches_cpuN(buf)) {
- ++result;
- }
- }
- fclose(fp);
- return result;
-}
-
-static int __get_meminfo(const char* pattern) {
- FILE* fp = fopen("/proc/meminfo", "r");
- if (fp == NULL) {
- return -1;
- }
-
- int result = -1;
- char buf[256];
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- long total;
- if (sscanf(buf, pattern, &total) == 1) {
- result = (int) (total / (PAGE_SIZE/1024));
- break;
- }
- }
- fclose(fp);
- return result;
-}
-
-static int __sysconf_phys_pages() {
- return __get_meminfo("MemTotal: %ld kB");
-}
-
-static int __sysconf_avphys_pages() {
- return __get_meminfo("MemFree: %ld kB");
-}
static int __sysconf_monotonic_clock() {
timespec t;
@@ -151,199 +47,141 @@
}
long sysconf(int name) {
- switch (name) {
-#ifdef _POSIX_ARG_MAX
- case _SC_ARG_MAX: return _POSIX_ARG_MAX;
-#endif
-#ifdef _POSIX2_BC_BASE_MAX
- case _SC_BC_BASE_MAX: return _POSIX2_BC_BASE_MAX;
-#endif
-#ifdef _POSIX2_BC_DIM_MAX
- case _SC_BC_DIM_MAX: return _POSIX2_BC_DIM_MAX;
-#endif
-#ifdef _POSIX2_BC_SCALE_MAX
- case _SC_BC_SCALE_MAX: return _POSIX2_BC_SCALE_MAX;
-#endif
-#ifdef _POSIX2_BC_STRING_MAX
- case _SC_BC_STRING_MAX: return _POSIX2_BC_STRING_MAX;
-#endif
+ switch (name) {
+ case _SC_ARG_MAX: return ARG_MAX;
+ case _SC_BC_BASE_MAX: return _POSIX2_BC_BASE_MAX; // Minimum requirement.
+ case _SC_BC_DIM_MAX: return _POSIX2_BC_DIM_MAX; // Minimum requirement.
+ case _SC_BC_SCALE_MAX: return _POSIX2_BC_SCALE_MAX; // Minimum requirement.
+ case _SC_BC_STRING_MAX: return _POSIX2_BC_STRING_MAX; // Minimum requirement.
case _SC_CHILD_MAX: return CHILD_MAX;
- case _SC_CLK_TCK: return SYSTEM_CLK_TCK;
-#ifdef _POSIX2_COLL_WEIGHTS_MASK
- case _SC_COLL_WEIGHTS_MAX: return _POSIX2_COLL_WEIGHTS_MASK;
-#endif
-#ifdef _POSIX2_EXPR_NEST_MAX
- case _SC_EXPR_NEST_MAX: return _POSIX2_EXPR_NEST_MAX;
-#endif
-#ifdef _POSIX2_LINE_MAX
- case _SC_LINE_MAX: return _POSIX2_LINE_MAX;
-#endif
+ case _SC_CLK_TCK: return static_cast<long>(getauxval(AT_CLKTCK));
+ case _SC_COLL_WEIGHTS_MAX: return _POSIX2_COLL_WEIGHTS_MAX; // Minimum requirement.
+ case _SC_EXPR_NEST_MAX: return _POSIX2_EXPR_NEST_MAX; // Minimum requirement.
+ case _SC_LINE_MAX: return _POSIX2_LINE_MAX; // Minimum requirement.
case _SC_NGROUPS_MAX: return NGROUPS_MAX;
case _SC_OPEN_MAX: return OPEN_MAX;
- //case _SC_PASS_MAX: return PASS_MAX;
- case _SC_2_C_BIND: return SYSTEM_2_C_BIND;
- case _SC_2_C_DEV: return SYSTEM_2_C_DEV;
- case _SC_2_C_VERSION: return SYSTEM_2_C_VER;
- //case _SC_2_CHAR_TERM: return ;
- case _SC_2_FORT_DEV: return SYSTEM_2_FORT_DEV;
- case _SC_2_FORT_RUN: return SYSTEM_2_FORT_RUN;
- case _SC_2_LOCALEDEF: return SYSTEM_2_LOCALEDEF;
- case _SC_2_SW_DEV: return SYSTEM_2_SW_DEV;
- case _SC_2_UPE: return SYSTEM_2_UPE;
- case _SC_2_VERSION: return SYSTEM_2_VERSION;
-#ifdef _POSIX_JOB_CONTROL
+ case _SC_PASS_MAX: return PASS_MAX;
+ case _SC_2_C_BIND: return _POSIX2_C_BIND;
+ case _SC_2_C_DEV: return _POSIX2_C_DEV;
+ case _SC_2_CHAR_TERM: return _POSIX2_CHAR_TERM;
+ case _SC_2_FORT_DEV: return -1;
+ case _SC_2_FORT_RUN: return -1;
+ case _SC_2_LOCALEDEF: return _POSIX2_LOCALEDEF;
+ case _SC_2_SW_DEV: return _POSIX2_SW_DEV;
+ case _SC_2_UPE: return _POSIX2_UPE;
+ case _SC_2_VERSION: return _POSIX2_VERSION;
case _SC_JOB_CONTROL: return _POSIX_JOB_CONTROL;
-#endif
-#ifdef _POSIX_SAVED_IDS
case _SC_SAVED_IDS: return _POSIX_SAVED_IDS;
-#endif
-#ifdef _POSIX_VERSION
case _SC_VERSION: return _POSIX_VERSION;
-#endif
- //case _SC_RE_DUP_<AX: return ;
+ case _SC_RE_DUP_MAX: return _POSIX_RE_DUP_MAX; // Minimum requirement.
case _SC_STREAM_MAX: return FOPEN_MAX;
- //case _SC_TZNAME_MAX: return ;
-#if _XOPEN_CRYPT
+ case _SC_TZNAME_MAX: return _POSIX_TZNAME_MAX; // Minimum requirement.
case _SC_XOPEN_CRYPT: return _XOPEN_CRYPT;
-#endif
-#ifdef _XOPEN_ENH_I18N
case _SC_XOPEN_ENH_I18N: return _XOPEN_ENH_I18N;
-#endif
-#ifdef _XOPEN_SHM
case _SC_XOPEN_SHM: return _XOPEN_SHM;
-#endif
-#ifdef _XOPEN_VERSION
case _SC_XOPEN_VERSION: return _XOPEN_VERSION;
-#endif
-#ifdef _XOPEN_XCU_VERSION
- case _SC_XOPEN_XCU_VERSION: return _XOPEN_XCU_VERSION;
-#endif
-#ifdef _XOPEN_REALTIME
case _SC_XOPEN_REALTIME: return _XOPEN_REALTIME;
-#endif
-#ifdef _XOPEN_REALTIME_THREADS
case _SC_XOPEN_REALTIME_THREADS: return _XOPEN_REALTIME_THREADS;
-#endif
-#ifdef _XOPEN_LEGACY
case _SC_XOPEN_LEGACY: return _XOPEN_LEGACY;
-#endif
- case _SC_ATEXIT_MAX: return SYSTEM_ATEXIT_MAX;
- case _SC_IOV_MAX: return SYSTEM_IOV_MAX;
+ case _SC_ATEXIT_MAX: return LONG_MAX; // Unlimited.
+ case _SC_IOV_MAX: return UIO_MAXIOV;
- case _SC_PAGESIZE:
- case _SC_PAGE_SIZE:
- return PAGE_SIZE;
-
-#ifdef _XOPEN_UNIX
+ case _SC_PAGESIZE: // Fall through, PAGESIZE and PAGE_SIZE always hold the same value.
+ case _SC_PAGE_SIZE: return PAGE_SIZE;
case _SC_XOPEN_UNIX: return _XOPEN_UNIX;
-#endif
-
- // XXX: TODO: XBS5 nonsense
-
-#ifdef AIO_LISTIO_MAX
- case _SC_AIO_LISTIO_MAX: return AIO_LISTIO_MAX;
-#endif
-#ifdef AIO_MAX
- case _SC_AIO_MAX: return AIO_MAX;
-#endif
-#ifdef AIO_PRIO_DELTA_MAX
- case _SC_AIO_PRIO_DELTA_MAX: return AIO_PRIO_DELTA_MAX;
-#endif
- case _SC_DELAYTIMER_MAX: return SYSTEM_DELAYTIMER_MAX;
- case _SC_MQ_OPEN_MAX: return SYSTEM_MQ_OPEN_MAX;
- case _SC_MQ_PRIO_MAX: return SYSTEM_MQ_PRIO_MAX;
+ case _SC_AIO_LISTIO_MAX: return _POSIX_AIO_LISTIO_MAX; // Minimum requirement.
+ case _SC_AIO_MAX: return _POSIX_AIO_MAX; // Minimum requirement.
+ case _SC_AIO_PRIO_DELTA_MAX:return 0; // Minimum requirement.
+ case _SC_DELAYTIMER_MAX: return INT_MAX;
+ case _SC_MQ_OPEN_MAX: return _POSIX_MQ_OPEN_MAX; // Minimum requirement.
+ case _SC_MQ_PRIO_MAX: return _POSIX_MQ_PRIO_MAX; // Minimum requirement.
case _SC_RTSIG_MAX: return RTSIG_MAX;
- case _SC_SEM_NSEMS_MAX: return SYSTEM_SEM_NSEMS_MAX;
- case _SC_SEM_VALUE_MAX: return SYSTEM_SEM_VALUE_MAX;
- case _SC_SIGQUEUE_MAX: return SYSTEM_SIGQUEUE_MAX;
- case _SC_TIMER_MAX: return SYSTEM_TIMER_MAX;
-#ifdef _POSIX_ASYNCHRONOUS_IO
+ case _SC_SEM_NSEMS_MAX: return _POSIX_SEM_NSEMS_MAX; // Minimum requirement.
+ case _SC_SEM_VALUE_MAX: return SEM_VALUE_MAX;
+ case _SC_SIGQUEUE_MAX: return _POSIX_SIGQUEUE_MAX; // Minimum requirement.
+ case _SC_TIMER_MAX: return _POSIX_TIMER_MAX; // Minimum requirement.
case _SC_ASYNCHRONOUS_IO: return _POSIX_ASYNCHRONOUS_IO;
-#endif
-#ifdef _POSIX_FSYNC
case _SC_FSYNC: return _POSIX_FSYNC;
-#endif
-#ifdef _POSIX_MAPPED_FILES
case _SC_MAPPED_FILES: return _POSIX_MAPPED_FILES;
-#endif
-#ifdef _POSIX_MEMLOCK
case _SC_MEMLOCK: return _POSIX_MEMLOCK;
-#endif
-#ifdef _POSIX_MEMLOCK_RANGE
- case _SC_MEMLOCK_RANGE: return _POSIX_MEMLOCK_RANGE
-#endif
-#ifdef _POSIX_MEMORY_PROTECTION
+ case _SC_MEMLOCK_RANGE: return _POSIX_MEMLOCK_RANGE;
case _SC_MEMORY_PROTECTION: return _POSIX_MEMORY_PROTECTION;
-#endif
-#ifdef _POSIX_MESSAGE_PASSING
case _SC_MESSAGE_PASSING: return _POSIX_MESSAGE_PASSING;
-#endif
-#ifdef _POSIX_PRIORITIZED_IO
case _SC_PRIORITIZED_IO: return _POSIX_PRIORITIZED_IO;
-#endif
-#ifdef _POSIX_PRIORITY_SCHEDULING
case _SC_PRIORITY_SCHEDULING: return _POSIX_PRIORITY_SCHEDULING;
-#endif
-#ifdef _POSIX_REALTIME_SIGNALS
case _SC_REALTIME_SIGNALS: return _POSIX_REALTIME_SIGNALS;
-#endif
-#ifdef _POSIX_SEMAPHORES
case _SC_SEMAPHORES: return _POSIX_SEMAPHORES;
-#endif
-#ifdef _POSIX_SHARED_MEMORY_OBJECTS
case _SC_SHARED_MEMORY_OBJECTS: return _POSIX_SHARED_MEMORY_OBJECTS;
-#endif
-#ifdef _POSIX_SYNCHRONIZED_IO
case _SC_SYNCHRONIZED_IO: return _POSIX_SYNCHRONIZED_IO;
-#endif
-#ifdef _POSIX_TIMERS
case _SC_TIMERS: return _POSIX_TIMERS;
-#endif
-
- case _SC_GETGR_R_SIZE_MAX: return 1024;
- case _SC_GETPW_R_SIZE_MAX: return 1024;
-
- case _SC_LOGIN_NAME_MAX: return SYSTEM_LOGIN_NAME_MAX;
-
- case _SC_THREAD_DESTRUCTOR_ITERATIONS:
- return _POSIX_THREAD_DESTRUCTOR_ITERATIONS;
-
- case _SC_THREAD_KEYS_MAX:
- return (BIONIC_TLS_SLOTS - TLS_SLOT_FIRST_USER_SLOT - BIONIC_TLS_RESERVED_SLOTS);
-
+ case _SC_GETGR_R_SIZE_MAX: return 1024;
+ case _SC_GETPW_R_SIZE_MAX: return 1024;
+ case _SC_LOGIN_NAME_MAX: return 256; // Seems default on linux.
+ case _SC_THREAD_DESTRUCTOR_ITERATIONS: return PTHREAD_DESTRUCTOR_ITERATIONS;
+ case _SC_THREAD_KEYS_MAX: return PTHREAD_KEYS_MAX;
case _SC_THREAD_STACK_MIN: return PTHREAD_STACK_MIN;
- case _SC_THREAD_THREADS_MAX: return SYSTEM_THREAD_THREADS_MAX;
- case _SC_TTY_NAME_MAX: return SYSTEM_TTY_NAME_MAX;
-#ifdef _POSIX_THREADS
+ case _SC_THREAD_THREADS_MAX: return PTHREAD_THREADS_MAX;
+ case _SC_TTY_NAME_MAX: return 32; // Seems default on linux.
case _SC_THREADS: return _POSIX_THREADS;
-#endif
-
- case _SC_THREAD_ATTR_STACKADDR: return -1; // Removed in POSIX 2008
- case _SC_THREAD_ATTR_STACKSIZE: return -1; // Removed in POSIX 2008
-
-#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+ case _SC_THREAD_ATTR_STACKADDR: return _POSIX_THREAD_ATTR_STACKADDR;
+ case _SC_THREAD_ATTR_STACKSIZE: return _POSIX_THREAD_ATTR_STACKSIZE;
case _SC_THREAD_PRIORITY_SCHEDULING: return _POSIX_THREAD_PRIORITY_SCHEDULING;
-#endif
-#ifdef _POSIX_THREAD_PRIO_INHERIT
- case _SC_THREAD_PRIO_INHERIT: return _POSIX_THREAD_PRIO_INHERIT;
-#endif
-#ifdef _POSIX_THREAD_PRIO_PROTECT
+ case _SC_THREAD_PRIO_INHERIT: return _POSIX_THREAD_PRIO_INHERIT;
case _SC_THREAD_PRIO_PROTECT: return _POSIX_THREAD_PRIO_PROTECT;
-#endif
-#ifdef _POSIX_THREAD_SAFE_FUNCTIONS
- case _SC_THREAD_SAFE_FUNCTIONS: return _POSIX_THREAD_SAFE_FUNCTIONS
-#endif
-
+ case _SC_THREAD_SAFE_FUNCTIONS: return _POSIX_THREAD_SAFE_FUNCTIONS;
+ case _SC_NPROCESSORS_CONF: return get_nprocs_conf();
+ case _SC_NPROCESSORS_ONLN: return get_nprocs();
+ case _SC_PHYS_PAGES: return get_phys_pages();
+ case _SC_AVPHYS_PAGES: return get_avphys_pages();
case _SC_MONOTONIC_CLOCK: return __sysconf_monotonic_clock();
- case _SC_NPROCESSORS_CONF: return __sysconf_nprocessors_conf();
- case _SC_NPROCESSORS_ONLN: return __sysconf_nprocessors_onln();
- case _SC_PHYS_PAGES: return __sysconf_phys_pages();
- case _SC_AVPHYS_PAGES: return __sysconf_avphys_pages();
+
+ case _SC_2_PBS: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_2_PBS_ACCOUNTING: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_2_PBS_CHECKPOINT: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_2_PBS_LOCATE: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_2_PBS_MESSAGE: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_2_PBS_TRACK: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_ADVISORY_INFO: return _POSIX_ADVISORY_INFO;
+ case _SC_BARRIERS: return _POSIX_BARRIERS;
+ case _SC_CLOCK_SELECTION: return _POSIX_CLOCK_SELECTION;
+ case _SC_CPUTIME: return _POSIX_CPUTIME;
+ case _SC_HOST_NAME_MAX: return _POSIX_HOST_NAME_MAX; // Minimum requirement.
+ case _SC_IPV6: return _POSIX_IPV6;
+ case _SC_RAW_SOCKETS: return _POSIX_RAW_SOCKETS;
+ case _SC_READER_WRITER_LOCKS: return _POSIX_READER_WRITER_LOCKS;
+ case _SC_REGEXP: return _POSIX_REGEXP;
+ case _SC_SHELL: return _POSIX_SHELL;
+ case _SC_SPAWN: return _POSIX_SPAWN;
+ case _SC_SPIN_LOCKS: return _POSIX_SPIN_LOCKS;
+ case _SC_SPORADIC_SERVER: return _POSIX_SPORADIC_SERVER;
+ case _SC_SS_REPL_MAX: return -1;
+ case _SC_SYMLOOP_MAX: return _POSIX_SYMLOOP_MAX; // Minimum requirement.
+ case _SC_THREAD_CPUTIME: return _POSIX_THREAD_CPUTIME;
+ case _SC_THREAD_PROCESS_SHARED: return _POSIX_THREAD_PROCESS_SHARED;
+ case _SC_THREAD_ROBUST_PRIO_INHERIT: return _POSIX_THREAD_ROBUST_PRIO_INHERIT;
+ case _SC_THREAD_ROBUST_PRIO_PROTECT: return _POSIX_THREAD_ROBUST_PRIO_PROTECT;
+ case _SC_THREAD_SPORADIC_SERVER: return _POSIX_THREAD_SPORADIC_SERVER;
+ case _SC_TIMEOUTS: return _POSIX_TIMEOUTS;
+ case _SC_TRACE: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_TRACE_EVENT_FILTER: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_TRACE_EVENT_NAME_MAX: return -1;
+ case _SC_TRACE_INHERIT: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_TRACE_LOG: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_TRACE_NAME_MAX: return -1;
+ case _SC_TRACE_SYS_MAX: return -1;
+ case _SC_TRACE_USER_EVENT_MAX: return -1;
+ case _SC_TYPED_MEMORY_OBJECTS: return _POSIX_TYPED_MEMORY_OBJECTS;
+ case _SC_V7_ILP32_OFF32: return _POSIX_V7_ILP32_OFF32;
+ case _SC_V7_ILP32_OFFBIG: return _POSIX_V7_ILP32_OFFBIG;
+ case _SC_V7_LP64_OFF64: return _POSIX_V7_LP64_OFF64;
+ case _SC_V7_LPBIG_OFFBIG: return _POSIX_V7_LPBIG_OFFBIG;
+ case _SC_XOPEN_STREAMS: return -1; // Obsolescent in POSIX.1-2008.
+ case _SC_XOPEN_UUCP: return -1;
default:
- /* Posix says EINVAL is the only error that shall be returned,
- * but GLibc uses ENOSYS */
- errno = ENOSYS;
- return -1;
- }
+ // Posix says EINVAL is the only error that shall be returned,
+ // but glibc uses ENOSYS.
+ errno = ENOSYS;
+ return -1;
+ }
}
diff --git a/libc/bionic/sysinfo.cpp b/libc/bionic/sysinfo.cpp
new file mode 100644
index 0000000..6f0afb8
--- /dev/null
+++ b/libc/bionic/sysinfo.cpp
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2014 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 <sys/sysinfo.h>
+
+#include <dirent.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "private/ScopedReaddir.h"
+
+static bool __matches_cpuN(const char* s) {
+ // The %c trick is to ensure that we have the anchored match "^cpu[0-9]+$".
+ unsigned cpu;
+ char dummy;
+ return (sscanf(s, "cpu%u%c", &cpu, &dummy) == 1);
+}
+
+int get_nprocs_conf() {
+ // On x86 kernels you can use /proc/cpuinfo for this, but on ARM kernels offline CPUs disappear
+ // from there. This method works on both.
+ ScopedReaddir reader("/sys/devices/system/cpu");
+ if (reader.IsBad()) {
+ return 1;
+ }
+
+ int result = 0;
+ dirent* entry;
+ while ((entry = reader.ReadEntry()) != NULL) {
+ if (entry->d_type == DT_DIR && __matches_cpuN(entry->d_name)) {
+ ++result;
+ }
+ }
+ return result;
+}
+
+int get_nprocs() {
+ FILE* fp = fopen("/proc/stat", "re");
+ if (fp == NULL) {
+ return 1;
+ }
+
+ int result = 0;
+ char buf[256];
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
+ // Extract just the first word from the line.
+ // 'cpu0 7976751 1364388 3116842 469770388 8629405 0 49047 0 0 0'
+ char* p = strchr(buf, ' ');
+ if (p != NULL) {
+ *p = 0;
+ }
+ if (__matches_cpuN(buf)) {
+ ++result;
+ }
+ }
+ fclose(fp);
+ return result;
+}
+
+static int __get_meminfo(const char* pattern) {
+ FILE* fp = fopen("/proc/meminfo", "re");
+ if (fp == NULL) {
+ return -1;
+ }
+
+ int result = -1;
+ char buf[256];
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
+ long total;
+ if (sscanf(buf, pattern, &total) == 1) {
+ result = (int) (total / (PAGE_SIZE/1024));
+ break;
+ }
+ }
+ fclose(fp);
+ return result;
+}
+
+long get_phys_pages() {
+ return __get_meminfo("MemTotal: %ld kB");
+}
+
+long get_avphys_pages() {
+ return __get_meminfo("MemFree: %ld kB");
+}
diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp
index 0e16bf3..170e7ac 100644
--- a/libc/bionic/system_properties.cpp
+++ b/libc/bionic/system_properties.cpp
@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
#include <new>
+#include <stdatomic.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -45,7 +46,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <netinet/in.h>
-#include <unistd.h>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
@@ -80,6 +80,16 @@
uint8_t namelen;
uint8_t reserved[3];
+ // TODO: The following fields should be declared as atomic_uint32_t.
+ // They should be assigned to with release semantics, instead of using
+ // explicit fences. Unfortunately, the read accesses are generally
+ // followed by more dependent read accesses, and the dependence
+ // is assumed to enforce memory ordering. Which it does on supported
+ // hardware. This technically should use memory_order_consume, if
+ // that worked as intended.
+ // We should also avoid rereading these fields redundantly, since not
+ // all processor implementations ensure that multiple loads from the
+ // same field are carried out in the right order.
volatile uint32_t prop;
volatile uint32_t left;
@@ -93,7 +103,8 @@
this->namelen = name_length;
memcpy(this->name, name, name_length);
this->name[name_length] = '\0';
- ANDROID_MEMBAR_FULL();
+ ANDROID_MEMBAR_FULL(); // TODO: Instead use a release store
+ // for subsequent pointer assignment.
}
private:
@@ -102,14 +113,15 @@
struct prop_area {
uint32_t bytes_used;
- volatile uint32_t serial;
+ atomic_uint_least32_t serial;
uint32_t magic;
uint32_t version;
uint32_t reserved[28];
char data[0];
prop_area(const uint32_t magic, const uint32_t version) :
- serial(0), magic(magic), version(version) {
+ magic(magic), version(version) {
+ atomic_init(&serial, 0);
memset(reserved, 0, sizeof(reserved));
// Allocate enough space for the root node.
bytes_used = sizeof(prop_bt);
@@ -120,7 +132,7 @@
};
struct prop_info {
- volatile uint32_t serial;
+ atomic_uint_least32_t serial;
char value[PROP_VALUE_MAX];
char name[0];
@@ -128,10 +140,11 @@
const uint8_t valuelen) {
memcpy(this->name, name, namelen);
this->name[namelen] = '\0';
- this->serial = (valuelen << 24);
+ atomic_init(&this->serial, valuelen << 24);
memcpy(this->value, value, valuelen);
this->value[valuelen] = '\0';
- ANDROID_MEMBAR_FULL();
+ ANDROID_MEMBAR_FULL(); // TODO: Instead use a release store
+ // for subsequent point assignment.
}
private:
DISALLOW_COPY_AND_ASSIGN(prop_info);
@@ -188,14 +201,6 @@
return -1;
}
- // TODO: Is this really required ? Does android run on any kernels that
- // don't support O_CLOEXEC ?
- const int ret = fcntl(fd, F_SETFD, FD_CLOEXEC);
- if (ret < 0) {
- close(fd);
- return -1;
- }
-
if (ftruncate(fd, PA_SIZE) < 0) {
close(fd);
return -1;
@@ -258,18 +263,9 @@
static int map_prop_area()
{
- int fd(open(property_filename, O_RDONLY | O_NOFOLLOW | O_CLOEXEC));
- if (fd >= 0) {
- /* For old kernels that don't support O_CLOEXEC */
- const int ret = fcntl(fd, F_SETFD, FD_CLOEXEC);
- if (ret < 0) {
- close(fd);
- return -1;
- }
- }
-
+ int fd = open(property_filename, O_CLOEXEC | O_NOFOLLOW | O_RDONLY);
bool close_fd = true;
- if ((fd < 0) && (errno == ENOENT)) {
+ if (fd == -1 && errno == ENOENT) {
/*
* For backwards compatibility, if the file doesn't
* exist, we use the environment to get the file descriptor.
@@ -598,6 +594,14 @@
return find_property(root_node(), name, strlen(name), NULL, 0, false);
}
+// The C11 standard doesn't allow atomic loads from const fields,
+// though C++11 does. Fudge it until standards get straightened out.
+static inline uint_least32_t load_const_atomic(const atomic_uint_least32_t* s,
+ memory_order mo) {
+ atomic_uint_least32_t* non_const_s = const_cast<atomic_uint_least32_t*>(s);
+ return atomic_load_explicit(non_const_s, mo);
+}
+
int __system_property_read(const prop_info *pi, char *name, char *value)
{
if (__predict_false(compat_mode)) {
@@ -605,11 +609,20 @@
}
while (true) {
- uint32_t serial = __system_property_serial(pi);
+ uint32_t serial = __system_property_serial(pi); // acquire semantics
size_t len = SERIAL_VALUE_LEN(serial);
memcpy(value, pi->value, len + 1);
- ANDROID_MEMBAR_FULL();
- if (serial == pi->serial) {
+ // TODO: Fix the synchronization scheme here.
+ // There is no fully supported way to implement this kind
+ // of synchronization in C++11, since the memcpy races with
+ // updates to pi, and the data being accessed is not atomic.
+ // The following fence is unintuitive, but would be the
+ // correct one if memcpy used memory_order_relaxed atomic accesses.
+ // In practice it seems unlikely that the generated code would
+ // would be any different, so this should be OK.
+ atomic_thread_fence(memory_order_acquire);
+ if (serial ==
+ load_const_atomic(&(pi->serial), memory_order_relaxed)) {
if (name != 0) {
strcpy(name, pi->name);
}
@@ -658,14 +671,24 @@
if (len >= PROP_VALUE_MAX)
return -1;
- pi->serial = pi->serial | 1;
- ANDROID_MEMBAR_FULL();
+ uint32_t serial = atomic_load_explicit(&pi->serial, memory_order_relaxed);
+ serial |= 1;
+ atomic_store_explicit(&pi->serial, serial, memory_order_relaxed);
+ // The memcpy call here also races. Again pretend it
+ // used memory_order_relaxed atomics, and use the analogous
+ // counterintuitive fence.
+ atomic_thread_fence(memory_order_release);
memcpy(pi->value, value, len + 1);
- ANDROID_MEMBAR_FULL();
- pi->serial = (len << 24) | ((pi->serial + 1) & 0xffffff);
+ atomic_store_explicit(
+ &pi->serial,
+ (len << 24) | ((serial + 1) & 0xffffff),
+ memory_order_release);
__futex_wake(&pi->serial, INT32_MAX);
- pa->serial++;
+ atomic_store_explicit(
+ &pa->serial,
+ atomic_load_explicit(&pa->serial, memory_order_relaxed) + 1,
+ memory_order_release);
__futex_wake(&pa->serial, INT32_MAX);
return 0;
@@ -688,17 +711,25 @@
if (!pi)
return -1;
- pa->serial++;
+ // There is only a single mutator, but we want to make sure that
+ // updates are visible to a reader waiting for the update.
+ atomic_store_explicit(
+ &pa->serial,
+ atomic_load_explicit(&pa->serial, memory_order_relaxed) + 1,
+ memory_order_release);
__futex_wake(&pa->serial, INT32_MAX);
return 0;
}
+// Wait for non-locked serial, and retrieve it with acquire semantics.
unsigned int __system_property_serial(const prop_info *pi)
{
- uint32_t serial = pi->serial;
+ uint32_t serial = load_const_atomic(&pi->serial, memory_order_acquire);
while (SERIAL_DIRTY(serial)) {
- __futex_wait(const_cast<volatile uint32_t*>(&pi->serial), serial, NULL);
- serial = pi->serial;
+ __futex_wait(const_cast<volatile void *>(
+ reinterpret_cast<const void *>(&pi->serial)),
+ serial, NULL);
+ serial = load_const_atomic(&pi->serial, memory_order_acquire);
}
return serial;
}
@@ -706,12 +737,14 @@
unsigned int __system_property_wait_any(unsigned int serial)
{
prop_area *pa = __system_property_area__;
+ uint32_t my_serial;
do {
__futex_wait(&pa->serial, serial, NULL);
- } while (pa->serial == serial);
+ my_serial = atomic_load_explicit(&pa->serial, memory_order_acquire);
+ } while (my_serial == serial);
- return pa->serial;
+ return my_serial;
}
const prop_info *__system_property_find_nth(unsigned n)
diff --git a/libc/bionic/time64.c b/libc/bionic/time64.c
index 95dfab5..da38bf3 100644
--- a/libc/bionic/time64.c
+++ b/libc/bionic/time64.c
@@ -748,10 +748,24 @@
char *asctime64_r( const struct TM* date, char *result ) {
/* I figure everything else can be displayed, even hour 25, but if
these are out of range we walk off the name arrays */
- if( !valid_tm_wday(date) || !valid_tm_mon(date) )
+ if (!valid_tm_wday(date) || !valid_tm_mon(date)) {
return NULL;
+ }
- sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",
+ /* Docs state this function does not support years beyond 9999. */
+ if (1900 + date->tm_year > 9999) {
+ return NULL;
+ }
+
+ /*
+ * The IBM docs for this function state that the result buffer can be
+ * assumed to be at least 26 bytes wide. The docs also state that this is
+ * only valid for years <= 9999, so we know this format string will not
+ * print more than that many characters.
+ *
+ * http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/asctimer.htm
+ */
+ snprintf(result, 26, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",
wday_name[date->tm_wday],
mon_name[date->tm_mon],
date->tm_mday, date->tm_hour,
diff --git a/libc/dns/gethnamaddr.c b/libc/dns/gethnamaddr.c
index 1d847b8..0bd838e 100644
--- a/libc/dns/gethnamaddr.c
+++ b/libc/dns/gethnamaddr.c
@@ -899,7 +899,7 @@
res_static rs = __res_get_static();
if (rs == NULL) return;
if (!rs->hostf)
- rs->hostf = fopen(_PATH_HOSTS, "r" );
+ rs->hostf = fopen(_PATH_HOSTS, "re" );
else
rewind(rs->hostf);
rs->stayopen = f;
@@ -925,7 +925,7 @@
int af, len;
res_static rs = __res_get_static();
- if (!rs->hostf && !(rs->hostf = fopen(_PATH_HOSTS, "r" ))) {
+ if (!rs->hostf && !(rs->hostf = fopen(_PATH_HOSTS, "re" ))) {
h_errno = NETDB_INTERNAL;
return NULL;
}
diff --git a/libc/dns/include/resolv_private.h b/libc/dns/include/resolv_private.h
index a91a4b8..4a832d0 100644
--- a/libc/dns/include/resolv_private.h
+++ b/libc/dns/include/resolv_private.h
@@ -426,7 +426,7 @@
int b64_pton(char const *, u_char *, size_t);
#endif
int loc_aton(const char *, u_char *);
-const char * loc_ntoa(const u_char *, char *);
+const char * loc_ntoa(const u_char *, char *, size_t);
int dn_skipname(const u_char *, const u_char *);
void putlong(uint32_t, u_char *);
void putshort(uint16_t, u_char *);
diff --git a/libc/dns/nameser/ns_name.c b/libc/dns/nameser/ns_name.c
index e3759ab..3a202c1 100644
--- a/libc/dns/nameser/ns_name.c
+++ b/libc/dns/nameser/ns_name.c
@@ -43,12 +43,6 @@
#include <stdlib.h>
#include <limits.h>
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) ((int)strlen(sprintf/**/x))
-#else
-# define SPRINTF(x) (sprintf x)
-#endif
-
#define NS_TYPE_ELT 0x40 /* EDNS0 extended label type */
#define DNS_LABELTYPE_BITSTRING 0x41
@@ -1012,31 +1006,31 @@
return(-1);
cp++;
- i = SPRINTF((dn, "\\[x"));
+ i = snprintf(dn, eom - dn, "\\[x");
if (i < 0)
return (-1);
dn += i;
for (b = blen; b > 7; b -= 8, cp++) {
- i = SPRINTF((dn, "%02x", *cp & 0xff));
+ i = snprintf(dn, eom - dn, "%02x", *cp & 0xff);
if (i < 0)
return (-1);
dn += i;
}
if (b > 4) {
tc = *cp++;
- i = SPRINTF((dn, "%02x", tc & (0xff << (8 - b))));
+ i = snprintf(dn, eom - dn, "%02x", tc & (0xff << (8 - b)));
if (i < 0)
return (-1);
dn += i;
} else if (b > 0) {
tc = *cp++;
- i = SPRINTF((dn, "%1x",
- (((u_int32_t)tc >> 4) & 0x0f) & (0x0f << (4 - b))));
+ i = snprintf(dn, eom - dn, "%1x",
+ (((u_int32_t)tc >> 4) & 0x0f) & (0x0f << (4 - b)));
if (i < 0)
return (-1);
dn += i;
}
- i = SPRINTF((dn, "/%d]", blen));
+ i = snprintf(dn, eom - dn, "/%d]", blen);
if (i < 0)
return (-1);
dn += i;
diff --git a/libc/dns/nameser/ns_print.c b/libc/dns/nameser/ns_print.c
index 0a6a1d6..32c8715 100644
--- a/libc/dns/nameser/ns_print.c
+++ b/libc/dns/nameser/ns_print.c
@@ -48,12 +48,6 @@
#include <string.h>
#include <ctype.h>
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) ((int)strlen(sprintf/**/x))
-#else
-# define SPRINTF(x) (sprintf x)
-#endif
-
#ifndef MIN
#define MIN(x,y) ((x)<(y)?(x):(y))
#endif
@@ -155,7 +149,7 @@
*/
T(x = ns_format_ttl(ttl, buf, buflen));
addlen((size_t)x, &buf, &buflen);
- len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type)));
+ len = snprintf(tmp, sizeof(tmp), " %s %s", p_class(class), p_type(type));
T(addstr(tmp, (size_t)len, &buf, &buflen));
T(spaced = addtab((size_t)(x + len), (size_t)16, spaced, &buf, &buflen));
@@ -218,7 +212,7 @@
/* Serial number. */
t = ns_get32(rdata); rdata += NS_INT32SZ;
T(addstr("\t\t\t\t\t", (size_t)5, &buf, &buflen));
- len = SPRINTF((tmp, "%lu", t));
+ len = snprintf(tmp, sizeof(tmp), "%lu", t);
T(addstr(tmp, (size_t)len, &buf, &buflen));
T(spaced = addtab((size_t)len, (size_t)16, spaced, &buf, &buflen));
T(addstr("; serial\n", (size_t)9, &buf, &buflen));
@@ -275,7 +269,7 @@
/* Priority. */
t = ns_get16(rdata);
rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
+ len = snprintf(tmp, sizeof(tmp), "%u ", t);
T(addstr(tmp, (size_t)len, &buf, &buflen));
/* Target. */
@@ -293,7 +287,7 @@
/* Priority. */
t = ns_get16(rdata);
rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
+ len = snprintf(tmp, sizeof(tmp), "%u ", t);
T(addstr(tmp, (size_t)len, &buf, &buflen));
/* Name1. */
@@ -344,7 +338,7 @@
char t[255];
/* XXX protocol format checking? */
- (void) loc_ntoa(rdata, t);
+ (void) loc_ntoa(rdata, t, sizeof(t));
T(addstr(t, strlen(t), &buf, &buflen));
break;
}
@@ -359,7 +353,7 @@
/* Order, Precedence. */
order = ns_get16(rdata); rdata += NS_INT16SZ;
preference = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u ", order, preference));
+ len = snprintf(t, sizeof(t), "%u %u ", order, preference);
T(addstr(t, (size_t)len, &buf, &buflen));
/* Flags. */
@@ -401,7 +395,7 @@
priority = ns_get16(rdata); rdata += NS_INT16SZ;
weight = ns_get16(rdata); rdata += NS_INT16SZ;
port = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((t, "%u %u %u ", priority, weight, port));
+ len = snprintf(t, sizeof(t), "%u %u %u ", priority, weight, port);
T(addstr(t, (size_t)len, &buf, &buflen));
/* Server. */
@@ -432,7 +426,7 @@
rdata += NS_INADDRSZ;
/* Protocol. */
- len = SPRINTF((tmp, " %u ( ", *rdata));
+ len = snprintf(tmp, sizeof(tmp), " %u ( ", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata += NS_INT8SZ;
@@ -449,7 +443,7 @@
lcnt = 10;
spaced = 0;
}
- len = SPRINTF((tmp, "%d ", n));
+ len = snprintf(tmp, sizeof(tmp), "%d ", n);
T(addstr(tmp, (size_t)len, &buf, &buflen));
lcnt--;
}
@@ -480,8 +474,8 @@
keyflags = ns_get16(rdata); rdata += NS_INT16SZ;
protocol = *rdata++;
algorithm = *rdata++;
- len = SPRINTF((tmp, "0x%04x %u %u",
- keyflags, protocol, algorithm));
+ len = snprintf(tmp, sizeof(tmp), "0x%04x %u %u",
+ keyflags, protocol, algorithm);
T(addstr(tmp, (size_t)len, &buf, &buflen));
/* Public key data. */
@@ -502,7 +496,7 @@
}
if (len > 15)
T(addstr(" )", (size_t)2, &buf, &buflen));
- n = SPRINTF((tmp, " ; key_tag= %u", key_id));
+ n = snprintf(tmp, sizeof(tmp), " ; key_tag= %u", key_id);
T(addstr(tmp, (size_t)n, &buf, &buflen));
break;
@@ -524,25 +518,25 @@
algorithm = *rdata++;
labels = *rdata++;
t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s %d %d %lu ",
- p_type((int)typ), algorithm, labels, t));
+ len = snprintf(tmp, sizeof(tmp), "%s %d %d %lu ",
+ p_type((int)typ), algorithm, labels, t);
T(addstr(tmp, (size_t)len, &buf, &buflen));
if (labels > (u_int)dn_count_labels(name))
goto formerr;
/* Signature expiry. */
t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ len = snprintf(tmp, sizeof(tmp), "%s ", p_secstodate(t));
T(addstr(tmp, (size_t)len, &buf, &buflen));
/* Time signed. */
t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ len = snprintf(tmp, sizeof(tmp), "%s ", p_secstodate(t));
T(addstr(tmp, (size_t)len, &buf, &buflen));
/* Signature Footprint. */
footprint = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", footprint));
+ len = snprintf(tmp, sizeof(tmp), "%u ", footprint);
T(addstr(tmp, (size_t)len, &buf, &buflen));
/* Signer's name. */
@@ -579,7 +573,7 @@
n = edata - rdata;
for (c = 0; c < n*8; c++)
if (NS_NXT_BIT_ISSET(c, rdata)) {
- len = SPRINTF((tmp, " %s", p_type((int)c)));
+ len = snprintf(tmp, sizeof(tmp), " %s", p_type((int)c));
T(addstr(tmp, (size_t)len, &buf, &buflen));
}
break;
@@ -596,7 +590,7 @@
key_tag = ns_get16(rdata); rdata += NS_INT16SZ;
alg = (u_int) *rdata++;
- len = SPRINTF((tmp1, "%d %d %d ", c_type, key_tag, alg));
+ len = snprintf(tmp1, sizeof(tmp1), "%d %d %d ", c_type, key_tag, alg);
T(addstr(tmp1, (size_t)len, &buf, &buflen));
siz = (edata-rdata)*4/3 + 4; /* "+4" accounts for trailing \0 */
if (siz > sizeof(base64_cert) * 3/4) {
@@ -640,12 +634,12 @@
/* Inception. */
t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ len = snprintf(tmp, sizeof(tmp), "%s ", p_secstodate(t));
T(addstr(tmp, (size_t)len, &buf, &buflen));
/* Experation. */
t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ len = snprintf(tmp, sizeof(tmp), "%s ", p_secstodate(t));
T(addstr(tmp, (size_t)len, &buf, &buflen));
/* Mode , Error, Key Size. */
@@ -653,7 +647,7 @@
mode = ns_get16(rdata); rdata += NS_INT16SZ;
err = ns_get16(rdata); rdata += NS_INT16SZ;
keysize = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u %u %u ", mode, err, keysize));
+ len = snprintf(tmp, sizeof(tmp), "%u %u %u ", mode, err, keysize);
T(addstr(tmp, (size_t)len, &buf, &buflen));
/* XXX need to dump key, print otherdata length & other data */
@@ -670,7 +664,7 @@
n = ns_get16(rdata); rdata += INT16SZ;
rdata += n; /* sig */
n = ns_get16(rdata); rdata += INT16SZ; /* original id */
- sprintf(buf, "%d", ns_get16(rdata));
+ snprintf(buf, buflen, "%d", ns_get16(rdata));
rdata += INT16SZ;
addlen(strlen(buf), &buf, &buflen);
break;
@@ -682,7 +676,7 @@
/* prefix length */
if (rdlen == 0U) goto formerr;
- len = SPRINTF((tmp, "%d ", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%d ", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
pbit = *rdata;
if (pbit > 128) goto formerr;
@@ -710,7 +704,7 @@
}
case ns_t_opt: {
- len = SPRINTF((tmp, "%u bytes", class));
+ len = snprintf(tmp, sizeof(tmp), "%u bytes", class);
T(addstr(tmp, (size_t)len, &buf, &buflen));
break;
}
@@ -724,21 +718,21 @@
if (rdlen < 4U) goto formerr;
t = ns_get16(rdata);
rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
+ len = snprintf(tmp, sizeof(tmp), "%u ", t);
T(addstr(tmp, (size_t)len, &buf, &buflen));
} else
if (rdlen < 2U) goto formerr;
- len = SPRINTF((tmp, "%u ", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%u ", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
- len = SPRINTF((tmp, "%u ", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%u ", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
while (rdata < edata) {
- len = SPRINTF((tmp, "%02X", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%02X", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
}
@@ -749,17 +743,17 @@
case ns_t_nsec3param: {
u_int t, w, l, j, k, c;
- len = SPRINTF((tmp, "%u ", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%u ", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
- len = SPRINTF((tmp, "%u ", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%u ", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
t = ns_get16(rdata);
rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", t));
+ len = snprintf(tmp, sizeof(tmp), "%u ", t);
T(addstr(tmp, (size_t)len, &buf, &buflen));
t = *rdata++;
@@ -767,7 +761,7 @@
T(addstr("-", 1, &buf, &buflen));
} else {
while (t-- > 0) {
- len = SPRINTF((tmp, "%02X", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%02X", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
}
@@ -851,7 +845,7 @@
if ((rdata[j] & (0x80 >> k)) == 0)
continue;
c = w * 256 + j * 8 + k;
- len = SPRINTF((tmp, " %s", p_type((ns_type)c)));
+ len = snprintf(tmp, sizeof(tmp), " %s", p_type((ns_type)c));
T(addstr(tmp, (size_t)len, &buf, &buflen));
}
}
@@ -875,7 +869,7 @@
if ((rdata[j] & (0x80 >> k)) == 0)
continue;
c = w * 256 + j * 8 + k;
- len = SPRINTF((tmp, " %s", p_type((ns_type)c)));
+ len = snprintf(tmp, sizeof(tmp), " %s", p_type((ns_type)c));
T(addstr(tmp, (size_t)len, &buf, &buflen));
}
}
@@ -949,15 +943,15 @@
goto hexify;
}
- len = SPRINTF((tmp, "%u ", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%u ", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
- len = SPRINTF((tmp, "%u ", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%u ", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
- len = SPRINTF((tmp, "%u ", *rdata));
+ len = snprintf(tmp, sizeof(tmp), "%u ", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
@@ -1030,11 +1024,11 @@
const char *str = "record too long to print";
T(addstr(str, strlen(str), &buf, &buflen));
} else {
- len = sprintf(tmp, "( %u ", algorithm);
+ len = snprintf(tmp, sizeof(tmp), "( %u ", algorithm);
T(addstr(tmp, (size_t)len, &buf, &buflen));
for (i = 0; i < hip_len; i++) {
- len = sprintf(tmp, "%02X", *rdata);
+ len = snprintf(tmp, sizeof(tmp), "%02X", *rdata);
T(addstr(tmp, (size_t)len, &buf, &buflen));
rdata++;
}
@@ -1069,23 +1063,23 @@
int n, m;
char *p;
- len = SPRINTF((tmp, "\\# %u%s\t; %s", (unsigned)(edata - rdata),
- rdlen != 0U ? " (" : "", comment));
+ len = snprintf(tmp, sizeof(tmp), "\\# %u%s\t; %s", (unsigned)(edata - rdata),
+ rdlen != 0U ? " (" : "", comment);
T(addstr(tmp, (size_t)len, &buf, &buflen));
while (rdata < edata) {
p = tmp;
- p += SPRINTF((p, "\n\t"));
+ p += snprintf(p, sizeof(tmp), "\n\t");
spaced = 0;
n = MIN(16, (int)(edata - rdata));
for (m = 0; m < n; m++)
- p += SPRINTF((p, "%02x ", rdata[m]));
+ p += snprintf(p, sizeof(tmp) - (p - tmp), "%02x ", rdata[m]);
T(addstr(tmp, (size_t)(p - tmp), &buf, &buflen));
if (n < 16) {
T(addstr(")", (size_t)1, &buf, &buflen));
T(addtab((size_t)(p - tmp + 1), (size_t)48, spaced, &buf, &buflen));
}
p = tmp;
- p += SPRINTF((p, "; "));
+ p += snprintf(p, sizeof(tmp), "; ");
for (m = 0; m < n; m++)
*p++ = (isascii(rdata[m]) && isprint(rdata[m]))
? rdata[m]
diff --git a/libc/dns/nameser/ns_ttl.c b/libc/dns/nameser/ns_ttl.c
index 2395b99..de073b8 100644
--- a/libc/dns/nameser/ns_ttl.c
+++ b/libc/dns/nameser/ns_ttl.c
@@ -36,12 +36,6 @@
#include <stdio.h>
#include <string.h>
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
/* Forward. */
static int fmt1(int t, char s, char **buf, size_t *buflen);
@@ -157,8 +151,8 @@
char tmp[50];
size_t len;
- len = SPRINTF((tmp, "%d%c", t, s));
- if (len + 1 > *buflen)
+ len = (size_t)snprintf(tmp, sizeof(tmp), "%d%c", t, s);
+ if ((int)len < 0 || len + 1 > *buflen)
return (-1);
strcpy(*buf, tmp);
*buf += len;
diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c
index 2612d6a..1ebd222 100644
--- a/libc/dns/net/getaddrinfo.c
+++ b/libc/dns/net/getaddrinfo.c
@@ -408,6 +408,15 @@
return _test_connect(PF_INET, &addr.generic, sizeof(addr.in), mark);
}
+bool readBE32(FILE* fp, int32_t* result) {
+ int32_t tmp;
+ if (fread(&tmp, sizeof(tmp), 1, fp) != 1) {
+ return false;
+ }
+ *result = ntohl(tmp);
+ return true;
+}
+
// Returns 0 on success, else returns on error.
static int
android_getaddrinfo_proxy(
@@ -454,6 +463,15 @@
// Send the request.
proxy = fdopen(sock, "r+");
+ if (proxy == NULL) {
+ // Failed to map sock to FILE*. Check errno for the cause.
+ // @sonymobile.com saw failures in automated testing, but
+ // couldn't reproduce it for debugging.
+ // Fail with EAI_SYSTEM and let callers handle the failure.
+ close(sock);
+ return EAI_SYSTEM;
+ }
+
if (fprintf(proxy, "getaddrinfo %s %s %d %d %d %d %u",
hostname == NULL ? "^" : hostname,
servname == NULL ? "^" : servname,
@@ -486,61 +504,62 @@
struct addrinfo* ai = NULL;
struct addrinfo** nextres = res;
while (1) {
- uint32_t addrinfo_len;
- if (fread(&addrinfo_len, sizeof(addrinfo_len),
- 1, proxy) != 1) {
+ int32_t have_more;
+ if (!readBE32(proxy, &have_more)) {
break;
}
- addrinfo_len = ntohl(addrinfo_len);
- if (addrinfo_len == 0) {
+ if (have_more == 0) {
success = 1;
break;
}
- if (addrinfo_len < sizeof(struct addrinfo)) {
- break;
- }
- struct addrinfo* ai = calloc(1, addrinfo_len +
- sizeof(struct sockaddr_storage));
+ struct addrinfo* ai = calloc(1, sizeof(struct addrinfo) + sizeof(struct sockaddr_storage));
if (ai == NULL) {
break;
}
+ ai->ai_addr = (struct sockaddr*)(ai + 1);
- if (fread(ai, addrinfo_len, 1, proxy) != 1) {
- // Error; fall through.
+ // struct addrinfo {
+ // int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
+ // int ai_family; /* PF_xxx */
+ // int ai_socktype; /* SOCK_xxx */
+ // int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+ // socklen_t ai_addrlen; /* length of ai_addr */
+ // char *ai_canonname; /* canonical name for hostname */
+ // struct sockaddr *ai_addr; /* binary address */
+ // struct addrinfo *ai_next; /* next structure in linked list */
+ // };
+
+ // Read the struct piece by piece because we might be a 32-bit process
+ // talking to a 64-bit netd.
+ int32_t addr_len;
+ bool success =
+ readBE32(proxy, &ai->ai_flags) &&
+ readBE32(proxy, &ai->ai_family) &&
+ readBE32(proxy, &ai->ai_socktype) &&
+ readBE32(proxy, &ai->ai_protocol) &&
+ readBE32(proxy, &addr_len);
+ if (!success) {
break;
}
- // Zero out the pointer fields we copied which aren't
- // valid in this address space.
- ai->ai_addr = NULL;
- ai->ai_canonname = NULL;
- ai->ai_next = NULL;
-
- // struct sockaddr
- uint32_t addr_len;
- if (fread(&addr_len, sizeof(addr_len), 1, proxy) != 1) {
- break;
- }
- addr_len = ntohl(addr_len);
+ // Set ai_addrlen and read the ai_addr data.
+ ai->ai_addrlen = addr_len;
if (addr_len != 0) {
- if (addr_len > sizeof(struct sockaddr_storage)) {
+ if ((size_t) addr_len > sizeof(struct sockaddr_storage)) {
// Bogus; too big.
break;
}
- struct sockaddr* addr = (struct sockaddr*)(ai + 1);
- if (fread(addr, addr_len, 1, proxy) != 1) {
+ if (fread(ai->ai_addr, addr_len, 1, proxy) != 1) {
break;
}
- ai->ai_addr = addr;
}
- // cannonname
- uint32_t name_len;
- if (fread(&name_len, sizeof(name_len), 1, proxy) != 1) {
+ // The string for ai_cannonname.
+ int32_t name_len;
+ if (!readBE32(proxy, &name_len)) {
break;
}
- name_len = ntohl(name_len);
if (name_len != 0) {
ai->ai_canonname = (char*) malloc(name_len);
if (fread(ai->ai_canonname, name_len, 1, proxy) != 1) {
@@ -2017,7 +2036,7 @@
{
if (!*hostf)
- *hostf = fopen(_PATH_HOSTS, "r" );
+ *hostf = fopen(_PATH_HOSTS, "re");
else
rewind(*hostf);
}
@@ -2046,7 +2065,7 @@
assert(name != NULL);
assert(pai != NULL);
- if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "r" )))
+ if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "re")))
return (NULL);
again:
if (!(p = fgets(hostbuf, sizeof hostbuf, *hostf)))
diff --git a/libc/dns/net/getservbyname.c b/libc/dns/net/getservbyname.c
index c95c9b0..c32416c 100644
--- a/libc/dns/net/getservbyname.c
+++ b/libc/dns/net/getservbyname.c
@@ -25,29 +25,19 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#include <sys/types.h>
+
#include <netdb.h>
+
#include "servent.h"
-struct servent *
-getservbyname(const char *name, const char *proto)
-{
- res_static rs = __res_get_static();
-
- if (rs == NULL || proto == NULL || name == NULL) {
- errno = EINVAL;
- return NULL;
+struct servent* getservbyname(const char* name, const char* proto) {
+ res_static rs = __res_get_static();
+ rs->servent_ptr = NULL;
+ struct servent* s;
+ while ((s = getservent_r(rs)) != NULL) {
+ if (strcmp(s->s_name, name) == 0 && (proto == NULL || strcmp(s->s_proto, proto) == 0)) {
+ return s;
}
-
- rs->servent_ptr = NULL;
- while (1) {
- struct servent* s = getservent_r(rs);
- if (s == NULL)
- break;
- if ( !strcmp( s->s_name, name ) && !strcmp( s->s_proto, proto ) )
- return s;
- }
-
- return NULL;
+ }
+ return NULL;
}
diff --git a/libc/dns/net/services.h b/libc/dns/net/services.h
index fa199d0..7f748f7 100644
--- a/libc/dns/net/services.h
+++ b/libc/dns/net/services.h
@@ -30,8 +30,8 @@
\6tacacs\0\61u\0\
\12re-mail-ck\0\62t\0\
\12re-mail-ck\0\62u\0\
-\6domain\0\65t\1\12nameserver\
-\6domain\0\65u\1\12nameserver\
+\6domain\0\65t\0\
+\6domain\0\65u\0\
\3mtp\0\71t\0\
\11tacacs-ds\0\101t\0\
\11tacacs-ds\0\101u\0\
@@ -44,8 +44,8 @@
\6gopher\0\106u\0\
\3rje\0\115t\1\6netrjs\
\6finger\0\117t\0\
-\3www\0\120t\1\4http\
-\3www\0\120u\0\
+\4http\0\120t\1\3www\
+\4http\0\120u\0\
\4link\0\127t\1\7ttylink\
\10kerberos\0\130t\3\11kerberos5\4krb5\14kerberos-sec\
\10kerberos\0\130u\3\11kerberos5\4krb5\14kerberos-sec\
@@ -138,12 +138,16 @@
\4ldap\1\205u\0\
\4imsp\1\226t\0\
\4imsp\1\226u\0\
+\6svrloc\1\253t\0\
+\6svrloc\1\253u\0\
\5https\1\273t\0\
\5https\1\273u\0\
\4snpp\1\274t\0\
\4snpp\1\274u\0\
\14microsoft-ds\1\275t\0\
\14microsoft-ds\1\275u\0\
+\7kpasswd\1\320t\0\
+\7kpasswd\1\320u\0\
\4saft\1\347t\0\
\4saft\1\347u\0\
\6isakmp\1\364t\0\
@@ -158,6 +162,8 @@
\10npmp-gui\2\143u\1\14dqs313_execd\
\10hmmp-ind\2\144t\1\20dqs313_intercell\
\10hmmp-ind\2\144u\1\20dqs313_intercell\
+\4qmqp\2\164t\0\
+\4qmqp\2\164u\0\
\3ipp\2\167t\0\
\3ipp\2\167u\0\
\4exec\2\0t\0\
@@ -181,8 +187,14 @@
\4uucp\2\34t\1\5uucpd\
\6klogin\2\37t\0\
\6kshell\2\40t\1\5krcmd\
+\15dhcpv6-client\2\42t\0\
+\15dhcpv6-client\2\42u\0\
+\15dhcpv6-server\2\43t\0\
+\15dhcpv6-server\2\43u\0\
\12afpovertcp\2\44t\0\
\12afpovertcp\2\44u\0\
+\4idfp\2\45t\0\
+\4idfp\2\45u\0\
\10remotefs\2\54t\2\12rfs_server\3rfs\
\5nntps\2\63t\1\5snntp\
\5nntps\2\63u\1\5snntp\
@@ -239,19 +251,33 @@
\13sa-msg-port\6\156u\1\13old-radacct\
\6kermit\6\161t\0\
\6kermit\6\161u\0\
+\11groupwise\6\215t\0\
+\11groupwise\6\215u\0\
\3l2f\6\245t\1\4l2tp\
\3l2f\6\245u\1\4l2tp\
\6radius\7\24t\0\
\6radius\7\24u\0\
\13radius-acct\7\25t\1\7radacct\
\13radius-acct\7\25u\1\7radacct\
+\4msnp\7\107t\0\
+\4msnp\7\107u\0\
\13unix-status\7\245t\0\
\12log-server\7\246t\0\
\12remoteping\7\247t\0\
+\12cisco-sccp\7\320t\0\
+\12cisco-sccp\7\320u\0\
+\6search\7\332t\1\4ndtp\
+\13pipe-server\7\332t\1\13pipe_server\
\3nfs\10\1t\0\
\3nfs\10\1u\0\
+\6gnunet\10\46t\0\
+\6gnunet\10\46u\0\
\12rtcm-sc104\10\65t\0\
\12rtcm-sc104\10\65u\0\
+\15gsigatekeeper\10\107t\0\
+\15gsigatekeeper\10\107u\0\
+\4gris\10\127t\0\
+\4gris\10\127u\0\
\12cvspserver\11\141t\0\
\12cvspserver\11\141u\0\
\5venus\11\176t\0\
@@ -266,10 +292,14 @@
\3mon\12\27u\0\
\4dict\12\104t\0\
\4dict\12\104u\0\
+\15f5-globalsite\12\350t\0\
+\15f5-globalsite\12\350u\0\
+\6gsiftp\12\373t\0\
+\6gsiftp\12\373u\0\
\4gpsd\13\203t\0\
\4gpsd\13\203u\0\
-\6gds_db\13\352t\0\
-\6gds_db\13\352u\0\
+\6gds-db\13\352t\1\6gds_db\
+\6gds-db\13\352u\1\6gds_db\
\5icpv2\14\72t\1\3icp\
\5icpv2\14\72u\1\3icp\
\5mysql\14\352t\0\
@@ -282,24 +312,49 @@
\4daap\16\151u\0\
\3svn\16\152t\1\12subversion\
\3svn\16\152u\1\12subversion\
+\5suucp\17\277t\0\
+\5suucp\17\277u\0\
+\6sysrqd\17\376t\0\
+\6sysrqd\17\376u\0\
+\5sieve\20\136t\0\
+\4epmd\21\21t\0\
+\4epmd\21\21u\0\
+\6remctl\21\25t\0\
+\6remctl\21\25u\0\
+\11f5-iquery\21\1t\0\
+\11f5-iquery\21\1u\0\
\3iax\21\331t\0\
\3iax\21\331u\0\
+\3mtn\22\123t\0\
+\3mtn\22\123u\0\
\13radmin-port\23\43t\0\
\13radmin-port\23\43u\0\
\3rfe\23\212u\0\
\3rfe\23\212t\0\
+\4mmcc\23\272t\0\
+\4mmcc\23\272u\0\
\3sip\23\304t\0\
\3sip\23\304u\0\
\7sip-tls\23\305t\0\
\7sip-tls\23\305u\0\
+\3aol\24\106t\0\
+\3aol\24\106u\0\
\13xmpp-client\24\146t\1\15jabber-client\
\13xmpp-client\24\146u\1\15jabber-client\
\13xmpp-server\24\225t\1\15jabber-server\
\13xmpp-server\24\225u\1\15jabber-server\
\10cfengine\24\274t\0\
\10cfengine\24\274u\0\
+\4mdns\24\351t\0\
+\4mdns\24\351u\0\
\12postgresql\25\70t\1\10postgres\
\12postgresql\25\70u\1\10postgres\
+\7freeciv\25\264t\1\4rptp\
+\7freeciv\25\264u\0\
+\4amqp\26\50t\0\
+\4amqp\26\50u\0\
+\3ggz\26\70t\0\
+\3ggz\26\70u\0\
\3x11\27\160t\1\5x11-0\
\3x11\27\160u\1\5x11-0\
\5x11-1\27\161t\0\
@@ -320,6 +375,12 @@
\14gnutella-svc\30\312u\0\
\14gnutella-rtr\30\313t\0\
\14gnutella-rtr\30\313u\0\
+\13sge-qmaster\31\54t\1\13sge_qmaster\
+\13sge-qmaster\31\54u\1\13sge_qmaster\
+\11sge-execd\31\55t\1\11sge_execd\
+\11sge-execd\31\55u\1\11sge_execd\
+\13mysql-proxy\31\56t\0\
+\13mysql-proxy\31\56u\0\
\17afs3-fileserver\33\130t\1\3bbs\
\17afs3-fileserver\33\130u\1\3bbs\
\15afs3-callback\33\131t\0\
@@ -342,12 +403,21 @@
\13afs3-rmtsys\33\141u\0\
\14font-service\33\274t\1\3xfs\
\14font-service\33\274u\1\3xfs\
+\10http-alt\37\220t\1\10webcache\
+\10http-alt\37\220u\0\
\12bacula-dir\43\215t\0\
\12bacula-dir\43\215u\0\
\11bacula-fd\43\216t\0\
\11bacula-fd\43\216u\0\
\11bacula-sd\43\217t\0\
\11bacula-sd\43\217u\0\
+\5xmms2\45\303t\0\
+\5xmms2\45\303u\0\
+\3nbd\52\71t\0\
+\14zabbix-agent\47\102t\0\
+\14zabbix-agent\47\102u\0\
+\16zabbix-trapper\47\103t\0\
+\16zabbix-trapper\47\103u\0\
\6amanda\47\140t\0\
\6amanda\47\140u\0\
\3hkp\54\153t\0\
@@ -364,16 +434,17 @@
\4bpcd\65\326u\0\
\6vopied\65\327t\0\
\6vopied\65\327u\0\
+\4dcap\126\155t\0\
+\7gsidcap\126\160t\0\
\4wnn6\127\1t\0\
\4wnn6\127\1u\0\
\11kerberos4\2\356u\2\13kerberos-iv\3kdc\
\11kerberos4\2\356t\2\13kerberos-iv\3kdc\
-\17kerberos_master\2\357u\0\
-\17kerberos_master\2\357t\0\
-\15passwd_server\2\360u\0\
-\10krb_prop\2\362t\2\11krb5_prop\5hprop\
+\17kerberos-master\2\357u\1\17kerberos_master\
+\17kerberos-master\2\357t\0\
+\15passwd-server\2\360u\1\15passwd_server\
+\10krb-prop\2\362t\3\10krb_prop\11krb5_prop\5hprop\
\11krbupdate\2\370t\1\4kreg\
-\7kpasswd\2\371t\1\4kpwd\
\4swat\3\205t\0\
\4kpop\4\125t\0\
\5knetd\10\5t\0\
@@ -389,9 +460,9 @@
\10poppassd\0\152t\0\
\10poppassd\0\152u\0\
\5ssmtp\1\321t\1\5smtps\
-\10moira_db\3\7t\0\
-\14moira_update\3\11t\0\
-\12moira_ureg\3\13u\0\
+\10moira-db\3\7t\1\10moira_db\
+\14moira-update\3\11t\1\14moira_update\
+\12moira-ureg\3\13u\1\12moira_ureg\
\5spamd\3\17t\0\
\5omirr\3\50t\1\6omirrd\
\5omirr\3\50u\1\6omirrd\
@@ -404,9 +475,7 @@
\4xtel\5\41t\0\
\5xtelw\5\42t\0\
\7support\5\371t\0\
-\5sieve\7\320t\0\
\7cfinger\7\323t\0\
-\4ndtp\7\332t\0\
\4frox\10\111t\0\
\10ninstall\10\146t\0\
\10ninstall\10\146u\0\
@@ -436,9 +505,7 @@
\7hostmon\24\353t\0\
\7hostmon\24\353u\0\
\5rplay\25\263u\0\
-\5rplay\25\263t\0\
-\4rptp\25\264u\0\
-\4rptp\25\264t\0\
+\4nrpe\26\42t\0\
\4nsca\26\43t\0\
\4mrtd\26\52t\0\
\6bgpsim\26\53t\0\
@@ -446,14 +513,15 @@
\11sane-port\31\246t\2\4sane\5saned\
\4ircd\32\13t\0\
\10zope-ftp\37\125t\0\
-\10webcache\37\220t\0\
\6tproxy\37\221t\0\
\7omniorb\37\230t\0\
\7omniorb\37\230u\0\
\20clc-build-daemon\43\36t\0\
\6xinetd\43\212t\0\
\13mandelspawn\44\217u\1\12mandelbrot\
+\3git\44\312t\0\
\4zope\45\311t\0\
+\6webmin\47\20t\0\
\7kamanda\47\141t\0\
\7kamanda\47\141u\0\
\11amandaidx\47\142t\0\
@@ -473,6 +541,7 @@
\5binkp\137\352t\0\
\3asp\152\356t\0\
\3asp\152\356u\0\
+\6csync2\170\221t\0\
\11dircproxy\336\250t\0\
\5tfido\353\21t\0\
\4fido\353\23t\0\
diff --git a/libc/dns/resolv/res_cache.c b/libc/dns/resolv/res_cache.c
index d68ec3b..15d04c2 100644
--- a/libc/dns/resolv/res_cache.c
+++ b/libc/dns/resolv/res_cache.c
@@ -1453,7 +1453,7 @@
char* buf;
int fileLen;
- fp = fopen("/data/reslog.txt", "w+");
+ fp = fopen("/data/reslog.txt", "w+e");
if (fp != NULL) {
statep = __res_get_state();
@@ -1949,7 +1949,7 @@
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM; /*dummy*/
hints.ai_flags = AI_NUMERICHOST;
- sprintf(sbuf, "%u", NAMESERVER_PORT);
+ snprintf(sbuf, sizeof(sbuf), "%u", NAMESERVER_PORT);
index = 0;
for (i = 0; i < numservers && i < MAXNS; i++) {
diff --git a/libc/dns/resolv/res_debug.c b/libc/dns/resolv/res_debug.c
index 7a05a5f..5f889cb 100644
--- a/libc/dns/resolv/res_debug.c
+++ b/libc/dns/resolv/res_debug.c
@@ -126,14 +126,6 @@
#include <strings.h>
#include <time.h>
-
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) sprintf x
-#endif
-
extern const char * const _res_opcodes[];
extern const char * const _res_sectioncodes[];
@@ -588,7 +580,7 @@
}
}
- sprintf(unname, "%d", number); /* XXX nonreentrant */
+ snprintf(unname, sizeof(unname), "%d", number); /* XXX nonreentrant */
if (success)
*success = 0;
return (unname);
@@ -605,7 +597,7 @@
return (syms->humanname);
}
}
- sprintf(unname, "%d", number); /* XXX nonreentrant */
+ snprintf(unname, sizeof(unname), "%d", number); /* XXX nonreentrant */
if (success)
*success = 0;
return (unname);
@@ -625,7 +617,7 @@
return (result);
if (type < 0 || type > 0xffff)
return ("BADTYPE");
- sprintf(typebuf, "TYPE%d", type);
+ snprintf(typebuf, sizeof(typebuf), "TYPE%d", type);
return (typebuf);
}
@@ -661,7 +653,7 @@
return (result);
if (class < 0 || class > 0xffff)
return ("BADCLASS");
- sprintf(classbuf, "CLASS%d", class);
+ snprintf(classbuf, sizeof(classbuf), "CLASS%d", class);
return (classbuf);
}
@@ -703,7 +695,7 @@
case RES_NO_NIBBLE2: return "no-nibble2";
#endif
/* XXX nonreentrant */
- default: sprintf(nbuf, "?0x%lx?", (u_long)option);
+ default: snprintf(nbuf, sizeof(nbuf), "?0x%lx?", (u_long)option);
return (nbuf);
}
}
@@ -716,7 +708,7 @@
static char nbuf[40]; /* XXX nonreentrant */
if (ns_format_ttl((u_long)value, nbuf, sizeof nbuf) < 0)
- sprintf(nbuf, "%u", value);
+ snprintf(nbuf, sizeof(nbuf), "%u", value);
return (nbuf);
}
@@ -745,7 +737,7 @@
break;
#endif
default:
- sprintf(ret, "[af%d]", u.sin.sin_family);
+ snprintf(ret, sizeof(ret), "[af%d]", u.sin.sin_family);
break;
}
if (size > 0U) {
@@ -777,7 +769,7 @@
val = mantissa * poweroften[exponent];
- (void) sprintf(retbuf, "%lu.%.2lu", val/100, val%100);
+ (void) snprintf(retbuf, sizeof(retbuf), "%lu.%.2lu", val/100, val%100);
return (retbuf);
}
@@ -1028,7 +1020,7 @@
/* takes an on-the-wire LOC RR and formats it in a human readable format. */
const char *
-loc_ntoa(const u_char *binary, char *ascii)
+loc_ntoa(const u_char *binary, char *ascii, size_t bufsiz)
{
static const char *error = "?";
static char tmpbuf[sizeof
@@ -1055,7 +1047,7 @@
ascii = tmpbuf;
if (versionval) {
- (void) sprintf(ascii, "; error: unknown LOC RR version");
+ (void) snprintf(ascii, bufsiz, "; error: unknown LOC RR version");
return (ascii);
}
@@ -1114,7 +1106,7 @@
hpstr = strdup(precsize_ntoa((u_int32_t)hpval));
vpstr = strdup(precsize_ntoa((u_int32_t)vpval));
- sprintf(ascii,
+ snprintf(ascii, bufsiz,
"%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %s%d.%.2dm %sm %sm %sm",
latdeg, latmin, latsec, latsecfrac, northsouth,
longdeg, longmin, longsec, longsecfrac, eastwest,
@@ -1180,7 +1172,7 @@
#endif
mytime->tm_year += 1900;
mytime->tm_mon += 1;
- sprintf(output, "%04d%02d%02d%02d%02d%02d",
+ snprintf(output, sizeof(output), "%04d%02d%02d%02d%02d%02d",
mytime->tm_year, mytime->tm_mon, mytime->tm_mday,
mytime->tm_hour, mytime->tm_min, mytime->tm_sec);
return (output);
diff --git a/libc/dns/resolv/res_init.c b/libc/dns/resolv/res_init.c
index f1cbed8..713b6e0 100644
--- a/libc/dns/resolv/res_init.c
+++ b/libc/dns/resolv/res_init.c
@@ -289,7 +289,7 @@
line[sizeof(name) - 1] == '\t'))
nserv = 0;
- if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) {
+ if ((fp = fopen(_PATH_RESCONF, "re")) != NULL) {
/* read the config file */
while (fgets(buf, sizeof(buf), fp) != NULL) {
/* skip comments */
@@ -616,47 +616,6 @@
}
#endif
-#ifdef ANDROID_CHANGES
-static int
-real_randomid(u_int *random_value) {
- /* open the nonblocking random device, returning -1 on failure */
- int random_device = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
- if (random_device < 0) {
- return -1;
- }
-
- /* read from the random device, returning -1 on failure (or too many retries)*/
- for (u_int retry = 5; retry > 0; retry--) {
- int retval = read(random_device, random_value, sizeof(u_int));
- if (retval == sizeof(u_int)) {
- *random_value &= 0xffff;
- close(random_device);
- return 0;
- } else if ((retval < 0) && (errno != EINTR)) {
- break;
- }
- }
-
- close(random_device);
- return -1;
-}
-#endif /* ANDROID_CHANGES */
-
-u_int
-res_randomid(void) {
-#ifdef ANDROID_CHANGES
- int status = 0;
- u_int output = 0;
- status = real_randomid(&output);
- if (status != -1) {
- return output;
- }
-#endif /* ANDROID_CHANGES */
- struct timeval now;
- gettimeofday(&now, NULL);
- return (0xffff & (now.tv_sec ^ now.tv_usec ^ getpid()));
-}
-
/*%
* This routine is for closing the socket if a virtual circuit is used and
* the program wants to close it. This provides support for endhostent()
diff --git a/libc/dns/resolv/res_query.c b/libc/dns/resolv/res_query.c
index 6cd9b15..09be8b4 100644
--- a/libc/dns/resolv/res_query.c
+++ b/libc/dns/resolv/res_query.c
@@ -414,7 +414,7 @@
RES_SET_H_ERRNO(statp, NO_RECOVERY);
return (-1);
}
- sprintf(nbuf, "%s.%s", name, domain);
+ snprintf(nbuf, sizeof(nbuf), "%s.%s", name, domain);
}
return (res_nquery(statp, longname, class, type, answer, anslen));
}
diff --git a/libc/include/android/dlext.h b/libc/include/android/dlext.h
index f27e4e5..90daf30 100644
--- a/libc/include/android/dlext.h
+++ b/libc/include/android/dlext.h
@@ -18,7 +18,9 @@
#define __ANDROID_DLEXT_H__
#include <stddef.h>
+#include <stdint.h>
#include <sys/cdefs.h>
+#include <sys/types.h> /* for off64_t */
__BEGIN_DECLS
diff --git a/libc/include/dirent.h b/libc/include/dirent.h
index a849a61..63716a4 100644
--- a/libc/include/dirent.h
+++ b/libc/include/dirent.h
@@ -58,6 +58,12 @@
#undef __DIRENT64_BODY
+/* glibc compatibility. */
+#undef _DIRENT_HAVE_D_NAMLEN /* Linux doesn't have a d_namlen field. */
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
+
#define d_fileno d_ino
typedef struct DIR DIR;
@@ -70,6 +76,8 @@
extern int readdir64_r(DIR*, struct dirent64*, struct dirent64**);
extern int closedir(DIR*);
extern void rewinddir(DIR*);
+extern void seekdir(DIR*, long);
+extern long telldir(DIR*);
extern int dirfd(DIR*);
extern int alphasort(const struct dirent**, const struct dirent**);
extern int alphasort64(const struct dirent64**, const struct dirent64**);
diff --git a/libc/include/dlfcn.h b/libc/include/dlfcn.h
index 8dde08c..afa7687 100644
--- a/libc/include/dlfcn.h
+++ b/libc/include/dlfcn.h
@@ -64,6 +64,7 @@
RTLD_GLOBAL = 2,
#endif
RTLD_NOLOAD = 4,
+ RTLD_NODELETE = 0x01000,
};
#if defined (__LP64__)
diff --git a/libc/include/elf.h b/libc/include/elf.h
index 7de464e..2039cc0 100644
--- a/libc/include/elf.h
+++ b/libc/include/elf.h
@@ -54,29 +54,29 @@
#define DF_BIND_NOW 0x00000008
#define DF_STATIC_TLS 0x00000010
-#define DF_1_NOW 0x00000001 // Perform complete relocation processing.
-#define DF_1_GLOBAL 0x00000002 // implies RTLD_GLOBAL
+#define DF_1_NOW 0x00000001 /* Perform complete relocation processing. */
+#define DF_1_GLOBAL 0x00000002 /* implies RTLD_GLOBAL */
#define DF_1_GROUP 0x00000004
-#define DF_1_NODELETE 0x00000008 // implies RTLD_NODELETE
+#define DF_1_NODELETE 0x00000008 /* implies RTLD_NODELETE */
#define DF_1_LOADFLTR 0x00000010
#define DF_1_INITFIRST 0x00000020
-#define DF_1_NOOPEN 0x00000040 // Object can not be used with dlopen(3)
+#define DF_1_NOOPEN 0x00000040 /* Object can not be used with dlopen(3) */
#define DF_1_ORIGIN 0x00000080
#define DF_1_DIRECT 0x00000100
#define DF_1_TRANS 0x00000200
#define DF_1_INTERPOSE 0x00000400
#define DF_1_NODEFLIB 0x00000800
-#define DF_1_NODUMP 0x00001000 // Object cannot be dumped with dldump(3)
+#define DF_1_NODUMP 0x00001000 /* Object cannot be dumped with dldump(3) */
#define DF_1_CONFALT 0x00002000
#define DF_1_ENDFILTEE 0x00004000
#define DF_1_DISPRELDNE 0x00008000
#define DF_1_DISPRELPND 0x00010000
#define DF_1_NODIRECT 0x00020000
-#define DF_1_IGNMULDEF 0x00040000 // Internal use
-#define DF_1_NOKSYMS 0x00080000 // Internal use
-#define DF_1_NOHDR 0x00100000 // Internal use
+#define DF_1_IGNMULDEF 0x00040000 /* Internal use */
+#define DF_1_NOKSYMS 0x00080000 /* Internal use */
+#define DF_1_NOHDR 0x00100000 /* Internal use */
#define DF_1_EDITED 0x00200000
-#define DF_1_NORELOC 0x00400000 // Internal use
+#define DF_1_NORELOC 0x00400000 /* Internal use */
#define DF_1_SYMINTPOSE 0x00800000
#define DF_1_GLOBAUDIT 0x01000000
#define DF_1_SINGLETON 0x02000000
@@ -94,6 +94,9 @@
#define DT_PREINIT_ARRAY 32
#define DT_PREINIT_ARRAYSZ 33
+/* gnu hash entry */
+#define DT_GNU_HASH 0x6ffffef5
+
#define ELFOSABI_SYSV 0 /* Synonym for ELFOSABI_NONE used by valgrind. */
#define PT_GNU_RELRO 0x6474e552
@@ -109,4 +112,7 @@
#define STT_LOPROC 13
#define STT_HIPROC 15
+/* The kernel uses NT_PRFPREG but glibc also offers NT_FPREGSET */
+#define NT_FPREGSET NT_PRFPREG
+
#endif /* _ELF_H */
diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h
index 794e62c..1089788 100644
--- a/libc/include/fcntl.h
+++ b/libc/include/fcntl.h
@@ -39,20 +39,14 @@
__BEGIN_DECLS
#ifdef __LP64__
-/* LP64 kernels don't have flock64 because their flock is 64-bit. */
-struct flock64 {
- short l_type;
- short l_whence;
- off64_t l_start;
- off64_t l_len;
- pid_t l_pid;
-};
+/* LP64 kernels don't have F_*64 defines because their flock is 64-bit. */
#define F_GETLK64 F_GETLK
#define F_SETLK64 F_SETLK
#define F_SETLKW64 F_SETLKW
#endif
#define O_ASYNC FASYNC
+#define O_RSYNC O_SYNC
#define SPLICE_F_MOVE 1
#define SPLICE_F_NONBLOCK 2
diff --git a/libc/include/features.h b/libc/include/features.h
index 343c84d..a279c7f 100644
--- a/libc/include/features.h
+++ b/libc/include/features.h
@@ -25,34 +25,11 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#ifndef _FEATURES_H_
#define _FEATURES_H_
-/* certain Linux-specific programs expect a <features.h> header file
- * that defines various features macros
- */
-
-/* we do include a number of BSD extensions */
-#define _BSD_SOURCE 1
-
-/* we do include a number of GNU extensions */
-#define _GNU_SOURCE 1
-
-/* C95 support */
-#undef __USE_ISOC95
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L
-# define __USE_ISOC95 1
-#endif
-
-/* C99 support */
-#undef __USE_ISOC99
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-# define __USE_ISOC99 1
-#endif
-
-/* Posix support */
-#define __USE_POSIX 1
-#define __USE_POSIX2 1
-#define __USE_XPG 1
+/* Our <features.h> macro fun is all in <sys/cdefs.h>. */
+#include <sys/cdefs.h>
#endif /* _FEATURES_H_ */
diff --git a/libc/include/fts.h b/libc/include/fts.h
index da26a88..cde0349 100644
--- a/libc/include/fts.h
+++ b/libc/include/fts.h
@@ -35,6 +35,8 @@
#ifndef _FTS_H_
#define _FTS_H_
+#include <sys/types.h>
+
typedef struct {
struct _ftsent *fts_cur; /* current node */
struct _ftsent *fts_child; /* linked list of children */
@@ -111,8 +113,6 @@
char fts_name[1]; /* file name */
} FTSENT;
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
FTSENT *fts_children(FTS *, int);
int fts_close(FTS *);
diff --git a/libc/include/libgen.h b/libc/include/libgen.h
index 9dcec75..e89328e 100644
--- a/libc/include/libgen.h
+++ b/libc/include/libgen.h
@@ -25,6 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#ifndef _LIBGEN_H
#define _LIBGEN_H
@@ -33,8 +34,18 @@
__BEGIN_DECLS
-/* On Android these don't modify their input, and use thread-local storage for their results. */
+#if !defined(__bionic_using_gnu_basename)
+/*
+ * <string.h> gets you the GNU basename.
+ * <libgen.h> the POSIX one.
+ * Note that our "POSIX" one has the wrong argument cv-qualifiers, but doesn't
+ * modify its input and uses thread-local storage for the result if necessary.
+ */
extern char* basename(const char*);
+#define __bionic_using_posix_basename
+#endif
+
+/* This has the wrong argument cv-qualifiers, but doesn't modify its input and uses thread-local storage for the result if necessary. */
extern char* dirname(const char*);
#if !defined(__LP64__)
diff --git a/libc/include/limits.h b/libc/include/limits.h
index fb09657..6ae629b 100644
--- a/libc/include/limits.h
+++ b/libc/include/limits.h
@@ -37,39 +37,6 @@
#include <sys/cdefs.h>
-#if __POSIX_VISIBLE
-#define _POSIX_ARG_MAX 4096
-#define _POSIX_CHILD_MAX 25
-#define _POSIX_LINK_MAX 8
-#define _POSIX_MAX_CANON 255
-#define _POSIX_MAX_INPUT 255
-#define _POSIX_NAME_MAX 14
-#define _POSIX_NGROUPS_MAX 0
-#define _POSIX_OPEN_MAX 16
-#define _POSIX_PATH_MAX 256
-#define _POSIX_PIPE_BUF 512
-#define _POSIX_RE_DUP_MAX 255
-#define _POSIX_SSIZE_MAX 32767
-#define _POSIX_STREAM_MAX 8
-#define _POSIX_SYMLINK_MAX 255
-#define _POSIX_SYMLOOP_MAX 8
-#define _POSIX_TZNAME_MAX 3
-
-#define _POSIX2_BC_BASE_MAX 99
-#define _POSIX2_BC_DIM_MAX 2048
-#define _POSIX2_BC_SCALE_MAX 99
-#define _POSIX2_BC_STRING_MAX 1000
-#define _POSIX2_COLL_WEIGHTS_MAX 2
-#define _POSIX2_EXPR_NEST_MAX 32
-#define _POSIX2_LINE_MAX 2048
-#define _POSIX2_RE_DUP_MAX _POSIX_RE_DUP_MAX
-
-#if __POSIX_VISIBLE >= 200112
-#define _POSIX_TTY_NAME_MAX 9 /* includes trailing NUL */
-#define _POSIX_LOGIN_NAME_MAX 9 /* includes trailing NUL */
-#endif /* __POSIX_VISIBLE >= 200112 */
-#endif /* __POSIX_VISIBLE */
-
#if __XPG_VISIBLE
#define PASS_MAX 128 /* _PASSWORD_LEN from <pwd.h> */
@@ -125,4 +92,10 @@
/* glibc's PAGE_MASK is the bitwise negation of BSD's! TODO: remove? */
#define PAGE_MASK (~(PAGE_SIZE - 1))
+#define SEM_VALUE_MAX 0x3fffffff
+
+/* POSIX says these belong in <unistd.h> but BSD has some in <limits.h>. */
+#include <machine/posix_limits.h>
+
+#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
#endif /* !_LIMITS_H_ */
diff --git a/libc/include/machine/posix_limits.h b/libc/include/machine/posix_limits.h
new file mode 100644
index 0000000..939a1de
--- /dev/null
+++ b/libc/include/machine/posix_limits.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2014 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 _POSIX_LIMITS_H_
+#define _POSIX_LIMITS_H_
+
+
+/* Any constant values here other than -1 or 200809L are explicitly specified by POSIX.1-2008. */
+/* Keep it sorted. */
+#define _POSIX_ADVISORY_INFO -1 /* posix_madvise() not implemented */
+#define _POSIX_AIO_LISTIO_MAX 2
+#define _POSIX_AIO_MAX 1
+#define _POSIX_ARG_MAX 4096
+#define _POSIX_ASYNCHRONOUS_IO -1 /* not implemented */
+#define _POSIX_BARRIERS -1 /* not implemented */
+#define _POSIX_CHILD_MAX 25
+#define _POSIX_CHOWN_RESTRICTED 1 /* yes, chown requires appropriate privileges */
+#define _POSIX_CLOCK_SELECTION 200809L
+#define _POSIX_CPUTIME 200809L
+#define _POSIX_DELAYTIMER_MAX 32
+#define _POSIX_FSYNC 200809L /* fdatasync() supported */
+#define _POSIX_HOST_NAME_MAX 255
+#define _POSIX_IPV6 200809L
+#define _POSIX_JOB_CONTROL 1 /* job control is a Linux feature */
+#define _POSIX_LINK_MAX 8
+#define _POSIX_LOGIN_NAME_MAX 9 /* includes trailing NUL */
+#define _POSIX_MAPPED_FILES 200809L /* mmap-ed files supported */
+#define _POSIX_MAX_CANON 255
+#define _POSIX_MAX_INPUT 255
+#define _POSIX_MEMLOCK 200809L
+#define _POSIX_MEMLOCK_RANGE 200809L
+#define _POSIX_MEMORY_PROTECTION 200809L
+#define _POSIX_MESSAGE_PASSING -1 /* not implemented */
+#define _POSIX_MONOTONIC_CLOCK 0 /* the monotonic clock may be available; ask sysconf */
+#define _POSIX_MQ_OPEN_MAX 8
+#define _POSIX_MQ_PRIO_MAX 32
+#define _POSIX_NAME_MAX 14
+#define _POSIX_NGROUPS_MAX 8
+#define _POSIX_NO_TRUNC 1 /* very long pathnames generate an error */
+#define _POSIX_OPEN_MAX 20
+#define _POSIX_PATH_MAX 256
+#define _POSIX_PIPE_BUF 512
+#define _POSIX_PRIORITY_SCHEDULING 200809L /* priority scheduling is a Linux feature */
+#define _POSIX_PRIORITIZED_IO -1 /* not implemented */
+#define _POSIX_RAW_SOCKETS 200809L
+#define _POSIX_READER_WRITER_LOCKS 200809L
+#define _POSIX_REALTIME_SIGNALS -1 /* for now, this is not supported */
+#define _POSIX_REGEXP 1
+#define _POSIX_RE_DUP_MAX 255
+#define _POSIX_SAVED_IDS 1 /* saved user ids is a Linux feature */
+#define _POSIX_SEMAPHORES 200809L
+#define _POSIX_SEM_NSEMS_MAX 256
+#define _POSIX_SEM_VALUE_MAX 32767
+#define _POSIX_SHARED_MEMORY_OBJECTS -1 /* shm_open()/shm_unlink() not implemented */
+#define _POSIX_SHELL 1 /* system() supported */
+#define _POSIX_SIGQUEUE_MAX 32
+#define _POSIX_SPAWN -1 /* not implemented */
+#define _POSIX_SPIN_LOCKS -1 /* not implemented */
+#define _POSIX_SPORADIC_SERVER -1 /* not implemented */
+#define _POSIX_SSIZE_MAX 32767
+#define _POSIX_STREAM_MAX 8
+#define _POSIX_SYMLINK_MAX 255
+#define _POSIX_SYMLOOP_MAX 8
+#define _POSIX_SYNCHRONIZED_IO 200809L /* synchronized i/o supported */
+#define _POSIX_THREADS 200809L /* we support threads */
+#define _POSIX_THREAD_ATTR_STACKADDR 200809L
+#define _POSIX_THREAD_ATTR_STACKSIZE 200809L
+#define _POSIX_THREAD_CPUTIME 200809L
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+#define _POSIX_THREAD_KEYS_MAX 128
+#define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L
+#define _POSIX_THREAD_PRIO_INHERIT 200809L /* linux feature */
+#define _POSIX_THREAD_PRIO_PROTECT 200809L /* linux feature */
+#define _POSIX_THREAD_PROCESS_SHARED -1 /* not implemented */
+#define _POSIX_THREAD_ROBUST_PRIO_INHERIT -1 /* not implemented */
+#define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 /* not implemented */
+#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
+#define _POSIX_THREAD_SPORADIC_SERVER -1 /* not implemented */
+#define _POSIX_THREAD_THREADS_MAX 64
+#define _POSIX_TIMEOUTS 200809L
+#define _POSIX_TIMERS 200809L /* Posix timers are supported */
+#define _POSIX_TIMER_MAX 32
+#define _POSIX_TRACE -1 /* not implemented */
+#define _POSIX_TRACE_EVENT_FILTER -1 /* not implemented */
+#define _POSIX_TRACE_INHERIT -1 /* not implemented */
+#define _POSIX_TRACE_LOG -1 /* not implemented */
+#define _POSIX_TRACE_NAME_MAX 8
+#define _POSIX_TRACE_SYS_MAX 8
+#define _POSIX_TRACE_USER_EVENT_MAX 32
+#define _POSIX_TTY_NAME_MAX 9 /* includes trailing NUL */
+#define _POSIX_TYPED_MEMORY_OBJECTS -1 /* not implemented */
+#define _POSIX_TZNAME_MAX 6
+#define _POSIX_VDISABLE '\0'
+
+#if defined(__LP64__)
+#define _POSIX_V7_ILP32_OFF32 -1
+#define _POSIX_V7_ILP32_OFFBIG -1
+#define _POSIX_V7_LP64_OFF64 1
+#define _POSIX_V7_LPBIG_OFFBIG 1
+#else
+#define _POSIX_V7_ILP32_OFF32 1
+#define _POSIX_V7_ILP32_OFFBIG -1
+#define _POSIX_V7_LP64_OFF64 -1
+#define _POSIX_V7_LPBIG_OFFBIG -1
+#endif
+
+#define _POSIX2_BC_BASE_MAX 99
+#define _POSIX2_BC_DIM_MAX 2048
+#define _POSIX2_BC_SCALE_MAX 99
+#define _POSIX2_BC_STRING_MAX 1000
+#define _POSIX2_CHARCLASS_NAME_MAX 14
+#define _POSIX2_CHAR_TERM -1 /* not implemented */
+#define _POSIX2_COLL_WEIGHTS_MAX 2
+#define _POSIX2_C_BIND _POSIX_VERSION
+#define _POSIX2_C_DEV -1 /* c dev utilities not implemented */
+#define _POSIX2_EXPR_NEST_MAX 32
+#define _POSIX2_LINE_MAX 2048
+#define _POSIX2_LOCALEDEF -1 /* localedef utilitiy not implemented */
+#define _POSIX2_RE_DUP_MAX _POSIX_RE_DUP_MAX
+#define _POSIX2_SW_DEV -1 /* software dev utilities not implemented */
+#define _POSIX2_UPE -1 /* user portability utilities not implemented */
+
+#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_IOV_MAX 16
+#define _XOPEN_LEGACY -1 /* not support all */
+#define _XOPEN_REALTIME -1 /* we don't support all these functions */
+#define _XOPEN_REALTIME_THREADS -1 /* same here */
+#define _XOPEN_SHM -1
+#define _XOPEN_UNIX 1
+
+#endif /* _POSIX_LIMITS_H_ */
diff --git a/libc/arch-mips/bionic/crtbegin_so.c b/libc/include/machine/pthread_types.h
similarity index 75%
rename from libc/arch-mips/bionic/crtbegin_so.c
rename to libc/include/machine/pthread_types.h
index d664ce6..900541c 100644
--- a/libc/arch-mips/bionic/crtbegin_so.c
+++ b/libc/include/machine/pthread_types.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 The Android Open Source Project
+ * Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +26,23 @@
* SUCH DAMAGE.
*/
-extern void __cxa_finalize(void *);
-extern void *__dso_handle;
+#ifndef _MACHINE_PTHREAD_TYPES_H_
+#define _MACHINE_PTHREAD_TYPES_H_
-__attribute__((visibility("hidden"),destructor))
-void __on_dlclose() {
- __cxa_finalize(&__dso_handle);
-}
+#include <sys/types.h>
-#include "../../arch-common/bionic/__dso_handle_so.h"
-#include "atexit.h"
+typedef long pthread_t;
+
+typedef struct {
+ uint32_t flags;
+ void* stack_base;
+ size_t stack_size;
+ size_t guard_size;
+ int32_t sched_policy;
+ int32_t sched_priority;
+#ifdef __LP64__
+ char __reserved[16];
+#endif
+} pthread_attr_t;
+
+#endif /* _MACHINE_PTHREAD_TYPES_H_ */
diff --git a/libc/include/malloc.h b/libc/include/malloc.h
index e6ea276..cb1dd3b 100644
--- a/libc/include/malloc.h
+++ b/libc/include/malloc.h
@@ -24,6 +24,7 @@
*/
#include <sys/cdefs.h>
#include <stddef.h>
+#include <stdio.h>
__BEGIN_DECLS
@@ -53,6 +54,27 @@
extern struct mallinfo mallinfo(void);
+/*
+ * XML structure for malloc_info(3) is in the following format:
+ *
+ * <malloc version="jemalloc-1">
+ * <heap nr="INT">
+ * <allocated-large>INT</allocated-large>
+ * <allocated-huge>INT</allocated-huge>
+ * <allocated-bins>INT</allocated-bins>
+ * <bins-total>INT</bins-total>
+ * <bin nr="INT">
+ * <allocated>INT</allocated>
+ * <nmalloc>INT</nmalloc>
+ * <ndalloc>INT</ndalloc>
+ * </bin>
+ * <!-- more bins -->
+ * </heap>
+ * <!-- more heaps -->
+ * </malloc>
+ */
+extern int malloc_info(int, FILE *);
+
__END_DECLS
#endif /* LIBC_INCLUDE_MALLOC_H_ */
diff --git a/libc/include/pathconf.h b/libc/include/pathconf.h
deleted file mode 100644
index 94f9787..0000000
--- a/libc/include/pathconf.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 _PATHCONF_H_
-#define _PATHCONF_H_
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-/* constants to be used for the 'name' paremeter of pathconf/fpathconf */
-
-#define _PC_FILESIZEBITS 0x0000
-#define _PC_LINK_MAX 0x0001
-#define _PC_MAX_CANON 0x0002
-#define _PC_MAX_INPUT 0x0003
-#define _PC_NAME_MAX 0x0004
-#define _PC_PATH_MAX 0x0005
-#define _PC_PIPE_BUF 0x0006
-#define _PC_2_SYMLINKS 0x0007
-#define _PC_ALLOC_SIZE_MIN 0x0008
-#define _PC_REC_INCR_XFER_SIZE 0x0009
-#define _PC_REC_MAX_XFER_SIZE 0x000a
-#define _PC_REC_MIN_XFER_SIZE 0x000b
-#define _PC_REC_XFER_ALIGN 0x000c
-#define _PC_SYMLINK_MAX 0x000d
-#define _PC_CHOWN_RESTRICTED 0x000e
-#define _PC_NO_TRUNC 0x000f
-#define _PC_VDISABLE 0x0010
-#define _PC_ASYNC_IO 0x0011
-#define _PC_PRIO_IO 0x0012
-#define _PC_SYNC_IO 0x0013
-
-extern long fpathconf(int fildes, int name);
-extern long pathconf(const char *path, int name);
-
-__END_DECLS
-
-#endif /* _PATHCONF_H_ */
-
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index c32890b..2178789 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -29,11 +29,12 @@
#ifndef _PTHREAD_H_
#define _PTHREAD_H_
-#include <time.h>
-#include <signal.h>
-#include <sched.h>
#include <limits.h>
+#include <machine/pthread_types.h>
+#include <sched.h>
+#include <sys/cdefs.h>
#include <sys/types.h>
+#include <time.h>
#if defined(__LP64__)
#define __RESERVED_INITIALIZER , {0}
@@ -52,9 +53,13 @@
#define __PTHREAD_RECURSIVE_MUTEX_INIT_VALUE 0x4000
#define __PTHREAD_ERRORCHECK_MUTEX_INIT_VALUE 0x8000
-#define PTHREAD_MUTEX_INITIALIZER {__PTHREAD_MUTEX_INIT_VALUE __RESERVED_INITIALIZER}
-#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER {__PTHREAD_RECURSIVE_MUTEX_INIT_VALUE __RESERVED_INITIALIZER}
-#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER {__PTHREAD_ERRORCHECK_MUTEX_INIT_VALUE __RESERVED_INITIALIZER}
+#define PTHREAD_MUTEX_INITIALIZER {__PTHREAD_MUTEX_INIT_VALUE __RESERVED_INITIALIZER}
+#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP {__PTHREAD_ERRORCHECK_MUTEX_INIT_VALUE __RESERVED_INITIALIZER}
+#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP {__PTHREAD_RECURSIVE_MUTEX_INIT_VALUE __RESERVED_INITIALIZER}
+
+/* TODO: remove this namespace pollution. */
+#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
enum {
PTHREAD_MUTEX_NORMAL = 0,
@@ -76,18 +81,6 @@
#define PTHREAD_COND_INITIALIZER {0 __RESERVED_INITIALIZER}
-typedef struct {
- uint32_t flags;
- void* stack_base;
- size_t stack_size;
- size_t guard_size;
- int32_t sched_policy;
- int32_t sched_priority;
-#ifdef __LP64__
- char __reserved[16];
-#endif
-} pthread_attr_t;
-
typedef long pthread_mutexattr_t;
typedef long pthread_condattr_t;
@@ -118,7 +111,6 @@
#endif
typedef int pthread_key_t;
-typedef long pthread_t;
typedef volatile int pthread_once_t;
@@ -195,8 +187,6 @@
int pthread_key_create(pthread_key_t*, void (*)(void*)) __nonnull((1));
int pthread_key_delete(pthread_key_t);
-int pthread_kill(pthread_t, int);
-
int pthread_mutexattr_destroy(pthread_mutexattr_t*) __nonnull((1));
int pthread_mutexattr_getpshared(const pthread_mutexattr_t*, int*) __nonnull((1, 2));
int pthread_mutexattr_gettype(const pthread_mutexattr_t*, int*) __nonnull((1, 2));
@@ -206,10 +196,10 @@
int pthread_mutex_destroy(pthread_mutex_t*) __nonnull((1));
int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*) __nonnull((1));
-int pthread_mutex_lock(pthread_mutex_t*) /* __nonnull((1)) */;
+int pthread_mutex_lock(pthread_mutex_t*) __nonnull((1));
int pthread_mutex_timedlock(pthread_mutex_t*, const struct timespec*) __nonnull((1, 2));
int pthread_mutex_trylock(pthread_mutex_t*) __nonnull((1));
-int pthread_mutex_unlock(pthread_mutex_t*) /* __nonnull((1)) */;
+int pthread_mutex_unlock(pthread_mutex_t*) __nonnull((1));
int pthread_once(pthread_once_t*, void (*)(void)) __nonnull((1, 2));
@@ -236,8 +226,6 @@
int pthread_setspecific(pthread_key_t, const void*);
-int pthread_sigmask(int, const sigset_t*, sigset_t*);
-
typedef void (*__pthread_cleanup_func_t)(void*);
typedef struct __pthread_cleanup_t {
diff --git a/libc/include/sched.h b/libc/include/sched.h
index e43b6cc..4f9e2a6 100644
--- a/libc/include/sched.h
+++ b/libc/include/sched.h
@@ -39,9 +39,8 @@
#define SCHED_OTHER SCHED_NORMAL
struct sched_param {
- int __sched_priority;
+ int sched_priority;
};
-#define sched_priority __sched_priority
extern int sched_setscheduler(pid_t, int, const struct sched_param*);
extern int sched_getscheduler(pid_t);
@@ -52,7 +51,7 @@
extern int sched_getparam(pid_t, struct sched_param*);
extern int sched_rr_get_interval(pid_t, struct timespec*);
-#ifdef _GNU_SOURCE
+#if defined(__USE_GNU)
extern int clone(int (*)(void*), void*, int, void*, ...);
extern int unshare(int);
@@ -146,7 +145,7 @@
extern int __sched_cpucount(size_t setsize, cpu_set_t* set);
-#endif /* _GNU_SOURCE */
+#endif /* __USE_GNU */
__END_DECLS
diff --git a/libc/include/semaphore.h b/libc/include/semaphore.h
index 7ae3c3a..5827870 100644
--- a/libc/include/semaphore.h
+++ b/libc/include/semaphore.h
@@ -25,6 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#ifndef _SEMAPHORE_H
#define _SEMAPHORE_H
@@ -32,6 +33,8 @@
__BEGIN_DECLS
+struct timespec;
+
typedef struct {
volatile unsigned int count;
#ifdef __LP64__
@@ -41,20 +44,18 @@
#define SEM_FAILED NULL
-extern int sem_init(sem_t *sem, int pshared, unsigned int value);
+int sem_destroy(sem_t*);
+int sem_getvalue(sem_t*, int*);
+int sem_init(sem_t*, int, unsigned int);
+int sem_post(sem_t*);
+int sem_timedwait(sem_t*, const struct timespec*);
+int sem_trywait(sem_t*);
+int sem_wait(sem_t*);
-extern int sem_close(sem_t *);
-extern int sem_destroy(sem_t *);
-extern int sem_getvalue(sem_t *, int *);
-extern int sem_init(sem_t *, int, unsigned int);
-extern sem_t *sem_open(const char *, int, ...);
-extern int sem_post(sem_t *);
-extern int sem_trywait(sem_t *);
-extern int sem_unlink(const char *);
-extern int sem_wait(sem_t *);
-
-struct timespec;
-extern int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout);
+/* These aren't actually implemented. */
+sem_t* sem_open(const char*, int, ...);
+int sem_close(sem_t*);
+int sem_unlink(const char*);
__END_DECLS
diff --git a/libc/include/signal.h b/libc/include/signal.h
index e23e65b..6d89ef7 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -29,12 +29,13 @@
#ifndef _SIGNAL_H_
#define _SIGNAL_H_
-#include <errno.h>
-#include <sys/cdefs.h>
-#include <limits.h> /* For LONG_BIT */
-#include <string.h> /* For memset() */
-#include <sys/types.h>
#include <asm/sigcontext.h>
+#include <errno.h>
+#include <limits.h>
+#include <machine/pthread_types.h>
+#include <string.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
#if defined(__LP64__) || defined(__mips__)
/* For 64-bit (and mips), the kernel's struct sigaction doesn't match the POSIX one,
@@ -129,6 +130,9 @@
extern void psiginfo(const siginfo_t*, const char*);
extern void psignal(int, const char*);
+extern int pthread_kill(pthread_t, int);
+extern int pthread_sigmask(int, const sigset_t*, sigset_t*);
+
__END_DECLS
#endif /* _SIGNAL_H_ */
diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h
index 58cb1bc..2c4f1ce 100644
--- a/libc/include/stdatomic.h
+++ b/libc/include/stdatomic.h
@@ -32,6 +32,12 @@
#include <sys/cdefs.h>
+#if defined(__GNUC__) && !defined(__GNUC_PREREQ)
+/* Duplicate definition here, since the mingw sys/cdefs.h omits the */
+/* definition, and this needs to be usable there. */
+#define __GNUC_PREREQ(x, y) \
+ ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || (__GNUC__ > (x)))
+#endif /* __GNUC__ && ... */
#if defined(__cplusplus) && __cplusplus >= 201103L && defined(_USING_LIBCXX)
# ifdef __clang__
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index a0161de..c0dac1a 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -38,6 +38,14 @@
#ifndef _STDIO_H_
#define _STDIO_H_
+/*
+ * This file must contain a reference to __gnuc_va_list so that GCC's
+ * fixincludes knows that that's what's being used for va_list, and so
+ * to leave our <stdio.h> alone. (fixincludes gets in the way of pointing
+ * one toolchain at various different sets of platform headers.)
+ * If you alter this comment, be sure to keep "__gnuc_va_list" in it!
+ */
+
#include <sys/cdefs.h>
#include <sys/types.h>
@@ -138,7 +146,16 @@
fpos_t _offset; /* current lseek offset */
} FILE;
+/* Legacy BSD implementation of stdin/stdout/stderr. */
extern FILE __sF[];
+/* More obvious implementation. */
+extern FILE* stdin;
+extern FILE* stdout;
+extern FILE* stderr;
+/* C99 and earlier plus current C++ standards say these must be macros. */
+#define stdin stdin
+#define stdout stdout
+#define stderr stderr
#define __SLBF 0x0001 /* line buffered */
#define __SNBF 0x0002 /* unbuffered */
@@ -201,10 +218,6 @@
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
-#define stdin (&__sF[0])
-#define stdout (&__sF[1])
-#define stderr (&__sF[2])
-
/*
* Functions defined in ANSI C standard.
*/
@@ -324,6 +337,11 @@
int putchar_unlocked(int);
#endif /* __POSIX_VISIBLE >= 199506 */
+#if __POSIX_VISIBLE >= 200809
+FILE* fmemopen(void*, size_t, const char*);
+FILE* open_memstream(char**, size_t*);
+#endif /* __POSIX_VISIBLE >= 200809 */
+
#endif /* __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE */
/*
@@ -340,6 +358,10 @@
__va_list)
__printflike(2, 0);
+void clearerr_unlocked(FILE*);
+int feof_unlocked(FILE*);
+int ferror_unlocked(FILE*);
+
/*
* Stdio function-access interface.
*/
diff --git a/libc/bionic/strxfrm_l.cpp b/libc/include/stdio_ext.h
similarity index 74%
copy from libc/bionic/strxfrm_l.cpp
copy to libc/include/stdio_ext.h
index afe3b96..f299e54 100644
--- a/libc/bionic/strxfrm_l.cpp
+++ b/libc/include/stdio_ext.h
@@ -26,8 +26,29 @@
* SUCH DAMAGE.
*/
-#include <string.h>
+#ifndef _STDIO_EXT_H
+#define _STDIO_EXT_H
-size_t strxfrm_l(char *dest, const char *src, size_t n, locale_t) {
- return strxfrm(dest, src, n);
-}
+#include <sys/cdefs.h>
+#include <stdio.h>
+
+#define FSETLOCKING_QUERY 0
+#define FSETLOCKING_INTERNAL 1
+#define FSETLOCKING_BYCALLER 2
+
+__BEGIN_DECLS
+
+size_t __fbufsize(FILE*);
+int __freading(FILE*);
+int __fwriting(FILE*);
+int __freadable(FILE*);
+int __fwritable(FILE*);
+int __flbf(FILE*);
+void __fpurge(FILE*);
+size_t __fpending(FILE*);
+void _flushlbf(void);
+int __fsetlocking(FILE*, int);
+
+__END_DECLS
+
+#endif /* _STDIO_EXT_H */
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index 52f371b..3053e85 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -59,8 +59,15 @@
extern char* mkdtemp(char*);
extern char* mktemp(char*) __warnattr("mktemp possibly used unsafely; consider using mkstemp");
-extern int mkstemp(char*);
+
+extern int mkostemp64(char*, int);
+extern int mkostemp(char*, int);
+extern int mkostemps64(char*, int, int);
+extern int mkostemps(char*, int, int);
extern int mkstemp64(char*);
+extern int mkstemp(char*);
+extern int mkstemps64(char*, int);
+extern int mkstemps(char*, int);
extern long strtol(const char *, char **, int);
extern long long strtoll(const char *, char **, int);
@@ -96,17 +103,8 @@
extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
-extern long jrand48(unsigned short *);
-extern long mrand48(void);
-extern long nrand48(unsigned short *);
-extern long lrand48(void);
-extern unsigned short *seed48(unsigned short*);
-extern double erand48(unsigned short xsubi[3]);
-extern double drand48(void);
-extern void srand48(long);
-
-unsigned int arc4random(void);
-unsigned int arc4random_uniform(unsigned int);
+uint32_t arc4random(void);
+uint32_t arc4random_uniform(uint32_t);
void arc4random_buf(void*, size_t);
#define RAND_MAX 0x7fffffff
@@ -115,6 +113,16 @@
int rand_r(unsigned int*);
void srand(unsigned int);
+double drand48(void);
+double erand48(unsigned short[3]);
+long jrand48(unsigned short[3]);
+void lcong48(unsigned short[7]);
+long lrand48(void);
+long mrand48(void);
+long nrand48(unsigned short[3]);
+unsigned short* seed48(unsigned short[3]);
+void srand48(long);
+
char* initstate(unsigned int, char*, size_t);
long random(void);
char* setstate(char*);
diff --git a/libc/include/string.h b/libc/include/string.h
index f2f6dd2..f0bed10 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -25,8 +25,9 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#ifndef _STRING_H_
-#define _STRING_H_
+
+#ifndef _STRING_H
+#define _STRING_H
#include <sys/cdefs.h>
#include <stddef.h>
@@ -57,8 +58,11 @@
extern char* strcpy(char* __restrict, const char* __restrict);
extern char* strcat(char* __restrict, const char* __restrict);
-extern int strcasecmp(const char *, const char *) __purefunc;
-extern int strncasecmp(const char *, const char *, size_t) __purefunc;
+int strcasecmp(const char*, const char*) __purefunc;
+int strcasecmp_l(const char*, const char*, locale_t) __purefunc;
+int strncasecmp(const char*, const char*, size_t) __purefunc;
+int strncasecmp_l(const char*, const char*, size_t, locale_t) __purefunc;
+
extern char* strdup(const char *);
extern char* strstr(const char *, const char *) __purefunc;
@@ -66,8 +70,13 @@
extern char* strtok(char* __restrict, const char* __restrict);
extern char* strtok_r(char* __restrict, const char* __restrict, char** __restrict);
-extern char* strerror(int);
-extern int strerror_r(int errnum, char *buf, size_t n);
+extern char* strerror(int);
+extern char* strerror_l(int, locale_t);
+#if defined(__USE_GNU)
+extern char* strerror_r(int, char*, size_t) __RENAME(__gnu_strerror_r);
+#else /* POSIX */
+extern int strerror_r(int, char*, size_t);
+#endif
extern size_t strnlen(const char *, size_t) __purefunc;
extern char* strncat(char* __restrict, const char* __restrict, size_t);
@@ -92,6 +101,20 @@
extern int strcoll_l(const char *, const char *, locale_t) __purefunc;
extern size_t strxfrm_l(char* __restrict, const char* __restrict, size_t, locale_t);
+#if defined(__USE_GNU) && !defined(__bionic_using_posix_basename)
+/*
+ * glibc has a basename in <string.h> that's different to the POSIX one in <libgen.h>.
+ * It doesn't modify its argument, and in C++ it's const-correct.
+ */
+#if defined(__cplusplus)
+extern "C++" char* basename(char*) __RENAME(__gnu_basename) __nonnull((1));
+extern "C++" const char* basename(const char*) __RENAME(__gnu_basename) __nonnull((1));
+#else
+extern char* basename(const char*) __RENAME(__gnu_basename) __nonnull((1));
+#endif
+#define __bionic_using_gnu_basename
+#endif
+
extern char* __stpncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t);
extern char* __strncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t);
extern size_t __strlcpy_real(char* __restrict, const char* __restrict, size_t) __RENAME(strlcpy);
@@ -281,4 +304,4 @@
__END_DECLS
-#endif /* _STRING_H_ */
+#endif /* _STRING_H */
diff --git a/libc/include/strings.h b/libc/include/strings.h
index ae261cf..1253006 100644
--- a/libc/include/strings.h
+++ b/libc/include/strings.h
@@ -41,22 +41,23 @@
#include <sys/types.h>
#include <sys/cdefs.h>
+#include <xlocale.h>
__BEGIN_DECLS
#if defined(__BIONIC_FORTIFY)
-#define bcopy(b1, b2, len) \
- (void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2)))
-#define bzero(b, len) \
- (void)(__builtin___memset_chk((b), '\0', (len), __bos0(b)))
+#define bcopy(b1, b2, len) (void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2)))
+#define bzero(b, len) (void)(__builtin___memset_chk((b), '\0', (len), __bos0(b)))
#else
#define bcopy(b1, b2, len) (void)(__builtin_memmove((b2), (b1), (len)))
#define bzero(b, len) (void)(__builtin_memset((b), '\0', (len)))
#endif
+int ffs(int);
-int ffs(int);
-int strcasecmp(const char *, const char *);
-int strncasecmp(const char *, const char *, size_t);
+int strcasecmp(const char*, const char*) __purefunc;
+int strcasecmp_l(const char*, const char*, locale_t) __purefunc;
+int strncasecmp(const char*, const char*, size_t) __purefunc;
+int strncasecmp_l(const char*, const char*, size_t, locale_t) __purefunc;
__END_DECLS
diff --git a/libc/include/sys/cachectl.h b/libc/include/sys/cachectl.h
index 57e6ae7..a302ff8 100644
--- a/libc/include/sys/cachectl.h
+++ b/libc/include/sys/cachectl.h
@@ -31,6 +31,5 @@
#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/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index 504e439..6f238a9 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -358,9 +358,32 @@
#define __RCSID(_s) /* nothing */
#define __SCCSID(_s) /* nothing */
+/*
+ * _BSD_SOURCE and _GNU_SOURCE are expected to be defined by callers before
+ * any standard header file is included. In those header files we test
+ * against __USE_BSD and __USE_GNU. glibc does this in <features.h> but we
+ * do it in <sys/cdefs.h> instead because that's where our existing
+ * _POSIX_C_SOURCE tests were, and we're already confident that <sys/cdefs.h>
+ * is included everywhere it should be.
+ *
+ * The _GNU_SOURCE test needs to come before any _BSD_SOURCE or _POSIX* tests
+ * because _GNU_SOURCE implies everything else.
+ */
+#if defined(_GNU_SOURCE)
+# define __USE_GNU 1
+# undef _POSIX_SOURCE
+# define _POSIX_SOURCE 1
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200809L
+# undef _BSD_SOURCE
+# define _BSD_SOURCE 1
+#endif
+
+#if defined(_BSD_SOURCE)
+# define __USE_BSD 1
+#endif
+
/*-
- * 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.
*
diff --git a/libc/include/sys/cdefs_elf.h b/libc/include/sys/cdefs_elf.h
index 6bb0a57..a40a867 100644
--- a/libc/include/sys/cdefs_elf.h
+++ b/libc/include/sys/cdefs_elf.h
@@ -34,10 +34,6 @@
__asm__(".global " #alias "\n" \
#alias " = " #sym);
-#define __weak_alias(alias,sym) \
- __asm__(".weak " #alias "\n" \
- #alias " = " #sym);
-
/* We use __warnattr instead of __warn_references.
* TODO: remove this and put an empty definition in one of the upstream-* compatibility headers.
*/
diff --git a/libc/include/sys/glibc-syscalls.h b/libc/include/sys/glibc-syscalls.h
index 459ee78..b7d9054 100644
--- a/libc/include/sys/glibc-syscalls.h
+++ b/libc/include/sys/glibc-syscalls.h
@@ -203,6 +203,7 @@
#define SYS_removexattr __NR_removexattr
#define SYS_rename __NR_rename
#define SYS_renameat __NR_renameat
+#define SYS_renameat2 __NR_renameat2
#define SYS_request_key __NR_request_key
#define SYS_restart_syscall __NR_restart_syscall
#define SYS_rmdir __NR_rmdir
@@ -533,6 +534,7 @@
#define SYS_removexattr __NR_removexattr
#define SYS_rename __NR_rename
#define SYS_renameat __NR_renameat
+#define SYS_renameat2 __NR_renameat2
#define SYS_request_key __NR_request_key
#define SYS_restart_syscall __NR_restart_syscall
#define SYS_rmdir __NR_rmdir
@@ -888,6 +890,7 @@
#define SYS_removexattr __NR_removexattr
#define SYS_rename __NR_rename
#define SYS_renameat __NR_renameat
+#define SYS_renameat2 __NR_renameat2
#define SYS_request_key __NR_request_key
#define SYS_reserved177 __NR_reserved177
#define SYS_reserved193 __NR_reserved193
@@ -1250,6 +1253,7 @@
#define SYS_removexattr __NR_removexattr
#define SYS_rename __NR_rename
#define SYS_renameat __NR_renameat
+#define SYS_renameat2 __NR_renameat2
#define SYS_request_key __NR_request_key
#define SYS_restart_syscall __NR_restart_syscall
#define SYS_rmdir __NR_rmdir
@@ -1580,6 +1584,7 @@
#define SYS_removexattr __NR_removexattr
#define SYS_rename __NR_rename
#define SYS_renameat __NR_renameat
+#define SYS_renameat2 __NR_renameat2
#define SYS_request_key __NR_request_key
#define SYS_restart_syscall __NR_restart_syscall
#define SYS_rmdir __NR_rmdir
diff --git a/libc/include/sys/limits.h b/libc/include/sys/limits.h
index c50eb10..be79cf3 100644
--- a/libc/include/sys/limits.h
+++ b/libc/include/sys/limits.h
@@ -115,57 +115,13 @@
/* Bionic-specific definitions */
-#define _POSIX_VERSION 200112L /* Posix C language bindings version */
+#define _POSIX_VERSION 200809L /* 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 _XOPEN_VERSION 700 /* by Posix definition */
-#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 */
-
-#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 /* the minimum mandated by POSIX */
-#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
-#define _POSIX_THREAD_KEYS_MAX 128 /* the minimum mandated by POSIX */
-#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
-#define _POSIX_THREAD_THREADS_MAX 64 /* the minimum mandated by POSIX */
-#define PTHREAD_THREADS_MAX /* bionic has no specific limit */
-
+#define PTHREAD_DESTRUCTOR_ITERATIONS 4 // >= _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+#define PTHREAD_KEYS_MAX 128 // >= _POSIX_THREAD_KEYS_MAX
+#define PTHREAD_THREADS_MAX 2048 // bionic has no specific limit
#endif
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index 9c7373a..7d85dd1 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -25,6 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#ifndef _SYS_STAT_H_
#define _SYS_STAT_H_
@@ -51,12 +52,9 @@
int st_blksize; \
int __pad2; \
long st_blocks; \
- long st_atime; \
- unsigned long st_atime_nsec; \
- long st_mtime; \
- unsigned long st_mtime_nsec; \
- long st_ctime; \
- unsigned long st_ctime_nsec; \
+ struct timespec st_atim; \
+ struct timespec st_mtim; \
+ struct timespec st_ctim; \
unsigned int __unused4; \
unsigned int __unused5; \
@@ -72,12 +70,9 @@
unsigned int st_rdev; \
unsigned int __pad1[3]; \
long long st_size; \
- unsigned int st_atime; \
- unsigned int st_atime_nsec; \
- unsigned int st_mtime; \
- unsigned int st_mtime_nsec; \
- unsigned int st_ctime; \
- unsigned int st_ctime_nsec; \
+ struct timespec st_atim; \
+ struct timespec st_mtim; \
+ struct timespec st_ctim; \
unsigned int st_blksize; \
unsigned int __pad2; \
unsigned long long st_blocks; \
@@ -95,12 +90,9 @@
long st_size; \
long st_blksize; \
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; \
+ struct timespec st_atim; \
+ struct timespec st_mtim; \
+ struct timespec st_ctim; \
long __pad3[3]; \
#else
@@ -117,12 +109,9 @@
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; \
+ struct timespec st_atim; \
+ struct timespec st_mtim; \
+ struct timespec st_ctim; \
unsigned long long st_ino; \
#endif
@@ -132,9 +121,14 @@
#undef __STAT64_BODY
-#define st_atimensec st_atime_nsec
-#define st_mtimensec st_mtime_nsec
-#define st_ctimensec st_ctime_nsec
+/* Compatibility with older versions of POSIX. */
+#define st_atime st_atim.tv_sec
+#define st_mtime st_mtim.tv_sec
+#define st_ctime st_ctim.tv_sec
+/* Compatibility with glibc. */
+#define st_atimensec st_atim.tv_nsec
+#define st_mtimensec st_mtim.tv_nsec
+#define st_ctimensec st_ctim.tv_nsec
#ifdef __USE_BSD
/* Permission macros provided by glibc for compatibility with BSDs. */
@@ -180,6 +174,7 @@
#endif /* defined(__BIONIC_FORTIFY) */
extern int mkfifo(const char*, mode_t);
+extern int mkfifoat(int, const char*, mode_t);
extern int fchmodat(int, const char*, mode_t, int);
extern int mkdirat(int, const char*, mode_t);
diff --git a/libc/include/sys/sysconf.h b/libc/include/sys/sysconf.h
index 3d058d7..8aa506e 100644
--- a/libc/include/sys/sysconf.h
+++ b/libc/include/sys/sysconf.h
@@ -50,7 +50,7 @@
#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_C_VERSION 0x000f /* Obsolescent in POSIX.1-2008, TODO: remove it. */
#define _SC_2_CHAR_TERM 0x0010
#define _SC_2_FORT_DEV 0x0011
#define _SC_2_FORT_RUN 0x0012
@@ -68,7 +68,7 @@
#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_XCU_VERSION 0x0021 /* Obsolescent in POSIX.1-2008, TODO: remove it. */
#define _SC_XOPEN_REALTIME 0x0022
#define _SC_XOPEN_REALTIME_THREADS 0x0023
#define _SC_XOPEN_LEGACY 0x0024
@@ -77,10 +77,10 @@
#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_XBS5_ILP32_OFF32 0x002a /* Obsolescent in POSIX.1-2008, TODO: remove it. */
+#define _SC_XBS5_ILP32_OFFBIG 0x002b /* Obsolescent in POSIX.1-2008, TODO: remove it. */
+#define _SC_XBS5_LP64_OFF64 0x002c /* Obsolescent in POSIX.1-2008, TODO: remove it. */
+#define _SC_XBS5_LPBIG_OFFBIG 0x002d /* Obsolescent in POSIX.1-2008, TODO: remove it. */
#define _SC_AIO_LISTIO_MAX 0x002e
#define _SC_AIO_MAX 0x002f
#define _SC_AIO_PRIO_DELTA_MAX 0x0030
@@ -129,6 +129,49 @@
#define _SC_AVPHYS_PAGES 0x0063
#define _SC_MONOTONIC_CLOCK 0x0064
+#define _SC_2_PBS 0x0065
+#define _SC_2_PBS_ACCOUNTING 0x0066
+#define _SC_2_PBS_CHECKPOINT 0x0067
+#define _SC_2_PBS_LOCATE 0x0068
+#define _SC_2_PBS_MESSAGE 0x0069
+#define _SC_2_PBS_TRACK 0x006a
+#define _SC_ADVISORY_INFO 0x006b
+#define _SC_BARRIERS 0x006c
+#define _SC_CLOCK_SELECTION 0x006d
+#define _SC_CPUTIME 0x006e
+#define _SC_HOST_NAME_MAX 0x006f
+#define _SC_IPV6 0x0070
+#define _SC_RAW_SOCKETS 0x0071
+#define _SC_READER_WRITER_LOCKS 0x0072
+#define _SC_REGEXP 0x0073
+#define _SC_SHELL 0x0074
+#define _SC_SPAWN 0x0075
+#define _SC_SPIN_LOCKS 0x0076
+#define _SC_SPORADIC_SERVER 0x0077
+#define _SC_SS_REPL_MAX 0x0078
+#define _SC_SYMLOOP_MAX 0x0079
+#define _SC_THREAD_CPUTIME 0x007a
+#define _SC_THREAD_PROCESS_SHARED 0x007b
+#define _SC_THREAD_ROBUST_PRIO_INHERIT 0x007c
+#define _SC_THREAD_ROBUST_PRIO_PROTECT 0x007d
+#define _SC_THREAD_SPORADIC_SERVER 0x007e
+#define _SC_TIMEOUTS 0x007f
+#define _SC_TRACE 0x0080
+#define _SC_TRACE_EVENT_FILTER 0x0081
+#define _SC_TRACE_EVENT_NAME_MAX 0x0082
+#define _SC_TRACE_INHERIT 0x0083
+#define _SC_TRACE_LOG 0x0084
+#define _SC_TRACE_NAME_MAX 0x0085
+#define _SC_TRACE_SYS_MAX 0x0086
+#define _SC_TRACE_USER_EVENT_MAX 0x0087
+#define _SC_TYPED_MEMORY_OBJECTS 0x0088
+#define _SC_V7_ILP32_OFF32 0x0089
+#define _SC_V7_ILP32_OFFBIG 0x008a
+#define _SC_V7_LP64_OFF64 0x008b
+#define _SC_V7_LPBIG_OFFBIG 0x008c
+#define _SC_XOPEN_STREAMS 0x008d
+#define _SC_XOPEN_UUCP 0x008e
+
long sysconf(int);
__END_DECLS
diff --git a/libc/include/sys/sysinfo.h b/libc/include/sys/sysinfo.h
index c7e46e6..b66bc8e 100644
--- a/libc/include/sys/sysinfo.h
+++ b/libc/include/sys/sysinfo.h
@@ -33,7 +33,15 @@
__BEGIN_DECLS
-extern int sysinfo (struct sysinfo *info);
+int sysinfo(struct sysinfo* info);
+
+int get_nprocs_conf(void);
+
+int get_nprocs(void);
+
+long get_phys_pages(void);
+
+long get_avphys_pages(void);
__END_DECLS
diff --git a/libc/include/sys/user.h b/libc/include/sys/user.h
index 0e36825..b370add 100644
--- a/libc/include/sys/user.h
+++ b/libc/include/sys/user.h
@@ -31,6 +31,7 @@
#include <sys/cdefs.h>
#include <limits.h> /* For PAGE_SIZE. */
+#include <stddef.h> /* For size_t. */
__BEGIN_DECLS
diff --git a/libc/include/sys/vfs.h b/libc/include/sys/vfs.h
index 5358ffb..1fbc8be 100644
--- a/libc/include/sys/vfs.h
+++ b/libc/include/sys/vfs.h
@@ -25,6 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#ifndef _SYS_VFS_H_
#define _SYS_VFS_H_
@@ -114,50 +115,27 @@
#define _STATFS_F_FRSIZE
#define _STATFS_F_FLAGS
-#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
+/* Pull in the kernel magic numbers. */
+#include <linux/magic.h>
+/* Add in ones that we had historically that aren't in the uapi header. */
+#define BEFS_SUPER_MAGIC 0x42465331
+#define BFS_MAGIC 0x1BADFACE
+#define CIFS_MAGIC_NUMBER 0xFF534D42
+#define COH_SUPER_MAGIC 0x012FF7B7
+#define DEVFS_SUPER_MAGIC 0x1373
+#define EXT_SUPER_MAGIC 0x137D
+#define EXT2_OLD_SUPER_MAGIC 0xEF51
+#define HFS_SUPER_MAGIC 0x4244
+#define JFS_SUPER_MAGIC 0x3153464a
+#define NTFS_SB_MAGIC 0x5346544e
+#define ROMFS_MAGIC 0x7275
+#define SYSV2_SUPER_MAGIC 0x012FF7B6
+#define SYSV4_SUPER_MAGIC 0x012FF7B5
+#define UDF_SUPER_MAGIC 0x15013346
+#define UFS_MAGIC 0x00011954
+#define VXFS_SUPER_MAGIC 0xa501FCF5
+#define XENIX_SUPER_MAGIC 0x012FF7B4
+#define XFS_SUPER_MAGIC 0x58465342
extern int statfs(const char*, struct statfs*) __nonnull((1, 2));
extern int statfs64(const char*, struct statfs64*) __nonnull((1, 2));
diff --git a/libc/include/time.h b/libc/include/time.h
index 34a53b2..1b0f6a1 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -85,8 +85,12 @@
extern clock_t clock(void) __LIBC_ABI_PUBLIC__;
-extern int clock_getres(int, struct timespec*) __LIBC_ABI_PUBLIC__;
-extern int clock_gettime(int, struct timespec*) __LIBC_ABI_PUBLIC__;
+extern int clock_getcpuclockid(pid_t, clockid_t*) __LIBC_ABI_PUBLIC__;
+
+extern int clock_getres(clockid_t, struct timespec*) __LIBC_ABI_PUBLIC__;
+extern int clock_gettime(clockid_t, struct timespec*) __LIBC_ABI_PUBLIC__;
+extern int clock_nanosleep(clockid_t, int, const struct timespec*, struct timespec*) __LIBC_ABI_PUBLIC__;
+extern int clock_settime(clockid_t, const struct timespec*) __LIBC_ABI_PUBLIC__;
extern int timer_create(int, struct sigevent*, timer_t*) __LIBC_ABI_PUBLIC__;
extern int timer_delete(timer_t) __LIBC_ABI_PUBLIC__;
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index 1bfdb0e..e94ee66 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -25,6 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#ifndef _UNISTD_H_
#define _UNISTD_H_
@@ -33,7 +34,6 @@
#include <sys/types.h>
#include <sys/select.h>
#include <sys/sysconf.h>
-#include <pathconf.h>
__BEGIN_DECLS
@@ -47,6 +47,29 @@
#define SEEK_CUR 1
#define SEEK_END 2
+#define _PC_FILESIZEBITS 0
+#define _PC_LINK_MAX 1
+#define _PC_MAX_CANON 2
+#define _PC_MAX_INPUT 3
+#define _PC_NAME_MAX 4
+#define _PC_PATH_MAX 5
+#define _PC_PIPE_BUF 6
+#define _PC_2_SYMLINKS 7
+#define _PC_ALLOC_SIZE_MIN 8
+#define _PC_REC_INCR_XFER_SIZE 9
+#define _PC_REC_MAX_XFER_SIZE 10
+#define _PC_REC_MIN_XFER_SIZE 11
+#define _PC_REC_XFER_ALIGN 12
+#define _PC_SYMLINK_MAX 13
+#define _PC_CHOWN_RESTRICTED 14
+#define _PC_NO_TRUNC 15
+#define _PC_VDISABLE 16
+#define _PC_ASYNC_IO 17
+#define _PC_PRIO_IO 18
+#define _PC_SYNC_IO 19
+
+#include <machine/posix_limits.h>
+
extern char** environ;
extern __noreturn void _exit(int);
@@ -95,6 +118,9 @@
extern void endusershell(void);
+extern long fpathconf(int, int);
+extern long pathconf(const char*, int);
+
/* Macros for access() */
#define R_OK 4 /* Read */
@@ -112,7 +138,7 @@
extern int fchdir(int);
extern int rmdir(const char *);
extern int pipe(int *);
-#ifdef _GNU_SOURCE
+#if defined(__USE_GNU)
extern int pipe2(int *, int);
#endif
extern int chroot(const char *);
@@ -143,9 +169,7 @@
extern int dup(int);
extern int dup2(int, int);
-#ifdef _GNU_SOURCE
extern int dup3(int, int, int);
-#endif
extern int fcntl(int, int, ...);
extern int ioctl(int, int, ...);
extern int flock(int, int);
@@ -159,7 +183,8 @@
extern unsigned int sleep(unsigned int);
extern int usleep(useconds_t);
-extern int gethostname(char *, size_t);
+int gethostname(char*, size_t);
+int sethostname(const char*, size_t);
extern void *__brk(void *);
extern int brk(void *);
diff --git a/libc/include/wchar.h b/libc/include/wchar.h
index e0e5c82..cfd2299 100644
--- a/libc/include/wchar.h
+++ b/libc/include/wchar.h
@@ -34,6 +34,7 @@
#include <stdarg.h>
#include <stddef.h>
#include <time.h>
+#include <xlocale.h>
#include <machine/wchar_limits.h>
@@ -110,8 +111,11 @@
extern int vswscanf(const wchar_t*, const wchar_t*, va_list);
extern int vwprintf(const wchar_t*, va_list);
extern int vwscanf(const wchar_t*, va_list);
+extern wchar_t* wcpcpy (wchar_t*, const wchar_t *);
+extern wchar_t* wcpncpy (wchar_t*, const wchar_t *, size_t);
extern size_t wcrtomb(char *, wchar_t, mbstate_t *);
extern int wcscasecmp(const wchar_t *, const wchar_t *);
+extern int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
extern wchar_t *wcscat(wchar_t *, const wchar_t *);
extern wchar_t *wcschr(const wchar_t *, wchar_t);
extern int wcscmp(const wchar_t *, const wchar_t *);
@@ -121,6 +125,7 @@
extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *) __LIBC_ABI_PUBLIC__;
extern size_t wcslen(const wchar_t *);
extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
+extern int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
extern wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t);
extern int wcsncmp(const wchar_t *, const wchar_t *, size_t);
extern wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t);
@@ -166,6 +171,7 @@
extern wctrans_t wctrans(const char*);
#if __POSIX_VISIBLE >= 200809
+FILE* open_wmemstream(wchar_t**, size_t*);
wchar_t* wcsdup(const wchar_t*);
size_t wcsnlen(const wchar_t*, size_t);
#endif
diff --git a/libc/kernel/tools/clean_header.py b/libc/kernel/tools/clean_header.py
index 6601817..ebebe80 100755
--- a/libc/kernel/tools/clean_header.py
+++ b/libc/kernel/tools/clean_header.py
@@ -199,8 +199,7 @@
if opt == '-u':
noUpdate = 0
elif opt == '-v':
- verbose = 1
- D_setlevel(1)
+ logging.basicConfig(level=logging.DEBUG)
elif opt == '-k':
kernel_original_path = arg
elif opt == '-d':
diff --git a/libc/kernel/tools/cpp.py b/libc/kernel/tools/cpp.py
index 2be9532..0c098de 100644
--- a/libc/kernel/tools/cpp.py
+++ b/libc/kernel/tools/cpp.py
@@ -1711,7 +1711,7 @@
while j < n and not blocks[j].isIf():
j += 1
if j > i:
- D2("appending lines %d to %d" % (blocks[i].lineno, blocks[j-1].lineno))
+ logging.debug("appending lines %d to %d" % (blocks[i].lineno, blocks[j-1].lineno))
result += blocks[i:j]
if j >= n:
break
@@ -1730,17 +1730,17 @@
break
dir = blocks[j].directive
if dir == "endif":
- D2("remove 'if 0' .. 'endif' (lines %d to %d)" % (blocks[i].lineno, blocks[j].lineno))
+ logging.debug("remove 'if 0' .. 'endif' (lines %d to %d)" % (blocks[i].lineno, blocks[j].lineno))
i = j + 1
elif dir == "else":
# convert 'else' into 'if 1'
- D2("convert 'if 0' .. 'else' into 'if 1' (lines %d to %d)" % (blocks[i].lineno, blocks[j-1].lineno))
+ logging.debug("convert 'if 0' .. 'else' into 'if 1' (lines %d to %d)" % (blocks[i].lineno, blocks[j-1].lineno))
blocks[j].directive = "if"
blocks[j].expr = CppExpr( CppLineTokenizer("1").toTokenList() )
i = j
elif dir == "elif":
# convert 'elif' into 'if'
- D2("convert 'if 0' .. 'elif' into 'if'")
+ logging.debug("convert 'if 0' .. 'elif' into 'if'")
blocks[j].directive = "if"
i = j
continue
@@ -1749,25 +1749,25 @@
k = find_matching_endif( blocks, j+1 )
if k >= n:
# unterminated #if 1, finish here
- D2("unterminated 'if 1'")
+ logging.debug("unterminated 'if 1'")
result += blocks[j+1:k]
break
dir = blocks[k].directive
if dir == "endif":
- D2("convert 'if 1' .. 'endif' (lines %d to %d)" % (blocks[j].lineno, blocks[k].lineno))
+ logging.debug("convert 'if 1' .. 'endif' (lines %d to %d)" % (blocks[j].lineno, blocks[k].lineno))
result += optimize_if01(blocks[j+1:k])
i = k+1
elif dir == "else":
# convert 'else' into 'if 0'
- D2("convert 'if 1' .. 'else' (lines %d to %d)" % (blocks[j].lineno, blocks[k].lineno))
+ logging.debug("convert 'if 1' .. 'else' (lines %d to %d)" % (blocks[j].lineno, blocks[k].lineno))
result += optimize_if01(blocks[j+1:k])
blocks[k].directive = "if"
blocks[k].expr = CppExpr( CppLineTokenizer("0").toTokenList() )
i = k
elif dir == "elif":
# convert 'elif' into 'if 0'
- D2("convert 'if 1' .. 'elif' (lines %d to %d)" % (blocks[j].lineno, blocks[k].lineno))
+ logging.debug("convert 'if 1' .. 'elif' (lines %d to %d)" % (blocks[j].lineno, blocks[k].lineno))
result += optimize_if01(blocks[j+1:k])
blocks[k].expr = CppExpr( CppLineTokenizer("0").toTokenList() )
i = k
@@ -1835,7 +1835,6 @@
out = StringOutput()
lines = string.split(text, '\n')
list = BlockParser().parse( CppLinesTokenizer(lines) )
- #D_setlevel(2)
list.replaceTokens( kernel_token_replacements )
list.optimizeAll( {"__KERNEL__":kCppUndefinedMacro} )
list.write(out)
diff --git a/libc/kernel/tools/utils.py b/libc/kernel/tools/utils.py
index 0478e93..e5a310e 100644
--- a/libc/kernel/tools/utils.py
+++ b/libc/kernel/tools/utils.py
@@ -1,59 +1,29 @@
# common python utility routines for the Bionic tool scripts
-import sys, os, commands, string, commands
+import commands
+import logging
+import os
+import string
+import sys
-# basic debugging trace support
-# call D_setlevel to set the verbosity level
-# and D(), D2(), D3(), D4() to add traces
-#
-verbose = 0
def panic(msg):
- sys.stderr.write( find_program_name() + ": error: " )
- sys.stderr.write( msg )
+ sys.stderr.write(os.path.basename(sys.argv[0]) + ": error: ")
+ sys.stderr.write(msg)
sys.exit(1)
-def D(msg):
- global verbose
- if verbose > 0:
- print msg
-
-def D2(msg):
- global verbose
- if verbose >= 2:
- print msg
-
-def D3(msg):
- global verbose
- if verbose >= 3:
- print msg
-
-def D4(msg):
- global verbose
- if verbose >= 4:
- print msg
-
-def D_setlevel(level):
- global verbose
- verbose = level
-
-
-# other stuff
-#
-#
-def find_program_name():
- return os.path.basename(sys.argv[0])
def find_program_dir():
return os.path.dirname(sys.argv[0])
+
class StringOutput:
def __init__(self):
self.line = ""
def write(self,msg):
self.line += msg
- D2("write '%s'" % msg)
+ logging.debug("write '%s'" % msg)
def get(self):
return self.line
@@ -76,47 +46,6 @@
continue
os.mkdir(dir)
-def walk_source_files(paths,callback,args,excludes=[]):
- """recursively walk a list of paths and files, only keeping the source files in directories"""
- for path in paths:
- if len(path) > 0 and path[0] == '@':
- # this is the name of another file, include it and parse it
- path = path[1:]
- if os.path.exists(path):
- for line in open(path):
- if len(line) > 0 and line[-1] == '\n':
- line = line[:-1]
- walk_source_files([line],callback,args,excludes)
- continue
- if not os.path.isdir(path):
- callback(path,args)
- else:
- for root, dirs, files in os.walk(path):
- #print "w-- %s (ex: %s)" % (repr((root,dirs)), repr(excludes))
- if len(excludes):
- for d in dirs[:]:
- if os.path.join(root,d) in excludes:
- dirs.remove(d)
- for f in files:
- r, ext = os.path.splitext(f)
- if ext in [ ".h", ".c", ".cpp", ".S" ]:
- callback( "%s/%s" % (root,f), args )
-
-def cleanup_dir(path):
- """create a directory if needed, and ensure that it is totally empty
- by removing any existing content in it"""
- if not os.path.exists(path):
- os.mkdir(path)
- else:
- for root, dirs, files in os.walk(path, topdown=False):
- if root.endswith("kernel_headers/"):
- # skip 'kernel_headers'
- continue
- for name in files:
- os.remove(os.path.join(root, name))
- for name in dirs:
- os.rmdir(os.path.join(root, name))
-
class BatchFileUpdater:
"""a class used to edit several files at once"""
diff --git a/libc/kernel/uapi/asm-arm/asm/hwcap.h b/libc/kernel/uapi/asm-arm/asm/hwcap.h
index e70f3b8..25dc930 100644
--- a/libc/kernel/uapi/asm-arm/asm/hwcap.h
+++ b/libc/kernel/uapi/asm-arm/asm/hwcap.h
@@ -47,4 +47,10 @@
#define HWCAP_LPAE (1 << 20)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define HWCAP_EVTSTRM (1 << 21)
+#define HWCAP2_AES (1 << 0)
+#define HWCAP2_PMULL (1 << 1)
+#define HWCAP2_SHA1 (1 << 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define HWCAP2_SHA2 (1 << 3)
+#define HWCAP2_CRC32 (1 << 4)
#endif
diff --git a/libc/kernel/uapi/asm-arm/asm/kvm.h b/libc/kernel/uapi/asm-arm/asm/kvm.h
index 2b5a17e..3599ff7 100644
--- a/libc/kernel/uapi/asm-arm/asm/kvm.h
+++ b/libc/kernel/uapi/asm-arm/asm/kvm.h
@@ -19,162 +19,165 @@
#ifndef __ARM_KVM_H__
#define __ARM_KVM_H__
#include <linux/types.h>
-#include <asm/ptrace.h>
+#include <linux/psci.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <asm/ptrace.h>
#define __KVM_HAVE_GUEST_DEBUG
#define __KVM_HAVE_IRQ_LINE
#define KVM_REG_SIZE(id) (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
-#define KVM_ARM_SVC_sp svc_regs[0]
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_SVC_sp svc_regs[0]
#define KVM_ARM_SVC_lr svc_regs[1]
#define KVM_ARM_SVC_spsr svc_regs[2]
#define KVM_ARM_ABT_sp abt_regs[0]
-#define KVM_ARM_ABT_lr abt_regs[1]
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_ABT_lr abt_regs[1]
#define KVM_ARM_ABT_spsr abt_regs[2]
#define KVM_ARM_UND_sp und_regs[0]
#define KVM_ARM_UND_lr und_regs[1]
-#define KVM_ARM_UND_spsr und_regs[2]
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_UND_spsr und_regs[2]
#define KVM_ARM_IRQ_sp irq_regs[0]
#define KVM_ARM_IRQ_lr irq_regs[1]
#define KVM_ARM_IRQ_spsr irq_regs[2]
-#define KVM_ARM_FIQ_r8 fiq_regs[0]
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_FIQ_r8 fiq_regs[0]
#define KVM_ARM_FIQ_r9 fiq_regs[1]
#define KVM_ARM_FIQ_r10 fiq_regs[2]
#define KVM_ARM_FIQ_fp fiq_regs[3]
-#define KVM_ARM_FIQ_ip fiq_regs[4]
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_FIQ_ip fiq_regs[4]
#define KVM_ARM_FIQ_sp fiq_regs[5]
#define KVM_ARM_FIQ_lr fiq_regs[6]
#define KVM_ARM_FIQ_spsr fiq_regs[7]
-struct kvm_regs {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct kvm_regs {
struct pt_regs usr_regs;
unsigned long svc_regs[3];
unsigned long abt_regs[3];
- unsigned long und_regs[3];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned long und_regs[3];
unsigned long irq_regs[3];
unsigned long fiq_regs[8];
};
-#define KVM_ARM_TARGET_CORTEX_A15 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_TARGET_CORTEX_A15 0
#define KVM_ARM_TARGET_CORTEX_A7 1
#define KVM_ARM_NUM_TARGETS 2
#define KVM_ARM_DEVICE_TYPE_SHIFT 0
-#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
#define KVM_ARM_DEVICE_ID_SHIFT 16
#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
#define KVM_ARM_DEVICE_VGIC_V2 0
-#define KVM_VGIC_V2_ADDR_TYPE_DIST 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_VGIC_V2_ADDR_TYPE_DIST 0
#define KVM_VGIC_V2_ADDR_TYPE_CPU 1
#define KVM_VGIC_V2_DIST_SIZE 0x1000
#define KVM_VGIC_V2_CPU_SIZE 0x2000
-#define KVM_ARM_VCPU_POWER_OFF 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_VCPU_POWER_OFF 0
+#define KVM_ARM_VCPU_PSCI_0_2 1
struct kvm_vcpu_init {
__u32 target;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 features[7];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_sregs {
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_fpu {
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_guest_debug_arch {
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_debug_exit_arch {
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_sync_regs {
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_arch_memory_slot {
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
#define KVM_REG_ARM_COPROC_SHIFT 16
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_32_OPC2_MASK 0x0000000000000007
#define KVM_REG_ARM_32_OPC2_SHIFT 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_OPC1_MASK 0x0000000000000078
#define KVM_REG_ARM_OPC1_SHIFT 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_CRM_MASK 0x0000000000000780
#define KVM_REG_ARM_CRM_SHIFT 7
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_32_CRN_MASK 0x0000000000007800
#define KVM_REG_ARM_32_CRN_SHIFT 11
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ARM_CP15_REG_SHIFT_MASK(x,n) (((x) << KVM_REG_ARM_ ## n ## _SHIFT) & KVM_REG_ARM_ ## n ## _MASK)
#define __ARM_CP15_REG(op1,crn,crm,op2) (KVM_REG_ARM | (15 << KVM_REG_ARM_COPROC_SHIFT) | ARM_CP15_REG_SHIFT_MASK(op1, OPC1) | ARM_CP15_REG_SHIFT_MASK(crn, 32_CRN) | ARM_CP15_REG_SHIFT_MASK(crm, CRM) | ARM_CP15_REG_SHIFT_MASK(op2, 32_OPC2))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ARM_CP15_REG32(...) (__ARM_CP15_REG(__VA_ARGS__) | KVM_REG_SIZE_U32)
#define __ARM_CP15_REG64(op1,crm) (__ARM_CP15_REG(op1, 0, crm, 0) | KVM_REG_SIZE_U64)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ARM_CP15_REG64(...) __ARM_CP15_REG64(__VA_ARGS__)
#define KVM_REG_ARM_TIMER_CTL ARM_CP15_REG32(0, 14, 3, 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_TIMER_CNT ARM_CP15_REG64(1, 14)
#define KVM_REG_ARM_TIMER_CVAL ARM_CP15_REG64(3, 14)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / 4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_DEMUX (0x0011 << KVM_REG_ARM_COPROC_SHIFT)
#define KVM_REG_ARM_DEMUX_ID_MASK 0x000000000000FF00
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_DEMUX_ID_SHIFT 8
#define KVM_REG_ARM_DEMUX_ID_CCSIDR (0x00 << KVM_REG_ARM_DEMUX_ID_SHIFT)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_DEMUX_VAL_MASK 0x00000000000000FF
#define KVM_REG_ARM_DEMUX_VAL_SHIFT 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_VFP (0x0012 << KVM_REG_ARM_COPROC_SHIFT)
#define KVM_REG_ARM_VFP_MASK 0x000000000000FFFF
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_VFP_BASE_REG 0x0
#define KVM_REG_ARM_VFP_FPSID 0x1000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_VFP_FPSCR 0x1001
#define KVM_REG_ARM_VFP_MVFR1 0x1006
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_VFP_MVFR0 0x1007
#define KVM_REG_ARM_VFP_FPEXC 0x1008
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_VFP_FPINST 0x1009
#define KVM_REG_ARM_VFP_FPINST2 0x100A
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_ARM_VGIC_GRP_CPU_REGS 2
#define KVM_DEV_ARM_VGIC_CPUID_SHIFT 32
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_ARM_VGIC_CPUID_MASK (0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT)
#define KVM_DEV_ARM_VGIC_OFFSET_SHIFT 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_ARM_VGIC_OFFSET_MASK (0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT)
#define KVM_ARM_IRQ_TYPE_SHIFT 24
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_TYPE_MASK 0xff
#define KVM_ARM_IRQ_VCPU_SHIFT 16
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_VCPU_MASK 0xff
#define KVM_ARM_IRQ_NUM_SHIFT 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_NUM_MASK 0xffff
#define KVM_ARM_IRQ_TYPE_CPU 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_TYPE_SPI 1
#define KVM_ARM_IRQ_TYPE_PPI 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_CPU_IRQ 0
#define KVM_ARM_IRQ_CPU_FIQ 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_GIC_MAX 127
#define KVM_PSCI_FN_BASE 0x95c1ba5e
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n))
#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1)
#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3)
-#define KVM_PSCI_RET_SUCCESS 0
-#define KVM_PSCI_RET_NI ((unsigned long)-1)
-#define KVM_PSCI_RET_INVAL ((unsigned long)-2)
+#define KVM_PSCI_RET_SUCCESS PSCI_RET_SUCCESS
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define KVM_PSCI_RET_DENIED ((unsigned long)-3)
+#define KVM_PSCI_RET_NI PSCI_RET_NOT_SUPPORTED
+#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS
+#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/asm-arm/asm/unistd.h b/libc/kernel/uapi/asm-arm/asm/unistd.h
index be9f36f..c93934a 100644
--- a/libc/kernel/uapi/asm-arm/asm/unistd.h
+++ b/libc/kernel/uapi/asm-arm/asm/unistd.h
@@ -458,27 +458,28 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_setattr (__NR_SYSCALL_BASE+380)
#define __NR_sched_getattr (__NR_SYSCALL_BASE+381)
+#define __NR_renameat2 (__NR_SYSCALL_BASE+382)
#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
-#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
-#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
#undef __NR_time
#undef __NR_umount
#undef __NR_stime
-#undef __NR_alarm
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#undef __NR_alarm
#undef __NR_utime
#undef __NR_getrlimit
#undef __NR_select
-#undef __NR_readdir
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#undef __NR_readdir
#undef __NR_mmap
#undef __NR_socketcall
#undef __NR_syscall
-#undef __NR_ipc
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#undef __NR_ipc
#endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/kvm.h b/libc/kernel/uapi/asm-arm64/asm/kvm.h
index 93abd43..7b80332 100644
--- a/libc/kernel/uapi/asm-arm64/asm/kvm.h
+++ b/libc/kernel/uapi/asm-arm64/asm/kvm.h
@@ -28,131 +28,134 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_NR_SPSR 5
#ifndef __ASSEMBLY__
+#include <linux/psci.h>
#include <asm/types.h>
-#include <asm/ptrace.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <asm/ptrace.h>
#define __KVM_HAVE_GUEST_DEBUG
#define __KVM_HAVE_IRQ_LINE
#define KVM_REG_SIZE(id) (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
-struct kvm_regs {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct kvm_regs {
struct user_pt_regs regs;
__u64 sp_el1;
__u64 elr_el1;
- __u64 spsr[KVM_NR_SPSR];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 spsr[KVM_NR_SPSR];
struct user_fpsimd_state fp_regs;
};
#define KVM_ARM_TARGET_AEM_V8 0
-#define KVM_ARM_TARGET_FOUNDATION_V8 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_TARGET_FOUNDATION_V8 1
#define KVM_ARM_TARGET_CORTEX_A57 2
#define KVM_ARM_TARGET_XGENE_POTENZA 3
-#define KVM_ARM_NUM_TARGETS 4
-#define KVM_ARM_DEVICE_TYPE_SHIFT 0
+#define KVM_ARM_TARGET_CORTEX_A53 4
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_NUM_TARGETS 5
+#define KVM_ARM_DEVICE_TYPE_SHIFT 0
#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
#define KVM_ARM_DEVICE_ID_SHIFT 16
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
#define KVM_ARM_DEVICE_VGIC_V2 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_VGIC_V2_ADDR_TYPE_DIST 0
#define KVM_VGIC_V2_ADDR_TYPE_CPU 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_VGIC_V2_DIST_SIZE 0x1000
#define KVM_VGIC_V2_CPU_SIZE 0x2000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_VCPU_POWER_OFF 0
#define KVM_ARM_VCPU_EL1_32BIT 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_ARM_VCPU_PSCI_0_2 2
struct kvm_vcpu_init {
__u32 target;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 features[7];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct kvm_sregs {
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_fpu {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct kvm_guest_debug_arch {
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_debug_exit_arch {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct kvm_sync_regs {
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_arch_memory_slot {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
#define KVM_REG_ARM_COPROC_SHIFT 16
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / sizeof(__u32))
#define KVM_REG_ARM_DEMUX (0x0011 << KVM_REG_ARM_COPROC_SHIFT)
#define KVM_REG_ARM_DEMUX_ID_MASK 0x000000000000FF00
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_DEMUX_ID_SHIFT 8
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_DEMUX_ID_CCSIDR (0x00 << KVM_REG_ARM_DEMUX_ID_SHIFT)
#define KVM_REG_ARM_DEMUX_VAL_MASK 0x00000000000000FF
#define KVM_REG_ARM_DEMUX_VAL_SHIFT 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM64_SYSREG (0x0013 << KVM_REG_ARM_COPROC_SHIFT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM64_SYSREG_OP0_MASK 0x000000000000c000
#define KVM_REG_ARM64_SYSREG_OP0_SHIFT 14
#define KVM_REG_ARM64_SYSREG_OP1_MASK 0x0000000000003800
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM64_SYSREG_OP1_SHIFT 11
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM64_SYSREG_CRN_MASK 0x0000000000000780
#define KVM_REG_ARM64_SYSREG_CRN_SHIFT 7
#define KVM_REG_ARM64_SYSREG_CRM_MASK 0x0000000000000078
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM64_SYSREG_CRM_SHIFT 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM64_SYSREG_OP2_MASK 0x0000000000000007
#define KVM_REG_ARM64_SYSREG_OP2_SHIFT 0
#define ARM64_SYS_REG_SHIFT_MASK(x,n) (((x) << KVM_REG_ARM64_SYSREG_ ## n ## _SHIFT) & KVM_REG_ARM64_SYSREG_ ## n ## _MASK)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARM64_SYS_REG(op0,op1,crn,crm,op2) (KVM_REG_ARM64 | KVM_REG_ARM64_SYSREG | ARM64_SYS_REG_SHIFT_MASK(op0, OP0) | ARM64_SYS_REG_SHIFT_MASK(op1, OP1) | ARM64_SYS_REG_SHIFT_MASK(crn, CRN) | ARM64_SYS_REG_SHIFT_MASK(crm, CRM) | ARM64_SYS_REG_SHIFT_MASK(op2, OP2))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ARM64_SYS_REG(...) (__ARM64_SYS_REG(__VA_ARGS__) | KVM_REG_SIZE_U64)
#define KVM_REG_ARM_TIMER_CTL ARM64_SYS_REG(3, 3, 14, 3, 1)
#define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
#define KVM_DEV_ARM_VGIC_GRP_CPU_REGS 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_ARM_VGIC_CPUID_SHIFT 32
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_ARM_VGIC_CPUID_MASK (0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT)
#define KVM_DEV_ARM_VGIC_OFFSET_SHIFT 0
#define KVM_DEV_ARM_VGIC_OFFSET_MASK (0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_TYPE_SHIFT 24
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_TYPE_MASK 0xff
#define KVM_ARM_IRQ_VCPU_SHIFT 16
#define KVM_ARM_IRQ_VCPU_MASK 0xff
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_NUM_SHIFT 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_NUM_MASK 0xffff
#define KVM_ARM_IRQ_TYPE_CPU 0
#define KVM_ARM_IRQ_TYPE_SPI 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_TYPE_PPI 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_ARM_IRQ_CPU_IRQ 0
#define KVM_ARM_IRQ_CPU_FIQ 1
#define KVM_ARM_IRQ_GIC_MAX 127
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_PSCI_FN_BASE 0x95c1ba5e
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n))
#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0)
#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3)
-#define KVM_PSCI_RET_SUCCESS 0
-#define KVM_PSCI_RET_NI ((unsigned long)-1)
+#define KVM_PSCI_RET_SUCCESS PSCI_RET_SUCCESS
+#define KVM_PSCI_RET_NI PSCI_RET_NOT_SUPPORTED
+#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define KVM_PSCI_RET_INVAL ((unsigned long)-2)
-#define KVM_PSCI_RET_DENIED ((unsigned long)-3)
+#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED
#endif
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/asm-arm64/asm/perf_regs.h b/libc/kernel/uapi/asm-arm64/asm/perf_regs.h
new file mode 100644
index 0000000..7110868
--- /dev/null
+++ b/libc/kernel/uapi/asm-arm64/asm/perf_regs.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_ARM64_PERF_REGS_H
+#define _ASM_ARM64_PERF_REGS_H
+enum perf_event_arm_regs {
+ PERF_REG_ARM64_X0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_REG_ARM64_X1,
+ PERF_REG_ARM64_X2,
+ PERF_REG_ARM64_X3,
+ PERF_REG_ARM64_X4,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_REG_ARM64_X5,
+ PERF_REG_ARM64_X6,
+ PERF_REG_ARM64_X7,
+ PERF_REG_ARM64_X8,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_REG_ARM64_X9,
+ PERF_REG_ARM64_X10,
+ PERF_REG_ARM64_X11,
+ PERF_REG_ARM64_X12,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_REG_ARM64_X13,
+ PERF_REG_ARM64_X14,
+ PERF_REG_ARM64_X15,
+ PERF_REG_ARM64_X16,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_REG_ARM64_X17,
+ PERF_REG_ARM64_X18,
+ PERF_REG_ARM64_X19,
+ PERF_REG_ARM64_X20,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_REG_ARM64_X21,
+ PERF_REG_ARM64_X22,
+ PERF_REG_ARM64_X23,
+ PERF_REG_ARM64_X24,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_REG_ARM64_X25,
+ PERF_REG_ARM64_X26,
+ PERF_REG_ARM64_X27,
+ PERF_REG_ARM64_X28,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_REG_ARM64_X29,
+ PERF_REG_ARM64_LR,
+ PERF_REG_ARM64_SP,
+ PERF_REG_ARM64_PC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_REG_ARM64_MAX,
+};
+#endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/posix_types.h b/libc/kernel/uapi/asm-arm64/asm/posix_types.h
index 1b89253..6289bbe 100644
--- a/libc/kernel/uapi/asm-arm64/asm/posix_types.h
+++ b/libc/kernel/uapi/asm-arm64/asm/posix_types.h
@@ -16,4 +16,11 @@
***
****************************************************************************
****************************************************************************/
+#ifndef __ASM_POSIX_TYPES_H
+#define __ASM_POSIX_TYPES_H
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __kernel_old_uid_t __kernel_old_uid_t
#include <asm-generic/posix_types.h>
+#endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/sigcontext.h b/libc/kernel/uapi/asm-arm64/asm/sigcontext.h
index c59f9c0..8918925 100644
--- a/libc/kernel/uapi/asm-arm64/asm/sigcontext.h
+++ b/libc/kernel/uapi/asm-arm64/asm/sigcontext.h
@@ -43,4 +43,11 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__uint128_t vregs[32];
};
+#define ESR_MAGIC 0x45535201
+struct esr_context {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct _aarch64_ctx head;
+ __u64 esr;
+};
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/asm-generic/fcntl.h b/libc/kernel/uapi/asm-generic/fcntl.h
index a15878f..9c1881b 100644
--- a/libc/kernel/uapi/asm-generic/fcntl.h
+++ b/libc/kernel/uapi/asm-generic/fcntl.h
@@ -136,71 +136,73 @@
#define F_GETOWNER_UIDS 17
#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define F_OFD_GETLK 36
+#define F_OFD_SETLK 37
+#define F_OFD_SETLKW 38
#define F_OWNER_TID 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define F_OWNER_PID 1
#define F_OWNER_PGRP 2
struct f_owner_ex {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__kernel_pid_t pid;
};
#define FD_CLOEXEC 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifndef F_RDLCK
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifndef F_EXLCK
#define F_EXLCK 4
#define F_SHLCK 8
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define LOCK_SH 1
#define LOCK_EX 2
#define LOCK_NB 4
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define LOCK_UN 8
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define LOCK_MAND 32
#define LOCK_READ 64
#define LOCK_WRITE 128
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define LOCK_RW 192
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define F_LINUX_SPECIFIC_BASE 1024
#ifndef HAVE_ARCH_STRUCT_FLOCK
#ifndef __ARCH_FLOCK_PAD
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARCH_FLOCK_PAD
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
struct flock {
short l_type;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
short l_whence;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__kernel_off_t l_start;
__kernel_off_t l_len;
__kernel_pid_t l_pid;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__ARCH_FLOCK_PAD
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#endif
-#ifndef __LP64__
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifndef HAVE_ARCH_STRUCT_FLOCK64
#ifndef __ARCH_FLOCK64_PAD
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARCH_FLOCK64_PAD
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct flock64 {
short l_type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
short l_whence;
__kernel_loff_t l_start;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__kernel_loff_t l_len;
__kernel_pid_t l_pid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__ARCH_FLOCK64_PAD
};
+#endif
+#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#endif
-#endif
-#endif
diff --git a/libc/kernel/uapi/asm-generic/resource.h b/libc/kernel/uapi/asm-generic/resource.h
index 243817a..a2bb17f 100644
--- a/libc/kernel/uapi/asm-generic/resource.h
+++ b/libc/kernel/uapi/asm-generic/resource.h
@@ -56,8 +56,4 @@
#define RLIM_INFINITY (~0UL)
#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#ifndef _STK_LIM_MAX
-#define _STK_LIM_MAX RLIM_INFINITY
#endif
-#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/asm-generic/unistd.h b/libc/kernel/uapi/asm-generic/unistd.h
index becc82d..4f87b6c 100644
--- a/libc/kernel/uapi/asm-generic/unistd.h
+++ b/libc/kernel/uapi/asm-generic/unistd.h
@@ -113,407 +113,409 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_quotactl 60
#define __NR_getdents64 61
+#define __ARCH_WANT_COMPAT_SYS_GETDENTS64
#define __NR3264_lseek 62
-#define __NR_read 63
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_read 63
#define __NR_write 64
#define __NR_readv 65
#define __NR_writev 66
-#define __NR_pread64 67
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_pread64 67
#define __NR_pwrite64 68
#define __NR_preadv 69
#define __NR_pwritev 70
-#define __NR3264_sendfile 71
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR3264_sendfile 71
#define __NR_pselect6 72
#define __NR_ppoll 73
#define __NR_signalfd4 74
-#define __NR_vmsplice 75
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_vmsplice 75
#define __NR_splice 76
#define __NR_tee 77
#define __NR_readlinkat 78
-#define __NR3264_fstatat 79
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR3264_fstatat 79
#define __NR3264_fstat 80
#define __NR_sync 81
#define __NR_fsync 82
-#define __NR_fdatasync 83
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_fdatasync 83
#ifdef __ARCH_WANT_SYNC_FILE_RANGE2
#define __NR_sync_file_range2 84
#else
-#define __NR_sync_file_range 84
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_sync_file_range 84
#endif
#define __NR_timerfd_create 85
#define __NR_timerfd_settime 86
-#define __NR_timerfd_gettime 87
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_timerfd_gettime 87
#define __NR_utimensat 88
#define __NR_acct 89
#define __NR_capget 90
-#define __NR_capset 91
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_capset 91
#define __NR_personality 92
#define __NR_exit 93
#define __NR_exit_group 94
-#define __NR_waitid 95
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_waitid 95
#define __NR_set_tid_address 96
#define __NR_unshare 97
#define __NR_futex 98
-#define __NR_set_robust_list 99
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_set_robust_list 99
#define __NR_get_robust_list 100
#define __NR_nanosleep 101
#define __NR_getitimer 102
-#define __NR_setitimer 103
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setitimer 103
#define __NR_kexec_load 104
#define __NR_init_module 105
#define __NR_delete_module 106
-#define __NR_timer_create 107
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_timer_create 107
#define __NR_timer_gettime 108
#define __NR_timer_getoverrun 109
#define __NR_timer_settime 110
-#define __NR_timer_delete 111
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_timer_delete 111
#define __NR_clock_settime 112
#define __NR_clock_gettime 113
#define __NR_clock_getres 114
-#define __NR_clock_nanosleep 115
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_clock_nanosleep 115
#define __NR_syslog 116
#define __NR_ptrace 117
#define __NR_sched_setparam 118
-#define __NR_sched_setscheduler 119
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_sched_setscheduler 119
#define __NR_sched_getscheduler 120
#define __NR_sched_getparam 121
#define __NR_sched_setaffinity 122
-#define __NR_sched_getaffinity 123
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_sched_getaffinity 123
#define __NR_sched_yield 124
#define __NR_sched_get_priority_max 125
#define __NR_sched_get_priority_min 126
-#define __NR_sched_rr_get_interval 127
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_sched_rr_get_interval 127
#define __NR_restart_syscall 128
#define __NR_kill 129
#define __NR_tkill 130
-#define __NR_tgkill 131
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_tgkill 131
#define __NR_sigaltstack 132
#define __NR_rt_sigsuspend 133
#define __NR_rt_sigaction 134
-#define __NR_rt_sigprocmask 135
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_rt_sigprocmask 135
#define __NR_rt_sigpending 136
#define __NR_rt_sigtimedwait 137
#define __NR_rt_sigqueueinfo 138
-#define __NR_rt_sigreturn 139
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_rt_sigreturn 139
#define __NR_setpriority 140
#define __NR_getpriority 141
#define __NR_reboot 142
-#define __NR_setregid 143
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setregid 143
#define __NR_setgid 144
#define __NR_setreuid 145
#define __NR_setuid 146
-#define __NR_setresuid 147
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setresuid 147
#define __NR_getresuid 148
#define __NR_setresgid 149
#define __NR_getresgid 150
-#define __NR_setfsuid 151
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setfsuid 151
#define __NR_setfsgid 152
#define __NR_times 153
#define __NR_setpgid 154
-#define __NR_getpgid 155
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getpgid 155
#define __NR_getsid 156
#define __NR_setsid 157
#define __NR_getgroups 158
-#define __NR_setgroups 159
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setgroups 159
#define __NR_uname 160
#define __NR_sethostname 161
#define __NR_setdomainname 162
-#define __NR_getrlimit 163
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getrlimit 163
#define __NR_setrlimit 164
#define __NR_getrusage 165
#define __NR_umask 166
-#define __NR_prctl 167
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_prctl 167
#define __NR_getcpu 168
#define __NR_gettimeofday 169
#define __NR_settimeofday 170
-#define __NR_adjtimex 171
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_adjtimex 171
#define __NR_getpid 172
#define __NR_getppid 173
#define __NR_getuid 174
-#define __NR_geteuid 175
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_geteuid 175
#define __NR_getgid 176
#define __NR_getegid 177
#define __NR_gettid 178
-#define __NR_sysinfo 179
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_sysinfo 179
#define __NR_mq_open 180
#define __NR_mq_unlink 181
#define __NR_mq_timedsend 182
-#define __NR_mq_timedreceive 183
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_mq_timedreceive 183
#define __NR_mq_notify 184
#define __NR_mq_getsetattr 185
#define __NR_msgget 186
-#define __NR_msgctl 187
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_msgctl 187
#define __NR_msgrcv 188
#define __NR_msgsnd 189
#define __NR_semget 190
-#define __NR_semctl 191
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_semctl 191
#define __NR_semtimedop 192
#define __NR_semop 193
#define __NR_shmget 194
-#define __NR_shmctl 195
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_shmctl 195
#define __NR_shmat 196
#define __NR_shmdt 197
#define __NR_socket 198
-#define __NR_socketpair 199
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_socketpair 199
#define __NR_bind 200
#define __NR_listen 201
#define __NR_accept 202
-#define __NR_connect 203
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_connect 203
#define __NR_getsockname 204
#define __NR_getpeername 205
#define __NR_sendto 206
-#define __NR_recvfrom 207
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_recvfrom 207
#define __NR_setsockopt 208
#define __NR_getsockopt 209
#define __NR_shutdown 210
-#define __NR_sendmsg 211
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_sendmsg 211
#define __NR_recvmsg 212
#define __NR_readahead 213
#define __NR_brk 214
-#define __NR_munmap 215
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_munmap 215
#define __NR_mremap 216
#define __NR_add_key 217
#define __NR_request_key 218
-#define __NR_keyctl 219
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_keyctl 219
#define __NR_clone 220
#define __NR_execve 221
#define __NR3264_mmap 222
-#define __NR3264_fadvise64 223
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR3264_fadvise64 223
#ifndef __ARCH_NOMMU
#define __NR_swapon 224
#define __NR_swapoff 225
-#define __NR_mprotect 226
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_mprotect 226
#define __NR_msync 227
#define __NR_mlock 228
#define __NR_munlock 229
-#define __NR_mlockall 230
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_mlockall 230
#define __NR_munlockall 231
#define __NR_mincore 232
#define __NR_madvise 233
-#define __NR_remap_file_pages 234
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_remap_file_pages 234
#define __NR_mbind 235
#define __NR_get_mempolicy 236
#define __NR_set_mempolicy 237
-#define __NR_migrate_pages 238
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_migrate_pages 238
#define __NR_move_pages 239
#endif
#define __NR_rt_tgsigqueueinfo 240
-#define __NR_perf_event_open 241
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_perf_event_open 241
#define __NR_accept4 242
#define __NR_recvmmsg 243
#define __NR_arch_specific_syscall 244
-#define __NR_wait4 260
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_wait4 260
#define __NR_prlimit64 261
#define __NR_fanotify_init 262
#define __NR_fanotify_mark 263
-#define __NR_name_to_handle_at 264
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_name_to_handle_at 264
#define __NR_open_by_handle_at 265
#define __NR_clock_adjtime 266
#define __NR_syncfs 267
-#define __NR_setns 268
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setns 268
#define __NR_sendmmsg 269
#define __NR_process_vm_readv 270
#define __NR_process_vm_writev 271
-#define __NR_kcmp 272
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_kcmp 272
#define __NR_finit_module 273
#define __NR_sched_setattr 274
#define __NR_sched_getattr 275
-#undef __NR_syscalls
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define __NR_syscalls 276
+#define __NR_renameat2 276
+#undef __NR_syscalls
+#define __NR_syscalls 277
#ifdef __ARCH_WANT_SYSCALL_NO_AT
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_open 1024
#define __NR_link 1025
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_unlink 1026
#define __NR_mknod 1027
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_chmod 1028
#define __NR_chown 1029
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mkdir 1030
#define __NR_rmdir 1031
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_lchown 1032
#define __NR_access 1033
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_rename 1034
#define __NR_readlink 1035
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_symlink 1036
#define __NR_utimes 1037
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR3264_stat 1038
#define __NR3264_lstat 1039
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#undef __NR_syscalls
#define __NR_syscalls (__NR3264_lstat+1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
#ifdef __ARCH_WANT_SYSCALL_NO_FLAGS
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_pipe 1040
#define __NR_dup2 1041
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_epoll_create 1042
#define __NR_inotify_init 1043
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_eventfd 1044
#define __NR_signalfd 1045
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#undef __NR_syscalls
#define __NR_syscalls (__NR_signalfd+1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
#if (__BITS_PER_LONG == 32 || defined(__SYSCALL_COMPAT)) && defined(__ARCH_WANT_SYSCALL_OFF_T)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sendfile 1046
#define __NR_ftruncate 1047
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_truncate 1048
#define __NR_stat 1049
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_lstat 1050
#define __NR_fstat 1051
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fcntl 1052
#define __NR_fadvise64 1053
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARCH_WANT_SYS_FADVISE64
#define __NR_newfstatat 1054
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARCH_WANT_SYS_NEWFSTATAT
#define __NR_fstatfs 1055
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_statfs 1056
#define __NR_lseek 1057
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mmap 1058
#undef __NR_syscalls
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_syscalls (__NR_mmap+1)
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __ARCH_WANT_SYSCALL_DEPRECATED
#define __NR_alarm 1059
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARCH_WANT_SYS_ALARM
#define __NR_getpgrp 1060
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARCH_WANT_SYS_GETPGRP
#define __NR_pause 1061
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARCH_WANT_SYS_PAUSE
#define __NR_time 1062
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_COMPAT_SYS_TIME
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_utime 1063
#define __ARCH_WANT_SYS_UTIME
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_creat 1064
#define __NR_getdents 1065
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __ARCH_WANT_SYS_GETDENTS
#define __NR_futimesat 1066
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_select 1067
#define __ARCH_WANT_SYS_SELECT
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_poll 1068
#define __NR_epoll_wait 1069
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_ustat 1070
#define __NR_vfork 1071
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_oldwait4 1072
#define __NR_recv 1073
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_send 1074
#define __NR_bdflush 1075
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_umount 1076
#define __ARCH_WANT_SYS_OLDUMOUNT
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_uselib 1077
#define __NR__sysctl 1078
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fork 1079
#undef __NR_syscalls
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_syscalls (__NR_fork+1)
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
#define __NR_fcntl __NR3264_fcntl
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_statfs __NR3264_statfs
#define __NR_fstatfs __NR3264_fstatfs
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_truncate __NR3264_truncate
#define __NR_ftruncate __NR3264_ftruncate
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_lseek __NR3264_lseek
#define __NR_sendfile __NR3264_sendfile
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_newfstatat __NR3264_fstatat
#define __NR_fstat __NR3264_fstat
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mmap __NR3264_mmap
#define __NR_fadvise64 __NR3264_fadvise64
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __NR3264_stat
#define __NR_stat __NR3264_stat
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_lstat __NR3264_lstat
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#else
#define __NR_fcntl64 __NR3264_fcntl
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_statfs64 __NR3264_statfs
#define __NR_fstatfs64 __NR3264_fstatfs
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_truncate64 __NR3264_truncate
#define __NR_ftruncate64 __NR3264_ftruncate
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_llseek __NR3264_lseek
#define __NR_sendfile64 __NR3264_sendfile
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fstatat64 __NR3264_fstatat
#define __NR_fstat64 __NR3264_fstat
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mmap2 __NR3264_mmap
#define __NR_fadvise64_64 __NR3264_fadvise64
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __NR3264_stat
#define __NR_stat64 __NR3264_stat
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_lstat64 __NR3264_lstat
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/asm-mips/asm/bitfield.h b/libc/kernel/uapi/asm-mips/asm/bitfield.h
new file mode 100644
index 0000000..4b8ac19
--- /dev/null
+++ b/libc/kernel/uapi/asm-mips/asm/bitfield.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __UAPI_ASM_BITFIELD_H
+#define __UAPI_ASM_BITFIELD_H
+#define __BITFIELD_FIELD(field, more) more field;
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/asm-mips/asm/inst.h b/libc/kernel/uapi/asm-mips/asm/inst.h
index c46d09b..18b5465 100644
--- a/libc/kernel/uapi/asm-mips/asm/inst.h
+++ b/libc/kernel/uapi/asm-mips/asm/inst.h
@@ -18,67 +18,77 @@
****************************************************************************/
#ifndef _UAPI_ASM_INST_H
#define _UAPI_ASM_INST_H
+#include <asm/bitfield.h>
enum major_op {
- spec_op, bcond_op, j_op, jal_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ spec_op, bcond_op, j_op, jal_op,
beq_op, bne_op, blez_op, bgtz_op,
addi_op, addiu_op, slti_op, sltiu_op,
andi_op, ori_op, xori_op, lui_op,
- cop0_op, cop1_op, cop2_op, cop1x_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ cop0_op, cop1_op, cop2_op, cop1x_op,
beql_op, bnel_op, blezl_op, bgtzl_op,
daddi_op, daddiu_op, ldl_op, ldr_op,
spec2_op, jalx_op, mdmx_op, spec3_op,
- lb_op, lh_op, lwl_op, lw_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ lb_op, lh_op, lwl_op, lw_op,
lbu_op, lhu_op, lwr_op, lwu_op,
sb_op, sh_op, swl_op, sw_op,
sdl_op, sdr_op, swr_op, cache_op,
- ll_op, lwc1_op, lwc2_op, pref_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ ll_op, lwc1_op, lwc2_op, pref_op,
lld_op, ldc1_op, ldc2_op, ld_op,
sc_op, swc1_op, swc2_op, major_3b_op,
scd_op, sdc1_op, sdc2_op, sd_op
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
enum spec_op {
sll_op, movc_op, srl_op, sra_op,
sllv_op, pmon_op, srlv_op, srav_op,
- jr_op, jalr_op, movz_op, movn_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ jr_op, jalr_op, movz_op, movn_op,
syscall_op, break_op, spim_op, sync_op,
mfhi_op, mthi_op, mflo_op, mtlo_op,
dsllv_op, spec2_unused_op, dsrlv_op, dsrav_op,
- mult_op, multu_op, div_op, divu_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mult_op, multu_op, div_op, divu_op,
dmult_op, dmultu_op, ddiv_op, ddivu_op,
add_op, addu_op, sub_op, subu_op,
and_op, or_op, xor_op, nor_op,
- spec3_unused_op, spec4_unused_op, slt_op, sltu_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ spec3_unused_op, spec4_unused_op, slt_op, sltu_op,
dadd_op, daddu_op, dsub_op, dsubu_op,
tge_op, tgeu_op, tlt_op, tltu_op,
teq_op, spec5_unused_op, tne_op, spec6_unused_op,
- dsll_op, spec7_unused_op, dsrl_op, dsra_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ dsll_op, spec7_unused_op, dsrl_op, dsra_op,
dsll32_op, spec8_unused_op, dsrl32_op, dsra32_op
};
enum spec2_op {
- madd_op, maddu_op, mul_op, spec2_3_unused_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ madd_op, maddu_op, mul_op, spec2_3_unused_op,
msub_op, msubu_op,
clz_op = 0x20, clo_op,
dclz_op = 0x24, dclo_op,
- sdbpp_op = 0x3f
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ sdbpp_op = 0x3f
};
enum spec3_op {
ext_op, dextm_op, dextu_op, dext_op,
- ins_op, dinsm_op, dinsu_op, dins_op,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- lx_op = 0x0a,
- bshfl_op = 0x20,
- dbshfl_op = 0x24,
+ ins_op, dinsm_op, dinsu_op, dins_op,
+ yield_op = 0x09, lx_op = 0x0a,
+ lwle_op = 0x19, lwre_op = 0x1a,
+ cachee_op = 0x1b, sbe_op = 0x1c,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ she_op = 0x1d, sce_op = 0x1e,
+ swe_op = 0x1f, bshfl_op = 0x20,
+ swle_op = 0x21, swre_op = 0x22,
+ prefe_op = 0x23, dbshfl_op = 0x24,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ lbue_op = 0x28, lhue_op = 0x29,
+ lbe_op = 0x2c, lhe_op = 0x2d,
+ lle_op = 0x2e, lwe_op = 0x2f,
rdhwr_op = 0x3b
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
@@ -112,773 +122,805 @@
tlbr_op = 0x01, tlbwi_op = 0x02,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
tlbwr_op = 0x06, tlbp_op = 0x08,
- rfe_op = 0x10, eret_op = 0x18
+ rfe_op = 0x10, eret_op = 0x18,
+ wait_op = 0x20,
};
-enum cop0_com_func {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum cop0_com_func {
tlbr1_op = 0x01, tlbw_op = 0x02,
tlbp1_op = 0x08, dctr_op = 0x09,
dctw_op = 0x0a
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
enum cop1_fmt {
s_fmt, d_fmt, e_fmt, q_fmt,
w_fmt, l_fmt
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
enum cop1_sdw_func {
fadd_op = 0x00, fsub_op = 0x01,
fmul_op = 0x02, fdiv_op = 0x03,
- fsqrt_op = 0x04, fabs_op = 0x05,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ fsqrt_op = 0x04, fabs_op = 0x05,
fmov_op = 0x06, fneg_op = 0x07,
froundl_op = 0x08, ftruncl_op = 0x09,
fceill_op = 0x0a, ffloorl_op = 0x0b,
- fround_op = 0x0c, ftrunc_op = 0x0d,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ fround_op = 0x0c, ftrunc_op = 0x0d,
fceil_op = 0x0e, ffloor_op = 0x0f,
fmovc_op = 0x11, fmovz_op = 0x12,
fmovn_op = 0x13, frecip_op = 0x15,
- frsqrt_op = 0x16, fcvts_op = 0x20,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ frsqrt_op = 0x16, fcvts_op = 0x20,
fcvtd_op = 0x21, fcvte_op = 0x22,
fcvtw_op = 0x24, fcvtl_op = 0x25,
fcmp_op = 0x30
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
enum cop1x_func {
lwxc1_op = 0x00, ldxc1_op = 0x01,
swxc1_op = 0x08, sdxc1_op = 0x09,
- pfetch_op = 0x0f, madd_s_op = 0x20,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ pfetch_op = 0x0f, madd_s_op = 0x20,
madd_d_op = 0x21, madd_e_op = 0x22,
msub_s_op = 0x28, msub_d_op = 0x29,
msub_e_op = 0x2a, nmadd_s_op = 0x30,
- nmadd_d_op = 0x31, nmadd_e_op = 0x32,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ nmadd_d_op = 0x31, nmadd_e_op = 0x32,
nmsub_s_op = 0x38, nmsub_d_op = 0x39,
nmsub_e_op = 0x3a
};
-enum mad_func {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum mad_func {
madd_fp_op = 0x08, msub_fp_op = 0x0a,
nmadd_fp_op = 0x0c, nmsub_fp_op = 0x0e
};
-enum lx_func {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum lx_func {
lwx_op = 0x00,
lhx_op = 0x04,
lbux_op = 0x06,
- ldx_op = 0x08,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ ldx_op = 0x08,
lwux_op = 0x10,
lhux_op = 0x14,
lbx_op = 0x16,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+enum bshfl_func {
+ wsbh_op = 0x2,
+ dshd_op = 0x5,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ seb_op = 0x10,
+ seh_op = 0x18,
+};
enum mm_major_op {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_pool32a_op, mm_pool16a_op, mm_lbu16_op, mm_move16_op,
mm_addi32_op, mm_lbu32_op, mm_sb32_op, mm_lb32_op,
mm_pool32b_op, mm_pool16b_op, mm_lhu16_op, mm_andi16_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_addiu32_op, mm_lhu32_op, mm_sh32_op, mm_lh32_op,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_pool32i_op, mm_pool16c_op, mm_lwsp16_op, mm_pool16d_op,
mm_ori32_op, mm_pool32f_op, mm_reserved1_op, mm_reserved2_op,
mm_pool32c_op, mm_lwgp16_op, mm_lw16_op, mm_pool16e_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_xori32_op, mm_jals32_op, mm_addiupc_op, mm_reserved3_op,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_reserved4_op, mm_pool16f_op, mm_sb16_op, mm_beqz16_op,
mm_slti32_op, mm_beq32_op, mm_swc132_op, mm_lwc132_op,
mm_reserved5_op, mm_reserved6_op, mm_sh16_op, mm_bnez16_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_sltiu32_op, mm_bne32_op, mm_sdc132_op, mm_ldc132_op,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_reserved7_op, mm_reserved8_op, mm_swsp16_op, mm_b16_op,
mm_andi32_op, mm_j32_op, mm_sd32_op, mm_ld32_op,
mm_reserved11_op, mm_reserved12_op, mm_sw16_op, mm_li16_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_jalx32_op, mm_jal32_op, mm_sw32_op, mm_lw32_op,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum mm_32i_minor_op {
mm_bltz_op, mm_bltzal_op, mm_bgez_op, mm_bgezal_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_blez_op, mm_bnezc_op, mm_bgtz_op, mm_beqzc_op,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_tlti_op, mm_tgei_op, mm_tltiu_op, mm_tgeiu_op,
mm_tnei_op, mm_lui_op, mm_teqi_op, mm_reserved13_op,
mm_synci_op, mm_bltzals_op, mm_reserved14_op, mm_bgezals_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_bc2f_op, mm_bc2t_op, mm_reserved15_op, mm_reserved16_op,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_reserved17_op, mm_reserved18_op, mm_bposge64_op, mm_bposge32_op,
mm_bc1f_op, mm_bc1t_op, mm_reserved19_op, mm_reserved20_op,
mm_bc1any2f_op, mm_bc1any2t_op, mm_bc1any4f_op, mm_bc1any4t_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum mm_32a_minor_op {
mm_sll32_op = 0x000,
mm_ins_op = 0x00c,
+ mm_sllv32_op = 0x010,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_ext_op = 0x02c,
mm_pool32axf_op = 0x03c,
mm_srl32_op = 0x040,
mm_sra_op = 0x080,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_srlv32_op = 0x090,
mm_rotr_op = 0x0c0,
mm_lwxs_op = 0x118,
mm_addu32_op = 0x150,
- mm_subu32_op = 0x1d0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_subu32_op = 0x1d0,
+ mm_wsbh_op = 0x1ec,
+ mm_mul_op = 0x210,
mm_and_op = 0x250,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_or32_op = 0x290,
mm_xor32_op = 0x310,
-};
+ mm_slt_op = 0x350,
+ mm_sltu_op = 0x390,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
enum mm_32b_func {
mm_lwc2_func = 0x0,
mm_lwp_func = 0x1,
- mm_ldc2_func = 0x2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_ldc2_func = 0x2,
mm_ldp_func = 0x4,
mm_lwm32_func = 0x5,
mm_cache_func = 0x6,
- mm_ldm_func = 0x7,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_ldm_func = 0x7,
mm_swc2_func = 0x8,
mm_swp_func = 0x9,
mm_sdc2_func = 0xa,
- mm_sdp_func = 0xc,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_sdp_func = 0xc,
mm_swm32_func = 0xd,
mm_sdm_func = 0xf,
};
-enum mm_32c_func {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum mm_32c_func {
mm_pref_func = 0x2,
mm_ll_func = 0x3,
mm_swr_func = 0x9,
- mm_sc_func = 0xb,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_sc_func = 0xb,
mm_lwu_func = 0xe,
};
enum mm_32axf_minor_op {
- mm_mfc0_op = 0x003,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_mfc0_op = 0x003,
mm_mtc0_op = 0x00b,
mm_tlbp_op = 0x00d,
+ mm_mfhi32_op = 0x035,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_jalr_op = 0x03c,
mm_tlbr_op = 0x04d,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_mflo32_op = 0x075,
mm_jalrhb_op = 0x07c,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_tlbwi_op = 0x08d,
mm_tlbwr_op = 0x0cd,
mm_jalrs_op = 0x13c,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_jalrshb_op = 0x17c,
- mm_syscall_op = 0x22d,
- mm_eret_op = 0x3cd,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_sync_op = 0x1ad,
+ mm_syscall_op = 0x22d,
+ mm_wait_op = 0x24d,
+ mm_eret_op = 0x3cd,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mm_divu_op = 0x5dc,
+};
enum mm_32f_minor_op {
mm_32f_00_op = 0x00,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_32f_01_op = 0x01,
mm_32f_02_op = 0x02,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_32f_10_op = 0x08,
mm_32f_11_op = 0x09,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_32f_12_op = 0x0a,
mm_32f_20_op = 0x10,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_32f_30_op = 0x18,
mm_32f_40_op = 0x20,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_32f_41_op = 0x21,
mm_32f_42_op = 0x22,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_32f_50_op = 0x28,
mm_32f_51_op = 0x29,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_32f_52_op = 0x2a,
mm_32f_60_op = 0x30,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_32f_70_op = 0x38,
mm_32f_73_op = 0x3b,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_32f_74_op = 0x3c,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum mm_32f_10_minor_op {
mm_lwxc1_op = 0x1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_swxc1_op,
mm_ldxc1_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_sdxc1_op,
mm_luxc1_op,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_suxc1_op,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum mm_32f_func {
mm_lwxc1_func = 0x048,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_swxc1_func = 0x088,
mm_ldxc1_func = 0x0c8,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_sdxc1_func = 0x108,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum mm_32f_40_minor_op {
mm_fmovf_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fmovt_op,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum mm_32f_60_minor_op {
mm_fadd_op,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fsub_op,
mm_fmul_op,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fdiv_op,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum mm_32f_70_minor_op {
mm_fmovn_op,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fmovz_op,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum mm_32f_73_minor_op {
mm_fmov0_op = 0x01,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fcvtl_op = 0x04,
mm_movf0_op = 0x05,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_frsqrt_op = 0x08,
mm_ffloorl_op = 0x0c,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fabs0_op = 0x0d,
mm_fcvtw_op = 0x24,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_movt0_op = 0x25,
mm_fsqrt_op = 0x28,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_ffloorw_op = 0x2c,
mm_fneg0_op = 0x2d,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_cfc1_op = 0x40,
mm_frecip_op = 0x48,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fceill_op = 0x4c,
mm_fcvtd0_op = 0x4d,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_ctc1_op = 0x60,
mm_fceilw_op = 0x6c,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fcvts0_op = 0x6d,
mm_mfc1_op = 0x80,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fmov1_op = 0x81,
mm_movf1_op = 0x85,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_ftruncl_op = 0x8c,
mm_fabs1_op = 0x8d,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_mtc1_op = 0xa0,
mm_movt1_op = 0xa5,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_ftruncw_op = 0xac,
mm_fneg1_op = 0xad,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_mfhc1_op = 0xc0,
mm_froundl_op = 0xcc,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_fcvtd1_op = 0xcd,
mm_mthc1_op = 0xe0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_froundw_op = 0xec,
mm_fcvts1_op = 0xed,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum mm_16c_minor_op {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_lwm16_op = 0x04,
mm_swm16_op = 0x05,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_jr16_op = 0x0c,
mm_jrc_op = 0x0d,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_jalr16_op = 0x0e,
mm_jalrs16_op = 0x0f,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_jraddiusp_op = 0x18,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum mm_16d_minor_op {
mm_addius5_func,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mm_addiusp_func,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum MIPS16e_ops {
MIPS16e_jal_op = 003,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_ld_op = 007,
MIPS16e_i8_op = 014,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_sd_op = 017,
MIPS16e_lb_op = 020,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_lh_op = 021,
MIPS16e_lwsp_op = 022,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_lw_op = 023,
MIPS16e_lbu_op = 024,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_lhu_op = 025,
MIPS16e_lwpc_op = 026,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_lwu_op = 027,
MIPS16e_sb_op = 030,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_sh_op = 031,
MIPS16e_swsp_op = 032,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_sw_op = 033,
MIPS16e_rr_op = 035,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_extend_op = 036,
MIPS16e_i64_op = 037,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum MIPS16e_i64_func {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_ldsp_func,
MIPS16e_sdsp_func,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_sdrasp_func,
MIPS16e_dadjsp_func,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_ldpc_func,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum MIPS16e_rr_func {
MIPS16e_jr_func,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum MIPS6e_i8_func {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MIPS16e_swrasp_func = 02,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MM_NOP16 0x0c00
-#define BITFIELD_FIELD(field, more) more field;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct j_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int target : 26,
- ;))
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int target : 26,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ ;))
};
struct i_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rs : 5,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int rt : 5,
- BITFIELD_FIELD(signed int simmediate : 16,
+ __BITFIELD_FIELD(unsigned int rs : 5,
+ __BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(signed int simmediate : 16,
;))))
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct u_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rs : 5,
- BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rs : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int uimmediate : 16,
+ __BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(unsigned int uimmediate : 16,
;))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct c_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rs : 5,
+ __BITFIELD_FIELD(unsigned int c_op : 3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rs : 5,
- BITFIELD_FIELD(unsigned int c_op : 3,
- BITFIELD_FIELD(unsigned int cache : 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int simmediate : 16,
+ __BITFIELD_FIELD(unsigned int cache : 2,
+ __BITFIELD_FIELD(unsigned int simmediate : 16,
;)))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct r_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rs : 5,
+ __BITFIELD_FIELD(unsigned int rt : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rs : 5,
- BITFIELD_FIELD(unsigned int rt : 5,
- BITFIELD_FIELD(unsigned int rd : 5,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int re : 5,
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int rd : 5,
+ __BITFIELD_FIELD(unsigned int re : 5,
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct p_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rs : 5,
- BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rs : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int rd : 5,
- BITFIELD_FIELD(unsigned int re : 5,
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(unsigned int rd : 5,
+ __BITFIELD_FIELD(unsigned int re : 5,
+ __BITFIELD_FIELD(unsigned int func : 6,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
;))))))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct f_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int : 1,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int fmt : 4,
- BITFIELD_FIELD(unsigned int rt : 5,
- BITFIELD_FIELD(unsigned int rd : 5,
- BITFIELD_FIELD(unsigned int re : 5,
+ __BITFIELD_FIELD(unsigned int : 1,
+ __BITFIELD_FIELD(unsigned int fmt : 4,
+ __BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(unsigned int rd : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int re : 5,
+ __BITFIELD_FIELD(unsigned int func : 6,
;)))))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ma_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int fr : 5,
+ __BITFIELD_FIELD(unsigned int ft : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int fr : 5,
- BITFIELD_FIELD(unsigned int ft : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
+ __BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int func : 4,
+ __BITFIELD_FIELD(unsigned int fmt : 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int fd : 5,
- BITFIELD_FIELD(unsigned int func : 4,
- BITFIELD_FIELD(unsigned int fmt : 2,
;)))))))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct b_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int code : 20,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int code : 20,
+ __BITFIELD_FIELD(unsigned int func : 6,
;)))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ps_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rs : 5,
+ __BITFIELD_FIELD(unsigned int ft : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rs : 5,
- BITFIELD_FIELD(unsigned int ft : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int fd : 5,
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int fs : 5,
+ __BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int sel : 4,
- BITFIELD_FIELD(unsigned int fmt : 1,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int sel : 4,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int vt : 5,
- BITFIELD_FIELD(unsigned int vs : 5,
- BITFIELD_FIELD(unsigned int vd : 5,
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int fmt : 1,
+ __BITFIELD_FIELD(unsigned int vt : 5,
+ __BITFIELD_FIELD(unsigned int vs : 5,
+ __BITFIELD_FIELD(unsigned int vd : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(unsigned int func : 6,
;)))))))
};
+struct spec3_format {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(unsigned int opcode:6,
+ __BITFIELD_FIELD(unsigned int rs:5,
+ __BITFIELD_FIELD(unsigned int rt:5,
+ __BITFIELD_FIELD(signed int simmediate:9,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(unsigned int func:7,
+ ;)))))
+};
struct fb_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int bc : 5,
- BITFIELD_FIELD(unsigned int cc : 3,
- BITFIELD_FIELD(unsigned int flag : 2,
- BITFIELD_FIELD(signed int simmediate : 16,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int bc : 5,
+ __BITFIELD_FIELD(unsigned int cc : 3,
+ __BITFIELD_FIELD(unsigned int flag : 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(signed int simmediate : 16,
;)))))
};
struct fp0_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int fmt : 5,
- BITFIELD_FIELD(unsigned int ft : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
- BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int fmt : 5,
+ __BITFIELD_FIELD(unsigned int ft : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_fp0_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int ft : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int ft : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
- BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int fmt : 3,
+ __BITFIELD_FIELD(unsigned int op : 2,
+ __BITFIELD_FIELD(unsigned int func : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int fmt : 3,
- BITFIELD_FIELD(unsigned int op : 2,
- BITFIELD_FIELD(unsigned int func : 6,
;)))))))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct fp1_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int op : 5,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int rt : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
- BITFIELD_FIELD(unsigned int fd : 5,
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int op : 5,
+ __BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
+ __BITFIELD_FIELD(unsigned int fd : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))
};
struct mm_fp1_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int rt : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
- BITFIELD_FIELD(unsigned int fmt : 2,
- BITFIELD_FIELD(unsigned int op : 8,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
+ __BITFIELD_FIELD(unsigned int fmt : 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int op : 8,
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_fp2_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int fd : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
- BITFIELD_FIELD(unsigned int cc : 3,
+ __BITFIELD_FIELD(unsigned int cc : 3,
+ __BITFIELD_FIELD(unsigned int zero : 2,
+ __BITFIELD_FIELD(unsigned int fmt : 2,
+ __BITFIELD_FIELD(unsigned int op : 3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int zero : 2,
- BITFIELD_FIELD(unsigned int fmt : 2,
- BITFIELD_FIELD(unsigned int op : 3,
- BITFIELD_FIELD(unsigned int func : 6,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))))
};
struct mm_fp3_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int rt : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
- BITFIELD_FIELD(unsigned int fmt : 3,
- BITFIELD_FIELD(unsigned int op : 7,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
+ __BITFIELD_FIELD(unsigned int fmt : 3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int op : 7,
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_fp4_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rt : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
- BITFIELD_FIELD(unsigned int cc : 3,
+ __BITFIELD_FIELD(unsigned int cc : 3,
+ __BITFIELD_FIELD(unsigned int fmt : 3,
+ __BITFIELD_FIELD(unsigned int cond : 4,
+ __BITFIELD_FIELD(unsigned int func : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int fmt : 3,
- BITFIELD_FIELD(unsigned int cond : 4,
- BITFIELD_FIELD(unsigned int func : 6,
;)))))))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct mm_fp5_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int index : 5,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int base : 5,
- BITFIELD_FIELD(unsigned int fd : 5,
- BITFIELD_FIELD(unsigned int op : 5,
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int index : 5,
+ __BITFIELD_FIELD(unsigned int base : 5,
+ __BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int op : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))
};
struct fp6_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int fr : 5,
- BITFIELD_FIELD(unsigned int ft : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
- BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int fr : 5,
+ __BITFIELD_FIELD(unsigned int ft : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_fp6_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int ft : 5,
+ __BITFIELD_FIELD(unsigned int fs : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int ft : 5,
- BITFIELD_FIELD(unsigned int fs : 5,
- BITFIELD_FIELD(unsigned int fd : 5,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int fr : 5,
- BITFIELD_FIELD(unsigned int func : 6,
+ __BITFIELD_FIELD(unsigned int fd : 5,
+ __BITFIELD_FIELD(unsigned int fr : 5,
+ __BITFIELD_FIELD(unsigned int func : 6,
;))))))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_i_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rt : 5,
- BITFIELD_FIELD(unsigned int rs : 5,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rt : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(signed int simmediate : 16,
+ __BITFIELD_FIELD(unsigned int rs : 5,
+ __BITFIELD_FIELD(signed int simmediate : 16,
;))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_m_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rd : 5,
+ __BITFIELD_FIELD(unsigned int base : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rd : 5,
- BITFIELD_FIELD(unsigned int base : 5,
- BITFIELD_FIELD(unsigned int func : 4,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(signed int simmediate : 12,
+ __BITFIELD_FIELD(unsigned int func : 4,
+ __BITFIELD_FIELD(signed int simmediate : 12,
;)))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_x_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int index : 5,
+ __BITFIELD_FIELD(unsigned int base : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int index : 5,
- BITFIELD_FIELD(unsigned int base : 5,
- BITFIELD_FIELD(unsigned int rd : 5,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int func : 11,
+ __BITFIELD_FIELD(unsigned int rd : 5,
+ __BITFIELD_FIELD(unsigned int func : 11,
;)))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_b0_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(signed int simmediate : 10,
+ __BITFIELD_FIELD(unsigned int : 16,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(signed int simmediate : 10,
- BITFIELD_FIELD(unsigned int : 16,
;)))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct mm_b1_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rs : 3,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(signed int simmediate : 7,
- BITFIELD_FIELD(unsigned int : 16,
+ __BITFIELD_FIELD(unsigned int rs : 3,
+ __BITFIELD_FIELD(signed int simmediate : 7,
+ __BITFIELD_FIELD(unsigned int : 16,
;))))
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct mm16_m_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int func : 4,
- BITFIELD_FIELD(unsigned int rlist : 2,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int func : 4,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int imm : 4,
- BITFIELD_FIELD(unsigned int : 16,
+ __BITFIELD_FIELD(unsigned int rlist : 2,
+ __BITFIELD_FIELD(unsigned int imm : 4,
+ __BITFIELD_FIELD(unsigned int : 16,
;)))))
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct mm16_rb_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rt : 3,
- BITFIELD_FIELD(unsigned int base : 3,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rt : 3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(signed int simmediate : 4,
- BITFIELD_FIELD(unsigned int : 16,
+ __BITFIELD_FIELD(unsigned int base : 3,
+ __BITFIELD_FIELD(signed int simmediate : 4,
+ __BITFIELD_FIELD(unsigned int : 16,
;)))))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm16_r3_format {
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rt : 3,
- BITFIELD_FIELD(signed int simmediate : 7,
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rt : 3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int : 16,
+ __BITFIELD_FIELD(signed int simmediate : 7,
+ __BITFIELD_FIELD(unsigned int : 16,
;))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm16_r5_format {
+ __BITFIELD_FIELD(unsigned int opcode : 6,
+ __BITFIELD_FIELD(unsigned int rt : 5,
+ __BITFIELD_FIELD(signed int simmediate : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 6,
- BITFIELD_FIELD(unsigned int rt : 5,
- BITFIELD_FIELD(signed int simmediate : 5,
- BITFIELD_FIELD(unsigned int : 16,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(unsigned int : 16,
;))))
};
struct m16e_rr {
- BITFIELD_FIELD(unsigned int opcode : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int rx : 3,
- BITFIELD_FIELD(unsigned int nd : 1,
- BITFIELD_FIELD(unsigned int l : 1,
- BITFIELD_FIELD(unsigned int ra : 1,
+ __BITFIELD_FIELD(unsigned int opcode : 5,
+ __BITFIELD_FIELD(unsigned int rx : 3,
+ __BITFIELD_FIELD(unsigned int nd : 1,
+ __BITFIELD_FIELD(unsigned int l : 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int func : 5,
+ __BITFIELD_FIELD(unsigned int ra : 1,
+ __BITFIELD_FIELD(unsigned int func : 5,
;))))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct m16e_jal {
+ __BITFIELD_FIELD(unsigned int opcode : 5,
+ __BITFIELD_FIELD(unsigned int x : 1,
+ __BITFIELD_FIELD(unsigned int imm20_16 : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 5,
- BITFIELD_FIELD(unsigned int x : 1,
- BITFIELD_FIELD(unsigned int imm20_16 : 5,
- BITFIELD_FIELD(signed int imm25_21 : 5,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(signed int imm25_21 : 5,
;))))
};
struct m16e_i64 {
- BITFIELD_FIELD(unsigned int opcode : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int func : 3,
- BITFIELD_FIELD(unsigned int imm : 8,
+ __BITFIELD_FIELD(unsigned int opcode : 5,
+ __BITFIELD_FIELD(unsigned int func : 3,
+ __BITFIELD_FIELD(unsigned int imm : 8,
;)))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct m16e_ri64 {
- BITFIELD_FIELD(unsigned int opcode : 5,
- BITFIELD_FIELD(unsigned int func : 3,
- BITFIELD_FIELD(unsigned int ry : 3,
+ __BITFIELD_FIELD(unsigned int opcode : 5,
+ __BITFIELD_FIELD(unsigned int func : 3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int imm : 5,
+ __BITFIELD_FIELD(unsigned int ry : 3,
+ __BITFIELD_FIELD(unsigned int imm : 5,
;))))
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct m16e_ri {
+ __BITFIELD_FIELD(unsigned int opcode : 5,
+ __BITFIELD_FIELD(unsigned int rx : 3,
+ __BITFIELD_FIELD(unsigned int imm : 8,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int opcode : 5,
- BITFIELD_FIELD(unsigned int rx : 3,
- BITFIELD_FIELD(unsigned int imm : 8,
;)))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct m16e_rri {
- BITFIELD_FIELD(unsigned int opcode : 5,
- BITFIELD_FIELD(unsigned int rx : 3,
+ __BITFIELD_FIELD(unsigned int opcode : 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- BITFIELD_FIELD(unsigned int ry : 3,
- BITFIELD_FIELD(unsigned int imm : 5,
+ __BITFIELD_FIELD(unsigned int rx : 3,
+ __BITFIELD_FIELD(unsigned int ry : 3,
+ __BITFIELD_FIELD(unsigned int imm : 5,
;))))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct m16e_i8 {
- BITFIELD_FIELD(unsigned int opcode : 5,
- BITFIELD_FIELD(unsigned int func : 3,
- BITFIELD_FIELD(unsigned int imm : 8,
+ __BITFIELD_FIELD(unsigned int opcode : 5,
+ __BITFIELD_FIELD(unsigned int func : 3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __BITFIELD_FIELD(unsigned int imm : 8,
;)))
};
union mips_instruction {
- unsigned int word;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned int word;
unsigned short halfword[2];
unsigned char byte[4];
struct j_format j_format;
- struct i_format i_format;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct i_format i_format;
struct u_format u_format;
struct c_format c_format;
struct r_format r_format;
- struct p_format p_format;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct p_format p_format;
struct f_format f_format;
struct ma_format ma_format;
struct b_format b_format;
- struct ps_format ps_format;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct ps_format ps_format;
struct v_format v_format;
+ struct spec3_format spec3_format;
struct fb_format fb_format;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct fp0_format fp0_format;
struct mm_fp0_format mm_fp0_format;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct fp1_format fp1_format;
struct mm_fp1_format mm_fp1_format;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_fp2_format mm_fp2_format;
struct mm_fp3_format mm_fp3_format;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_fp4_format mm_fp4_format;
struct mm_fp5_format mm_fp5_format;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct fp6_format fp6_format;
struct mm_fp6_format mm_fp6_format;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_i_format mm_i_format;
struct mm_m_format mm_m_format;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_x_format mm_x_format;
struct mm_b0_format mm_b0_format;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm_b1_format mm_b1_format;
struct mm16_m_format mm16_m_format ;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm16_rb_format mm16_rb_format;
struct mm16_r3_format mm16_r3_format;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct mm16_r5_format mm16_r5_format;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union mips16e_instruction {
unsigned int full : 16;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct m16e_rr rr;
struct m16e_jal jal;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct m16e_i64 i64;
struct m16e_ri64 ri64;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct m16e_ri ri;
struct m16e_rri rri;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct m16e_i8 i8;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/asm-mips/asm/kvm.h b/libc/kernel/uapi/asm-mips/asm/kvm.h
index 69084ee..908ab9d 100644
--- a/libc/kernel/uapi/asm-mips/asm/kvm.h
+++ b/libc/kernel/uapi/asm-mips/asm/kvm.h
@@ -82,6 +82,11 @@
#define KVM_REG_MIPS_LO (KVM_REG_MIPS | KVM_REG_SIZE_U64 | 33)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_MIPS_PC (KVM_REG_MIPS | KVM_REG_SIZE_U64 | 34)
+#define KVM_REG_MIPS_COUNT_CTL (KVM_REG_MIPS | KVM_REG_SIZE_U64 | 0x20000 | 0)
+#define KVM_REG_MIPS_COUNT_CTL_DC 0x00000001
+#define KVM_REG_MIPS_COUNT_RESUME (KVM_REG_MIPS | KVM_REG_SIZE_U64 | 0x20000 | 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_REG_MIPS_COUNT_HZ (KVM_REG_MIPS | KVM_REG_SIZE_U64 | 0x20000 | 2)
struct kvm_debug_exit_arch {
__u64 epc;
};
diff --git a/libc/kernel/uapi/asm-mips/asm/kvm_para.h b/libc/kernel/uapi/asm-mips/asm/kvm_para.h
index e19f7a0..825c12a 100644
--- a/libc/kernel/uapi/asm-mips/asm/kvm_para.h
+++ b/libc/kernel/uapi/asm-mips/asm/kvm_para.h
@@ -16,4 +16,6 @@
***
****************************************************************************
****************************************************************************/
-#include <asm-generic/kvm_para.h>
+#ifndef _UAPI_ASM_MIPS_KVM_PARA_H
+#define _UAPI_ASM_MIPS_KVM_PARA_H
+#endif
diff --git a/libc/kernel/uapi/asm-mips/asm/reg.h b/libc/kernel/uapi/asm-mips/asm/reg.h
new file mode 100644
index 0000000..35c89f7
--- /dev/null
+++ b/libc/kernel/uapi/asm-mips/asm/reg.h
@@ -0,0 +1,223 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __UAPI_ASM_MIPS_REG_H
+#define __UAPI_ASM_MIPS_REG_H
+#define MIPS32_EF_R0 6
+#define MIPS32_EF_R1 7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_R2 8
+#define MIPS32_EF_R3 9
+#define MIPS32_EF_R4 10
+#define MIPS32_EF_R5 11
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_R6 12
+#define MIPS32_EF_R7 13
+#define MIPS32_EF_R8 14
+#define MIPS32_EF_R9 15
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_R10 16
+#define MIPS32_EF_R11 17
+#define MIPS32_EF_R12 18
+#define MIPS32_EF_R13 19
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_R14 20
+#define MIPS32_EF_R15 21
+#define MIPS32_EF_R16 22
+#define MIPS32_EF_R17 23
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_R18 24
+#define MIPS32_EF_R19 25
+#define MIPS32_EF_R20 26
+#define MIPS32_EF_R21 27
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_R22 28
+#define MIPS32_EF_R23 29
+#define MIPS32_EF_R24 30
+#define MIPS32_EF_R25 31
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_R26 32
+#define MIPS32_EF_R27 33
+#define MIPS32_EF_R28 34
+#define MIPS32_EF_R29 35
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_R30 36
+#define MIPS32_EF_R31 37
+#define MIPS32_EF_LO 38
+#define MIPS32_EF_HI 39
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_CP0_EPC 40
+#define MIPS32_EF_CP0_BADVADDR 41
+#define MIPS32_EF_CP0_STATUS 42
+#define MIPS32_EF_CP0_CAUSE 43
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS32_EF_UNUSED0 44
+#define MIPS32_EF_SIZE 180
+#define MIPS64_EF_R0 0
+#define MIPS64_EF_R1 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_R2 2
+#define MIPS64_EF_R3 3
+#define MIPS64_EF_R4 4
+#define MIPS64_EF_R5 5
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_R6 6
+#define MIPS64_EF_R7 7
+#define MIPS64_EF_R8 8
+#define MIPS64_EF_R9 9
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_R10 10
+#define MIPS64_EF_R11 11
+#define MIPS64_EF_R12 12
+#define MIPS64_EF_R13 13
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_R14 14
+#define MIPS64_EF_R15 15
+#define MIPS64_EF_R16 16
+#define MIPS64_EF_R17 17
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_R18 18
+#define MIPS64_EF_R19 19
+#define MIPS64_EF_R20 20
+#define MIPS64_EF_R21 21
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_R22 22
+#define MIPS64_EF_R23 23
+#define MIPS64_EF_R24 24
+#define MIPS64_EF_R25 25
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_R26 26
+#define MIPS64_EF_R27 27
+#define MIPS64_EF_R28 28
+#define MIPS64_EF_R29 29
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_R30 30
+#define MIPS64_EF_R31 31
+#define MIPS64_EF_LO 32
+#define MIPS64_EF_HI 33
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_CP0_EPC 34
+#define MIPS64_EF_CP0_BADVADDR 35
+#define MIPS64_EF_CP0_STATUS 36
+#define MIPS64_EF_CP0_CAUSE 37
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MIPS64_EF_SIZE 304
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+#define EF_R0 MIPS32_EF_R0
+#define EF_R1 MIPS32_EF_R1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R2 MIPS32_EF_R2
+#define EF_R3 MIPS32_EF_R3
+#define EF_R4 MIPS32_EF_R4
+#define EF_R5 MIPS32_EF_R5
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R6 MIPS32_EF_R6
+#define EF_R7 MIPS32_EF_R7
+#define EF_R8 MIPS32_EF_R8
+#define EF_R9 MIPS32_EF_R9
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R10 MIPS32_EF_R10
+#define EF_R11 MIPS32_EF_R11
+#define EF_R12 MIPS32_EF_R12
+#define EF_R13 MIPS32_EF_R13
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R14 MIPS32_EF_R14
+#define EF_R15 MIPS32_EF_R15
+#define EF_R16 MIPS32_EF_R16
+#define EF_R17 MIPS32_EF_R17
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R18 MIPS32_EF_R18
+#define EF_R19 MIPS32_EF_R19
+#define EF_R20 MIPS32_EF_R20
+#define EF_R21 MIPS32_EF_R21
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R22 MIPS32_EF_R22
+#define EF_R23 MIPS32_EF_R23
+#define EF_R24 MIPS32_EF_R24
+#define EF_R25 MIPS32_EF_R25
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R26 MIPS32_EF_R26
+#define EF_R27 MIPS32_EF_R27
+#define EF_R28 MIPS32_EF_R28
+#define EF_R29 MIPS32_EF_R29
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R30 MIPS32_EF_R30
+#define EF_R31 MIPS32_EF_R31
+#define EF_LO MIPS32_EF_LO
+#define EF_HI MIPS32_EF_HI
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_CP0_EPC MIPS32_EF_CP0_EPC
+#define EF_CP0_BADVADDR MIPS32_EF_CP0_BADVADDR
+#define EF_CP0_STATUS MIPS32_EF_CP0_STATUS
+#define EF_CP0_CAUSE MIPS32_EF_CP0_CAUSE
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_UNUSED0 MIPS32_EF_UNUSED0
+#define EF_SIZE MIPS32_EF_SIZE
+#elif _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
+#define EF_R0 MIPS64_EF_R0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R1 MIPS64_EF_R1
+#define EF_R2 MIPS64_EF_R2
+#define EF_R3 MIPS64_EF_R3
+#define EF_R4 MIPS64_EF_R4
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R5 MIPS64_EF_R5
+#define EF_R6 MIPS64_EF_R6
+#define EF_R7 MIPS64_EF_R7
+#define EF_R8 MIPS64_EF_R8
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R9 MIPS64_EF_R9
+#define EF_R10 MIPS64_EF_R10
+#define EF_R11 MIPS64_EF_R11
+#define EF_R12 MIPS64_EF_R12
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R13 MIPS64_EF_R13
+#define EF_R14 MIPS64_EF_R14
+#define EF_R15 MIPS64_EF_R15
+#define EF_R16 MIPS64_EF_R16
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R17 MIPS64_EF_R17
+#define EF_R18 MIPS64_EF_R18
+#define EF_R19 MIPS64_EF_R19
+#define EF_R20 MIPS64_EF_R20
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R21 MIPS64_EF_R21
+#define EF_R22 MIPS64_EF_R22
+#define EF_R23 MIPS64_EF_R23
+#define EF_R24 MIPS64_EF_R24
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R25 MIPS64_EF_R25
+#define EF_R26 MIPS64_EF_R26
+#define EF_R27 MIPS64_EF_R27
+#define EF_R28 MIPS64_EF_R28
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_R29 MIPS64_EF_R29
+#define EF_R30 MIPS64_EF_R30
+#define EF_R31 MIPS64_EF_R31
+#define EF_LO MIPS64_EF_LO
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_HI MIPS64_EF_HI
+#define EF_CP0_EPC MIPS64_EF_CP0_EPC
+#define EF_CP0_BADVADDR MIPS64_EF_CP0_BADVADDR
+#define EF_CP0_STATUS MIPS64_EF_CP0_STATUS
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define EF_CP0_CAUSE MIPS64_EF_CP0_CAUSE
+#define EF_SIZE MIPS64_EF_SIZE
+#endif
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/asm-mips/asm/types.h b/libc/kernel/uapi/asm-mips/asm/types.h
index 45fea6c..9ef7b7c 100644
--- a/libc/kernel/uapi/asm-mips/asm/types.h
+++ b/libc/kernel/uapi/asm-mips/asm/types.h
@@ -18,11 +18,6 @@
****************************************************************************/
#ifndef _UAPI_ASM_TYPES_H
#define _UAPI_ASM_TYPES_H
-#if _MIPS_SZLONG == 64
-#include <asm-generic/int-l64.h>
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#else
#include <asm-generic/int-ll64.h>
#endif
-#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/asm-mips/asm/unistd.h b/libc/kernel/uapi/asm-mips/asm/unistd.h
index 37c3da1..9060e44 100644
--- a/libc/kernel/uapi/asm-mips/asm/unistd.h
+++ b/libc/kernel/uapi/asm-mips/asm/unistd.h
@@ -459,805 +459,808 @@
#define __NR_finit_module (__NR_Linux + 348)
#define __NR_sched_setattr (__NR_Linux + 349)
#define __NR_sched_getattr (__NR_Linux + 350)
-#define __NR_Linux_syscalls 350
+#define __NR_renameat2 (__NR_Linux + 351)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_Linux_syscalls 351
#endif
#define __NR_O32_Linux 4000
-#define __NR_O32_Linux_syscalls 350
-#if _MIPS_SIM == _MIPS_SIM_ABI64
+#define __NR_O32_Linux_syscalls 351
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#if _MIPS_SIM == _MIPS_SIM_ABI64
#define __NR_Linux 5000
#define __NR_read (__NR_Linux + 0)
#define __NR_write (__NR_Linux + 1)
-#define __NR_open (__NR_Linux + 2)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_open (__NR_Linux + 2)
#define __NR_close (__NR_Linux + 3)
#define __NR_stat (__NR_Linux + 4)
#define __NR_fstat (__NR_Linux + 5)
-#define __NR_lstat (__NR_Linux + 6)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_lstat (__NR_Linux + 6)
#define __NR_poll (__NR_Linux + 7)
#define __NR_lseek (__NR_Linux + 8)
#define __NR_mmap (__NR_Linux + 9)
-#define __NR_mprotect (__NR_Linux + 10)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_mprotect (__NR_Linux + 10)
#define __NR_munmap (__NR_Linux + 11)
#define __NR_brk (__NR_Linux + 12)
#define __NR_rt_sigaction (__NR_Linux + 13)
-#define __NR_rt_sigprocmask (__NR_Linux + 14)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_rt_sigprocmask (__NR_Linux + 14)
#define __NR_ioctl (__NR_Linux + 15)
#define __NR_pread64 (__NR_Linux + 16)
#define __NR_pwrite64 (__NR_Linux + 17)
-#define __NR_readv (__NR_Linux + 18)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_readv (__NR_Linux + 18)
#define __NR_writev (__NR_Linux + 19)
#define __NR_access (__NR_Linux + 20)
#define __NR_pipe (__NR_Linux + 21)
-#define __NR__newselect (__NR_Linux + 22)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR__newselect (__NR_Linux + 22)
#define __NR_sched_yield (__NR_Linux + 23)
#define __NR_mremap (__NR_Linux + 24)
#define __NR_msync (__NR_Linux + 25)
-#define __NR_mincore (__NR_Linux + 26)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_mincore (__NR_Linux + 26)
#define __NR_madvise (__NR_Linux + 27)
#define __NR_shmget (__NR_Linux + 28)
#define __NR_shmat (__NR_Linux + 29)
-#define __NR_shmctl (__NR_Linux + 30)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_shmctl (__NR_Linux + 30)
#define __NR_dup (__NR_Linux + 31)
#define __NR_dup2 (__NR_Linux + 32)
#define __NR_pause (__NR_Linux + 33)
-#define __NR_nanosleep (__NR_Linux + 34)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_nanosleep (__NR_Linux + 34)
#define __NR_getitimer (__NR_Linux + 35)
#define __NR_setitimer (__NR_Linux + 36)
#define __NR_alarm (__NR_Linux + 37)
-#define __NR_getpid (__NR_Linux + 38)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getpid (__NR_Linux + 38)
#define __NR_sendfile (__NR_Linux + 39)
#define __NR_socket (__NR_Linux + 40)
#define __NR_connect (__NR_Linux + 41)
-#define __NR_accept (__NR_Linux + 42)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_accept (__NR_Linux + 42)
#define __NR_sendto (__NR_Linux + 43)
#define __NR_recvfrom (__NR_Linux + 44)
#define __NR_sendmsg (__NR_Linux + 45)
-#define __NR_recvmsg (__NR_Linux + 46)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_recvmsg (__NR_Linux + 46)
#define __NR_shutdown (__NR_Linux + 47)
#define __NR_bind (__NR_Linux + 48)
#define __NR_listen (__NR_Linux + 49)
-#define __NR_getsockname (__NR_Linux + 50)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getsockname (__NR_Linux + 50)
#define __NR_getpeername (__NR_Linux + 51)
#define __NR_socketpair (__NR_Linux + 52)
#define __NR_setsockopt (__NR_Linux + 53)
-#define __NR_getsockopt (__NR_Linux + 54)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getsockopt (__NR_Linux + 54)
#define __NR_clone (__NR_Linux + 55)
#define __NR_fork (__NR_Linux + 56)
#define __NR_execve (__NR_Linux + 57)
-#define __NR_exit (__NR_Linux + 58)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_exit (__NR_Linux + 58)
#define __NR_wait4 (__NR_Linux + 59)
#define __NR_kill (__NR_Linux + 60)
#define __NR_uname (__NR_Linux + 61)
-#define __NR_semget (__NR_Linux + 62)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_semget (__NR_Linux + 62)
#define __NR_semop (__NR_Linux + 63)
#define __NR_semctl (__NR_Linux + 64)
#define __NR_shmdt (__NR_Linux + 65)
-#define __NR_msgget (__NR_Linux + 66)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_msgget (__NR_Linux + 66)
#define __NR_msgsnd (__NR_Linux + 67)
#define __NR_msgrcv (__NR_Linux + 68)
#define __NR_msgctl (__NR_Linux + 69)
-#define __NR_fcntl (__NR_Linux + 70)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_fcntl (__NR_Linux + 70)
#define __NR_flock (__NR_Linux + 71)
#define __NR_fsync (__NR_Linux + 72)
#define __NR_fdatasync (__NR_Linux + 73)
-#define __NR_truncate (__NR_Linux + 74)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_truncate (__NR_Linux + 74)
#define __NR_ftruncate (__NR_Linux + 75)
#define __NR_getdents (__NR_Linux + 76)
#define __NR_getcwd (__NR_Linux + 77)
-#define __NR_chdir (__NR_Linux + 78)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_chdir (__NR_Linux + 78)
#define __NR_fchdir (__NR_Linux + 79)
#define __NR_rename (__NR_Linux + 80)
#define __NR_mkdir (__NR_Linux + 81)
-#define __NR_rmdir (__NR_Linux + 82)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_rmdir (__NR_Linux + 82)
#define __NR_creat (__NR_Linux + 83)
#define __NR_link (__NR_Linux + 84)
#define __NR_unlink (__NR_Linux + 85)
-#define __NR_symlink (__NR_Linux + 86)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_symlink (__NR_Linux + 86)
#define __NR_readlink (__NR_Linux + 87)
#define __NR_chmod (__NR_Linux + 88)
#define __NR_fchmod (__NR_Linux + 89)
-#define __NR_chown (__NR_Linux + 90)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_chown (__NR_Linux + 90)
#define __NR_fchown (__NR_Linux + 91)
#define __NR_lchown (__NR_Linux + 92)
#define __NR_umask (__NR_Linux + 93)
-#define __NR_gettimeofday (__NR_Linux + 94)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_gettimeofday (__NR_Linux + 94)
#define __NR_getrlimit (__NR_Linux + 95)
#define __NR_getrusage (__NR_Linux + 96)
#define __NR_sysinfo (__NR_Linux + 97)
-#define __NR_times (__NR_Linux + 98)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_times (__NR_Linux + 98)
#define __NR_ptrace (__NR_Linux + 99)
#define __NR_getuid (__NR_Linux + 100)
#define __NR_syslog (__NR_Linux + 101)
-#define __NR_getgid (__NR_Linux + 102)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getgid (__NR_Linux + 102)
#define __NR_setuid (__NR_Linux + 103)
#define __NR_setgid (__NR_Linux + 104)
#define __NR_geteuid (__NR_Linux + 105)
-#define __NR_getegid (__NR_Linux + 106)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getegid (__NR_Linux + 106)
#define __NR_setpgid (__NR_Linux + 107)
#define __NR_getppid (__NR_Linux + 108)
#define __NR_getpgrp (__NR_Linux + 109)
-#define __NR_setsid (__NR_Linux + 110)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setsid (__NR_Linux + 110)
#define __NR_setreuid (__NR_Linux + 111)
#define __NR_setregid (__NR_Linux + 112)
#define __NR_getgroups (__NR_Linux + 113)
-#define __NR_setgroups (__NR_Linux + 114)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setgroups (__NR_Linux + 114)
#define __NR_setresuid (__NR_Linux + 115)
#define __NR_getresuid (__NR_Linux + 116)
#define __NR_setresgid (__NR_Linux + 117)
-#define __NR_getresgid (__NR_Linux + 118)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getresgid (__NR_Linux + 118)
#define __NR_getpgid (__NR_Linux + 119)
#define __NR_setfsuid (__NR_Linux + 120)
#define __NR_setfsgid (__NR_Linux + 121)
-#define __NR_getsid (__NR_Linux + 122)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getsid (__NR_Linux + 122)
#define __NR_capget (__NR_Linux + 123)
#define __NR_capset (__NR_Linux + 124)
#define __NR_rt_sigpending (__NR_Linux + 125)
-#define __NR_rt_sigtimedwait (__NR_Linux + 126)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_rt_sigtimedwait (__NR_Linux + 126)
#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
#define __NR_rt_sigsuspend (__NR_Linux + 128)
#define __NR_sigaltstack (__NR_Linux + 129)
-#define __NR_utime (__NR_Linux + 130)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_utime (__NR_Linux + 130)
#define __NR_mknod (__NR_Linux + 131)
#define __NR_personality (__NR_Linux + 132)
#define __NR_ustat (__NR_Linux + 133)
-#define __NR_statfs (__NR_Linux + 134)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_statfs (__NR_Linux + 134)
#define __NR_fstatfs (__NR_Linux + 135)
#define __NR_sysfs (__NR_Linux + 136)
#define __NR_getpriority (__NR_Linux + 137)
-#define __NR_setpriority (__NR_Linux + 138)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setpriority (__NR_Linux + 138)
#define __NR_sched_setparam (__NR_Linux + 139)
#define __NR_sched_getparam (__NR_Linux + 140)
#define __NR_sched_setscheduler (__NR_Linux + 141)
-#define __NR_sched_getscheduler (__NR_Linux + 142)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_sched_getscheduler (__NR_Linux + 142)
#define __NR_sched_get_priority_max (__NR_Linux + 143)
#define __NR_sched_get_priority_min (__NR_Linux + 144)
#define __NR_sched_rr_get_interval (__NR_Linux + 145)
-#define __NR_mlock (__NR_Linux + 146)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_mlock (__NR_Linux + 146)
#define __NR_munlock (__NR_Linux + 147)
#define __NR_mlockall (__NR_Linux + 148)
#define __NR_munlockall (__NR_Linux + 149)
-#define __NR_vhangup (__NR_Linux + 150)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_vhangup (__NR_Linux + 150)
#define __NR_pivot_root (__NR_Linux + 151)
#define __NR__sysctl (__NR_Linux + 152)
#define __NR_prctl (__NR_Linux + 153)
-#define __NR_adjtimex (__NR_Linux + 154)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_adjtimex (__NR_Linux + 154)
#define __NR_setrlimit (__NR_Linux + 155)
#define __NR_chroot (__NR_Linux + 156)
#define __NR_sync (__NR_Linux + 157)
-#define __NR_acct (__NR_Linux + 158)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_acct (__NR_Linux + 158)
#define __NR_settimeofday (__NR_Linux + 159)
#define __NR_mount (__NR_Linux + 160)
#define __NR_umount2 (__NR_Linux + 161)
-#define __NR_swapon (__NR_Linux + 162)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_swapon (__NR_Linux + 162)
#define __NR_swapoff (__NR_Linux + 163)
#define __NR_reboot (__NR_Linux + 164)
#define __NR_sethostname (__NR_Linux + 165)
-#define __NR_setdomainname (__NR_Linux + 166)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setdomainname (__NR_Linux + 166)
#define __NR_create_module (__NR_Linux + 167)
#define __NR_init_module (__NR_Linux + 168)
#define __NR_delete_module (__NR_Linux + 169)
-#define __NR_get_kernel_syms (__NR_Linux + 170)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_get_kernel_syms (__NR_Linux + 170)
#define __NR_query_module (__NR_Linux + 171)
#define __NR_quotactl (__NR_Linux + 172)
#define __NR_nfsservctl (__NR_Linux + 173)
-#define __NR_getpmsg (__NR_Linux + 174)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getpmsg (__NR_Linux + 174)
#define __NR_putpmsg (__NR_Linux + 175)
#define __NR_afs_syscall (__NR_Linux + 176)
#define __NR_reserved177 (__NR_Linux + 177)
-#define __NR_gettid (__NR_Linux + 178)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_gettid (__NR_Linux + 178)
#define __NR_readahead (__NR_Linux + 179)
#define __NR_setxattr (__NR_Linux + 180)
#define __NR_lsetxattr (__NR_Linux + 181)
-#define __NR_fsetxattr (__NR_Linux + 182)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_fsetxattr (__NR_Linux + 182)
#define __NR_getxattr (__NR_Linux + 183)
#define __NR_lgetxattr (__NR_Linux + 184)
#define __NR_fgetxattr (__NR_Linux + 185)
-#define __NR_listxattr (__NR_Linux + 186)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_listxattr (__NR_Linux + 186)
#define __NR_llistxattr (__NR_Linux + 187)
#define __NR_flistxattr (__NR_Linux + 188)
#define __NR_removexattr (__NR_Linux + 189)
-#define __NR_lremovexattr (__NR_Linux + 190)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_lremovexattr (__NR_Linux + 190)
#define __NR_fremovexattr (__NR_Linux + 191)
#define __NR_tkill (__NR_Linux + 192)
#define __NR_reserved193 (__NR_Linux + 193)
-#define __NR_futex (__NR_Linux + 194)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_futex (__NR_Linux + 194)
#define __NR_sched_setaffinity (__NR_Linux + 195)
#define __NR_sched_getaffinity (__NR_Linux + 196)
#define __NR_cacheflush (__NR_Linux + 197)
-#define __NR_cachectl (__NR_Linux + 198)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_cachectl (__NR_Linux + 198)
#define __NR_sysmips (__NR_Linux + 199)
#define __NR_io_setup (__NR_Linux + 200)
#define __NR_io_destroy (__NR_Linux + 201)
-#define __NR_io_getevents (__NR_Linux + 202)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_io_getevents (__NR_Linux + 202)
#define __NR_io_submit (__NR_Linux + 203)
#define __NR_io_cancel (__NR_Linux + 204)
#define __NR_exit_group (__NR_Linux + 205)
-#define __NR_lookup_dcookie (__NR_Linux + 206)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_lookup_dcookie (__NR_Linux + 206)
#define __NR_epoll_create (__NR_Linux + 207)
#define __NR_epoll_ctl (__NR_Linux + 208)
#define __NR_epoll_wait (__NR_Linux + 209)
-#define __NR_remap_file_pages (__NR_Linux + 210)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_remap_file_pages (__NR_Linux + 210)
#define __NR_rt_sigreturn (__NR_Linux + 211)
#define __NR_set_tid_address (__NR_Linux + 212)
#define __NR_restart_syscall (__NR_Linux + 213)
-#define __NR_semtimedop (__NR_Linux + 214)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_semtimedop (__NR_Linux + 214)
#define __NR_fadvise64 (__NR_Linux + 215)
#define __NR_timer_create (__NR_Linux + 216)
#define __NR_timer_settime (__NR_Linux + 217)
-#define __NR_timer_gettime (__NR_Linux + 218)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_timer_gettime (__NR_Linux + 218)
#define __NR_timer_getoverrun (__NR_Linux + 219)
#define __NR_timer_delete (__NR_Linux + 220)
#define __NR_clock_settime (__NR_Linux + 221)
-#define __NR_clock_gettime (__NR_Linux + 222)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_clock_gettime (__NR_Linux + 222)
#define __NR_clock_getres (__NR_Linux + 223)
#define __NR_clock_nanosleep (__NR_Linux + 224)
#define __NR_tgkill (__NR_Linux + 225)
-#define __NR_utimes (__NR_Linux + 226)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_utimes (__NR_Linux + 226)
#define __NR_mbind (__NR_Linux + 227)
#define __NR_get_mempolicy (__NR_Linux + 228)
#define __NR_set_mempolicy (__NR_Linux + 229)
-#define __NR_mq_open (__NR_Linux + 230)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_mq_open (__NR_Linux + 230)
#define __NR_mq_unlink (__NR_Linux + 231)
#define __NR_mq_timedsend (__NR_Linux + 232)
#define __NR_mq_timedreceive (__NR_Linux + 233)
-#define __NR_mq_notify (__NR_Linux + 234)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_mq_notify (__NR_Linux + 234)
#define __NR_mq_getsetattr (__NR_Linux + 235)
#define __NR_vserver (__NR_Linux + 236)
#define __NR_waitid (__NR_Linux + 237)
-#define __NR_add_key (__NR_Linux + 239)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_add_key (__NR_Linux + 239)
#define __NR_request_key (__NR_Linux + 240)
#define __NR_keyctl (__NR_Linux + 241)
#define __NR_set_thread_area (__NR_Linux + 242)
-#define __NR_inotify_init (__NR_Linux + 243)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_inotify_init (__NR_Linux + 243)
#define __NR_inotify_add_watch (__NR_Linux + 244)
#define __NR_inotify_rm_watch (__NR_Linux + 245)
#define __NR_migrate_pages (__NR_Linux + 246)
-#define __NR_openat (__NR_Linux + 247)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_openat (__NR_Linux + 247)
#define __NR_mkdirat (__NR_Linux + 248)
#define __NR_mknodat (__NR_Linux + 249)
#define __NR_fchownat (__NR_Linux + 250)
-#define __NR_futimesat (__NR_Linux + 251)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_futimesat (__NR_Linux + 251)
#define __NR_newfstatat (__NR_Linux + 252)
#define __NR_unlinkat (__NR_Linux + 253)
#define __NR_renameat (__NR_Linux + 254)
-#define __NR_linkat (__NR_Linux + 255)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_linkat (__NR_Linux + 255)
#define __NR_symlinkat (__NR_Linux + 256)
#define __NR_readlinkat (__NR_Linux + 257)
#define __NR_fchmodat (__NR_Linux + 258)
-#define __NR_faccessat (__NR_Linux + 259)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_faccessat (__NR_Linux + 259)
#define __NR_pselect6 (__NR_Linux + 260)
#define __NR_ppoll (__NR_Linux + 261)
#define __NR_unshare (__NR_Linux + 262)
-#define __NR_splice (__NR_Linux + 263)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_splice (__NR_Linux + 263)
#define __NR_sync_file_range (__NR_Linux + 264)
#define __NR_tee (__NR_Linux + 265)
#define __NR_vmsplice (__NR_Linux + 266)
-#define __NR_move_pages (__NR_Linux + 267)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_move_pages (__NR_Linux + 267)
#define __NR_set_robust_list (__NR_Linux + 268)
#define __NR_get_robust_list (__NR_Linux + 269)
#define __NR_kexec_load (__NR_Linux + 270)
-#define __NR_getcpu (__NR_Linux + 271)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_getcpu (__NR_Linux + 271)
#define __NR_epoll_pwait (__NR_Linux + 272)
#define __NR_ioprio_set (__NR_Linux + 273)
#define __NR_ioprio_get (__NR_Linux + 274)
-#define __NR_utimensat (__NR_Linux + 275)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_utimensat (__NR_Linux + 275)
#define __NR_signalfd (__NR_Linux + 276)
#define __NR_timerfd (__NR_Linux + 277)
#define __NR_eventfd (__NR_Linux + 278)
-#define __NR_fallocate (__NR_Linux + 279)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_fallocate (__NR_Linux + 279)
#define __NR_timerfd_create (__NR_Linux + 280)
#define __NR_timerfd_gettime (__NR_Linux + 281)
#define __NR_timerfd_settime (__NR_Linux + 282)
-#define __NR_signalfd4 (__NR_Linux + 283)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_signalfd4 (__NR_Linux + 283)
#define __NR_eventfd2 (__NR_Linux + 284)
#define __NR_epoll_create1 (__NR_Linux + 285)
#define __NR_dup3 (__NR_Linux + 286)
-#define __NR_pipe2 (__NR_Linux + 287)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_pipe2 (__NR_Linux + 287)
#define __NR_inotify_init1 (__NR_Linux + 288)
#define __NR_preadv (__NR_Linux + 289)
#define __NR_pwritev (__NR_Linux + 290)
-#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
#define __NR_perf_event_open (__NR_Linux + 292)
#define __NR_accept4 (__NR_Linux + 293)
#define __NR_recvmmsg (__NR_Linux + 294)
-#define __NR_fanotify_init (__NR_Linux + 295)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_fanotify_init (__NR_Linux + 295)
#define __NR_fanotify_mark (__NR_Linux + 296)
#define __NR_prlimit64 (__NR_Linux + 297)
#define __NR_name_to_handle_at (__NR_Linux + 298)
-#define __NR_open_by_handle_at (__NR_Linux + 299)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_open_by_handle_at (__NR_Linux + 299)
#define __NR_clock_adjtime (__NR_Linux + 300)
#define __NR_syncfs (__NR_Linux + 301)
#define __NR_sendmmsg (__NR_Linux + 302)
-#define __NR_setns (__NR_Linux + 303)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_setns (__NR_Linux + 303)
#define __NR_process_vm_readv (__NR_Linux + 304)
#define __NR_process_vm_writev (__NR_Linux + 305)
#define __NR_kcmp (__NR_Linux + 306)
-#define __NR_finit_module (__NR_Linux + 307)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_finit_module (__NR_Linux + 307)
#define __NR_getdents64 (__NR_Linux + 308)
#define __NR_sched_setattr (__NR_Linux + 309)
#define __NR_sched_getattr (__NR_Linux + 310)
-#define __NR_Linux_syscalls 310
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_renameat2 (__NR_Linux + 311)
+#define __NR_Linux_syscalls 311
#endif
#define __NR_64_Linux 5000
-#define __NR_64_Linux_syscalls 310
-#if _MIPS_SIM == _MIPS_SIM_NABI32
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_64_Linux_syscalls 311
+#if _MIPS_SIM == _MIPS_SIM_NABI32
#define __NR_Linux 6000
#define __NR_read (__NR_Linux + 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_write (__NR_Linux + 1)
#define __NR_open (__NR_Linux + 2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_close (__NR_Linux + 3)
#define __NR_stat (__NR_Linux + 4)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fstat (__NR_Linux + 5)
#define __NR_lstat (__NR_Linux + 6)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_poll (__NR_Linux + 7)
#define __NR_lseek (__NR_Linux + 8)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mmap (__NR_Linux + 9)
#define __NR_mprotect (__NR_Linux + 10)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_munmap (__NR_Linux + 11)
#define __NR_brk (__NR_Linux + 12)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_rt_sigaction (__NR_Linux + 13)
#define __NR_rt_sigprocmask (__NR_Linux + 14)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_ioctl (__NR_Linux + 15)
#define __NR_pread64 (__NR_Linux + 16)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_pwrite64 (__NR_Linux + 17)
#define __NR_readv (__NR_Linux + 18)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_writev (__NR_Linux + 19)
#define __NR_access (__NR_Linux + 20)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_pipe (__NR_Linux + 21)
#define __NR__newselect (__NR_Linux + 22)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_yield (__NR_Linux + 23)
#define __NR_mremap (__NR_Linux + 24)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_msync (__NR_Linux + 25)
#define __NR_mincore (__NR_Linux + 26)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_madvise (__NR_Linux + 27)
#define __NR_shmget (__NR_Linux + 28)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_shmat (__NR_Linux + 29)
#define __NR_shmctl (__NR_Linux + 30)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_dup (__NR_Linux + 31)
#define __NR_dup2 (__NR_Linux + 32)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_pause (__NR_Linux + 33)
#define __NR_nanosleep (__NR_Linux + 34)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_getitimer (__NR_Linux + 35)
#define __NR_setitimer (__NR_Linux + 36)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_alarm (__NR_Linux + 37)
#define __NR_getpid (__NR_Linux + 38)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sendfile (__NR_Linux + 39)
#define __NR_socket (__NR_Linux + 40)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_connect (__NR_Linux + 41)
#define __NR_accept (__NR_Linux + 42)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sendto (__NR_Linux + 43)
#define __NR_recvfrom (__NR_Linux + 44)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sendmsg (__NR_Linux + 45)
#define __NR_recvmsg (__NR_Linux + 46)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_shutdown (__NR_Linux + 47)
#define __NR_bind (__NR_Linux + 48)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_listen (__NR_Linux + 49)
#define __NR_getsockname (__NR_Linux + 50)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_getpeername (__NR_Linux + 51)
#define __NR_socketpair (__NR_Linux + 52)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setsockopt (__NR_Linux + 53)
#define __NR_getsockopt (__NR_Linux + 54)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_clone (__NR_Linux + 55)
#define __NR_fork (__NR_Linux + 56)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_execve (__NR_Linux + 57)
#define __NR_exit (__NR_Linux + 58)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_wait4 (__NR_Linux + 59)
#define __NR_kill (__NR_Linux + 60)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_uname (__NR_Linux + 61)
#define __NR_semget (__NR_Linux + 62)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_semop (__NR_Linux + 63)
#define __NR_semctl (__NR_Linux + 64)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_shmdt (__NR_Linux + 65)
#define __NR_msgget (__NR_Linux + 66)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_msgsnd (__NR_Linux + 67)
#define __NR_msgrcv (__NR_Linux + 68)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_msgctl (__NR_Linux + 69)
#define __NR_fcntl (__NR_Linux + 70)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_flock (__NR_Linux + 71)
#define __NR_fsync (__NR_Linux + 72)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fdatasync (__NR_Linux + 73)
#define __NR_truncate (__NR_Linux + 74)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_ftruncate (__NR_Linux + 75)
#define __NR_getdents (__NR_Linux + 76)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_getcwd (__NR_Linux + 77)
#define __NR_chdir (__NR_Linux + 78)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fchdir (__NR_Linux + 79)
#define __NR_rename (__NR_Linux + 80)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mkdir (__NR_Linux + 81)
#define __NR_rmdir (__NR_Linux + 82)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_creat (__NR_Linux + 83)
#define __NR_link (__NR_Linux + 84)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_unlink (__NR_Linux + 85)
#define __NR_symlink (__NR_Linux + 86)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_readlink (__NR_Linux + 87)
#define __NR_chmod (__NR_Linux + 88)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fchmod (__NR_Linux + 89)
#define __NR_chown (__NR_Linux + 90)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fchown (__NR_Linux + 91)
#define __NR_lchown (__NR_Linux + 92)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_umask (__NR_Linux + 93)
#define __NR_gettimeofday (__NR_Linux + 94)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_getrlimit (__NR_Linux + 95)
#define __NR_getrusage (__NR_Linux + 96)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sysinfo (__NR_Linux + 97)
#define __NR_times (__NR_Linux + 98)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_ptrace (__NR_Linux + 99)
#define __NR_getuid (__NR_Linux + 100)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_syslog (__NR_Linux + 101)
#define __NR_getgid (__NR_Linux + 102)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setuid (__NR_Linux + 103)
#define __NR_setgid (__NR_Linux + 104)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_geteuid (__NR_Linux + 105)
#define __NR_getegid (__NR_Linux + 106)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setpgid (__NR_Linux + 107)
#define __NR_getppid (__NR_Linux + 108)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_getpgrp (__NR_Linux + 109)
#define __NR_setsid (__NR_Linux + 110)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setreuid (__NR_Linux + 111)
#define __NR_setregid (__NR_Linux + 112)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_getgroups (__NR_Linux + 113)
#define __NR_setgroups (__NR_Linux + 114)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setresuid (__NR_Linux + 115)
#define __NR_getresuid (__NR_Linux + 116)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setresgid (__NR_Linux + 117)
#define __NR_getresgid (__NR_Linux + 118)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_getpgid (__NR_Linux + 119)
#define __NR_setfsuid (__NR_Linux + 120)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setfsgid (__NR_Linux + 121)
#define __NR_getsid (__NR_Linux + 122)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_capget (__NR_Linux + 123)
#define __NR_capset (__NR_Linux + 124)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_rt_sigpending (__NR_Linux + 125)
#define __NR_rt_sigtimedwait (__NR_Linux + 126)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
#define __NR_rt_sigsuspend (__NR_Linux + 128)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sigaltstack (__NR_Linux + 129)
#define __NR_utime (__NR_Linux + 130)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mknod (__NR_Linux + 131)
#define __NR_personality (__NR_Linux + 132)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_ustat (__NR_Linux + 133)
#define __NR_statfs (__NR_Linux + 134)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fstatfs (__NR_Linux + 135)
#define __NR_sysfs (__NR_Linux + 136)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_getpriority (__NR_Linux + 137)
#define __NR_setpriority (__NR_Linux + 138)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_setparam (__NR_Linux + 139)
#define __NR_sched_getparam (__NR_Linux + 140)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_setscheduler (__NR_Linux + 141)
#define __NR_sched_getscheduler (__NR_Linux + 142)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_get_priority_max (__NR_Linux + 143)
#define __NR_sched_get_priority_min (__NR_Linux + 144)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_rr_get_interval (__NR_Linux + 145)
#define __NR_mlock (__NR_Linux + 146)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_munlock (__NR_Linux + 147)
#define __NR_mlockall (__NR_Linux + 148)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_munlockall (__NR_Linux + 149)
#define __NR_vhangup (__NR_Linux + 150)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_pivot_root (__NR_Linux + 151)
#define __NR__sysctl (__NR_Linux + 152)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_prctl (__NR_Linux + 153)
#define __NR_adjtimex (__NR_Linux + 154)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setrlimit (__NR_Linux + 155)
#define __NR_chroot (__NR_Linux + 156)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sync (__NR_Linux + 157)
#define __NR_acct (__NR_Linux + 158)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_settimeofday (__NR_Linux + 159)
#define __NR_mount (__NR_Linux + 160)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_umount2 (__NR_Linux + 161)
#define __NR_swapon (__NR_Linux + 162)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_swapoff (__NR_Linux + 163)
#define __NR_reboot (__NR_Linux + 164)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sethostname (__NR_Linux + 165)
#define __NR_setdomainname (__NR_Linux + 166)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_create_module (__NR_Linux + 167)
#define __NR_init_module (__NR_Linux + 168)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_delete_module (__NR_Linux + 169)
#define __NR_get_kernel_syms (__NR_Linux + 170)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_query_module (__NR_Linux + 171)
#define __NR_quotactl (__NR_Linux + 172)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_nfsservctl (__NR_Linux + 173)
#define __NR_getpmsg (__NR_Linux + 174)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_putpmsg (__NR_Linux + 175)
#define __NR_afs_syscall (__NR_Linux + 176)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_reserved177 (__NR_Linux + 177)
#define __NR_gettid (__NR_Linux + 178)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_readahead (__NR_Linux + 179)
#define __NR_setxattr (__NR_Linux + 180)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_lsetxattr (__NR_Linux + 181)
#define __NR_fsetxattr (__NR_Linux + 182)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_getxattr (__NR_Linux + 183)
#define __NR_lgetxattr (__NR_Linux + 184)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fgetxattr (__NR_Linux + 185)
#define __NR_listxattr (__NR_Linux + 186)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_llistxattr (__NR_Linux + 187)
#define __NR_flistxattr (__NR_Linux + 188)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_removexattr (__NR_Linux + 189)
#define __NR_lremovexattr (__NR_Linux + 190)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fremovexattr (__NR_Linux + 191)
#define __NR_tkill (__NR_Linux + 192)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_reserved193 (__NR_Linux + 193)
#define __NR_futex (__NR_Linux + 194)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_setaffinity (__NR_Linux + 195)
#define __NR_sched_getaffinity (__NR_Linux + 196)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_cacheflush (__NR_Linux + 197)
#define __NR_cachectl (__NR_Linux + 198)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sysmips (__NR_Linux + 199)
#define __NR_io_setup (__NR_Linux + 200)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_io_destroy (__NR_Linux + 201)
#define __NR_io_getevents (__NR_Linux + 202)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_io_submit (__NR_Linux + 203)
#define __NR_io_cancel (__NR_Linux + 204)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_exit_group (__NR_Linux + 205)
#define __NR_lookup_dcookie (__NR_Linux + 206)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_epoll_create (__NR_Linux + 207)
#define __NR_epoll_ctl (__NR_Linux + 208)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_epoll_wait (__NR_Linux + 209)
#define __NR_remap_file_pages (__NR_Linux + 210)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_rt_sigreturn (__NR_Linux + 211)
#define __NR_fcntl64 (__NR_Linux + 212)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_set_tid_address (__NR_Linux + 213)
#define __NR_restart_syscall (__NR_Linux + 214)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_semtimedop (__NR_Linux + 215)
#define __NR_fadvise64 (__NR_Linux + 216)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_statfs64 (__NR_Linux + 217)
#define __NR_fstatfs64 (__NR_Linux + 218)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sendfile64 (__NR_Linux + 219)
#define __NR_timer_create (__NR_Linux + 220)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_timer_settime (__NR_Linux + 221)
#define __NR_timer_gettime (__NR_Linux + 222)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_timer_getoverrun (__NR_Linux + 223)
#define __NR_timer_delete (__NR_Linux + 224)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_clock_settime (__NR_Linux + 225)
#define __NR_clock_gettime (__NR_Linux + 226)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_clock_getres (__NR_Linux + 227)
#define __NR_clock_nanosleep (__NR_Linux + 228)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_tgkill (__NR_Linux + 229)
#define __NR_utimes (__NR_Linux + 230)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mbind (__NR_Linux + 231)
#define __NR_get_mempolicy (__NR_Linux + 232)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_set_mempolicy (__NR_Linux + 233)
#define __NR_mq_open (__NR_Linux + 234)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mq_unlink (__NR_Linux + 235)
#define __NR_mq_timedsend (__NR_Linux + 236)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mq_timedreceive (__NR_Linux + 237)
#define __NR_mq_notify (__NR_Linux + 238)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mq_getsetattr (__NR_Linux + 239)
#define __NR_vserver (__NR_Linux + 240)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_waitid (__NR_Linux + 241)
#define __NR_add_key (__NR_Linux + 243)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_request_key (__NR_Linux + 244)
#define __NR_keyctl (__NR_Linux + 245)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_set_thread_area (__NR_Linux + 246)
#define __NR_inotify_init (__NR_Linux + 247)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_inotify_add_watch (__NR_Linux + 248)
#define __NR_inotify_rm_watch (__NR_Linux + 249)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_migrate_pages (__NR_Linux + 250)
#define __NR_openat (__NR_Linux + 251)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mkdirat (__NR_Linux + 252)
#define __NR_mknodat (__NR_Linux + 253)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fchownat (__NR_Linux + 254)
#define __NR_futimesat (__NR_Linux + 255)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_newfstatat (__NR_Linux + 256)
#define __NR_unlinkat (__NR_Linux + 257)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_renameat (__NR_Linux + 258)
#define __NR_linkat (__NR_Linux + 259)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_symlinkat (__NR_Linux + 260)
#define __NR_readlinkat (__NR_Linux + 261)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fchmodat (__NR_Linux + 262)
#define __NR_faccessat (__NR_Linux + 263)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_pselect6 (__NR_Linux + 264)
#define __NR_ppoll (__NR_Linux + 265)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_unshare (__NR_Linux + 266)
#define __NR_splice (__NR_Linux + 267)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sync_file_range (__NR_Linux + 268)
#define __NR_tee (__NR_Linux + 269)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_vmsplice (__NR_Linux + 270)
#define __NR_move_pages (__NR_Linux + 271)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_set_robust_list (__NR_Linux + 272)
#define __NR_get_robust_list (__NR_Linux + 273)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_kexec_load (__NR_Linux + 274)
#define __NR_getcpu (__NR_Linux + 275)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_epoll_pwait (__NR_Linux + 276)
#define __NR_ioprio_set (__NR_Linux + 277)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_ioprio_get (__NR_Linux + 278)
#define __NR_utimensat (__NR_Linux + 279)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_signalfd (__NR_Linux + 280)
#define __NR_timerfd (__NR_Linux + 281)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_eventfd (__NR_Linux + 282)
#define __NR_fallocate (__NR_Linux + 283)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_timerfd_create (__NR_Linux + 284)
#define __NR_timerfd_gettime (__NR_Linux + 285)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_timerfd_settime (__NR_Linux + 286)
#define __NR_signalfd4 (__NR_Linux + 287)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_eventfd2 (__NR_Linux + 288)
#define __NR_epoll_create1 (__NR_Linux + 289)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_dup3 (__NR_Linux + 290)
#define __NR_pipe2 (__NR_Linux + 291)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_inotify_init1 (__NR_Linux + 292)
#define __NR_preadv (__NR_Linux + 293)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_pwritev (__NR_Linux + 294)
#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_perf_event_open (__NR_Linux + 296)
#define __NR_accept4 (__NR_Linux + 297)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_recvmmsg (__NR_Linux + 298)
#define __NR_getdents64 (__NR_Linux + 299)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fanotify_init (__NR_Linux + 300)
#define __NR_fanotify_mark (__NR_Linux + 301)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_prlimit64 (__NR_Linux + 302)
#define __NR_name_to_handle_at (__NR_Linux + 303)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_open_by_handle_at (__NR_Linux + 304)
#define __NR_clock_adjtime (__NR_Linux + 305)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_syncfs (__NR_Linux + 306)
#define __NR_sendmmsg (__NR_Linux + 307)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setns (__NR_Linux + 308)
#define __NR_process_vm_readv (__NR_Linux + 309)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_process_vm_writev (__NR_Linux + 310)
#define __NR_kcmp (__NR_Linux + 311)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_finit_module (__NR_Linux + 312)
#define __NR_sched_setattr (__NR_Linux + 313)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_getattr (__NR_Linux + 314)
-#define __NR_Linux_syscalls 314
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_renameat2 (__NR_Linux + 315)
+#define __NR_Linux_syscalls 315
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_N32_Linux 6000
-#define __NR_N32_Linux_syscalls 314
+#define __NR_N32_Linux_syscalls 315
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/asm-x86/asm/kvm_perf.h b/libc/kernel/uapi/asm-x86/asm/kvm_perf.h
new file mode 100644
index 0000000..4301de2
--- /dev/null
+++ b/libc/kernel/uapi/asm-x86/asm/kvm_perf.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_KVM_PERF_H
+#define _ASM_X86_KVM_PERF_H
+#include <asm/svm.h>
+#include <asm/vmx.h>
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <asm/kvm.h>
+#define DECODE_STR_LEN 20
+#define VCPU_ID "vcpu_id"
+#define KVM_ENTRY_TRACE "kvm:kvm_entry"
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_EXIT_TRACE "kvm:kvm_exit"
+#define KVM_EXIT_REASON "exit_reason"
+#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/msr-index.h b/libc/kernel/uapi/asm-x86/asm/msr-index.h
index 6e4cac7..a83f350 100644
--- a/libc/kernel/uapi/asm-x86/asm/msr-index.h
+++ b/libc/kernel/uapi/asm-x86/asm/msr-index.h
@@ -302,263 +302,295 @@
#define MSR_IA32_FEATURE_CONTROL 0x0000003a
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_TSC_ADJUST 0x0000003b
+#define MSR_IA32_BNDCFGS 0x00000d90
#define FEATURE_CONTROL_LOCKED (1<<0)
#define FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX (1<<1)
-#define FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX (1<<2)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX (1<<2)
#define MSR_IA32_APICBASE 0x0000001b
#define MSR_IA32_APICBASE_BSP (1<<8)
#define MSR_IA32_APICBASE_ENABLE (1<<11)
-#define MSR_IA32_APICBASE_BASE (0xfffff<<12)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_APICBASE_BASE (0xfffff<<12)
#define MSR_IA32_TSCDEADLINE 0x000006e0
#define MSR_IA32_UCODE_WRITE 0x00000079
#define MSR_IA32_UCODE_REV 0x0000008b
-#define MSR_IA32_PERF_STATUS 0x00000198
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_PERF_STATUS 0x00000198
#define MSR_IA32_PERF_CTL 0x00000199
#define MSR_AMD_PSTATE_DEF_BASE 0xc0010064
#define MSR_AMD_PERF_STATUS 0xc0010063
-#define MSR_AMD_PERF_CTL 0xc0010062
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_AMD_PERF_CTL 0xc0010062
#define MSR_IA32_MPERF 0x000000e7
#define MSR_IA32_APERF 0x000000e8
#define MSR_IA32_THERM_CONTROL 0x0000019a
-#define MSR_IA32_THERM_INTERRUPT 0x0000019b
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_THERM_INTERRUPT 0x0000019b
#define THERM_INT_HIGH_ENABLE (1 << 0)
#define THERM_INT_LOW_ENABLE (1 << 1)
#define THERM_INT_PLN_ENABLE (1 << 24)
-#define MSR_IA32_THERM_STATUS 0x0000019c
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_THERM_STATUS 0x0000019c
#define THERM_STATUS_PROCHOT (1 << 0)
#define THERM_STATUS_POWER_LIMIT (1 << 10)
#define MSR_THERM2_CTL 0x0000019d
-#define MSR_THERM2_CTL_TM_SELECT (1ULL << 16)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_THERM2_CTL_TM_SELECT (1ULL << 16)
#define MSR_IA32_MISC_ENABLE 0x000001a0
#define MSR_IA32_TEMPERATURE_TARGET 0x000001a2
#define MSR_IA32_ENERGY_PERF_BIAS 0x000001b0
-#define ENERGY_PERF_BIAS_PERFORMANCE 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ENERGY_PERF_BIAS_PERFORMANCE 0
#define ENERGY_PERF_BIAS_NORMAL 6
#define ENERGY_PERF_BIAS_POWERSAVE 15
#define MSR_IA32_PACKAGE_THERM_STATUS 0x000001b1
-#define PACKAGE_THERM_STATUS_PROCHOT (1 << 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PACKAGE_THERM_STATUS_PROCHOT (1 << 0)
#define PACKAGE_THERM_STATUS_POWER_LIMIT (1 << 10)
#define MSR_IA32_PACKAGE_THERM_INTERRUPT 0x000001b2
#define PACKAGE_THERM_INT_HIGH_ENABLE (1 << 0)
-#define PACKAGE_THERM_INT_LOW_ENABLE (1 << 1)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PACKAGE_THERM_INT_LOW_ENABLE (1 << 1)
#define PACKAGE_THERM_INT_PLN_ENABLE (1 << 24)
#define THERM_INT_THRESHOLD0_ENABLE (1 << 15)
#define THERM_SHIFT_THRESHOLD0 8
-#define THERM_MASK_THRESHOLD0 (0x7f << THERM_SHIFT_THRESHOLD0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define THERM_MASK_THRESHOLD0 (0x7f << THERM_SHIFT_THRESHOLD0)
#define THERM_INT_THRESHOLD1_ENABLE (1 << 23)
#define THERM_SHIFT_THRESHOLD1 16
#define THERM_MASK_THRESHOLD1 (0x7f << THERM_SHIFT_THRESHOLD1)
-#define THERM_STATUS_THRESHOLD0 (1 << 6)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define THERM_STATUS_THRESHOLD0 (1 << 6)
#define THERM_LOG_THRESHOLD0 (1 << 7)
#define THERM_STATUS_THRESHOLD1 (1 << 8)
#define THERM_LOG_THRESHOLD1 (1 << 9)
-#define MSR_IA32_MISC_ENABLE_FAST_STRING (1ULL << 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define MSR_IA32_MISC_ENABLE_TCC (1ULL << 1)
-#define MSR_IA32_MISC_ENABLE_EMON (1ULL << 7)
-#define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL (1ULL << 11)
-#define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL (1ULL << 12)
+#define MSR_IA32_MISC_ENABLE_FAST_STRING_BIT 0
+#define MSR_IA32_MISC_ENABLE_FAST_STRING (1ULL << MSR_IA32_MISC_ENABLE_FAST_STRING_BIT)
+#define MSR_IA32_MISC_ENABLE_TCC_BIT 1
+#define MSR_IA32_MISC_ENABLE_TCC (1ULL << MSR_IA32_MISC_ENABLE_TCC_BIT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP (1ULL << 16)
-#define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << 18)
-#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << 22)
-#define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1ULL << 23)
+#define MSR_IA32_MISC_ENABLE_EMON_BIT 7
+#define MSR_IA32_MISC_ENABLE_EMON (1ULL << MSR_IA32_MISC_ENABLE_EMON_BIT)
+#define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL_BIT 11
+#define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL (1ULL << MSR_IA32_MISC_ENABLE_BTS_UNAVAIL_BIT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define MSR_IA32_MISC_ENABLE_XD_DISABLE (1ULL << 34)
-#define MSR_IA32_MISC_ENABLE_X87_COMPAT (1ULL << 2)
-#define MSR_IA32_MISC_ENABLE_TM1 (1ULL << 3)
-#define MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE (1ULL << 4)
+#define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL_BIT 12
+#define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL (1ULL << MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL_BIT)
+#define MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP_BIT 16
+#define MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP (1ULL << MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP_BIT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE (1ULL << 6)
-#define MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK (1ULL << 8)
-#define MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE (1ULL << 9)
-#define MSR_IA32_MISC_ENABLE_FERR (1ULL << 10)
+#define MSR_IA32_MISC_ENABLE_MWAIT_BIT 18
+#define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << MSR_IA32_MISC_ENABLE_MWAIT_BIT)
+#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT 22
+#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX (1ULL << 10)
-#define MSR_IA32_MISC_ENABLE_TM2 (1ULL << 13)
-#define MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE (1ULL << 19)
-#define MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK (1ULL << 20)
+#define MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT 23
+#define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT)
+#define MSR_IA32_MISC_ENABLE_XD_DISABLE_BIT 34
+#define MSR_IA32_MISC_ENABLE_XD_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_XD_DISABLE_BIT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define MSR_IA32_MISC_ENABLE_L1D_CONTEXT (1ULL << 24)
-#define MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE (1ULL << 37)
-#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << 38)
-#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << 39)
+#define MSR_IA32_MISC_ENABLE_X87_COMPAT_BIT 2
+#define MSR_IA32_MISC_ENABLE_X87_COMPAT (1ULL << MSR_IA32_MISC_ENABLE_X87_COMPAT_BIT)
+#define MSR_IA32_MISC_ENABLE_TM1_BIT 3
+#define MSR_IA32_MISC_ENABLE_TM1 (1ULL << MSR_IA32_MISC_ENABLE_TM1_BIT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE_BIT 4
+#define MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE_BIT)
+#define MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE_BIT 6
+#define MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE_BIT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK_BIT 8
+#define MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK (1ULL << MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK_BIT)
+#define MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT 9
+#define MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_MISC_ENABLE_FERR_BIT 10
+#define MSR_IA32_MISC_ENABLE_FERR (1ULL << MSR_IA32_MISC_ENABLE_FERR_BIT)
+#define MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX_BIT 10
+#define MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX (1ULL << MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX_BIT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_MISC_ENABLE_TM2_BIT 13
+#define MSR_IA32_MISC_ENABLE_TM2 (1ULL << MSR_IA32_MISC_ENABLE_TM2_BIT)
+#define MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE_BIT 19
+#define MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE_BIT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK_BIT 20
+#define MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK (1ULL << MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK_BIT)
+#define MSR_IA32_MISC_ENABLE_L1D_CONTEXT_BIT 24
+#define MSR_IA32_MISC_ENABLE_L1D_CONTEXT (1ULL << MSR_IA32_MISC_ENABLE_L1D_CONTEXT_BIT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE_BIT 37
+#define MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE_BIT)
+#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE_BIT 38
+#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_TURBO_DISABLE_BIT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE_BIT 39
+#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE_BIT)
#define MSR_IA32_TSC_DEADLINE 0x000006E0
#define MSR_IA32_MCG_EAX 0x00000180
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_MCG_EBX 0x00000181
#define MSR_IA32_MCG_ECX 0x00000182
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_MCG_EDX 0x00000183
#define MSR_IA32_MCG_ESI 0x00000184
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_MCG_EDI 0x00000185
#define MSR_IA32_MCG_EBP 0x00000186
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_MCG_ESP 0x00000187
#define MSR_IA32_MCG_EFLAGS 0x00000188
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_MCG_EIP 0x00000189
#define MSR_IA32_MCG_RESERVED 0x0000018a
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_BPU_PERFCTR0 0x00000300
#define MSR_P4_BPU_PERFCTR1 0x00000301
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_BPU_PERFCTR2 0x00000302
#define MSR_P4_BPU_PERFCTR3 0x00000303
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_MS_PERFCTR0 0x00000304
#define MSR_P4_MS_PERFCTR1 0x00000305
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_MS_PERFCTR2 0x00000306
#define MSR_P4_MS_PERFCTR3 0x00000307
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_FLAME_PERFCTR0 0x00000308
#define MSR_P4_FLAME_PERFCTR1 0x00000309
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_FLAME_PERFCTR2 0x0000030a
#define MSR_P4_FLAME_PERFCTR3 0x0000030b
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_IQ_PERFCTR0 0x0000030c
#define MSR_P4_IQ_PERFCTR1 0x0000030d
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_IQ_PERFCTR2 0x0000030e
#define MSR_P4_IQ_PERFCTR3 0x0000030f
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_IQ_PERFCTR4 0x00000310
#define MSR_P4_IQ_PERFCTR5 0x00000311
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_BPU_CCCR0 0x00000360
#define MSR_P4_BPU_CCCR1 0x00000361
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_BPU_CCCR2 0x00000362
#define MSR_P4_BPU_CCCR3 0x00000363
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_MS_CCCR0 0x00000364
#define MSR_P4_MS_CCCR1 0x00000365
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_MS_CCCR2 0x00000366
#define MSR_P4_MS_CCCR3 0x00000367
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_FLAME_CCCR0 0x00000368
#define MSR_P4_FLAME_CCCR1 0x00000369
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_FLAME_CCCR2 0x0000036a
#define MSR_P4_FLAME_CCCR3 0x0000036b
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_IQ_CCCR0 0x0000036c
#define MSR_P4_IQ_CCCR1 0x0000036d
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_IQ_CCCR2 0x0000036e
#define MSR_P4_IQ_CCCR3 0x0000036f
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_IQ_CCCR4 0x00000370
#define MSR_P4_IQ_CCCR5 0x00000371
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_ALF_ESCR0 0x000003ca
#define MSR_P4_ALF_ESCR1 0x000003cb
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_BPU_ESCR0 0x000003b2
#define MSR_P4_BPU_ESCR1 0x000003b3
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_BSU_ESCR0 0x000003a0
#define MSR_P4_BSU_ESCR1 0x000003a1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_CRU_ESCR0 0x000003b8
#define MSR_P4_CRU_ESCR1 0x000003b9
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_CRU_ESCR2 0x000003cc
#define MSR_P4_CRU_ESCR3 0x000003cd
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_CRU_ESCR4 0x000003e0
#define MSR_P4_CRU_ESCR5 0x000003e1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_DAC_ESCR0 0x000003a8
#define MSR_P4_DAC_ESCR1 0x000003a9
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_FIRM_ESCR0 0x000003a4
#define MSR_P4_FIRM_ESCR1 0x000003a5
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_FLAME_ESCR0 0x000003a6
#define MSR_P4_FLAME_ESCR1 0x000003a7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_FSB_ESCR0 0x000003a2
#define MSR_P4_FSB_ESCR1 0x000003a3
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_IQ_ESCR0 0x000003ba
#define MSR_P4_IQ_ESCR1 0x000003bb
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_IS_ESCR0 0x000003b4
#define MSR_P4_IS_ESCR1 0x000003b5
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_ITLB_ESCR0 0x000003b6
#define MSR_P4_ITLB_ESCR1 0x000003b7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_IX_ESCR0 0x000003c8
#define MSR_P4_IX_ESCR1 0x000003c9
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_MOB_ESCR0 0x000003aa
#define MSR_P4_MOB_ESCR1 0x000003ab
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_MS_ESCR0 0x000003c0
#define MSR_P4_MS_ESCR1 0x000003c1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_PMH_ESCR0 0x000003ac
#define MSR_P4_PMH_ESCR1 0x000003ad
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_RAT_ESCR0 0x000003bc
#define MSR_P4_RAT_ESCR1 0x000003bd
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_SAAT_ESCR0 0x000003ae
#define MSR_P4_SAAT_ESCR1 0x000003af
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_SSU_ESCR0 0x000003be
#define MSR_P4_SSU_ESCR1 0x000003bf
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_TBPU_ESCR0 0x000003c2
#define MSR_P4_TBPU_ESCR1 0x000003c3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_TC_ESCR0 0x000003c4
#define MSR_P4_TC_ESCR1 0x000003c5
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_U2L_ESCR0 0x000003b0
#define MSR_P4_U2L_ESCR1 0x000003b1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_P4_PEBS_MATRIX_VERT 0x000003f2
#define MSR_CORE_PERF_FIXED_CTR0 0x00000309
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_CORE_PERF_FIXED_CTR1 0x0000030a
#define MSR_CORE_PERF_FIXED_CTR2 0x0000030b
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_CORE_PERF_FIXED_CTR_CTRL 0x0000038d
#define MSR_CORE_PERF_GLOBAL_STATUS 0x0000038e
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_CORE_PERF_GLOBAL_CTRL 0x0000038f
#define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x00000390
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_GEODE_BUSCONT_CONF0 0x00001900
#define MSR_IA32_VMX_BASIC 0x00000480
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_PINBASED_CTLS 0x00000481
#define MSR_IA32_VMX_PROCBASED_CTLS 0x00000482
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_EXIT_CTLS 0x00000483
#define MSR_IA32_VMX_ENTRY_CTLS 0x00000484
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_MISC 0x00000485
#define MSR_IA32_VMX_CR0_FIXED0 0x00000486
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_CR0_FIXED1 0x00000487
#define MSR_IA32_VMX_CR4_FIXED0 0x00000488
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_CR4_FIXED1 0x00000489
#define MSR_IA32_VMX_VMCS_ENUM 0x0000048a
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_PROCBASED_CTLS2 0x0000048b
#define MSR_IA32_VMX_EPT_VPID_CAP 0x0000048c
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_TRUE_PINBASED_CTLS 0x0000048d
#define MSR_IA32_VMX_TRUE_PROCBASED_CTLS 0x0000048e
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_TRUE_EXIT_CTLS 0x0000048f
#define MSR_IA32_VMX_TRUE_ENTRY_CTLS 0x00000490
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_VMFUNC 0x00000491
#define VMX_BASIC_VMCS_SIZE_SHIFT 32
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VMX_BASIC_64 0x0001000000000000LLU
#define VMX_BASIC_MEM_TYPE_SHIFT 50
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VMX_BASIC_MEM_TYPE_MASK 0x003c000000000000LLU
#define VMX_BASIC_MEM_TYPE_WB 6LLU
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VMX_BASIC_INOUT 0x0040000000000000LLU
#define MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS (1ULL << 29)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_IA32_VMX_MISC_PREEMPTION_TIMER_SCALE 0x1F
#define MSR_VM_CR 0xc0010114
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSR_VM_IGNNE 0xc0010115
#define MSR_VM_HSAVE_PA 0xc0010117
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/unistd_32.h b/libc/kernel/uapi/asm-x86/asm/unistd_32.h
index 4838ae1..5102e56 100644
--- a/libc/kernel/uapi/asm-x86/asm/unistd_32.h
+++ b/libc/kernel/uapi/asm-x86/asm/unistd_32.h
@@ -454,5 +454,6 @@
#define __NR_finit_module 350
#define __NR_sched_setattr 351
#define __NR_sched_getattr 352
-#endif
+#define __NR_renameat2 353
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/unistd_64.h b/libc/kernel/uapi/asm-x86/asm/unistd_64.h
index 7bdb301..36d5118 100644
--- a/libc/kernel/uapi/asm-x86/asm/unistd_64.h
+++ b/libc/kernel/uapi/asm-x86/asm/unistd_64.h
@@ -413,4 +413,6 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_setattr 314
#define __NR_sched_getattr 315
+#define __NR_renameat2 316
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/asm-x86/asm/unistd_x32.h b/libc/kernel/uapi/asm-x86/asm/unistd_x32.h
index ee51fb5..7942237 100644
--- a/libc/kernel/uapi/asm-x86/asm/unistd_x32.h
+++ b/libc/kernel/uapi/asm-x86/asm/unistd_x32.h
@@ -247,157 +247,158 @@
#define __NR_sched_setaffinity (__X32_SYSCALL_BIT + 203)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_getaffinity (__X32_SYSCALL_BIT + 204)
-#define __NR_io_setup (__X32_SYSCALL_BIT + 206)
#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define __NR_io_submit (__X32_SYSCALL_BIT + 209)
#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_lookup_dcookie (__X32_SYSCALL_BIT + 212)
#define __NR_epoll_create (__X32_SYSCALL_BIT + 213)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_remap_file_pages (__X32_SYSCALL_BIT + 216)
#define __NR_getdents64 (__X32_SYSCALL_BIT + 217)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_set_tid_address (__X32_SYSCALL_BIT + 218)
#define __NR_restart_syscall (__X32_SYSCALL_BIT + 219)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_semtimedop (__X32_SYSCALL_BIT + 220)
#define __NR_fadvise64 (__X32_SYSCALL_BIT + 221)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_timer_settime (__X32_SYSCALL_BIT + 223)
#define __NR_timer_gettime (__X32_SYSCALL_BIT + 224)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_timer_getoverrun (__X32_SYSCALL_BIT + 225)
#define __NR_timer_delete (__X32_SYSCALL_BIT + 226)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_clock_settime (__X32_SYSCALL_BIT + 227)
#define __NR_clock_gettime (__X32_SYSCALL_BIT + 228)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_clock_getres (__X32_SYSCALL_BIT + 229)
#define __NR_clock_nanosleep (__X32_SYSCALL_BIT + 230)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_exit_group (__X32_SYSCALL_BIT + 231)
#define __NR_epoll_wait (__X32_SYSCALL_BIT + 232)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_epoll_ctl (__X32_SYSCALL_BIT + 233)
#define __NR_tgkill (__X32_SYSCALL_BIT + 234)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_utimes (__X32_SYSCALL_BIT + 235)
#define __NR_mbind (__X32_SYSCALL_BIT + 237)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_set_mempolicy (__X32_SYSCALL_BIT + 238)
#define __NR_get_mempolicy (__X32_SYSCALL_BIT + 239)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mq_open (__X32_SYSCALL_BIT + 240)
#define __NR_mq_unlink (__X32_SYSCALL_BIT + 241)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mq_timedsend (__X32_SYSCALL_BIT + 242)
#define __NR_mq_timedreceive (__X32_SYSCALL_BIT + 243)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mq_getsetattr (__X32_SYSCALL_BIT + 245)
#define __NR_add_key (__X32_SYSCALL_BIT + 248)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_request_key (__X32_SYSCALL_BIT + 249)
#define __NR_keyctl (__X32_SYSCALL_BIT + 250)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_ioprio_set (__X32_SYSCALL_BIT + 251)
#define __NR_ioprio_get (__X32_SYSCALL_BIT + 252)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_inotify_init (__X32_SYSCALL_BIT + 253)
#define __NR_inotify_add_watch (__X32_SYSCALL_BIT + 254)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_inotify_rm_watch (__X32_SYSCALL_BIT + 255)
#define __NR_migrate_pages (__X32_SYSCALL_BIT + 256)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_openat (__X32_SYSCALL_BIT + 257)
#define __NR_mkdirat (__X32_SYSCALL_BIT + 258)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_mknodat (__X32_SYSCALL_BIT + 259)
#define __NR_fchownat (__X32_SYSCALL_BIT + 260)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_futimesat (__X32_SYSCALL_BIT + 261)
#define __NR_newfstatat (__X32_SYSCALL_BIT + 262)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_unlinkat (__X32_SYSCALL_BIT + 263)
#define __NR_renameat (__X32_SYSCALL_BIT + 264)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_linkat (__X32_SYSCALL_BIT + 265)
#define __NR_symlinkat (__X32_SYSCALL_BIT + 266)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_readlinkat (__X32_SYSCALL_BIT + 267)
#define __NR_fchmodat (__X32_SYSCALL_BIT + 268)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_faccessat (__X32_SYSCALL_BIT + 269)
#define __NR_pselect6 (__X32_SYSCALL_BIT + 270)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_ppoll (__X32_SYSCALL_BIT + 271)
#define __NR_unshare (__X32_SYSCALL_BIT + 272)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_splice (__X32_SYSCALL_BIT + 275)
#define __NR_tee (__X32_SYSCALL_BIT + 276)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sync_file_range (__X32_SYSCALL_BIT + 277)
#define __NR_utimensat (__X32_SYSCALL_BIT + 280)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_epoll_pwait (__X32_SYSCALL_BIT + 281)
#define __NR_signalfd (__X32_SYSCALL_BIT + 282)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_timerfd_create (__X32_SYSCALL_BIT + 283)
#define __NR_eventfd (__X32_SYSCALL_BIT + 284)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fallocate (__X32_SYSCALL_BIT + 285)
#define __NR_timerfd_settime (__X32_SYSCALL_BIT + 286)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_timerfd_gettime (__X32_SYSCALL_BIT + 287)
#define __NR_accept4 (__X32_SYSCALL_BIT + 288)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_signalfd4 (__X32_SYSCALL_BIT + 289)
#define __NR_eventfd2 (__X32_SYSCALL_BIT + 290)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_epoll_create1 (__X32_SYSCALL_BIT + 291)
#define __NR_dup3 (__X32_SYSCALL_BIT + 292)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_pipe2 (__X32_SYSCALL_BIT + 293)
#define __NR_inotify_init1 (__X32_SYSCALL_BIT + 294)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_perf_event_open (__X32_SYSCALL_BIT + 298)
#define __NR_fanotify_init (__X32_SYSCALL_BIT + 300)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_fanotify_mark (__X32_SYSCALL_BIT + 301)
#define __NR_prlimit64 (__X32_SYSCALL_BIT + 302)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_name_to_handle_at (__X32_SYSCALL_BIT + 303)
#define __NR_open_by_handle_at (__X32_SYSCALL_BIT + 304)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_clock_adjtime (__X32_SYSCALL_BIT + 305)
#define __NR_syncfs (__X32_SYSCALL_BIT + 306)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setns (__X32_SYSCALL_BIT + 308)
#define __NR_getcpu (__X32_SYSCALL_BIT + 309)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_kcmp (__X32_SYSCALL_BIT + 312)
#define __NR_finit_module (__X32_SYSCALL_BIT + 313)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sched_setattr (__X32_SYSCALL_BIT + 314)
#define __NR_sched_getattr (__X32_SYSCALL_BIT + 315)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __NR_renameat2 (__X32_SYSCALL_BIT + 316)
#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
#define __NR_readv (__X32_SYSCALL_BIT + 515)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_writev (__X32_SYSCALL_BIT + 516)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_recvfrom (__X32_SYSCALL_BIT + 517)
#define __NR_sendmsg (__X32_SYSCALL_BIT + 518)
#define __NR_recvmsg (__X32_SYSCALL_BIT + 519)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_execve (__X32_SYSCALL_BIT + 520)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_ptrace (__X32_SYSCALL_BIT + 521)
#define __NR_rt_sigpending (__X32_SYSCALL_BIT + 522)
#define __NR_rt_sigtimedwait (__X32_SYSCALL_BIT + 523)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_rt_sigqueueinfo (__X32_SYSCALL_BIT + 524)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_sigaltstack (__X32_SYSCALL_BIT + 525)
#define __NR_timer_create (__X32_SYSCALL_BIT + 526)
#define __NR_mq_notify (__X32_SYSCALL_BIT + 527)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_kexec_load (__X32_SYSCALL_BIT + 528)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_waitid (__X32_SYSCALL_BIT + 529)
#define __NR_set_robust_list (__X32_SYSCALL_BIT + 530)
#define __NR_get_robust_list (__X32_SYSCALL_BIT + 531)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_vmsplice (__X32_SYSCALL_BIT + 532)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_move_pages (__X32_SYSCALL_BIT + 533)
#define __NR_preadv (__X32_SYSCALL_BIT + 534)
#define __NR_pwritev (__X32_SYSCALL_BIT + 535)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
#define __NR_sendmmsg (__X32_SYSCALL_BIT + 538)
#define __NR_process_vm_readv (__X32_SYSCALL_BIT + 539)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_process_vm_writev (__X32_SYSCALL_BIT + 540)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NR_setsockopt (__X32_SYSCALL_BIT + 541)
#define __NR_getsockopt (__X32_SYSCALL_BIT + 542)
-#endif
+#define __NR_io_setup (__X32_SYSCALL_BIT + 543)
+#define __NR_io_submit (__X32_SYSCALL_BIT + 544)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/vsyscall.h b/libc/kernel/uapi/asm-x86/asm/vsyscall.h
index 4a5b3ab..d010af9 100644
--- a/libc/kernel/uapi/asm-x86/asm/vsyscall.h
+++ b/libc/kernel/uapi/asm-x86/asm/vsyscall.h
@@ -24,11 +24,6 @@
__NR_vtime,
__NR_vgetcpu,
};
-#define VSYSCALL_START (-10UL << 20)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define VSYSCALL_SIZE 1024
-#define VSYSCALL_END (-2UL << 20)
-#define VSYSCALL_MAPPED_PAGES 1
-#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
+#define VSYSCALL_ADDR (-10UL << 20)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/drm/drm.h b/libc/kernel/uapi/drm/drm.h
index ed848a8..32a76a7 100644
--- a/libc/kernel/uapi/drm/drm.h
+++ b/libc/kernel/uapi/drm/drm.h
@@ -441,200 +441,201 @@
};
#define DRM_CLIENT_CAP_STEREO_3D 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
struct drm_set_client_cap {
__u64 capability;
__u64 value;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define DRM_CLOEXEC O_CLOEXEC
struct drm_prime_handle {
__u32 handle;
- __u32 flags;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 flags;
__s32 fd;
};
#include <drm/drm_mode.h>
-#define DRM_IOCTL_BASE 'd'
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_BASE 'd'
#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
-#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version)
#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique)
#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth)
-#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid)
#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map)
#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
-#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
-#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap)
#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap)
#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
-#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block)
#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block)
#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control)
-#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map)
#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc)
#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc)
#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info)
-#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map)
#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free)
#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map)
#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map)
-#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map)
#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e)
#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx)
-#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx)
#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx)
#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx)
#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx)
-#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx)
#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res)
#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw)
#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw)
-#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma)
#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock)
#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
-#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)
#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle)
#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31)
-#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode)
#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info)
#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer)
#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer)
-#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding)
#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather)
#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather)
-#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)
#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res)
#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc)
-#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc)
#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor)
#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut)
#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut)
-#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector)
#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd)
#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd)
-#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property)
#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
-#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
-#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb)
#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res)
-#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane)
#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane)
#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
-#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
#define DRM_COMMAND_BASE 0x40
#define DRM_COMMAND_END 0xA0
-struct drm_event {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct drm_event {
__u32 type;
__u32 length;
};
-#define DRM_EVENT_VBLANK 0x01
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_EVENT_VBLANK 0x01
#define DRM_EVENT_FLIP_COMPLETE 0x02
struct drm_event_vblank {
struct drm_event base;
- __u64 user_data;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 user_data;
__u32 tv_sec;
__u32 tv_usec;
__u32 sequence;
- __u32 reserved;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 reserved;
};
typedef struct drm_clip_rect drm_clip_rect_t;
typedef struct drm_drawable_info drm_drawable_info_t;
-typedef struct drm_tex_region drm_tex_region_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef struct drm_tex_region drm_tex_region_t;
typedef struct drm_hw_lock drm_hw_lock_t;
typedef struct drm_version drm_version_t;
typedef struct drm_unique drm_unique_t;
-typedef struct drm_list drm_list_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef struct drm_list drm_list_t;
typedef struct drm_block drm_block_t;
typedef struct drm_control drm_control_t;
typedef enum drm_map_type drm_map_type_t;
-typedef enum drm_map_flags drm_map_flags_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef enum drm_map_flags drm_map_flags_t;
typedef struct drm_ctx_priv_map drm_ctx_priv_map_t;
typedef struct drm_map drm_map_t;
typedef struct drm_client drm_client_t;
-typedef enum drm_stat_type drm_stat_type_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef enum drm_stat_type drm_stat_type_t;
typedef struct drm_stats drm_stats_t;
typedef enum drm_lock_flags drm_lock_flags_t;
typedef struct drm_lock drm_lock_t;
-typedef enum drm_dma_flags drm_dma_flags_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef enum drm_dma_flags drm_dma_flags_t;
typedef struct drm_buf_desc drm_buf_desc_t;
typedef struct drm_buf_info drm_buf_info_t;
typedef struct drm_buf_free drm_buf_free_t;
-typedef struct drm_buf_pub drm_buf_pub_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef struct drm_buf_pub drm_buf_pub_t;
typedef struct drm_buf_map drm_buf_map_t;
typedef struct drm_dma drm_dma_t;
typedef union drm_wait_vblank drm_wait_vblank_t;
-typedef struct drm_agp_mode drm_agp_mode_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef struct drm_agp_mode drm_agp_mode_t;
typedef enum drm_ctx_flags drm_ctx_flags_t;
typedef struct drm_ctx drm_ctx_t;
typedef struct drm_ctx_res drm_ctx_res_t;
-typedef struct drm_draw drm_draw_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef struct drm_draw drm_draw_t;
typedef struct drm_update_draw drm_update_draw_t;
typedef struct drm_auth drm_auth_t;
typedef struct drm_irq_busid drm_irq_busid_t;
-typedef enum drm_vblank_seq_type drm_vblank_seq_type_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef enum drm_vblank_seq_type drm_vblank_seq_type_t;
typedef struct drm_agp_buffer drm_agp_buffer_t;
typedef struct drm_agp_binding drm_agp_binding_t;
typedef struct drm_agp_info drm_agp_info_t;
-typedef struct drm_scatter_gather drm_scatter_gather_t;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+typedef struct drm_scatter_gather drm_scatter_gather_t;
typedef struct drm_set_version drm_set_version_t;
#endif
diff --git a/libc/kernel/uapi/drm/drm_mode.h b/libc/kernel/uapi/drm/drm_mode.h
index bbe1c8e..19bc06b 100644
--- a/libc/kernel/uapi/drm/drm_mode.h
+++ b/libc/kernel/uapi/drm/drm_mode.h
@@ -159,231 +159,238 @@
#define DRM_MODE_ENCODER_TVDAC 4
#define DRM_MODE_ENCODER_VIRTUAL 5
#define DRM_MODE_ENCODER_DSI 6
-struct drm_mode_get_encoder {
+#define DRM_MODE_ENCODER_DPMST 7
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct drm_mode_get_encoder {
__u32 encoder_id;
__u32 encoder_type;
__u32 crtc_id;
- __u32 possible_crtcs;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 possible_crtcs;
__u32 possible_clones;
};
#define DRM_MODE_SUBCONNECTOR_Automatic 0
-#define DRM_MODE_SUBCONNECTOR_Unknown 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_MODE_SUBCONNECTOR_Unknown 0
#define DRM_MODE_SUBCONNECTOR_DVID 3
#define DRM_MODE_SUBCONNECTOR_DVIA 4
#define DRM_MODE_SUBCONNECTOR_Composite 5
-#define DRM_MODE_SUBCONNECTOR_SVIDEO 6
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_MODE_SUBCONNECTOR_SVIDEO 6
#define DRM_MODE_SUBCONNECTOR_Component 8
#define DRM_MODE_SUBCONNECTOR_SCART 9
#define DRM_MODE_CONNECTOR_Unknown 0
-#define DRM_MODE_CONNECTOR_VGA 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_MODE_CONNECTOR_VGA 1
#define DRM_MODE_CONNECTOR_DVII 2
#define DRM_MODE_CONNECTOR_DVID 3
#define DRM_MODE_CONNECTOR_DVIA 4
-#define DRM_MODE_CONNECTOR_Composite 5
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_MODE_CONNECTOR_Composite 5
#define DRM_MODE_CONNECTOR_SVIDEO 6
#define DRM_MODE_CONNECTOR_LVDS 7
#define DRM_MODE_CONNECTOR_Component 8
-#define DRM_MODE_CONNECTOR_9PinDIN 9
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_MODE_CONNECTOR_9PinDIN 9
#define DRM_MODE_CONNECTOR_DisplayPort 10
#define DRM_MODE_CONNECTOR_HDMIA 11
#define DRM_MODE_CONNECTOR_HDMIB 12
-#define DRM_MODE_CONNECTOR_TV 13
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_MODE_CONNECTOR_TV 13
#define DRM_MODE_CONNECTOR_eDP 14
#define DRM_MODE_CONNECTOR_VIRTUAL 15
#define DRM_MODE_CONNECTOR_DSI 16
-struct drm_mode_get_connector {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct drm_mode_get_connector {
__u64 encoders_ptr;
__u64 modes_ptr;
__u64 props_ptr;
- __u64 prop_values_ptr;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 prop_values_ptr;
__u32 count_modes;
__u32 count_props;
__u32 count_encoders;
- __u32 encoder_id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 encoder_id;
__u32 connector_id;
__u32 connector_type;
__u32 connector_type_id;
- __u32 connection;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 connection;
__u32 mm_width, mm_height;
__u32 subpixel;
__u32 pad;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define DRM_MODE_PROP_PENDING (1<<0)
#define DRM_MODE_PROP_RANGE (1<<1)
#define DRM_MODE_PROP_IMMUTABLE (1<<2)
-#define DRM_MODE_PROP_ENUM (1<<3)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_MODE_PROP_ENUM (1<<3)
#define DRM_MODE_PROP_BLOB (1<<4)
#define DRM_MODE_PROP_BITMASK (1<<5)
+#define DRM_MODE_PROP_LEGACY_TYPE ( DRM_MODE_PROP_RANGE | DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BLOB | DRM_MODE_PROP_BITMASK)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0
+#define DRM_MODE_PROP_TYPE(n) ((n) << 6)
+#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1)
+#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_mode_property_enum {
__u64 value;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char name[DRM_PROP_NAME_LEN];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_mode_get_property {
__u64 values_ptr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 enum_blob_ptr;
__u32 prop_id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
char name[DRM_PROP_NAME_LEN];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 count_values;
__u32 count_enum_blobs;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_mode_connector_set_property {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 value;
__u32 prop_id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 connector_id;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_mode_obj_get_properties {
__u64 props_ptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 prop_values_ptr;
__u32 count_props;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 obj_id;
__u32 obj_type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_mode_obj_set_property {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 value;
__u32 prop_id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 obj_id;
__u32 obj_type;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_mode_get_blob {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 blob_id;
__u32 length;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 data;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_mode_fb_cmd {
__u32 fb_id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 width, height;
__u32 pitch;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 bpp;
__u32 depth;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handle;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_MODE_FB_INTERLACED (1<<0)
struct drm_mode_fb_cmd2 {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 fb_id;
__u32 width, height;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pixel_format;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handles[4];
__u32 pitches[4];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 offsets[4];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_MODE_FB_DIRTY_FLAGS 0x03
#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_mode_fb_dirty_cmd {
__u32 fb_id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u32 color;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 num_clips;
__u64 clips_ptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_mode_mode_cmd {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 connector_id;
struct drm_mode_modeinfo mode;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define DRM_MODE_CURSOR_BO 0x01
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_MODE_CURSOR_MOVE 0x02
#define DRM_MODE_CURSOR_FLAGS 0x03
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_mode_cursor {
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 crtc_id;
__s32 x;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 y;
__u32 width;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 height;
__u32 handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_mode_cursor2 {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u32 crtc_id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 x;
__s32 y;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 width;
__u32 height;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handle;
__s32 hot_x;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 hot_y;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_mode_crtc_lut {
__u32 crtc_id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 gamma_size;
__u64 red;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 green;
__u64 blue;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define DRM_MODE_PAGE_FLIP_EVENT 0x01
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_mode_crtc_page_flip {
__u32 crtc_id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 fb_id;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved;
__u64 user_data;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_mode_create_dumb {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t height;
uint32_t width;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t bpp;
uint32_t flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t handle;
uint32_t pitch;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t size;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_mode_map_dumb {
__u32 handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pad;
__u64 offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_mode_destroy_dumb {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t handle;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/drm/i915_drm.h b/libc/kernel/uapi/drm/i915_drm.h
index 7b9810c..3274ecf 100644
--- a/libc/kernel/uapi/drm/i915_drm.h
+++ b/libc/kernel/uapi/drm/i915_drm.h
@@ -196,515 +196,529 @@
#define DRM_I915_REG_READ 0x31
#define DRM_I915_GET_RESET_STATS 0x32
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_I915_GEM_USERPTR 0x33
#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
#define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP)
-#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t)
#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t)
#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
-#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t)
#define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t)
#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t)
-#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
-#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
#define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init)
#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer)
-#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
-#define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching)
#define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching)
#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
-#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
-#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain)
#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
-#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id)
-#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
-#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
-#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
+#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr)
typedef struct drm_i915_batchbuffer {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int start;
int used;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int DR1;
int DR4;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int num_cliprects;
struct drm_clip_rect __user *cliprects;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_batchbuffer_t;
typedef struct _drm_i915_cmdbuffer {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char __user *buf;
int sz;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int DR1;
int DR4;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int num_cliprects;
struct drm_clip_rect __user *cliprects;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_cmdbuffer_t;
typedef struct drm_i915_irq_emit {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int __user *irq_seq;
} drm_i915_irq_emit_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_i915_irq_wait {
int irq_seq;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_irq_wait_t;
#define I915_PARAM_IRQ_ACTIVE 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_ALLOW_BATCHBUFFER 2
#define I915_PARAM_LAST_DISPATCH 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_CHIPSET_ID 4
#define I915_PARAM_HAS_GEM 5
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_NUM_FENCES_AVAIL 6
#define I915_PARAM_HAS_OVERLAY 7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_PAGEFLIPPING 8
#define I915_PARAM_HAS_EXECBUF2 9
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_BSD 10
#define I915_PARAM_HAS_BLT 11
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_RELAXED_FENCING 12
#define I915_PARAM_HAS_COHERENT_RINGS 13
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_EXEC_CONSTANTS 14
#define I915_PARAM_HAS_RELAXED_DELTA 15
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_GEN7_SOL_RESET 16
#define I915_PARAM_HAS_LLC 17
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_ALIASING_PPGTT 18
#define I915_PARAM_HAS_WAIT_TIMEOUT 19
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_SEMAPHORES 20
#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_VEBOX 22
#define I915_PARAM_HAS_SECURE_BATCHES 23
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_PINNED_BATCHES 24
#define I915_PARAM_HAS_EXEC_NO_RELOC 25
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
#define I915_PARAM_HAS_WT 27
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define I915_PARAM_CMD_PARSER_VERSION 28
typedef struct drm_i915_getparam {
int param;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int __user *value;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_getparam_t;
#define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
#define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_SETPARAM_ALLOW_BATCHBUFFER 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_SETPARAM_NUM_USED_FENCES 4
typedef struct drm_i915_setparam {
int param;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int value;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_setparam_t;
#define I915_MEM_REGION_AGP 1
typedef struct drm_i915_mem_alloc {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int region;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int alignment;
int size;
int __user *region_offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_mem_alloc_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_i915_mem_free {
int region;
int region_offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_mem_free_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_i915_mem_init_heap {
int region;
int size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int start;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_mem_init_heap_t;
typedef struct drm_i915_mem_destroy_heap {
int region;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_mem_destroy_heap_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_I915_VBLANK_PIPE_A 1
#define DRM_I915_VBLANK_PIPE_B 2
typedef struct drm_i915_vblank_pipe {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int pipe;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_vblank_pipe_t;
typedef struct drm_i915_vblank_swap {
drm_drawable_t drawable;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum drm_vblank_seq_type seqtype;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int sequence;
} drm_i915_vblank_swap_t;
typedef struct drm_i915_hws_addr {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 addr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_i915_hws_addr_t;
struct drm_i915_gem_init {
__u64 gtt_start;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 gtt_end;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_i915_gem_create {
__u64 size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pad;
};
struct drm_i915_gem_pread {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pad;
__u64 offset;
__u64 size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 data_ptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_i915_gem_pwrite {
__u32 handle;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pad;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 offset;
__u64 size;
__u64 data_ptr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_mmap {
__u32 handle;
__u32 pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 size;
__u64 addr_ptr;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_mmap_gtt {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handle;
__u32 pad;
__u64 offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_set_domain {
__u32 handle;
__u32 read_domains;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 write_domain;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_i915_gem_sw_finish {
__u32 handle;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_relocation_entry {
__u32 target_handle;
__u32 delta;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 presumed_offset;
__u32 read_domains;
__u32 write_domain;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_GEM_DOMAIN_CPU 0x00000001
#define I915_GEM_DOMAIN_RENDER 0x00000002
#define I915_GEM_DOMAIN_SAMPLER 0x00000004
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_GEM_DOMAIN_COMMAND 0x00000008
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
#define I915_GEM_DOMAIN_VERTEX 0x00000020
#define I915_GEM_DOMAIN_GTT 0x00000040
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_exec_object {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handle;
__u32 relocation_count;
__u64 relocs_ptr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 alignment;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 offset;
};
struct drm_i915_gem_execbuffer {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 buffers_ptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 buffer_count;
__u32 batch_start_offset;
__u32 batch_len;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 DR1;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 DR4;
__u32 num_cliprects;
__u64 cliprects_ptr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_exec_object2 {
__u32 handle;
__u32 relocation_count;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 relocs_ptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 alignment;
__u64 offset;
#define EXEC_OBJECT_NEEDS_FENCE (1<<0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define EXEC_OBJECT_NEEDS_GTT (1<<1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define EXEC_OBJECT_WRITE (1<<2)
#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1)
__u64 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 rsvd1;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 rsvd2;
};
struct drm_i915_gem_execbuffer2 {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 buffers_ptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 buffer_count;
__u32 batch_start_offset;
__u32 batch_len;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 DR1;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 DR4;
__u32 num_cliprects;
__u64 cliprects_ptr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_EXEC_RING_MASK (7<<0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_EXEC_DEFAULT (0<<0)
#define I915_EXEC_RENDER (1<<0)
#define I915_EXEC_BSD (2<<0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_EXEC_BLT (3<<0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_EXEC_VEBOX (4<<0)
#define I915_EXEC_CONSTANTS_MASK (3<<6)
#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6)
__u64 flags;
__u64 rsvd1;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 rsvd2;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define I915_EXEC_GEN7_SOL_RESET (1<<8)
#define I915_EXEC_SECURE (1<<9)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_EXEC_IS_PINNED (1<<10)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_EXEC_NO_RELOC (1<<11)
#define I915_EXEC_HANDLE_LUT (1<<12)
#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define i915_execbuffer2_set_context_id(eb2, context) (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
#define i915_execbuffer2_get_context_id(eb2) ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
struct drm_i915_gem_pin {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pad;
__u64 alignment;
__u64 offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_unpin {
__u32 handle;
__u32 pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_busy {
__u32 handle;
__u32 busy;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_CACHING_NONE 0
#define I915_CACHING_CACHED 1
#define I915_CACHING_DISPLAY 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_caching {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handle;
__u32 caching;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_TILING_NONE 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_TILING_X 1
#define I915_TILING_Y 2
#define I915_BIT_6_SWIZZLE_NONE 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_BIT_6_SWIZZLE_9 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_BIT_6_SWIZZLE_9_10 2
#define I915_BIT_6_SWIZZLE_9_11 3
#define I915_BIT_6_SWIZZLE_9_10_11 4
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_BIT_6_SWIZZLE_UNKNOWN 5
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_BIT_6_SWIZZLE_9_17 6
#define I915_BIT_6_SWIZZLE_9_10_17 7
struct drm_i915_gem_set_tiling {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 tiling_mode;
__u32 stride;
__u32 swizzle_mode;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_get_tiling {
__u32 handle;
__u32 tiling_mode;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 swizzle_mode;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_i915_gem_get_aperture {
__u64 aper_size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 aper_available_size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_i915_get_pipe_from_crtc_id {
__u32 crtc_id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pipe;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define I915_MADV_WILLNEED 0
#define I915_MADV_DONTNEED 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __I915_MADV_PURGED 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_madvise {
__u32 handle;
__u32 madv;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 retained;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define I915_OVERLAY_TYPE_MASK 0xff
#define I915_OVERLAY_YUV_PLANAR 0x01
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_YUV_PACKED 0x02
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_RGB 0x03
#define I915_OVERLAY_DEPTH_MASK 0xff00
#define I915_OVERLAY_RGB24 0x1000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_RGB16 0x2000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_RGB15 0x3000
#define I915_OVERLAY_YUV422 0x0100
#define I915_OVERLAY_YUV411 0x0200
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_YUV420 0x0300
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_YUV410 0x0400
#define I915_OVERLAY_SWAP_MASK 0xff0000
#define I915_OVERLAY_NO_SWAP 0x000000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_UV_SWAP 0x010000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_Y_SWAP 0x020000
#define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
#define I915_OVERLAY_FLAGS_MASK 0xff000000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_ENABLE 0x01000000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_intel_overlay_put_image {
__u32 flags;
__u32 bo_handle;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 stride_Y;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 stride_UV;
__u32 offset_Y;
__u32 offset_U;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 offset_V;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 src_width;
__u16 src_height;
__u16 src_scan_width;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 src_scan_height;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 crtc_id;
__u16 dst_x;
__u16 dst_y;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 dst_width;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 dst_height;
};
#define I915_OVERLAY_UPDATE_ATTRS (1<<0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_OVERLAY_UPDATE_GAMMA (1<<1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_intel_overlay_attrs {
__u32 flags;
__u32 color_key;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 brightness;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 contrast;
__u32 saturation;
__u32 gamma0;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 gamma1;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 gamma2;
__u32 gamma3;
__u32 gamma4;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 gamma5;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define I915_SET_COLORKEY_NONE (1<<0)
#define I915_SET_COLORKEY_DESTINATION (1<<1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define I915_SET_COLORKEY_SOURCE (1<<2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_intel_sprite_colorkey {
__u32 plane_id;
__u32 min_value;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 channel_mask;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 max_value;
__u32 flags;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_wait {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 bo_handle;
__u32 flags;
__s64 timeout_ns;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_context_create {
__u32 ctx_id;
__u32 pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_gem_context_destroy {
__u32 ctx_id;
__u32 pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_reg_read {
__u64 offset;
__u64 val;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_i915_reset_stats {
__u32 ctx_id;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reset_count;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 batch_active;
__u32 batch_pending;
__u32 pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct drm_i915_gem_userptr {
+ __u64 user_ptr;
+ __u64 user_size;
+ __u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define I915_USERPTR_READ_ONLY 0x1
+#define I915_USERPTR_UNSYNCHRONIZED 0x80000000
+ __u32 handle;
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/drm/msm_drm.h b/libc/kernel/uapi/drm/msm_drm.h
index 033bb39..54257a7 100644
--- a/libc/kernel/uapi/drm/msm_drm.h
+++ b/libc/kernel/uapi/drm/msm_drm.h
@@ -33,72 +33,77 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSM_PARAM_GPU_ID 0x01
#define MSM_PARAM_GMEM_SIZE 0x02
+#define MSM_PARAM_CHIP_ID 0x03
struct drm_msm_param {
- uint32_t pipe;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t pipe;
uint32_t param;
uint64_t value;
};
-#define MSM_BO_SCANOUT 0x00000001
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSM_BO_SCANOUT 0x00000001
#define MSM_BO_GPU_READONLY 0x00000002
#define MSM_BO_CACHE_MASK 0x000f0000
#define MSM_BO_CACHED 0x00010000
-#define MSM_BO_WC 0x00020000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSM_BO_WC 0x00020000
#define MSM_BO_UNCACHED 0x00040000
+#define MSM_BO_FLAGS (MSM_BO_SCANOUT | MSM_BO_GPU_READONLY | MSM_BO_CACHED | MSM_BO_WC | MSM_BO_UNCACHED)
struct drm_msm_gem_new {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t size;
uint32_t flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t handle;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_msm_gem_info {
uint32_t handle;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t pad;
uint64_t offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define MSM_PREP_READ 0x01
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSM_PREP_WRITE 0x02
#define MSM_PREP_NOSYNC 0x04
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
struct drm_msm_gem_cpu_prep {
uint32_t handle;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t op;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_msm_timespec timeout;
};
struct drm_msm_gem_cpu_fini {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_msm_gem_submit_reloc {
uint32_t submit_offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t or;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int32_t shift;
uint32_t reloc_idx;
uint64_t reloc_offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSM_SUBMIT_CMD_BUF 0x0001
#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_msm_gem_submit_cmd {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t type;
uint32_t submit_idx;
uint32_t submit_offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t pad;
uint32_t nr_relocs;
uint64_t __user relocs;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MSM_SUBMIT_BO_READ 0x0001
#define MSM_SUBMIT_BO_WRITE 0x0002
+#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE)
struct drm_msm_gem_submit_bo {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t flags;
diff --git a/libc/kernel/uapi/drm/radeon_drm.h b/libc/kernel/uapi/drm/radeon_drm.h
index fd0a3a9..d583d2c 100644
--- a/libc/kernel/uapi/drm/radeon_drm.h
+++ b/libc/kernel/uapi/drm/radeon_drm.h
@@ -473,453 +473,473 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_RADEON_GEM_BUSY 0x2a
#define DRM_RADEON_GEM_VA 0x2b
+#define DRM_RADEON_GEM_OP 0x2c
#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
-#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
#define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_STOP, drm_radeon_cp_stop_t)
#define DRM_IOCTL_RADEON_CP_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESET)
#define DRM_IOCTL_RADEON_CP_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_IDLE)
-#define DRM_IOCTL_RADEON_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_RESET)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_RESET)
#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FULLSCREEN, drm_radeon_fullscreen_t)
#define DRM_IOCTL_RADEON_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_SWAP)
#define DRM_IOCTL_RADEON_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CLEAR, drm_radeon_clear_t)
-#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX, drm_radeon_vertex_t)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX, drm_radeon_vertex_t)
#define DRM_IOCTL_RADEON_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INDICES, drm_radeon_indices_t)
#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_STIPPLE, drm_radeon_stipple_t)
#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INDIRECT, drm_radeon_indirect_t)
-#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_TEXTURE, drm_radeon_texture_t)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_TEXTURE, drm_radeon_texture_t)
#define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX2, drm_radeon_vertex2_t)
#define DRM_IOCTL_RADEON_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CMDBUF, drm_radeon_cmd_buffer_t)
#define DRM_IOCTL_RADEON_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GETPARAM, drm_radeon_getparam_t)
-#define DRM_IOCTL_RADEON_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_FLIP)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_FLIP)
#define DRM_IOCTL_RADEON_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_ALLOC, drm_radeon_mem_alloc_t)
#define DRM_IOCTL_RADEON_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FREE, drm_radeon_mem_free_t)
#define DRM_IOCTL_RADEON_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INIT_HEAP, drm_radeon_mem_init_heap_t)
-#define DRM_IOCTL_RADEON_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_IRQ_EMIT, drm_radeon_irq_emit_t)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_IRQ_EMIT, drm_radeon_irq_emit_t)
#define DRM_IOCTL_RADEON_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_IRQ_WAIT, drm_radeon_irq_wait_t)
#define DRM_IOCTL_RADEON_CP_RESUME DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESUME)
#define DRM_IOCTL_RADEON_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SETPARAM, drm_radeon_setparam_t)
-#define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t)
#define DRM_IOCTL_RADEON_SURF_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_FREE, drm_radeon_surface_free_t)
#define DRM_IOCTL_RADEON_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_INFO, struct drm_radeon_gem_info)
#define DRM_IOCTL_RADEON_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_CREATE, struct drm_radeon_gem_create)
-#define DRM_IOCTL_RADEON_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_MMAP, struct drm_radeon_gem_mmap)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_MMAP, struct drm_radeon_gem_mmap)
#define DRM_IOCTL_RADEON_GEM_PREAD DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PREAD, struct drm_radeon_gem_pread)
#define DRM_IOCTL_RADEON_GEM_PWRITE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PWRITE, struct drm_radeon_gem_pwrite)
#define DRM_IOCTL_RADEON_GEM_SET_DOMAIN DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_DOMAIN, struct drm_radeon_gem_set_domain)
-#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle)
#define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs)
#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
#define DRM_IOCTL_RADEON_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling)
-#define DRM_IOCTL_RADEON_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DRM_IOCTL_RADEON_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
#define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy)
#define DRM_IOCTL_RADEON_GEM_VA DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_VA, struct drm_radeon_gem_va)
+#define DRM_IOCTL_RADEON_GEM_OP DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_OP, struct drm_radeon_gem_op)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_init {
enum {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
RADEON_INIT_CP = 0x01,
RADEON_CLEANUP_CP = 0x02,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
RADEON_INIT_R200_CP = 0x03,
RADEON_INIT_R300_CP = 0x04,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
RADEON_INIT_R600_CP = 0x05
} func;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long sarea_priv_offset;
int is_pci;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int cp_mode;
int gart_size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int ring_size;
int usec_timeout;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int fb_bpp;
unsigned int front_offset, front_pitch;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int back_offset, back_pitch;
unsigned int depth_bpp;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int depth_offset, depth_pitch;
unsigned long fb_offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long mmio_offset;
unsigned long ring_offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long ring_rptr_offset;
unsigned long buffers_offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long gart_textures_offset;
} drm_radeon_init_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_cp_stop {
int flush;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int idle;
} drm_radeon_cp_stop_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_fullscreen {
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
RADEON_INIT_FULLSCREEN = 0x01,
RADEON_CLEANUP_FULLSCREEN = 0x02
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} func;
} drm_radeon_fullscreen_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define CLEAR_X1 0
#define CLEAR_Y1 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define CLEAR_X2 2
#define CLEAR_Y2 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define CLEAR_DEPTH 4
typedef union drm_radeon_clear_rect {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
float f[5];
unsigned int ui[5];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_radeon_clear_rect_t;
typedef struct drm_radeon_clear {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int flags;
unsigned int clear_color;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int clear_depth;
unsigned int color_mask;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int depth_mask;
drm_radeon_clear_rect_t __user *depth_boxes;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_radeon_clear_t;
typedef struct drm_radeon_vertex {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int prim;
int idx;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int count;
int discard;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_radeon_vertex_t;
typedef struct drm_radeon_indices {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int prim;
int idx;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int start;
int end;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int discard;
} drm_radeon_indices_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_vertex2 {
int idx;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int discard;
int nr_states;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
drm_radeon_state_t __user *state;
int nr_prims;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
drm_radeon_prim_t __user *prim;
} drm_radeon_vertex2_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_cmd_buffer {
int bufsz;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char __user *buf;
int nbox;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_clip_rect __user *boxes;
} drm_radeon_cmd_buffer_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_tex_image {
unsigned int x, y;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int width, height;
const void __user *data;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_radeon_tex_image_t;
typedef struct drm_radeon_texture {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int offset;
int pitch;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int format;
int width;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int height;
drm_radeon_tex_image_t __user *image;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_radeon_texture_t;
typedef struct drm_radeon_stipple {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int __user *mask;
} drm_radeon_stipple_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_indirect {
int idx;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int start;
int end;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int discard;
} drm_radeon_indirect_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_CARD_PCI 0
#define RADEON_CARD_AGP 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_CARD_PCIE 2
#define RADEON_PARAM_GART_BUFFER_OFFSET 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_PARAM_LAST_FRAME 2
#define RADEON_PARAM_LAST_DISPATCH 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_PARAM_LAST_CLEAR 4
#define RADEON_PARAM_IRQ_NR 5
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_PARAM_GART_BASE 6
#define RADEON_PARAM_REGISTER_HANDLE 7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_PARAM_STATUS_HANDLE 8
#define RADEON_PARAM_SAREA_HANDLE 9
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_PARAM_GART_TEX_HANDLE 10
#define RADEON_PARAM_SCRATCH_OFFSET 11
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_PARAM_CARD_TYPE 12
#define RADEON_PARAM_VBLANK_CRTC 13
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_PARAM_FB_LOCATION 14
#define RADEON_PARAM_NUM_GB_PIPES 15
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_PARAM_DEVICE_ID 16
#define RADEON_PARAM_NUM_Z_PIPES 17
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_getparam {
int param;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
void __user *value;
} drm_radeon_getparam_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_MEM_REGION_GART 1
#define RADEON_MEM_REGION_FB 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_mem_alloc {
int region;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int alignment;
int size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int __user *region_offset;
} drm_radeon_mem_alloc_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_mem_free {
int region;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int region_offset;
} drm_radeon_mem_free_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_mem_init_heap {
int region;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int size;
int start;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_radeon_mem_init_heap_t;
typedef struct drm_radeon_irq_emit {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int __user *irq_seq;
} drm_radeon_irq_emit_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_irq_wait {
int irq_seq;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_radeon_irq_wait_t;
typedef struct drm_radeon_setparam {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int param;
__s64 value;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_radeon_setparam_t;
#define RADEON_SETPARAM_FB_LOCATION 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_SETPARAM_SWITCH_TILING 2
#define RADEON_SETPARAM_PCIGART_LOCATION 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_SETPARAM_NEW_MEMMAP 4
#define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_SETPARAM_VBLANK_CRTC 6
typedef struct drm_radeon_surface_alloc {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int address;
unsigned int size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int flags;
} drm_radeon_surface_alloc_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef struct drm_radeon_surface_free {
unsigned int address;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} drm_radeon_surface_free_t;
#define DRM_RADEON_VBLANK_CRTC1 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_RADEON_VBLANK_CRTC2 2
#define RADEON_GEM_DOMAIN_CPU 0x1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_GEM_DOMAIN_GTT 0x2
#define RADEON_GEM_DOMAIN_VRAM 0x4
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_radeon_gem_info {
uint64_t gart_size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t vram_size;
uint64_t vram_visible;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define RADEON_GEM_NO_BACKING_STORE 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_radeon_gem_create {
uint64_t size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t alignment;
uint32_t handle;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t initial_domain;
uint32_t flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define RADEON_TILING_MACRO 0x1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_TILING_MICRO 0x2
#define RADEON_TILING_SWAP_16BIT 0x4
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_TILING_SWAP_32BIT 0x8
#define RADEON_TILING_SURFACE 0x10
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_TILING_MICRO_SQUARE 0x20
#define RADEON_TILING_EG_BANKW_SHIFT 8
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_TILING_EG_BANKW_MASK 0xf
#define RADEON_TILING_EG_BANKH_SHIFT 12
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_TILING_EG_BANKH_MASK 0xf
#define RADEON_TILING_EG_MACRO_TILE_ASPECT_SHIFT 16
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_TILING_EG_MACRO_TILE_ASPECT_MASK 0xf
#define RADEON_TILING_EG_TILE_SPLIT_SHIFT 24
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_TILING_EG_TILE_SPLIT_MASK 0xf
#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_SHIFT 28
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_MASK 0xf
struct drm_radeon_gem_set_tiling {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t handle;
uint32_t tiling_flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t pitch;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_radeon_gem_get_tiling {
uint32_t handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t tiling_flags;
uint32_t pitch;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_radeon_gem_mmap {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t handle;
uint32_t pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t offset;
uint64_t size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t addr_ptr;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_radeon_gem_set_domain {
uint32_t handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t read_domains;
uint32_t write_domain;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_radeon_gem_wait_idle {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t handle;
uint32_t pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_radeon_gem_busy {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t handle;
uint32_t domain;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct drm_radeon_gem_pread {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t handle;
uint32_t pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t offset;
uint64_t size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t data_ptr;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_radeon_gem_pwrite {
uint32_t handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t pad;
uint64_t offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t size;
uint64_t data_ptr;
-};
-#define RADEON_VA_MAP 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+struct drm_radeon_gem_op {
+ uint32_t handle;
+ uint32_t op;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t value;
+};
+#define RADEON_GEM_OP_GET_INITIAL_DOMAIN 0
+#define RADEON_GEM_OP_SET_INITIAL_DOMAIN 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RADEON_VA_MAP 1
#define RADEON_VA_UNMAP 2
#define RADEON_VA_RESULT_OK 0
#define RADEON_VA_RESULT_ERROR 1
-#define RADEON_VA_RESULT_VA_EXIST 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RADEON_VA_RESULT_VA_EXIST 2
#define RADEON_VM_PAGE_VALID (1 << 0)
#define RADEON_VM_PAGE_READABLE (1 << 1)
#define RADEON_VM_PAGE_WRITEABLE (1 << 2)
-#define RADEON_VM_PAGE_SYSTEM (1 << 3)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RADEON_VM_PAGE_SYSTEM (1 << 3)
#define RADEON_VM_PAGE_SNOOPED (1 << 4)
struct drm_radeon_gem_va {
uint32_t handle;
- uint32_t operation;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t operation;
uint32_t vm_id;
uint32_t flags;
uint64_t offset;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define RADEON_CHUNK_ID_RELOCS 0x01
#define RADEON_CHUNK_ID_IB 0x02
#define RADEON_CHUNK_ID_FLAGS 0x03
-#define RADEON_CHUNK_ID_CONST_IB 0x04
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RADEON_CHUNK_ID_CONST_IB 0x04
#define RADEON_CS_KEEP_TILING_FLAGS 0x01
#define RADEON_CS_USE_VM 0x02
#define RADEON_CS_END_OF_FRAME 0x04
-#define RADEON_CS_RING_GFX 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RADEON_CS_RING_GFX 0
#define RADEON_CS_RING_COMPUTE 1
#define RADEON_CS_RING_DMA 2
#define RADEON_CS_RING_UVD 3
-struct drm_radeon_cs_chunk {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RADEON_CS_RING_VCE 4
+struct drm_radeon_cs_chunk {
uint32_t chunk_id;
uint32_t length_dw;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t chunk_data;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_radeon_cs_reloc {
uint32_t handle;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t read_domains;
uint32_t write_domain;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t flags;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_radeon_cs {
uint32_t num_chunks;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t cs_id;
uint64_t chunks;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint64_t gart_limit;
uint64_t vram_limit;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define RADEON_INFO_DEVICE_ID 0x00
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_NUM_GB_PIPES 0x01
#define RADEON_INFO_NUM_Z_PIPES 0x02
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_ACCEL_WORKING 0x03
#define RADEON_INFO_CRTC_FROM_ID 0x04
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_ACCEL_WORKING2 0x05
#define RADEON_INFO_TILING_CONFIG 0x06
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_WANT_HYPERZ 0x07
#define RADEON_INFO_WANT_CMASK 0x08
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_CLOCK_CRYSTAL_FREQ 0x09
#define RADEON_INFO_NUM_BACKENDS 0x0a
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_NUM_TILE_PIPES 0x0b
#define RADEON_INFO_FUSION_GART_WORKING 0x0c
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_BACKEND_MAP 0x0d
#define RADEON_INFO_VA_START 0x0e
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_IB_VM_MAX_SIZE 0x0f
#define RADEON_INFO_MAX_PIPES 0x10
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_TIMESTAMP 0x11
#define RADEON_INFO_MAX_SE 0x12
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_MAX_SH_PER_SE 0x13
#define RADEON_INFO_FASTFB_WORKING 0x14
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_RING_WORKING 0x15
#define RADEON_INFO_SI_TILE_MODE_ARRAY 0x16
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17
#define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RADEON_INFO_SI_BACKEND_ENABLED_MASK 0x19
#define RADEON_INFO_MAX_SCLK 0x1a
+#define RADEON_INFO_VCE_FW_VERSION 0x1b
+#define RADEON_INFO_VCE_FB_VERSION 0x1c
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RADEON_INFO_NUM_BYTES_MOVED 0x1d
+#define RADEON_INFO_VRAM_USAGE 0x1e
+#define RADEON_INFO_GTT_USAGE 0x1f
+#define RADEON_INFO_ACTIVE_CU_COUNT 0x20
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct drm_radeon_info {
uint32_t request;
diff --git a/libc/kernel/uapi/drm/tegra_drm.h b/libc/kernel/uapi/drm/tegra_drm.h
index 91d71be..609957d 100644
--- a/libc/kernel/uapi/drm/tegra_drm.h
+++ b/libc/kernel/uapi/drm/tegra_drm.h
@@ -119,40 +119,38 @@
__u32 num_waitchks;
__u32 waitchk_mask;
__u32 timeout;
- __u32 pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 syncpts;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 cmdbufs;
__u64 relocs;
__u64 waitchks;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 fence;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[5];
};
#define DRM_TEGRA_GEM_CREATE 0x00
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_TEGRA_GEM_MMAP 0x01
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_TEGRA_SYNCPT_READ 0x02
#define DRM_TEGRA_SYNCPT_INCR 0x03
#define DRM_TEGRA_SYNCPT_WAIT 0x04
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_TEGRA_OPEN_CHANNEL 0x05
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_TEGRA_CLOSE_CHANNEL 0x06
#define DRM_TEGRA_GET_SYNCPT 0x07
#define DRM_TEGRA_SUBMIT 0x08
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_TEGRA_GET_SYNCPT_BASE 0x09
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create)
#define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap)
#define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait)
#define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
#define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_open_channel)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit)
#define DRM_IOCTL_TEGRA_GET_SYNCPT_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT_BASE, struct drm_tegra_get_syncpt_base)
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/drm/vmwgfx_drm.h b/libc/kernel/uapi/drm/vmwgfx_drm.h
index 849ef7d..5536ea1 100644
--- a/libc/kernel/uapi/drm/vmwgfx_drm.h
+++ b/libc/kernel/uapi/drm/vmwgfx_drm.h
@@ -68,6 +68,11 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DRM_VMW_PARAM_MAX_MOB_MEMORY 9
#define DRM_VMW_PARAM_MAX_MOB_SIZE 10
+enum drm_vmw_handle_type {
+ DRM_VMW_HANDLE_LEGACY = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ DRM_VMW_HANDLE_PRIME = 1
+};
struct drm_vmw_getparam_arg {
uint64_t value;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -92,7 +97,7 @@
struct drm_vmw_surface_arg {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int32_t sid;
- uint32_t pad64;
+ enum drm_vmw_handle_type handle_type;
};
struct drm_vmw_size {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/audit.h b/libc/kernel/uapi/linux/audit.h
index b506512..1fd6462 100644
--- a/libc/kernel/uapi/linux/audit.h
+++ b/libc/kernel/uapi/linux/audit.h
@@ -46,349 +46,363 @@
#define AUDIT_SET_FEATURE 1018
#define AUDIT_GET_FEATURE 1019
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define AUDIT_FEATURE_CHANGE 1020
#define AUDIT_FIRST_USER_MSG 1100
#define AUDIT_USER_AVC 1107
#define AUDIT_USER_TTY 1124
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_LAST_USER_MSG 1199
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_FIRST_USER_MSG2 2100
#define AUDIT_LAST_USER_MSG2 2999
#define AUDIT_DAEMON_START 1200
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_DAEMON_END 1201
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_DAEMON_ABORT 1202
#define AUDIT_DAEMON_CONFIG 1203
#define AUDIT_SYSCALL 1300
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_PATH 1302
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_IPC 1303
#define AUDIT_SOCKETCALL 1304
#define AUDIT_CONFIG_CHANGE 1305
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_SOCKADDR 1306
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_CWD 1307
#define AUDIT_EXECVE 1309
#define AUDIT_IPC_SET_PERM 1311
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_MQ_OPEN 1312
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_MQ_SENDRECV 1313
#define AUDIT_MQ_NOTIFY 1314
#define AUDIT_MQ_GETSETATTR 1315
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_KERNEL_OTHER 1316
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_FD_PAIR 1317
#define AUDIT_OBJ_PID 1318
#define AUDIT_TTY 1319
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_EOE 1320
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_BPRM_FCAPS 1321
#define AUDIT_CAPSET 1322
#define AUDIT_MMAP 1323
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_NETFILTER_PKT 1324
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_NETFILTER_CFG 1325
#define AUDIT_SECCOMP 1326
-#define AUDIT_AVC 1400
+#define AUDIT_PROCTITLE 1327
+#define AUDIT_FEATURE_CHANGE 1328
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_AVC 1400
#define AUDIT_SELINUX_ERR 1401
#define AUDIT_AVC_PATH 1402
#define AUDIT_MAC_POLICY_LOAD 1403
-#define AUDIT_MAC_STATUS 1404
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_MAC_STATUS 1404
#define AUDIT_MAC_CONFIG_CHANGE 1405
#define AUDIT_MAC_UNLBL_ALLOW 1406
#define AUDIT_MAC_CIPSOV4_ADD 1407
-#define AUDIT_MAC_CIPSOV4_DEL 1408
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_MAC_CIPSOV4_DEL 1408
#define AUDIT_MAC_MAP_ADD 1409
#define AUDIT_MAC_MAP_DEL 1410
#define AUDIT_MAC_IPSEC_ADDSA 1411
-#define AUDIT_MAC_IPSEC_DELSA 1412
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_MAC_IPSEC_DELSA 1412
#define AUDIT_MAC_IPSEC_ADDSPD 1413
#define AUDIT_MAC_IPSEC_DELSPD 1414
#define AUDIT_MAC_IPSEC_EVENT 1415
-#define AUDIT_MAC_UNLBL_STCADD 1416
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_MAC_UNLBL_STCADD 1416
#define AUDIT_MAC_UNLBL_STCDEL 1417
#define AUDIT_FIRST_KERN_ANOM_MSG 1700
#define AUDIT_LAST_KERN_ANOM_MSG 1799
-#define AUDIT_ANOM_PROMISCUOUS 1700
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_ANOM_PROMISCUOUS 1700
#define AUDIT_ANOM_ABEND 1701
#define AUDIT_ANOM_LINK 1702
#define AUDIT_INTEGRITY_DATA 1800
-#define AUDIT_INTEGRITY_METADATA 1801
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_INTEGRITY_METADATA 1801
#define AUDIT_INTEGRITY_STATUS 1802
#define AUDIT_INTEGRITY_HASH 1803
#define AUDIT_INTEGRITY_PCR 1804
-#define AUDIT_INTEGRITY_RULE 1805
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_INTEGRITY_RULE 1805
#define AUDIT_KERNEL 2000
#define AUDIT_FILTER_USER 0x00
#define AUDIT_FILTER_TASK 0x01
-#define AUDIT_FILTER_ENTRY 0x02
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_FILTER_ENTRY 0x02
#define AUDIT_FILTER_WATCH 0x03
#define AUDIT_FILTER_EXIT 0x04
#define AUDIT_FILTER_TYPE 0x05
-#define AUDIT_NR_FILTERS 6
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_NR_FILTERS 6
#define AUDIT_FILTER_PREPEND 0x10
#define AUDIT_NEVER 0
#define AUDIT_POSSIBLE 1
-#define AUDIT_ALWAYS 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_ALWAYS 2
#define AUDIT_MAX_FIELDS 64
#define AUDIT_MAX_KEY_LEN 256
#define AUDIT_BITMASK_SIZE 64
-#define AUDIT_WORD(nr) ((__u32)((nr)/32))
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_WORD(nr) ((__u32)((nr)/32))
#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32))
#define AUDIT_SYSCALL_CLASSES 16
#define AUDIT_CLASS_DIR_WRITE 0
-#define AUDIT_CLASS_DIR_WRITE_32 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_CLASS_DIR_WRITE_32 1
#define AUDIT_CLASS_CHATTR 2
#define AUDIT_CLASS_CHATTR_32 3
#define AUDIT_CLASS_READ 4
-#define AUDIT_CLASS_READ_32 5
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_CLASS_READ_32 5
#define AUDIT_CLASS_WRITE 6
#define AUDIT_CLASS_WRITE_32 7
#define AUDIT_CLASS_SIGNAL 8
-#define AUDIT_CLASS_SIGNAL_32 9
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_CLASS_SIGNAL_32 9
#define AUDIT_UNUSED_BITS 0x07FFFC00
#define AUDIT_COMPARE_UID_TO_OBJ_UID 1
#define AUDIT_COMPARE_GID_TO_OBJ_GID 2
-#define AUDIT_COMPARE_EUID_TO_OBJ_UID 3
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_COMPARE_EUID_TO_OBJ_UID 3
#define AUDIT_COMPARE_EGID_TO_OBJ_GID 4
#define AUDIT_COMPARE_AUID_TO_OBJ_UID 5
#define AUDIT_COMPARE_SUID_TO_OBJ_UID 6
-#define AUDIT_COMPARE_SGID_TO_OBJ_GID 7
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_COMPARE_SGID_TO_OBJ_GID 7
#define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8
#define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9
#define AUDIT_COMPARE_UID_TO_AUID 10
-#define AUDIT_COMPARE_UID_TO_EUID 11
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_COMPARE_UID_TO_EUID 11
#define AUDIT_COMPARE_UID_TO_FSUID 12
#define AUDIT_COMPARE_UID_TO_SUID 13
#define AUDIT_COMPARE_AUID_TO_FSUID 14
-#define AUDIT_COMPARE_AUID_TO_SUID 15
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_COMPARE_AUID_TO_SUID 15
#define AUDIT_COMPARE_AUID_TO_EUID 16
#define AUDIT_COMPARE_EUID_TO_SUID 17
#define AUDIT_COMPARE_EUID_TO_FSUID 18
-#define AUDIT_COMPARE_SUID_TO_FSUID 19
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_COMPARE_SUID_TO_FSUID 19
#define AUDIT_COMPARE_GID_TO_EGID 20
#define AUDIT_COMPARE_GID_TO_FSGID 21
#define AUDIT_COMPARE_GID_TO_SGID 22
-#define AUDIT_COMPARE_EGID_TO_FSGID 23
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_COMPARE_EGID_TO_FSGID 23
#define AUDIT_COMPARE_EGID_TO_SGID 24
#define AUDIT_COMPARE_SGID_TO_FSGID 25
#define AUDIT_MAX_FIELD_COMPARE AUDIT_COMPARE_SGID_TO_FSGID
-#define AUDIT_PID 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_PID 0
#define AUDIT_UID 1
#define AUDIT_EUID 2
#define AUDIT_SUID 3
-#define AUDIT_FSUID 4
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_FSUID 4
#define AUDIT_GID 5
#define AUDIT_EGID 6
#define AUDIT_SGID 7
-#define AUDIT_FSGID 8
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_FSGID 8
#define AUDIT_LOGINUID 9
#define AUDIT_PERS 10
#define AUDIT_ARCH 11
-#define AUDIT_MSGTYPE 12
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_MSGTYPE 12
#define AUDIT_SUBJ_USER 13
#define AUDIT_SUBJ_ROLE 14
#define AUDIT_SUBJ_TYPE 15
-#define AUDIT_SUBJ_SEN 16
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_SUBJ_SEN 16
#define AUDIT_SUBJ_CLR 17
#define AUDIT_PPID 18
#define AUDIT_OBJ_USER 19
-#define AUDIT_OBJ_ROLE 20
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_OBJ_ROLE 20
#define AUDIT_OBJ_TYPE 21
#define AUDIT_OBJ_LEV_LOW 22
#define AUDIT_OBJ_LEV_HIGH 23
-#define AUDIT_LOGINUID_SET 24
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_LOGINUID_SET 24
#define AUDIT_DEVMAJOR 100
#define AUDIT_DEVMINOR 101
#define AUDIT_INODE 102
-#define AUDIT_EXIT 103
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_EXIT 103
#define AUDIT_SUCCESS 104
#define AUDIT_WATCH 105
#define AUDIT_PERM 106
-#define AUDIT_DIR 107
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_DIR 107
#define AUDIT_FILETYPE 108
#define AUDIT_OBJ_UID 109
#define AUDIT_OBJ_GID 110
-#define AUDIT_FIELD_COMPARE 111
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_FIELD_COMPARE 111
#define AUDIT_ARG0 200
#define AUDIT_ARG1 (AUDIT_ARG0+1)
#define AUDIT_ARG2 (AUDIT_ARG0+2)
-#define AUDIT_ARG3 (AUDIT_ARG0+3)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_ARG3 (AUDIT_ARG0+3)
#define AUDIT_FILTERKEY 210
#define AUDIT_NEGATE 0x80000000
#define AUDIT_BIT_MASK 0x08000000
-#define AUDIT_LESS_THAN 0x10000000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_LESS_THAN 0x10000000
#define AUDIT_GREATER_THAN 0x20000000
#define AUDIT_NOT_EQUAL 0x30000000
#define AUDIT_EQUAL 0x40000000
-#define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL)
#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL)
#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL)
#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
-enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
Audit_equal,
Audit_not_equal,
Audit_bitmask,
- Audit_bittest,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ Audit_bittest,
Audit_lt,
Audit_gt,
Audit_le,
- Audit_ge,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ Audit_ge,
Audit_bad
};
#define AUDIT_STATUS_ENABLED 0x0001
-#define AUDIT_STATUS_FAILURE 0x0002
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_STATUS_FAILURE 0x0002
#define AUDIT_STATUS_PID 0x0004
#define AUDIT_STATUS_RATE_LIMIT 0x0008
#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010
-#define AUDIT_STATUS_BACKLOG_WAIT_TIME 0x0020
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_STATUS_BACKLOG_WAIT_TIME 0x0020
#define AUDIT_VERSION_BACKLOG_LIMIT 1
#define AUDIT_VERSION_BACKLOG_WAIT_TIME 2
#define AUDIT_VERSION_LATEST AUDIT_VERSION_BACKLOG_WAIT_TIME
-#define AUDIT_FAIL_SILENT 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_FAIL_SILENT 0
#define AUDIT_FAIL_PRINTK 1
#define AUDIT_FAIL_PANIC 2
+#define __AUDIT_ARCH_CONVENTION_MASK 0x30000000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __AUDIT_ARCH_CONVENTION_MIPS64_N32 0x20000000
#define __AUDIT_ARCH_64BIT 0x80000000
#define __AUDIT_ARCH_LE 0x40000000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
#define AUDIT_ARCH_ARMEB (EM_ARM)
#define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_ARCH_FRV (EM_FRV)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
#define AUDIT_ARCH_M32R (EM_M32R)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_ARCH_M68K (EM_68K)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_ARCH_MIPS (EM_MIPS)
#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT| __AUDIT_ARCH_CONVENTION_MIPS64_N32)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE| __AUDIT_ARCH_CONVENTION_MIPS64_N32)
#define AUDIT_ARCH_OPENRISC (EM_OPENRISC)
#define AUDIT_ARCH_PARISC (EM_PARISC)
-#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
#define AUDIT_ARCH_PPC (EM_PPC)
#define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
#define AUDIT_ARCH_S390 (EM_S390)
-#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
#define AUDIT_ARCH_SH (EM_SH)
#define AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE)
#define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT)
-#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
#define AUDIT_ARCH_SPARC (EM_SPARC)
#define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT)
#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
-#define AUDIT_PERM_EXEC 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_PERM_EXEC 1
#define AUDIT_PERM_WRITE 2
#define AUDIT_PERM_READ 4
#define AUDIT_PERM_ATTR 8
-#define AUDIT_MESSAGE_TEXT_MAX 8560
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define AUDIT_MESSAGE_TEXT_MAX 8560
+enum audit_nlgrps {
+ AUDIT_NLGRP_NONE,
+ AUDIT_NLGRP_READLOG,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __AUDIT_NLGRP_MAX
+};
+#define AUDIT_NLGRP_MAX (__AUDIT_NLGRP_MAX - 1)
struct audit_status {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 mask;
__u32 enabled;
__u32 failure;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 rate_limit;
__u32 backlog_limit;
__u32 lost;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 backlog;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 version;
__u32 backlog_wait_time;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct audit_features {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_FEATURE_VERSION 1
__u32 vers;
__u32 mask;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 features;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 lock;
};
#define AUDIT_FEATURE_ONLY_UNSET_LOGINUID 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_FEATURE_LOGINUID_IMMUTABLE 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_LAST_FEATURE AUDIT_FEATURE_LOGINUID_IMMUTABLE
#define audit_feature_valid(x) ((x) >= 0 && (x) <= AUDIT_LAST_FEATURE)
#define AUDIT_FEATURE_TO_MASK(x) (1 << ((x) & 31))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct audit_tty_status {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 enabled;
__u32 log_passwd;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AUDIT_UID_UNSET (unsigned int)-1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct audit_rule_data {
__u32 flags;
__u32 action;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 field_count;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 mask[AUDIT_BITMASK_SIZE];
__u32 fields[AUDIT_MAX_FIELDS];
__u32 values[AUDIT_MAX_FIELDS];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 fieldflags[AUDIT_MAX_FIELDS];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 buflen;
char buf[0];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct audit_rule {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u32 action;
__u32 field_count;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 mask[AUDIT_BITMASK_SIZE];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 fields[AUDIT_MAX_FIELDS];
__u32 values[AUDIT_MAX_FIELDS];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/binder.h b/libc/kernel/uapi/linux/binder.h
index 02101ab..7a5cee5 100644
--- a/libc/kernel/uapi/linux/binder.h
+++ b/libc/kernel/uapi/linux/binder.h
@@ -182,9 +182,12 @@
BC_ENTER_LOOPER = _IO('c', 12),
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
BC_EXIT_LOOPER = _IO('c', 13),
- BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14, struct binder_handle_cookie),
- BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15, struct binder_handle_cookie),
- BC_DEAD_BINDER_DONE = _IOW('c', 16, binder_uintptr_t),
+ BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14,
+ struct binder_handle_cookie),
+ BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct binder_handle_cookie),
+ BC_DEAD_BINDER_DONE = _IOW('c', 16, binder_uintptr_t),
};
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/btrfs.h b/libc/kernel/uapi/linux/btrfs.h
index 11f950f..db4ef2a 100644
--- a/libc/kernel/uapi/linux/btrfs.h
+++ b/libc/kernel/uapi/linux/btrfs.h
@@ -37,408 +37,423 @@
#define BTRFS_FSID_SIZE 16
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_UUID_SIZE 16
+#define BTRFS_UUID_UNPARSED_SIZE 37
#define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
struct btrfs_qgroup_limit {
- __u64 flags;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 flags;
__u64 max_rfer;
__u64 max_excl;
__u64 rsv_rfer;
- __u64 rsv_excl;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 rsv_excl;
};
struct btrfs_qgroup_inherit {
__u64 flags;
- __u64 num_qgroups;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 num_qgroups;
__u64 num_ref_copies;
__u64 num_excl_copies;
struct btrfs_qgroup_limit lim;
- __u64 qgroups[0];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 qgroups[0];
};
struct btrfs_ioctl_qgroup_limit_args {
__u64 qgroupid;
- struct btrfs_qgroup_limit lim;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct btrfs_qgroup_limit lim;
};
#define BTRFS_SUBVOL_NAME_MAX 4039
struct btrfs_ioctl_vol_args_v2 {
- __s64 fd;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __s64 fd;
__u64 transid;
__u64 flags;
union {
- struct {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct {
__u64 size;
struct btrfs_qgroup_inherit __user *qgroup_inherit;
};
- __u64 unused[4];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 unused[4];
};
char name[BTRFS_SUBVOL_NAME_MAX + 1];
};
-struct btrfs_scrub_progress {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct btrfs_scrub_progress {
__u64 data_extents_scrubbed;
__u64 tree_extents_scrubbed;
__u64 data_bytes_scrubbed;
- __u64 tree_bytes_scrubbed;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 tree_bytes_scrubbed;
__u64 read_errors;
__u64 csum_errors;
__u64 verify_errors;
- __u64 no_csum;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 no_csum;
__u64 csum_discards;
__u64 super_errors;
__u64 malloc_errors;
- __u64 uncorrectable_errors;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 uncorrectable_errors;
__u64 corrected_errors;
__u64 last_physical;
__u64 unverified_errors;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define BTRFS_SCRUB_READONLY 1
struct btrfs_ioctl_scrub_args {
__u64 devid;
- __u64 start;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 start;
__u64 end;
__u64 flags;
struct btrfs_scrub_progress progress;
- __u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8];
};
#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
-struct btrfs_ioctl_dev_replace_start_params {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct btrfs_ioctl_dev_replace_start_params {
__u64 srcdevid;
__u64 cont_reading_from_srcdev_mode;
__u8 srcdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1];
- __u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1];
};
#define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0
#define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1
-#define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
#define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3
#define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4
struct btrfs_ioctl_dev_replace_status_params {
- __u64 replace_state;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 replace_state;
__u64 progress_1000;
__u64 time_started;
__u64 time_stopped;
- __u64 num_write_errors;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 num_write_errors;
__u64 num_uncorrectable_read_errors;
};
#define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
-#define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
#define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
-#define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
struct btrfs_ioctl_dev_replace_args {
__u64 cmd;
__u64 result;
- union {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ union {
struct btrfs_ioctl_dev_replace_start_params start;
struct btrfs_ioctl_dev_replace_status_params status;
};
- __u64 spare[64];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 spare[64];
};
struct btrfs_ioctl_dev_info_args {
__u64 devid;
- __u8 uuid[BTRFS_UUID_SIZE];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 uuid[BTRFS_UUID_SIZE];
__u64 bytes_used;
__u64 total_bytes;
__u64 unused[379];
- __u8 path[BTRFS_DEVICE_PATH_NAME_MAX];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 path[BTRFS_DEVICE_PATH_NAME_MAX];
};
struct btrfs_ioctl_fs_info_args {
__u64 max_id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 num_devices;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 fsid[BTRFS_FSID_SIZE];
- __u64 reserved[124];
-};
-struct btrfs_ioctl_feature_flags {
+ __u32 nodesize;
+ __u32 sectorsize;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 clone_alignment;
+ __u32 reserved32;
+ __u64 reserved[122];
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct btrfs_ioctl_feature_flags {
__u64 compat_flags;
__u64 compat_ro_flags;
__u64 incompat_flags;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define BTRFS_BALANCE_CTL_PAUSE 1
#define BTRFS_BALANCE_CTL_CANCEL 2
struct btrfs_balance_args {
- __u64 profiles;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 profiles;
__u64 usage;
__u64 devid;
__u64 pstart;
- __u64 pend;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 pend;
__u64 vstart;
__u64 vend;
__u64 target;
- __u64 flags;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u64 unused[8];
+ __u64 flags;
+ __u64 limit;
+ __u64 unused[7];
} __attribute__ ((__packed__));
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_balance_progress {
__u64 expected;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 considered;
__u64 completed;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
#define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_balance_args {
__u64 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 state;
struct btrfs_balance_args data;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_balance_args meta;
struct btrfs_balance_args sys;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_balance_progress stat;
__u64 unused[72];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define BTRFS_INO_LOOKUP_PATH_MAX 4080
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_ino_lookup_args {
__u64 treeid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 objectid;
char name[BTRFS_INO_LOOKUP_PATH_MAX];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct btrfs_ioctl_search_key {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 tree_id;
__u64 min_objectid;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 max_objectid;
__u64 min_offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 max_offset;
__u64 min_transid;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 max_transid;
__u32 min_type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 max_type;
__u32 nr_items;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 unused;
__u64 unused1;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 unused2;
__u64 unused3;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 unused4;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_search_header {
__u64 transid;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 objectid;
__u64 offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
__u32 len;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_search_args {
struct btrfs_ioctl_search_key key;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct btrfs_ioctl_search_args_v2 {
+ struct btrfs_ioctl_search_key key;
+ __u64 buf_size;
+ __u64 buf[0];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct btrfs_ioctl_clone_range_args {
__s64 src_fd;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 src_offset, src_length;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 dest_offset;
};
#define BTRFS_DEFRAG_RANGE_COMPRESS 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_DEFRAG_RANGE_START_IO 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_SAME_DATA_DIFFERS 1
struct btrfs_ioctl_same_extent_info {
__s64 fd;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 logical_offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 bytes_deduped;
__s32 status;
__u32 reserved;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_same_args {
__u64 logical_offset;
__u64 length;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 dest_count;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 reserved1;
__u32 reserved2;
struct btrfs_ioctl_same_extent_info info[0];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_space_info {
__u64 flags;
__u64 total_bytes;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 used_bytes;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct btrfs_ioctl_space_args {
__u64 space_slots;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 total_spaces;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_space_info spaces[0];
};
struct btrfs_data_container {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 bytes_left;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 bytes_missing;
__u32 elem_cnt;
__u32 elem_missed;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 val[0];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct btrfs_ioctl_ino_path_args {
__u64 inum;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 reserved[4];
__u64 fspath;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_logical_ino_args {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 logical;
__u64 size;
__u64 reserved[4];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 inodes;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum btrfs_dev_stat_values {
BTRFS_DEV_STAT_WRITE_ERRS,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
BTRFS_DEV_STAT_READ_ERRS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
BTRFS_DEV_STAT_FLUSH_ERRS,
BTRFS_DEV_STAT_CORRUPTION_ERRS,
BTRFS_DEV_STAT_GENERATION_ERRS,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
BTRFS_DEV_STAT_VALUES_MAX
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define BTRFS_DEV_STATS_RESET (1ULL << 0)
struct btrfs_ioctl_get_dev_stats {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 devid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 nr_items;
__u64 flags;
__u64 values[BTRFS_DEV_STAT_VALUES_MAX];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define BTRFS_QUOTA_CTL_ENABLE 1
#define BTRFS_QUOTA_CTL_DISABLE 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_QUOTA_CTL_RESCAN__NOTUSED 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_quota_ctl_args {
__u64 cmd;
__u64 status;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_quota_rescan_args {
__u64 flags;
__u64 progress;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 reserved[6];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct btrfs_ioctl_qgroup_assign_args {
__u64 assign;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 src;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 dst;
};
struct btrfs_ioctl_qgroup_create_args {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 create;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 qgroupid;
};
struct btrfs_ioctl_timespec {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 sec;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 nsec;
};
struct btrfs_ioctl_received_subvol_args {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char uuid[BTRFS_UUID_SIZE];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 stransid;
__u64 rtransid;
struct btrfs_ioctl_timespec stime;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_timespec rtime;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 flags;
__u64 reserved[16];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_SEND_FLAG_OMIT_STREAM_HEADER 0x2
#define BTRFS_SEND_FLAG_OMIT_END_CMD 0x4
#define BTRFS_SEND_FLAG_MASK (BTRFS_SEND_FLAG_NO_FILE_DATA | BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | BTRFS_SEND_FLAG_OMIT_END_CMD)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct btrfs_ioctl_send_args {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s64 send_fd;
__u64 clone_sources_count;
__u64 __user *clone_sources;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 parent_root;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 flags;
__u64 reserved[4];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum btrfs_err_code {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
notused,
BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET,
BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET,
BTRFS_ERROR_DEV_TGT_REPLACE,
BTRFS_ERROR_DEV_MISSING_NOT_FOUND,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
BTRFS_ERROR_DEV_ONLY_WRITABLE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
};
#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, struct btrfs_ioctl_vol_args)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, struct btrfs_ioctl_vol_args)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_IOC_RESIZE _IOW(BTRFS_IOCTL_MAGIC, 3, struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8)
#define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int)
#define BTRFS_IOC_ADD_DEV _IOW(BTRFS_IOCTL_MAGIC, 10, struct btrfs_ioctl_vol_args)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_IOC_RM_DEV _IOW(BTRFS_IOCTL_MAGIC, 11, struct btrfs_ioctl_vol_args)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, struct btrfs_ioctl_clone_range_args)
#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, struct btrfs_ioctl_vol_args)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, struct btrfs_ioctl_vol_args)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_IOC_DEFRAG_RANGE _IOW(BTRFS_IOCTL_MAGIC, 16, struct btrfs_ioctl_defrag_range_args)
#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args)
+#define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args_v2)
#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, struct btrfs_ioctl_ino_lookup_args)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
diff --git a/libc/kernel/uapi/linux/can.h b/libc/kernel/uapi/linux/can.h
index 9549bbf..df7715b 100644
--- a/libc/kernel/uapi/linux/can.h
+++ b/libc/kernel/uapi/linux/can.h
@@ -16,8 +16,8 @@
***
****************************************************************************
****************************************************************************/
-#ifndef CAN_H
-#define CAN_H
+#ifndef _UAPI_CAN_H
+#define _UAPI_CAN_H
#include <linux/types.h>
#include <linux/socket.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/can/bcm.h b/libc/kernel/uapi/linux/can/bcm.h
index fca1232..72c36bf 100644
--- a/libc/kernel/uapi/linux/can/bcm.h
+++ b/libc/kernel/uapi/linux/can/bcm.h
@@ -16,8 +16,8 @@
***
****************************************************************************
****************************************************************************/
-#ifndef CAN_BCM_H
-#define CAN_BCM_H
+#ifndef _UAPI_CAN_BCM_H
+#define _UAPI_CAN_BCM_H
#include <linux/types.h>
#include <linux/can.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/can/error.h b/libc/kernel/uapi/linux/can/error.h
index 2436ace..46af758 100644
--- a/libc/kernel/uapi/linux/can/error.h
+++ b/libc/kernel/uapi/linux/can/error.h
@@ -16,8 +16,8 @@
***
****************************************************************************
****************************************************************************/
-#ifndef CAN_ERROR_H
-#define CAN_ERROR_H
+#ifndef _UAPI_CAN_ERROR_H
+#define _UAPI_CAN_ERROR_H
#define CAN_ERR_DLC 8
#define CAN_ERR_TX_TIMEOUT 0x00000001U
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/can/gw.h b/libc/kernel/uapi/linux/can/gw.h
index dd80d48..cafc1ec 100644
--- a/libc/kernel/uapi/linux/can/gw.h
+++ b/libc/kernel/uapi/linux/can/gw.h
@@ -16,8 +16,8 @@
***
****************************************************************************
****************************************************************************/
-#ifndef CAN_GW_H
-#define CAN_GW_H
+#ifndef _UAPI_CAN_GW_H
+#define _UAPI_CAN_GW_H
#include <linux/types.h>
#include <linux/can.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/can/netlink.h b/libc/kernel/uapi/linux/can/netlink.h
index df8a19c..655aaa1 100644
--- a/libc/kernel/uapi/linux/can/netlink.h
+++ b/libc/kernel/uapi/linux/can/netlink.h
@@ -16,8 +16,8 @@
***
****************************************************************************
****************************************************************************/
-#ifndef CAN_NETLINK_H
-#define CAN_NETLINK_H
+#ifndef _UAPI_CAN_NETLINK_H
+#define _UAPI_CAN_NETLINK_H
#include <linux/types.h>
struct can_bittiming {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -77,30 +77,34 @@
#define CAN_CTRLMODE_ONE_SHOT 0x08
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define CAN_CTRLMODE_BERR_REPORTING 0x10
+#define CAN_CTRLMODE_FD 0x20
struct can_device_stats {
__u32 bus_error;
- __u32 error_warning;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 error_warning;
__u32 error_passive;
__u32 bus_off;
__u32 arbitration_lost;
- __u32 restarts;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 restarts;
};
enum {
IFLA_CAN_UNSPEC,
- IFLA_CAN_BITTIMING,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_CAN_BITTIMING,
IFLA_CAN_BITTIMING_CONST,
IFLA_CAN_CLOCK,
IFLA_CAN_STATE,
- IFLA_CAN_CTRLMODE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_CAN_CTRLMODE,
IFLA_CAN_RESTART_MS,
IFLA_CAN_RESTART,
IFLA_CAN_BERR_COUNTER,
- __IFLA_CAN_MAX
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_CAN_DATA_BITTIMING,
+ IFLA_CAN_DATA_BITTIMING_CONST,
+ __IFLA_CAN_MAX
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
#endif
diff --git a/libc/kernel/uapi/linux/can/raw.h b/libc/kernel/uapi/linux/can/raw.h
index 9d40c90..77cce9b 100644
--- a/libc/kernel/uapi/linux/can/raw.h
+++ b/libc/kernel/uapi/linux/can/raw.h
@@ -16,8 +16,8 @@
***
****************************************************************************
****************************************************************************/
-#ifndef CAN_RAW_H
-#define CAN_RAW_H
+#ifndef _UAPI_CAN_RAW_H
+#define _UAPI_CAN_RAW_H
#include <linux/can.h>
#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/capability.h b/libc/kernel/uapi/linux/capability.h
index c0ab4d9..e013040 100644
--- a/libc/kernel/uapi/linux/capability.h
+++ b/libc/kernel/uapi/linux/capability.h
@@ -113,9 +113,11 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define CAP_WAKE_ALARM 35
#define CAP_BLOCK_SUSPEND 36
-#define CAP_LAST_CAP CAP_BLOCK_SUSPEND
-#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
+#define CAP_AUDIT_READ 37
+#define CAP_LAST_CAP CAP_AUDIT_READ
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
#define CAP_TO_INDEX(x) ((x) >> 5)
#define CAP_TO_MASK(x) (1 << ((x) & 31))
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/ethtool.h b/libc/kernel/uapi/linux/ethtool.h
index b6f1327..b808f0d 100644
--- a/libc/kernel/uapi/linux/ethtool.h
+++ b/libc/kernel/uapi/linux/ethtool.h
@@ -323,48 +323,58 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 ring_index[0];
};
-struct ethtool_rx_ntuple_flow_spec {
- __u32 flow_type;
+struct ethtool_rxfh {
+ __u32 cmd;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 rss_context;
+ __u32 indir_size;
+ __u32 key_size;
+ __u32 rsvd[2];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 rss_config[0];
+};
+#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
+struct ethtool_rx_ntuple_flow_spec {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 flow_type;
union {
struct ethtool_tcpip4_spec tcp_ip4_spec;
struct ethtool_tcpip4_spec udp_ip4_spec;
- struct ethtool_tcpip4_spec sctp_ip4_spec;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct ethtool_tcpip4_spec sctp_ip4_spec;
struct ethtool_ah_espip4_spec ah_ip4_spec;
struct ethtool_ah_espip4_spec esp_ip4_spec;
struct ethtool_usrip4_spec usr_ip4_spec;
- struct ethhdr ether_spec;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct ethhdr ether_spec;
__u8 hdata[72];
} h_u, m_u;
__u16 vlan_tag;
- __u16 vlan_tag_mask;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 vlan_tag_mask;
__u64 data;
__u64 data_mask;
__s32 action;
-#define ETHTOOL_RXNTUPLE_ACTION_DROP (-1)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_RXNTUPLE_ACTION_DROP (-1)
#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2)
};
struct ethtool_rx_ntuple {
- __u32 cmd;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 cmd;
struct ethtool_rx_ntuple_flow_spec fs;
};
#define ETHTOOL_FLASH_MAX_FILENAME 128
-enum ethtool_flash_op_type {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum ethtool_flash_op_type {
ETHTOOL_FLASH_ALL_REGIONS = 0,
};
struct ethtool_flash {
- __u32 cmd;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 cmd;
__u32 region;
char data[ETHTOOL_FLASH_MAX_FILENAME];
};
-#define ETH_FW_DUMP_DISABLE 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ethtool_dump {
__u32 cmd;
@@ -374,310 +384,313 @@
__u32 len;
__u8 data[0];
};
-struct ethtool_get_features_block {
+#define ETH_FW_DUMP_DISABLE 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct ethtool_get_features_block {
__u32 available;
__u32 requested;
__u32 active;
- __u32 never_changed;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 never_changed;
};
struct ethtool_gfeatures {
__u32 cmd;
- __u32 size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 size;
struct ethtool_get_features_block features[0];
};
struct ethtool_set_features_block {
- __u32 valid;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 valid;
__u32 requested;
};
struct ethtool_sfeatures {
- __u32 cmd;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 cmd;
__u32 size;
struct ethtool_set_features_block features[0];
};
-struct ethtool_ts_info {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct ethtool_ts_info {
__u32 cmd;
__u32 so_timestamping;
__s32 phc_index;
- __u32 tx_types;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 tx_types;
__u32 tx_reserved[3];
__u32 rx_filters;
__u32 rx_reserved[3];
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
enum ethtool_sfeatures_retval_bits {
ETHTOOL_F_UNSUPPORTED__BIT,
ETHTOOL_F_WISH__BIT,
- ETHTOOL_F_COMPAT__BIT,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ ETHTOOL_F_COMPAT__BIT,
};
#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
-#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
#define ETHTOOL_GSET 0x00000001
#define ETHTOOL_SSET 0x00000002
#define ETHTOOL_GDRVINFO 0x00000003
-#define ETHTOOL_GREGS 0x00000004
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_GREGS 0x00000004
#define ETHTOOL_GWOL 0x00000005
#define ETHTOOL_SWOL 0x00000006
#define ETHTOOL_GMSGLVL 0x00000007
-#define ETHTOOL_SMSGLVL 0x00000008
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SMSGLVL 0x00000008
#define ETHTOOL_NWAY_RST 0x00000009
#define ETHTOOL_GLINK 0x0000000a
#define ETHTOOL_GEEPROM 0x0000000b
-#define ETHTOOL_SEEPROM 0x0000000c
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SEEPROM 0x0000000c
#define ETHTOOL_GCOALESCE 0x0000000e
#define ETHTOOL_SCOALESCE 0x0000000f
#define ETHTOOL_GRINGPARAM 0x00000010
-#define ETHTOOL_SRINGPARAM 0x00000011
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SRINGPARAM 0x00000011
#define ETHTOOL_GPAUSEPARAM 0x00000012
#define ETHTOOL_SPAUSEPARAM 0x00000013
#define ETHTOOL_GRXCSUM 0x00000014
-#define ETHTOOL_SRXCSUM 0x00000015
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SRXCSUM 0x00000015
#define ETHTOOL_GTXCSUM 0x00000016
#define ETHTOOL_STXCSUM 0x00000017
#define ETHTOOL_GSG 0x00000018
-#define ETHTOOL_SSG 0x00000019
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SSG 0x00000019
#define ETHTOOL_TEST 0x0000001a
#define ETHTOOL_GSTRINGS 0x0000001b
#define ETHTOOL_PHYS_ID 0x0000001c
-#define ETHTOOL_GSTATS 0x0000001d
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_GSTATS 0x0000001d
#define ETHTOOL_GTSO 0x0000001e
#define ETHTOOL_STSO 0x0000001f
#define ETHTOOL_GPERMADDR 0x00000020
-#define ETHTOOL_GUFO 0x00000021
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_GUFO 0x00000021
#define ETHTOOL_SUFO 0x00000022
#define ETHTOOL_GGSO 0x00000023
#define ETHTOOL_SGSO 0x00000024
-#define ETHTOOL_GFLAGS 0x00000025
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_GFLAGS 0x00000025
#define ETHTOOL_SFLAGS 0x00000026
#define ETHTOOL_GPFLAGS 0x00000027
#define ETHTOOL_SPFLAGS 0x00000028
-#define ETHTOOL_GRXFH 0x00000029
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_GRXFH 0x00000029
#define ETHTOOL_SRXFH 0x0000002a
#define ETHTOOL_GGRO 0x0000002b
#define ETHTOOL_SGRO 0x0000002c
-#define ETHTOOL_GRXRINGS 0x0000002d
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_GRXRINGS 0x0000002d
#define ETHTOOL_GRXCLSRLCNT 0x0000002e
#define ETHTOOL_GRXCLSRULE 0x0000002f
#define ETHTOOL_GRXCLSRLALL 0x00000030
-#define ETHTOOL_SRXCLSRLDEL 0x00000031
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SRXCLSRLDEL 0x00000031
#define ETHTOOL_SRXCLSRLINS 0x00000032
#define ETHTOOL_FLASHDEV 0x00000033
#define ETHTOOL_RESET 0x00000034
-#define ETHTOOL_SRXNTUPLE 0x00000035
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SRXNTUPLE 0x00000035
#define ETHTOOL_GRXNTUPLE 0x00000036
#define ETHTOOL_GSSET_INFO 0x00000037
#define ETHTOOL_GRXFHINDIR 0x00000038
-#define ETHTOOL_SRXFHINDIR 0x00000039
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SRXFHINDIR 0x00000039
#define ETHTOOL_GFEATURES 0x0000003a
#define ETHTOOL_SFEATURES 0x0000003b
#define ETHTOOL_GCHANNELS 0x0000003c
-#define ETHTOOL_SCHANNELS 0x0000003d
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SCHANNELS 0x0000003d
#define ETHTOOL_SET_DUMP 0x0000003e
#define ETHTOOL_GET_DUMP_FLAG 0x0000003f
#define ETHTOOL_GET_DUMP_DATA 0x00000040
-#define ETHTOOL_GET_TS_INFO 0x00000041
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_GET_TS_INFO 0x00000041
#define ETHTOOL_GMODULEINFO 0x00000042
#define ETHTOOL_GMODULEEEPROM 0x00000043
#define ETHTOOL_GEEE 0x00000044
-#define ETHTOOL_SEEE 0x00000045
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETHTOOL_SEEE 0x00000045
+#define ETHTOOL_GRSSH 0x00000046
+#define ETHTOOL_SRSSH 0x00000047
#define SPARC_ETH_GSET ETHTOOL_GSET
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPARC_ETH_SSET ETHTOOL_SSET
#define SUPPORTED_10baseT_Half (1 << 0)
#define SUPPORTED_10baseT_Full (1 << 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_100baseT_Half (1 << 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_100baseT_Full (1 << 3)
#define SUPPORTED_1000baseT_Half (1 << 4)
#define SUPPORTED_1000baseT_Full (1 << 5)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_Autoneg (1 << 6)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_TP (1 << 7)
#define SUPPORTED_AUI (1 << 8)
#define SUPPORTED_MII (1 << 9)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_FIBRE (1 << 10)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_BNC (1 << 11)
#define SUPPORTED_10000baseT_Full (1 << 12)
#define SUPPORTED_Pause (1 << 13)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_Asym_Pause (1 << 14)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_2500baseX_Full (1 << 15)
#define SUPPORTED_Backplane (1 << 16)
#define SUPPORTED_1000baseKX_Full (1 << 17)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_10000baseKX4_Full (1 << 18)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_10000baseKR_Full (1 << 19)
#define SUPPORTED_10000baseR_FEC (1 << 20)
#define SUPPORTED_20000baseMLD2_Full (1 << 21)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_20000baseKR2_Full (1 << 22)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_40000baseKR4_Full (1 << 23)
#define SUPPORTED_40000baseCR4_Full (1 << 24)
#define SUPPORTED_40000baseSR4_Full (1 << 25)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SUPPORTED_40000baseLR4_Full (1 << 26)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_10baseT_Half (1 << 0)
#define ADVERTISED_10baseT_Full (1 << 1)
#define ADVERTISED_100baseT_Half (1 << 2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_100baseT_Full (1 << 3)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_1000baseT_Half (1 << 4)
#define ADVERTISED_1000baseT_Full (1 << 5)
#define ADVERTISED_Autoneg (1 << 6)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_TP (1 << 7)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_AUI (1 << 8)
#define ADVERTISED_MII (1 << 9)
#define ADVERTISED_FIBRE (1 << 10)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_BNC (1 << 11)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_10000baseT_Full (1 << 12)
#define ADVERTISED_Pause (1 << 13)
#define ADVERTISED_Asym_Pause (1 << 14)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_2500baseX_Full (1 << 15)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_Backplane (1 << 16)
#define ADVERTISED_1000baseKX_Full (1 << 17)
#define ADVERTISED_10000baseKX4_Full (1 << 18)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_10000baseKR_Full (1 << 19)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_10000baseR_FEC (1 << 20)
#define ADVERTISED_20000baseMLD2_Full (1 << 21)
#define ADVERTISED_20000baseKR2_Full (1 << 22)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_40000baseKR4_Full (1 << 23)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ADVERTISED_40000baseCR4_Full (1 << 24)
#define ADVERTISED_40000baseSR4_Full (1 << 25)
#define ADVERTISED_40000baseLR4_Full (1 << 26)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPEED_10 10
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPEED_100 100
#define SPEED_1000 1000
#define SPEED_2500 2500
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPEED_10000 10000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPEED_UNKNOWN -1
#define DUPLEX_HALF 0x00
#define DUPLEX_FULL 0x01
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define DUPLEX_UNKNOWN 0xff
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PORT_TP 0x00
#define PORT_AUI 0x01
#define PORT_MII 0x02
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PORT_FIBRE 0x03
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PORT_BNC 0x04
#define PORT_DA 0x05
#define PORT_NONE 0xef
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PORT_OTHER 0xff
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XCVR_INTERNAL 0x00
#define XCVR_EXTERNAL 0x01
#define XCVR_DUMMY1 0x02
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XCVR_DUMMY2 0x03
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XCVR_DUMMY3 0x04
#define AUTONEG_DISABLE 0x00
#define AUTONEG_ENABLE 0x01
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_TP_MDI_INVALID 0x00
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_TP_MDI 0x01
#define ETH_TP_MDI_X 0x02
#define ETH_TP_MDI_AUTO 0x03
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define WAKE_PHY (1 << 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define WAKE_UCAST (1 << 1)
#define WAKE_MCAST (1 << 2)
#define WAKE_BCAST (1 << 3)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define WAKE_ARP (1 << 4)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define WAKE_MAGIC (1 << 5)
#define WAKE_MAGICSECURE (1 << 6)
#define TCP_V4_FLOW 0x01
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define UDP_V4_FLOW 0x02
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SCTP_V4_FLOW 0x03
#define AH_ESP_V4_FLOW 0x04
#define TCP_V6_FLOW 0x05
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define UDP_V6_FLOW 0x06
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SCTP_V6_FLOW 0x07
#define AH_ESP_V6_FLOW 0x08
#define AH_V4_FLOW 0x09
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ESP_V4_FLOW 0x0a
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AH_V6_FLOW 0x0b
#define ESP_V6_FLOW 0x0c
#define IP_USER_FLOW 0x0d
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IPV4_FLOW 0x10
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IPV6_FLOW 0x11
#define ETHER_FLOW 0x12
#define FLOW_EXT 0x80000000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FLOW_MAC_EXT 0x40000000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RXH_L2DA (1 << 1)
#define RXH_VLAN (1 << 2)
#define RXH_L3_PROTO (1 << 3)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RXH_IP_SRC (1 << 4)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RXH_IP_DST (1 << 5)
#define RXH_L4_B_0_1 (1 << 6)
#define RXH_L4_B_2_3 (1 << 7)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RXH_DISCARD (1 << 31)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
#define RX_CLS_LOC_SPECIAL 0x80000000
#define RX_CLS_LOC_ANY 0xffffffff
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RX_CLS_LOC_FIRST 0xfffffffe
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define RX_CLS_LOC_LAST 0xfffffffd
#define ETH_MODULE_SFF_8079 0x1
#define ETH_MODULE_SFF_8079_LEN 256
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_MODULE_SFF_8472 0x2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_MODULE_SFF_8472_LEN 512
enum ethtool_reset_flags {
ETH_RESET_MGMT = 1 << 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
ETH_RESET_IRQ = 1 << 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
ETH_RESET_DMA = 1 << 2,
ETH_RESET_FILTER = 1 << 3,
ETH_RESET_OFFLOAD = 1 << 4,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
ETH_RESET_MAC = 1 << 5,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
ETH_RESET_PHY = 1 << 6,
ETH_RESET_RAM = 1 << 7,
ETH_RESET_DEDICATED = 0x0000ffff,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
ETH_RESET_ALL = 0xffffffff,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define ETH_RESET_SHARED_SHIFT 16
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/falloc.h b/libc/kernel/uapi/linux/falloc.h
index 80a4c29..9ea0b24 100644
--- a/libc/kernel/uapi/linux/falloc.h
+++ b/libc/kernel/uapi/linux/falloc.h
@@ -22,4 +22,7 @@
#define FALLOC_FL_PUNCH_HOLE 0x02
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FALLOC_FL_NO_HIDE_STALE 0x04
+#define FALLOC_FL_COLLAPSE_RANGE 0x08
+#define FALLOC_FL_ZERO_RANGE 0x10
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/filter.h b/libc/kernel/uapi/linux/filter.h
index 8b75270..b90474e 100644
--- a/libc/kernel/uapi/linux/filter.h
+++ b/libc/kernel/uapi/linux/filter.h
@@ -123,8 +123,9 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SKF_AD_VLAN_TAG_PRESENT 48
#define SKF_AD_PAY_OFFSET 52
-#define SKF_AD_MAX 56
-#define SKF_NET_OFF (-0x100000)
+#define SKF_AD_RANDOM 56
+#define SKF_AD_MAX 60
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SKF_NET_OFF (-0x100000)
#define SKF_LL_OFF (-0x200000)
#endif
diff --git a/libc/kernel/uapi/linux/fs.h b/libc/kernel/uapi/linux/fs.h
index d6fc730..c8e841c 100644
--- a/libc/kernel/uapi/linux/fs.h
+++ b/libc/kernel/uapi/linux/fs.h
@@ -36,151 +36,154 @@
#define SEEK_HOLE 4
#define SEEK_MAX SEEK_HOLE
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RENAME_NOREPLACE (1 << 0)
+#define RENAME_EXCHANGE (1 << 1)
struct fstrim_range {
__u64 start;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 len;
__u64 minlen;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct files_stat_struct {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long nr_files;
unsigned long nr_free_files;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long max_files;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct inodes_stat_t {
long nr_inodes;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
long nr_unused;
long dummy[5];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define NR_FILE 8192
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_RDONLY 1
#define MS_NOSUID 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_NODEV 4
#define MS_NOEXEC 8
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_SYNCHRONOUS 16
#define MS_REMOUNT 32
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_MANDLOCK 64
#define MS_DIRSYNC 128
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_NOATIME 1024
#define MS_NODIRATIME 2048
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_BIND 4096
#define MS_MOVE 8192
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_REC 16384
#define MS_VERBOSE 32768
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_SILENT 32768
#define MS_POSIXACL (1<<16)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_UNBINDABLE (1<<17)
#define MS_PRIVATE (1<<18)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_SLAVE (1<<19)
#define MS_SHARED (1<<20)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_RELATIME (1<<21)
#define MS_KERNMOUNT (1<<22)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_I_VERSION (1<<23)
#define MS_STRICTATIME (1<<24)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_NOSEC (1<<28)
#define MS_BORN (1<<29)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_ACTIVE (1<<30)
#define MS_NOUSER (1<<31)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
#define MS_MGC_VAL 0xC0ED0000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MS_MGC_MSK 0xffff0000
#define BLKROSET _IO(0x12,93)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKROGET _IO(0x12,94)
#define BLKRRPART _IO(0x12,95)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKGETSIZE _IO(0x12,96)
#define BLKFLSBUF _IO(0x12,97)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKRASET _IO(0x12,98)
#define BLKRAGET _IO(0x12,99)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKFRASET _IO(0x12,100)
#define BLKFRAGET _IO(0x12,101)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKSECTSET _IO(0x12,102)
#define BLKSECTGET _IO(0x12,103)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKSSZGET _IO(0x12,104)
#define BLKBSZGET _IOR(0x12,112,size_t)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKBSZSET _IOW(0x12,113,size_t)
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
#define BLKTRACESTART _IO(0x12,116)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKTRACESTOP _IO(0x12,117)
#define BLKTRACETEARDOWN _IO(0x12,118)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKDISCARD _IO(0x12,119)
#define BLKIOMIN _IO(0x12,120)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKIOOPT _IO(0x12,121)
#define BLKALIGNOFF _IO(0x12,122)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKPBSZGET _IO(0x12,123)
#define BLKDISCARDZEROES _IO(0x12,124)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKSECDISCARD _IO(0x12,125)
#define BLKROTATIONAL _IO(0x12,126)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define BLKZEROOUT _IO(0x12,127)
#define BMAP_IOCTL 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FIBMAP _IO(0x00,1)
#define FIGETBSZ _IO(0x00,2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FIFREEZE _IOWR('X', 119, int)
#define FITHAW _IOWR('X', 120, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FITRIM _IOWR('X', 121, struct fstrim_range)
#define FS_IOC_GETFLAGS _IOR('f', 1, long)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
#define FS_IOC_GETVERSION _IOR('v', 1, long)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_IOC_SETVERSION _IOW('v', 2, long)
#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_IOC32_GETVERSION _IOR('v', 1, int)
#define FS_IOC32_SETVERSION _IOW('v', 2, int)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_SECRM_FL 0x00000001
#define FS_UNRM_FL 0x00000002
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_COMPR_FL 0x00000004
#define FS_SYNC_FL 0x00000008
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_IMMUTABLE_FL 0x00000010
#define FS_APPEND_FL 0x00000020
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_NODUMP_FL 0x00000040
#define FS_NOATIME_FL 0x00000080
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_DIRTY_FL 0x00000100
#define FS_COMPRBLK_FL 0x00000200
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_NOCOMP_FL 0x00000400
#define FS_ECOMPR_FL 0x00000800
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_BTREE_FL 0x00001000
#define FS_INDEX_FL 0x00001000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_IMAGIC_FL 0x00002000
#define FS_JOURNAL_DATA_FL 0x00004000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_NOTAIL_FL 0x00008000
#define FS_DIRSYNC_FL 0x00010000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_TOPDIR_FL 0x00020000
#define FS_EXTENT_FL 0x00080000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_DIRECTIO_FL 0x00100000
#define FS_NOCOW_FL 0x00800000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_RESERVED_FL 0x80000000
#define FS_FL_USER_VISIBLE 0x0003DFFF
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FS_FL_USER_MODIFIABLE 0x000380FF
#define SYNC_FILE_RANGE_WAIT_BEFORE 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SYNC_FILE_RANGE_WRITE 2
#define SYNC_FILE_RANGE_WAIT_AFTER 4
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/fuse.h b/libc/kernel/uapi/linux/fuse.h
index 8135d47..c7cafe3 100644
--- a/libc/kernel/uapi/linux/fuse.h
+++ b/libc/kernel/uapi/linux/fuse.h
@@ -21,7 +21,7 @@
#include <stdint.h>
#define FUSE_KERNEL_VERSION 7
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define FUSE_KERNEL_MINOR_VERSION 22
+#define FUSE_KERNEL_MINOR_VERSION 23
#define FUSE_ROOT_ID 1
struct fuse_attr {
uint64_t ino;
@@ -81,102 +81,107 @@
#define FATTR_MTIME_NOW (1 << 8)
#define FATTR_LOCKOWNER (1 << 9)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FATTR_CTIME (1 << 10)
#define FOPEN_DIRECT_IO (1 << 0)
#define FOPEN_KEEP_CACHE (1 << 1)
#define FOPEN_NONSEEKABLE (1 << 2)
-#define FUSE_ASYNC_READ (1 << 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FUSE_ASYNC_READ (1 << 0)
#define FUSE_POSIX_LOCKS (1 << 1)
#define FUSE_FILE_OPS (1 << 2)
#define FUSE_ATOMIC_O_TRUNC (1 << 3)
-#define FUSE_EXPORT_SUPPORT (1 << 4)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FUSE_EXPORT_SUPPORT (1 << 4)
#define FUSE_BIG_WRITES (1 << 5)
#define FUSE_DONT_MASK (1 << 6)
#define FUSE_SPLICE_WRITE (1 << 7)
-#define FUSE_SPLICE_MOVE (1 << 8)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FUSE_SPLICE_MOVE (1 << 8)
#define FUSE_SPLICE_READ (1 << 9)
#define FUSE_FLOCK_LOCKS (1 << 10)
#define FUSE_HAS_IOCTL_DIR (1 << 11)
-#define FUSE_AUTO_INVAL_DATA (1 << 12)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FUSE_AUTO_INVAL_DATA (1 << 12)
#define FUSE_DO_READDIRPLUS (1 << 13)
#define FUSE_READDIRPLUS_AUTO (1 << 14)
#define FUSE_ASYNC_DIO (1 << 15)
-#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FUSE_WRITEBACK_CACHE (1 << 16)
+#define FUSE_NO_OPEN_SUPPORT (1 << 17)
+#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
#define FUSE_RELEASE_FLUSH (1 << 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
#define FUSE_GETATTR_FH (1 << 0)
#define FUSE_LK_FLOCK (1 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FUSE_WRITE_CACHE (1 << 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FUSE_WRITE_LOCKOWNER (1 << 1)
#define FUSE_READ_LOCKOWNER (1 << 1)
#define FUSE_IOCTL_COMPAT (1 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FUSE_IOCTL_RETRY (1 << 2)
#define FUSE_IOCTL_32BIT (1 << 3)
#define FUSE_IOCTL_DIR (1 << 4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FUSE_IOCTL_MAX_IOV 256
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
enum fuse_opcode {
FUSE_LOOKUP = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_FORGET = 2,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_GETATTR = 3,
FUSE_SETATTR = 4,
FUSE_READLINK = 5,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_SYMLINK = 6,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_MKNOD = 8,
FUSE_MKDIR = 9,
FUSE_UNLINK = 10,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_RMDIR = 11,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_RENAME = 12,
FUSE_LINK = 13,
FUSE_OPEN = 14,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_READ = 15,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_WRITE = 16,
FUSE_STATFS = 17,
FUSE_RELEASE = 18,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_FSYNC = 20,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_SETXATTR = 21,
FUSE_GETXATTR = 22,
FUSE_LISTXATTR = 23,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_REMOVEXATTR = 24,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_FLUSH = 25,
FUSE_INIT = 26,
FUSE_OPENDIR = 27,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_READDIR = 28,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_RELEASEDIR = 29,
FUSE_FSYNCDIR = 30,
FUSE_GETLK = 31,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_SETLK = 32,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_SETLKW = 33,
FUSE_ACCESS = 34,
FUSE_CREATE = 35,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_INTERRUPT = 36,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_BMAP = 37,
FUSE_DESTROY = 38,
FUSE_IOCTL = 39,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_POLL = 40,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_NOTIFY_REPLY = 41,
FUSE_BATCH_FORGET = 42,
FUSE_FALLOCATE = 43,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUSE_READDIRPLUS = 44,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ FUSE_RENAME2 = 45,
CUSE_INIT = 4096,
};
enum fuse_notify_code {
@@ -251,324 +256,335 @@
uint64_t newdir;
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_rename2_in {
+ uint64_t newdir;
+ uint32_t flags;
+ uint32_t padding;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_link_in {
uint64_t oldnodeid;
};
-struct fuse_setattr_in {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_setattr_in {
uint32_t valid;
uint32_t padding;
uint64_t fh;
- uint64_t size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t size;
uint64_t lock_owner;
uint64_t atime;
uint64_t mtime;
- uint64_t unused2;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t ctime;
uint32_t atimensec;
uint32_t mtimensec;
- uint32_t unused3;
- uint32_t mode;
+ uint32_t ctimensec;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t mode;
uint32_t unused4;
uint32_t uid;
uint32_t gid;
- uint32_t unused5;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t unused5;
};
struct fuse_open_in {
uint32_t flags;
- uint32_t unused;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t unused;
};
struct fuse_create_in {
uint32_t flags;
- uint32_t mode;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t mode;
uint32_t umask;
uint32_t padding;
};
-struct fuse_open_out {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_open_out {
uint64_t fh;
uint32_t open_flags;
uint32_t padding;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_release_in {
uint64_t fh;
uint32_t flags;
- uint32_t release_flags;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t release_flags;
uint64_t lock_owner;
};
struct fuse_flush_in {
- uint64_t fh;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t fh;
uint32_t unused;
uint32_t padding;
uint64_t lock_owner;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_read_in {
uint64_t fh;
uint64_t offset;
- uint32_t size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t size;
uint32_t read_flags;
uint64_t lock_owner;
uint32_t flags;
- uint32_t padding;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t padding;
};
#define FUSE_COMPAT_WRITE_IN_SIZE 24
struct fuse_write_in {
- uint64_t fh;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t fh;
uint64_t offset;
uint32_t size;
uint32_t write_flags;
- uint64_t lock_owner;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t lock_owner;
uint32_t flags;
uint32_t padding;
};
-struct fuse_write_out {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_write_out {
uint32_t size;
uint32_t padding;
};
-#define FUSE_COMPAT_STATFS_SIZE 48
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FUSE_COMPAT_STATFS_SIZE 48
struct fuse_statfs_out {
struct fuse_kstatfs st;
};
-struct fuse_fsync_in {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_fsync_in {
uint64_t fh;
uint32_t fsync_flags;
uint32_t padding;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_setxattr_in {
uint32_t size;
uint32_t flags;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_getxattr_in {
uint32_t size;
uint32_t padding;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_getxattr_out {
uint32_t size;
uint32_t padding;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_lk_in {
uint64_t fh;
uint64_t owner;
- struct fuse_file_lock lk;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct fuse_file_lock lk;
uint32_t lk_flags;
uint32_t padding;
};
-struct fuse_lk_out {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_lk_out {
struct fuse_file_lock lk;
};
struct fuse_access_in {
- uint32_t mask;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t mask;
uint32_t padding;
};
struct fuse_init_in {
- uint32_t major;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t major;
uint32_t minor;
uint32_t max_readahead;
uint32_t flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FUSE_COMPAT_INIT_OUT_SIZE 8
+#define FUSE_COMPAT_22_INIT_OUT_SIZE 24
struct fuse_init_out {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t major;
uint32_t minor;
uint32_t max_readahead;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint32_t flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
uint16_t max_background;
uint16_t congestion_threshold;
uint32_t max_write;
+ uint32_t time_gran;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t unused[9];
};
#define CUSE_INIT_INFO_MAX 4096
struct cuse_init_in {
- uint32_t major;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t major;
uint32_t minor;
uint32_t unused;
uint32_t flags;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct cuse_init_out {
uint32_t major;
uint32_t minor;
- uint32_t unused;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t unused;
uint32_t flags;
uint32_t max_read;
uint32_t max_write;
- uint32_t dev_major;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t dev_major;
uint32_t dev_minor;
uint32_t spare[10];
};
-struct fuse_interrupt_in {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_interrupt_in {
uint64_t unique;
};
struct fuse_bmap_in {
- uint64_t block;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t block;
uint32_t blocksize;
uint32_t padding;
};
-struct fuse_bmap_out {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_bmap_out {
uint64_t block;
};
struct fuse_ioctl_in {
- uint64_t fh;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t fh;
uint32_t flags;
uint32_t cmd;
uint64_t arg;
- uint32_t in_size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t in_size;
uint32_t out_size;
};
struct fuse_ioctl_iovec {
- uint64_t base;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t base;
uint64_t len;
};
struct fuse_ioctl_out {
- int32_t result;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ int32_t result;
uint32_t flags;
uint32_t in_iovs;
uint32_t out_iovs;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_poll_in {
uint64_t fh;
uint64_t kh;
- uint32_t flags;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t flags;
uint32_t events;
};
struct fuse_poll_out {
- uint32_t revents;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t revents;
uint32_t padding;
};
struct fuse_notify_poll_wakeup_out {
- uint64_t kh;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t kh;
};
struct fuse_fallocate_in {
uint64_t fh;
- uint64_t offset;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t offset;
uint64_t length;
uint32_t mode;
uint32_t padding;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_in_header {
uint32_t len;
uint32_t opcode;
- uint64_t unique;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t unique;
uint64_t nodeid;
uint32_t uid;
uint32_t gid;
- uint32_t pid;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t pid;
uint32_t padding;
};
struct fuse_out_header {
- uint32_t len;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t len;
int32_t error;
uint64_t unique;
};
-struct fuse_dirent {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_dirent {
uint64_t ino;
uint64_t off;
uint32_t namelen;
- uint32_t type;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t type;
char name[];
};
#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
-#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
#define FUSE_DIRENT_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
struct fuse_direntplus {
struct fuse_entry_out entry_out;
- struct fuse_dirent dirent;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct fuse_dirent dirent;
};
#define FUSE_NAME_OFFSET_DIRENTPLUS offsetof(struct fuse_direntplus, dirent.name)
#define FUSE_DIRENTPLUS_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
-struct fuse_notify_inval_inode_out {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_notify_inval_inode_out {
uint64_t ino;
int64_t off;
int64_t len;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_notify_inval_entry_out {
uint64_t parent;
uint32_t namelen;
- uint32_t padding;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t padding;
};
struct fuse_notify_delete_out {
uint64_t parent;
- uint64_t child;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t child;
uint32_t namelen;
uint32_t padding;
};
-struct fuse_notify_store_out {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fuse_notify_store_out {
uint64_t nodeid;
uint64_t offset;
uint32_t size;
- uint32_t padding;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t padding;
};
struct fuse_notify_retrieve_out {
uint64_t notify_unique;
- uint64_t nodeid;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint64_t nodeid;
uint64_t offset;
uint32_t size;
uint32_t padding;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct fuse_notify_retrieve_in {
uint64_t dummy1;
uint64_t offset;
- uint32_t size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uint32_t size;
uint32_t dummy2;
uint64_t dummy3;
uint64_t dummy4;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#endif
diff --git a/libc/kernel/uapi/linux/gfs2_ondisk.h b/libc/kernel/uapi/linux/gfs2_ondisk.h
index a3106ba..1615eb2 100644
--- a/libc/kernel/uapi/linux/gfs2_ondisk.h
+++ b/libc/kernel/uapi/linux/gfs2_ondisk.h
@@ -26,7 +26,7 @@
#define GFS2_MOUNT_LOCK 0
#define GFS2_LIVE_LOCK 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define GFS2_TRANS_LOCK 2
+#define GFS2_FREEZE_LOCK 2
#define GFS2_RENAME_LOCK 3
#define GFS2_CONTROL_LOCK 4
#define GFS2_MOUNTED_LOCK 5
@@ -264,105 +264,112 @@
__be16 de_rec_len;
__be16 de_name_len;
__be16 de_type;
- __u8 __pad[14];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-};
-struct gfs2_leaf {
- struct gfs2_meta_header lf_header;
- __be16 lf_depth;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __be16 lf_entries;
- __be32 lf_dirent_format;
- __be64 lf_next;
union {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 __pad[14];
+ struct {
+ __be16 de_rahead;
+ __u8 pad2[12];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ };
+ };
+};
+struct gfs2_leaf {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct gfs2_meta_header lf_header;
+ __be16 lf_depth;
+ __be16 lf_entries;
+ __be32 lf_dirent_format;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __be64 lf_next;
+ union {
__u8 lf_reserved[64];
struct {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be64 lf_inode;
__be32 lf_dist;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be32 lf_nsec;
__be64 lf_sec;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 lf_reserved2[40];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define GFS2_EA_MAX_NAME_LEN 255
#define GFS2_EA_MAX_DATA_LEN 65536
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define GFS2_EATYPE_UNUSED 0
#define GFS2_EATYPE_USR 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define GFS2_EATYPE_SYS 2
#define GFS2_EATYPE_SECURITY 3
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define GFS2_EATYPE_LAST 3
#define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define GFS2_EAFLAG_LAST 0x01
struct gfs2_ea_header {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be32 ea_rec_len;
__be32 ea_data_len;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 ea_name_len;
__u8 ea_type;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 ea_flags;
__u8 ea_num_ptrs;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 __pad;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define GFS2_LOG_HEAD_UNMOUNT 0x00000001
struct gfs2_log_header {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct gfs2_meta_header lh_header;
__be64 lh_sequence;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be32 lh_flags;
__be32 lh_tail;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be32 lh_blkno;
__be32 lh_hash;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define GFS2_LOG_DESC_METADATA 300
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define GFS2_LOG_DESC_REVOKE 301
#define GFS2_LOG_DESC_JDATA 302
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct gfs2_log_descriptor {
struct gfs2_meta_header ld_header;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be32 ld_type;
__be32 ld_length;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be32 ld_data1;
__be32 ld_data2;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 ld_reserved[32];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define GFS2_INUM_QUANTUM 1048576
struct gfs2_inum_range {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be64 ir_start;
__be64 ir_length;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct gfs2_statfs_change {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be64 sc_total;
__be64 sc_free;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be64 sc_dinodes;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define GFS2_QCF_USER 0x00000001
struct gfs2_quota_change {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be64 qc_change;
__be32 qc_flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be32 qc_id;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct gfs2_quota_lvb {
__be32 qb_magic;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 __pad;
__be64 qb_limit;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be64 qb_warn;
__be64 qb_value;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/hyperv.h b/libc/kernel/uapi/linux/hyperv.h
new file mode 100644
index 0000000..da4c4f1
--- /dev/null
+++ b/libc/kernel/uapi/linux/hyperv.h
@@ -0,0 +1,233 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_HYPERV_H
+#define _UAPI_HYPERV_H
+#include <linux/uuid.h>
+#define UTIL_FW_MINOR 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define UTIL_WS2K8_FW_MAJOR 1
+#define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR << 16 | UTIL_FW_MINOR)
+#define UTIL_FW_MAJOR 3
+#define UTIL_FW_VERSION (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VSS_OP_REGISTER 128
+enum hv_vss_op {
+ VSS_OP_CREATE = 0,
+ VSS_OP_DELETE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ VSS_OP_HOT_BACKUP,
+ VSS_OP_GET_DM_INFO,
+ VSS_OP_BU_COMPLETE,
+ VSS_OP_FREEZE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ VSS_OP_THAW,
+ VSS_OP_AUTO_RECOVER,
+ VSS_OP_COUNT
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct hv_vss_hdr {
+ __u8 operation;
+ __u8 reserved[7];
+} __attribute__((packed));
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VSS_HBU_NO_AUTO_RECOVERY 0x00000005
+struct hv_vss_check_feature {
+ __u32 flags;
+} __attribute__((packed));
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct hv_vss_check_dm_info {
+ __u32 flags;
+} __attribute__((packed));
+struct hv_vss_msg {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ union {
+ struct hv_vss_hdr vss_hdr;
+ int error;
+ };
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ union {
+ struct hv_vss_check_feature vss_cf;
+ struct hv_vss_check_dm_info dm_info;
+ };
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__((packed));
+#define FCOPY_VERSION_0 0
+#define FCOPY_CURRENT_VERSION FCOPY_VERSION_0
+#define W_MAX_PATH 260
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum hv_fcopy_op {
+ START_FILE_COPY = 0,
+ WRITE_TO_FILE,
+ COMPLETE_FCOPY,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ CANCEL_FCOPY,
+};
+struct hv_fcopy_hdr {
+ __u32 operation;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ uuid_le service_id0;
+ uuid_le service_id1;
+} __attribute__((packed));
+#define OVER_WRITE 0x1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define CREATE_PATH 0x2
+struct hv_start_fcopy {
+ struct hv_fcopy_hdr hdr;
+ __u16 file_name[W_MAX_PATH];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 path_name[W_MAX_PATH];
+ __u32 copy_flags;
+ __u64 file_size;
+} __attribute__((packed));
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define DATA_FRAGMENT (6 * 1024)
+struct hv_do_fcopy {
+ struct hv_fcopy_hdr hdr;
+ __u64 offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 size;
+ __u8 data[DATA_FRAGMENT];
+};
+#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE (2048)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define HV_KVP_EXCHANGE_MAX_KEY_SIZE (512)
+#define REG_SZ 1
+#define REG_U32 4
+#define REG_U64 8
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVP_OP_REGISTER 4
+#define KVP_OP_REGISTER1 100
+enum hv_kvp_exchg_op {
+ KVP_OP_GET = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ KVP_OP_SET,
+ KVP_OP_DELETE,
+ KVP_OP_ENUMERATE,
+ KVP_OP_GET_IP_INFO,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ KVP_OP_SET_IP_INFO,
+ KVP_OP_COUNT
+};
+enum hv_kvp_exchg_pool {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ KVP_POOL_EXTERNAL = 0,
+ KVP_POOL_GUEST,
+ KVP_POOL_AUTO,
+ KVP_POOL_AUTO_EXTERNAL,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ KVP_POOL_AUTO_INTERNAL,
+ KVP_POOL_COUNT
+};
+#define HV_S_OK 0x00000000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define HV_E_FAIL 0x80004005
+#define HV_S_CONT 0x80070103
+#define HV_ERROR_NOT_SUPPORTED 0x80070032
+#define HV_ERROR_MACHINE_LOCKED 0x800704F7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F
+#define HV_INVALIDARG 0x80070057
+#define HV_GUID_NOTFOUND 0x80041002
+#define HV_ERROR_ALREADY_EXISTS 0x80070050
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ADDR_FAMILY_NONE 0x00
+#define ADDR_FAMILY_IPV4 0x01
+#define ADDR_FAMILY_IPV6 0x02
+#define MAX_ADAPTER_ID_SIZE 128
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MAX_IP_ADDR_SIZE 1024
+#define MAX_GATEWAY_SIZE 512
+struct hv_kvp_ipaddr_value {
+ __u16 adapter_id[MAX_ADAPTER_ID_SIZE];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 addr_family;
+ __u8 dhcp_enabled;
+ __u16 ip_addr[MAX_IP_ADDR_SIZE];
+ __u16 sub_net[MAX_IP_ADDR_SIZE];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 gate_way[MAX_GATEWAY_SIZE];
+ __u16 dns_addr[MAX_IP_ADDR_SIZE];
+} __attribute__((packed));
+struct hv_kvp_hdr {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 operation;
+ __u8 pool;
+ __u16 pad;
+} __attribute__((packed));
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct hv_kvp_exchg_msg_value {
+ __u32 value_type;
+ __u32 key_size;
+ __u32 value_size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
+ union {
+ __u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
+ __u32 value_u32;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 value_u64;
+ };
+} __attribute__((packed));
+struct hv_kvp_msg_enumerate {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 index;
+ struct hv_kvp_exchg_msg_value data;
+} __attribute__((packed));
+struct hv_kvp_msg_get {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct hv_kvp_exchg_msg_value data;
+};
+struct hv_kvp_msg_set {
+ struct hv_kvp_exchg_msg_value data;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+struct hv_kvp_msg_delete {
+ __u32 key_size;
+ __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+struct hv_kvp_register {
+ __u8 version[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct hv_kvp_msg {
+ union {
+ struct hv_kvp_hdr kvp_hdr;
+ int error;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ };
+ union {
+ struct hv_kvp_msg_get kvp_get;
+ struct hv_kvp_msg_set kvp_set;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct hv_kvp_msg_delete kvp_delete;
+ struct hv_kvp_msg_enumerate kvp_enum_data;
+ struct hv_kvp_ipaddr_value kvp_ip_val;
+ struct hv_kvp_register kvp_register;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ } body;
+} __attribute__((packed));
+struct hv_kvp_ip_msg {
+ __u8 operation;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 pool;
+ struct hv_kvp_ipaddr_value kvp_ip_val;
+} __attribute__((packed));
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/if.h b/libc/kernel/uapi/linux/if.h
index 4eca84d..5302f13 100644
--- a/libc/kernel/uapi/linux/if.h
+++ b/libc/kernel/uapi/linux/if.h
@@ -26,186 +26,185 @@
#define IFALIASZ 256
#include <linux/hdlc/ioctl.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_UP 0x1
-#define IFF_BROADCAST 0x2
-#define IFF_DEBUG 0x4
-#define IFF_LOOPBACK 0x8
+enum net_device_flags {
+ IFF_UP = 1<<0,
+ IFF_BROADCAST = 1<<1,
+ IFF_DEBUG = 1<<2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_POINTOPOINT 0x10
-#define IFF_NOTRAILERS 0x20
-#define IFF_RUNNING 0x40
-#define IFF_NOARP 0x80
+ IFF_LOOPBACK = 1<<3,
+ IFF_POINTOPOINT = 1<<4,
+ IFF_NOTRAILERS = 1<<5,
+ IFF_RUNNING = 1<<6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_PROMISC 0x100
-#define IFF_ALLMULTI 0x200
-#define IFF_MASTER 0x400
-#define IFF_SLAVE 0x800
+ IFF_NOARP = 1<<7,
+ IFF_PROMISC = 1<<8,
+ IFF_ALLMULTI = 1<<9,
+ IFF_MASTER = 1<<10,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_MULTICAST 0x1000
-#define IFF_PORTSEL 0x2000
-#define IFF_AUTOMEDIA 0x4000
-#define IFF_DYNAMIC 0x8000
+ IFF_SLAVE = 1<<11,
+ IFF_MULTICAST = 1<<12,
+ IFF_PORTSEL = 1<<13,
+ IFF_AUTOMEDIA = 1<<14,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_LOWER_UP 0x10000
-#define IFF_DORMANT 0x20000
-#define IFF_ECHO 0x40000
+ IFF_DYNAMIC = 1<<15,
+ IFF_LOWER_UP = 1<<16,
+ IFF_DORMANT = 1<<17,
+ IFF_ECHO = 1<<18,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+#define IFF_UP IFF_UP
+#define IFF_BROADCAST IFF_BROADCAST
+#define IFF_DEBUG IFF_DEBUG
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IFF_LOOPBACK IFF_LOOPBACK
+#define IFF_POINTOPOINT IFF_POINTOPOINT
+#define IFF_NOTRAILERS IFF_NOTRAILERS
+#define IFF_RUNNING IFF_RUNNING
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IFF_NOARP IFF_NOARP
+#define IFF_PROMISC IFF_PROMISC
+#define IFF_ALLMULTI IFF_ALLMULTI
+#define IFF_MASTER IFF_MASTER
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IFF_SLAVE IFF_SLAVE
+#define IFF_MULTICAST IFF_MULTICAST
+#define IFF_PORTSEL IFF_PORTSEL
+#define IFF_AUTOMEDIA IFF_AUTOMEDIA
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IFF_DYNAMIC IFF_DYNAMIC
+#define IFF_LOWER_UP IFF_LOWER_UP
+#define IFF_DORMANT IFF_DORMANT
+#define IFF_ECHO IFF_ECHO
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO| IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_802_1Q_VLAN 0x1
-#define IFF_EBRIDGE 0x2
-#define IFF_SLAVE_INACTIVE 0x4
-#define IFF_MASTER_8023AD 0x8
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_MASTER_ALB 0x10
-#define IFF_BONDING 0x20
-#define IFF_SLAVE_NEEDARP 0x40
-#define IFF_ISATAP 0x80
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_MASTER_ARPMON 0x100
-#define IFF_WAN_HDLC 0x200
-#define IFF_XMIT_DST_RELEASE 0x400
-#define IFF_DONT_BRIDGE 0x800
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_DISABLE_NETPOLL 0x1000
-#define IFF_MACVLAN_PORT 0x2000
-#define IFF_BRIDGE_PORT 0x4000
-#define IFF_OVS_DATAPATH 0x8000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_TX_SKB_SHARING 0x10000
-#define IFF_UNICAST_FLT 0x20000
-#define IFF_TEAM_PORT 0x40000
-#define IFF_SUPP_NOFCS 0x80000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define IFF_LIVE_ADDR_CHANGE 0x100000
-#define IFF_MACVLAN 0x200000
#define IF_GET_IFACE 0x0001
#define IF_GET_PROTO 0x0002
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_IFACE_V35 0x1000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_IFACE_V24 0x1001
#define IF_IFACE_X21 0x1002
#define IF_IFACE_T1 0x1003
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_IFACE_E1 0x1004
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_IFACE_SYNC_SERIAL 0x1005
#define IF_IFACE_X21D 0x1006
#define IF_PROTO_HDLC 0x2000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_PROTO_PPP 0x2001
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_PROTO_CISCO 0x2002
#define IF_PROTO_FR 0x2003
#define IF_PROTO_FR_ADD_PVC 0x2004
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_PROTO_FR_DEL_PVC 0x2005
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_PROTO_X25 0x2006
#define IF_PROTO_HDLC_ETH 0x2007
#define IF_PROTO_FR_ADD_ETH_PVC 0x2008
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_PROTO_FR_DEL_ETH_PVC 0x2009
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IF_PROTO_FR_PVC 0x200A
#define IF_PROTO_FR_ETH_PVC 0x200B
#define IF_PROTO_RAW 0x200C
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IF_OPER_UNKNOWN,
IF_OPER_NOTPRESENT,
IF_OPER_DOWN,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IF_OPER_LOWERLAYERDOWN,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IF_OPER_TESTING,
IF_OPER_DORMANT,
IF_OPER_UP,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
IF_LINK_MODE_DEFAULT,
IF_LINK_MODE_DORMANT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ifmap {
unsigned long mem_start;
unsigned long mem_end;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned short base_addr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char irq;
unsigned char dma;
unsigned char port;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct if_settings {
unsigned int type;
unsigned int size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
raw_hdlc_proto __user *raw_hdlc;
cisco_proto __user *cisco;
fr_proto __user *fr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
fr_proto_pvc __user *fr_pvc;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
fr_proto_pvc_info __user *fr_pvc_info;
sync_serial_settings __user *sync;
te1_settings __user *te1;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} ifs_ifsu;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct ifreq {
#define IFHWADDRLEN 6
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
{
char ifrn_name[IFNAMSIZ];
} ifr_ifrn;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
struct sockaddr ifru_broadaddr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct sockaddr ifru_netmask;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct sockaddr ifru_hwaddr;
short ifru_flags;
int ifru_ivalue;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int ifru_mtu;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ifmap ifru_map;
char ifru_slave[IFNAMSIZ];
char ifru_newname[IFNAMSIZ];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
void __user * ifru_data;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct if_settings ifru_settings;
} ifr_ifru;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifr_name ifr_ifrn.ifrn_name
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifr_hwaddr ifr_ifru.ifru_hwaddr
#define ifr_addr ifr_ifru.ifru_addr
#define ifr_dstaddr ifr_ifru.ifru_dstaddr
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifr_broadaddr ifr_ifru.ifru_broadaddr
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifr_netmask ifr_ifru.ifru_netmask
#define ifr_flags ifr_ifru.ifru_flags
#define ifr_metric ifr_ifru.ifru_ivalue
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifr_mtu ifr_ifru.ifru_mtu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifr_map ifr_ifru.ifru_map
#define ifr_slave ifr_ifru.ifru_slave
#define ifr_data ifr_ifru.ifru_data
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifr_ifindex ifr_ifru.ifru_ivalue
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifr_bandwidth ifr_ifru.ifru_ivalue
#define ifr_qlen ifr_ifru.ifru_ivalue
#define ifr_newname ifr_ifru.ifru_newname
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifr_settings ifr_ifru.ifru_settings
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ifconf {
int ifc_len;
union {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char __user *ifcu_buf;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ifreq __user *ifcu_req;
} ifc_ifcu;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifc_buf ifc_ifcu.ifcu_buf
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ifc_req ifc_ifcu.ifcu_req
#endif
diff --git a/libc/kernel/uapi/linux/if_ether.h b/libc/kernel/uapi/linux/if_ether.h
index 610f70b..6d88ba8 100644
--- a/libc/kernel/uapi/linux/if_ether.h
+++ b/libc/kernel/uapi/linux/if_ether.h
@@ -62,12 +62,12 @@
#define ETH_P_SLOW 0x8809
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_WCCP 0x883E
-#define ETH_P_PPP_DISC 0x8863
-#define ETH_P_PPP_SES 0x8864
#define ETH_P_MPLS_UC 0x8847
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_MPLS_MC 0x8848
#define ETH_P_ATMMPOA 0x884c
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETH_P_PPP_DISC 0x8863
+#define ETH_P_PPP_SES 0x8864
#define ETH_P_LINK_CTL 0x886c
#define ETH_P_ATMFATE 0x8884
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -86,48 +86,50 @@
#define ETH_P_TDLS 0x890D
#define ETH_P_FIP 0x8914
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ETH_P_80221 0x8917
+#define ETH_P_LOOPBACK 0x9000
#define ETH_P_QINQ1 0x9100
#define ETH_P_QINQ2 0x9200
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_QINQ3 0x9300
#define ETH_P_EDSA 0xDADA
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_AF_IUCV 0xFBFB
#define ETH_P_802_3_MIN 0x0600
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_802_3 0x0001
#define ETH_P_AX25 0x0002
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_ALL 0x0003
#define ETH_P_802_2 0x0004
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_SNAP 0x0005
#define ETH_P_DDCMP 0x0006
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_WAN_PPP 0x0007
#define ETH_P_PPP_MP 0x0008
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_LOCALTALK 0x0009
#define ETH_P_CAN 0x000C
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_CANFD 0x000D
#define ETH_P_PPPTALK 0x0010
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_TR_802_2 0x0011
#define ETH_P_MOBITEX 0x0015
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_CONTROL 0x0016
#define ETH_P_IRDA 0x0017
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_ECONET 0x0018
#define ETH_P_HDLC 0x0019
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_ARCNET 0x001A
#define ETH_P_DSA 0x001B
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_TRAILER 0x001C
#define ETH_P_PHONET 0x00F5
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define ETH_P_IEEE802154 0x00F6
#define ETH_P_CAIF 0x00F7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ethhdr {
unsigned char h_dest[ETH_ALEN];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char h_source[ETH_ALEN];
__be16 h_proto;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((packed));
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/if_fddi.h b/libc/kernel/uapi/linux/if_fddi.h
index 699ae44..cee18c0 100644
--- a/libc/kernel/uapi/linux/if_fddi.h
+++ b/libc/kernel/uapi/linux/if_fddi.h
@@ -31,43 +31,43 @@
#define FDDI_K_LLC_ZLEN 13
#define FDDI_K_LLC_LEN 4491
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FDDI_K_OUI_LEN 3
#define FDDI_FC_K_VOID 0x00
#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
-#define FDDI_FC_K_SMT_MIN 0x41
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FDDI_FC_K_SMT_MIN 0x41
#define FDDI_FC_K_SMT_MAX 0x4F
#define FDDI_FC_K_MAC_MIN 0xC1
#define FDDI_FC_K_MAC_MAX 0xCF
-#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
#define FDDI_FC_K_ASYNC_LLC_DEF 0x54
#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F
#define FDDI_FC_K_SYNC_LLC_MIN 0xD0
-#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60
#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F
#define FDDI_FC_K_RESERVED_MIN 0x70
-#define FDDI_FC_K_RESERVED_MAX 0x7F
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FDDI_FC_K_RESERVED_MAX 0x7F
#define FDDI_EXTENDED_SAP 0xAA
#define FDDI_UI_CMD 0x03
struct fddi_8022_1_hdr {
- __u8 dsap;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 dsap;
__u8 ssap;
__u8 ctrl;
} __attribute__((packed));
-struct fddi_8022_2_hdr {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct fddi_8022_2_hdr {
__u8 dsap;
__u8 ssap;
__u8 ctrl_1;
- __u8 ctrl_2;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 ctrl_2;
} __attribute__((packed));
-#define FDDI_K_OUI_LEN 3
struct fddi_snap_hdr {
__u8 dsap;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -82,13 +82,12 @@
__u8 daddr[FDDI_K_ALEN];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 saddr[FDDI_K_ALEN];
- union
- {
+ union {
struct fddi_8022_1_hdr llc_8022_1;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct fddi_8022_2_hdr llc_8022_2;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct fddi_snap_hdr llc_snap;
} hdr;
} __attribute__((packed));
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/if_link.h b/libc/kernel/uapi/linux/if_link.h
index aa53f0e..1f320a3 100644
--- a/libc/kernel/uapi/linux/if_link.h
+++ b/libc/kernel/uapi/linux/if_link.h
@@ -151,148 +151,153 @@
IFLA_CARRIER,
IFLA_PHYS_PORT_ID,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_CARRIER_CHANGES,
__IFLA_MAX
};
#define IFLA_MAX (__IFLA_MAX - 1)
-#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
enum {
IFLA_INET_UNSPEC,
- IFLA_INET_CONF,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_INET_CONF,
__IFLA_INET_MAX,
};
#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
-enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
IFLA_INET6_UNSPEC,
IFLA_INET6_FLAGS,
IFLA_INET6_CONF,
- IFLA_INET6_STATS,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_INET6_STATS,
IFLA_INET6_MCAST,
IFLA_INET6_CACHEINFO,
IFLA_INET6_ICMP6STATS,
- IFLA_INET6_TOKEN,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_INET6_TOKEN,
__IFLA_INET6_MAX
};
#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
-enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
BRIDGE_MODE_UNSPEC,
BRIDGE_MODE_HAIRPIN,
};
-enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
IFLA_BRPORT_UNSPEC,
IFLA_BRPORT_STATE,
IFLA_BRPORT_PRIORITY,
- IFLA_BRPORT_COST,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_BRPORT_COST,
IFLA_BRPORT_MODE,
IFLA_BRPORT_GUARD,
IFLA_BRPORT_PROTECT,
- IFLA_BRPORT_FAST_LEAVE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_BRPORT_FAST_LEAVE,
IFLA_BRPORT_LEARNING,
IFLA_BRPORT_UNICAST_FLOOD,
__IFLA_BRPORT_MAX
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
struct ifla_cacheinfo {
__u32 max_reasm_len;
- __u32 tstamp;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 tstamp;
__u32 reachable_time;
__u32 retrans_time;
};
-enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
IFLA_INFO_UNSPEC,
IFLA_INFO_KIND,
IFLA_INFO_DATA,
- IFLA_INFO_XSTATS,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_INFO_XSTATS,
IFLA_INFO_SLAVE_KIND,
IFLA_INFO_SLAVE_DATA,
__IFLA_INFO_MAX,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
enum {
IFLA_VLAN_UNSPEC,
- IFLA_VLAN_ID,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_VLAN_ID,
IFLA_VLAN_FLAGS,
IFLA_VLAN_EGRESS_QOS,
IFLA_VLAN_INGRESS_QOS,
- IFLA_VLAN_PROTOCOL,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_VLAN_PROTOCOL,
__IFLA_VLAN_MAX,
};
#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
-struct ifla_vlan_flags {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct ifla_vlan_flags {
__u32 flags;
__u32 mask;
};
-enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
IFLA_VLAN_QOS_UNSPEC,
IFLA_VLAN_QOS_MAPPING,
__IFLA_VLAN_QOS_MAX
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
struct ifla_vlan_qos_mapping {
__u32 from;
- __u32 to;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 to;
};
enum {
IFLA_MACVLAN_UNSPEC,
- IFLA_MACVLAN_MODE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_MACVLAN_MODE,
IFLA_MACVLAN_FLAGS,
__IFLA_MACVLAN_MAX,
};
-#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
enum macvlan_mode {
MACVLAN_MODE_PRIVATE = 1,
MACVLAN_MODE_VEPA = 2,
- MACVLAN_MODE_BRIDGE = 4,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ MACVLAN_MODE_BRIDGE = 4,
MACVLAN_MODE_PASSTHRU = 8,
};
#define MACVLAN_FLAG_NOPROMISC 1
-enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
IFLA_VXLAN_UNSPEC,
IFLA_VXLAN_ID,
IFLA_VXLAN_GROUP,
- IFLA_VXLAN_LINK,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_VXLAN_LINK,
IFLA_VXLAN_LOCAL,
IFLA_VXLAN_TTL,
IFLA_VXLAN_TOS,
- IFLA_VXLAN_LEARNING,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_VXLAN_LEARNING,
IFLA_VXLAN_AGEING,
IFLA_VXLAN_LIMIT,
IFLA_VXLAN_PORT_RANGE,
- IFLA_VXLAN_PROXY,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_VXLAN_PROXY,
IFLA_VXLAN_RSC,
IFLA_VXLAN_L2MISS,
IFLA_VXLAN_L3MISS,
- IFLA_VXLAN_PORT,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_VXLAN_PORT,
IFLA_VXLAN_GROUP6,
IFLA_VXLAN_LOCAL6,
+ IFLA_VXLAN_UDP_CSUM,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
+ IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
__IFLA_VXLAN_MAX
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -379,130 +384,137 @@
IFLA_VF_TX_RATE,
IFLA_VF_SPOOFCHK,
IFLA_VF_LINK_STATE,
- __IFLA_VF_MAX,
+ IFLA_VF_RATE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __IFLA_VF_MAX,
};
#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
struct ifla_vf_mac {
- __u32 vf;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 vf;
__u8 mac[32];
};
struct ifla_vf_vlan {
- __u32 vf;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 vf;
__u32 vlan;
__u32 qos;
};
-struct ifla_vf_tx_rate {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct ifla_vf_tx_rate {
__u32 vf;
__u32 rate;
};
-struct ifla_vf_spoofchk {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct ifla_vf_rate {
+ __u32 vf;
+ __u32 min_tx_rate;
+ __u32 max_tx_rate;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+struct ifla_vf_spoofchk {
__u32 vf;
__u32 setting;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_VF_LINK_STATE_AUTO,
IFLA_VF_LINK_STATE_ENABLE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_VF_LINK_STATE_DISABLE,
__IFLA_VF_LINK_STATE_MAX,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct ifla_vf_link_state {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 vf;
__u32 link_state;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_VF_PORT_UNSPEC,
IFLA_VF_PORT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__IFLA_VF_PORT_MAX,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
enum {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_PORT_UNSPEC,
IFLA_PORT_VF,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_PORT_PROFILE,
IFLA_PORT_VSI_TYPE,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_PORT_INSTANCE_UUID,
IFLA_PORT_HOST_UUID,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_PORT_REQUEST,
IFLA_PORT_RESPONSE,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__IFLA_PORT_MAX,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
#define PORT_PROFILE_MAX 40
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PORT_UUID_MAX 16
#define PORT_SELF_VF -1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
PORT_REQUEST_PREASSOCIATE = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PORT_REQUEST_PREASSOCIATE_RR,
PORT_REQUEST_ASSOCIATE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PORT_REQUEST_DISASSOCIATE,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
PORT_VDP_RESPONSE_SUCCESS = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PORT_VDP_RESPONSE_INVALID_FORMAT,
PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PORT_VDP_RESPONSE_UNUSED_VTID,
PORT_VDP_RESPONSE_VTID_VIOLATION,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
PORT_VDP_RESPONSE_OUT_OF_SYNC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
PORT_PROFILE_RESPONSE_INPROGRESS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PORT_PROFILE_RESPONSE_INVALID,
PORT_PROFILE_RESPONSE_BADSTATE,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
PORT_PROFILE_RESPONSE_ERROR,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct ifla_port_vsi {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 vsi_mgr_id;
__u8 vsi_type_id[3];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 vsi_type_version;
__u8 pad[3];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_IPOIB_UNSPEC,
IFLA_IPOIB_PKEY,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_IPOIB_MODE,
IFLA_IPOIB_UMCAST,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__IFLA_IPOIB_MAX
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
IPOIB_MODE_DATAGRAM = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPOIB_MODE_CONNECTED = 1,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_HSR_UNSPEC,
IFLA_HSR_SLAVE1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_HSR_SLAVE2,
IFLA_HSR_MULTICAST_SPEC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFLA_HSR_SUPERVISION_ADDR,
IFLA_HSR_SEQ_NR,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__IFLA_HSR_MAX,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/if_tunnel.h b/libc/kernel/uapi/linux/if_tunnel.h
index 67ce5ce..c3e39a4 100644
--- a/libc/kernel/uapi/linux/if_tunnel.h
+++ b/libc/kernel/uapi/linux/if_tunnel.h
@@ -122,7 +122,7 @@
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
-#define VTI_ISVTI 0x0001
+#define VTI_ISVTI ((__force __be16)0x0001)
enum {
IFLA_VTI_UNSPEC,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/in.h b/libc/kernel/uapi/linux/in.h
index e90209b..0182e0a 100644
--- a/libc/kernel/uapi/linux/in.h
+++ b/libc/kernel/uapi/linux/in.h
@@ -124,137 +124,138 @@
#define IP_PMTUDISC_DO 2
#define IP_PMTUDISC_PROBE 3
#define IP_PMTUDISC_INTERFACE 4
-#define IP_MULTICAST_IF 32
+#define IP_PMTUDISC_OMIT 5
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IP_MULTICAST_IF 32
#define IP_MULTICAST_TTL 33
#define IP_MULTICAST_LOOP 34
#define IP_ADD_MEMBERSHIP 35
-#define IP_DROP_MEMBERSHIP 36
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IP_DROP_MEMBERSHIP 36
#define IP_UNBLOCK_SOURCE 37
#define IP_BLOCK_SOURCE 38
#define IP_ADD_SOURCE_MEMBERSHIP 39
-#define IP_DROP_SOURCE_MEMBERSHIP 40
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IP_DROP_SOURCE_MEMBERSHIP 40
#define IP_MSFILTER 41
#define MCAST_JOIN_GROUP 42
#define MCAST_BLOCK_SOURCE 43
-#define MCAST_UNBLOCK_SOURCE 44
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MCAST_UNBLOCK_SOURCE 44
#define MCAST_LEAVE_GROUP 45
#define MCAST_JOIN_SOURCE_GROUP 46
#define MCAST_LEAVE_SOURCE_GROUP 47
-#define MCAST_MSFILTER 48
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MCAST_MSFILTER 48
#define IP_MULTICAST_ALL 49
#define IP_UNICAST_IF 50
#define MCAST_EXCLUDE 0
-#define MCAST_INCLUDE 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MCAST_INCLUDE 1
#define IP_DEFAULT_MULTICAST_TTL 1
#define IP_DEFAULT_MULTICAST_LOOP 1
struct ip_mreq {
- struct in_addr imr_multiaddr;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct in_addr imr_multiaddr;
struct in_addr imr_interface;
};
struct ip_mreqn {
- struct in_addr imr_multiaddr;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct in_addr imr_multiaddr;
struct in_addr imr_address;
int imr_ifindex;
};
-struct ip_mreq_source {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct ip_mreq_source {
__be32 imr_multiaddr;
__be32 imr_interface;
__be32 imr_sourceaddr;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct ip_msfilter {
__be32 imsf_multiaddr;
__be32 imsf_interface;
- __u32 imsf_fmode;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 imsf_fmode;
__u32 imsf_numsrc;
__be32 imsf_slist[1];
};
-#define IP_MSFILTER_SIZE(numsrc) (sizeof(struct ip_msfilter) - sizeof(__u32) + (numsrc) * sizeof(__u32))
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IP_MSFILTER_SIZE(numsrc) (sizeof(struct ip_msfilter) - sizeof(__u32) + (numsrc) * sizeof(__u32))
struct group_req {
__u32 gr_interface;
struct __kernel_sockaddr_storage gr_group;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct group_source_req {
__u32 gsr_interface;
struct __kernel_sockaddr_storage gsr_group;
- struct __kernel_sockaddr_storage gsr_source;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct __kernel_sockaddr_storage gsr_source;
};
struct group_filter {
__u32 gf_interface;
- struct __kernel_sockaddr_storage gf_group;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct __kernel_sockaddr_storage gf_group;
__u32 gf_fmode;
__u32 gf_numsrc;
struct __kernel_sockaddr_storage gf_slist[1];
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define GROUP_FILTER_SIZE(numsrc) (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
struct in_pktinfo {
int ipi_ifindex;
- struct in_addr ipi_spec_dst;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct in_addr ipi_spec_dst;
struct in_addr ipi_addr;
};
#define __SOCK_SIZE__ 16
-struct sockaddr_in {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct sockaddr_in {
__kernel_sa_family_t sin_family;
__be16 sin_port;
struct in_addr sin_addr;
- unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
sizeof(unsigned short int) - sizeof(struct in_addr)];
};
#define sin_zero __pad
-#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
-#define IN_CLASSA_MAX 128
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IN_CLASSA_MAX 128
#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET 0xffff0000
#define IN_CLASSB_NSHIFT 16
-#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
#define IN_CLASSB_MAX 65536
#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
#define IN_CLASSC_NET 0xffffff00
-#define IN_CLASSC_NSHIFT 8
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IN_CLASSC_NSHIFT 8
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
#define IN_MULTICAST(a) IN_CLASSD(a)
-#define IN_MULTICAST_NET 0xF0000000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IN_MULTICAST_NET 0xF0000000
#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
#define INADDR_ANY ((unsigned long int) 0x00000000)
-#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
#define INADDR_NONE ((unsigned long int) 0xffffffff)
#define IN_LOOPBACKNET 127
#define INADDR_LOOPBACK 0x7f000001
-#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
#define INADDR_UNSPEC_GROUP 0xe0000000U
#define INADDR_ALLHOSTS_GROUP 0xe0000001U
#define INADDR_ALLRTRS_GROUP 0xe0000002U
-#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU
#include <asm/byteorder.h>
#endif
diff --git a/libc/kernel/uapi/linux/in6.h b/libc/kernel/uapi/linux/in6.h
index 641a69b..8dd53c1 100644
--- a/libc/kernel/uapi/linux/in6.h
+++ b/libc/kernel/uapi/linux/in6.h
@@ -164,46 +164,47 @@
#define IPV6_PMTUDISC_DO 2
#define IPV6_PMTUDISC_PROBE 3
#define IPV6_PMTUDISC_INTERFACE 4
-#define IPV6_FLOWLABEL_MGR 32
+#define IPV6_PMTUDISC_OMIT 5
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IPV6_FLOWLABEL_MGR 32
#define IPV6_FLOWINFO_SEND 33
#define IPV6_IPSEC_POLICY 34
#define IPV6_XFRM_POLICY 35
-#define IPV6_RECVPKTINFO 49
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IPV6_RECVPKTINFO 49
#define IPV6_PKTINFO 50
#define IPV6_RECVHOPLIMIT 51
#define IPV6_HOPLIMIT 52
-#define IPV6_RECVHOPOPTS 53
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IPV6_RECVHOPOPTS 53
#define IPV6_HOPOPTS 54
#define IPV6_RTHDRDSTOPTS 55
#define IPV6_RECVRTHDR 56
-#define IPV6_RTHDR 57
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IPV6_RTHDR 57
#define IPV6_RECVDSTOPTS 58
#define IPV6_DSTOPTS 59
#define IPV6_RECVPATHMTU 60
-#define IPV6_PATHMTU 61
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IPV6_PATHMTU 61
#define IPV6_DONTFRAG 62
#define IPV6_RECVTCLASS 66
#define IPV6_TCLASS 67
-#define IPV6_ADDR_PREFERENCES 72
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IPV6_ADDR_PREFERENCES 72
#define IPV6_PREFER_SRC_TMP 0x0001
#define IPV6_PREFER_SRC_PUBLIC 0x0002
#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
-#define IPV6_PREFER_SRC_COA 0x0004
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IPV6_PREFER_SRC_COA 0x0004
#define IPV6_PREFER_SRC_HOME 0x0400
#define IPV6_PREFER_SRC_CGA 0x0008
#define IPV6_PREFER_SRC_NONCGA 0x0800
-#define IPV6_MINHOPCOUNT 73
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IPV6_MINHOPCOUNT 73
#define IPV6_ORIGDSTADDR 74
#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
#define IPV6_TRANSPARENT 75
-#define IPV6_UNICAST_IF 76
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IPV6_UNICAST_IF 76
#endif
diff --git a/libc/kernel/uapi/linux/kvm.h b/libc/kernel/uapi/linux/kvm.h
index e64f9b5..75331dd 100644
--- a/libc/kernel/uapi/linux/kvm.h
+++ b/libc/kernel/uapi/linux/kvm.h
@@ -171,653 +171,758 @@
#define KVM_EXIT_S390_TSCH 22
#define KVM_EXIT_EPR 23
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_EXIT_SYSTEM_EVENT 24
#define KVM_INTERNAL_ERROR_EMULATION 1
#define KVM_INTERNAL_ERROR_SIMUL_EX 2
#define KVM_INTERNAL_ERROR_DELIVERY_EV 3
-struct kvm_run {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct kvm_run {
__u8 request_interrupt_window;
__u8 padding1[7];
__u32 exit_reason;
- __u8 ready_for_interrupt_injection;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 ready_for_interrupt_injection;
__u8 if_flag;
__u8 padding2[2];
__u64 cr8;
- __u64 apic_base;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 apic_base;
#ifdef __KVM_S390
__u64 psw_mask;
__u64 psw_addr;
-#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
union {
struct {
__u64 hardware_exit_reason;
- } hw;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ } hw;
struct {
__u64 hardware_entry_failure_reason;
} fail_entry;
- struct {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct {
__u32 exception;
__u32 error_code;
} ex;
- struct {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct {
#define KVM_EXIT_IO_IN 0
#define KVM_EXIT_IO_OUT 1
__u8 direction;
- __u8 size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 size;
__u16 port;
__u32 count;
__u64 data_offset;
- } io;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ } io;
struct {
struct kvm_debug_exit_arch arch;
} debug;
- struct {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct {
__u64 phys_addr;
__u8 data[8];
__u32 len;
- __u8 is_write;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 is_write;
} mmio;
struct {
__u64 nr;
- __u64 args[6];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 args[6];
__u64 ret;
__u32 longmode;
__u32 pad;
- } hypercall;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ } hypercall;
struct {
__u64 rip;
__u32 is_write;
- __u32 pad;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 pad;
} tpr_access;
struct {
__u8 icptcode;
- __u16 ipa;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 ipa;
__u32 ipb;
} s390_sieic;
#define KVM_S390_RESET_POR 1
-#define KVM_S390_RESET_CLEAR 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_S390_RESET_CLEAR 2
#define KVM_S390_RESET_SUBSYSTEM 4
#define KVM_S390_RESET_CPU_INIT 8
#define KVM_S390_RESET_IPL 16
- __u64 s390_reset_flags;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 s390_reset_flags;
struct {
__u64 trans_exc_code;
__u32 pgm_code;
- } s390_ucontrol;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ } s390_ucontrol;
struct {
__u32 dcrn;
__u32 data;
- __u8 is_write;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 is_write;
} dcr;
struct {
__u32 suberror;
- __u32 ndata;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 ndata;
__u64 data[16];
} internal;
struct {
- __u64 gprs[32];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 gprs[32];
} osi;
struct {
__u64 nr;
- __u64 ret;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 ret;
__u64 args[9];
} papr_hcall;
struct {
- __u16 subchannel_id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 subchannel_id;
__u16 subchannel_nr;
__u32 io_int_parm;
__u32 io_int_word;
- __u32 ipb;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 ipb;
__u8 dequeued;
} s390_tsch;
struct {
- __u32 epr;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 epr;
} epr;
+ struct {
+#define KVM_SYSTEM_EVENT_SHUTDOWN 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_SYSTEM_EVENT_RESET 2
+ __u32 type;
+ __u64 flags;
+ } system_event;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char padding[256];
};
__u64 kvm_valid_regs;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 kvm_dirty_regs;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
struct kvm_sync_regs regs;
char padding[1024];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} s;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct kvm_coalesced_mmio_zone {
__u64 addr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pad;
};
struct kvm_coalesced_mmio {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 phys_addr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 len;
__u32 pad;
__u8 data[8];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_coalesced_mmio_ring {
__u32 first, last;
struct kvm_coalesced_mmio coalesced_mmio[0];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_COALESCED_MMIO_MAX ((PAGE_SIZE - sizeof(struct kvm_coalesced_mmio_ring)) / sizeof(struct kvm_coalesced_mmio))
struct kvm_translation {
__u64 linear_address;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 physical_address;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 valid;
__u8 writeable;
__u8 usermode;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 pad[5];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct kvm_interrupt {
__u32 irq;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_dirty_log {
__u32 slot;
__u32 padding1;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
void __user *dirty_bitmap;
__u64 padding2;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_signal_mask {
__u32 len;
__u8 sigset[0];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_tpr_access_ctl {
__u32 enabled;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[8];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct kvm_vapic_addr {
__u64 vapic_addr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_MP_STATE_RUNNABLE 0
#define KVM_MP_STATE_UNINITIALIZED 1
#define KVM_MP_STATE_INIT_RECEIVED 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_MP_STATE_HALTED 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_MP_STATE_SIPI_RECEIVED 4
struct kvm_mp_state {
__u32 mp_state;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_s390_psw {
__u64 mask;
__u64 addr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_S390_SIGP_STOP 0xfffe0000u
#define KVM_S390_PROGRAM_INT 0xfffe0001u
#define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_S390_RESTART 0xfffe0003u
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_S390_INT_PFAULT_INIT 0xfffe0004u
+#define KVM_S390_INT_PFAULT_DONE 0xfffe0005u
#define KVM_S390_MCHK 0xfffe1000u
+#define KVM_S390_INT_CLOCK_COMP 0xffff1004u
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_S390_INT_CPU_TIMER 0xffff1005u
#define KVM_S390_INT_VIRTIO 0xffff2603u
#define KVM_S390_INT_SERVICE 0xffff2401u
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_S390_INT_EMERGENCY 0xffff1201u
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u
#define KVM_S390_INT_IO(ai,cssid,ssid,schid) (((schid)) | ((ssid) << 16) | ((cssid) << 18) | ((ai) << 26))
#define KVM_S390_INT_IO_MIN 0x00000000u
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_S390_INT_IO_MAX 0xfffdffffu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_s390_interrupt {
__u32 type;
__u32 parm;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 parm64;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+struct kvm_s390_io_info {
+ __u16 subchannel_id;
+ __u16 subchannel_nr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 io_int_parm;
+ __u32 io_int_word;
+};
+struct kvm_s390_ext_info {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 ext_params;
+ __u32 pad;
+ __u64 ext_params2;
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct kvm_s390_pgm_info {
+ __u64 trans_exc_code;
+ __u64 mon_code;
+ __u64 per_address;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 data_exc_code;
+ __u16 code;
+ __u16 mon_class_nr;
+ __u8 per_code;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 per_atmid;
+ __u8 exc_access_id;
+ __u8 per_access_id;
+ __u8 op_access_id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 pad[3];
+};
+struct kvm_s390_prefix_info {
+ __u32 address;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+struct kvm_s390_extcall_info {
+ __u16 code;
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct kvm_s390_emerg_info {
+ __u16 code;
+};
+struct kvm_s390_mchk_info {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 cr14;
+ __u64 mcic;
+ __u64 failing_storage_address;
+ __u32 ext_damage_code;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 pad;
+ __u8 fixed_logout[16];
+};
+struct kvm_s390_irq {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 type;
+ union {
+ struct kvm_s390_io_info io;
+ struct kvm_s390_ext_info ext;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct kvm_s390_pgm_info pgm;
+ struct kvm_s390_emerg_info emerg;
+ struct kvm_s390_extcall_info extcall;
+ struct kvm_s390_prefix_info prefix;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct kvm_s390_mchk_info mchk;
+ char reserved[64];
+ } u;
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_GUESTDBG_ENABLE 0x00000001
#define KVM_GUESTDBG_SINGLESTEP 0x00000002
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_guest_debug {
__u32 control;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 pad;
struct kvm_guest_debug_arch arch;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
kvm_ioeventfd_flag_nr_datamatch,
kvm_ioeventfd_flag_nr_pio,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
kvm_ioeventfd_flag_nr_deassign,
kvm_ioeventfd_flag_nr_virtio_ccw_notify,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ kvm_ioeventfd_flag_nr_fast_mmio,
kvm_ioeventfd_flag_nr_max,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)
#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)
#define KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY (1 << kvm_ioeventfd_flag_nr_virtio_ccw_notify)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_ioeventfd {
__u64 datamatch;
__u64 addr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 len;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 fd;
__u32 flags;
__u8 pad[36];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_enable_cap {
__u32 cap;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 args[4];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 pad[64];
};
struct kvm_ppc_pvinfo {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 hcall[4];
__u8 pad[108];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_PPC_PAGE_SIZES_MAX_SZ 8
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_ppc_one_page_size {
__u32 page_shift;
__u32 pte_enc;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_ppc_one_seg_page_size {
__u32 page_shift;
__u32 slb_enc;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define KVM_PPC_PAGE_SIZES_REAL 0x00000001
#define KVM_PPC_1T_SEGMENTS 0x00000002
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_ppc_smmu_info {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 flags;
__u32 slb_size;
__u32 pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
#define KVMIO 0xAE
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_VM_S390_UCONTROL 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_VM_PPC_HV 1
#define KVM_VM_PPC_PR 2
#define KVM_S390_SIE_PAGE_OFFSET 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_GET_API_VERSION _IO(KVMIO, 0x00)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CREATE_VM _IO(KVMIO, 0x01)
#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list)
#define KVM_S390_ENABLE_SIE _IO(KVMIO, 0x06)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04)
#define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2)
#define KVM_TRACE_ENABLE __KVM_DEPRECATED_MAIN_W_0x06
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_TRACE_PAUSE __KVM_DEPRECATED_MAIN_0x07
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_TRACE_DISABLE __KVM_DEPRECATED_MAIN_0x08
#define KVM_GET_EMULATED_CPUID _IOWR(KVMIO, 0x09, struct kvm_cpuid2)
#define KVM_CAP_IRQCHIP 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_HLT 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_MMU_SHADOW_CACHE_CONTROL 2
#define KVM_CAP_USER_MEMORY 3
#define KVM_CAP_SET_TSS_ADDR 4
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_VAPIC 6
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_EXT_CPUID 7
#define KVM_CAP_CLOCKSOURCE 8
#define KVM_CAP_NR_VCPUS 9
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_NR_MEMSLOTS 10
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PIT 11
#define KVM_CAP_NOP_IO_DELAY 12
#define KVM_CAP_PV_MMU 13
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_MP_STATE 14
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_COALESCED_MMIO 15
#define KVM_CAP_SYNC_MMU 16
#define KVM_CAP_DEVICE_ASSIGNMENT 17
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_IOMMU 18
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __KVM_HAVE_MSI
#define KVM_CAP_DEVICE_MSI 20
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __KVM_HAVE_USER_NMI
#define KVM_CAP_USER_NMI 22
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __KVM_HAVE_GUEST_DEBUG
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_SET_GUEST_DEBUG 23
#endif
#ifdef __KVM_HAVE_PIT
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_REINJECT_CONTROL 24
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
#define KVM_CAP_IRQ_ROUTING 25
#define KVM_CAP_IRQ_INJECT_STATUS 26
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_DEVICE_DEASSIGNMENT 27
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __KVM_HAVE_MSIX
#define KVM_CAP_DEVICE_MSIX 28
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_ASSIGN_DEV_IRQ 29
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30
#ifdef __KVM_HAVE_MCE
#define KVM_CAP_MCE 31
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_IRQFD 32
#ifdef __KVM_HAVE_PIT
#define KVM_CAP_PIT2 33
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_SET_BOOT_CPU_ID 34
#ifdef __KVM_HAVE_PIT_STATE2
#define KVM_CAP_PIT_STATE2 35
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_IOEVENTFD 36
#define KVM_CAP_SET_IDENTITY_MAP_ADDR 37
#ifdef __KVM_HAVE_XEN_HVM
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_XEN_HVM 38
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
#define KVM_CAP_ADJUST_CLOCK 39
#define KVM_CAP_INTERNAL_ERROR_DATA 40
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __KVM_HAVE_VCPU_EVENTS
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_VCPU_EVENTS 41
#endif
#define KVM_CAP_S390_PSW 42
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_SEGSTATE 43
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_HYPERV 44
#define KVM_CAP_HYPERV_VAPIC 45
#define KVM_CAP_HYPERV_SPIN 46
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PCI_SEGMENT 47
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_PAIRED_SINGLES 48
#define KVM_CAP_INTR_SHADOW 49
#ifdef __KVM_HAVE_DEBUGREGS
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_DEBUGREGS 50
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
#define KVM_CAP_X86_ROBUST_SINGLESTEP 51
#define KVM_CAP_PPC_OSI 52
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_UNSET_IRQ 53
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_ENABLE_CAP 54
#ifdef __KVM_HAVE_XSAVE
#define KVM_CAP_XSAVE 55
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __KVM_HAVE_XCRS
#define KVM_CAP_XCRS 56
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_GET_PVINFO 57
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_IRQ_LEVEL 58
#define KVM_CAP_ASYNC_PF 59
#define KVM_CAP_TSC_CONTROL 60
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_GET_TSC_KHZ 61
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_BOOKE_SREGS 62
#define KVM_CAP_SPAPR_TCE 63
#define KVM_CAP_PPC_SMT 64
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_RMA 65
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_MAX_VCPUS 66
#define KVM_CAP_PPC_HIOR 67
#define KVM_CAP_PPC_PAPR 68
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_SW_TLB 69
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_ONE_REG 70
#define KVM_CAP_S390_GMAP 71
#define KVM_CAP_TSC_DEADLINE_TIMER 72
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_S390_UCONTROL 73
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_SYNC_REGS 74
#define KVM_CAP_PCI_2_3 75
#define KVM_CAP_KVMCLOCK_CTRL 76
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_SIGNAL_MSI 77
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_GET_SMMU_INFO 78
#define KVM_CAP_S390_COW 79
#define KVM_CAP_PPC_ALLOC_HTAB 80
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef __KVM_HAVE_READONLY_MEM
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_READONLY_MEM 81
#endif
#define KVM_CAP_IRQFD_RESAMPLE 82
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_BOOKE_WATCHDOG 83
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_HTAB_FD 84
#define KVM_CAP_S390_CSS_SUPPORT 85
#define KVM_CAP_PPC_EPR 86
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_ARM_PSCI 87
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_ARM_SET_DEVICE_ADDR 88
#define KVM_CAP_DEVICE_CTRL 89
#define KVM_CAP_IRQ_MPIC 90
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_PPC_RTAS 91
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_IRQ_XICS 92
#define KVM_CAP_ARM_EL1_32BIT 93
#define KVM_CAP_SPAPR_MULTITCE 94
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_EXT_EMUL_CPUID 95
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_CAP_HYPERV_TIME 96
+#define KVM_CAP_IOAPIC_POLARITY_IGNORED 97
+#define KVM_CAP_ENABLE_CAP_VM 98
+#define KVM_CAP_S390_IRQCHIP 99
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_CAP_IOEVENTFD_NO_LENGTH 100
+#define KVM_CAP_VM_ATTRIBUTES 101
+#define KVM_CAP_ARM_PSCI_0_2 102
+#define KVM_CAP_PPC_FIXUP_HCALL 103
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef KVM_CAP_IRQ_ROUTING
struct kvm_irq_routing_irqchip {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 irqchip;
__u32 pin;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct kvm_irq_routing_msi {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 address_lo;
__u32 address_hi;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 data;
__u32 pad;
+};
+struct kvm_irq_routing_s390_adapter {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 ind_addr;
+ __u64 summary_addr;
+ __u64 ind_offset;
+ __u32 summary_offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 adapter_id;
};
#define KVM_IRQ_ROUTING_IRQCHIP 1
#define KVM_IRQ_ROUTING_MSI 2
-struct kvm_irq_routing_entry {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_IRQ_ROUTING_S390_ADAPTER 3
+struct kvm_irq_routing_entry {
__u32 gsi;
__u32 type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u32 pad;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
struct kvm_irq_routing_irqchip irqchip;
- struct kvm_irq_routing_msi msi;
- __u32 pad[8];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct kvm_irq_routing_msi msi;
+ struct kvm_irq_routing_s390_adapter adapter;
+ __u32 pad[8];
} u;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct kvm_irq_routing {
__u32 nr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_irq_routing_entry entries[0];
};
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef KVM_CAP_MCE
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_x86_mce {
__u64 status;
__u64 addr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 misc;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 mcg_status;
__u8 bank;
__u8 pad1[7];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 pad2[3];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#endif
#ifdef KVM_CAP_XEN_HVM
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_xen_hvm_config {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u32 msr;
__u64 blob_addr_32;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 blob_addr_64;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 blob_size_32;
__u8 blob_size_64;
__u8 pad2[30];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
#define KVM_IRQFD_FLAG_RESAMPLE (1 << 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_irqfd {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 fd;
__u32 gsi;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 resamplefd;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 pad[16];
};
struct kvm_clock_data {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 clock;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u32 pad[9];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_MMU_FSL_BOOKE_NOHV 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_MMU_FSL_BOOKE_HV 1
struct kvm_config_tlb {
__u64 params;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 array;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 mmu_type;
__u32 array_len;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_dirty_tlb {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 bitmap;
__u32 num_dirty;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARCH_MASK 0xff00000000000000ULL
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_GENERIC 0x0000000000000000ULL
#define KVM_REG_PPC 0x1000000000000000ULL
#define KVM_REG_X86 0x2000000000000000ULL
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_IA64 0x3000000000000000ULL
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_ARM 0x4000000000000000ULL
#define KVM_REG_S390 0x5000000000000000ULL
#define KVM_REG_ARM64 0x6000000000000000ULL
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_MIPS 0x7000000000000000ULL
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_SIZE_SHIFT 52
#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL
#define KVM_REG_SIZE_U8 0x0000000000000000ULL
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_SIZE_U16 0x0010000000000000ULL
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_SIZE_U32 0x0020000000000000ULL
#define KVM_REG_SIZE_U64 0x0030000000000000ULL
#define KVM_REG_SIZE_U128 0x0040000000000000ULL
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_SIZE_U256 0x0050000000000000ULL
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_REG_SIZE_U512 0x0060000000000000ULL
#define KVM_REG_SIZE_U1024 0x0070000000000000ULL
struct kvm_reg_list {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 n;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 reg[0];
};
struct kvm_one_reg {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 addr;
};
struct kvm_msi {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 address_lo;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 address_hi;
__u32 data;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 pad[16];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct kvm_arm_device_addr {
__u64 id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 addr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define KVM_CREATE_DEVICE_TEST 1
struct kvm_create_device {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 fd;
__u32 flags;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct kvm_device_attr {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u32 group;
__u64 attr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 addr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define KVM_DEV_TYPE_FSL_MPIC_20 1
#define KVM_DEV_TYPE_FSL_MPIC_42 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_TYPE_XICS 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_TYPE_VFIO 4
#define KVM_DEV_VFIO_GROUP 1
#define KVM_DEV_VFIO_GROUP_ADD 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_VFIO_GROUP_DEL 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define KVM_DEV_TYPE_ARM_VGIC_V2 5
+#define KVM_DEV_TYPE_FLIC 6
#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/kvm_para.h b/libc/kernel/uapi/linux/kvm_para.h
index d973996..be05b85 100644
--- a/libc/kernel/uapi/linux/kvm_para.h
+++ b/libc/kernel/uapi/linux/kvm_para.h
@@ -29,6 +29,10 @@
#define KVM_HC_FEATURES 3
#define KVM_HC_PPC_MAP_MAGIC_PAGE 4
#define KVM_HC_KICK_CPU 5
-#include <asm/kvm_para.h>
+#define KVM_HC_MIPS_GET_CLOCK_FREQ 6
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define KVM_HC_MIPS_EXIT_VM 7
+#define KVM_HC_MIPS_CONSOLE_OUTPUT 8
+#include <asm/kvm_para.h>
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/l2tp.h b/libc/kernel/uapi/linux/l2tp.h
index 818cda4..0bc4dd3 100644
--- a/libc/kernel/uapi/linux/l2tp.h
+++ b/libc/kernel/uapi/linux/l2tp.h
@@ -106,54 +106,56 @@
L2TP_ATTR_IP6_SADDR,
L2TP_ATTR_IP6_DADDR,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ L2TP_ATTR_UDP_ZERO_CSUM6_TX,
+ L2TP_ATTR_UDP_ZERO_CSUM6_RX,
__L2TP_ATTR_MAX,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define L2TP_ATTR_MAX (__L2TP_ATTR_MAX - 1)
enum {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_ATTR_STATS_NONE,
L2TP_ATTR_TX_PACKETS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_ATTR_TX_BYTES,
L2TP_ATTR_TX_ERRORS,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_ATTR_RX_PACKETS,
L2TP_ATTR_RX_BYTES,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_ATTR_RX_SEQ_DISCARDS,
L2TP_ATTR_RX_OOS_PACKETS,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_ATTR_RX_ERRORS,
__L2TP_ATTR_STATS_MAX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define L2TP_ATTR_STATS_MAX (__L2TP_ATTR_STATS_MAX - 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum l2tp_pwtype {
L2TP_PWTYPE_NONE = 0x0000,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_PWTYPE_ETH_VLAN = 0x0004,
L2TP_PWTYPE_ETH = 0x0005,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_PWTYPE_PPP = 0x0007,
L2TP_PWTYPE_PPP_AC = 0x0008,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_PWTYPE_IP = 0x000b,
__L2TP_PWTYPE_MAX
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum l2tp_l2spec_type {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_L2SPECTYPE_NONE,
L2TP_L2SPECTYPE_DEFAULT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum l2tp_encap_type {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_ENCAPTYPE_UDP,
L2TP_ENCAPTYPE_IP,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum l2tp_seqmode {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_SEQ_NONE = 0,
L2TP_SEQ_IP = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
L2TP_SEQ_ALL = 2,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define L2TP_GENL_NAME "l2tp"
#define L2TP_GENL_VERSION 0x1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/libc-compat.h b/libc/kernel/uapi/linux/libc-compat.h
index 826b763..7854520 100644
--- a/libc/kernel/uapi/linux/libc-compat.h
+++ b/libc/kernel/uapi/linux/libc-compat.h
@@ -41,13 +41,20 @@
#define __UAPI_DEF_IPPROTO_V6 1
#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#ifdef _SYS_XATTR_H
+#define __UAPI_DEF_XATTR 0
+#else
+#define __UAPI_DEF_XATTR 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
#else
#define __UAPI_DEF_IN6_ADDR 1
#define __UAPI_DEF_IN6_ADDR_ALT 1
-#define __UAPI_DEF_SOCKADDR_IN6 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __UAPI_DEF_SOCKADDR_IN6 1
#define __UAPI_DEF_IPV6_MREQ 1
#define __UAPI_DEF_IPPROTO_V6 1
-#endif
-#endif
+#define __UAPI_DEF_XATTR 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#endif
diff --git a/libc/kernel/uapi/linux/memfd.h b/libc/kernel/uapi/linux/memfd.h
new file mode 100644
index 0000000..2011dab
--- /dev/null
+++ b/libc/kernel/uapi/linux/memfd.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_MEMFD_H
+#define _UAPI_LINUX_MEMFD_H
+#define MFD_CLOEXEC 0x0001U
+#define MFD_ALLOW_SEALING 0x0002U
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/linux/mpls.h b/libc/kernel/uapi/linux/mpls.h
new file mode 100644
index 0000000..e84d8e7
--- /dev/null
+++ b/libc/kernel/uapi/linux/mpls.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_MPLS_H
+#define _UAPI_MPLS_H
+#include <linux/types.h>
+#include <asm/byteorder.h>
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct mpls_label {
+ __be32 entry;
+};
+#define MPLS_LS_LABEL_MASK 0xFFFFF000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MPLS_LS_LABEL_SHIFT 12
+#define MPLS_LS_TC_MASK 0x00000E00
+#define MPLS_LS_TC_SHIFT 9
+#define MPLS_LS_S_MASK 0x00000100
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MPLS_LS_S_SHIFT 8
+#define MPLS_LS_TTL_MASK 0x000000FF
+#define MPLS_LS_TTL_SHIFT 0
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/neighbour.h b/libc/kernel/uapi/linux/neighbour.h
index d84de0c..f822453 100644
--- a/libc/kernel/uapi/linux/neighbour.h
+++ b/libc/kernel/uapi/linux/neighbour.h
@@ -44,111 +44,112 @@
NDA_PORT,
NDA_VNI,
NDA_IFINDEX,
- __NDA_MAX
+ NDA_MASTER,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __NDA_MAX
};
#define NDA_MAX (__NDA_MAX - 1)
#define NTF_USE 0x01
-#define NTF_PROXY 0x08
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NTF_PROXY 0x08
#define NTF_ROUTER 0x80
#define NTF_SELF 0x02
#define NTF_MASTER 0x04
-#define NUD_INCOMPLETE 0x01
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NUD_INCOMPLETE 0x01
#define NUD_REACHABLE 0x02
#define NUD_STALE 0x04
#define NUD_DELAY 0x08
-#define NUD_PROBE 0x10
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NUD_PROBE 0x10
#define NUD_FAILED 0x20
#define NUD_NOARP 0x40
#define NUD_PERMANENT 0x80
-#define NUD_NONE 0x00
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NUD_NONE 0x00
struct nda_cacheinfo {
__u32 ndm_confirmed;
__u32 ndm_used;
- __u32 ndm_updated;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 ndm_updated;
__u32 ndm_refcnt;
};
struct ndt_stats {
- __u64 ndts_allocs;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 ndts_allocs;
__u64 ndts_destroys;
__u64 ndts_hash_grows;
__u64 ndts_res_failed;
- __u64 ndts_lookups;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 ndts_lookups;
__u64 ndts_hits;
__u64 ndts_rcv_probes_mcast;
__u64 ndts_rcv_probes_ucast;
- __u64 ndts_periodic_gc_runs;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 ndts_periodic_gc_runs;
__u64 ndts_forced_gc_runs;
};
enum {
- NDTPA_UNSPEC,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NDTPA_UNSPEC,
NDTPA_IFINDEX,
NDTPA_REFCNT,
NDTPA_REACHABLE_TIME,
- NDTPA_BASE_REACHABLE_TIME,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NDTPA_BASE_REACHABLE_TIME,
NDTPA_RETRANS_TIME,
NDTPA_GC_STALETIME,
NDTPA_DELAY_PROBE_TIME,
- NDTPA_QUEUE_LEN,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NDTPA_QUEUE_LEN,
NDTPA_APP_PROBES,
NDTPA_UCAST_PROBES,
NDTPA_MCAST_PROBES,
- NDTPA_ANYCAST_DELAY,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NDTPA_ANYCAST_DELAY,
NDTPA_PROXY_DELAY,
NDTPA_PROXY_QLEN,
NDTPA_LOCKTIME,
- NDTPA_QUEUE_LENBYTES,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NDTPA_QUEUE_LENBYTES,
__NDTPA_MAX
};
#define NDTPA_MAX (__NDTPA_MAX - 1)
-struct ndtmsg {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct ndtmsg {
__u8 ndtm_family;
__u8 ndtm_pad1;
__u16 ndtm_pad2;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct ndt_config {
__u16 ndtc_key_len;
__u16 ndtc_entry_size;
- __u32 ndtc_entries;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 ndtc_entries;
__u32 ndtc_last_flush;
__u32 ndtc_last_rand;
__u32 ndtc_hash_rnd;
- __u32 ndtc_hash_mask;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 ndtc_hash_mask;
__u32 ndtc_hash_chain_gc;
__u32 ndtc_proxy_qlen;
};
-enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
NDTA_UNSPEC,
NDTA_NAME,
NDTA_THRESH1,
- NDTA_THRESH2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NDTA_THRESH2,
NDTA_THRESH3,
NDTA_CONFIG,
NDTA_PARMS,
- NDTA_STATS,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NDTA_STATS,
NDTA_GC_INTERVAL,
__NDTA_MAX
};
-#define NDTA_MAX (__NDTA_MAX - 1)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NDTA_MAX (__NDTA_MAX - 1)
#endif
diff --git a/libc/kernel/uapi/linux/netdevice.h b/libc/kernel/uapi/linux/netdevice.h
index f2472fc..0bc0ae2 100644
--- a/libc/kernel/uapi/linux/netdevice.h
+++ b/libc/kernel/uapi/linux/netdevice.h
@@ -37,4 +37,9 @@
IF_PORT_100BASEFX
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+#define NET_ADDR_PERM 0
+#define NET_ADDR_RANDOM 1
+#define NET_ADDR_STOLEN 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NET_ADDR_SET 3
#endif
diff --git a/libc/kernel/uapi/linux/netfilter/ipset/ip_set.h b/libc/kernel/uapi/linux/netfilter/ipset/ip_set.h
index d85c85b..5a8468c 100644
--- a/libc/kernel/uapi/linux/netfilter/ipset/ip_set.h
+++ b/libc/kernel/uapi/linux/netfilter/ipset/ip_set.h
@@ -88,187 +88,199 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_CADT_FLAGS,
IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO,
+ IPSET_ATTR_MARK,
+ IPSET_ATTR_MARKMASK,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_CADT_MAX = 16,
IPSET_ATTR_GC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_HASHSIZE,
IPSET_ATTR_MAXELEM,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_NETMASK,
IPSET_ATTR_PROBES,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_RESIZE,
IPSET_ATTR_SIZE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_ELEMENTS,
IPSET_ATTR_REFERENCES,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_MEMSIZE,
__IPSET_ATTR_CREATE_MAX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define IPSET_ATTR_CREATE_MAX (__IPSET_ATTR_CREATE_MAX - 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
IPSET_ATTR_ETHER = IPSET_ATTR_CADT_MAX + 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_NAME,
IPSET_ATTR_NAMEREF,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_IP2,
IPSET_ATTR_CIDR2,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_IP2_TO,
IPSET_ATTR_IFACE,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_BYTES,
IPSET_ATTR_PACKETS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_COMMENT,
__IPSET_ATTR_ADT_MAX,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
IPSET_ATTR_IPADDR_IPV4 = IPSET_ATTR_UNSPEC + 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ATTR_IPADDR_IPV6,
__IPSET_ATTR_IPADDR_MAX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define IPSET_ATTR_IPADDR_MAX (__IPSET_ATTR_IPADDR_MAX - 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum ipset_errno {
IPSET_ERR_PRIVATE = 4096,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ERR_PROTOCOL,
IPSET_ERR_FIND_TYPE,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ERR_MAX_SETS,
IPSET_ERR_BUSY,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ERR_EXIST_SETNAME2,
IPSET_ERR_TYPE_MISMATCH,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ERR_EXIST,
IPSET_ERR_INVALID_CIDR,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ERR_INVALID_NETMASK,
IPSET_ERR_INVALID_FAMILY,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ERR_TIMEOUT,
IPSET_ERR_REFERENCED,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ERR_IPADDR_IPV4,
IPSET_ERR_IPADDR_IPV6,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ERR_COUNTER,
IPSET_ERR_COMMENT,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IPSET_ERR_INVALID_MARKMASK,
IPSET_ERR_TYPE_SPECIFIC = 4352,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum ipset_cmd_flags {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_BIT_EXIST = 0,
IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
IPSET_FLAG_BIT_LIST_SETNAME = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_BIT_LIST_HEADER = 2,
IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
IPSET_FLAG_BIT_SKIP_COUNTER_UPDATE = 3,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_SKIP_COUNTER_UPDATE =
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
(1 << IPSET_FLAG_BIT_SKIP_COUNTER_UPDATE),
IPSET_FLAG_BIT_SKIP_SUBCOUNTER_UPDATE = 4,
IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE =
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
(1 << IPSET_FLAG_BIT_SKIP_SUBCOUNTER_UPDATE),
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_BIT_MATCH_COUNTERS = 5,
IPSET_FLAG_MATCH_COUNTERS = (1 << IPSET_FLAG_BIT_MATCH_COUNTERS),
IPSET_FLAG_BIT_RETURN_NOMATCH = 7,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_RETURN_NOMATCH = (1 << IPSET_FLAG_BIT_RETURN_NOMATCH),
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_CMD_MAX = 15,
};
enum ipset_cadt_flags {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_BIT_BEFORE = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
IPSET_FLAG_BIT_PHYSDEV = 1,
IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_BIT_NOMATCH = 2,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
IPSET_FLAG_BIT_WITH_COUNTERS = 3,
IPSET_FLAG_WITH_COUNTERS = (1 << IPSET_FLAG_BIT_WITH_COUNTERS),
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_FLAG_BIT_WITH_COMMENT = 4,
- IPSET_FLAG_WITH_COMMENT = (1 << IPSET_FLAG_BIT_WITH_COMMENT),
- IPSET_FLAG_CADT_MAX = 15,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IPSET_FLAG_WITH_COMMENT = (1 << IPSET_FLAG_BIT_WITH_COMMENT),
+ IPSET_FLAG_BIT_WITH_FORCEADD = 5,
+ IPSET_FLAG_WITH_FORCEADD = (1 << IPSET_FLAG_BIT_WITH_FORCEADD),
+ IPSET_FLAG_CADT_MAX = 15,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+enum ipset_create_flags {
+ IPSET_CREATE_FLAG_BIT_FORCEADD = 0,
+ IPSET_CREATE_FLAG_FORCEADD = (1 << IPSET_CREATE_FLAG_BIT_FORCEADD),
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IPSET_CREATE_FLAG_BIT_MAX = 7,
+};
enum ipset_adt {
IPSET_ADD,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_DEL,
IPSET_TEST,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_ADT_MAX,
IPSET_CREATE = IPSET_ADT_MAX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_CADT_MAX,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef __u16 ip_set_id_t;
#define IPSET_INVALID_ID 65535
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum ip_set_dim {
IPSET_DIM_ZERO = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_DIM_ONE,
IPSET_DIM_TWO,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_DIM_THREE,
IPSET_DIM_MAX = 6,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_BIT_RETURN_NOMATCH = 7,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum ip_set_kopt {
IPSET_INV_MATCH = (1 << IPSET_DIM_ZERO),
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH),
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_COUNTER_NONE = 0,
IPSET_COUNTER_EQ,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_COUNTER_NE,
IPSET_COUNTER_LT,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IPSET_COUNTER_GT,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ip_set_counter_match {
__u8 op;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 value;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SO_IP_SET 83
union ip_set_name_index {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char name[IPSET_MAXNAMELEN];
ip_set_id_t index;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define IP_SET_OP_GET_BYNAME 0x00000006
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ip_set_req_get_set {
unsigned int op;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int version;
union ip_set_name_index set;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define IP_SET_OP_GET_BYINDEX 0x00000007
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IP_SET_OP_GET_FNAME 0x00000008
struct ip_set_req_get_set_family {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int op;
unsigned int version;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int family;
union ip_set_name_index set;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define IP_SET_OP_VERSION 0x00000100
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ip_set_req_version {
unsigned int op;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int version;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/netfilter/nf_tables.h b/libc/kernel/uapi/linux/netfilter/nf_tables.h
index 34632dd..e2abfa0 100644
--- a/libc/kernel/uapi/linux/netfilter/nf_tables.h
+++ b/libc/kernel/uapi/linux/netfilter/nf_tables.h
@@ -19,130 +19,145 @@
#ifndef _LINUX_NF_TABLES_H
#define _LINUX_NF_TABLES_H
#define NFT_CHAIN_MAXNAMELEN 32
-enum nft_registers {
+#define NFT_USERDATA_MAXLEN 256
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nft_registers {
NFT_REG_VERDICT,
NFT_REG_1,
NFT_REG_2,
- NFT_REG_3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_REG_3,
NFT_REG_4,
__NFT_REG_MAX
};
-#define NFT_REG_MAX (__NFT_REG_MAX - 1)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NFT_REG_MAX (__NFT_REG_MAX - 1)
enum nft_verdicts {
NFT_CONTINUE = -1,
NFT_BREAK = -2,
- NFT_JUMP = -3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_JUMP = -3,
NFT_GOTO = -4,
NFT_RETURN = -5,
};
-enum nf_tables_msg_types {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nf_tables_msg_types {
NFT_MSG_NEWTABLE,
NFT_MSG_GETTABLE,
NFT_MSG_DELTABLE,
- NFT_MSG_NEWCHAIN,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_MSG_NEWCHAIN,
NFT_MSG_GETCHAIN,
NFT_MSG_DELCHAIN,
NFT_MSG_NEWRULE,
- NFT_MSG_GETRULE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_MSG_GETRULE,
NFT_MSG_DELRULE,
NFT_MSG_NEWSET,
NFT_MSG_GETSET,
- NFT_MSG_DELSET,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_MSG_DELSET,
NFT_MSG_NEWSETELEM,
NFT_MSG_GETSETELEM,
NFT_MSG_DELSETELEM,
- NFT_MSG_MAX,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_MSG_MAX,
};
enum nft_list_attributes {
NFTA_LIST_UNPEC,
- NFTA_LIST_ELEM,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFTA_LIST_ELEM,
__NFTA_LIST_MAX
};
#define NFTA_LIST_MAX (__NFTA_LIST_MAX - 1)
-enum nft_hook_attributes {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nft_hook_attributes {
NFTA_HOOK_UNSPEC,
NFTA_HOOK_HOOKNUM,
NFTA_HOOK_PRIORITY,
- __NFTA_HOOK_MAX
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __NFTA_HOOK_MAX
};
#define NFTA_HOOK_MAX (__NFTA_HOOK_MAX - 1)
enum nft_table_flags {
- NFT_TABLE_F_DORMANT = 0x1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_TABLE_F_DORMANT = 0x1,
};
enum nft_table_attributes {
NFTA_TABLE_UNSPEC,
- NFTA_TABLE_NAME,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFTA_TABLE_NAME,
NFTA_TABLE_FLAGS,
NFTA_TABLE_USE,
__NFTA_TABLE_MAX
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1)
enum nft_chain_attributes {
NFTA_CHAIN_UNSPEC,
- NFTA_CHAIN_TABLE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFTA_CHAIN_TABLE,
NFTA_CHAIN_HANDLE,
NFTA_CHAIN_NAME,
NFTA_CHAIN_HOOK,
- NFTA_CHAIN_POLICY,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFTA_CHAIN_POLICY,
NFTA_CHAIN_USE,
NFTA_CHAIN_TYPE,
NFTA_CHAIN_COUNTERS,
- __NFTA_CHAIN_MAX
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __NFTA_CHAIN_MAX
};
#define NFTA_CHAIN_MAX (__NFTA_CHAIN_MAX - 1)
enum nft_rule_attributes {
- NFTA_RULE_UNSPEC,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFTA_RULE_UNSPEC,
NFTA_RULE_TABLE,
NFTA_RULE_CHAIN,
NFTA_RULE_HANDLE,
- NFTA_RULE_EXPRESSIONS,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFTA_RULE_EXPRESSIONS,
NFTA_RULE_COMPAT,
NFTA_RULE_POSITION,
+ NFTA_RULE_USERDATA,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NFTA_RULE_MAX
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1)
enum nft_rule_compat_flags {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_RULE_COMPAT_F_INV = (1 << 1),
NFT_RULE_COMPAT_F_MASK = NFT_RULE_COMPAT_F_INV,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum nft_rule_compat_attributes {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFTA_RULE_COMPAT_UNSPEC,
NFTA_RULE_COMPAT_PROTO,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFTA_RULE_COMPAT_FLAGS,
__NFTA_RULE_COMPAT_MAX
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define NFTA_RULE_COMPAT_MAX (__NFTA_RULE_COMPAT_MAX - 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nft_set_flags {
NFT_SET_ANONYMOUS = 0x1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_SET_CONSTANT = 0x2,
NFT_SET_INTERVAL = 0x4,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_SET_MAP = 0x8,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nft_set_policies {
+ NFT_SET_POL_PERFORMANCE,
+ NFT_SET_POL_MEMORY,
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nft_set_desc_attributes {
+ NFTA_SET_DESC_UNSPEC,
+ NFTA_SET_DESC_SIZE,
+ __NFTA_SET_DESC_MAX
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+#define NFTA_SET_DESC_MAX (__NFTA_SET_DESC_MAX - 1)
enum nft_set_attributes {
NFTA_SET_UNSPEC,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -154,30 +169,35 @@
NFTA_SET_KEY_LEN,
NFTA_SET_DATA_TYPE,
NFTA_SET_DATA_LEN,
- __NFTA_SET_MAX
+ NFTA_SET_POLICY,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFTA_SET_DESC,
+ NFTA_SET_ID,
+ __NFTA_SET_MAX
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFTA_SET_MAX (__NFTA_SET_MAX - 1)
enum nft_set_elem_flags {
NFT_SET_ELEM_INTERVAL_END = 0x1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nft_set_elem_attributes {
NFTA_SET_ELEM_UNSPEC,
NFTA_SET_ELEM_KEY,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFTA_SET_ELEM_DATA,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFTA_SET_ELEM_FLAGS,
__NFTA_SET_ELEM_MAX
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFTA_SET_ELEM_MAX (__NFTA_SET_ELEM_MAX - 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nft_set_elem_list_attributes {
NFTA_SET_ELEM_LIST_UNSPEC,
NFTA_SET_ELEM_LIST_TABLE,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFTA_SET_ELEM_LIST_SET,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFTA_SET_ELEM_LIST_ELEMENTS,
+ NFTA_SET_ELEM_LIST_SET_ID,
__NFTA_SET_ELEM_LIST_MAX
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -279,90 +299,95 @@
NFTA_LOOKUP_SET,
NFTA_LOOKUP_SREG,
NFTA_LOOKUP_DREG,
- __NFTA_LOOKUP_MAX
+ NFTA_LOOKUP_SET_ID,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __NFTA_LOOKUP_MAX
};
#define NFTA_LOOKUP_MAX (__NFTA_LOOKUP_MAX - 1)
enum nft_payload_bases {
- NFT_PAYLOAD_LL_HEADER,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_PAYLOAD_LL_HEADER,
NFT_PAYLOAD_NETWORK_HEADER,
NFT_PAYLOAD_TRANSPORT_HEADER,
};
-enum nft_payload_attributes {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nft_payload_attributes {
NFTA_PAYLOAD_UNSPEC,
NFTA_PAYLOAD_DREG,
NFTA_PAYLOAD_BASE,
- NFTA_PAYLOAD_OFFSET,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFTA_PAYLOAD_OFFSET,
NFTA_PAYLOAD_LEN,
__NFTA_PAYLOAD_MAX
};
-#define NFTA_PAYLOAD_MAX (__NFTA_PAYLOAD_MAX - 1)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NFTA_PAYLOAD_MAX (__NFTA_PAYLOAD_MAX - 1)
enum nft_exthdr_attributes {
NFTA_EXTHDR_UNSPEC,
NFTA_EXTHDR_DREG,
- NFTA_EXTHDR_TYPE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFTA_EXTHDR_TYPE,
NFTA_EXTHDR_OFFSET,
NFTA_EXTHDR_LEN,
__NFTA_EXTHDR_MAX
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define NFTA_EXTHDR_MAX (__NFTA_EXTHDR_MAX - 1)
enum nft_meta_keys {
NFT_META_LEN,
- NFT_META_PROTOCOL,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_META_PROTOCOL,
NFT_META_PRIORITY,
NFT_META_MARK,
NFT_META_IIF,
- NFT_META_OIF,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_META_OIF,
NFT_META_IIFNAME,
NFT_META_OIFNAME,
NFT_META_IIFTYPE,
- NFT_META_OIFTYPE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_META_OIFTYPE,
NFT_META_SKUID,
NFT_META_SKGID,
NFT_META_NFTRACE,
- NFT_META_RTCLASSID,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_META_RTCLASSID,
NFT_META_SECMARK,
NFT_META_NFPROTO,
NFT_META_L4PROTO,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFT_META_BRI_IIFNAME,
+ NFT_META_BRI_OIFNAME,
+};
enum nft_meta_attributes {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFTA_META_UNSPEC,
NFTA_META_DREG,
NFTA_META_KEY,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFTA_META_SREG,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NFTA_META_MAX
};
#define NFTA_META_MAX (__NFTA_META_MAX - 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nft_ct_keys {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_CT_STATE,
NFT_CT_DIRECTION,
NFT_CT_STATUS,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_CT_MARK,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_CT_SECMARK,
NFT_CT_EXPIRATION,
NFT_CT_HELPER,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_CT_L3PROTOCOL,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_CT_SRC,
NFT_CT_DST,
NFT_CT_PROTOCOL,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_CT_PROTO_SRC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFT_CT_PROTO_DST,
+ NFT_CT_LABELS,
};
enum nft_ct_attributes {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/netfilter/nfnetlink.h b/libc/kernel/uapi/linux/netfilter/nfnetlink.h
index c04f62c..6f6e887 100644
--- a/libc/kernel/uapi/linux/netfilter/nfnetlink.h
+++ b/libc/kernel/uapi/linux/netfilter/nfnetlink.h
@@ -42,37 +42,39 @@
NFNLGRP_NFTABLES,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNLGRP_NFTABLES NFNLGRP_NFTABLES
+ NFNLGRP_ACCT_QUOTA,
+#define NFNLGRP_ACCT_QUOTA NFNLGRP_ACCT_QUOTA
__NFNLGRP_MAX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct nfgenmsg {
__u8 nfgen_family;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 version;
__be16 res_id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define NFNETLINK_V0 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
#define NFNL_MSG_TYPE(x) (x & 0x00ff)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNL_SUBSYS_NONE 0
#define NFNL_SUBSYS_CTNETLINK 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNL_SUBSYS_CTNETLINK_EXP 2
#define NFNL_SUBSYS_QUEUE 3
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNL_SUBSYS_ULOG 4
#define NFNL_SUBSYS_OSF 5
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNL_SUBSYS_IPSET 6
#define NFNL_SUBSYS_ACCT 7
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
#define NFNL_SUBSYS_CTHELPER 9
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNL_SUBSYS_NFTABLES 10
#define NFNL_SUBSYS_NFT_COMPAT 11
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNL_SUBSYS_COUNT 12
#define NFNL_MSG_BATCH_BEGIN NLMSG_MIN_TYPE
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFNL_MSG_BATCH_END NLMSG_MIN_TYPE+1
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/netfilter/nfnetlink_acct.h b/libc/kernel/uapi/linux/netfilter/nfnetlink_acct.h
index 01f13ef..2598881 100644
--- a/libc/kernel/uapi/linux/netfilter/nfnetlink_acct.h
+++ b/libc/kernel/uapi/linux/netfilter/nfnetlink_acct.h
@@ -28,16 +28,26 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFNL_MSG_ACCT_GET_CTRZERO,
NFNL_MSG_ACCT_DEL,
+ NFNL_MSG_ACCT_OVERQUOTA,
NFNL_MSG_ACCT_MAX
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+enum nfnl_acct_flags {
+ NFACCT_F_QUOTA_PKTS = (1 << 0),
+ NFACCT_F_QUOTA_BYTES = (1 << 1),
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFACCT_F_OVERQUOTA = (1 << 2),
+};
enum nfnl_acct_type {
NFACCT_UNSPEC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFACCT_NAME,
NFACCT_PKTS,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFACCT_BYTES,
NFACCT_USE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NFACCT_FLAGS,
+ NFACCT_QUOTA,
__NFACCT_MAX
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/nfc.h b/libc/kernel/uapi/linux/nfc.h
index 88979de..d4cc7a3 100644
--- a/libc/kernel/uapi/linux/nfc.h
+++ b/libc/kernel/uapi/linux/nfc.h
@@ -98,37 +98,42 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS,
NFC_ATTR_SE_APDU,
+ NFC_ATTR_TARGET_ISO15693_DSFID,
+ NFC_ATTR_TARGET_ISO15693_UID,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NFC_ATTR_AFTER_LAST
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
enum nfc_sdp_attr {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFC_SDP_ATTR_UNSPEC,
NFC_SDP_ATTR_URI,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NFC_SDP_ATTR_SAP,
__NFC_SDP_ATTR_AFTER_LAST
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define NFC_SDP_ATTR_MAX (__NFC_SDP_ATTR_AFTER_LAST - 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_DEVICE_NAME_MAXSIZE 8
#define NFC_NFCID1_MAXSIZE 10
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_NFCID2_MAXSIZE 8
#define NFC_NFCID3_MAXSIZE 10
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_SENSB_RES_MAXSIZE 12
#define NFC_SENSF_RES_MAXSIZE 18
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_GB_MAXSIZE 48
#define NFC_FIRMWARE_NAME_MAXSIZE 32
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NFC_ISO15693_UID_MAXSIZE 8
#define NFC_PROTO_JEWEL 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_PROTO_MIFARE 2
#define NFC_PROTO_FELICA 3
#define NFC_PROTO_ISO14443 4
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_PROTO_NFC_DEP 5
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_PROTO_ISO14443_B 6
-#define NFC_PROTO_MAX 7
+#define NFC_PROTO_ISO15693 7
+#define NFC_PROTO_MAX 8
#define NFC_COMM_ACTIVE 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_COMM_PASSIVE 1
@@ -143,46 +148,53 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
+#define NFC_PROTO_ISO15693_MASK (1 << NFC_PROTO_ISO15693)
#define NFC_SE_UICC 0x1
-#define NFC_SE_EMBEDDED 0x2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NFC_SE_EMBEDDED 0x2
#define NFC_SE_DISABLED 0x0
#define NFC_SE_ENABLED 0x1
struct sockaddr_nfc {
- sa_family_t sa_family;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ sa_family_t sa_family;
__u32 dev_idx;
__u32 target_idx;
__u32 nfc_protocol;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define NFC_LLCP_MAX_SERVICE_NAME 63
struct sockaddr_nfc_llcp {
sa_family_t sa_family;
- __u32 dev_idx;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 dev_idx;
__u32 target_idx;
__u32 nfc_protocol;
__u8 dsap;
- __u8 ssap;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 ssap;
char service_name[NFC_LLCP_MAX_SERVICE_NAME]; ;
size_t service_name_len;
};
-#define NFC_SOCKPROTO_RAW 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NFC_SOCKPROTO_RAW 0
#define NFC_SOCKPROTO_LLCP 1
#define NFC_SOCKPROTO_MAX 2
#define NFC_HEADER_SIZE 1
-#define NFC_LLCP_RAW_HEADER_SIZE 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define NFC_LLCP_DIRECTION_RX 0x00
-#define NFC_LLCP_DIRECTION_TX 0x01
+#define NFC_RAW_HEADER_SIZE 2
+#define NFC_DIRECTION_RX 0x00
+#define NFC_DIRECTION_TX 0x01
+#define RAW_PAYLOAD_LLCP 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RAW_PAYLOAD_NCI 1
+#define RAW_PAYLOAD_HCI 2
+#define RAW_PAYLOAD_DIGITAL 3
+#define RAW_PAYLOAD_PROPRIETARY 4
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_LLCP_RW 0
#define NFC_LLCP_MIUX 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_LLCP_REMOTE_MIU 2
#define NFC_LLCP_REMOTE_LTO 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NFC_LLCP_REMOTE_RW 4
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/nfsd/nfsfh.h b/libc/kernel/uapi/linux/nfsd/nfsfh.h
index d089412..81177f7 100644
--- a/libc/kernel/uapi/linux/nfsd/nfsfh.h
+++ b/libc/kernel/uapi/linux/nfsd/nfsfh.h
@@ -68,7 +68,7 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define fh_auth_type fh_base.fh_new.fb_auth_type
#define fh_fileid_type fh_base.fh_new.fb_fileid_type
-#define fh_auth fh_base.fh_new.fb_auth
#define fh_fsid fh_base.fh_new.fb_auth
+#define fh_auth fh_base.fh_new.fb_auth
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/nl80211.h b/libc/kernel/uapi/linux/nl80211.h
index 01c50cd..6df45d5 100644
--- a/libc/kernel/uapi/linux/nl80211.h
+++ b/libc/kernel/uapi/linux/nl80211.h
@@ -429,161 +429,171 @@
NL80211_ATTR_VENDOR_DATA,
NL80211_ATTR_VENDOR_EVENTS,
NL80211_ATTR_QOS_MAP,
- __NL80211_ATTR_AFTER_LAST,
+ NL80211_ATTR_MAC_HINT,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL80211_ATTR_WIPHY_FREQ_HINT,
+ NL80211_ATTR_MAX_AP_ASSOC_STA,
+ NL80211_ATTR_TDLS_PEER_CAPABILITY,
+ NL80211_ATTR_IFACE_SOCKET_OWNER,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL80211_ATTR_CSA_C_OFFSETS_TX,
+ NL80211_ATTR_MAX_CSA_COUNTERS,
+ __NL80211_ATTR_AFTER_LAST,
NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE
#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE
#define NL80211_ATTR_IE NL80211_ATTR_IE
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE
#define NL80211_ATTR_FRAME NL80211_ATTR_FRAME
#define NL80211_ATTR_SSID NL80211_ATTR_SSID
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE
#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE
#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES
#define NL80211_ATTR_KEY NL80211_ATTR_KEY
#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_MAX_SUPP_RATES 32
#define NL80211_MAX_SUPP_HT_RATES 77
#define NL80211_MAX_SUPP_REG_RULES 32
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
#define NL80211_HT_CAPABILITY_LEN 26
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_VHT_CAPABILITY_LEN 12
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_MAX_NR_CIPHER_SUITES 5
#define NL80211_MAX_NR_AKM_SUITES 2
#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_SCAN_RSSI_THOLD_OFF -300
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_CQM_TXE_MAX_INTVL 1800
enum nl80211_iftype {
NL80211_IFTYPE_UNSPECIFIED,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFTYPE_ADHOC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFTYPE_STATION,
NL80211_IFTYPE_AP,
NL80211_IFTYPE_AP_VLAN,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFTYPE_WDS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFTYPE_MONITOR,
NL80211_IFTYPE_MESH_POINT,
NL80211_IFTYPE_P2P_CLIENT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFTYPE_P2P_GO,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFTYPE_P2P_DEVICE,
NUM_NL80211_IFTYPES,
NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_sta_flags {
__NL80211_STA_FLAG_INVALID,
NL80211_STA_FLAG_AUTHORIZED,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_FLAG_SHORT_PREAMBLE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_FLAG_WME,
NL80211_STA_FLAG_MFP,
NL80211_STA_FLAG_AUTHENTICATED,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_FLAG_TDLS_PEER,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_FLAG_ASSOCIATED,
__NL80211_STA_FLAG_AFTER_LAST,
NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER
struct nl80211_sta_flag_update {
__u32 mask;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 set;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((packed));
enum nl80211_rate_info {
__NL80211_RATE_INFO_INVALID,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RATE_INFO_BITRATE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RATE_INFO_MCS,
NL80211_RATE_INFO_40_MHZ_WIDTH,
NL80211_RATE_INFO_SHORT_GI,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RATE_INFO_BITRATE32,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RATE_INFO_VHT_MCS,
NL80211_RATE_INFO_VHT_NSS,
NL80211_RATE_INFO_80_MHZ_WIDTH,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RATE_INFO_80P80_MHZ_WIDTH,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RATE_INFO_160_MHZ_WIDTH,
__NL80211_RATE_INFO_AFTER_LAST,
NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_sta_bss_param {
__NL80211_STA_BSS_PARAM_INVALID,
NL80211_STA_BSS_PARAM_CTS_PROT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_BSS_PARAM_SHORT_PREAMBLE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME,
NL80211_STA_BSS_PARAM_DTIM_PERIOD,
NL80211_STA_BSS_PARAM_BEACON_INTERVAL,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NL80211_STA_BSS_PARAM_AFTER_LAST,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1
};
enum nl80211_sta_info {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NL80211_STA_INFO_INVALID,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_INACTIVE_TIME,
NL80211_STA_INFO_RX_BYTES,
NL80211_STA_INFO_TX_BYTES,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_LLID,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_PLID,
NL80211_STA_INFO_PLINK_STATE,
NL80211_STA_INFO_SIGNAL,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_TX_BITRATE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_RX_PACKETS,
NL80211_STA_INFO_TX_PACKETS,
NL80211_STA_INFO_TX_RETRIES,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_TX_FAILED,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_SIGNAL_AVG,
NL80211_STA_INFO_RX_BITRATE,
NL80211_STA_INFO_BSS_PARAM,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_CONNECTED_TIME,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_STA_FLAGS,
NL80211_STA_INFO_BEACON_LOSS,
NL80211_STA_INFO_T_OFFSET,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_LOCAL_PM,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_PEER_PM,
NL80211_STA_INFO_NONPEER_PM,
NL80211_STA_INFO_RX_BYTES64,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_TX_BYTES64,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_CHAIN_SIGNAL,
NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
+ NL80211_STA_INFO_EXPECTED_THROUGHPUT,
__NL80211_STA_INFO_AFTER_LAST,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
@@ -647,93 +657,103 @@
NL80211_FREQUENCY_ATTR_NO_80MHZ,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FREQUENCY_ATTR_NO_160MHZ,
+ NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
+ NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
+ NL80211_FREQUENCY_ATTR_GO_CONCURRENT,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL80211_FREQUENCY_ATTR_NO_20MHZ,
+ NL80211_FREQUENCY_ATTR_NO_10MHZ,
__NL80211_FREQUENCY_ATTR_AFTER_LAST,
NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
-#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
enum nl80211_bitrate_attr {
__NL80211_BITRATE_ATTR_INVALID,
NL80211_BITRATE_ATTR_RATE,
- NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
__NL80211_BITRATE_ATTR_AFTER_LAST,
NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
};
-enum nl80211_reg_initiator {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nl80211_reg_initiator {
NL80211_REGDOM_SET_BY_CORE,
NL80211_REGDOM_SET_BY_USER,
NL80211_REGDOM_SET_BY_DRIVER,
- NL80211_REGDOM_SET_BY_COUNTRY_IE,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL80211_REGDOM_SET_BY_COUNTRY_IE,
};
enum nl80211_reg_type {
NL80211_REGDOM_TYPE_COUNTRY,
- NL80211_REGDOM_TYPE_WORLD,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL80211_REGDOM_TYPE_WORLD,
NL80211_REGDOM_TYPE_CUSTOM_WORLD,
NL80211_REGDOM_TYPE_INTERSECTION,
};
-enum nl80211_reg_rule_attr {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nl80211_reg_rule_attr {
__NL80211_REG_RULE_ATTR_INVALID,
NL80211_ATTR_REG_RULE_FLAGS,
NL80211_ATTR_FREQ_RANGE_START,
- NL80211_ATTR_FREQ_RANGE_END,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL80211_ATTR_FREQ_RANGE_END,
NL80211_ATTR_FREQ_RANGE_MAX_BW,
NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
NL80211_ATTR_POWER_RULE_MAX_EIRP,
- __NL80211_REG_RULE_ATTR_AFTER_LAST,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL80211_ATTR_DFS_CAC_TIME,
+ __NL80211_REG_RULE_ATTR_AFTER_LAST,
NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_sched_scan_match_attr {
__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_SCHED_SCAN_MATCH_ATTR_SSID,
NL80211_SCHED_SCAN_MATCH_ATTR_RSSI,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
NL80211_SCHED_SCAN_MATCH_ATTR_MAX =
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID
enum nl80211_reg_rule_flags {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RRF_NO_OFDM = 1<<0,
NL80211_RRF_NO_CCK = 1<<1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RRF_NO_INDOOR = 1<<2,
NL80211_RRF_NO_OUTDOOR = 1<<3,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RRF_DFS = 1<<4,
NL80211_RRF_PTP_ONLY = 1<<5,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_RRF_PTMP_ONLY = 1<<6,
NL80211_RRF_NO_IR = 1<<7,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NL80211_RRF_NO_IBSS = 1<<8,
+ NL80211_RRF_AUTO_BW = 1<<11,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
enum nl80211_dfs_regions {
NL80211_DFS_UNSET = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_DFS_FCC = 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_DFS_ETSI = 2,
NL80211_DFS_JP = 3,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_user_reg_hint_type {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_USER_REG_HINT_USER = 0,
NL80211_USER_REG_HINT_CELL_BASE = 1,
+ NL80211_USER_REG_HINT_INDOOR = 2,
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_survey_info {
@@ -974,275 +994,285 @@
NL80211_TXRATE_LEGACY,
NL80211_TXRATE_HT,
NL80211_TXRATE_VHT,
- __NL80211_TXRATE_AFTER_LAST,
+ NL80211_TXRATE_GI,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __NL80211_TXRATE_AFTER_LAST,
NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
};
#define NL80211_TXRATE_MCS NL80211_TXRATE_HT
-#define NL80211_VHT_NSS_MAX 8
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NL80211_VHT_NSS_MAX 8
struct nl80211_txrate_vht {
__u16 mcs[NL80211_VHT_NSS_MAX];
};
-enum nl80211_band {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nl80211_txrate_gi {
+ NL80211_TXRATE_DEFAULT_GI,
+ NL80211_TXRATE_FORCE_SGI,
+ NL80211_TXRATE_FORCE_LGI,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+enum nl80211_band {
NL80211_BAND_2GHZ,
NL80211_BAND_5GHZ,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_BAND_60GHZ,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_ps_state {
NL80211_PS_DISABLED,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_PS_ENABLED,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_attr_cqm {
__NL80211_ATTR_CQM_INVALID,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_ATTR_CQM_RSSI_THOLD,
NL80211_ATTR_CQM_RSSI_HYST,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
NL80211_ATTR_CQM_PKT_LOSS_EVENT,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_ATTR_CQM_TXE_RATE,
NL80211_ATTR_CQM_TXE_PKTS,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_ATTR_CQM_TXE_INTVL,
__NL80211_ATTR_CQM_AFTER_LAST,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_cqm_rssi_threshold_event {
NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
NL80211_CQM_RSSI_BEACON_LOSS_EVENT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum nl80211_tx_power_setting {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_TX_POWER_AUTOMATIC,
NL80211_TX_POWER_LIMITED,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_TX_POWER_FIXED,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_packet_pattern_attr {
__NL80211_PKTPAT_INVALID,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_PKTPAT_MASK,
NL80211_PKTPAT_PATTERN,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_PKTPAT_OFFSET,
NUM_NL80211_PKTPAT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct nl80211_pattern_support {
__u32 max_patterns;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 min_pattern_len;
__u32 max_pattern_len;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 max_pkt_offset;
} __attribute__((packed));
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID
#define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN
#define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT
#define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define nl80211_wowlan_pattern_support nl80211_pattern_support
enum nl80211_wowlan_triggers {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NL80211_WOWLAN_TRIG_INVALID,
NL80211_WOWLAN_TRIG_ANY,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TRIG_DISCONNECT,
NL80211_WOWLAN_TRIG_MAGIC_PKT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TRIG_PKT_PATTERN,
NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE,
NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211,
NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023,
NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TRIG_TCP_CONNECTION,
NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST,
NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NUM_NL80211_WOWLAN_TRIG,
MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct nl80211_wowlan_tcp_data_seq {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 start, offset, len;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct nl80211_wowlan_tcp_data_token {
__u32 offset, len;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 token_stream[];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct nl80211_wowlan_tcp_data_token_feature {
__u32 min_len, max_len, bufsize;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum nl80211_wowlan_tcp_attrs {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__NL80211_WOWLAN_TCP_INVALID,
NL80211_WOWLAN_TCP_SRC_IPV4,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TCP_DST_IPV4,
NL80211_WOWLAN_TCP_DST_MAC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TCP_SRC_PORT,
NL80211_WOWLAN_TCP_DST_PORT,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TCP_DATA_PAYLOAD,
NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN,
NL80211_WOWLAN_TCP_DATA_INTERVAL,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_WOWLAN_TCP_WAKE_PAYLOAD,
NL80211_WOWLAN_TCP_WAKE_MASK,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NUM_NL80211_WOWLAN_TCP,
MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct nl80211_coalesce_rule_support {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 max_rules;
struct nl80211_pattern_support pat;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 max_delay;
} __attribute__((packed));
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_attr_coalesce_rule {
__NL80211_COALESCE_RULE_INVALID,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_ATTR_COALESCE_RULE_DELAY,
NL80211_ATTR_COALESCE_RULE_CONDITION,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
NUM_NL80211_ATTR_COALESCE_RULE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_coalesce_condition {
NL80211_COALESCE_CONDITION_MATCH,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_COALESCE_CONDITION_NO_MATCH
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_iface_limit_attrs {
NL80211_IFACE_LIMIT_UNSPEC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFACE_LIMIT_MAX,
NL80211_IFACE_LIMIT_TYPES,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NUM_NL80211_IFACE_LIMIT,
MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum nl80211_if_combination_attrs {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFACE_COMB_UNSPEC,
NL80211_IFACE_COMB_LIMITS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFACE_COMB_MAXNUM,
NL80211_IFACE_COMB_STA_AP_BI_MATCH,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_IFACE_COMB_NUM_CHANNELS,
NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL80211_IFACE_COMB_RADAR_DETECT_REGIONS,
NUM_NL80211_IFACE_COMB,
MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_plink_state {
NL80211_PLINK_LISTEN,
NL80211_PLINK_OPN_SNT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_PLINK_OPN_RCVD,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_PLINK_CNF_RCVD,
NL80211_PLINK_ESTAB,
NL80211_PLINK_HOLDING,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_PLINK_BLOCKED,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NUM_NL80211_PLINK_STATES,
MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum plink_actions {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_PLINK_ACTION_NO_ACTION,
NL80211_PLINK_ACTION_OPEN,
NL80211_PLINK_ACTION_BLOCK,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NUM_NL80211_PLINK_ACTIONS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define NL80211_KCK_LEN 16
#define NL80211_KEK_LEN 16
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NL80211_REPLAY_CTR_LEN 8
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_rekey_data {
__NL80211_REKEY_DATA_INVALID,
NL80211_REKEY_DATA_KEK,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_REKEY_DATA_KCK,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_REKEY_DATA_REPLAY_CTR,
NUM_NL80211_REKEY_DATA,
MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_hidden_ssid {
NL80211_HIDDEN_SSID_NOT_IN_USE,
NL80211_HIDDEN_SSID_ZERO_LEN,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_HIDDEN_SSID_ZERO_CONTENTS
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum nl80211_sta_wme_attr {
__NL80211_STA_WME_INVALID,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_WME_UAPSD_QUEUES,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_STA_WME_MAX_SP,
__NL80211_STA_WME_AFTER_LAST,
NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_pmksa_candidate_attr {
__NL80211_PMKSA_CANDIDATE_INVALID,
NL80211_PMKSA_CANDIDATE_INDEX,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_PMKSA_CANDIDATE_BSSID,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_PMKSA_CANDIDATE_PREAUTH,
NUM_NL80211_PMKSA_CANDIDATE,
MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_tdls_operation {
NL80211_TDLS_DISCOVERY_REQ,
NL80211_TDLS_SETUP,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_TDLS_TEARDOWN,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_TDLS_ENABLE_LINK,
NL80211_TDLS_DISABLE_LINK,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum nl80211_feature_flags {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
NL80211_FEATURE_HT_IBSS = 1 << 1,
NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
NL80211_FEATURE_SAE = 1 << 5,
NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FEATURE_AP_SCAN = 1 << 8,
NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17,
+ NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 1 << 18,
};
enum nl80211_probe_resp_offload_support_attr {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -1306,4 +1336,10 @@
__u32 subcmd;
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nl80211_tdls_peer_capability {
+ NL80211_TDLS_PEER_HT = 1<<0,
+ NL80211_TDLS_PEER_VHT = 1<<1,
+ NL80211_TDLS_PEER_WMM = 1<<2,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#endif
diff --git a/libc/kernel/uapi/linux/nvme.h b/libc/kernel/uapi/linux/nvme.h
index eedea90..850c42e 100644
--- a/libc/kernel/uapi/linux/nvme.h
+++ b/libc/kernel/uapi/linux/nvme.h
@@ -32,51 +32,71 @@
__u8 write_tput;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 write_lat;
- __u8 rsvd16[16];
-};
-enum {
+ __le16 idle_power;
+ __u8 idle_scale;
+ __u8 rsvd19;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 active_power;
+ __u8 active_work_scale;
+ __u8 rsvd23[9];
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
NVME_PS_FLAGS_MAX_POWER_SCALE = 1 << 0,
NVME_PS_FLAGS_NON_OP_STATE = 1 << 1,
};
-struct nvme_id_ctrl {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct nvme_id_ctrl {
__le16 vid;
__le16 ssvid;
char sn[20];
- char mn[40];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ char mn[40];
char fr[8];
__u8 rab;
__u8 ieee[3];
- __u8 mic;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 mic;
__u8 mdts;
- __u8 rsvd78[178];
+ __u16 cntlid;
+ __u32 ver;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 rsvd84[172];
__le16 oacs;
__u8 acl;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 aerl;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 frmw;
__u8 lpa;
__u8 elpe;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 npss;
- __u8 rsvd264[248];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 avscc;
+ __u8 apsta;
+ __le16 wctemp;
+ __le16 cctemp;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 rsvd270[242];
__u8 sqes;
__u8 cqes;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 rsvd514[2];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__le32 nn;
__le16 oncs;
__le16 fuses;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 fna;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 vwc;
__le16 awun;
__le16 awupf;
+ __u8 nvscc;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 rsvd530[1518];
+ __u8 rsvd531;
+ __le16 acwu;
+ __u8 rsvd534[2];
+ __le32 sgls;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 rsvd540[1508];
struct nvme_id_power_state psd[32];
__u8 vs[1024];
};
@@ -86,63 +106,78 @@
NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1,
NVME_CTRL_ONCS_DSM = 1 << 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NVME_CTRL_VWC_PRESENT = 1 << 0,
};
struct nvme_lbaf {
__le16 ms;
- __u8 ds;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 ds;
__u8 rp;
};
struct nvme_id_ns {
- __le64 nsze;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le64 nsze;
__le64 ncap;
__le64 nuse;
__u8 nsfeat;
- __u8 nlbaf;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 nlbaf;
__u8 flbas;
__u8 mc;
__u8 dpc;
- __u8 dps;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 rsvd30[98];
+ __u8 dps;
+ __u8 nmic;
+ __u8 rescap;
+ __u8 fpi;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 rsvd33;
+ __le16 nawun;
+ __le16 nawupf;
+ __le16 nacwu;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 rsvd40[80];
+ __u8 eui64[8];
struct nvme_lbaf lbaf[16];
__u8 rsvd192[192];
- __u8 vs[3712];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 vs[3712];
};
enum {
NVME_NS_FEAT_THIN = 1 << 0,
- NVME_LBAF_RP_BEST = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NVME_LBAF_RP_BEST = 0,
NVME_LBAF_RP_BETTER = 1,
NVME_LBAF_RP_GOOD = 2,
NVME_LBAF_RP_DEGRADED = 3,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct nvme_smart_log {
__u8 critical_warning;
__u8 temperature[2];
- __u8 avail_spare;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 avail_spare;
__u8 spare_thresh;
__u8 percent_used;
__u8 rsvd6[26];
- __u8 data_units_read[16];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 data_units_read[16];
__u8 data_units_written[16];
__u8 host_reads[16];
__u8 host_writes[16];
- __u8 ctrl_busy_time[16];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 ctrl_busy_time[16];
__u8 power_cycles[16];
__u8 power_on_hours[16];
__u8 unsafe_shutdowns[16];
- __u8 media_errors[16];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 media_errors[16];
__u8 num_err_log_entries[16];
- __u8 rsvd192[320];
+ __le32 warning_temp_time;
+ __le32 critical_comp_time;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 temp_sensor[8];
+ __u8 rsvd216[296];
};
enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -316,6 +351,11 @@
NVME_FEAT_ASYNC_EVENT = 0x0b,
NVME_FEAT_SW_PROGRESS = 0x0c,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NVME_LOG_ERROR = 0x01,
+ NVME_LOG_SMART = 0x02,
+ NVME_LOG_FW_SLOT = 0x03,
+ NVME_LOG_RESERVATION = 0x80,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NVME_FWACT_REPL = (0 << 3),
NVME_FWACT_REPL_ACTV = (1 << 3),
NVME_FWACT_ACTV = (2 << 3),
@@ -493,62 +533,63 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
NVME_SC_COMPARE_FAILED = 0x285,
NVME_SC_ACCESS_DENIED = 0x286,
+ NVME_SC_DNR = 0x4000,
};
-struct nvme_completion {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct nvme_completion {
__le32 result;
__u32 rsvd;
__le16 sq_head;
- __le16 sq_id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 sq_id;
__u16 command_id;
__le16 status;
};
-struct nvme_user_io {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct nvme_user_io {
__u8 opcode;
__u8 flags;
__u16 control;
- __u16 nblocks;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 nblocks;
__u16 rsvd;
__u64 metadata;
__u64 addr;
- __u64 slba;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 slba;
__u32 dsmgmt;
__u32 reftag;
__u16 apptag;
- __u16 appmask;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 appmask;
};
struct nvme_admin_cmd {
__u8 opcode;
- __u8 flags;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 flags;
__u16 rsvd1;
__u32 nsid;
__u32 cdw2;
- __u32 cdw3;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 cdw3;
__u64 metadata;
__u64 addr;
__u32 metadata_len;
- __u32 data_len;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 data_len;
__u32 cdw10;
__u32 cdw11;
__u32 cdw12;
- __u32 cdw13;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 cdw13;
__u32 cdw14;
__u32 cdw15;
__u32 timeout_ms;
- __u32 result;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 result;
};
#define NVME_IOCTL_ID _IO('N', 0x40)
#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
-#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
#endif
diff --git a/libc/kernel/uapi/linux/perf_event.h b/libc/kernel/uapi/linux/perf_event.h
index 5922cbe..a88df08 100644
--- a/libc/kernel/uapi/linux/perf_event.h
+++ b/libc/kernel/uapi/linux/perf_event.h
@@ -132,287 +132,290 @@
PERF_SAMPLE_BRANCH_IN_TX = 1U << 8,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_SAMPLE_BRANCH_NO_TX = 1U << 9,
- PERF_SAMPLE_BRANCH_MAX = 1U << 10,
+ PERF_SAMPLE_BRANCH_COND = 1U << 10,
+ PERF_SAMPLE_BRANCH_MAX = 1U << 11,
};
-#define PERF_SAMPLE_BRANCH_PLM_ALL (PERF_SAMPLE_BRANCH_USER| PERF_SAMPLE_BRANCH_KERNEL| PERF_SAMPLE_BRANCH_HV)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PERF_SAMPLE_BRANCH_PLM_ALL (PERF_SAMPLE_BRANCH_USER| PERF_SAMPLE_BRANCH_KERNEL| PERF_SAMPLE_BRANCH_HV)
enum perf_sample_regs_abi {
PERF_SAMPLE_REGS_ABI_NONE = 0,
PERF_SAMPLE_REGS_ABI_32 = 1,
- PERF_SAMPLE_REGS_ABI_64 = 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_SAMPLE_REGS_ABI_64 = 2,
};
enum {
PERF_TXN_ELISION = (1 << 0),
- PERF_TXN_TRANSACTION = (1 << 1),
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_TXN_TRANSACTION = (1 << 1),
PERF_TXN_SYNC = (1 << 2),
PERF_TXN_ASYNC = (1 << 3),
PERF_TXN_RETRY = (1 << 4),
- PERF_TXN_CONFLICT = (1 << 5),
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_TXN_CONFLICT = (1 << 5),
PERF_TXN_CAPACITY_WRITE = (1 << 6),
PERF_TXN_CAPACITY_READ = (1 << 7),
PERF_TXN_MAX = (1 << 8),
- PERF_TXN_ABORT_MASK = (0xffffffffULL << 32),
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_TXN_ABORT_MASK = (0xffffffffULL << 32),
PERF_TXN_ABORT_SHIFT = 32,
};
enum perf_event_read_format {
- PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
PERF_FORMAT_ID = 1U << 2,
PERF_FORMAT_GROUP = 1U << 3,
- PERF_FORMAT_MAX = 1U << 4,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PERF_FORMAT_MAX = 1U << 4,
};
#define PERF_ATTR_SIZE_VER0 64
#define PERF_ATTR_SIZE_VER1 72
-#define PERF_ATTR_SIZE_VER2 80
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PERF_ATTR_SIZE_VER2 80
#define PERF_ATTR_SIZE_VER3 96
struct perf_event_attr {
__u32 type;
- __u32 size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 size;
__u64 config;
union {
__u64 sample_period;
- __u64 sample_freq;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 sample_freq;
};
__u64 sample_type;
__u64 read_format;
- __u64 disabled : 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 disabled : 1,
inherit : 1,
pinned : 1,
exclusive : 1,
- exclude_user : 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ exclude_user : 1,
exclude_kernel : 1,
exclude_hv : 1,
exclude_idle : 1,
- mmap : 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mmap : 1,
comm : 1,
freq : 1,
inherit_stat : 1,
- enable_on_exec : 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ enable_on_exec : 1,
task : 1,
watermark : 1,
precise_ip : 2,
- mmap_data : 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ mmap_data : 1,
sample_id_all : 1,
exclude_host : 1,
exclude_guest : 1,
- exclude_callchain_kernel : 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ exclude_callchain_kernel : 1,
exclude_callchain_user : 1,
mmap2 : 1,
- __reserved_1 : 40;
- union {
+ comm_exec : 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __reserved_1 : 39;
+ union {
__u32 wakeup_events;
__u32 wakeup_watermark;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
__u32 bp_type;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
__u64 bp_addr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 config1;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
__u64 bp_len;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 config2;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 branch_sample_type;
__u64 sample_regs_user;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 sample_stack_user;
__u32 __reserved_2;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define perf_flags(attr) (*(&(attr)->read_format + 1))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_EVENT_IOC_ENABLE _IO ('$', 0)
#define PERF_EVENT_IOC_DISABLE _IO ('$', 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_EVENT_IOC_REFRESH _IO ('$', 2)
#define PERF_EVENT_IOC_RESET _IO ('$', 3)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum perf_event_ioc_flags {
PERF_IOC_FLAG_GROUP = 1U << 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct perf_event_mmap_page {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 version;
__u32 compat_version;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 lock;
__u32 index;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s64 offset;
__u64 time_enabled;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 time_running;
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 capabilities;
struct {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 cap_bit0 : 1,
cap_bit0_is_deprecated : 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
cap_user_rdpmc : 1,
cap_user_time : 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
cap_user_time_zero : 1,
cap_____res : 59;
- };
- };
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ };
+ };
__u16 pmc_width;
__u16 time_shift;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 time_mult;
__u64 time_offset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 time_zero;
__u32 size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 __reserved[118*8+4];
__u64 data_head;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 data_tail;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_RECORD_MISC_KERNEL (1 << 0)
#define PERF_RECORD_MISC_USER (2 << 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
#define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PERF_RECORD_MISC_COMM_EXEC (1 << 13)
#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
#define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct perf_event_header {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
__u16 misc;
__u16 size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum perf_event_type {
PERF_RECORD_MMAP = 1,
PERF_RECORD_LOST = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_RECORD_COMM = 3,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_RECORD_EXIT = 4,
PERF_RECORD_THROTTLE = 5,
PERF_RECORD_UNTHROTTLE = 6,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_RECORD_FORK = 7,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_RECORD_READ = 8,
PERF_RECORD_SAMPLE = 9,
PERF_RECORD_MMAP2 = 10,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_RECORD_MAX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define PERF_MAX_STACK_DEPTH 127
enum perf_callchain_context {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_CONTEXT_HV = (__u64)-32,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_CONTEXT_KERNEL = (__u64)-128,
PERF_CONTEXT_USER = (__u64)-512,
PERF_CONTEXT_GUEST = (__u64)-2048,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
PERF_CONTEXT_GUEST_USER = (__u64)-2560,
PERF_CONTEXT_MAX = (__u64)-4095,
};
+#define PERF_FLAG_FD_NO_GROUP (1UL << 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define PERF_FLAG_FD_NO_GROUP (1U << 0)
-#define PERF_FLAG_FD_OUTPUT (1U << 1)
-#define PERF_FLAG_PID_CGROUP (1U << 2)
-#define PERF_FLAG_FD_CLOEXEC (1U << 3)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PERF_FLAG_FD_OUTPUT (1UL << 1)
+#define PERF_FLAG_PID_CGROUP (1UL << 2)
+#define PERF_FLAG_FD_CLOEXEC (1UL << 3)
union perf_mem_data_src {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 val;
struct {
__u64 mem_op:5,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mem_lvl:14,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mem_snoop:5,
mem_lock:2,
mem_dtlb:7,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
mem_rsvd:31;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
};
#define PERF_MEM_OP_NA 0x01
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_OP_LOAD 0x02
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_OP_STORE 0x04
#define PERF_MEM_OP_PFETCH 0x08
#define PERF_MEM_OP_EXEC 0x10
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_OP_SHIFT 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_LVL_NA 0x01
#define PERF_MEM_LVL_HIT 0x02
#define PERF_MEM_LVL_MISS 0x04
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_LVL_L1 0x08
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_LVL_LFB 0x10
#define PERF_MEM_LVL_L2 0x20
#define PERF_MEM_LVL_L3 0x40
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_LVL_LOC_RAM 0x80
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_LVL_REM_RAM1 0x100
#define PERF_MEM_LVL_REM_RAM2 0x200
#define PERF_MEM_LVL_REM_CCE1 0x400
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_LVL_REM_CCE2 0x800
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_LVL_IO 0x1000
#define PERF_MEM_LVL_UNC 0x2000
#define PERF_MEM_LVL_SHIFT 5
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_SNOOP_NA 0x01
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_SNOOP_NONE 0x02
#define PERF_MEM_SNOOP_HIT 0x04
#define PERF_MEM_SNOOP_MISS 0x08
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_SNOOP_HITM 0x10
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_SNOOP_SHIFT 19
#define PERF_MEM_LOCK_NA 0x01
#define PERF_MEM_LOCK_LOCKED 0x02
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_LOCK_SHIFT 24
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_TLB_NA 0x01
#define PERF_MEM_TLB_HIT 0x02
#define PERF_MEM_TLB_MISS 0x04
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_TLB_L1 0x08
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_TLB_L2 0x10
#define PERF_MEM_TLB_WK 0x20
#define PERF_MEM_TLB_OS 0x40
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_TLB_SHIFT 26
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PERF_MEM_S(a, s) (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
struct perf_branch_entry {
__u64 from;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 to;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 mispred:1,
predicted:1,
in_tx:1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
abort:1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
reserved:60;
};
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/pfkeyv2.h b/libc/kernel/uapi/linux/pfkeyv2.h
index b87b698..18ed7ed 100644
--- a/libc/kernel/uapi/linux/pfkeyv2.h
+++ b/libc/kernel/uapi/linux/pfkeyv2.h
@@ -223,143 +223,156 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 sadb_x_kmaddress_reserved;
} __attribute__((packed));
-#define SADB_RESERVED 0
-#define SADB_GETSPI 1
+struct sadb_x_filter {
+ __u16 sadb_x_filter_len;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 sadb_x_filter_exttype;
+ __u32 sadb_x_filter_saddr[4];
+ __u32 sadb_x_filter_daddr[4];
+ __u16 sadb_x_filter_family;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 sadb_x_filter_splen;
+ __u8 sadb_x_filter_dplen;
+} __attribute__((packed));
+#define SADB_RESERVED 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_GETSPI 1
#define SADB_UPDATE 2
#define SADB_ADD 3
#define SADB_DELETE 4
-#define SADB_GET 5
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_GET 5
#define SADB_ACQUIRE 6
#define SADB_REGISTER 7
#define SADB_EXPIRE 8
-#define SADB_FLUSH 9
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_FLUSH 9
#define SADB_DUMP 10
#define SADB_X_PROMISC 11
#define SADB_X_PCHANGE 12
-#define SADB_X_SPDUPDATE 13
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_SPDUPDATE 13
#define SADB_X_SPDADD 14
#define SADB_X_SPDDELETE 15
#define SADB_X_SPDGET 16
-#define SADB_X_SPDACQUIRE 17
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_SPDACQUIRE 17
#define SADB_X_SPDDUMP 18
#define SADB_X_SPDFLUSH 19
#define SADB_X_SPDSETIDX 20
-#define SADB_X_SPDEXPIRE 21
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_SPDEXPIRE 21
#define SADB_X_SPDDELETE2 22
#define SADB_X_NAT_T_NEW_MAPPING 23
#define SADB_X_MIGRATE 24
-#define SADB_MAX 24
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_MAX 24
#define SADB_SAFLAGS_PFS 1
#define SADB_SAFLAGS_NOPMTUDISC 0x20000000
#define SADB_SAFLAGS_DECAP_DSCP 0x40000000
-#define SADB_SAFLAGS_NOECN 0x80000000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_SAFLAGS_NOECN 0x80000000
#define SADB_SASTATE_LARVAL 0
#define SADB_SASTATE_MATURE 1
#define SADB_SASTATE_DYING 2
-#define SADB_SASTATE_DEAD 3
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_SASTATE_DEAD 3
#define SADB_SASTATE_MAX 3
#define SADB_SATYPE_UNSPEC 0
#define SADB_SATYPE_AH 2
-#define SADB_SATYPE_ESP 3
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_SATYPE_ESP 3
#define SADB_SATYPE_RSVP 5
#define SADB_SATYPE_OSPFV2 6
#define SADB_SATYPE_RIPV2 7
-#define SADB_SATYPE_MIP 8
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_SATYPE_MIP 8
#define SADB_X_SATYPE_IPCOMP 9
#define SADB_SATYPE_MAX 9
#define SADB_AALG_NONE 0
-#define SADB_AALG_MD5HMAC 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_AALG_MD5HMAC 2
#define SADB_AALG_SHA1HMAC 3
#define SADB_X_AALG_SHA2_256HMAC 5
#define SADB_X_AALG_SHA2_384HMAC 6
-#define SADB_X_AALG_SHA2_512HMAC 7
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_AALG_SHA2_512HMAC 7
#define SADB_X_AALG_RIPEMD160HMAC 8
#define SADB_X_AALG_AES_XCBC_MAC 9
#define SADB_X_AALG_NULL 251
-#define SADB_AALG_MAX 251
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_AALG_MAX 251
#define SADB_EALG_NONE 0
#define SADB_EALG_DESCBC 2
#define SADB_EALG_3DESCBC 3
-#define SADB_X_EALG_CASTCBC 6
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_EALG_CASTCBC 6
#define SADB_X_EALG_BLOWFISHCBC 7
#define SADB_EALG_NULL 11
#define SADB_X_EALG_AESCBC 12
-#define SADB_X_EALG_AESCTR 13
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_EALG_AESCTR 13
#define SADB_X_EALG_AES_CCM_ICV8 14
#define SADB_X_EALG_AES_CCM_ICV12 15
#define SADB_X_EALG_AES_CCM_ICV16 16
-#define SADB_X_EALG_AES_GCM_ICV8 18
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_EALG_AES_GCM_ICV8 18
#define SADB_X_EALG_AES_GCM_ICV12 19
#define SADB_X_EALG_AES_GCM_ICV16 20
#define SADB_X_EALG_CAMELLIACBC 22
-#define SADB_X_EALG_NULL_AES_GMAC 23
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_EALG_NULL_AES_GMAC 23
#define SADB_EALG_MAX 253
#define SADB_X_EALG_SERPENTCBC 252
#define SADB_X_EALG_TWOFISHCBC 253
-#define SADB_X_CALG_NONE 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_CALG_NONE 0
#define SADB_X_CALG_OUI 1
#define SADB_X_CALG_DEFLATE 2
#define SADB_X_CALG_LZS 3
-#define SADB_X_CALG_LZJH 4
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_CALG_LZJH 4
#define SADB_X_CALG_MAX 4
#define SADB_EXT_RESERVED 0
#define SADB_EXT_SA 1
-#define SADB_EXT_LIFETIME_CURRENT 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_EXT_LIFETIME_CURRENT 2
#define SADB_EXT_LIFETIME_HARD 3
#define SADB_EXT_LIFETIME_SOFT 4
#define SADB_EXT_ADDRESS_SRC 5
-#define SADB_EXT_ADDRESS_DST 6
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_EXT_ADDRESS_DST 6
#define SADB_EXT_ADDRESS_PROXY 7
#define SADB_EXT_KEY_AUTH 8
#define SADB_EXT_KEY_ENCRYPT 9
-#define SADB_EXT_IDENTITY_SRC 10
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_EXT_IDENTITY_SRC 10
#define SADB_EXT_IDENTITY_DST 11
#define SADB_EXT_SENSITIVITY 12
#define SADB_EXT_PROPOSAL 13
-#define SADB_EXT_SUPPORTED_AUTH 14
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_EXT_SUPPORTED_AUTH 14
#define SADB_EXT_SUPPORTED_ENCRYPT 15
#define SADB_EXT_SPIRANGE 16
#define SADB_X_EXT_KMPRIVATE 17
-#define SADB_X_EXT_POLICY 18
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_EXT_POLICY 18
#define SADB_X_EXT_SA2 19
#define SADB_X_EXT_NAT_T_TYPE 20
#define SADB_X_EXT_NAT_T_SPORT 21
-#define SADB_X_EXT_NAT_T_DPORT 22
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_EXT_NAT_T_DPORT 22
#define SADB_X_EXT_NAT_T_OA 23
#define SADB_X_EXT_SEC_CTX 24
#define SADB_X_EXT_KMADDRESS 25
-#define SADB_EXT_MAX 25
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SADB_X_EXT_FILTER 26
+#define SADB_EXT_MAX 26
#define SADB_IDENTTYPE_RESERVED 0
#define SADB_IDENTTYPE_PREFIX 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SADB_IDENTTYPE_FQDN 2
#define SADB_IDENTTYPE_USERFQDN 3
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SADB_IDENTTYPE_MAX 3
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/prctl.h b/libc/kernel/uapi/linux/prctl.h
index a127b5a..bf077fa 100644
--- a/libc/kernel/uapi/linux/prctl.h
+++ b/libc/kernel/uapi/linux/prctl.h
@@ -117,4 +117,7 @@
#define PR_GET_NO_NEW_PRIVS 39
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PR_GET_TID_ADDRESS 40
+#define PR_SET_THP_DISABLE 41
+#define PR_GET_THP_DISABLE 42
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/psci.h b/libc/kernel/uapi/linux/psci.h
new file mode 100644
index 0000000..8dea76f
--- /dev/null
+++ b/libc/kernel/uapi/linux/psci.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_PSCI_H
+#define _UAPI_LINUX_PSCI_H
+#define PSCI_0_2_FN_BASE 0x84000000
+#define PSCI_0_2_FN(n) (PSCI_0_2_FN_BASE + (n))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_0_2_64BIT 0x40000000
+#define PSCI_0_2_FN64_BASE (PSCI_0_2_FN_BASE + PSCI_0_2_64BIT)
+#define PSCI_0_2_FN64(n) (PSCI_0_2_FN64_BASE + (n))
+#define PSCI_0_2_FN_PSCI_VERSION PSCI_0_2_FN(0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_0_2_FN_CPU_SUSPEND PSCI_0_2_FN(1)
+#define PSCI_0_2_FN_CPU_OFF PSCI_0_2_FN(2)
+#define PSCI_0_2_FN_CPU_ON PSCI_0_2_FN(3)
+#define PSCI_0_2_FN_AFFINITY_INFO PSCI_0_2_FN(4)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_0_2_FN_MIGRATE PSCI_0_2_FN(5)
+#define PSCI_0_2_FN_MIGRATE_INFO_TYPE PSCI_0_2_FN(6)
+#define PSCI_0_2_FN_MIGRATE_INFO_UP_CPU PSCI_0_2_FN(7)
+#define PSCI_0_2_FN_SYSTEM_OFF PSCI_0_2_FN(8)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_0_2_FN_SYSTEM_RESET PSCI_0_2_FN(9)
+#define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1)
+#define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3)
+#define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_0_2_FN64_MIGRATE PSCI_0_2_FN64(5)
+#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7)
+#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff
+#define PSCI_0_2_POWER_STATE_ID_SHIFT 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_0_2_POWER_STATE_TYPE_SHIFT 16
+#define PSCI_0_2_POWER_STATE_TYPE_MASK (0x1 << PSCI_0_2_POWER_STATE_TYPE_SHIFT)
+#define PSCI_0_2_POWER_STATE_AFFL_SHIFT 24
+#define PSCI_0_2_POWER_STATE_AFFL_MASK (0x3 << PSCI_0_2_POWER_STATE_AFFL_SHIFT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_0_2_AFFINITY_LEVEL_ON 0
+#define PSCI_0_2_AFFINITY_LEVEL_OFF 1
+#define PSCI_0_2_AFFINITY_LEVEL_ON_PENDING 2
+#define PSCI_0_2_TOS_UP_MIGRATE 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_0_2_TOS_UP_NO_MIGRATE 1
+#define PSCI_0_2_TOS_MP 2
+#define PSCI_VERSION_MAJOR_SHIFT 16
+#define PSCI_VERSION_MINOR_MASK ((1U << PSCI_VERSION_MAJOR_SHIFT) - 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_VERSION_MAJOR_MASK ~PSCI_VERSION_MINOR_MASK
+#define PSCI_VERSION_MAJOR(ver) (((ver) & PSCI_VERSION_MAJOR_MASK) >> PSCI_VERSION_MAJOR_SHIFT)
+#define PSCI_VERSION_MINOR(ver) ((ver) & PSCI_VERSION_MINOR_MASK)
+#define PSCI_RET_SUCCESS 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_RET_NOT_SUPPORTED -1
+#define PSCI_RET_INVALID_PARAMS -2
+#define PSCI_RET_DENIED -3
+#define PSCI_RET_ALREADY_ON -4
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PSCI_RET_ON_PENDING -5
+#define PSCI_RET_INTERNAL_FAILURE -6
+#define PSCI_RET_NOT_PRESENT -7
+#define PSCI_RET_DISABLED -8
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/linux/ptp_clock.h b/libc/kernel/uapi/linux/ptp_clock.h
index 01b15d0..910fe74 100644
--- a/libc/kernel/uapi/linux/ptp_clock.h
+++ b/libc/kernel/uapi/linux/ptp_clock.h
@@ -38,38 +38,58 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int n_per_out;
int pps;
- int rsv[15];
-};
+ int n_pins;
+ int rsv[14];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct ptp_extts_request {
unsigned int index;
unsigned int flags;
- unsigned int rsv[2];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned int rsv[2];
};
struct ptp_perout_request {
struct ptp_clock_time start;
- struct ptp_clock_time period;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct ptp_clock_time period;
unsigned int index;
unsigned int flags;
unsigned int rsv[4];
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define PTP_MAX_SAMPLES 25
struct ptp_sys_offset {
unsigned int n_samples;
- unsigned int rsv[3];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned int rsv[3];
struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
};
+enum ptp_pin_function {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ PTP_PF_NONE,
+ PTP_PF_EXTTS,
+ PTP_PF_PEROUT,
+ PTP_PF_PHYSYNC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+struct ptp_pin_desc {
+ char name[64];
+ unsigned int index;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned int func;
+ unsigned int chan;
+ unsigned int rsv[5];
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PTP_CLK_MAGIC '='
#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request)
#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int)
#define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset)
+#define PTP_PIN_GETFUNC _IOWR(PTP_CLK_MAGIC, 6, struct ptp_pin_desc)
+#define PTP_PIN_SETFUNC _IOW(PTP_CLK_MAGIC, 7, struct ptp_pin_desc)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ptp_extts_event {
struct ptp_clock_time t;
diff --git a/libc/kernel/uapi/linux/serial_core.h b/libc/kernel/uapi/linux/serial_core.h
index 59fc32a..643011a 100644
--- a/libc/kernel/uapi/linux/serial_core.h
+++ b/libc/kernel/uapi/linux/serial_core.h
@@ -143,4 +143,7 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define PORT_ASC 105
#define PORT_TILEGX 106
+#define PORT_MEN_Z135 107
+#define PORT_SC16IS7XX 108
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/serial_reg.h b/libc/kernel/uapi/linux/serial_reg.h
index 1b0bada..e19cfb4 100644
--- a/libc/kernel/uapi/linux/serial_reg.h
+++ b/libc/kernel/uapi/linux/serial_reg.h
@@ -31,7 +31,7 @@
#define UART_IIR 2
#define UART_IIR_NO_INT 0x01
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define UART_IIR_ID 0x06
+#define UART_IIR_ID 0x0e
#define UART_IIR_MSI 0x00
#define UART_IIR_THRI 0x02
#define UART_IIR_RDI 0x04
diff --git a/libc/kernel/uapi/linux/shm.h b/libc/kernel/uapi/linux/shm.h
index 28e1670..e41ca50 100644
--- a/libc/kernel/uapi/linux/shm.h
+++ b/libc/kernel/uapi/linux/shm.h
@@ -22,11 +22,11 @@
#include <linux/errno.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#include <unistd.h>
-#define SHMMAX 0x2000000
#define SHMMIN 1
#define SHMMNI 4096
+#define SHMMAX (ULONG_MAX - (1UL << 24))
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
+#define SHMALL (ULONG_MAX - (1UL << 24))
#define SHMSEG SHMMNI
struct shmid_ds {
struct ipc_perm shm_perm;
diff --git a/libc/kernel/uapi/linux/snmp.h b/libc/kernel/uapi/linux/snmp.h
index 9d5fb09..645128f 100644
--- a/libc/kernel/uapi/linux/snmp.h
+++ b/libc/kernel/uapi/linux/snmp.h
@@ -278,57 +278,64 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_TCPSYNCHALLENGE,
LINUX_MIB_TCPFASTOPENACTIVE,
+ LINUX_MIB_TCPFASTOPENACTIVEFAIL,
LINUX_MIB_TCPFASTOPENPASSIVE,
- LINUX_MIB_TCPFASTOPENPASSIVEFAIL,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ LINUX_MIB_TCPFASTOPENPASSIVEFAIL,
LINUX_MIB_TCPFASTOPENLISTENOVERFLOW,
LINUX_MIB_TCPFASTOPENCOOKIEREQD,
LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES,
- LINUX_MIB_BUSYPOLLRXPACKETS,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ LINUX_MIB_BUSYPOLLRXPACKETS,
LINUX_MIB_TCPAUTOCORKING,
+ LINUX_MIB_TCPFROMZEROWINDOWADV,
+ LINUX_MIB_TCPTOZEROWINDOWADV,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ LINUX_MIB_TCPWANTZEROWINDOWADV,
+ LINUX_MIB_TCPSYNRETRANS,
+ LINUX_MIB_TCPORIGDATASENT,
__LINUX_MIB_MAX
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
{
LINUX_MIB_XFRMNUM = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMINERROR,
LINUX_MIB_XFRMINBUFFERERROR,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMINHDRERROR,
LINUX_MIB_XFRMINNOSTATES,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMINSTATEPROTOERROR,
LINUX_MIB_XFRMINSTATEMODEERROR,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMINSTATESEQERROR,
LINUX_MIB_XFRMINSTATEEXPIRED,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMINSTATEMISMATCH,
LINUX_MIB_XFRMINSTATEINVALID,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMINTMPLMISMATCH,
LINUX_MIB_XFRMINNOPOLS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMINPOLBLOCK,
LINUX_MIB_XFRMINPOLERROR,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMOUTERROR,
LINUX_MIB_XFRMOUTBUNDLEGENERROR,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMOUTBUNDLECHECKERROR,
LINUX_MIB_XFRMOUTNOSTATES,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMOUTSTATEPROTOERROR,
LINUX_MIB_XFRMOUTSTATEMODEERROR,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMOUTSTATESEQERROR,
LINUX_MIB_XFRMOUTSTATEEXPIRED,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMOUTPOLBLOCK,
LINUX_MIB_XFRMOUTPOLDEAD,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMOUTPOLERROR,
LINUX_MIB_XFRMFWDHDRERROR,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
LINUX_MIB_XFRMOUTSTATEINVALID,
LINUX_MIB_XFRMACQUIREERROR,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__LINUX_MIB_XFRMMAX
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/spi/spidev.h b/libc/kernel/uapi/linux/spi/spidev.h
index 241dc95..f233040 100644
--- a/libc/kernel/uapi/linux/spi/spidev.h
+++ b/libc/kernel/uapi/linux/spi/spidev.h
@@ -34,6 +34,11 @@
#define SPI_LOOP 0x20
#define SPI_NO_CS 0x40
#define SPI_READY 0x80
+#define SPI_TX_DUAL 0x100
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SPI_TX_QUAD 0x200
+#define SPI_RX_DUAL 0x400
+#define SPI_RX_QUAD 0x800
#define SPI_IOC_MAGIC 'k'
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct spi_ioc_transfer {
@@ -46,19 +51,24 @@
__u8 bits_per_word;
__u8 cs_change;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 pad;
+ __u8 tx_nbits;
+ __u8 rx_nbits;
+ __u16 pad;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPI_MSGSIZE(N) ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) ? ((N)*(sizeof (struct spi_ioc_transfer))) : 0)
#define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)])
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPI_IOC_RD_MODE _IOR(SPI_IOC_MAGIC, 1, __u8)
#define SPI_IOC_WR_MODE _IOW(SPI_IOC_MAGIC, 1, __u8)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPI_IOC_RD_LSB_FIRST _IOR(SPI_IOC_MAGIC, 2, __u8)
#define SPI_IOC_WR_LSB_FIRST _IOW(SPI_IOC_MAGIC, 2, __u8)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPI_IOC_RD_BITS_PER_WORD _IOR(SPI_IOC_MAGIC, 3, __u8)
#define SPI_IOC_WR_BITS_PER_WORD _IOW(SPI_IOC_MAGIC, 3, __u8)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SPI_IOC_RD_MAX_SPEED_HZ _IOR(SPI_IOC_MAGIC, 4, __u32)
#define SPI_IOC_WR_MAX_SPEED_HZ _IOW(SPI_IOC_MAGIC, 4, __u32)
+#define SPI_IOC_RD_MODE32 _IOR(SPI_IOC_MAGIC, 5, __u32)
+#define SPI_IOC_WR_MODE32 _IOW(SPI_IOC_MAGIC, 5, __u32)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/tcp.h b/libc/kernel/uapi/linux/tcp.h
index a7b5c5e..d57ad0c 100644
--- a/libc/kernel/uapi/linux/tcp.h
+++ b/libc/kernel/uapi/linux/tcp.h
@@ -193,16 +193,18 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 tcpi_rcv_space;
__u32 tcpi_total_retrans;
+ __u64 tcpi_pacing_rate;
+ __u64 tcpi_max_pacing_rate;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define TCP_MD5SIG_MAXKEYLEN 80
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct tcp_md5sig {
struct __kernel_sockaddr_storage tcpm_addr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 __tcpm_pad1;
__u16 tcpm_keylen;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 __tcpm_pad2;
__u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/tcp_metrics.h b/libc/kernel/uapi/linux/tcp_metrics.h
index 449ec95..1c36a55 100644
--- a/libc/kernel/uapi/linux/tcp_metrics.h
+++ b/libc/kernel/uapi/linux/tcp_metrics.h
@@ -29,38 +29,41 @@
TCP_METRIC_SSTHRESH,
TCP_METRIC_CWND,
TCP_METRIC_REORDERING,
- __TCP_METRIC_MAX,
+ TCP_METRIC_RTT_US,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ TCP_METRIC_RTTVAR_US,
+ __TCP_METRIC_MAX,
};
#define TCP_METRIC_MAX (__TCP_METRIC_MAX - 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
TCP_METRICS_ATTR_UNSPEC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
TCP_METRICS_ATTR_ADDR_IPV4,
TCP_METRICS_ATTR_ADDR_IPV6,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
TCP_METRICS_ATTR_AGE,
TCP_METRICS_ATTR_TW_TSVAL,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
TCP_METRICS_ATTR_TW_TS_STAMP,
TCP_METRICS_ATTR_VALS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
TCP_METRICS_ATTR_FOPEN_MSS,
TCP_METRICS_ATTR_FOPEN_SYN_DROPS,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS,
TCP_METRICS_ATTR_FOPEN_COOKIE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
TCP_METRICS_ATTR_SADDR_IPV4,
TCP_METRICS_ATTR_SADDR_IPV6,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__TCP_METRICS_ATTR_MAX,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TCP_METRICS_ATTR_MAX (__TCP_METRICS_ATTR_MAX - 1)
enum {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
TCP_METRICS_CMD_UNSPEC,
TCP_METRICS_CMD_GET,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
TCP_METRICS_CMD_DEL,
__TCP_METRICS_CMD_MAX,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define TCP_METRICS_CMD_MAX (__TCP_METRICS_CMD_MAX - 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/tipc.h b/libc/kernel/uapi/linux/tipc.h
index 645c610..8fdd319 100644
--- a/libc/kernel/uapi/linux/tipc.h
+++ b/libc/kernel/uapi/linux/tipc.h
@@ -19,111 +19,126 @@
#ifndef _LINUX_TIPC_H_
#define _LINUX_TIPC_H_
#include <linux/types.h>
-struct tipc_portid {
+#include <linux/sockios.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct tipc_portid {
__u32 ref;
__u32 node;
};
-struct tipc_name {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct tipc_name {
__u32 type;
__u32 instance;
};
-struct tipc_name_seq {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct tipc_name_seq {
__u32 type;
__u32 lower;
__u32 upper;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define TIPC_CFG_SRV 0
#define TIPC_TOP_SRV 1
+#define TIPC_LINK_STATE 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_RESERVED_TYPES 64
#define TIPC_ZONE_SCOPE 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_CLUSTER_SCOPE 2
#define TIPC_NODE_SCOPE 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_MAX_USER_MSG_SIZE 66000U
#define TIPC_LOW_IMPORTANCE 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_MEDIUM_IMPORTANCE 1
#define TIPC_HIGH_IMPORTANCE 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_CRITICAL_IMPORTANCE 3
#define TIPC_OK 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_ERR_NO_NAME 1
#define TIPC_ERR_NO_PORT 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_ERR_NO_NODE 3
#define TIPC_ERR_OVERLOAD 4
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_CONN_SHUTDOWN 5
#define TIPC_SUB_PORTS 0x01
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_SUB_SERVICE 0x02
#define TIPC_SUB_CANCEL 0x04
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_WAIT_FOREVER (~0)
struct tipc_subscr {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct tipc_name_seq seq;
__u32 timeout;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 filter;
char usr_handle[8];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define TIPC_PUBLISHED 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_WITHDRAWN 2
#define TIPC_SUBSCR_TIMEOUT 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct tipc_event {
__u32 event;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 found_lower;
__u32 found_upper;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct tipc_portid port;
struct tipc_subscr s;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#ifndef AF_TIPC
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define AF_TIPC 30
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifndef PF_TIPC
#define PF_TIPC AF_TIPC
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
#ifndef SOL_TIPC
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SOL_TIPC 271
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_ADDR_NAMESEQ 1
#define TIPC_ADDR_MCAST 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_ADDR_NAME 2
#define TIPC_ADDR_ID 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct sockaddr_tipc {
unsigned short family;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char addrtype;
signed char scope;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
struct tipc_portid id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct tipc_name_seq nameseq;
struct {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct tipc_name name;
__u32 domain;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} name;
} addr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define TIPC_ERRINFO 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_RETDATA 2
#define TIPC_DESTNAME 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_IMPORTANCE 127
#define TIPC_SRC_DROPPABLE 128
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_DEST_DROPPABLE 129
#define TIPC_CONN_TIMEOUT 130
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_NODE_RECVQ_DEPTH 131
#define TIPC_SOCK_RECVQ_DEPTH 132
+#define TIPC_MAX_MEDIA_NAME 16
+#define TIPC_MAX_IF_NAME 16
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_MAX_BEARER_NAME 32
+#define TIPC_MAX_LINK_NAME 60
+#define SIOCGETLINKNAME SIOCPROTOPRIVATE
+struct tipc_sioc_ln_req {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 peer;
+ __u32 bearer_id;
+ char linkname[TIPC_MAX_LINK_NAME];
+};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/tipc_config.h b/libc/kernel/uapi/linux/tipc_config.h
index 6ecabda..ca5bc1d 100644
--- a/libc/kernel/uapi/linux/tipc_config.h
+++ b/libc/kernel/uapi/linux/tipc_config.h
@@ -21,176 +21,173 @@
#include <linux/types.h>
#include <linux/string.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <linux/tipc.h>
#include <asm/byteorder.h>
#include <arpa/inet.h>
#define TIPC_CMD_NOOP 0x0000
-#define TIPC_CMD_GET_NODES 0x0001
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CMD_GET_NODES 0x0001
#define TIPC_CMD_GET_MEDIA_NAMES 0x0002
#define TIPC_CMD_GET_BEARER_NAMES 0x0003
#define TIPC_CMD_GET_LINKS 0x0004
-#define TIPC_CMD_SHOW_NAME_TABLE 0x0005
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CMD_SHOW_NAME_TABLE 0x0005
#define TIPC_CMD_SHOW_PORTS 0x0006
#define TIPC_CMD_SHOW_LINK_STATS 0x000B
#define TIPC_CMD_SHOW_STATS 0x000F
-#define TIPC_CMD_GET_REMOTE_MNG 0x4003
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CMD_GET_REMOTE_MNG 0x4003
#define TIPC_CMD_GET_MAX_PORTS 0x4004
#define TIPC_CMD_GET_MAX_PUBL 0x4005
#define TIPC_CMD_GET_MAX_SUBSCR 0x4006
-#define TIPC_CMD_GET_MAX_ZONES 0x4007
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CMD_GET_MAX_ZONES 0x4007
#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008
#define TIPC_CMD_GET_MAX_NODES 0x4009
#define TIPC_CMD_GET_MAX_SLAVES 0x400A
-#define TIPC_CMD_GET_NETID 0x400B
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CMD_GET_NETID 0x400B
#define TIPC_CMD_ENABLE_BEARER 0x4101
#define TIPC_CMD_DISABLE_BEARER 0x4102
#define TIPC_CMD_SET_LINK_TOL 0x4107
-#define TIPC_CMD_SET_LINK_PRI 0x4108
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CMD_SET_LINK_PRI 0x4108
#define TIPC_CMD_SET_LINK_WINDOW 0x4109
#define TIPC_CMD_SET_LOG_SIZE 0x410A
#define TIPC_CMD_DUMP_LOG 0x410B
-#define TIPC_CMD_RESET_LINK_STATS 0x410C
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CMD_RESET_LINK_STATS 0x410C
#define TIPC_CMD_SET_NODE_ADDR 0x8001
#define TIPC_CMD_SET_REMOTE_MNG 0x8003
#define TIPC_CMD_SET_MAX_PORTS 0x8004
-#define TIPC_CMD_SET_MAX_PUBL 0x8005
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CMD_SET_MAX_PUBL 0x8005
#define TIPC_CMD_SET_MAX_SUBSCR 0x8006
#define TIPC_CMD_SET_MAX_ZONES 0x8007
#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008
-#define TIPC_CMD_SET_MAX_NODES 0x8009
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CMD_SET_MAX_NODES 0x8009
#define TIPC_CMD_SET_MAX_SLAVES 0x800A
#define TIPC_CMD_SET_NETID 0x800B
#define TIPC_CMD_NOT_NET_ADMIN 0xC001
-#define TIPC_TLV_NONE 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_TLV_NONE 0
#define TIPC_TLV_VOID 1
#define TIPC_TLV_UNSIGNED 2
#define TIPC_TLV_STRING 3
-#define TIPC_TLV_LARGE_STRING 4
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_TLV_LARGE_STRING 4
#define TIPC_TLV_ULTRA_STRING 5
#define TIPC_TLV_ERROR_STRING 16
#define TIPC_TLV_NET_ADDR 17
-#define TIPC_TLV_MEDIA_NAME 18
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_TLV_MEDIA_NAME 18
#define TIPC_TLV_BEARER_NAME 19
#define TIPC_TLV_LINK_NAME 20
#define TIPC_TLV_NODE_INFO 21
-#define TIPC_TLV_LINK_INFO 22
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_TLV_LINK_INFO 22
#define TIPC_TLV_BEARER_CONFIG 23
#define TIPC_TLV_LINK_CONFIG 24
#define TIPC_TLV_NAME_TBL_QUERY 25
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_TLV_PORT_REF 26
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define TIPC_MAX_MEDIA_NAME 16
-#define TIPC_MAX_IF_NAME 16
-#define TIPC_MAX_BEARER_NAME 32
-#define TIPC_MAX_LINK_NAME 60
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define TIPC_MIN_LINK_PRI 0
#define TIPC_DEF_LINK_PRI 10
#define TIPC_MAX_LINK_PRI 31
-#define TIPC_MEDIA_LINK_PRI (TIPC_MAX_LINK_PRI + 1)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_MEDIA_LINK_PRI (TIPC_MAX_LINK_PRI + 1)
#define TIPC_MIN_LINK_TOL 50
#define TIPC_DEF_LINK_TOL 1500
#define TIPC_MAX_LINK_TOL 30000
-#if TIPC_MIN_LINK_TOL < 16
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#if TIPC_MIN_LINK_TOL < 16
#error "TIPC_MIN_LINK_TOL is too small (abort limit may be NaN)"
#endif
#define TIPC_MIN_LINK_WIN 16
-#define TIPC_DEF_LINK_WIN 50
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_DEF_LINK_WIN 50
#define TIPC_MAX_LINK_WIN 150
struct tipc_node_info {
__be32 addr;
- __be32 up;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __be32 up;
};
struct tipc_link_info {
__be32 dest;
- __be32 up;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __be32 up;
char str[TIPC_MAX_LINK_NAME];
};
struct tipc_bearer_config {
- __be32 priority;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __be32 priority;
__be32 disc_domain;
char name[TIPC_MAX_BEARER_NAME];
};
-struct tipc_link_config {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct tipc_link_config {
__be32 value;
char name[TIPC_MAX_LINK_NAME];
};
-#define TIPC_NTQ_ALLTYPES 0x80000000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_NTQ_ALLTYPES 0x80000000
struct tipc_name_table_query {
__be32 depth;
__be32 type;
- __be32 lowbound;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __be32 lowbound;
__be32 upbound;
};
#define TIPC_CFG_TLV_ERROR "\x80"
-#define TIPC_CFG_NOT_NET_ADMIN "\x81"
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CFG_NOT_NET_ADMIN "\x81"
#define TIPC_CFG_NOT_ZONE_MSTR "\x82"
#define TIPC_CFG_NO_REMOTE "\x83"
#define TIPC_CFG_NOT_SUPPORTED "\x84"
-#define TIPC_CFG_INVALID_VALUE "\x85"
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_CFG_INVALID_VALUE "\x85"
struct tlv_desc {
__be16 tlv_len;
__be16 tlv_type;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define TLV_ALIGNTO 4
#define TLV_ALIGN(datalen) (((datalen)+(TLV_ALIGNTO-1)) & ~(TLV_ALIGNTO-1))
#define TLV_LENGTH(datalen) (sizeof(struct tlv_desc) + (datalen))
-#define TLV_SPACE(datalen) (TLV_ALIGN(TLV_LENGTH(datalen)))
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TLV_SPACE(datalen) (TLV_ALIGN(TLV_LENGTH(datalen)))
#define TLV_DATA(tlv) ((void *)((char *)(tlv) + TLV_LENGTH(0)))
struct tlv_list_desc {
struct tlv_desc *tlv_ptr;
- __u32 tlv_space;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 tlv_space;
};
#define TIPC_GENL_NAME "TIPC"
#define TIPC_GENL_VERSION 0x1
-#define TIPC_GENL_CMD 0x1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TIPC_GENL_CMD 0x1
struct tipc_genlmsghdr {
__u32 dest;
__u16 cmd;
- __u16 reserved;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 reserved;
};
#define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr))
struct tipc_cfg_msg_hdr {
- __be32 tcm_len;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __be32 tcm_len;
__be16 tcm_type;
__be16 tcm_flags;
char tcm_reserved[8];
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define TCM_F_REQUEST 0x1
#define TCM_F_MORE 0x2
#define TCM_ALIGN(datalen) (((datalen)+3) & ~3)
-#define TCM_LENGTH(datalen) (sizeof(struct tipc_cfg_msg_hdr) + datalen)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TCM_LENGTH(datalen) (sizeof(struct tipc_cfg_msg_hdr) + datalen)
#define TCM_SPACE(datalen) (TCM_ALIGN(TCM_LENGTH(datalen)))
#define TCM_DATA(tcm_hdr) ((void *)((char *)(tcm_hdr) + TCM_LENGTH(0)))
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/udp.h b/libc/kernel/uapi/linux/udp.h
index 41a0592..2c0819f 100644
--- a/libc/kernel/uapi/linux/udp.h
+++ b/libc/kernel/uapi/linux/udp.h
@@ -29,8 +29,11 @@
};
#define UDP_CORK 1
#define UDP_ENCAP 100
-#define UDP_ENCAP_ESPINUDP_NON_IKE 1
+#define UDP_NO_CHECK6_TX 101
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define UDP_NO_CHECK6_RX 102
+#define UDP_ENCAP_ESPINUDP_NON_IKE 1
#define UDP_ENCAP_ESPINUDP 2
#define UDP_ENCAP_L2TPINUDP 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/uhid.h b/libc/kernel/uapi/linux/uhid.h
index 37c3b17..e52f68e 100644
--- a/libc/kernel/uapi/linux/uhid.h
+++ b/libc/kernel/uapi/linux/uhid.h
@@ -21,88 +21,114 @@
#include <linux/input.h>
#include <linux/types.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <linux/hid.h>
enum uhid_event_type {
UHID_CREATE,
UHID_DESTROY,
- UHID_START,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ UHID_START,
UHID_STOP,
UHID_OPEN,
UHID_CLOSE,
- UHID_OUTPUT,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ UHID_OUTPUT,
UHID_OUTPUT_EV,
UHID_INPUT,
UHID_FEATURE,
- UHID_FEATURE_ANSWER,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ UHID_FEATURE_ANSWER,
+ UHID_CREATE2,
+ UHID_INPUT2,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct uhid_create_req {
__u8 name[128];
__u8 phys[64];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 uniq[64];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 __user *rd_data;
__u16 rd_size;
__u16 bus;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 vendor;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 product;
__u32 version;
__u32 country;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((__packed__));
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct uhid_create2_req {
+ __u8 name[128];
+ __u8 phys[64];
+ __u8 uniq[64];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 rd_size;
+ __u16 bus;
+ __u32 vendor;
+ __u32 product;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 version;
+ __u32 country;
+ __u8 rd_data[HID_MAX_DESCRIPTOR_SIZE];
+} __attribute__((__packed__));
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define UHID_DATA_MAX 4096
enum uhid_report_type {
UHID_FEATURE_REPORT,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
UHID_OUTPUT_REPORT,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
UHID_INPUT_REPORT,
};
struct uhid_input_req {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 data[UHID_DATA_MAX];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 size;
} __attribute__((__packed__));
-struct uhid_output_req {
+struct uhid_input2_req {
+ __u16 size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 data[UHID_DATA_MAX];
+} __attribute__((__packed__));
+struct uhid_output_req {
+ __u8 data[UHID_DATA_MAX];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 size;
__u8 rtype;
} __attribute__((__packed__));
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct uhid_output_ev_req {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 type;
__u16 code;
__s32 value;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((__packed__));
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct uhid_feature_req {
__u32 id;
__u8 rnum;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 rtype;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((__packed__));
struct uhid_feature_answer_req {
__u32 id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 err;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 size;
__u8 data[UHID_DATA_MAX];
} __attribute__((__packed__));
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct uhid_event {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
union {
struct uhid_create_req create;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct uhid_input_req input;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct uhid_output_req output;
struct uhid_output_ev_req output_ev;
struct uhid_feature_req feature;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct uhid_feature_answer_req feature_answer;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct uhid_create2_req create2;
+ struct uhid_input2_req input2;
} u;
} __attribute__((__packed__));
-#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/linux/uinput.h b/libc/kernel/uapi/linux/uinput.h
index 6ad0334..f622822 100644
--- a/libc/kernel/uapi/linux/uinput.h
+++ b/libc/kernel/uapi/linux/uinput.h
@@ -21,7 +21,7 @@
#include <linux/types.h>
#include <linux/input.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define UINPUT_VERSION 3
+#define UINPUT_VERSION 4
struct uinput_ff_upload {
__u32 request_id;
__s32 retval;
@@ -58,21 +58,22 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase)
#define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase)
+#define UI_GET_SYSNAME(len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 300, len)
#define EV_UINPUT 0x0101
-#define UI_FF_UPLOAD 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define UI_FF_UPLOAD 1
#define UI_FF_ERASE 2
#define UINPUT_MAX_NAME_SIZE 80
struct uinput_user_dev {
- char name[UINPUT_MAX_NAME_SIZE];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ char name[UINPUT_MAX_NAME_SIZE];
struct input_id id;
__u32 ff_effects_max;
__s32 absmax[ABS_CNT];
- __s32 absmin[ABS_CNT];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __s32 absmin[ABS_CNT];
__s32 absfuzz[ABS_CNT];
__s32 absflat[ABS_CNT];
};
-#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/linux/usb/cdc-wdm.h b/libc/kernel/uapi/linux/usb/cdc-wdm.h
index e170f59..23855bd 100644
--- a/libc/kernel/uapi/linux/usb/cdc-wdm.h
+++ b/libc/kernel/uapi/linux/usb/cdc-wdm.h
@@ -18,6 +18,7 @@
****************************************************************************/
#ifndef _UAPI__LINUX_USB_CDC_WDM_H
#define _UAPI__LINUX_USB_CDC_WDM_H
+#include <linux/types.h>
#define IOCTL_WDM_MAX_COMMAND _IOR('H', 0xA0, __u16)
-#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/linux/usb/cdc.h b/libc/kernel/uapi/linux/usb/cdc.h
index 17278e1..698d9ec 100644
--- a/libc/kernel/uapi/linux/usb/cdc.h
+++ b/libc/kernel/uapi/linux/usb/cdc.h
@@ -62,312 +62,323 @@
#define USB_CDC_NCM_TYPE 0x1a
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define USB_CDC_MBIM_TYPE 0x1b
+#define USB_CDC_MBIM_EXTENDED_TYPE 0x1c
struct usb_cdc_header_desc {
__u8 bLength;
- __u8 bDescriptorType;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdCDC;
} __attribute__ ((packed));
-struct usb_cdc_call_mgmt_descriptor {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct usb_cdc_call_mgmt_descriptor {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
- __u8 bmCapabilities;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bmCapabilities;
#define USB_CDC_CALL_MGMT_CAP_CALL_MGMT 0x01
#define USB_CDC_CALL_MGMT_CAP_DATA_INTF 0x02
__u8 bDataInterface;
-} __attribute__ ((packed));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__ ((packed));
struct usb_cdc_acm_descriptor {
__u8 bLength;
__u8 bDescriptorType;
- __u8 bDescriptorSubType;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bDescriptorSubType;
__u8 bmCapabilities;
} __attribute__ ((packed));
#define USB_CDC_COMM_FEATURE 0x01
-#define USB_CDC_CAP_LINE 0x02
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_CAP_LINE 0x02
#define USB_CDC_CAP_BRK 0x04
#define USB_CDC_CAP_NOTIFY 0x08
struct usb_cdc_union_desc {
- __u8 bLength;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__u8 bMasterInterface0;
- __u8 bSlaveInterface0;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bSlaveInterface0;
} __attribute__ ((packed));
struct usb_cdc_country_functional_desc {
__u8 bLength;
- __u8 bDescriptorType;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bDescriptorType;
__u8 bDescriptorSubType;
__u8 iCountryCodeRelDate;
__le16 wCountyCode0;
-} __attribute__ ((packed));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__ ((packed));
struct usb_cdc_network_terminal_desc {
__u8 bLength;
__u8 bDescriptorType;
- __u8 bDescriptorSubType;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bDescriptorSubType;
__u8 bEntityId;
__u8 iName;
__u8 bChannelIndex;
- __u8 bPhysicalInterface;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bPhysicalInterface;
} __attribute__ ((packed));
struct usb_cdc_ether_desc {
__u8 bLength;
- __u8 bDescriptorType;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bDescriptorType;
__u8 bDescriptorSubType;
__u8 iMACAddress;
__le32 bmEthernetStatistics;
- __le16 wMaxSegmentSize;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 wMaxSegmentSize;
__le16 wNumberMCFilters;
__u8 bNumberPowerFilters;
} __attribute__ ((packed));
-struct usb_cdc_dmm_desc {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct usb_cdc_dmm_desc {
__u8 bFunctionLength;
__u8 bDescriptorType;
__u8 bDescriptorSubtype;
- __u16 bcdVersion;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 bcdVersion;
__le16 wMaxCommand;
} __attribute__ ((packed));
struct usb_cdc_mdlm_desc {
- __u8 bLength;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdVersion;
- __u8 bGUID[16];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bGUID[16];
} __attribute__ ((packed));
struct usb_cdc_mdlm_detail_desc {
__u8 bLength;
- __u8 bDescriptorType;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bDescriptorType;
__u8 bDescriptorSubType;
__u8 bGuidDescriptorType;
__u8 bDetailData[0];
-} __attribute__ ((packed));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__ ((packed));
struct usb_cdc_obex_desc {
__u8 bLength;
__u8 bDescriptorType;
- __u8 bDescriptorSubType;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bDescriptorSubType;
__le16 bcdVersion;
} __attribute__ ((packed));
struct usb_cdc_ncm_desc {
- __u8 bLength;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__le16 bcdNcmVersion;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bmNetworkCapabilities;
+} __attribute__ ((packed));
+struct usb_cdc_mbim_desc {
+ __u8 bLength;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+ __le16 bcdMBIMVersion;
+ __le16 wMaxControlMessage;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bNumberFilters;
+ __u8 bMaxFilterSize;
+ __le16 wMaxSegmentSize;
__u8 bmNetworkCapabilities;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__ ((packed));
-struct usb_cdc_mbim_desc {
+struct usb_cdc_mbim_extended_desc {
__u8 bLength;
__u8 bDescriptorType;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 bDescriptorSubType;
- __le16 bcdMBIMVersion;
- __le16 wMaxControlMessage;
- __u8 bNumberFilters;
+ __le16 bcdMBIMExtendedVersion;
+ __u8 bMaxOutstandingCommandMessages;
+ __le16 wMTU;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 bMaxFilterSize;
- __le16 wMaxSegmentSize;
- __u8 bmNetworkCapabilities;
} __attribute__ ((packed));
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define USB_CDC_SEND_ENCAPSULATED_COMMAND 0x00
#define USB_CDC_GET_ENCAPSULATED_RESPONSE 0x01
#define USB_CDC_REQ_SET_LINE_CODING 0x20
-#define USB_CDC_REQ_GET_LINE_CODING 0x21
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_REQ_GET_LINE_CODING 0x21
#define USB_CDC_REQ_SET_CONTROL_LINE_STATE 0x22
#define USB_CDC_REQ_SEND_BREAK 0x23
#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40
-#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41
#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42
#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43
#define USB_CDC_GET_ETHERNET_STATISTIC 0x44
-#define USB_CDC_GET_NTB_PARAMETERS 0x80
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_GET_NTB_PARAMETERS 0x80
#define USB_CDC_GET_NET_ADDRESS 0x81
#define USB_CDC_SET_NET_ADDRESS 0x82
#define USB_CDC_GET_NTB_FORMAT 0x83
-#define USB_CDC_SET_NTB_FORMAT 0x84
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_SET_NTB_FORMAT 0x84
#define USB_CDC_GET_NTB_INPUT_SIZE 0x85
#define USB_CDC_SET_NTB_INPUT_SIZE 0x86
#define USB_CDC_GET_MAX_DATAGRAM_SIZE 0x87
-#define USB_CDC_SET_MAX_DATAGRAM_SIZE 0x88
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_SET_MAX_DATAGRAM_SIZE 0x88
#define USB_CDC_GET_CRC_MODE 0x89
#define USB_CDC_SET_CRC_MODE 0x8a
struct usb_cdc_line_coding {
- __le32 dwDTERate;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le32 dwDTERate;
__u8 bCharFormat;
#define USB_CDC_1_STOP_BITS 0
#define USB_CDC_1_5_STOP_BITS 1
-#define USB_CDC_2_STOP_BITS 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_2_STOP_BITS 2
__u8 bParityType;
#define USB_CDC_NO_PARITY 0
#define USB_CDC_ODD_PARITY 1
-#define USB_CDC_EVEN_PARITY 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_EVEN_PARITY 2
#define USB_CDC_MARK_PARITY 3
#define USB_CDC_SPACE_PARITY 4
__u8 bDataBits;
-} __attribute__ ((packed));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__ ((packed));
#define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0)
#define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1)
#define USB_CDC_PACKET_TYPE_DIRECTED (1 << 2)
-#define USB_CDC_PACKET_TYPE_BROADCAST (1 << 3)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_PACKET_TYPE_BROADCAST (1 << 3)
#define USB_CDC_PACKET_TYPE_MULTICAST (1 << 4)
#define USB_CDC_NOTIFY_NETWORK_CONNECTION 0x00
#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE 0x01
-#define USB_CDC_NOTIFY_SERIAL_STATE 0x20
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_NOTIFY_SERIAL_STATE 0x20
#define USB_CDC_NOTIFY_SPEED_CHANGE 0x2a
struct usb_cdc_notification {
__u8 bmRequestType;
- __u8 bNotificationType;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 bNotificationType;
__le16 wValue;
__le16 wIndex;
__le16 wLength;
-} __attribute__ ((packed));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__ ((packed));
struct usb_cdc_speed_change {
__le32 DLBitRRate;
__le32 ULBitRate;
-} __attribute__ ((packed));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__ ((packed));
struct usb_cdc_ncm_ntb_parameters {
__le16 wLength;
__le16 bmNtbFormatsSupported;
- __le32 dwNtbInMaxSize;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le32 dwNtbInMaxSize;
__le16 wNdpInDivisor;
__le16 wNdpInPayloadRemainder;
__le16 wNdpInAlignment;
- __le16 wPadding1;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 wPadding1;
__le32 dwNtbOutMaxSize;
__le16 wNdpOutDivisor;
__le16 wNdpOutPayloadRemainder;
- __le16 wNdpOutAlignment;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 wNdpOutAlignment;
__le16 wNtbOutMaxDatagrams;
} __attribute__ ((packed));
#define USB_CDC_NCM_NTH16_SIGN 0x484D434E
-#define USB_CDC_NCM_NTH32_SIGN 0x686D636E
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_NCM_NTH32_SIGN 0x686D636E
struct usb_cdc_ncm_nth16 {
__le32 dwSignature;
__le16 wHeaderLength;
- __le16 wSequence;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 wSequence;
__le16 wBlockLength;
__le16 wNdpIndex;
} __attribute__ ((packed));
-struct usb_cdc_ncm_nth32 {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct usb_cdc_ncm_nth32 {
__le32 dwSignature;
__le16 wHeaderLength;
__le16 wSequence;
- __le32 dwBlockLength;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le32 dwBlockLength;
__le32 dwNdpIndex;
} __attribute__ ((packed));
#define USB_CDC_NCM_NDP16_CRC_SIGN 0x314D434E
-#define USB_CDC_NCM_NDP16_NOCRC_SIGN 0x304D434E
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_NCM_NDP16_NOCRC_SIGN 0x304D434E
#define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E
#define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E
#define USB_CDC_MBIM_NDP16_IPS_SIGN 0x00535049
-#define USB_CDC_MBIM_NDP32_IPS_SIGN 0x00737069
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_MBIM_NDP32_IPS_SIGN 0x00737069
#define USB_CDC_MBIM_NDP16_DSS_SIGN 0x00535344
#define USB_CDC_MBIM_NDP32_DSS_SIGN 0x00737364
struct usb_cdc_ncm_dpe16 {
- __le16 wDatagramIndex;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 wDatagramIndex;
__le16 wDatagramLength;
} __attribute__((__packed__));
struct usb_cdc_ncm_ndp16 {
- __le32 dwSignature;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le32 dwSignature;
__le16 wLength;
__le16 wNextNdpIndex;
struct usb_cdc_ncm_dpe16 dpe16[0];
-} __attribute__ ((packed));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__ ((packed));
struct usb_cdc_ncm_dpe32 {
__le32 dwDatagramIndex;
__le32 dwDatagramLength;
-} __attribute__((__packed__));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__((__packed__));
struct usb_cdc_ncm_ndp32 {
__le32 dwSignature;
__le16 wLength;
- __le16 wReserved6;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 wReserved6;
__le32 dwNextNdpIndex;
__le32 dwReserved12;
struct usb_cdc_ncm_dpe32 dpe32[0];
-} __attribute__ ((packed));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__ ((packed));
#define USB_CDC_NCM_NDP16_INDEX_MIN 0x000C
#define USB_CDC_NCM_NDP32_INDEX_MIN 0x0010
#define USB_CDC_NCM_DATAGRAM_FORMAT_CRC 0x30
-#define USB_CDC_NCM_DATAGRAM_FORMAT_NOCRC 0X31
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_NCM_DATAGRAM_FORMAT_NOCRC 0X31
#define USB_CDC_NCM_PROTO_CODE_NO_ENCAP_COMMANDS 0x00
#define USB_CDC_NCM_PROTO_CODE_EXTERN_PROTO 0xFE
#define USB_CDC_NCM_NCAP_ETH_FILTER (1 << 0)
-#define USB_CDC_NCM_NCAP_NET_ADDRESS (1 << 1)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_NCM_NCAP_NET_ADDRESS (1 << 1)
#define USB_CDC_NCM_NCAP_ENCAP_COMMAND (1 << 2)
#define USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE (1 << 3)
#define USB_CDC_NCM_NCAP_CRC_MODE (1 << 4)
-#define USB_CDC_NCM_NCAP_NTB_INPUT_SIZE (1 << 5)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_NCM_NCAP_NTB_INPUT_SIZE (1 << 5)
#define USB_CDC_NCM_NTB16_SUPPORTED (1 << 0)
#define USB_CDC_NCM_NTB32_SUPPORTED (1 << 1)
#define USB_CDC_NCM_NDP_ALIGN_MIN_SIZE 0x04
-#define USB_CDC_NCM_NTB_MAX_LENGTH 0x1C
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_NCM_NTB_MAX_LENGTH 0x1C
#define USB_CDC_NCM_NTB16_FORMAT 0x00
#define USB_CDC_NCM_NTB32_FORMAT 0x01
#define USB_CDC_NCM_NTB_MIN_IN_SIZE 2048
-#define USB_CDC_NCM_NTB_MIN_OUT_SIZE 2048
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define USB_CDC_NCM_NTB_MIN_OUT_SIZE 2048
struct usb_cdc_ncm_ndp_input_size {
__le32 dwNtbInMaxSize;
__le16 wNtbInMaxDatagrams;
- __le16 wReserved;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __le16 wReserved;
} __attribute__ ((packed));
#define USB_CDC_NCM_CRC_NOT_APPENDED 0x00
#define USB_CDC_NCM_CRC_APPENDED 0x01
-#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/linux/usb/functionfs.h b/libc/kernel/uapi/linux/usb/functionfs.h
index 3ea185a..359529c 100644
--- a/libc/kernel/uapi/linux/usb/functionfs.h
+++ b/libc/kernel/uapi/linux/usb/functionfs.h
@@ -24,58 +24,66 @@
#include <linux/usb/ch9.h>
enum {
FUNCTIONFS_DESCRIPTORS_MAGIC = 1,
- FUNCTIONFS_STRINGS_MAGIC = 2
+ FUNCTIONFS_STRINGS_MAGIC = 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ FUNCTIONFS_DESCRIPTORS_MAGIC_V2 = 3,
+};
+enum functionfs_flags {
+ FUNCTIONFS_HAS_FS_DESC = 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ FUNCTIONFS_HAS_HS_DESC = 2,
+ FUNCTIONFS_HAS_SS_DESC = 4,
};
struct usb_endpoint_descriptor_no_audio {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 bLength;
__u8 bDescriptorType;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 bEndpointAddress;
__u8 bmAttributes;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__le16 wMaxPacketSize;
__u8 bInterval;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((packed));
struct usb_functionfs_descs_head {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__le32 magic;
__le32 length;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__le32 fs_count;
__le32 hs_count;
-} __attribute__((packed));
-struct usb_functionfs_strings_head {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} __attribute__((packed, deprecated));
+struct usb_functionfs_strings_head {
__le32 magic;
__le32 length;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__le32 str_count;
__le32 lang_count;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((packed));
enum usb_functionfs_event_type {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUNCTIONFS_BIND,
FUNCTIONFS_UNBIND,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUNCTIONFS_ENABLE,
FUNCTIONFS_DISABLE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUNCTIONFS_SETUP,
FUNCTIONFS_SUSPEND,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
FUNCTIONFS_RESUME
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct usb_functionfs_event {
union {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct usb_ctrlrequest setup;
} __attribute__((packed)) u;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 type;
__u8 _pad[3];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((packed));
#define FUNCTIONFS_FIFO_STATUS _IO('g', 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FUNCTIONFS_FIFO_FLUSH _IO('g', 2)
#define FUNCTIONFS_CLEAR_HALT _IO('g', 3)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define FUNCTIONFS_INTERFACE_REVMAP _IO('g', 128)
#define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/usbdevice_fs.h b/libc/kernel/uapi/linux/usbdevice_fs.h
index 0c1781d..359d351 100644
--- a/libc/kernel/uapi/linux/usbdevice_fs.h
+++ b/libc/kernel/uapi/linux/usbdevice_fs.h
@@ -91,37 +91,47 @@
int actual_length;
int start_frame;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ union {
int number_of_packets;
+ unsigned int stream_id;
+ };
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int error_count;
unsigned int signr;
void __user *usercontext;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct usbdevfs_iso_packet_desc iso_frame_desc[0];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct usbdevfs_ioctl {
int ifno;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int ioctl_code;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
void __user *data;
};
struct usbdevfs_hub_portinfo {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char nports;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char port [127];
};
#define USBDEVFS_CAP_ZERO_PACKET 0x01
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define USBDEVFS_CAP_BULK_CONTINUATION 0x02
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04
#define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08
#define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct usbdevfs_disconnect_claim {
unsigned int interface;
unsigned int flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char driver[USBDEVFS_MAXDRIVERNAME + 1];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+struct usbdevfs_streams {
+ unsigned int num_streams;
+ unsigned int num_eps;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned char eps[0];
};
#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
#define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
@@ -162,4 +172,7 @@
#define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim)
+#define USBDEVFS_ALLOC_STREAMS _IOR('U', 28, struct usbdevfs_streams)
+#define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams)
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/usbip.h b/libc/kernel/uapi/linux/usbip.h
new file mode 100644
index 0000000..bc3f292
--- /dev/null
+++ b/libc/kernel/uapi/linux/usbip.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_USBIP_H
+#define _UAPI_LINUX_USBIP_H
+enum usbip_device_status {
+ SDEV_ST_AVAILABLE = 0x01,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ SDEV_ST_USED,
+ SDEV_ST_ERROR,
+ VDEV_ST_NULL,
+ VDEV_ST_NOTASSIGNED,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ VDEV_ST_USED,
+ VDEV_ST_ERROR
+};
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/v4l2-common.h b/libc/kernel/uapi/linux/v4l2-common.h
index 814d960..eaf3bfc 100644
--- a/libc/kernel/uapi/linux/v4l2-common.h
+++ b/libc/kernel/uapi/linux/v4l2-common.h
@@ -18,28 +18,38 @@
****************************************************************************/
#ifndef __V4L2_COMMON__
#define __V4L2_COMMON__
+#include <linux/types.h>
#define V4L2_SEL_TGT_CROP 0x0000
-#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
#define V4L2_SEL_TGT_COMPOSE 0x0100
#define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
-#define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
#define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
-#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
-#define V4L2_SEL_FLAG_GE (1 << 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_SEL_FLAG_GE (1 << 0)
#define V4L2_SEL_FLAG_LE (1 << 1)
#define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2)
#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
-#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
+struct v4l2_edid {
+ __u32 pad;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 start_block;
+ __u32 blocks;
+ __u32 reserved[5];
+ __u8 *edid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#endif
diff --git a/libc/kernel/uapi/linux/v4l2-controls.h b/libc/kernel/uapi/linux/v4l2-controls.h
index 2236ff7..abaf199 100644
--- a/libc/kernel/uapi/linux/v4l2-controls.h
+++ b/libc/kernel/uapi/linux/v4l2-controls.h
@@ -31,900 +31,921 @@
#define V4L2_CTRL_CLASS_DV 0x00a00000
#define V4L2_CTRL_CLASS_FM_RX 0x00a10000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CTRL_CLASS_RF_TUNER 0x00a20000
#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
#define V4L2_CID_USER_BASE V4L2_CID_BASE
#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
-#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
#define V4L2_CID_HUE (V4L2_CID_BASE+3)
-#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
-#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11)
#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
-#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
-#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA)
#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
-#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
#define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24)
enum v4l2_power_line_frequency {
- V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
#define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27)
-#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
#define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
#define V4L2_CID_COLORFX (V4L2_CID_BASE+31)
-enum v4l2_colorfx {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum v4l2_colorfx {
V4L2_COLORFX_NONE = 0,
V4L2_COLORFX_BW = 1,
V4L2_COLORFX_SEPIA = 2,
- V4L2_COLORFX_NEGATIVE = 3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_COLORFX_NEGATIVE = 3,
V4L2_COLORFX_EMBOSS = 4,
V4L2_COLORFX_SKETCH = 5,
V4L2_COLORFX_SKY_BLUE = 6,
- V4L2_COLORFX_GRASS_GREEN = 7,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_COLORFX_GRASS_GREEN = 7,
V4L2_COLORFX_SKIN_WHITEN = 8,
V4L2_COLORFX_VIVID = 9,
V4L2_COLORFX_AQUA = 10,
- V4L2_COLORFX_ART_FREEZE = 11,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_COLORFX_ART_FREEZE = 11,
V4L2_COLORFX_SILHOUETTE = 12,
V4L2_COLORFX_SOLARIZATION = 13,
V4L2_COLORFX_ANTIQUE = 14,
- V4L2_COLORFX_SET_CBCR = 15,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_COLORFX_SET_CBCR = 15,
};
#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
-#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
-#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
-#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43)
#define V4L2_CID_USER_MEYE_BASE (V4L2_CID_USER_BASE + 0x1000)
#define V4L2_CID_USER_BTTV_BASE (V4L2_CID_USER_BASE + 0x1010)
-#define V4L2_CID_USER_S2255_BASE (V4L2_CID_USER_BASE + 0x1030)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_USER_S2255_BASE (V4L2_CID_USER_BASE + 0x1030)
#define V4L2_CID_USER_SI476X_BASE (V4L2_CID_USER_BASE + 0x1040)
#define V4L2_CID_USER_TI_VPE_BASE (V4L2_CID_USER_BASE + 0x1050)
#define V4L2_CID_USER_SAA7134_BASE (V4L2_CID_USER_BASE + 0x1060)
-#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
enum v4l2_mpeg_stream_type {
- V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0,
V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1,
V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2,
V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3,
- V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4,
V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5,
};
#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
-#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
-#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
enum v4l2_mpeg_stream_vbi_fmt {
V4L2_MPEG_STREAM_VBI_FMT_NONE = 0,
- V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1,
};
#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
enum v4l2_mpeg_audio_sampling_freq {
- V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
};
-#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
enum v4l2_mpeg_audio_encoding {
V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
- V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
V4L2_MPEG_AUDIO_ENCODING_AAC = 3,
V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,
};
-#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
enum v4l2_mpeg_audio_l1_bitrate {
V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
- V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
- V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
- V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
enum v4l2_mpeg_audio_l2_bitrate {
V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
- V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
- V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
- V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
- V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
};
#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
enum v4l2_mpeg_audio_l3_bitrate {
- V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
- V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
- V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
- V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
};
#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
-enum v4l2_mpeg_audio_mode {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum v4l2_mpeg_audio_mode {
V4L2_MPEG_AUDIO_MODE_STEREO = 0,
V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
V4L2_MPEG_AUDIO_MODE_DUAL = 2,
- V4L2_MPEG_AUDIO_MODE_MONO = 3,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_MODE_MONO = 3,
};
#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
enum v4l2_mpeg_audio_mode_extension {
- V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
enum v4l2_mpeg_audio_emphasis {
V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
- V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
};
#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
-enum v4l2_mpeg_audio_crc {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum v4l2_mpeg_audio_crc {
V4L2_MPEG_AUDIO_CRC_NONE = 0,
V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
};
-#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)
#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)
enum v4l2_mpeg_audio_ac3_bitrate {
- V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,
V4L2_MPEG_AUDIO_AC3_BITRATE_48K = 2,
V4L2_MPEG_AUDIO_AC3_BITRATE_56K = 3,
- V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4,
V4L2_MPEG_AUDIO_AC3_BITRATE_80K = 5,
V4L2_MPEG_AUDIO_AC3_BITRATE_96K = 6,
V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
- V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
- V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
- V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
};
-#define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112)
enum v4l2_mpeg_audio_dec_playback {
V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO = 0,
V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO = 1,
- V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT = 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT = 2,
V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT = 3,
V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO = 4,
V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5,
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113)
#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
enum v4l2_mpeg_video_encoding {
- V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
};
-#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
enum v4l2_mpeg_video_aspect {
V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
- V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
};
#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
-#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
-enum v4l2_mpeg_video_bitrate_mode {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum v4l2_mpeg_video_bitrate_mode {
V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
};
-#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
-#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)
#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)
#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)
-#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)
enum v4l2_mpeg_video_header_mode {
V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,
- V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
};
#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)
#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)
-#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)
#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)
enum v4l2_mpeg_video_multi_slice_mode {
- V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,
V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,
};
-#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
#define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225)
-#define V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (V4L2_CID_MPEG_BASE+226)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (V4L2_CID_MPEG_BASE+226)
+#define V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (V4L2_CID_MPEG_BASE+227)
+#define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (V4L2_CID_MPEG_BASE+228)
#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)
#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)
#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)
#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)
#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)
#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_mpeg_video_h264_entropy_mode {
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)
#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)
enum v4l2_mpeg_video_h264_level {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,
V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2,
V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5,
V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6,
V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9,
V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10,
V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,
V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,
V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)
#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)
#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_mpeg_video_h264_loop_filter_mode {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,
V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,
V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)
enum v4l2_mpeg_video_h264_profile {
V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2,
V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10,
V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11,
V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,
V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,
V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)
#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)
#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_mpeg_video_h264_vui_sar_idc {
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_MPEG_BASE+368)
#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_MPEG_BASE+369)
#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_MPEG_BASE+370)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHECKERBOARD = 0,
V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN = 1,
V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE = 3,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM = 4,
V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL = 5,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_MPEG_BASE+371)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_MPEG_BASE+372)
enum v4l2_mpeg_video_h264_fmo_map_type {
V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES = 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER = 2,
V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT = 3,
V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN = 4,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN = 5,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT = 6,
};
#define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_MPEG_BASE+373)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_MPEG_BASE+374)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_mpeg_video_h264_fmo_change_dir {
V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT = 0,
V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_MPEG_BASE+375)
#define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_MPEG_BASE+376)
#define V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_MPEG_BASE+377)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_MPEG_BASE+378)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_MPEG_BASE+379)
#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_MPEG_BASE+380)
enum v4l2_mpeg_video_h264_hierarchical_coding_type {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P = 1,
};
#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)
#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)
enum v4l2_mpeg_video_mpeg4_level {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)
enum v4l2_mpeg_video_mpeg4_profile {
V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2,
V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,
V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
#define V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS (V4L2_CID_MPEG_BASE+500)
enum v4l2_vp8_num_partitions {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS = 1,
V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS = 2,
V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS = 3,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (V4L2_CID_MPEG_BASE+501)
#define V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES (V4L2_CID_MPEG_BASE+502)
enum v4l2_vp8_num_ref_frames {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME = 1,
V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME = 2,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (V4L2_CID_MPEG_BASE+503)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (V4L2_CID_MPEG_BASE+504)
#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (V4L2_CID_MPEG_BASE+505)
#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL (V4L2_CID_MPEG_BASE+506)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_vp8_golden_frame_sel {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0,
V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (V4L2_CID_MPEG_BASE+507)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (V4L2_CID_MPEG_BASE+508)
#define V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (V4L2_CID_MPEG_BASE+509)
#define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_MPEG_BASE+510)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_VIDEO_VPX_PROFILE (V4L2_CID_MPEG_BASE+511)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
};
#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_mpeg_cx2341x_video_median_filter_type {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
};
#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)
#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)
#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_mpeg_mfc51_video_frame_skip_mode {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)
enum v4l2_mpeg_mfc51_video_force_frame_type {
V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,
};
#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)
#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
#define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1)
enum v4l2_exposure_auto_type {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_EXPOSURE_AUTO = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_EXPOSURE_MANUAL = 1,
V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
V4L2_EXPOSURE_APERTURE_PRIORITY = 3
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+2)
#define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE+3)
#define V4L2_CID_PAN_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_TILT_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+5)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_PAN_RESET (V4L2_CID_CAMERA_CLASS_BASE+6)
#define V4L2_CID_TILT_RESET (V4L2_CID_CAMERA_CLASS_BASE+7)
#define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+8)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+9)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10)
#define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
#define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)
#define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+15)
#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
#define V4L2_CID_AUTO_EXPOSURE_BIAS (V4L2_CID_CAMERA_CLASS_BASE+19)
#define V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE (V4L2_CID_CAMERA_CLASS_BASE+20)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_auto_n_preset_white_balance {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_WHITE_BALANCE_MANUAL = 0,
V4L2_WHITE_BALANCE_AUTO = 1,
V4L2_WHITE_BALANCE_INCANDESCENT = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_WHITE_BALANCE_FLUORESCENT = 3,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_WHITE_BALANCE_FLUORESCENT_H = 4,
V4L2_WHITE_BALANCE_HORIZON = 5,
V4L2_WHITE_BALANCE_DAYLIGHT = 6,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_WHITE_BALANCE_FLASH = 7,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_WHITE_BALANCE_CLOUDY = 8,
V4L2_WHITE_BALANCE_SHADE = 9,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_WIDE_DYNAMIC_RANGE (V4L2_CID_CAMERA_CLASS_BASE+21)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_IMAGE_STABILIZATION (V4L2_CID_CAMERA_CLASS_BASE+22)
#define V4L2_CID_ISO_SENSITIVITY (V4L2_CID_CAMERA_CLASS_BASE+23)
#define V4L2_CID_ISO_SENSITIVITY_AUTO (V4L2_CID_CAMERA_CLASS_BASE+24)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_iso_sensitivity_auto_type {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_ISO_SENSITIVITY_MANUAL = 0,
V4L2_ISO_SENSITIVITY_AUTO = 1,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_EXPOSURE_METERING (V4L2_CID_CAMERA_CLASS_BASE+25)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_exposure_metering {
V4L2_EXPOSURE_METERING_AVERAGE = 0,
V4L2_EXPOSURE_METERING_CENTER_WEIGHTED = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_EXPOSURE_METERING_SPOT = 2,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_EXPOSURE_METERING_MATRIX = 3,
};
#define V4L2_CID_SCENE_MODE (V4L2_CID_CAMERA_CLASS_BASE+26)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_scene_mode {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_SCENE_MODE_NONE = 0,
V4L2_SCENE_MODE_BACKLIGHT = 1,
V4L2_SCENE_MODE_BEACH_SNOW = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_SCENE_MODE_CANDLE_LIGHT = 3,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_SCENE_MODE_DAWN_DUSK = 4,
V4L2_SCENE_MODE_FALL_COLORS = 5,
V4L2_SCENE_MODE_FIREWORKS = 6,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_SCENE_MODE_LANDSCAPE = 7,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_SCENE_MODE_NIGHT = 8,
V4L2_SCENE_MODE_PARTY_INDOOR = 9,
V4L2_SCENE_MODE_PORTRAIT = 10,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_SCENE_MODE_SPORTS = 11,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_SCENE_MODE_SUNSET = 12,
V4L2_SCENE_MODE_TEXT = 13,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_3A_LOCK (V4L2_CID_CAMERA_CLASS_BASE+27)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_LOCK_EXPOSURE (1 << 0)
#define V4L2_LOCK_WHITE_BALANCE (1 << 1)
#define V4L2_LOCK_FOCUS (1 << 2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_AUTO_FOCUS_START (V4L2_CID_CAMERA_CLASS_BASE+28)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_AUTO_FOCUS_STOP (V4L2_CID_CAMERA_CLASS_BASE+29)
#define V4L2_CID_AUTO_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+30)
#define V4L2_AUTO_FOCUS_STATUS_IDLE (0 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_AUTO_FOCUS_STATUS_BUSY (1 << 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_AUTO_FOCUS_STATUS_REACHED (1 << 1)
#define V4L2_AUTO_FOCUS_STATUS_FAILED (1 << 2)
#define V4L2_CID_AUTO_FOCUS_RANGE (V4L2_CID_CAMERA_CLASS_BASE+31)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_auto_focus_range {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_AUTO_FOCUS_RANGE_AUTO = 0,
V4L2_AUTO_FOCUS_RANGE_NORMAL = 1,
V4L2_AUTO_FOCUS_RANGE_MACRO = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_AUTO_FOCUS_RANGE_INFINITY = 3,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_RDS_TX_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
#define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3)
#define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64)
#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65)
#define V4L2_CID_AUDIO_LIMITER_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 66)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 80)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_AUDIO_COMPRESSION_GAIN (V4L2_CID_FM_TX_CLASS_BASE + 81)
#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 82)
#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 83)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 84)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_PILOT_TONE_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 96)
#define V4L2_CID_PILOT_TONE_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 97)
#define V4L2_CID_PILOT_TONE_FREQUENCY (V4L2_CID_FM_TX_CLASS_BASE + 98)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_TUNE_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 112)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_preemphasis {
V4L2_PREEMPHASIS_DISABLED = 0,
V4L2_PREEMPHASIS_50_uS = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_PREEMPHASIS_75_uS = 2,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1)
#define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1)
enum v4l2_flash_led_mode {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_FLASH_LED_MODE_NONE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_FLASH_LED_MODE_FLASH,
V4L2_FLASH_LED_MODE_TORCH,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_flash_strobe_source {
V4L2_FLASH_STROBE_SOURCE_SOFTWARE,
V4L2_FLASH_STROBE_SOURCE_EXTERNAL,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3)
#define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4)
#define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7)
#define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8)
#define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0)
#define V4L2_FLASH_FAULT_TIMEOUT (1 << 1)
#define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4)
#define V4L2_FLASH_FAULT_INDICATOR (1 << 5)
-#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
+#define V4L2_FLASH_FAULT_UNDER_VOLTAGE (1 << 6)
+#define V4L2_FLASH_FAULT_INPUT_VOLTAGE (1 << 7)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE (1 << 8)
+#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
#define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
#define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1)
#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_jpeg_chroma_subsampling {
V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1,
V4L2_JPEG_CHROMA_SUBSAMPLING_420 = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_JPEG_CHROMA_SUBSAMPLING_411 = 3,
V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
#define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_VBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
#define V4L2_CID_HBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_ANALOGUE_GAIN (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 3)
#define V4L2_CID_IMAGE_PROC_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_PROC | 0x900)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_IMAGE_PROC_CLASS (V4L2_CTRL_CLASS_IMAGE_PROC | 1)
#define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
#define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)
#define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
#define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
#define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_dv_tx_mode {
V4L2_DV_TX_MODE_DVI_D = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_DV_TX_MODE_HDMI = 1,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_DV_TX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 5)
enum v4l2_dv_rgb_range {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_DV_RGB_RANGE_AUTO = 0,
V4L2_DV_RGB_RANGE_LIMITED = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_DV_RGB_RANGE_FULL = 2,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100)
#define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_FM_RX_CLASS_BASE (V4L2_CTRL_CLASS_FM_RX | 0x900)
#define V4L2_CID_FM_RX_CLASS (V4L2_CTRL_CLASS_FM_RX | 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_TUNE_DEEMPHASIS (V4L2_CID_FM_RX_CLASS_BASE + 1)
enum v4l2_deemphasis {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_DEEMPHASIS_DISABLED = V4L2_PREEMPHASIS_DISABLED,
V4L2_DEEMPHASIS_50_uS = V4L2_PREEMPHASIS_50_uS,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_DEEMPHASIS_75_uS = V4L2_PREEMPHASIS_75_uS,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_RDS_RECEPTION (V4L2_CID_FM_RX_CLASS_BASE + 2)
+#define V4L2_CID_RF_TUNER_CLASS_BASE (V4L2_CTRL_CLASS_RF_TUNER | 0x900)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_RF_TUNER_CLASS (V4L2_CTRL_CLASS_RF_TUNER | 1)
+#define V4L2_CID_RF_TUNER_BANDWIDTH_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 11)
+#define V4L2_CID_RF_TUNER_BANDWIDTH (V4L2_CID_RF_TUNER_CLASS_BASE + 12)
+#define V4L2_CID_RF_TUNER_LNA_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 41)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_RF_TUNER_LNA_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 42)
+#define V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 51)
+#define V4L2_CID_RF_TUNER_MIXER_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 52)
+#define V4L2_CID_RF_TUNER_IF_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 61)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CID_RF_TUNER_IF_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 62)
+#define V4L2_CID_RF_TUNER_PLL_LOCK (V4L2_CID_RF_TUNER_CLASS_BASE + 91)
#endif
diff --git a/libc/kernel/uapi/linux/v4l2-dv-timings.h b/libc/kernel/uapi/linux/v4l2-dv-timings.h
index bb1374a..1d9758e 100644
--- a/libc/kernel/uapi/linux/v4l2-dv-timings.h
+++ b/libc/kernel/uapi/linux/v4l2-dv-timings.h
@@ -46,111 +46,126 @@
#define V4L2_DV_BT_CEA_1920X1080I60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1080, 1, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 74250000, 88, 44, 148, 2, 5, 15, 2, 5, 16, V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_HALF_LINE) }
#define V4L2_DV_BT_CEA_1920X1080P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1080, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 148500000, 88, 44, 148, 4, 5, 36, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) }
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_DV_BT_CEA_3840X2160P24 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, 297000000, 1276, 88, 296, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) }
+#define V4L2_DV_BT_CEA_3840X2160P25 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, 297000000, 1056, 88, 296, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, 0) }
+#define V4L2_DV_BT_CEA_3840X2160P30 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, 297000000, 176, 88, 296, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) }
+#define V4L2_DV_BT_CEA_3840X2160P50 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, 594000000, 1056, 88, 296, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_DV_BT_CEA_3840X2160P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, 594000000, 176, 88, 296, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) }
+#define V4L2_DV_BT_CEA_4096X2160P24 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, 297000000, 1020, 88, 296, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) }
+#define V4L2_DV_BT_CEA_4096X2160P25 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, 297000000, 968, 88, 128, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, 0) }
+#define V4L2_DV_BT_CEA_4096X2160P30 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, 297000000, 88, 88, 128, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_DV_BT_CEA_4096X2160P50 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, 594000000, 968, 88, 128, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, 0) }
+#define V4L2_DV_BT_CEA_4096X2160P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, 594000000, 88, 88, 128, 8, 10, 72, 0, 0, 0, V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) }
#define V4L2_DV_BT_DMT_640X350P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(640, 350, 0, V4L2_DV_HSYNC_POS_POL, 31500000, 32, 64, 96, 32, 3, 60, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_640X400P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(640, 400, 0, V4L2_DV_VSYNC_POS_POL, 31500000, 32, 64, 96, 1, 3, 41, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_720X400P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(720, 400, 0, V4L2_DV_VSYNC_POS_POL, 35500000, 36, 72, 108, 1, 3, 42, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_640X480P60 V4L2_DV_BT_CEA_640X480P59_94
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_640X480P72 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(640, 480, 0, 0, 31500000, 24, 40, 128, 9, 3, 28, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_640X480P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(640, 480, 0, 0, 31500000, 16, 64, 120, 1, 3, 16, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_640X480P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(640, 480, 0, 0, 36000000, 56, 56, 80, 1, 3, 25, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_800X600P56 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(800, 600, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 36000000, 24, 72, 128, 1, 2, 22, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_800X600P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(800, 600, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 40000000, 40, 128, 88, 1, 4, 23, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_800X600P72 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(800, 600, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 50000000, 56, 120, 64, 37, 6, 23, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_800X600P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(800, 600, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 49500000, 16, 80, 160, 1, 3, 21, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_800X600P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(800, 600, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 56250000, 32, 64, 152, 1, 3, 27, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_800X600P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(800, 600, 0, V4L2_DV_HSYNC_POS_POL, 73250000, 48, 32, 80, 3, 4, 29, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_848X480P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(848, 480, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 33750000, 16, 112, 112, 6, 8, 23, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1024X768I43 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1024, 768, 1, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 44900000, 8, 176, 56, 0, 4, 20, 0, 4, 21, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1024X768P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1024, 768, 0, 0, 65000000, 24, 136, 160, 3, 6, 29, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1024X768P70 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1024, 768, 0, 0, 75000000, 24, 136, 144, 3, 6, 29, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1024X768P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1024, 768, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 78750000, 16, 96, 176, 1, 3, 28, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1024X768P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1024, 768, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 94500000, 48, 96, 208, 1, 3, 36, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1024X768P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1024, 768, 0, V4L2_DV_HSYNC_POS_POL, 115500000, 48, 32, 80, 3, 4, 38, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1152X864P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1152, 864, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 108000000, 64, 128, 256, 1, 3, 32, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1280X720P60 V4L2_DV_BT_CEA_1280X720P60
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1280X768P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_HSYNC_POS_POL, 68250000, 48, 32, 80, 3, 7, 12, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1280X768P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_VSYNC_POS_POL, 79500000, 64, 128, 192, 3, 7, 20, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1280X768P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_VSYNC_POS_POL, 102250000, 80, 128, 208, 3, 7, 27, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_1280X768P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_VSYNC_POS_POL, 117500000, 80, 136, 216, 3, 7, 31, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1280X768P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_HSYNC_POS_POL, 140250000, 48, 32, 80, 3, 7, 35, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1280X800P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_HSYNC_POS_POL, 71000000, 48, 32, 80, 3, 6, 14, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1280X800P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_VSYNC_POS_POL, 83500000, 72, 128, 200, 3, 6, 22, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_1280X800P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_VSYNC_POS_POL, 106500000, 80, 128, 208, 3, 6, 29, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1280X800P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_VSYNC_POS_POL, 122500000, 80, 136, 216, 3, 6, 34, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_1280X800P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_HSYNC_POS_POL, 146250000, 48, 32, 80, 3, 6, 38, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1280X960P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 960, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 108000000, 96, 112, 312, 1, 3, 36, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1280X960P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 960, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 148500000, 64, 160, 224, 1, 3, 47, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1280X960P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 960, 0, V4L2_DV_HSYNC_POS_POL, 175500000, 48, 32, 80, 3, 4, 50, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1280X1024P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 1024, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 108000000, 48, 112, 248, 1, 3, 38, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1280X1024P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 1024, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 135000000, 16, 144, 248, 1, 3, 38, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1280X1024P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 1024, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 157500000, 64, 160, 224, 1, 3, 44, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1280X1024P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1280, 1024, 0, V4L2_DV_HSYNC_POS_POL, 187250000, 48, 32, 80, 3, 7, 50, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1360X768P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1360, 768, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 85500000, 64, 112, 256, 3, 6, 18, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1360X768P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1360, 768, 0, V4L2_DV_HSYNC_POS_POL, 148250000, 48, 32, 80, 3, 5, 37, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1366X768P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1366, 768, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 85500000, 70, 143, 213, 3, 3, 24, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1366X768P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1366, 768, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 72000000, 14, 56, 64, 1, 3, 28, 0, 0, 0, V4L2_DV_BT_STD_DMT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1400X1050P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_HSYNC_POS_POL, 101000000, 48, 32, 80, 3, 4, 23, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1400X1050P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_VSYNC_POS_POL, 121750000, 88, 144, 232, 3, 4, 32, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_1400X1050P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_VSYNC_POS_POL, 156000000, 104, 144, 248, 3, 4, 42, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1400X1050P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_VSYNC_POS_POL, 179500000, 104, 152, 256, 3, 4, 48, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_1400X1050P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_HSYNC_POS_POL, 208000000, 48, 32, 80, 3, 4, 55, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1440X900P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_HSYNC_POS_POL, 88750000, 48, 32, 80, 3, 6, 17, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1440X900P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_VSYNC_POS_POL, 106500000, 80, 152, 232, 3, 6, 25, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1440X900P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_VSYNC_POS_POL, 136750000, 96, 152, 248, 3, 6, 33, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_1440X900P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_VSYNC_POS_POL, 157000000, 104, 152, 256, 3, 6, 39, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1440X900P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_HSYNC_POS_POL, 182750000, 48, 32, 80, 3, 6, 44, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1600X900P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1600, 900, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 108000000, 24, 80, 96, 1, 3, 96, 0, 0, 0, V4L2_DV_BT_STD_DMT, V4L2_DV_FL_REDUCED_BLANKING) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1600X1200P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1600, 1200, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 162000000, 64, 192, 304, 1, 3, 46, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1600X1200P65 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1600, 1200, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 175500000, 64, 192, 304, 1, 3, 46, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1600X1200P70 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1600, 1200, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 189000000, 64, 192, 304, 1, 3, 46, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1600X1200P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1600, 1200, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 202500000, 64, 192, 304, 1, 3, 46, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1600X1200P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1600, 1200, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 229500000, 64, 192, 304, 1, 3, 46, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1600X1200P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1600, 1200, 0, V4L2_DV_HSYNC_POS_POL, 268250000, 48, 32, 80, 3, 4, 64, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1680X1050P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_HSYNC_POS_POL, 119000000, 48, 32, 80, 3, 6, 21, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1680X1050P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_VSYNC_POS_POL, 146250000, 104, 176, 280, 3, 6, 30, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1680X1050P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_VSYNC_POS_POL, 187000000, 120, 176, 296, 3, 6, 40, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_1680X1050P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_VSYNC_POS_POL, 214750000, 128, 176, 304, 3, 6, 46, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1680X1050P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_HSYNC_POS_POL, 245500000, 48, 32, 80, 3, 6, 53, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1792X1344P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1792, 1344, 0, V4L2_DV_VSYNC_POS_POL, 204750000, 128, 200, 328, 1, 3, 46, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1792X1344P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1792, 1344, 0, V4L2_DV_VSYNC_POS_POL, 261000000, 96, 216, 352, 1, 3, 69, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1792X1344P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1792, 1344, 0, V4L2_DV_HSYNC_POS_POL, 333250000, 48, 32, 80, 3, 4, 72, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1856X1392P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1856, 1392, 0, V4L2_DV_VSYNC_POS_POL, 218250000, 96, 224, 352, 1, 3, 43, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1856X1392P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1856, 1392, 0, V4L2_DV_VSYNC_POS_POL, 288000000, 128, 224, 352, 1, 3, 104, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1856X1392P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1856, 1392, 0, V4L2_DV_HSYNC_POS_POL, 356500000, 48, 32, 80, 3, 4, 75, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1920X1080P60 V4L2_DV_BT_CEA_1920X1080P60
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1920X1200P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_HSYNC_POS_POL, 154000000, 48, 32, 80, 3, 6, 26, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1920X1200P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_VSYNC_POS_POL, 193250000, 136, 200, 336, 3, 6, 36, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1920X1200P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_VSYNC_POS_POL, 245250000, 136, 208, 344, 3, 6, 46, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_1920X1200P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_VSYNC_POS_POL, 281250000, 144, 208, 352, 3, 6, 53, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1920X1200P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_HSYNC_POS_POL, 317000000, 48, 32, 80, 3, 6, 62, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_1920X1440P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1440, 0, V4L2_DV_VSYNC_POS_POL, 234000000, 128, 208, 344, 1, 3, 56, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_1920X1440P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1440, 0, V4L2_DV_VSYNC_POS_POL, 297000000, 144, 224, 352, 1, 3, 56, 0, 0, 0, V4L2_DV_BT_STD_DMT, 0) }
#define V4L2_DV_BT_DMT_1920X1440P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(1920, 1440, 0, V4L2_DV_HSYNC_POS_POL, 380500000, 48, 32, 80, 3, 4, 78, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_2048X1152P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(2048, 1152, 0, V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, 162000000, 26, 80, 96, 1, 3, 44, 0, 0, 0, V4L2_DV_BT_STD_DMT, V4L2_DV_FL_REDUCED_BLANKING) }
#define V4L2_DV_BT_DMT_2560X1600P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_HSYNC_POS_POL, 268500000, 48, 32, 80, 3, 6, 37, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_2560X1600P60 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_VSYNC_POS_POL, 348500000, 192, 280, 472, 3, 6, 49, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_2560X1600P75 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_VSYNC_POS_POL, 443250000, 208, 280, 488, 3, 6, 63, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_DMT_2560X1600P85 { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_VSYNC_POS_POL, 505250000, 208, 280, 488, 3, 6, 73, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) }
#define V4L2_DV_BT_DMT_2560X1600P120_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_HSYNC_POS_POL, 552750000, 48, 32, 80, 3, 6, 85, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_DV_BT_DMT_4096X2160P60_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, 556744000, 8, 32, 40, 48, 8, 6, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
+#define V4L2_DV_BT_DMT_4096X2160P59_94_RB { .type = V4L2_DV_BT_656_1120, V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, 556188000, 8, 32, 40, 48, 8, 6, 0, 0, 0, V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, V4L2_DV_FL_REDUCED_BLANKING) }
#endif
diff --git a/libc/kernel/uapi/linux/v4l2-mediabus.h b/libc/kernel/uapi/linux/v4l2-mediabus.h
index 84aa5d3..63ec934 100644
--- a/libc/kernel/uapi/linux/v4l2-mediabus.h
+++ b/libc/kernel/uapi/linux/v4l2-mediabus.h
@@ -53,21 +53,36 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MBUS_FMT_YVYU8_2X8 = 0x2009,
V4L2_MBUS_FMT_Y10_1X10 = 0x200a,
+ V4L2_MBUS_FMT_UYVY10_2X10 = 0x2018,
+ V4L2_MBUS_FMT_VYUY10_2X10 = 0x2019,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MBUS_FMT_YUYV10_2X10 = 0x200b,
V4L2_MBUS_FMT_YVYU10_2X10 = 0x200c,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MBUS_FMT_Y12_1X12 = 0x2013,
V4L2_MBUS_FMT_UYVY8_1X16 = 0x200f,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010,
V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012,
V4L2_MBUS_FMT_YDYUYDYV8_1X16 = 0x2014,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MBUS_FMT_UYVY10_1X20 = 0x201a,
+ V4L2_MBUS_FMT_VYUY10_1X20 = 0x201b,
V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MBUS_FMT_YUV10_1X30 = 0x2016,
V4L2_MBUS_FMT_AYUV8_1X32 = 0x2017,
+ V4L2_MBUS_FMT_UYVY12_2X12 = 0x201c,
+ V4L2_MBUS_FMT_VYUY12_2X12 = 0x201d,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MBUS_FMT_YUYV12_2X12 = 0x201e,
+ V4L2_MBUS_FMT_YVYU12_2X12 = 0x201f,
+ V4L2_MBUS_FMT_UYVY12_1X24 = 0x2020,
+ V4L2_MBUS_FMT_VYUY12_1X24 = 0x2021,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_MBUS_FMT_YUYV12_1X24 = 0x2022,
+ V4L2_MBUS_FMT_YVYU12_1X24 = 0x2023,
V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/v4l2-subdev.h b/libc/kernel/uapi/linux/v4l2-subdev.h
index ad9cb8b..63b6b44 100644
--- a/libc/kernel/uapi/linux/v4l2-subdev.h
+++ b/libc/kernel/uapi/linux/v4l2-subdev.h
@@ -91,29 +91,28 @@
__u32 reserved[8];
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-struct v4l2_subdev_edid {
- __u32 pad;
- __u32 start_block;
- __u32 blocks;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 reserved[5];
- __u8 __user *edid;
-};
+#define v4l2_subdev_edid v4l2_edid
#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
-#define VIDIOC_SUBDEV_G_FRAME_INTERVAL _IOWR('V', 21, struct v4l2_subdev_frame_interval)
-#define VIDIOC_SUBDEV_S_FRAME_INTERVAL _IOWR('V', 22, struct v4l2_subdev_frame_interval)
-#define VIDIOC_SUBDEV_ENUM_MBUS_CODE _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum)
+#define VIDIOC_SUBDEV_G_FRAME_INTERVAL _IOWR('V', 21, struct v4l2_subdev_frame_interval)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define VIDIOC_SUBDEV_ENUM_FRAME_SIZE _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
-#define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
+#define VIDIOC_SUBDEV_S_FRAME_INTERVAL _IOWR('V', 22, struct v4l2_subdev_frame_interval)
+#define VIDIOC_SUBDEV_ENUM_MBUS_CODE _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum)
+#define VIDIOC_SUBDEV_ENUM_FRAME_SIZE _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
+#define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop)
#define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)
+#define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection)
+#define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection)
-#define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection)
-#define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_subdev_edid)
-#define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_subdev_edid)
+#define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_edid)
+#define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_edid)
+#define VIDIOC_SUBDEV_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
+#define VIDIOC_SUBDEV_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_SUBDEV_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
+#define VIDIOC_SUBDEV_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
+#define VIDIOC_SUBDEV_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/linux/version.h b/libc/kernel/uapi/linux/version.h
index 71e5373..2d66eba 100644
--- a/libc/kernel/uapi/linux/version.h
+++ b/libc/kernel/uapi/linux/version.h
@@ -16,5 +16,5 @@
***
****************************************************************************
****************************************************************************/
-#define LINUX_VERSION_CODE 200192
+#define LINUX_VERSION_CODE 200707
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
diff --git a/libc/kernel/uapi/linux/vfio.h b/libc/kernel/uapi/linux/vfio.h
index 88cb067..4f9bfc0 100644
--- a/libc/kernel/uapi/linux/vfio.h
+++ b/libc/kernel/uapi/linux/vfio.h
@@ -24,176 +24,178 @@
#define VFIO_API_VERSION 0
#define VFIO_TYPE1_IOMMU 1
#define VFIO_SPAPR_TCE_IOMMU 2
-#define VFIO_TYPE (';')
+#define VFIO_TYPE1v2_IOMMU 3
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VFIO_DMA_CC_IOMMU 4
+#define VFIO_TYPE (';')
#define VFIO_BASE 100
#define VFIO_GET_API_VERSION _IO(VFIO_TYPE, VFIO_BASE + 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_CHECK_EXTENSION _IO(VFIO_TYPE, VFIO_BASE + 1)
#define VFIO_SET_IOMMU _IO(VFIO_TYPE, VFIO_BASE + 2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct vfio_group_status {
__u32 argsz;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
#define VFIO_GROUP_FLAGS_VIABLE (1 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1)
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_GROUP_GET_STATUS _IO(VFIO_TYPE, VFIO_BASE + 3)
#define VFIO_GROUP_SET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_GROUP_UNSET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 5)
#define VFIO_GROUP_GET_DEVICE_FD _IO(VFIO_TYPE, VFIO_BASE + 6)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct vfio_device_info {
__u32 argsz;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
#define VFIO_DEVICE_FLAGS_RESET (1 << 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_DEVICE_FLAGS_PCI (1 << 1)
__u32 num_regions;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 num_irqs;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
struct vfio_region_info {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 argsz;
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_REGION_INFO_FLAG_READ (1 << 0)
#define VFIO_REGION_INFO_FLAG_WRITE (1 << 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_REGION_INFO_FLAG_MMAP (1 << 2)
__u32 index;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 resv;
__u64 size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 offset;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8)
struct vfio_irq_info {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 argsz;
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_IRQ_INFO_EVENTFD (1 << 0)
#define VFIO_IRQ_INFO_MASKABLE (1 << 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_IRQ_INFO_AUTOMASKED (1 << 2)
#define VFIO_IRQ_INFO_NORESIZE (1 << 3)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
__u32 count;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct vfio_irq_set {
__u32 argsz;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
#define VFIO_IRQ_SET_DATA_NONE (1 << 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_IRQ_SET_DATA_BOOL (1 << 1)
#define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_IRQ_SET_ACTION_MASK (1 << 3)
#define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5)
__u32 index;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 start;
__u32 count;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 data[];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10)
#define VFIO_IRQ_SET_DATA_TYPE_MASK (VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_DATA_BOOL | VFIO_IRQ_SET_DATA_EVENTFD)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_IRQ_SET_ACTION_TYPE_MASK (VFIO_IRQ_SET_ACTION_MASK | VFIO_IRQ_SET_ACTION_UNMASK | VFIO_IRQ_SET_ACTION_TRIGGER)
#define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
VFIO_PCI_BAR0_REGION_INDEX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
VFIO_PCI_BAR1_REGION_INDEX,
VFIO_PCI_BAR2_REGION_INDEX,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
VFIO_PCI_BAR3_REGION_INDEX,
VFIO_PCI_BAR4_REGION_INDEX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
VFIO_PCI_BAR5_REGION_INDEX,
VFIO_PCI_ROM_REGION_INDEX,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
VFIO_PCI_CONFIG_REGION_INDEX,
VFIO_PCI_VGA_REGION_INDEX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
VFIO_PCI_NUM_REGIONS
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
VFIO_PCI_INTX_IRQ_INDEX,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
VFIO_PCI_MSI_IRQ_INDEX,
VFIO_PCI_MSIX_IRQ_INDEX,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
VFIO_PCI_ERR_IRQ_INDEX,
VFIO_PCI_NUM_IRQS
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct vfio_pci_dependent_device {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 group_id;
__u16 segment;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 bus;
__u8 devfn;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct vfio_pci_hot_reset_info {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 argsz;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 count;
struct vfio_pci_dependent_device devices[];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct vfio_pci_hot_reset {
__u32 argsz;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u32 count;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 group_fds[];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13)
struct vfio_iommu_type1_info {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 argsz;
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_IOMMU_INFO_PGSIZES (1 << 0)
__u64 iova_pgsizes;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct vfio_iommu_type1_dma_map {
__u32 argsz;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
#define VFIO_DMA_MAP_FLAG_READ (1 << 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1)
__u64 vaddr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 iova;
__u64 size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct vfio_iommu_type1_dma_unmap {
__u32 argsz;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u64 iova;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 size;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
#define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16)
struct vfio_iommu_spapr_tce_info {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 argsz;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 dma32_window_start;
__u32 dma32_window_size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/linux/videodev2.h b/libc/kernel/uapi/linux/videodev2.h
index b1c6042..b191bea 100644
--- a/libc/kernel/uapi/linux/videodev2.h
+++ b/libc/kernel/uapi/linux/videodev2.h
@@ -62,93 +62,98 @@
V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
+ V4L2_BUF_TYPE_SDR_CAPTURE = 11,
V4L2_BUF_TYPE_PRIVATE = 0x80,
};
-#define V4L2_TYPE_IS_MULTIPLANAR(type) ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_TYPE_IS_MULTIPLANAR(type) ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
#define V4L2_TYPE_IS_OUTPUT(type) ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY || (type) == V4L2_BUF_TYPE_VBI_OUTPUT || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
enum v4l2_tuner_type {
V4L2_TUNER_RADIO = 1,
- V4L2_TUNER_ANALOG_TV = 2,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ V4L2_TUNER_ANALOG_TV = 2,
V4L2_TUNER_DIGITAL_TV = 3,
+ V4L2_TUNER_ADC = 4,
+ V4L2_TUNER_RF = 5,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum v4l2_memory {
V4L2_MEMORY_MMAP = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MEMORY_USERPTR = 2,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_MEMORY_OVERLAY = 3,
V4L2_MEMORY_DMABUF = 4,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_colorspace {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_COLORSPACE_SMPTE170M = 1,
V4L2_COLORSPACE_SMPTE240M = 2,
V4L2_COLORSPACE_REC709 = 3,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_COLORSPACE_BT878 = 4,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_COLORSPACE_470_SYSTEM_M = 5,
V4L2_COLORSPACE_470_SYSTEM_BG = 6,
V4L2_COLORSPACE_JPEG = 7,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_COLORSPACE_SRGB = 8,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum v4l2_priority {
V4L2_PRIORITY_UNSET = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_PRIORITY_BACKGROUND = 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_PRIORITY_INTERACTIVE = 2,
V4L2_PRIORITY_RECORD = 3,
V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_rect {
__s32 left;
__s32 top;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 width;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 height;
};
struct v4l2_fract {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 numerator;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 denominator;
};
struct v4l2_capability {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 driver[16];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 card[32];
__u8 bus_info[32];
__u32 version;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 capabilities;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 device_caps;
__u32 reserved[3];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_VIDEO_CAPTURE 0x00000001
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_VIDEO_OUTPUT 0x00000002
#define V4L2_CAP_VIDEO_OVERLAY 0x00000004
#define V4L2_CAP_VBI_CAPTURE 0x00000010
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_VBI_OUTPUT 0x00000020
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040
#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080
#define V4L2_CAP_RDS_CAPTURE 0x00000100
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_HW_FREQ_SEEK 0x00000400
#define V4L2_CAP_RDS_OUTPUT 0x00000800
#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_VIDEO_M2M_MPLANE 0x00004000
#define V4L2_CAP_VIDEO_M2M 0x00008000
#define V4L2_CAP_TUNER 0x00010000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_AUDIO 0x00020000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_RADIO 0x00040000
#define V4L2_CAP_MODULATOR 0x00080000
+#define V4L2_CAP_SDR_CAPTURE 0x00100000
#define V4L2_CAP_READWRITE 0x01000000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CAP_ASYNCIO 0x02000000
@@ -311,622 +316,632 @@
#define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1')
#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I')
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8')
+#define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6')
struct v4l2_fmtdesc {
__u32 index;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 description[32];
__u32 pixelformat;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[4];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_FMT_FLAG_COMPRESSED 0x0001
#define V4L2_FMT_FLAG_EMULATED 0x0002
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_frmsizetypes {
V4L2_FRMSIZE_TYPE_DISCRETE = 1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
V4L2_FRMSIZE_TYPE_STEPWISE = 3,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct v4l2_frmsize_discrete {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 width;
__u32 height;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct v4l2_frmsize_stepwise {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 min_width;
__u32 max_width;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 step_width;
__u32 min_height;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 max_height;
__u32 step_height;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct v4l2_frmsizeenum {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
__u32 pixel_format;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
union {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_frmsize_discrete discrete;
struct v4l2_frmsize_stepwise stepwise;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
__u32 reserved[2];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum v4l2_frmivaltypes {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_FRMIVAL_TYPE_DISCRETE = 1,
V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_FRMIVAL_TYPE_STEPWISE = 3,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_frmival_stepwise {
struct v4l2_fract min;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_fract max;
struct v4l2_fract step;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct v4l2_frmivalenum {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
__u32 pixel_format;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 width;
__u32 height;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_fract discrete;
struct v4l2_frmival_stepwise stepwise;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
__u32 reserved[2];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct v4l2_timecode {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 frames;
__u8 seconds;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 minutes;
__u8 hours;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 userbits[4];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TC_TYPE_24FPS 1
#define V4L2_TC_TYPE_25FPS 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TC_TYPE_30FPS 3
#define V4L2_TC_TYPE_50FPS 4
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TC_TYPE_60FPS 5
#define V4L2_TC_FLAG_DROPFRAME 0x0001
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TC_FLAG_COLORFRAME 0x0002
#define V4L2_TC_USERBITS_field 0x000C
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TC_USERBITS_USERDEFINED 0x0000
#define V4L2_TC_USERBITS_8BITCHARS 0x0008
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_jpegcompression {
int quality;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int APPn;
int APP_len;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char APP_data[60];
int COM_len;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char COM_data[60];
__u32 jpeg_markers;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_JPEG_MARKER_DHT (1<<3)
#define V4L2_JPEG_MARKER_DQT (1<<4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_JPEG_MARKER_DRI (1<<5)
#define V4L2_JPEG_MARKER_COM (1<<6)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_JPEG_MARKER_APP (1<<7)
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_requestbuffers {
__u32 count;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
__u32 memory;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[2];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_plane {
__u32 bytesused;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 length;
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 mem_offset;
unsigned long userptr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 fd;
} m;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 data_offset;
__u32 reserved[11];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct v4l2_buffer {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
__u32 type;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 bytesused;
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 field;
struct timeval timestamp;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_timecode timecode;
__u32 sequence;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 memory;
union {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 offset;
unsigned long userptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_plane *planes;
__s32 fd;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} m;
__u32 length;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved2;
__u32 reserved;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
-#define V4L2_BUF_FLAG_MAPPED 0x0001
-#define V4L2_BUF_FLAG_QUEUED 0x0002
-#define V4L2_BUF_FLAG_DONE 0x0004
+#define V4L2_BUF_FLAG_MAPPED 0x00000001
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define V4L2_BUF_FLAG_KEYFRAME 0x0008
-#define V4L2_BUF_FLAG_PFRAME 0x0010
-#define V4L2_BUF_FLAG_BFRAME 0x0020
-#define V4L2_BUF_FLAG_ERROR 0x0040
+#define V4L2_BUF_FLAG_QUEUED 0x00000002
+#define V4L2_BUF_FLAG_DONE 0x00000004
+#define V4L2_BUF_FLAG_KEYFRAME 0x00000008
+#define V4L2_BUF_FLAG_PFRAME 0x00000010
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define V4L2_BUF_FLAG_TIMECODE 0x0100
-#define V4L2_BUF_FLAG_PREPARED 0x0400
-#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
-#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
+#define V4L2_BUF_FLAG_BFRAME 0x00000020
+#define V4L2_BUF_FLAG_ERROR 0x00000040
+#define V4L2_BUF_FLAG_TIMECODE 0x00000100
+#define V4L2_BUF_FLAG_PREPARED 0x00000400
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define V4L2_BUF_FLAG_TIMESTAMP_MASK 0xe000
-#define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x0000
-#define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x2000
-#define V4L2_BUF_FLAG_TIMESTAMP_COPY 0x4000
+#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x00000800
+#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x00001000
+#define V4L2_BUF_FLAG_TIMESTAMP_MASK 0x0000e000
+#define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x00000000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x00002000
+#define V4L2_BUF_FLAG_TIMESTAMP_COPY 0x00004000
+#define V4L2_BUF_FLAG_TSTAMP_SRC_MASK 0x00070000
+#define V4L2_BUF_FLAG_TSTAMP_SRC_EOF 0x00000000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000
struct v4l2_exportbuffer {
__u32 type;
__u32 index;
- __u32 plane;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 plane;
__u32 flags;
__s32 fd;
__u32 reserved[11];
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct v4l2_framebuffer {
__u32 capability;
__u32 flags;
- void *base;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ void *base;
struct v4l2_pix_format fmt;
};
#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
-#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
-#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
#define V4L2_FBUF_FLAG_PRIMARY 0x0001
-#define V4L2_FBUF_FLAG_OVERLAY 0x0002
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_FBUF_FLAG_OVERLAY 0x0002
#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
-#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
#define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040
struct v4l2_clip {
struct v4l2_rect c;
- struct v4l2_clip __user *next;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct v4l2_clip __user *next;
};
struct v4l2_window {
struct v4l2_rect w;
- __u32 field;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 field;
__u32 chromakey;
struct v4l2_clip __user *clips;
__u32 clipcount;
- void __user *bitmap;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ void __user *bitmap;
__u8 global_alpha;
};
struct v4l2_captureparm {
- __u32 capability;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 capability;
__u32 capturemode;
struct v4l2_fract timeperframe;
__u32 extendedmode;
- __u32 readbuffers;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 readbuffers;
__u32 reserved[4];
};
#define V4L2_MODE_HIGHQUALITY 0x0001
-#define V4L2_CAP_TIMEPERFRAME 0x1000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_CAP_TIMEPERFRAME 0x1000
struct v4l2_outputparm {
__u32 capability;
__u32 outputmode;
- struct v4l2_fract timeperframe;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct v4l2_fract timeperframe;
__u32 extendedmode;
__u32 writebuffers;
__u32 reserved[4];
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct v4l2_cropcap {
__u32 type;
struct v4l2_rect bounds;
- struct v4l2_rect defrect;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct v4l2_rect defrect;
struct v4l2_fract pixelaspect;
};
struct v4l2_crop {
- __u32 type;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 type;
struct v4l2_rect c;
};
struct v4l2_selection {
- __u32 type;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 type;
__u32 target;
__u32 flags;
struct v4l2_rect r;
- __u32 reserved[9];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 reserved[9];
};
typedef __u64 v4l2_std_id;
#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
-#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
-#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
-#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
-#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
-#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
-#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
-#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
#define V4L2_STD_NTSC (V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_M_KR)
#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D | V4L2_STD_SECAM_K | V4L2_STD_SECAM_K1)
#define V4L2_STD_SECAM (V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H | V4L2_STD_SECAM_DK | V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)
-#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B | V4L2_STD_PAL_B1 | V4L2_STD_PAL_G)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B | V4L2_STD_PAL_B1 | V4L2_STD_PAL_G)
#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D | V4L2_STD_PAL_D1 | V4L2_STD_PAL_K)
#define V4L2_STD_PAL (V4L2_STD_PAL_BG | V4L2_STD_PAL_DK | V4L2_STD_PAL_H | V4L2_STD_PAL_I)
#define V4L2_STD_B (V4L2_STD_PAL_B | V4L2_STD_PAL_B1 | V4L2_STD_SECAM_B)
-#define V4L2_STD_G (V4L2_STD_PAL_G | V4L2_STD_SECAM_G)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_G (V4L2_STD_PAL_G | V4L2_STD_SECAM_G)
#define V4L2_STD_H (V4L2_STD_PAL_H | V4L2_STD_SECAM_H)
#define V4L2_STD_L (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)
#define V4L2_STD_GH (V4L2_STD_G | V4L2_STD_H)
-#define V4L2_STD_DK (V4L2_STD_PAL_DK | V4L2_STD_SECAM_DK)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_DK (V4L2_STD_PAL_DK | V4L2_STD_SECAM_DK)
#define V4L2_STD_BG (V4L2_STD_B | V4L2_STD_G)
#define V4L2_STD_MN (V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc | V4L2_STD_NTSC)
#define V4L2_STD_MTS (V4L2_STD_NTSC_M | V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc)
-#define V4L2_STD_525_60 (V4L2_STD_PAL_M | V4L2_STD_PAL_60 | V4L2_STD_NTSC | V4L2_STD_NTSC_443)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_525_60 (V4L2_STD_PAL_M | V4L2_STD_PAL_60 | V4L2_STD_NTSC | V4L2_STD_NTSC_443)
#define V4L2_STD_625_50 (V4L2_STD_PAL | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc | V4L2_STD_SECAM)
#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB | V4L2_STD_ATSC_16_VSB)
#define V4L2_STD_UNKNOWN 0
-#define V4L2_STD_ALL (V4L2_STD_525_60 | V4L2_STD_625_50)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_STD_ALL (V4L2_STD_525_60 | V4L2_STD_625_50)
struct v4l2_standard {
__u32 index;
v4l2_std_id id;
- __u8 name[24];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 name[24];
struct v4l2_fract frameperiod;
__u32 framelines;
__u32 reserved[4];
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct v4l2_bt_timings {
__u32 width;
__u32 height;
- __u32 interlaced;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 interlaced;
__u32 polarities;
__u64 pixelclock;
__u32 hfrontporch;
- __u32 hsync;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 hsync;
__u32 hbackporch;
__u32 vfrontporch;
__u32 vsync;
- __u32 vbackporch;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 vbackporch;
__u32 il_vfrontporch;
__u32 il_vsync;
__u32 il_vbackporch;
- __u32 standards;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 standards;
__u32 flags;
__u32 reserved[14];
} __attribute__ ((packed));
-#define V4L2_DV_PROGRESSIVE 0
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_DV_PROGRESSIVE 0
#define V4L2_DV_INTERLACED 1
#define V4L2_DV_VSYNC_POS_POL 0x00000001
#define V4L2_DV_HSYNC_POS_POL 0x00000002
-#define V4L2_DV_BT_STD_CEA861 (1 << 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_DV_BT_STD_CEA861 (1 << 0)
#define V4L2_DV_BT_STD_DMT (1 << 1)
#define V4L2_DV_BT_STD_CVT (1 << 2)
#define V4L2_DV_BT_STD_GTF (1 << 3)
-#define V4L2_DV_FL_REDUCED_BLANKING (1 << 0)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_DV_FL_REDUCED_BLANKING (1 << 0)
#define V4L2_DV_FL_CAN_REDUCE_FPS (1 << 1)
#define V4L2_DV_FL_REDUCED_FPS (1 << 2)
#define V4L2_DV_FL_HALF_LINE (1 << 3)
-#define V4L2_DV_BT_BLANKING_WIDTH(bt) (bt->hfrontporch + bt->hsync + bt->hbackporch)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#define V4L2_DV_BT_FRAME_WIDTH(bt) (bt->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
-#define V4L2_DV_BT_BLANKING_HEIGHT(bt) (bt->vfrontporch + bt->vsync + bt->vbackporch + bt->il_vfrontporch + bt->il_vsync + bt->il_vbackporch)
-#define V4L2_DV_BT_FRAME_HEIGHT(bt) (bt->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
+#define V4L2_DV_BT_BLANKING_WIDTH(bt) ((bt)->hfrontporch + (bt)->hsync + (bt)->hbackporch)
+#define V4L2_DV_BT_FRAME_WIDTH(bt) ((bt)->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
+#define V4L2_DV_BT_BLANKING_HEIGHT(bt) ((bt)->vfrontporch + (bt)->vsync + (bt)->vbackporch + (bt)->il_vfrontporch + (bt)->il_vsync + (bt)->il_vbackporch)
+#define V4L2_DV_BT_FRAME_HEIGHT(bt) ((bt)->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_dv_timings {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
union {
struct v4l2_bt_timings bt;
- __u32 reserved[32];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 reserved[32];
};
} __attribute__ ((packed));
#define V4L2_DV_BT_656_1120 0
-struct v4l2_enum_dv_timings {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct v4l2_enum_dv_timings {
__u32 index;
- __u32 reserved[3];
+ __u32 pad;
+ __u32 reserved[2];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_dv_timings timings;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_bt_timings_cap {
__u32 min_width;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 max_width;
__u32 min_height;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 max_height;
__u64 min_pixelclock;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 max_pixelclock;
__u32 standards;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 capabilities;
__u32 reserved[16];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__ ((packed));
#define V4L2_DV_BT_CAP_INTERLACED (1 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_CAP_PROGRESSIVE (1 << 1)
#define V4L2_DV_BT_CAP_REDUCED_BLANKING (1 << 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_DV_BT_CAP_CUSTOM (1 << 3)
struct v4l2_dv_timings_cap {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
- __u32 reserved[3];
+ __u32 pad;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 reserved[2];
union {
struct v4l2_bt_timings_cap bt;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 raw_data[32];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
};
struct v4l2_input {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 name[32];
__u32 type;
__u32 audioset;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 tuner;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
v4l2_std_id std;
__u32 status;
__u32 capabilities;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[3];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define V4L2_INPUT_TYPE_TUNER 1
#define V4L2_INPUT_TYPE_CAMERA 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_IN_ST_NO_POWER 0x00000001
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_IN_ST_NO_SIGNAL 0x00000002
#define V4L2_IN_ST_NO_COLOR 0x00000004
#define V4L2_IN_ST_HFLIP 0x00000010
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_IN_ST_VFLIP 0x00000020
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_IN_ST_NO_H_LOCK 0x00000100
#define V4L2_IN_ST_COLOR_KILL 0x00000200
#define V4L2_IN_ST_NO_SYNC 0x00010000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_IN_ST_NO_EQU 0x00020000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_IN_ST_NO_CARRIER 0x00040000
#define V4L2_IN_ST_MACROVISION 0x01000000
#define V4L2_IN_ST_NO_ACCESS 0x02000000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_IN_ST_VTR 0x04000000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_IN_CAP_DV_TIMINGS 0x00000002
#define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS
#define V4L2_IN_CAP_STD 0x00000004
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_output {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
__u8 name[32];
__u32 type;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 audioset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 modulator;
v4l2_std_id std;
__u32 capabilities;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[3];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define V4L2_OUTPUT_TYPE_MODULATOR 1
#define V4L2_OUTPUT_TYPE_ANALOG 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_OUT_CAP_DV_TIMINGS 0x00000002
#define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS
#define V4L2_OUT_CAP_STD 0x00000004
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_control {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 id;
__s32 value;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_ext_control {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 id;
__u32 size;
__u32 reserved2[1];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 value;
__s64 value64;
char *string;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__ ((packed));
struct v4l2_ext_controls {
__u32 ctrl_class;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 count;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 error_idx;
__u32 reserved[2];
struct v4l2_ext_control *controls;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CTRL_ID_MASK (0x0fffffff)
#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum v4l2_ctrl_type {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CTRL_TYPE_INTEGER = 1,
V4L2_CTRL_TYPE_BOOLEAN = 2,
V4L2_CTRL_TYPE_MENU = 3,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CTRL_TYPE_BUTTON = 4,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CTRL_TYPE_INTEGER64 = 5,
V4L2_CTRL_TYPE_CTRL_CLASS = 6,
V4L2_CTRL_TYPE_STRING = 7,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CTRL_TYPE_BITMASK = 8,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
V4L2_CTRL_TYPE_INTEGER_MENU = 9,
};
struct v4l2_queryctrl {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
__u8 name[32];
__s32 minimum;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 maximum;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 step;
__s32 default_value;
__u32 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[2];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct v4l2_querymenu {
__u32 id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
__u8 name[32];
__s64 value;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved;
} __attribute__ ((packed));
#define V4L2_CTRL_FLAG_DISABLED 0x0001
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CTRL_FLAG_GRABBED 0x0002
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CTRL_FLAG_READ_ONLY 0x0004
#define V4L2_CTRL_FLAG_UPDATE 0x0008
#define V4L2_CTRL_FLAG_INACTIVE 0x0010
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CTRL_FLAG_SLIDER 0x0020
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
#define V4L2_CTRL_FLAG_VOLATILE 0x0080
#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_MAX_CTRLS 1024
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CID_PRIVATE_BASE 0x08000000
struct v4l2_tuner {
__u32 index;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 name[32];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
__u32 capability;
__u32 rangelow;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 rangehigh;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 rxsubchans;
__u32 audmode;
__s32 signal;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 afc;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[4];
};
struct v4l2_modulator {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 name[32];
__u32 capability;
__u32 rangelow;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 rangehigh;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 txsubchans;
__u32 reserved[4];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TUNER_CAP_LOW 0x0001
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TUNER_CAP_NORM 0x0002
#define V4L2_TUNER_CAP_HWSEEK_BOUNDED 0x0004
#define V4L2_TUNER_CAP_HWSEEK_WRAP 0x0008
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TUNER_CAP_STEREO 0x0010
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TUNER_CAP_LANG2 0x0020
#define V4L2_TUNER_CAP_SAP 0x0020
#define V4L2_TUNER_CAP_LANG1 0x0040
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TUNER_CAP_RDS 0x0080
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
#define V4L2_TUNER_CAP_FREQ_BANDS 0x0400
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_TUNER_CAP_1HZ 0x1000
#define V4L2_TUNER_SUB_MONO 0x0001
#define V4L2_TUNER_SUB_STEREO 0x0002
#define V4L2_TUNER_SUB_LANG2 0x0004
@@ -1184,6 +1199,11 @@
__u8 num_planes;
__u8 reserved[11];
} __attribute__ ((packed));
+struct v4l2_sdr_format {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 pixelformat;
+ __u8 reserved[28];
+} __attribute__ ((packed));
struct v4l2_format {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
@@ -1194,225 +1214,236 @@
struct v4l2_window win;
struct v4l2_vbi_format vbi;
struct v4l2_sliced_vbi_format sliced;
- __u8 raw_data[200];
+ struct v4l2_sdr_format sdr;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 raw_data[200];
} fmt;
};
struct v4l2_streamparm {
- __u32 type;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 type;
union {
struct v4l2_captureparm capture;
struct v4l2_outputparm output;
- __u8 raw_data[200];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 raw_data[200];
} parm;
};
#define V4L2_EVENT_ALL 0
-#define V4L2_EVENT_VSYNC 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_EVENT_VSYNC 1
#define V4L2_EVENT_EOS 2
#define V4L2_EVENT_CTRL 3
#define V4L2_EVENT_FRAME_SYNC 4
-#define V4L2_EVENT_PRIVATE_START 0x08000000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_EVENT_SOURCE_CHANGE 5
+#define V4L2_EVENT_PRIVATE_START 0x08000000
struct v4l2_event_vsync {
__u8 field;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__ ((packed));
#define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
#define V4L2_EVENT_CTRL_CH_RANGE (1 << 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_event_ctrl {
__u32 changes;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 type;
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 value;
__s64 value64;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 minimum;
__s32 maximum;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 step;
__s32 default_value;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct v4l2_event_frame_sync {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 frame_sequence;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define V4L2_EVENT_SRC_CH_RESOLUTION (1 << 0)
+struct v4l2_event_src_change {
+ __u32 changes;
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_event {
__u32 type;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
struct v4l2_event_vsync vsync;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_event_ctrl ctrl;
struct v4l2_event_frame_sync frame_sync;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct v4l2_event_src_change src_change;
__u8 data[64];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} u;
__u32 pending;
__u32 sequence;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct timespec timestamp;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 id;
__u32 reserved[8];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1)
struct v4l2_event_subscription {
__u32 type;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
__u32 reserved[5];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CHIP_MATCH_BRIDGE 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CHIP_MATCH_SUBDEV 4
#define V4L2_CHIP_MATCH_HOST V4L2_CHIP_MATCH_BRIDGE
#define V4L2_CHIP_MATCH_I2C_DRIVER 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CHIP_MATCH_I2C_ADDR 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CHIP_MATCH_AC97 3
struct v4l2_dbg_match {
__u32 type;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 addr;
char name[32];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__ ((packed));
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_dbg_register {
struct v4l2_dbg_match match;
__u32 size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 reg;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 val;
} __attribute__ ((packed));
#define V4L2_CHIP_FL_READABLE (1 << 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define V4L2_CHIP_FL_WRITABLE (1 << 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct v4l2_dbg_chip_info {
struct v4l2_dbg_match match;
char name[32];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[32];
} __attribute__ ((packed));
struct v4l2_create_buffers {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 count;
__u32 memory;
struct v4l2_format format;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[8];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability)
#define VIDIOC_RESERVED _IO('V', 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format)
#define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format)
#define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer)
#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
#define VIDIOC_OVERLAY _IOW('V', 14, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_EXPBUF _IOWR('V', 16, struct v4l2_exportbuffer)
#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
#define VIDIOC_STREAMON _IOW('V', 18, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_STREAMOFF _IOW('V', 19, int)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm)
#define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm)
#define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
#define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input)
#define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner)
#define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner)
#define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl)
#define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu)
#define VIDIOC_G_INPUT _IOR('V', 38, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define VIDIOC_S_INPUT _IOWR('V', 39, int)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_G_EDID _IOWR('V', 40, struct v4l2_edid)
+#define VIDIOC_S_EDID _IOWR('V', 41, struct v4l2_edid)
#define VIDIOC_G_OUTPUT _IOR('V', 46, int)
#define VIDIOC_S_OUTPUT _IOWR('V', 47, int)
-#define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output)
#define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout)
#define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout)
#define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator)
-#define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator)
#define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency)
#define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency)
#define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap)
-#define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop)
#define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop)
#define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression)
#define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression)
-#define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id)
#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format)
#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio)
#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout)
-#define VIDIOC_G_PRIORITY _IOR('V', 67, __u32)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_G_PRIORITY _IOR('V', 67, __u32)
#define VIDIOC_S_PRIORITY _IOW('V', 68, __u32)
#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
#define VIDIOC_LOG_STATUS _IO('V', 70)
-#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls)
#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls)
#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
-#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx)
#define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd)
#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd)
-#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
-#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
-#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
#define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
#define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection)
-#define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd)
#define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)
#define VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
#define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
-#define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
#define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band)
#define VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info)
#define BASE_VIDIOC_PRIVATE 192
-#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/linux/xattr.h b/libc/kernel/uapi/linux/xattr.h
index ecadc6a..650cf93 100644
--- a/libc/kernel/uapi/linux/xattr.h
+++ b/libc/kernel/uapi/linux/xattr.h
@@ -16,10 +16,15 @@
***
****************************************************************************
****************************************************************************/
+#include <linux/libc-compat.h>
#ifndef _UAPI_LINUX_XATTR_H
#define _UAPI_LINUX_XATTR_H
+#ifdef __UAPI_DEF_XATTR
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __USE_KERNEL_XATTR_DEFS
#define XATTR_CREATE 0x1
#define XATTR_REPLACE 0x2
+#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XATTR_OS2_PREFIX "os2."
#define XATTR_OS2_PREFIX_LEN (sizeof(XATTR_OS2_PREFIX) - 1)
diff --git a/libc/kernel/uapi/linux/xfrm.h b/libc/kernel/uapi/linux/xfrm.h
index 4b09ee8..6a4e618 100644
--- a/libc/kernel/uapi/linux/xfrm.h
+++ b/libc/kernel/uapi/linux/xfrm.h
@@ -311,223 +311,234 @@
XFRMA_REPLAY_ESN_VAL,
XFRMA_SA_EXTRA_FLAGS,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ XFRMA_PROTO,
+ XFRMA_ADDRESS_FILTER,
__XFRMA_MAX
#define XFRMA_MAX (__XFRMA_MAX - 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct xfrm_mark {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 v;
__u32 m;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum xfrm_sadattr_type_t {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
XFRMA_SAD_UNSPEC,
XFRMA_SAD_CNT,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
XFRMA_SAD_HINFO,
__XFRMA_SAD_MAX
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1)
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrmu_sadhinfo {
__u32 sadhcnt;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 sadhmcnt;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum xfrm_spdattr_type_t {
XFRMA_SPD_UNSPEC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
XFRMA_SPD_INFO,
XFRMA_SPD_HINFO,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__XFRMA_SPD_MAX
#define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct xfrmu_spdinfo {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 incnt;
__u32 outcnt;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 fwdcnt;
__u32 inscnt;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 outscnt;
__u32 fwdscnt;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct xfrmu_spdhinfo {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 spdhcnt;
__u32 spdhmcnt;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct xfrm_usersa_info {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_selector sel;
struct xfrm_id id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
xfrm_address_t saddr;
struct xfrm_lifetime_cfg lft;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_lifetime_cur curlft;
struct xfrm_stats stats;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 seq;
__u32 reqid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 family;
__u8 mode;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 replay_window;
__u8 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XFRM_STATE_NOECN 1
#define XFRM_STATE_DECAP_DSCP 2
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XFRM_STATE_NOPMTUDISC 4
#define XFRM_STATE_WILDRECV 8
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XFRM_STATE_ICMP 16
#define XFRM_STATE_AF_UNSPEC 32
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XFRM_STATE_ALIGN4 64
#define XFRM_STATE_ESN 128
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define XFRM_SA_XFLAG_DONT_ENCAP_DSCP 1
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_usersa_id {
xfrm_address_t daddr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be32 spi;
__u16 family;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 proto;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_aevent_id {
struct xfrm_usersa_id sa_id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
xfrm_address_t saddr;
__u32 flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reqid;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_userspi_info {
struct xfrm_usersa_info info;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 min;
__u32 max;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct xfrm_userpolicy_info {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_selector sel;
struct xfrm_lifetime_cfg lft;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_lifetime_cur curlft;
__u32 priority;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
__u8 dir;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 action;
#define XFRM_POLICY_ALLOW 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XFRM_POLICY_BLOCK 1
__u8 flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define XFRM_POLICY_LOCALOK 1
#define XFRM_POLICY_ICMP 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 share;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_userpolicy_id {
struct xfrm_selector sel;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 index;
__u8 dir;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct xfrm_user_acquire {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_id id;
xfrm_address_t saddr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_selector sel;
struct xfrm_userpolicy_info policy;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 aalgos;
__u32 ealgos;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 calgos;
__u32 seq;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct xfrm_user_expire {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_usersa_info state;
__u8 hard;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct xfrm_user_polexpire {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_userpolicy_info pol;
__u8 hard;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct xfrm_usersa_flush {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 proto;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_user_report {
__u8 proto;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_selector sel;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_user_kmaddress {
xfrm_address_t local;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
xfrm_address_t remote;
__u32 reserved;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 family;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_user_migrate {
xfrm_address_t old_daddr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
xfrm_address_t old_saddr;
xfrm_address_t new_daddr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
xfrm_address_t new_saddr;
__u8 proto;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 mode;
__u16 reserved;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reqid;
__u16 old_family;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u16 new_family;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct xfrm_user_mapping {
struct xfrm_usersa_id id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reqid;
xfrm_address_t old_saddr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
xfrm_address_t new_saddr;
__be16 old_sport;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__be16 new_sport;
};
+struct xfrm_address_filter {
+ xfrm_address_t saddr;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ xfrm_address_t daddr;
+ __u16 family;
+ __u8 splen;
+ __u8 dplen;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define XFRMGRP_ACQUIRE 1
#define XFRMGRP_EXPIRE 2
#define XFRMGRP_SA 4
-#define XFRMGRP_POLICY 8
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define XFRMGRP_POLICY 8
#define XFRMGRP_REPORT 0x20
enum xfrm_nlgroups {
XFRMNLGRP_NONE,
-#define XFRMNLGRP_NONE XFRMNLGRP_NONE
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define XFRMNLGRP_NONE XFRMNLGRP_NONE
XFRMNLGRP_ACQUIRE,
#define XFRMNLGRP_ACQUIRE XFRMNLGRP_ACQUIRE
XFRMNLGRP_EXPIRE,
-#define XFRMNLGRP_EXPIRE XFRMNLGRP_EXPIRE
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define XFRMNLGRP_EXPIRE XFRMNLGRP_EXPIRE
XFRMNLGRP_SA,
#define XFRMNLGRP_SA XFRMNLGRP_SA
XFRMNLGRP_POLICY,
-#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
XFRMNLGRP_AEVENTS,
#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
XFRMNLGRP_REPORT,
-#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
XFRMNLGRP_MIGRATE,
#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
XFRMNLGRP_MAPPING,
-#define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING
__XFRMNLGRP_MAX
};
#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
-#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/uapi/mtd/mtd-abi.h b/libc/kernel/uapi/mtd/mtd-abi.h
index 0bb7c61..3641554 100644
--- a/libc/kernel/uapi/mtd/mtd-abi.h
+++ b/libc/kernel/uapi/mtd/mtd-abi.h
@@ -81,105 +81,106 @@
#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MTD_CAP_NVRAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
#define MTD_NANDECC_OFF 0
#define MTD_NANDECC_PLACE 1
#define MTD_NANDECC_AUTOPLACE 2
-#define MTD_NANDECC_PLACEONLY 3
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MTD_NANDECC_PLACEONLY 3
#define MTD_NANDECC_AUTOPL_USR 4
#define MTD_OTP_OFF 0
#define MTD_OTP_FACTORY 1
-#define MTD_OTP_USER 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MTD_OTP_USER 2
struct mtd_info_user {
__u8 type;
__u32 flags;
- __u32 size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 size;
__u32 erasesize;
__u32 writesize;
__u32 oobsize;
- __u64 padding;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 padding;
};
struct region_info_user {
__u32 offset;
- __u32 erasesize;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 erasesize;
__u32 numblocks;
__u32 regionindex;
};
-struct otp_info {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct otp_info {
__u32 start;
__u32 length;
__u32 locked;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
#define MEMERASE _IOW('M', 2, struct erase_info_user)
#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
-#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
#define MEMLOCK _IOW('M', 5, struct erase_info_user)
#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
#define MEMGETREGIONCOUNT _IOR('M', 7, int)
-#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t)
#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)
-#define OTPSELECT _IOR('M', 13, int)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define OTPSELECT _IOR('M', 13, int)
#define OTPGETREGIONCOUNT _IOW('M', 14, int)
#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
#define OTPLOCK _IOR('M', 16, struct otp_info)
-#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
#define MTDFILEMODE _IO('M', 19)
#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
-#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)
#define MEMISLOCKED _IOR('M', 23, struct erase_info_user)
#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
-struct nand_oobinfo {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct nand_oobinfo {
__u32 useecc;
__u32 eccbytes;
__u32 oobfree[8][2];
- __u32 eccpos[32];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 eccpos[32];
};
struct nand_oobfree {
__u32 offset;
- __u32 length;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 length;
};
#define MTD_MAX_OOBFREE_ENTRIES 8
#define MTD_MAX_ECCPOS_ENTRIES 64
-struct nand_ecclayout_user {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct nand_ecclayout_user {
__u32 eccbytes;
__u32 eccpos[MTD_MAX_ECCPOS_ENTRIES];
__u32 oobavail;
- struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
};
struct mtd_ecc_stats {
__u32 corrected;
- __u32 failed;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 failed;
__u32 badblocks;
__u32 bbtblocks;
};
-enum mtd_file_modes {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum mtd_file_modes {
MTD_FILE_MODE_NORMAL = MTD_OTP_OFF,
MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
MTD_FILE_MODE_OTP_USER = MTD_OTP_USER,
- MTD_FILE_MODE_RAW,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ MTD_FILE_MODE_RAW,
};
#endif
diff --git a/libc/kernel/uapi/mtd/ubi-user.h b/libc/kernel/uapi/mtd/ubi-user.h
index fa6be32..dbe1279 100644
--- a/libc/kernel/uapi/mtd/ubi-user.h
+++ b/libc/kernel/uapi/mtd/ubi-user.h
@@ -43,74 +43,81 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_vol_prop_req)
+#define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req)
+#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MAX_UBI_MTD_NAME_LEN 127
#define UBI_MAX_RNVOL 32
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
UBI_DYNAMIC_VOLUME = 3,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
UBI_STATIC_VOLUME = 4,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
UBI_VOL_PROP_DIRECT_WRITE = 1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct ubi_attach_req {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 ubi_num;
__s32 mtd_num;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 vid_hdr_offset;
__s16 max_beb_per1024;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s8 padding[10];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ubi_mkvol_req {
__s32 vol_id;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 alignment;
__s64 bytes;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s8 vol_type;
__s8 padding1;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s16 name_len;
__s8 padding2[4];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char name[UBI_MAX_VOLUME_NAME + 1];
} __packed;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ubi_rsvol_req {
__s64 bytes;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 vol_id;
} __packed;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ubi_rnvol_req {
__s32 count;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s8 padding1[12];
struct {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 vol_id;
__s16 name_len;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s8 padding2[2];
char name[UBI_MAX_VOLUME_NAME + 1];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} ents[UBI_MAX_RNVOL];
} __packed;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ubi_leb_change_req {
__s32 lnum;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 bytes;
__s8 dtype;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s8 padding[7];
} __packed;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ubi_map_req {
__s32 lnum;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s8 dtype;
__s8 padding[3];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __packed;
struct ubi_set_vol_prop_req {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 property;
__u8 padding[7];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u64 value;
} __packed;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct ubi_blkcreate_req {
+ __s8 padding[128];
+} __packed;
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/rdma/rdma_netlink.h b/libc/kernel/uapi/rdma/rdma_netlink.h
index 195b7f1..51aab2c 100644
--- a/libc/kernel/uapi/rdma/rdma_netlink.h
+++ b/libc/kernel/uapi/rdma/rdma_netlink.h
@@ -21,7 +21,17 @@
#include <linux/types.h>
enum {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- RDMA_NL_RDMA_CM = 1
+ RDMA_NL_RDMA_CM = 1,
+ RDMA_NL_NES,
+ RDMA_NL_C4IW,
+ RDMA_NL_NUM_CLIENTS
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+enum {
+ RDMA_NL_GROUP_CM = 1,
+ RDMA_NL_GROUP_IWPM,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_NL_NUM_GROUPS
};
#define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
#define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
@@ -38,17 +48,108 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
RDMA_NL_RDMA_CM_NUM_ATTR,
};
-struct rdma_cm_id_stats {
- __u32 qp_num;
+enum {
+ RDMA_NL_IWPM_REG_PID = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 bound_dev_if;
- __u32 port_space;
- __s32 pid;
- __u8 cm_state;
+ RDMA_NL_IWPM_ADD_MAPPING,
+ RDMA_NL_IWPM_QUERY_MAPPING,
+ RDMA_NL_IWPM_REMOVE_MAPPING,
+ RDMA_NL_IWPM_HANDLE_ERR,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 node_type;
- __u8 port_num;
- __u8 qp_type;
+ RDMA_NL_IWPM_MAPINFO,
+ RDMA_NL_IWPM_MAPINFO_NUM,
+ RDMA_NL_IWPM_NUM_OPS
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct rdma_cm_id_stats {
+ __u32 qp_num;
+ __u32 bound_dev_if;
+ __u32 port_space;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __s32 pid;
+ __u8 cm_state;
+ __u8 node_type;
+ __u8 port_num;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 qp_type;
+};
+enum {
+ IWPM_NLA_REG_PID_UNSPEC = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_REG_PID_SEQ,
+ IWPM_NLA_REG_IF_NAME,
+ IWPM_NLA_REG_IBDEV_NAME,
+ IWPM_NLA_REG_ULIB_NAME,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_REG_PID_MAX
+};
+enum {
+ IWPM_NLA_RREG_PID_UNSPEC = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_RREG_PID_SEQ,
+ IWPM_NLA_RREG_IBDEV_NAME,
+ IWPM_NLA_RREG_ULIB_NAME,
+ IWPM_NLA_RREG_ULIB_VER,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_RREG_PID_ERR,
+ IWPM_NLA_RREG_PID_MAX
+};
+enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0,
+ IWPM_NLA_MANAGE_MAPPING_SEQ,
+ IWPM_NLA_MANAGE_ADDR,
+ IWPM_NLA_MANAGE_MAPPED_LOC_ADDR,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_RMANAGE_MAPPING_ERR,
+ IWPM_NLA_RMANAGE_MAPPING_MAX
+};
+#define IWPM_NLA_MANAGE_MAPPING_MAX 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define IWPM_NLA_QUERY_MAPPING_MAX 4
+#define IWPM_NLA_MAPINFO_SEND_MAX 3
+enum {
+ IWPM_NLA_QUERY_MAPPING_UNSPEC = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_QUERY_MAPPING_SEQ,
+ IWPM_NLA_QUERY_LOCAL_ADDR,
+ IWPM_NLA_QUERY_REMOTE_ADDR,
+ IWPM_NLA_RQUERY_MAPPED_LOC_ADDR,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_RQUERY_MAPPED_REM_ADDR,
+ IWPM_NLA_RQUERY_MAPPING_ERR,
+ IWPM_NLA_RQUERY_MAPPING_MAX
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
+ IWPM_NLA_MAPINFO_REQ_UNSPEC = 0,
+ IWPM_NLA_MAPINFO_ULIB_NAME,
+ IWPM_NLA_MAPINFO_ULIB_VER,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_MAPINFO_REQ_MAX
+};
+enum {
+ IWPM_NLA_MAPINFO_UNSPEC = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_MAPINFO_LOCAL_ADDR,
+ IWPM_NLA_MAPINFO_MAPPED_ADDR,
+ IWPM_NLA_MAPINFO_MAX
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
+ IWPM_NLA_MAPINFO_NUM_UNSPEC = 0,
+ IWPM_NLA_MAPINFO_SEQ,
+ IWPM_NLA_MAPINFO_SEND_NUM,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_MAPINFO_ACK_NUM,
+ IWPM_NLA_MAPINFO_NUM_MAX
+};
+enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ IWPM_NLA_ERR_UNSPEC = 0,
+ IWPM_NLA_ERR_SEQ,
+ IWPM_NLA_ERR_CODE,
+ IWPM_NLA_ERR_MAX
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
#endif
diff --git a/libc/kernel/uapi/rdma/rdma_user_cm.h b/libc/kernel/uapi/rdma/rdma_user_cm.h
index 74e5a05..d142261 100644
--- a/libc/kernel/uapi/rdma/rdma_user_cm.h
+++ b/libc/kernel/uapi/rdma/rdma_user_cm.h
@@ -19,283 +19,285 @@
#ifndef RDMA_USER_CM_H
#define RDMA_USER_CM_H
#include <linux/types.h>
-#include <linux/in6.h>
+#include <linux/socket.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <linux/in6.h>
#include <rdma/ib_user_verbs.h>
#include <rdma/ib_user_sa.h>
#define RDMA_USER_CM_ABI_VERSION 4
-#define RDMA_MAX_PRIVATE_DATA 256
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define RDMA_MAX_PRIVATE_DATA 256
enum {
RDMA_USER_CM_CMD_CREATE_ID,
RDMA_USER_CM_CMD_DESTROY_ID,
- RDMA_USER_CM_CMD_BIND_IP,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_USER_CM_CMD_BIND_IP,
RDMA_USER_CM_CMD_RESOLVE_IP,
RDMA_USER_CM_CMD_RESOLVE_ROUTE,
RDMA_USER_CM_CMD_QUERY_ROUTE,
- RDMA_USER_CM_CMD_CONNECT,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_USER_CM_CMD_CONNECT,
RDMA_USER_CM_CMD_LISTEN,
RDMA_USER_CM_CMD_ACCEPT,
RDMA_USER_CM_CMD_REJECT,
- RDMA_USER_CM_CMD_DISCONNECT,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_USER_CM_CMD_DISCONNECT,
RDMA_USER_CM_CMD_INIT_QP_ATTR,
RDMA_USER_CM_CMD_GET_EVENT,
RDMA_USER_CM_CMD_GET_OPTION,
- RDMA_USER_CM_CMD_SET_OPTION,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_USER_CM_CMD_SET_OPTION,
RDMA_USER_CM_CMD_NOTIFY,
RDMA_USER_CM_CMD_JOIN_IP_MCAST,
RDMA_USER_CM_CMD_LEAVE_MCAST,
- RDMA_USER_CM_CMD_MIGRATE_ID,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_USER_CM_CMD_MIGRATE_ID,
RDMA_USER_CM_CMD_QUERY,
RDMA_USER_CM_CMD_BIND,
RDMA_USER_CM_CMD_RESOLVE_ADDR,
- RDMA_USER_CM_CMD_JOIN_MCAST
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_USER_CM_CMD_JOIN_MCAST
};
struct rdma_ucm_cmd_hdr {
__u32 cmd;
- __u16 in;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 in;
__u16 out;
};
struct rdma_ucm_create_id {
- __u64 uid;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 uid;
__u64 response;
__u16 ps;
__u8 qp_type;
- __u8 reserved[5];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 reserved[5];
};
struct rdma_ucm_create_id_resp {
__u32 id;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct rdma_ucm_destroy_id {
__u64 response;
__u32 id;
- __u32 reserved;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 reserved;
};
struct rdma_ucm_destroy_id_resp {
__u32 events_reported;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct rdma_ucm_bind_ip {
__u64 response;
struct sockaddr_in6 addr;
- __u32 id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 id;
};
struct rdma_ucm_bind {
__u32 id;
- __u16 addr_size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 addr_size;
__u16 reserved;
struct sockaddr_storage addr;
};
-struct rdma_ucm_resolve_ip {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct rdma_ucm_resolve_ip {
struct sockaddr_in6 src_addr;
struct sockaddr_in6 dst_addr;
__u32 id;
- __u32 timeout_ms;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 timeout_ms;
};
struct rdma_ucm_resolve_addr {
__u32 id;
- __u32 timeout_ms;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 timeout_ms;
__u16 src_size;
__u16 dst_size;
__u32 reserved;
- struct sockaddr_storage src_addr;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct sockaddr_storage src_addr;
struct sockaddr_storage dst_addr;
};
struct rdma_ucm_resolve_route {
- __u32 id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 id;
__u32 timeout_ms;
};
enum {
- RDMA_USER_CM_QUERY_ADDR,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_USER_CM_QUERY_ADDR,
RDMA_USER_CM_QUERY_PATH,
RDMA_USER_CM_QUERY_GID
};
-struct rdma_ucm_query {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct rdma_ucm_query {
__u64 response;
__u32 id;
__u32 option;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct rdma_ucm_query_route_resp {
__u64 node_guid;
struct ib_user_path_rec ib_route[2];
- struct sockaddr_in6 src_addr;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct sockaddr_in6 src_addr;
struct sockaddr_in6 dst_addr;
__u32 num_paths;
__u8 port_num;
- __u8 reserved[3];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 reserved[3];
};
struct rdma_ucm_query_addr_resp {
__u64 node_guid;
- __u8 port_num;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 port_num;
__u8 reserved;
__u16 pkey;
__u16 src_size;
- __u16 dst_size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 dst_size;
struct sockaddr_storage src_addr;
struct sockaddr_storage dst_addr;
};
-struct rdma_ucm_query_path_resp {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct rdma_ucm_query_path_resp {
__u32 num_paths;
__u32 reserved;
struct ib_path_rec_data path_data[0];
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct rdma_ucm_conn_param {
__u32 qp_num;
__u32 qkey;
- __u8 private_data[RDMA_MAX_PRIVATE_DATA];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 private_data[RDMA_MAX_PRIVATE_DATA];
__u8 private_data_len;
__u8 srq;
__u8 responder_resources;
- __u8 initiator_depth;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 initiator_depth;
__u8 flow_control;
__u8 retry_count;
__u8 rnr_retry_count;
- __u8 valid;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 valid;
};
struct rdma_ucm_ud_param {
__u32 qp_num;
- __u32 qkey;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 qkey;
struct ib_uverbs_ah_attr ah_attr;
__u8 private_data[RDMA_MAX_PRIVATE_DATA];
__u8 private_data_len;
- __u8 reserved[7];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 reserved[7];
};
struct rdma_ucm_connect {
struct rdma_ucm_conn_param conn_param;
- __u32 id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 id;
__u32 reserved;
};
struct rdma_ucm_listen {
- __u32 id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 id;
__u32 backlog;
};
struct rdma_ucm_accept {
- __u64 uid;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 uid;
struct rdma_ucm_conn_param conn_param;
__u32 id;
__u32 reserved;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct rdma_ucm_reject {
__u32 id;
__u8 private_data_len;
- __u8 reserved[3];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u8 reserved[3];
__u8 private_data[RDMA_MAX_PRIVATE_DATA];
};
struct rdma_ucm_disconnect {
- __u32 id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 id;
};
struct rdma_ucm_init_qp_attr {
__u64 response;
- __u32 id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 id;
__u32 qp_state;
};
struct rdma_ucm_notify {
- __u32 id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 id;
__u32 event;
};
struct rdma_ucm_join_ip_mcast {
- __u64 response;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 response;
__u64 uid;
struct sockaddr_in6 addr;
__u32 id;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct rdma_ucm_join_mcast {
__u64 response;
__u64 uid;
- __u32 id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 id;
__u16 addr_size;
__u16 reserved;
struct sockaddr_storage addr;
-};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
struct rdma_ucm_get_event {
__u64 response;
};
-struct rdma_ucm_event_resp {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct rdma_ucm_event_resp {
__u64 uid;
__u32 id;
__u32 event;
- __u32 status;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 status;
union {
struct rdma_ucm_conn_param conn;
struct rdma_ucm_ud_param ud;
- } param;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ } param;
};
enum {
RDMA_OPTION_ID = 0,
- RDMA_OPTION_IB = 1
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_OPTION_IB = 1
};
enum {
RDMA_OPTION_ID_TOS = 0,
- RDMA_OPTION_ID_REUSEADDR = 1,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ RDMA_OPTION_ID_REUSEADDR = 1,
RDMA_OPTION_ID_AFONLY = 2,
RDMA_OPTION_IB_PATH = 1
};
-struct rdma_ucm_set_option {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct rdma_ucm_set_option {
__u64 optval;
__u32 id;
__u32 level;
- __u32 optname;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 optname;
__u32 optlen;
};
struct rdma_ucm_migrate_id {
- __u64 response;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u64 response;
__u32 id;
__u32 fd;
};
-struct rdma_ucm_migrate_resp {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct rdma_ucm_migrate_resp {
__u32 events_reported;
};
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/uapi/sound/asound.h b/libc/kernel/uapi/sound/asound.h
index 9d187aa..ebb4e68 100644
--- a/libc/kernel/uapi/sound/asound.h
+++ b/libc/kernel/uapi/sound/asound.h
@@ -68,924 +68,927 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_HWDEP_IFACE_USB_STREAM,
SNDRV_HWDEP_IFACE_FW_DICE,
- SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_DICE
-};
+ SNDRV_HWDEP_IFACE_FW_FIREWORKS,
+ SNDRV_HWDEP_IFACE_FW_BEBOB,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_BEBOB
+};
struct snd_hwdep_info {
unsigned int device;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int card;
unsigned char id[64];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char name[80];
int iface;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[64];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_hwdep_dsp_status {
unsigned int version;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char id[32];
unsigned int num_dsps;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int dsp_loaded;
unsigned int chip_ready;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[16];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_hwdep_dsp_image {
unsigned int index;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char name[64];
unsigned char __user *image;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
size_t length;
unsigned long driver_data;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 11)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef unsigned long snd_pcm_uframes_t;
typedef signed long snd_pcm_sframes_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
SNDRV_PCM_CLASS_GENERIC = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_CLASS_MULTI,
SNDRV_PCM_CLASS_MODEM,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_CLASS_DIGITIZER,
SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0,
SNDRV_PCM_SUBCLASS_MULTI_MIX,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
SNDRV_PCM_STREAM_PLAYBACK = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_STREAM_CAPTURE,
SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
typedef int __bitwise snd_pcm_access_t;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0)
#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2)
#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4)
#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef int __bitwise snd_pcm_format_t;
#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7)
#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9)
#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15)
#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17)
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19)
#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33)
#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35)
#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37)
#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39)
#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41)
#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43)
#define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45)
#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47)
#define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49)
#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U16_LE
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#ifdef SNDRV_LITTLE_ENDIAN
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
#ifdef SNDRV_BIG_ENDIAN
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef int __bitwise snd_pcm_subformat_t;
#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
#define SNDRV_PCM_INFO_MMAP 0x00000001
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002
#define SNDRV_PCM_INFO_DOUBLE 0x00000004
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_INFO_BATCH 0x00000010
#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200
#define SNDRV_PCM_INFO_COMPLEX 0x00000400
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000
#define SNDRV_PCM_INFO_OVERRANGE 0x00020000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_INFO_RESUME 0x00040000
#define SNDRV_PCM_INFO_PAUSE 0x00080000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000
#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_INFO_SYNC_START 0x00400000
#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000
#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef int __bitwise snd_pcm_state_t;
#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1)
#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3)
#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5)
#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7)
#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union snd_pcm_sync_id {
unsigned char id[16];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned short id16[8];
unsigned int id32[4];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_pcm_info {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int device;
unsigned int subdevice;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int stream;
int card;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char id[64];
unsigned char name[80];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char subname[32];
int dev_class;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int dev_subclass;
unsigned int subdevices_count;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int subdevices_avail;
union snd_pcm_sync_id sync;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[64];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef int snd_pcm_hw_param_t;
#define SNDRV_PCM_HW_PARAM_ACCESS 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAM_FORMAT 1
#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8
#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAM_CHANNELS 10
#define SNDRV_PCM_HW_PARAM_RATE 11
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12
#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14
#define SNDRV_PCM_HW_PARAM_PERIODS 15
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16
#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18
#define SNDRV_PCM_HW_PARAM_TICK_TIME 19
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0)
#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2)
struct snd_interval {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int min, max;
unsigned int openmin:1,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
openmax:1,
integer:1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
empty:1;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_MASK_MAX 256
struct snd_mask {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 bits[(SNDRV_MASK_MAX+31)/32];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_pcm_hw_params {
unsigned int flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_mask mres[5];
struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
struct snd_interval ires[9];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int rmask;
unsigned int cmask;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int info;
unsigned int msbits;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int rate_num;
unsigned int rate_den;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t fifo_size;
unsigned char reserved[64];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_TSTAMP_NONE = 0,
SNDRV_PCM_TSTAMP_ENABLE,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_pcm_sw_params {
int tstamp_mode;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int period_step;
unsigned int sleep_min;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t avail_min;
snd_pcm_uframes_t xfer_align;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t start_threshold;
snd_pcm_uframes_t stop_threshold;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t silence_threshold;
snd_pcm_uframes_t silence_size;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t boundary;
unsigned char reserved[64];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_pcm_channel_info {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int channel;
__kernel_off_t offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int first;
unsigned int step;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_pcm_status {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_state_t state;
struct timespec trigger_tstamp;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct timespec tstamp;
snd_pcm_uframes_t appl_ptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t hw_ptr;
snd_pcm_sframes_t delay;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t avail;
snd_pcm_uframes_t avail_max;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t overrange;
snd_pcm_state_t suspended_state;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved_alignment;
struct timespec audio_tstamp;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[56-sizeof(struct timespec)];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_pcm_mmap_status {
snd_pcm_state_t state;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int pad1;
snd_pcm_uframes_t hw_ptr;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct timespec tstamp;
snd_pcm_state_t suspended_state;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct timespec audio_tstamp;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_pcm_mmap_control {
snd_pcm_uframes_t appl_ptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t avail_min;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0)
#define SNDRV_PCM_SYNC_PTR_APPL (1<<1)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2)
struct snd_pcm_sync_ptr {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int flags;
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_pcm_mmap_status status;
unsigned char reserved[64];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} s;
union {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_pcm_mmap_control control;
unsigned char reserved[64];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} c;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_xferi {
snd_pcm_sframes_t result;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
void __user *buf;
snd_pcm_uframes_t frames;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_xfern {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_sframes_t result;
void __user * __user *bufs;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_pcm_uframes_t frames;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_UNKNOWN = 0,
SNDRV_CHMAP_NA,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_MONO,
SNDRV_CHMAP_FL,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_FR,
SNDRV_CHMAP_RL,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_RR,
SNDRV_CHMAP_FC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_LFE,
SNDRV_CHMAP_SL,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_SR,
SNDRV_CHMAP_RC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_FLC,
SNDRV_CHMAP_FRC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_RLC,
SNDRV_CHMAP_RRC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_FLW,
SNDRV_CHMAP_FRW,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_FLH,
SNDRV_CHMAP_FCH,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_FRH,
SNDRV_CHMAP_TC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_TFL,
SNDRV_CHMAP_TFR,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_TFC,
SNDRV_CHMAP_TRL,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_TRR,
SNDRV_CHMAP_TRC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_TFLC,
SNDRV_CHMAP_TFRC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_TSL,
SNDRV_CHMAP_TSR,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_LLFE,
SNDRV_CHMAP_RLFE,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_BC,
SNDRV_CHMAP_BLC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CHMAP_BRC,
SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define SNDRV_CHMAP_POSITION_MASK 0xffff
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_RAWMIDI_STREAM_INPUT,
SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_rawmidi_info {
unsigned int device;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int subdevice;
int stream;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int card;
unsigned int flags;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char id[64];
unsigned char name[80];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char subname[32];
unsigned int subdevices_count;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int subdevices_avail;
unsigned char reserved[64];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_rawmidi_params {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int stream;
size_t buffer_size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
size_t avail_min;
unsigned int no_active_sensing: 1;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[16];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_rawmidi_status {
int stream;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct timespec tstamp;
size_t avail;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
size_t xruns;
unsigned char reserved[16];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
SNDRV_TIMER_CLASS_NONE = -1,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_CLASS_SLAVE = 0,
SNDRV_TIMER_CLASS_GLOBAL,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_CLASS_CARD,
SNDRV_TIMER_CLASS_PCM,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum {
SNDRV_TIMER_SCLASS_NONE = 0,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_SCLASS_APPLICATION,
SNDRV_TIMER_SCLASS_SEQUENCER,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define SNDRV_TIMER_GLOBAL_SYSTEM 0
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_GLOBAL_RTC 1
#define SNDRV_TIMER_GLOBAL_HPET 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_GLOBAL_HRTIMER 3
#define SNDRV_TIMER_FLG_SLAVE (1<<0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_timer_id {
int dev_class;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int dev_sclass;
int card;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int device;
int subdevice;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_timer_ginfo {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_timer_id tid;
unsigned int flags;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int card;
unsigned char id[64];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char name[80];
unsigned long reserved0;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long resolution;
unsigned long resolution_min;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long resolution_max;
unsigned int clients;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[32];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_timer_gparams {
struct snd_timer_id tid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long period_num;
unsigned long period_den;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[32];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_timer_gstatus {
struct snd_timer_id tid;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long resolution;
unsigned long resolution_num;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long resolution_den;
unsigned char reserved[32];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_timer_select {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_timer_id id;
unsigned char reserved[32];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_timer_info {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int flags;
int card;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char id[64];
unsigned char name[80];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long reserved0;
unsigned long resolution;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[64];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_PSFLG_AUTO (1<<0)
#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2)
struct snd_timer_params {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int flags;
unsigned int ticks;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int queue_size;
unsigned int reserved0;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int filter;
unsigned char reserved[60];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_timer_status {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct timespec tstamp;
unsigned int resolution;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int lost;
unsigned int overrun;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int queue;
unsigned char reserved[64];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
struct snd_timer_read {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int resolution;
unsigned int ticks;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
enum {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_EVENT_RESOLUTION = 0,
SNDRV_TIMER_EVENT_TICK,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_EVENT_START,
SNDRV_TIMER_EVENT_STOP,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_EVENT_CONTINUE,
SNDRV_TIMER_EVENT_PAUSE,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_EVENT_EARLY,
SNDRV_TIMER_EVENT_SUSPEND,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_EVENT_RESUME,
SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_timer_tread {
int event;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct timespec tstamp;
unsigned int val;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_ctl_card_info {
int card;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
int pad;
unsigned char id[16];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char driver[16];
unsigned char name[32];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char longname[80];
unsigned char reserved_[16];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char mixername[80];
unsigned char components[128];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
typedef int __bitwise snd_ctl_elem_type_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0)
#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2)
#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4)
#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6)
#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef int __bitwise snd_ctl_elem_iface_t;
#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1)
#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3)
#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5)
#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2)
#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4)
#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8)
#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10)
#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29)
#define SNDRV_CTL_POWER_D0 0x0000
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_POWER_D1 0x0100
#define SNDRV_CTL_POWER_D2 0x0200
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_POWER_D3 0x0300
#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001)
#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_ctl_elem_id {
unsigned int numid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_ctl_elem_iface_t iface;
unsigned int device;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int subdevice;
unsigned char name[44];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int index;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_ctl_elem_list {
unsigned int offset;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int space;
unsigned int used;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int count;
struct snd_ctl_elem_id __user *pids;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[50];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_ctl_elem_info {
struct snd_ctl_elem_id id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
snd_ctl_elem_type_t type;
unsigned int access;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int count;
__kernel_pid_t owner;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
struct {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
long min;
long max;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
long step;
} integer;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct {
long long min;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
long long max;
long long step;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} integer64;
struct {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int items;
unsigned int item;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char name[64];
__u64 names_ptr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int names_length;
} enumerated;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[128];
} value;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
unsigned short d[4];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned short *d_ptr;
} dimen;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char reserved[64-4*sizeof(unsigned short)];
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_ctl_elem_value {
struct snd_ctl_elem_id id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int indirect: 1;
union {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
long value[128];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
long *value_ptr;
} integer;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
long long value[64];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
long long *value_ptr;
} integer64;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
unsigned int item[128];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int *item_ptr;
} enumerated;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
unsigned char data[512];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char *data_ptr;
} bytes;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_aes_iec958 iec958;
} value;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct timespec tstamp;
unsigned char reserved[128-sizeof(struct timespec)];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct snd_ctl_tlv {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int numid;
unsigned int length;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int tlv[0];
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
enum sndrv_ctl_event_type {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
SNDRV_CTL_EVENT_ELEM = 0,
SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_EVENT_MASK_INFO (1<<1)
#define SNDRV_CTL_EVENT_MASK_ADD (1<<2)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_EVENT_MASK_TLV (1<<3)
#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_ctl_event {
int type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union {
struct {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int mask;
struct snd_ctl_elem_id id;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} elem;
unsigned char data8[60];
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} data;
};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_NAME_NONE ""
#define SNDRV_CTL_NAME_PLAYBACK "Playback "
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_NAME_CAPTURE "Capture "
#define SNDRV_CTL_NAME_IEC958_NONE ""
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
diff --git a/libc/kernel/uapi/sound/compress_offload.h b/libc/kernel/uapi/sound/compress_offload.h
index 5b06741..0120502 100644
--- a/libc/kernel/uapi/sound/compress_offload.h
+++ b/libc/kernel/uapi/sound/compress_offload.h
@@ -27,13 +27,13 @@
__u32 fragment_size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 fragments;
-};
+} __attribute__((packed, aligned(4)));
struct snd_compr_params {
struct snd_compressed_buffer buffer;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_codec codec;
__u8 no_wake_mode;
-};
+} __attribute__((packed, aligned(4)));
struct snd_compr_tstamp {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 byte_offset;
@@ -42,12 +42,12 @@
__u32 pcm_io_frames;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 sampling_rate;
-};
+} __attribute__((packed, aligned(4)));
struct snd_compr_avail {
__u64 avail;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_compr_tstamp tstamp;
-};
+} __attribute__((packed, aligned(4)));
enum snd_compr_direction {
SND_COMPRESS_PLAYBACK = 0,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -64,14 +64,14 @@
__u32 max_fragments;
__u32 codecs[MAX_NUM_CODECS];
__u32 reserved[11];
-};
+} __attribute__((packed, aligned(4)));
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_compr_codec_caps {
__u32 codec;
__u32 num_descriptors;
struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-};
+} __attribute__((packed, aligned(4)));
enum {
SNDRV_COMPRESS_ENCODER_PADDING = 1,
SNDRV_COMPRESS_ENCODER_DELAY = 2,
@@ -81,7 +81,7 @@
__u32 key;
__u32 value[8];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-};
+} __attribute__((packed, aligned(4)));
#define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int)
#define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps)
#define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11, struct snd_compr_codec_caps)
diff --git a/libc/kernel/uapi/sound/compress_params.h b/libc/kernel/uapi/sound/compress_params.h
index 8aa0bfe..e884e9a 100644
--- a/libc/kernel/uapi/sound/compress_params.h
+++ b/libc/kernel/uapi/sound/compress_params.h
@@ -181,23 +181,23 @@
__u32 min_bit_rate;
__u32 downmix;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-};
+} __attribute__((packed, aligned(4)));
struct snd_enc_real {
__u32 quant_bits;
__u32 start_region;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 num_regions;
-};
+} __attribute__((packed, aligned(4)));
struct snd_enc_flac {
__u32 num;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 gain;
-};
+} __attribute__((packed, aligned(4)));
struct snd_enc_generic {
__u32 bw;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__s32 reserved[15];
-};
+} __attribute__((packed, aligned(4)));
union snd_codec_options {
struct snd_enc_wma wma;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -206,7 +206,7 @@
struct snd_enc_flac flac;
struct snd_enc_generic generic;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-};
+} __attribute__((packed, aligned(4)));
struct snd_codec_desc {
__u32 max_ch;
__u32 sample_rates[MAX_NUM_SAMPLE_RATES];
@@ -222,7 +222,7 @@
__u32 min_buffer;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 reserved[15];
-};
+} __attribute__((packed, aligned(4)));
struct snd_codec {
__u32 id;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -241,5 +241,5 @@
union snd_codec_options options;
__u32 reserved[3];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-};
+} __attribute__((packed, aligned(4)));
#endif
diff --git a/libc/kernel/uapi/sound/firewire.h b/libc/kernel/uapi/sound/firewire.h
index 5d0fd14..55f729e 100644
--- a/libc/kernel/uapi/sound/firewire.h
+++ b/libc/kernel/uapi/sound/firewire.h
@@ -19,40 +19,63 @@
#ifndef _UAPI_SOUND_FIREWIRE_H_INCLUDED
#define _UAPI_SOUND_FIREWIRE_H_INCLUDED
#include <linux/ioctl.h>
-#define SNDRV_FIREWIRE_EVENT_LOCK_STATUS 0x000010cc
+#include <linux/types.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SNDRV_FIREWIRE_EVENT_LOCK_STATUS 0x000010cc
#define SNDRV_FIREWIRE_EVENT_DICE_NOTIFICATION 0xd1ce004e
+#define SNDRV_FIREWIRE_EVENT_EFW_RESPONSE 0x4e617475
struct snd_firewire_event_common {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int type;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_firewire_event_lock_status {
unsigned int type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int status;
};
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_firewire_event_dice_notification {
unsigned int type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned int notification;
};
+#define SND_EFW_TRANSACTION_USER_SEQNUM_MAX ((__u32)((__u16)~0) - 1)
+struct snd_efw_transaction {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __be32 length;
+ __be32 version;
+ __be32 seqnum;
+ __be32 category;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __be32 command;
+ __be32 status;
+ __be32 params[0];
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct snd_firewire_event_efw_response {
+ unsigned int type;
+ __be32 response[0];
+};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
union snd_firewire_event {
struct snd_firewire_event_common common;
struct snd_firewire_event_lock_status lock_status;
struct snd_firewire_event_dice_notification dice_notification;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct snd_firewire_event_efw_response efw_response;
};
#define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
#define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
-#define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
#define SNDRV_FIREWIRE_TYPE_DICE 1
+#define SNDRV_FIREWIRE_TYPE_FIREWORKS 2
+#define SNDRV_FIREWIRE_TYPE_BEBOB 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct snd_firewire_get_info {
unsigned int type;
unsigned int card;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned char guid[8];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
char device_name[16];
};
#endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/private/bionic_asm.h b/libc/private/bionic_asm.h
index 7c2686f..d53ebba 100644
--- a/libc/private/bionic_asm.h
+++ b/libc/private/bionic_asm.h
@@ -41,7 +41,7 @@
#define ENTRY(f) \
.text; \
.globl f; \
- _ALIGN_TEXT; \
+ .align __bionic_asm_align; \
.type f, __bionic_asm_function_type; \
f: \
__bionic_asm_custom_entry(f); \
diff --git a/libc/private/bionic_atomic_arm.h b/libc/private/bionic_atomic_arm.h
index 2156e6a..0cb832f 100644
--- a/libc/private/bionic_atomic_arm.h
+++ b/libc/private/bionic_atomic_arm.h
@@ -17,12 +17,7 @@
#define BIONIC_ATOMIC_ARM_H
__ATOMIC_INLINE__ void __bionic_memory_barrier() {
-#if defined(ANDROID_SMP) && ANDROID_SMP == 1
__asm__ __volatile__ ( "dmb ish" : : : "memory" );
-#else
- /* A simple compiler barrier. */
- __asm__ __volatile__ ( "" : : : "memory" );
-#endif
}
/* Compare-and-swap, without any explicit barriers. Note that this function
diff --git a/libc/private/bionic_atomic_inline.h b/libc/private/bionic_atomic_inline.h
index b834a27..f8032c3 100644
--- a/libc/private/bionic_atomic_inline.h
+++ b/libc/private/bionic_atomic_inline.h
@@ -30,10 +30,6 @@
* on SMP systems emits an appropriate instruction.
*/
-#if !defined(ANDROID_SMP)
-# error "Must define ANDROID_SMP before including atomic-inline.h"
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/libc/private/bionic_atomic_mips.h b/libc/private/bionic_atomic_mips.h
index 5e08116..83f75fe 100644
--- a/libc/private/bionic_atomic_mips.h
+++ b/libc/private/bionic_atomic_mips.h
@@ -21,12 +21,7 @@
*/
__ATOMIC_INLINE__ void __bionic_memory_barrier() {
-#if defined(ANDROID_SMP) && ANDROID_SMP == 1
__asm__ __volatile__ ( "sync" : : : "memory" );
-#else
- /* A simple compiler barrier. */
- __asm__ __volatile__ ( "" : : : "memory" );
-#endif
}
/* Compare-and-swap, without any explicit barriers. Note that this function
diff --git a/libc/private/bionic_atomic_x86.h b/libc/private/bionic_atomic_x86.h
index 89639c8..e63df93 100644
--- a/libc/private/bionic_atomic_x86.h
+++ b/libc/private/bionic_atomic_x86.h
@@ -20,12 +20,7 @@
* platform for a multi-core device.
*/
__ATOMIC_INLINE__ void __bionic_memory_barrier() {
-#if defined(ANDROID_SMP) && ANDROID_SMP == 1
__asm__ __volatile__ ( "mfence" : : : "memory" );
-#else
- /* A simple compiler barrier. */
- __asm__ __volatile__ ( "" : : : "memory" );
-#endif
}
/* Compare-and-swap, without any explicit barriers. Note that this function
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/libc/private/bionic_constants.h
similarity index 79%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to libc/private/bionic_constants.h
index a4d7504..9ae1c8d 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/libc/private/bionic_constants.h
@@ -14,12 +14,9 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
-}
+#ifndef _BIONIC_CONSTANTS_H_
+#define _BIONIC_CONSTANTS_H_
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
-}
-#endif
+#define NS_PER_S 1000000000
+
+#endif // _BIONIC_CONSTANTS_H_
diff --git a/libc/private/bionic_macros.h b/libc/private/bionic_macros.h
index 491b3ac..4f3cf89 100644
--- a/libc/private/bionic_macros.h
+++ b/libc/private/bionic_macros.h
@@ -17,11 +17,16 @@
#ifndef _BIONIC_MACROS_H_
#define _BIONIC_MACROS_H_
+// Frameworks OpenGL code currently leaks this header and allows
+// collisions with other declarations, e.g., from libnativehelper.
+// TODO: Remove once cleaned up. b/18334516
+#if !defined(DISALLOW_COPY_AND_ASSIGN)
// DISALLOW_COPY_AND_ASSIGN disallows the copy and operator= functions.
// It goes in the private: declarations in a class.
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \
void operator=(const TypeName&) = delete
+#endif // !defined(DISALLOW_COPY_AND_ASSIGN)
// A macro to disallow all the implicit constructors, namely the
// default constructor, copy constructor and operator= functions.
diff --git a/libc/private/bionic_pthread.h b/libc/private/bionic_pthread.h
deleted file mode 100644
index 07bcbd4..0000000
--- a/libc/private/bionic_pthread.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2011 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 _BIONIC_PTHREAD_H
-#define _BIONIC_PTHREAD_H
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-/* Internal, not an NDK API */
-extern pid_t __pthread_gettid(pthread_t thid);
-
-__END_DECLS
-
-#endif /* _BIONIC_PTHREAD_H */
diff --git a/libc/private/bionic_systrace.h b/libc/private/bionic_systrace.h
new file mode 100644
index 0000000..0b4560f
--- /dev/null
+++ b/libc/private/bionic_systrace.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BIONIC_SYSTRACE_H
+#define BIONIC_SYSTRACE_H
+
+#include "bionic_macros.h"
+
+// Tracing class for bionic. To begin a trace at a specified point:
+// ScopedTrace("Trace message");
+// The trace will end when the contructor goes out of scope.
+
+class __LIBC_HIDDEN__ ScopedTrace {
+ public:
+ explicit ScopedTrace(const char* message);
+ ~ScopedTrace();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScopedTrace);
+};
+
+#endif
diff --git a/libc/private/bionic_time_conversions.h b/libc/private/bionic_time_conversions.h
index 51f543f..cf0046a 100644
--- a/libc/private/bionic_time_conversions.h
+++ b/libc/private/bionic_time_conversions.h
@@ -39,6 +39,8 @@
__LIBC_HIDDEN__ void timeval_from_timespec(timeval& tv, const timespec& ts);
+__LIBC_HIDDEN__ bool timespec_from_absolute_timespec(timespec& ts, const timespec& abs_ts, clockid_t clock);
+
__END_DECLS
#endif
diff --git a/libc/private/kernel_sigset_t.h b/libc/private/kernel_sigset_t.h
index b2d6386..9415fcf 100644
--- a/libc/private/kernel_sigset_t.h
+++ b/libc/private/kernel_sigset_t.h
@@ -17,6 +17,8 @@
#ifndef LIBC_PRIVATE_KERNEL_SIGSET_T_H_
#define LIBC_PRIVATE_KERNEL_SIGSET_T_H_
+#include <signal.h>
+
// Our sigset_t is wrong for ARM and x86. It's 32-bit but the kernel expects 64 bits.
// This means we can't support real-time signals correctly until we can change the ABI.
// In the meantime, we can use this union to pass an appropriately-sized block of memory
diff --git a/libc/stdio/fileext.h b/libc/stdio/fileext.h
index c074b4b..25b7bda 100644
--- a/libc/stdio/fileext.h
+++ b/libc/stdio/fileext.h
@@ -45,8 +45,6 @@
pthread_mutex_t _lock; /* file lock */
};
-#define _FILEEXT_INITIALIZER {{NULL,0},{0},PTHREAD_RECURSIVE_MUTEX_INITIALIZER}
-
#define _EXT(fp) ((struct __sfileext *)((fp)->_ext._base))
#define _UB(fp) _EXT(fp)->_ub
#define _FLOCK(fp) _EXT(fp)->_lock
diff --git a/libc/stdio/findfp.c b/libc/stdio/findfp.c
index cfbb66b..7a537c8 100644
--- a/libc/stdio/findfp.c
+++ b/libc/stdio/findfp.c
@@ -53,8 +53,8 @@
#define NDYNAMIC 10 /* add ten more whenever necessary */
#define std(flags, file) \
- {0,0,0,flags,file,{0},0,__sF+file,__sclose,__sread,__sseek,__swrite, \
- {(unsigned char *)(__sFext+file), 0},NULL,0,{0},{0},{0},0,0}
+ {0,0,0,flags,file,{0,0},0,__sF+file,__sclose,__sread,__sseek,__swrite, \
+ {(unsigned char *)(__sFext+file), 0},NULL,0,{0},{0},{0,0},0,0}
/* the usual - (stdin + stdout + stderr) */
static FILE usual[FOPEN_MAX - 3];
diff --git a/libc/stdio/stdio_ext.cpp b/libc/stdio/stdio_ext.cpp
new file mode 100644
index 0000000..bfdecb8
--- /dev/null
+++ b/libc/stdio/stdio_ext.cpp
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2014 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 <stdio_ext.h>
+
+#include <stdio.h>
+#include "local.h"
+
+#define FSETLOCKING_QUERY 0
+#define FSETLOCKING_INTERNAL 1
+#define FSETLOCKING_BYCALLER 2
+
+size_t __fbufsize(FILE* fp) {
+ return fp->_bf._size;
+}
+
+/* For a _SRW stream, we don't know whether we last read or wrote.
+int __freading(FILE* fp) {
+ return (fp->_flags & _SRD) != 0 || ...;
+}
+*/
+
+/* For a _SRW stream, we don't know whether we last read or wrote.
+int __fwriting(FILE*) {
+ return (fp->_flags & _SWR) != 0 || ...;
+}
+*/
+
+int __freadable(FILE* fp) {
+ return (fp->_flags & (__SRD|__SRW)) != 0;
+}
+
+int __fwritable(FILE* fp) {
+ return (fp->_flags & (__SWR|__SRW)) != 0;
+}
+
+int __flbf(FILE* fp) {
+ return (fp->_flags & __SLBF) != 0;
+}
+
+void __fpurge(FILE* fp) {
+ fpurge(fp);
+}
+
+size_t __fpending(FILE* fp) {
+ return fp->_p - fp->_bf._base;
+}
+
+void _flushlbf() {
+ // If we flush all streams, we know we've flushed all the line-buffered streams.
+ fflush(NULL);
+}
+
+int __fsetlocking(FILE*, int) {
+ // We don't currently have an implementation that would obey this,
+ // so make setting the state a no-op and always return "we handle locking for you".
+ // http://b/17154740 suggests ways we could fix this.
+ return FSETLOCKING_INTERNAL;
+}
+
+void clearerr_unlocked(FILE* fp) {
+ return __sclearerr(fp);
+}
+
+int feof_unlocked(FILE* fp) {
+ return __sfeof(fp);
+}
+
+int ferror_unlocked(FILE* fp) {
+ return __sferror(fp);
+}
diff --git a/libc/tools/bionic_utils.py b/libc/tools/bionic_utils.py
deleted file mode 100644
index c38efb5..0000000
--- a/libc/tools/bionic_utils.py
+++ /dev/null
@@ -1,165 +0,0 @@
-# common python utility routines for the Bionic tool scripts
-
-import sys, os, commands, string
-
-all_arches = [ "arm", "arm64", "mips", "mips64", "x86", "x86_64" ]
-
-# basic debugging trace support
-# call D_setlevel to set the verbosity level
-# and D(), D2(), D3(), D4() to add traces
-#
-verbose = 0
-
-def D(msg):
- global verbose
- if verbose > 0:
- print msg
-
-def D2(msg):
- global verbose
- if verbose >= 2:
- print msg
-
-def D3(msg):
- global verbose
- if verbose >= 3:
- print msg
-
-def D4(msg):
- global verbose
- if verbose >= 4:
- print msg
-
-def D_setlevel(level):
- global verbose
- verbose = level
-
-
-# parser for the SYSCALLS.TXT file
-#
-class SysCallsTxtParser:
- def __init__(self):
- self.syscalls = []
- self.lineno = 0
-
- def E(self, msg):
- print "%d: %s" % (self.lineno, msg)
-
- def parse_line(self, line):
- """ parse a syscall spec line.
-
- line processing, format is
- return type func_name[|alias_list][:syscall_name[:socketcall_id]] ( [paramlist] ) architecture_list
- """
- pos_lparen = line.find('(')
- E = self.E
- if pos_lparen < 0:
- E("missing left parenthesis in '%s'" % line)
- return
-
- pos_rparen = line.rfind(')')
- if pos_rparen < 0 or pos_rparen <= pos_lparen:
- E("missing or misplaced right parenthesis in '%s'" % line)
- return
-
- return_type = line[:pos_lparen].strip().split()
- if len(return_type) < 2:
- E("missing return type in '%s'" % line)
- return
-
- syscall_func = return_type[-1]
- return_type = string.join(return_type[:-1],' ')
- socketcall_id = -1
-
- pos_colon = syscall_func.find(':')
- if pos_colon < 0:
- syscall_name = syscall_func
- else:
- if pos_colon == 0 or pos_colon+1 >= len(syscall_func):
- E("misplaced colon in '%s'" % line)
- return
-
- # now find if there is a socketcall_id for a dispatch-type syscall
- # after the optional 2nd colon
- pos_colon2 = syscall_func.find(':', pos_colon + 1)
- if pos_colon2 < 0:
- syscall_name = syscall_func[pos_colon+1:]
- syscall_func = syscall_func[:pos_colon]
- else:
- if pos_colon2+1 >= len(syscall_func):
- E("misplaced colon2 in '%s'" % line)
- return
- syscall_name = syscall_func[(pos_colon+1):pos_colon2]
- socketcall_id = int(syscall_func[pos_colon2+1:])
- syscall_func = syscall_func[:pos_colon]
-
- alias_delim = syscall_func.find('|')
- if alias_delim > 0:
- alias_list = syscall_func[alias_delim+1:].strip()
- syscall_func = syscall_func[:alias_delim]
- alias_delim = syscall_name.find('|')
- if alias_delim > 0:
- syscall_name = syscall_name[:alias_delim]
- syscall_aliases = string.split(alias_list, ',')
- else:
- syscall_aliases = []
-
- if pos_rparen > pos_lparen+1:
- syscall_params = line[pos_lparen+1:pos_rparen].split(',')
- params = string.join(syscall_params,',')
- else:
- syscall_params = []
- params = "void"
-
- t = {
- "name" : syscall_name,
- "func" : syscall_func,
- "aliases" : syscall_aliases,
- "params" : syscall_params,
- "decl" : "%-15s %s (%s);" % (return_type, syscall_func, params),
- "socketcall_id" : socketcall_id
- }
-
- # Parse the architecture list.
- arch_list = line[pos_rparen+1:].strip()
- if arch_list == "all":
- for arch in all_arches:
- t[arch] = True
- else:
- for arch in string.split(arch_list, ','):
- if arch in all_arches:
- t[arch] = True
- else:
- E("invalid syscall architecture '%s' in '%s'" % (arch, line))
- return
-
- self.syscalls.append(t)
-
- global verbose
- if verbose >= 2:
- print t
-
-
- def parse_file(self, file_path):
- D2("parse_file: %s" % file_path)
- fp = open(file_path)
- for line in fp.xreadlines():
- self.lineno += 1
- line = line.strip()
- if not line: continue
- if line[0] == '#': continue
- self.parse_line(line)
-
- fp.close()
-
-
-class StringOutput:
- def __init__(self):
- self.line = ""
-
- def write(self,msg):
- self.line += msg
- D2("write '%s'" % msg)
-
- def get(self):
- return self.line
diff --git a/libc/tools/check-symbols-glibc.py b/libc/tools/check-symbols-glibc.py
index 58a10e0..0c7e28e 100755
--- a/libc/tools/check-symbols-glibc.py
+++ b/libc/tools/check-symbols-glibc.py
@@ -3,12 +3,26 @@
import glob
import os
import re
-import string
import subprocess
import sys
+only_unwanted = False
+if len(sys.argv) > 1:
+ if sys.argv[1] in ('-u', '--unwanted'):
+ only_unwanted = True
+
toolchain = os.environ['ANDROID_TOOLCHAIN']
arch = re.sub(r'.*/linux-x86/([^/]+)/.*', r'\1', toolchain)
+if arch == 'aarch64':
+ arch = 'arm64'
+
+def GetSymbolsFromTxt(txt_file):
+ symbols = set()
+ f = open(txt_file, 'r')
+ for line in f.read().splitlines():
+ symbols.add(line)
+ f.close()
+ return symbols
def GetSymbolsFromSo(so_file):
# Example readelf output:
@@ -50,15 +64,27 @@
return glibc_to_bionic_names[name]
return name
+def GetNdkIgnored():
+ global arch
+ symbols = set()
+ files = glob.glob('%s/ndk/build/tools/unwanted-symbols/%s/*' %
+ (os.getenv('ANDROID_BUILD_TOP'), arch))
+ for f in files:
+ symbols |= set(open(f, 'r').read().splitlines())
+ return symbols
+
glibc_to_bionic_names = {
'__res_init': 'res_init',
'__res_mkquery': 'res_mkquery',
'__res_query': 'res_query',
'__res_search': 'res_search',
+ '__xpg_basename': '__gnu_basename',
}
glibc = GetSymbolsFromSystemSo('libc.so.*', 'librt.so.*', 'libpthread.so.*', 'libresolv.so.*', 'libm.so.*')
bionic = GetSymbolsFromAndroidSo('libc.so', 'libm.so')
+posix = GetSymbolsFromTxt(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'posix-2013.txt'))
+ndk_ignored = GetNdkIgnored()
glibc = map(MangleGlibcNameToBionic, glibc)
@@ -100,6 +126,16 @@
'__errno',
'__fe_dfl_env',
'__get_h_errno',
+ '__fpclassifyd',
+ '__isfinite',
+ '__isfinitef',
+ '__isfinitel',
+ '__isnormal',
+ '__isnormalf',
+ '__isnormall',
+ '__sF',
+ '__pthread_cleanup_pop',
+ '__pthread_cleanup_push',
])
# bionic exposes various Linux features that glibc doesn't.
linux_stuff = set([
@@ -133,21 +169,48 @@
'mknodat',
'stat',
'stat64',
+ 'optreset',
+ 'sigsetjmp',
+])
+# These exist in glibc, but under slightly different names (generally one extra
+# or one fewer _). TODO: check against glibc names.
+libresolv_stuff = set([
+ '__res_send_setqhook',
+ '__res_send_setrhook',
+ '_resolv_flush_cache_for_net',
+ '_resolv_set_nameservers_for_net',
+ 'dn_expand',
+ 'nsdispatch',
+])
+# Implementation details we know we export (and can't get away from).
+known = set([
+ '_ctype_',
+ '__libc_init',
])
-print 'glibc:'
-for symbol in sorted(glibc):
- print symbol
+if not only_unwanted:
+ print 'glibc:'
+ for symbol in sorted(glibc):
+ print symbol
-print
-print 'bionic:'
-for symbol in sorted(bionic):
- print symbol
+ print
+ print 'bionic:'
+ for symbol in sorted(bionic):
+ print symbol
-print
-print 'in bionic but not glibc:'
-allowed_stuff = (bsd_stuff | FORTIFY_stuff | linux_stuff | macro_stuff | std_stuff | weird_stuff)
+ print
+ print 'in posix but not bionic:'
+ for symbol in sorted(posix.difference(bionic)):
+ print symbol
+
+ print
+ print 'in bionic but not glibc:'
+
+allowed_stuff = (bsd_stuff | FORTIFY_stuff | linux_stuff | macro_stuff |
+ std_stuff | weird_stuff | libresolv_stuff | known)
for symbol in sorted((bionic - allowed_stuff).difference(glibc)):
+ if symbol in ndk_ignored:
+ symbol += '*'
print symbol
sys.exit(0)
diff --git a/libc/tools/generate-NOTICE.py b/libc/tools/generate-NOTICE.py
index 8cd75a3..3edc299 100755
--- a/libc/tools/generate-NOTICE.py
+++ b/libc/tools/generate-NOTICE.py
@@ -121,7 +121,6 @@
try:
content = open(path, 'r').read().decode('utf-8')
except:
- # TODO: update hash.h, md5.c, and md5.h; upstream is probably UTF-8 already.
sys.stderr.write('warning: bad UTF-8 in %s\n' % path)
content = open(path, 'r').read().decode('iso-8859-1')
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index e8ec636..4e24077 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -4,21 +4,29 @@
# the header files listing all available system calls, and the
# makefiles used to build all the stubs.
+import atexit
import commands
import filecmp
import glob
+import logging
import os.path
import re
import shutil
import stat
+import string
import sys
+import tempfile
-from bionic_utils import *
-bionic_libc_root = os.environ["ANDROID_BUILD_TOP"] + "/bionic/libc/"
+all_arches = [ "arm", "arm64", "mips", "mips64", "x86", "x86_64" ]
+
# temp directory where we store all intermediate files
-bionic_temp = "/tmp/bionic_gensyscalls/"
+bionic_temp = tempfile.mkdtemp(prefix="bionic_gensyscalls");
+# Make sure the directory is deleted when the script exits.
+atexit.register(shutil.rmtree, bionic_temp)
+
+bionic_libc_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libc")
warning = "Generated by gensyscalls.py. Do not edit."
@@ -34,9 +42,10 @@
def create_file(relpath):
- dir = os.path.dirname(bionic_temp + relpath)
+ full_path = os.path.join(bionic_temp, relpath)
+ dir = os.path.dirname(full_path)
make_dir(dir)
- return open(bionic_temp + relpath, "w")
+ return open(full_path, "w")
syscall_stub_header = "/* " + warning + " */\n" + \
@@ -265,7 +274,7 @@
# This lets us support regular system calls like __NR_write and also weird
# ones like __ARM_NR_cacheflush, where the NR doesn't come at the start.
def make__NR_name(name):
- if name.startswith("__"):
+ if name.startswith("__ARM_NR_"):
return name
else:
return "__NR_%s" % (name)
@@ -380,6 +389,120 @@
return result
+class SysCallsTxtParser:
+ def __init__(self):
+ self.syscalls = []
+ self.lineno = 0
+
+ def E(self, msg):
+ print "%d: %s" % (self.lineno, msg)
+
+ def parse_line(self, line):
+ """ parse a syscall spec line.
+
+ line processing, format is
+ return type func_name[|alias_list][:syscall_name[:socketcall_id]] ( [paramlist] ) architecture_list
+ """
+ pos_lparen = line.find('(')
+ E = self.E
+ if pos_lparen < 0:
+ E("missing left parenthesis in '%s'" % line)
+ return
+
+ pos_rparen = line.rfind(')')
+ if pos_rparen < 0 or pos_rparen <= pos_lparen:
+ E("missing or misplaced right parenthesis in '%s'" % line)
+ return
+
+ return_type = line[:pos_lparen].strip().split()
+ if len(return_type) < 2:
+ E("missing return type in '%s'" % line)
+ return
+
+ syscall_func = return_type[-1]
+ return_type = string.join(return_type[:-1],' ')
+ socketcall_id = -1
+
+ pos_colon = syscall_func.find(':')
+ if pos_colon < 0:
+ syscall_name = syscall_func
+ else:
+ if pos_colon == 0 or pos_colon+1 >= len(syscall_func):
+ E("misplaced colon in '%s'" % line)
+ return
+
+ # now find if there is a socketcall_id for a dispatch-type syscall
+ # after the optional 2nd colon
+ pos_colon2 = syscall_func.find(':', pos_colon + 1)
+ if pos_colon2 < 0:
+ syscall_name = syscall_func[pos_colon+1:]
+ syscall_func = syscall_func[:pos_colon]
+ else:
+ if pos_colon2+1 >= len(syscall_func):
+ E("misplaced colon2 in '%s'" % line)
+ return
+ syscall_name = syscall_func[(pos_colon+1):pos_colon2]
+ socketcall_id = int(syscall_func[pos_colon2+1:])
+ syscall_func = syscall_func[:pos_colon]
+
+ alias_delim = syscall_func.find('|')
+ if alias_delim > 0:
+ alias_list = syscall_func[alias_delim+1:].strip()
+ syscall_func = syscall_func[:alias_delim]
+ alias_delim = syscall_name.find('|')
+ if alias_delim > 0:
+ syscall_name = syscall_name[:alias_delim]
+ syscall_aliases = string.split(alias_list, ',')
+ else:
+ syscall_aliases = []
+
+ if pos_rparen > pos_lparen+1:
+ syscall_params = line[pos_lparen+1:pos_rparen].split(',')
+ params = string.join(syscall_params,',')
+ else:
+ syscall_params = []
+ params = "void"
+
+ t = {
+ "name" : syscall_name,
+ "func" : syscall_func,
+ "aliases" : syscall_aliases,
+ "params" : syscall_params,
+ "decl" : "%-15s %s (%s);" % (return_type, syscall_func, params),
+ "socketcall_id" : socketcall_id
+ }
+
+ # Parse the architecture list.
+ arch_list = line[pos_rparen+1:].strip()
+ if arch_list == "all":
+ for arch in all_arches:
+ t[arch] = True
+ else:
+ for arch in string.split(arch_list, ','):
+ if arch in all_arches:
+ t[arch] = True
+ else:
+ E("invalid syscall architecture '%s' in '%s'" % (arch, line))
+ return
+
+ self.syscalls.append(t)
+
+ logging.debug(t)
+
+
+ def parse_file(self, file_path):
+ logging.debug("parse_file: %s" % file_path)
+ fp = open(file_path)
+ for line in fp.xreadlines():
+ self.lineno += 1
+ line = line.strip()
+ if not line: continue
+ if line[0] == '#': continue
+ self.parse_line(line)
+
+ fp.close()
+
+
class State:
def __init__(self):
self.old_stubs = []
@@ -437,22 +560,22 @@
def gen_glibc_syscalls_h(self):
# TODO: generate a separate file for each architecture, like glibc's bits/syscall.h.
glibc_syscalls_h_path = "include/sys/glibc-syscalls.h"
- D("generating " + glibc_syscalls_h_path)
+ logging.info("generating " + glibc_syscalls_h_path)
glibc_fp = create_file(glibc_syscalls_h_path)
glibc_fp.write("/* %s */\n" % warning)
glibc_fp.write("#ifndef _BIONIC_GLIBC_SYSCALLS_H_\n")
glibc_fp.write("#define _BIONIC_GLIBC_SYSCALLS_H_\n")
glibc_fp.write("#if defined(__aarch64__)\n")
- self.scan_linux_unistd_h(glibc_fp, bionic_libc_root + "/kernel/uapi/asm-generic/unistd.h")
+ self.scan_linux_unistd_h(glibc_fp, os.path.join(bionic_libc_root, "kernel/uapi/asm-generic/unistd.h"))
glibc_fp.write("#elif defined(__arm__)\n")
- self.scan_linux_unistd_h(glibc_fp, bionic_libc_root + "/kernel/uapi/asm-arm/asm/unistd.h")
+ self.scan_linux_unistd_h(glibc_fp, os.path.join(bionic_libc_root, "kernel/uapi/asm-arm/asm/unistd.h"))
glibc_fp.write("#elif defined(__mips__)\n")
- self.scan_linux_unistd_h(glibc_fp, bionic_libc_root + "/kernel/uapi/asm-mips/asm/unistd.h")
+ self.scan_linux_unistd_h(glibc_fp, os.path.join(bionic_libc_root, "kernel/uapi/asm-mips/asm/unistd.h"))
glibc_fp.write("#elif defined(__i386__)\n")
- self.scan_linux_unistd_h(glibc_fp, bionic_libc_root + "/kernel/uapi/asm-x86/asm/unistd_32.h")
+ self.scan_linux_unistd_h(glibc_fp, os.path.join(bionic_libc_root, "kernel/uapi/asm-x86/asm/unistd_32.h"))
glibc_fp.write("#elif defined(__x86_64__)\n")
- self.scan_linux_unistd_h(glibc_fp, bionic_libc_root + "/kernel/uapi/asm-x86/asm/unistd_64.h")
+ self.scan_linux_unistd_h(glibc_fp, os.path.join(bionic_libc_root, "kernel/uapi/asm-x86/asm/unistd_64.h"))
glibc_fp.write("#endif\n")
glibc_fp.write("#endif /* _BIONIC_GLIBC_SYSCALLS_H_ */\n")
@@ -466,7 +589,7 @@
for arch in all_arches:
if syscall.has_key("asm-%s" % arch):
filename = "arch-%s/syscalls/%s.S" % (arch, syscall["func"])
- D2(">>> generating " + filename)
+ logging.info(">>> generating " + filename)
fp = create_file(filename)
fp.write(syscall["asm-%s" % arch])
fp.close()
@@ -474,48 +597,49 @@
def regenerate(self):
- D("scanning for existing architecture-specific stub files...")
-
- bionic_libc_root_len = len(bionic_libc_root)
+ logging.info("scanning for existing architecture-specific stub files...")
for arch in all_arches:
- arch_path = bionic_libc_root + "arch-" + arch
- D("scanning " + arch_path)
- files = glob.glob(arch_path + "/syscalls/*.S")
- for f in files:
- self.old_stubs.append(f[bionic_libc_root_len:])
+ arch_dir = "arch-" + arch
+ logging.info("scanning " + os.path.join(bionic_libc_root, arch_dir))
+ rel_path = os.path.join(arch_dir, "syscalls")
+ for file in os.listdir(os.path.join(bionic_libc_root, rel_path)):
+ if file.endswith(".S"):
+ self.old_stubs.append(os.path.join(rel_path, file))
- D("found %d stub files" % len(self.old_stubs))
+ logging.info("found %d stub files" % len(self.old_stubs))
if not os.path.exists(bionic_temp):
- D("creating %s..." % bionic_temp)
+ logging.info("creating %s..." % bionic_temp)
make_dir(bionic_temp)
- D("re-generating stubs and support files...")
+ logging.info("re-generating stubs and support files...")
self.gen_glibc_syscalls_h()
self.gen_syscall_stubs()
- D("comparing files...")
+ logging.info("comparing files...")
adds = []
edits = []
for stub in self.new_stubs + self.other_files:
- if not os.path.exists(bionic_libc_root + stub):
+ tmp_file = os.path.join(bionic_temp, stub)
+ libc_file = os.path.join(bionic_libc_root, stub)
+ if not os.path.exists(libc_file):
# new file, git add it
- D("new file: " + stub)
- adds.append(bionic_libc_root + stub)
- shutil.copyfile(bionic_temp + stub, bionic_libc_root + stub)
+ logging.info("new file: " + stub)
+ adds.append(libc_file)
+ shutil.copyfile(tmp_file, libc_file)
- elif not filecmp.cmp(bionic_temp + stub, bionic_libc_root + stub):
- D("changed file: " + stub)
+ elif not filecmp.cmp(tmp_file, libc_file):
+ logging.info("changed file: " + stub)
edits.append(stub)
deletes = []
for stub in self.old_stubs:
if not stub in self.new_stubs:
- D("deleted file: " + stub)
- deletes.append(bionic_libc_root + stub)
+ logging.info("deleted file: " + stub)
+ deletes.append(os.path.join(bionic_libc_root, stub))
if not DRY_RUN:
if adds:
@@ -524,18 +648,19 @@
commands.getoutput("git rm " + " ".join(deletes))
if edits:
for file in edits:
- shutil.copyfile(bionic_temp + file, bionic_libc_root + file)
- commands.getoutput("git add " + " ".join((bionic_libc_root + file) for file in edits))
+ shutil.copyfile(os.path.join(bionic_temp, file),
+ os.path.join(bionic_libc_root, file))
+ commands.getoutput("git add " + " ".join((os.path.join(bionic_libc_root, file)) for file in edits))
- commands.getoutput("git add %s%s" % (bionic_libc_root,"SYSCALLS.TXT"))
+ commands.getoutput("git add %s" % (os.path.join(bionic_libc_root, "SYSCALLS.TXT")))
if (not adds) and (not deletes) and (not edits):
- D("no changes detected!")
+ logging.info("no changes detected!")
else:
- D("ready to go!!")
+ logging.info("ready to go!!")
-D_setlevel(1)
+logging.basicConfig(level=logging.INFO)
state = State()
-state.process_file(bionic_libc_root+"SYSCALLS.TXT")
+state.process_file(os.path.join(bionic_libc_root, "SYSCALLS.TXT"))
state.regenerate()
diff --git a/libc/tools/posix-2013.txt b/libc/tools/posix-2013.txt
new file mode 100644
index 0000000..6972c81
--- /dev/null
+++ b/libc/tools/posix-2013.txt
@@ -0,0 +1,1191 @@
+FD_CLR
+FD_ISSET
+FD_SET
+FD_ZERO
+_Exit
+_exit
+_longjmp
+_setjmp
+_tolower
+_toupper
+a64l
+abort
+abs
+accept
+access
+acosf
+acoshf
+acosh
+acoshl
+acos
+acosl
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_write
+alarm
+alphasort
+asctime
+asctime_r
+asinf
+asinhf
+asinh
+asinhl
+asin
+asinl
+assert
+atan2f
+atan2
+atan2l
+atanf
+atanhf
+atanh
+atanhl
+atan
+atanl
+atexit
+atof
+atoi
+atol
+atoll
+basename
+bind
+bsearch
+btowc
+cabsf
+cabs
+cabsl
+cacosf
+cacoshf
+cacosh
+cacoshl
+cacos
+cacosl
+calloc
+cargf
+carg
+cargl
+casinf
+casinhf
+casinh
+casinhl
+casin
+casinl
+catanf
+catanhf
+catanh
+catanhl
+catan
+catanl
+catclose
+catgets
+catopen
+cbrtf
+cbrt
+cbrtl
+ccosf
+ccoshf
+ccosh
+ccoshl
+ccos
+ccosl
+ceilf
+ceil
+ceill
+cexpf
+cexp
+cexpl
+cfgetispeed
+cfgetospeed
+cfsetispeed
+cfsetospeed
+chdir
+chmod
+chown
+cimagf
+cimag
+cimagl
+clearerr
+clock_getcpuclockid
+clock_getres
+clock_gettime
+clock
+clock_nanosleep
+clock_settime
+clogf
+clog
+clogl
+closedir
+close
+closelog
+confstr
+conjf
+conj
+conjl
+connect
+copysignf
+copysign
+copysignl
+cosf
+coshf
+cosh
+coshl
+cos
+cosl
+cpowf
+cpow
+cpowl
+cprojf
+cproj
+cprojl
+crealf
+creal
+creall
+creat
+crypt
+csinf
+csinhf
+csinh
+csinhl
+csin
+csinl
+csqrtf
+csqrt
+csqrtl
+ctanf
+ctanhf
+ctanh
+ctanhl
+ctan
+ctanl
+ctermid
+ctime
+ctime_r
+daylight
+dbm_clearerr
+dbm_close
+dbm_delete
+dbm_error
+dbm_fetch
+dbm_firstkey
+dbm_nextkey
+dbm_open
+dbm_store
+difftime
+dirfd
+dirname
+div
+dlclose
+dlerror
+dlopen
+dlsym
+dprintf
+drand48
+dup2
+dup
+duplocale
+encrypt
+endgrent
+endhostent
+endnetent
+endprotoent
+endpwent
+endservent
+endutxent
+environ
+erand48
+erfcf
+erfc
+erfcl
+erff
+erf
+erfl
+errno
+execle
+execl
+execlp
+execve
+execv
+execvp
+exit
+exp2f
+exp2
+exp2l
+expf
+exp
+expl
+expm1f
+expm1
+expm1l
+fabsf
+fabs
+fabsl
+faccessat
+fattach
+fchdir
+fchmodat
+fchmod
+fchownat
+fchown
+fclose
+fcntl
+fdatasync
+fdetach
+fdimf
+fdim
+fdiml
+fdopendir
+fdopen
+feclearexcept
+fegetenv
+fegetexceptflag
+fegetround
+feholdexcept
+feof
+feraiseexcept
+ferror
+fesetenv
+fesetexceptflag
+fesetround
+fetestexcept
+feupdateenv
+fexecve
+fflush
+ffs
+fgetc
+fgetpos
+fgets
+fgetwc
+fgetws
+fileno
+flockfile
+floorf
+floor
+floorl
+fmaf
+fma
+fmal
+fmaxf
+fmax
+fmaxl
+fmemopen
+fminf
+fmin
+fminl
+fmodf
+fmod
+fmodl
+fmtmsg
+fnmatch
+fopen
+fork
+fpathconf
+fpclassify
+fprintf
+fputc
+fputs
+fputwc
+fputws
+fread
+freeaddrinfo
+free
+freelocale
+freopen
+frexpf
+frexp
+frexpl
+fscanf
+fseek
+fseeko
+fsetpos
+fstatat
+fstat
+fstatvfs
+fsync
+ftell
+ftello
+ftok
+ftruncate
+ftrylockfile
+ftw
+funlockfile
+futimens
+fwide
+fwprintf
+fwrite
+fwscanf
+gai_strerror
+getaddrinfo
+getchar
+getchar_unlocked
+getc
+getc_unlocked
+getcwd
+getdate_err
+getdate
+getdelim
+getegid
+getenv
+geteuid
+getgid
+getgrent
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgroups
+gethostent
+gethostid
+gethostname
+getitimer
+getline
+getlogin
+getlogin_r
+getmsg
+getnameinfo
+getnetbyaddr
+getnetbyname
+getnetent
+getopt
+getpeername
+getpgid
+getpgrp
+getpid
+getpmsg
+getppid
+getpriority
+getprotobyname
+getprotobynumber
+getprotoent
+getpwent
+getpwnam
+getpwnam_r
+getpwuid
+getpwuid_r
+getrlimit
+getrusage
+getservbyname
+getservbyport
+getservent
+gets
+getsid
+getsockname
+getsockopt
+getsubopt
+gettimeofday
+getuid
+getutxent
+getutxid
+getutxline
+getwchar
+getwc
+globfree
+glob
+gmtime
+gmtime_r
+grantpt
+hcreate
+hdestroy
+hsearch
+htonl
+htons
+hypotf
+hypot
+hypotl
+iconv_close
+iconv
+iconv_open
+if_freenameindex
+if_indextoname
+if_nameindex
+if_nametoindex
+ilogbf
+ilogb
+ilogbl
+imaxabs
+imaxdiv
+inet_addr
+inet_ntoa
+inet_ntop
+inet_pton
+initstate
+insque
+ioctl
+isalnum
+isalnum_l
+isalpha
+isalpha_l
+isascii
+isastream
+isatty
+isblank
+isblank_l
+iscntrl
+iscntrl_l
+isdigit
+isdigit_l
+isfinite
+isgraph
+isgraph_l
+isgreaterequal
+isgreater
+isinf
+islessequal
+islessgreater
+isless
+islower
+islower_l
+isnan
+isnormal
+isprint
+isprint_l
+ispunct
+ispunct_l
+isspace
+isspace_l
+isunordered
+isupper
+isupper_l
+iswalnum
+iswalnum_l
+iswalpha
+iswalpha_l
+iswblank
+iswblank_l
+iswcntrl
+iswcntrl_l
+iswctype
+iswctype_l
+iswdigit
+iswdigit_l
+iswgraph
+iswgraph_l
+iswlower
+iswlower_l
+iswprint
+iswprint_l
+iswpunct
+iswpunct_l
+iswspace
+iswspace_l
+iswupper
+iswupper_l
+iswxdigit
+iswxdigit_l
+isxdigit
+isxdigit_l
+j0
+j1
+jn
+jrand48
+kill
+killpg
+l64a
+labs
+lchown
+lcong48
+ldexpf
+ldexp
+ldexpl
+ldiv
+lfind
+lgammaf
+lgamma
+lgammal
+linkat
+link
+lio_listio
+listen
+llabs
+lldiv
+llrintf
+llrint
+llrintl
+llroundf
+llround
+llroundl
+localeconv
+localtime
+localtime_r
+lockf
+log10f
+log10
+log10l
+log1pf
+log1p
+log1pl
+log2f
+log2
+log2l
+logbf
+logb
+logbl
+logf
+log
+logl
+longjmp
+lrand48
+lrintf
+lrint
+lrintl
+lroundf
+lround
+lroundl
+lsearch
+lseek
+lstat
+malloc
+mblen
+mbrlen
+mbrtowc
+mbsinit
+mbsnrtowcs
+mbsrtowcs
+mbstowcs
+mbtowc
+memccpy
+memchr
+memcmp
+memcpy
+memmove
+memset
+mkdirat
+mkdir
+mkdtemp
+mkfifoat
+mkfifo
+mknodat
+mknod
+mkstemp
+mktime
+mlockall
+mlock
+mmap
+modff
+modf
+modfl
+mprotect
+mq_close
+mq_getattr
+mq_notify
+mq_open
+mq_receive
+mq_send
+mq_setattr
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mrand48
+msgctl
+msgget
+msgrcv
+msgsnd
+msync
+munlockall
+munlock
+munmap
+nanf
+nan
+nanl
+nanosleep
+nearbyintf
+nearbyint
+nearbyintl
+newlocale
+nextafterf
+nextafter
+nextafterl
+nexttowardf
+nexttoward
+nexttowardl
+nftw
+nice
+nl_langinfo
+nl_langinfo_l
+nrand48
+ntohl
+ntohs
+openat
+opendir
+open
+openlog
+open_memstream
+open_wmemstream
+optarg
+opterr
+optind
+optopt
+pathconf
+pause
+pclose
+perror
+pipe
+poll
+popen
+posix_fadvise
+posix_fallocate
+posix_madvise
+posix_memalign
+posix_mem_offset
+posix_openpt
+posix_spawnattr_destroy
+posix_spawnattr_getflags
+posix_spawnattr_getpgroup
+posix_spawnattr_getschedparam
+posix_spawnattr_getschedpolicy
+posix_spawnattr_getsigdefault
+posix_spawnattr_getsigmask
+posix_spawnattr_init
+posix_spawnattr_setflags
+posix_spawnattr_setpgroup
+posix_spawnattr_setschedparam
+posix_spawnattr_setschedpolicy
+posix_spawnattr_setsigdefault
+posix_spawnattr_setsigmask
+posix_spawn_file_actions_addclose
+posix_spawn_file_actions_adddup2
+posix_spawn_file_actions_addopen
+posix_spawn_file_actions_destroy
+posix_spawn_file_actions_init
+posix_spawn
+posix_spawnp
+posix_trace_attr_destroy
+posix_trace_attr_getclockres
+posix_trace_attr_getcreatetime
+posix_trace_attr_getgenversion
+posix_trace_attr_getinherited
+posix_trace_attr_getlogfullpolicy
+posix_trace_attr_getlogsize
+posix_trace_attr_getmaxdatasize
+posix_trace_attr_getmaxsystemeventsize
+posix_trace_attr_getmaxusereventsize
+posix_trace_attr_getname
+posix_trace_attr_getstreamfullpolicy
+posix_trace_attr_getstreamsize
+posix_trace_attr_init
+posix_trace_attr_setinherited
+posix_trace_attr_setlogfullpolicy
+posix_trace_attr_setlogsize
+posix_trace_attr_setmaxdatasize
+posix_trace_attr_setname
+posix_trace_attr_setstreamfullpolicy
+posix_trace_attr_setstreamsize
+posix_trace_clear
+posix_trace_close
+posix_trace_create
+posix_trace_create_withlog
+posix_trace_event
+posix_trace_eventid_equal
+posix_trace_eventid_get_name
+posix_trace_eventid_open
+posix_trace_eventset_add
+posix_trace_eventset_del
+posix_trace_eventset_empty
+posix_trace_eventset_fill
+posix_trace_eventset_ismember
+posix_trace_eventtypelist_getnext_id
+posix_trace_eventtypelist_rewind
+posix_trace_flush
+posix_trace_get_attr
+posix_trace_get_filter
+posix_trace_getnext_event
+posix_trace_get_status
+posix_trace_open
+posix_trace_rewind
+posix_trace_set_filter
+posix_trace_shutdown
+posix_trace_start
+posix_trace_stop
+posix_trace_timedgetnext_event
+posix_trace_trid_eventid_open
+posix_trace_trygetnext_event
+posix_typed_mem_get_info
+posix_typed_mem_open
+powf
+pow
+powl
+pread
+printf
+pselect
+psiginfo
+psignal
+pthread_atfork
+pthread_attr_destroy
+pthread_attr_getdetachstate
+pthread_attr_getguardsize
+pthread_attr_getinheritsched
+pthread_attr_getschedparam
+pthread_attr_getschedpolicy
+pthread_attr_getscope
+pthread_attr_getstack
+pthread_attr_getstacksize
+pthread_attr_init
+pthread_attr_setdetachstate
+pthread_attr_setguardsize
+pthread_attr_setinheritsched
+pthread_attr_setschedparam
+pthread_attr_setschedpolicy
+pthread_attr_setscope
+pthread_attr_setstack
+pthread_attr_setstacksize
+pthread_barrierattr_destroy
+pthread_barrierattr_getpshared
+pthread_barrierattr_init
+pthread_barrierattr_setpshared
+pthread_barrier_destroy
+pthread_barrier_init
+pthread_barrier_wait
+pthread_cancel
+pthread_cleanup_pop
+pthread_cleanup_push
+pthread_condattr_destroy
+pthread_condattr_getclock
+pthread_condattr_getpshared
+pthread_condattr_init
+pthread_condattr_setclock
+pthread_condattr_setpshared
+pthread_cond_broadcast
+pthread_cond_destroy
+pthread_cond_init
+pthread_cond_signal
+pthread_cond_timedwait
+pthread_cond_wait
+pthread_create
+pthread_detach
+pthread_equal
+pthread_exit
+pthread_getconcurrency
+pthread_getcpuclockid
+pthread_getschedparam
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_kill
+pthread_mutexattr_destroy
+pthread_mutexattr_getprioceiling
+pthread_mutexattr_getprotocol
+pthread_mutexattr_getpshared
+pthread_mutexattr_getrobust
+pthread_mutexattr_gettype
+pthread_mutexattr_init
+pthread_mutexattr_setprioceiling
+pthread_mutexattr_setprotocol
+pthread_mutexattr_setpshared
+pthread_mutexattr_setrobust
+pthread_mutexattr_settype
+pthread_mutex_consistent
+pthread_mutex_destroy
+pthread_mutex_getprioceiling
+pthread_mutex_init
+pthread_mutex_lock
+pthread_mutex_setprioceiling
+pthread_mutex_timedlock
+pthread_mutex_trylock
+pthread_mutex_unlock
+pthread_once
+pthread_rwlockattr_destroy
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_init
+pthread_rwlockattr_setpshared
+pthread_rwlock_destroy
+pthread_rwlock_init
+pthread_rwlock_rdlock
+pthread_rwlock_timedrdlock
+pthread_rwlock_timedwrlock
+pthread_rwlock_tryrdlock
+pthread_rwlock_trywrlock
+pthread_rwlock_unlock
+pthread_rwlock_wrlock
+pthread_self
+pthread_setcancelstate
+pthread_setcanceltype
+pthread_setconcurrency
+pthread_setschedparam
+pthread_setschedprio
+pthread_setspecific
+pthread_sigmask
+pthread_spin_destroy
+pthread_spin_init
+pthread_spin_lock
+pthread_spin_trylock
+pthread_spin_unlock
+pthread_testcancel
+ptsname
+putchar
+putchar_unlocked
+putc
+putc_unlocked
+putenv
+putmsg
+putpmsg
+puts
+pututxline
+putwchar
+putwc
+pwrite
+qsort
+raise
+rand
+random
+rand_r
+readdir
+readdir_r
+read
+readlinkat
+readlink
+readv
+realloc
+realpath
+recvfrom
+recv
+recvmsg
+regcomp
+regerror
+regexec
+regfree
+remainderf
+remainder
+remainderl
+remove
+remque
+remquof
+remquo
+remquol
+renameat
+rename
+rewinddir
+rewind
+rintf
+rint
+rintl
+rmdir
+roundf
+round
+roundl
+scalblnf
+scalbln
+scalblnl
+scalbnf
+scalbn
+scalbnl
+scandir
+scanf
+sched_getparam
+sched_get_priority_max
+sched_get_priority_min
+sched_getscheduler
+sched_rr_get_interval
+sched_setparam
+sched_setscheduler
+sched_yield
+seed48
+seekdir
+select
+sem_close
+semctl
+sem_destroy
+semget
+sem_getvalue
+sem_init
+sem_open
+semop
+sem_post
+sem_timedwait
+sem_trywait
+sem_unlink
+sem_wait
+send
+sendmsg
+sendto
+setbuf
+setegid
+setenv
+seteuid
+setgid
+setgrent
+sethostent
+setitimer
+setjmp
+setkey
+setlocale
+setlogmask
+setnetent
+setpgid
+setpgrp
+setpriority
+setprotoent
+setpwent
+setregid
+setreuid
+setrlimit
+setservent
+setsid
+setsockopt
+setstate
+setuid
+setutxent
+setvbuf
+shmat
+shmctl
+shmdt
+shmget
+shm_open
+shm_unlink
+shutdown
+sigaction
+sigaddset
+sigaltstack
+sigdelset
+sigemptyset
+sigfillset
+sighold
+sigignore
+siginterrupt
+sigismember
+siglongjmp
+signal
+signbit
+signgam
+sigpause
+sigpending
+sigprocmask
+sigqueue
+sigrelse
+sigset
+sigsetjmp
+sigsuspend
+sigtimedwait
+sigwait
+sigwaitinfo
+sinf
+sinhf
+sinh
+sinhl
+sin
+sinl
+sleep
+snprintf
+sockatmark
+socket
+socketpair
+sprintf
+sqrtf
+sqrt
+sqrtl
+srand48
+srand
+srandom
+sscanf
+stat
+statvfs
+stderr
+stdin
+stdout
+stpcpy
+stpncpy
+strcasecmp
+strcasecmp_l
+strcat
+strchr
+strcmp
+strcoll
+strcoll_l
+strcpy
+strcspn
+strdup
+strerror
+strerror_l
+strerror_r
+strfmon
+strfmon_l
+strftime
+strftime_l
+strlen
+strncasecmp
+strncasecmp_l
+strncat
+strncmp
+strncpy
+strndup
+strnlen
+strpbrk
+strptime
+strrchr
+strsignal
+strspn
+strstr
+strtod
+strtof
+strtoimax
+strtok
+strtok_r
+strtold
+strtol
+strtoll
+strtoul
+strtoull
+strtoumax
+strxfrm
+strxfrm_l
+swab
+swprintf
+swscanf
+symlinkat
+symlink
+sync
+sysconf
+syslog
+system
+tanf
+tanhf
+tanh
+tanhl
+tan
+tanl
+tcdrain
+tcflow
+tcflush
+tcgetattr
+tcgetpgrp
+tcgetsid
+tcsendbreak
+tcsetattr
+tcsetpgrp
+tdelete
+telldir
+tempnam
+tfind
+tgammaf
+tgamma
+tgammal
+time
+timer_create
+timer_delete
+timer_getoverrun
+timer_gettime
+timer_settime
+times
+timezone
+tmpfile
+tmpnam
+toascii
+tolower
+tolower_l
+toupper
+toupper_l
+towctrans
+towctrans_l
+towlower
+towlower_l
+towupper
+towupper_l
+truncate
+truncf
+trunc
+truncl
+tsearch
+ttyname
+ttyname_r
+twalk
+tzname
+tzset
+ulimit
+umask
+uname
+ungetc
+ungetwc
+unlinkat
+unlink
+unlockpt
+unsetenv
+uselocale
+utime
+utimensat
+utimes
+va_arg
+va_copy
+va_end
+va_start
+vdprintf
+vfprintf
+vfscanf
+vfwprintf
+vfwscanf
+vprintf
+vscanf
+vsnprintf
+vsprintf
+vsscanf
+vswprintf
+vswscanf
+vwprintf
+vwscanf
+wait
+waitid
+waitpid
+wcpcpy
+wcpncpy
+wcrtomb
+wcscasecmp
+wcscasecmp_l
+wcscat
+wcschr
+wcscmp
+wcscoll
+wcscoll_l
+wcscpy
+wcscspn
+wcsdup
+wcsftime
+wcslen
+wcsncasecmp
+wcsncasecmp_l
+wcsncat
+wcsncmp
+wcsncpy
+wcsnlen
+wcsnrtombs
+wcspbrk
+wcsrchr
+wcsrtombs
+wcsspn
+wcsstr
+wcstod
+wcstof
+wcstoimax
+wcstok
+wcstold
+wcstol
+wcstoll
+wcstombs
+wcstoul
+wcstoull
+wcstoumax
+wcswidth
+wcsxfrm
+wcsxfrm_l
+wctob
+wctomb
+wctrans
+wctrans_l
+wctype
+wctype_l
+wcwidth
+wmemchr
+wmemcmp
+wmemcpy
+wmemmove
+wmemset
+wordexp
+wordfree
+wprintf
+write
+writev
+wscanf
+y0
+y1
+yn
diff --git a/libc/tzcode/asctime.c b/libc/tzcode/asctime.c
index 152b0db..fea24e4 100644
--- a/libc/tzcode/asctime.c
+++ b/libc/tzcode/asctime.c
@@ -103,7 +103,7 @@
/*
** We avoid using snprintf since it's not available on all systems.
*/
- (void) sprintf(result,
+ (void) snprintf(result, sizeof(result), /* Android change: use snprintf. */
((strlen(year) <= 4) ? ASCTIME_FMT : ASCTIME_FMT_B),
wn, mn,
timeptr->tm_mday, timeptr->tm_hour,
diff --git a/libc/tzcode/localtime.c b/libc/tzcode/localtime.c
index 28d13f4..29f605c 100644
--- a/libc/tzcode/localtime.c
+++ b/libc/tzcode/localtime.c
@@ -1257,6 +1257,7 @@
lclptr->ttis[0].tt_gmtoff = 0;
lclptr->ttis[0].tt_abbrind = 0;
(void) strcpy(lclptr->chars, gmt);
+ lclptr->defaulttype = 0;
} else if (tzload(name, lclptr, TRUE) != 0)
if (name[0] == ':' || tzparse(name, lclptr, FALSE) != 0)
(void) gmtload(lclptr);
diff --git a/libc/upstream-freebsd/android/include/freebsd-compat.h b/libc/upstream-freebsd/android/include/freebsd-compat.h
index d5f1425..7acdf7c 100644
--- a/libc/upstream-freebsd/android/include/freebsd-compat.h
+++ b/libc/upstream-freebsd/android/include/freebsd-compat.h
@@ -17,7 +17,7 @@
#ifndef _BIONIC_FREEBSD_COMPAT_H_included
#define _BIONIC_FREEBSD_COMPAT_H_included
-#define __USE_BSD
+#define _BSD_SOURCE
#define REPLACE_GETOPT
/*
@@ -38,17 +38,6 @@
#define __usleep usleep
/* Redirect internal C library calls to the public function. */
-#define _close close
-#define _fcntl fcntl
-#define _fstat fstat
#define _nanosleep nanosleep
-#define _open open
-
-/* This one is only needed as long as we have a mix of OpenBSD and FreeBSD stdio. */
-#define _sseek __sseek
-
-/* This is in BSD's <stdlib.h>. */
-#include <stdint.h>
-extern uint32_t arc4random_uniform(uint32_t upper_bound);
#endif
diff --git a/libc/upstream-freebsd/android/include/libc_private.h b/libc/upstream-freebsd/android/include/libc_private.h
deleted file mode 100644
index c6a6433..0000000
--- a/libc/upstream-freebsd/android/include/libc_private.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _BIONIC_FREEBSD_LIBC_PRIVATE_H_included
-#define _BIONIC_FREEBSD_LIBC_PRIVATE_H_included
-
-#define STDIO_THREAD_LOCK() /* TODO: until we have the FreeBSD findfp.c, this is useless. */
-#define STDIO_THREAD_UNLOCK() /* TODO: until we have the FreeBSD findfp.c, this is useless. */
-
-#define ORIENT(fp, o) /* Only needed for wide-character stream support. */
-
-#endif
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/getopt_long.c b/libc/upstream-freebsd/lib/libc/stdlib/getopt_long.c
index 9f7f6d5..9534a2a 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/getopt_long.c
+++ b/libc/upstream-freebsd/lib/libc/stdlib/getopt_long.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getopt_long.c,v 1.22 2006/10/04 21:29:04 jmc Exp $ */
+/* $OpenBSD: getopt_long.c,v 1.26 2013/06/08 22:47:56 millert Exp $ */
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
/*
@@ -248,7 +248,7 @@
if (short_too && current_argv_len == 1)
continue;
- if (match == -1) /* first partial match */
+ if (match == -1) /* first partial match */
match = i;
else if ((flags & FLAG_LONGONLY) ||
long_options[i].has_arg !=
@@ -359,37 +359,31 @@
{
char *oli; /* option letter list index */
int optchar, short_too;
- int posixly_correct; /* no static, can be changed on the fly */
+ static int posixly_correct = -1;
if (options == NULL)
return (-1);
/*
- * Disable GNU extensions if POSIXLY_CORRECT is set or options
- * string begins with a '+'.
- */
- posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
-#ifdef GNU_COMPATIBLE
- if (*options == '-')
- flags |= FLAG_ALLARGS;
- else if (posixly_correct || *options == '+')
- flags &= ~FLAG_PERMUTE;
-#else
- if (posixly_correct || *options == '+')
- flags &= ~FLAG_PERMUTE;
- else if (*options == '-')
- flags |= FLAG_ALLARGS;
-#endif
- if (*options == '+' || *options == '-')
- options++;
-
- /*
* XXX Some GNU programs (like cvs) set optind to 0 instead of
* XXX using optreset. Work around this braindamage.
*/
if (optind == 0)
optind = optreset = 1;
+ /*
+ * Disable GNU extensions if POSIXLY_CORRECT is set or options
+ * string begins with a '+'.
+ */
+ if (posixly_correct == -1 || optreset)
+ posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
+ if (*options == '-')
+ flags |= FLAG_ALLARGS;
+ else if (posixly_correct || *options == '+')
+ flags &= ~FLAG_PERMUTE;
+ if (*options == '+' || *options == '-')
+ options++;
+
optarg = NULL;
if (optreset)
nonopt_start = nonopt_end = -1;
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/realpath.c b/libc/upstream-freebsd/lib/libc/stdlib/realpath.c
index 8fd5457..c4bd953 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/realpath.c
+++ b/libc/upstream-freebsd/lib/libc/stdlib/realpath.c
@@ -132,26 +132,7 @@
resolved[resolved_len] = '\0';
}
if (next_token[0] == '\0') {
- /*
- * Handle consequential slashes. The path
- * before slash shall point to a directory.
- *
- * Only the trailing slashes are not covered
- * by other checks in the loop, but we verify
- * the prefix for any (rare) "//" or "/\0"
- * occurence to not implement lookahead.
- */
- if (lstat(resolved, &sb) != 0) {
- if (m)
- free(resolved);
- return (NULL);
- }
- if (!S_ISDIR(sb.st_mode)) {
- if (m)
- free(resolved);
- errno = ENOTDIR;
- return (NULL);
- }
+ /* Handle consequential slashes. */
continue;
}
else if (strcmp(next_token, ".") == 0)
@@ -236,6 +217,11 @@
}
}
left_len = strlcpy(left, symlink, sizeof(left));
+ } else if (!S_ISDIR(sb.st_mode) && p != NULL) {
+ if (m)
+ free(resolved);
+ errno = ENOTDIR;
+ return (NULL);
}
}
diff --git a/libc/upstream-netbsd/android/include/namespace.h b/libc/upstream-netbsd/android/include/namespace.h
index 5df543c..630ea9b 100644
--- a/libc/upstream-netbsd/android/include/namespace.h
+++ b/libc/upstream-netbsd/android/include/namespace.h
@@ -17,11 +17,6 @@
#ifndef _BIONIC_NETBSD_NAMESPACE_H_included
#define _BIONIC_NETBSD_NAMESPACE_H_included
-// NetBSD uses __weak_alias on a lot of functions. We don't want that.
-#if defined(__weak_alias)
-#undef __weak_alias
-#endif
-
__LIBC_HIDDEN__ int __res_enable_mt(void);
__LIBC_HIDDEN__ int __res_disable_mt(void);
diff --git a/libc/upstream-netbsd/android/include/netbsd-compat.h b/libc/upstream-netbsd/android/include/netbsd-compat.h
index 84be931..04bc728 100644
--- a/libc/upstream-netbsd/android/include/netbsd-compat.h
+++ b/libc/upstream-netbsd/android/include/netbsd-compat.h
@@ -17,6 +17,9 @@
#ifndef _BIONIC_NETBSD_COMPAT_H_included
#define _BIONIC_NETBSD_COMPAT_H_included
+#define _BSD_SOURCE
+#define _GNU_SOURCE
+
// NetBSD uses _DIAGASSERT to null-check arguments and the like.
#include <assert.h>
#define _DIAGASSERT(e) ((e) ? (void) 0 : __assert2(__FILE__, __LINE__, __func__, #e))
@@ -24,9 +27,6 @@
// TODO: update our <sys/cdefs.h> to support this properly.
#define __type_fit(t, a) (0 == 0)
-#define _GNU_SOURCE
-#define __USE_BSD
-
// TODO: we don't yet have thread-safe environment variables.
#define __readlockenv() 0
#define __unlockenv() 0
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/lcong48.c b/libc/upstream-netbsd/lib/libc/stdlib/lcong48.c
new file mode 100644
index 0000000..42ce979
--- /dev/null
+++ b/libc/upstream-netbsd/lib/libc/stdlib/lcong48.c
@@ -0,0 +1,43 @@
+/* $NetBSD: lcong48.c,v 1.8 2005/06/12 05:21:28 lukem Exp $ */
+
+/*
+ * Copyright (c) 1993 Martin Birgmeier
+ * All rights reserved.
+ *
+ * You may redistribute unmodified or modified versions of this source
+ * code provided that the above copyright notice and this and the
+ * following conditions are retained.
+ *
+ * This software is provided ``as is'', and comes with no warranties
+ * of any kind. I shall in no event be liable for anything that happens
+ * to anyone/anything when using this software.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: lcong48.c,v 1.8 2005/06/12 05:21:28 lukem Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <assert.h>
+
+#include "rand48.h"
+
+#ifdef __weak_alias
+__weak_alias(lcong48,_lcong48)
+#endif
+
+void
+lcong48(unsigned short p[7])
+{
+ _DIAGASSERT(p != NULL);
+
+ __rand48_seed[0] = p[0];
+ __rand48_seed[1] = p[1];
+ __rand48_seed[2] = p[2];
+ __rand48_mult[0] = p[3];
+ __rand48_mult[1] = p[4];
+ __rand48_mult[2] = p[5];
+ __rand48_add = p[6];
+}
diff --git a/libc/upstream-openbsd/android/include/openbsd-compat.h b/libc/upstream-openbsd/android/include/openbsd-compat.h
index 34ad2c5..8386ba5 100644
--- a/libc/upstream-openbsd/android/include/openbsd-compat.h
+++ b/libc/upstream-openbsd/android/include/openbsd-compat.h
@@ -17,10 +17,23 @@
#ifndef _BIONIC_OPENBSD_COMPAT_H_included
#define _BIONIC_OPENBSD_COMPAT_H_included
+#define _BSD_SOURCE
+
#include <sys/cdefs.h>
#include <stddef.h> // For size_t.
-#define __USE_BSD
+/* Redirect internal C library calls to the public function. */
+#define _err err
+#define _errx errx
+#define _verr verr
+#define _verrx verrx
+#define _vwarn vwarn
+#define _vwarnx vwarnx
+#define _warn warn
+#define _warnx warnx
+
+/* Ignore all __weak_alias in OpenBSD. */
+#define __weak_alias(alias,sym)
/* OpenBSD's <ctype.h> uses these names, which conflicted with stlport.
* Additionally, we changed the numeric/digit type from N to D for libcxx.
@@ -39,9 +52,16 @@
#define explicit_bzero(p, s) memset(p, 0, s)
+/* OpenBSD has these in <sys/param.h>, but "ALIGN" isn't something we want to reserve. */
+#define ALIGNBYTES (sizeof(uintptr_t) - 1)
+#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) &~ ALIGNBYTES)
+
/* We have OpenBSD's getentropy_linux.c, but we don't mention getentropy in any header. */
__LIBC_HIDDEN__ extern int getentropy(void*, size_t);
+/* OpenBSD has this as API, but we just use it internally. */
+__LIBC_HIDDEN__ void* reallocarray(void*, size_t, size_t);
+
/* LP32 NDK ctype.h contained references to these. */
__LIBC64_HIDDEN__ extern const short* _tolower_tab_;
__LIBC64_HIDDEN__ extern const short* _toupper_tab_;
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/compat-43/killpg.c
similarity index 80%
rename from libc/upstream-netbsd/lib/libc/unistd/killpg.c
rename to libc/upstream-openbsd/lib/libc/compat-43/killpg.c
index ceac3f4..75b1ad9 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/compat-43/killpg.c
@@ -1,8 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1989 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
@@ -29,15 +27,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/ldtoa.c b/libc/upstream-openbsd/lib/libc/gdtoa/ldtoa.c
index 793d71c..16f6f9c 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/ldtoa.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/ldtoa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldtoa.c,v 1.1 2008/09/07 20:36:08 martynas Exp $ */
+/* $OpenBSD: ldtoa.c,v 1.2 2014/08/10 02:15:18 guenther Exp $ */
/*-
* Copyright (c) 2003 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
@@ -30,7 +30,7 @@
#include <machine/ieee.h>
#endif /* !__vax__ */
#include <float.h>
-#include <inttypes.h>
+#include <stdint.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/gen/daemon.c
similarity index 73%
copy from libc/upstream-netbsd/lib/libc/unistd/killpg.c
copy to libc/upstream-openbsd/lib/libc/gen/daemon.c
index ceac3f4..79f4264 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/gen/daemon.c
@@ -1,7 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
+/* $OpenBSD: daemon.c,v 1.7 2010/07/27 22:29:09 marco 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
@@ -29,28 +28,37 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
+#include <fcntl.h>
+#include <paths.h>
+#include <unistd.h>
+#include <stdlib.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-
-/*
- * Backwards-compatible killpg().
- */
int
-killpg(pid_t pgid, int sig)
+daemon(int nochdir, int noclose)
{
- if (pgid == 1) {
- errno = ESRCH;
+ int fd;
+
+ switch (fork()) {
+ case -1:
return (-1);
+ case 0:
+ break;
+ default:
+ _exit(0);
}
- return (kill(-pgid, sig));
+
+ if (setsid() == -1)
+ return (-1);
+
+ if (!nochdir)
+ (void)chdir("/");
+
+ if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
+ (void)dup2(fd, STDIN_FILENO);
+ (void)dup2(fd, STDOUT_FILENO);
+ (void)dup2(fd, STDERR_FILENO);
+ if (fd > 2)
+ (void)close(fd);
+ }
+ return (0);
}
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/gen/err.c
similarity index 73%
copy from libc/upstream-netbsd/lib/libc/unistd/killpg.c
copy to libc/upstream-openbsd/lib/libc/gen/err.c
index ceac3f4..e7ec29d 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/gen/err.c
@@ -1,7 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
+/* $OpenBSD: err.c,v 1.11 2012/12/05 23:19:59 deraadt Exp $ */
+/*-
+ * Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,28 +28,20 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
+#include <err.h>
+#include <stdarg.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-
-/*
- * Backwards-compatible killpg().
- */
-int
-killpg(pid_t pgid, int sig)
+/* PRINTFLIKE2 */
+__dead void
+_err(int eval, const char *fmt, ...)
{
- if (pgid == 1) {
- errno = ESRCH;
- return (-1);
- }
- return (kill(-pgid, sig));
+ va_list ap;
+
+ va_start(ap, fmt);
+ _verr(eval, fmt, ap);
+ va_end(ap);
}
+
+/* PRINTFLIKE2 */
+__weak_alias(err, _err);
+
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/gen/errx.c
similarity index 73%
copy from libc/upstream-netbsd/lib/libc/unistd/killpg.c
copy to libc/upstream-openbsd/lib/libc/gen/errx.c
index ceac3f4..d213435 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/gen/errx.c
@@ -1,7 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
+/* $OpenBSD: errx.c,v 1.10 2012/12/05 23:19:59 deraadt Exp $ */
+/*-
+ * Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,28 +28,20 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
+#include <err.h>
+#include <stdarg.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-
-/*
- * Backwards-compatible killpg().
- */
-int
-killpg(pid_t pgid, int sig)
+/* PRINTFLIKE2 */
+__dead void
+_errx(int eval, const char *fmt, ...)
{
- if (pgid == 1) {
- errno = ESRCH;
- return (-1);
- }
- return (kill(-pgid, sig));
+ va_list ap;
+
+ va_start(ap, fmt);
+ _verrx(eval, fmt, ap);
+ va_end(ap);
}
+
+/* PRINTFLIKE2 */
+__weak_alias(errx, _errx);
+
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/gen/verr.c
similarity index 73%
copy from libc/upstream-netbsd/lib/libc/unistd/killpg.c
copy to libc/upstream-openbsd/lib/libc/gen/verr.c
index ceac3f4..dcd8edc 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/gen/verr.c
@@ -1,7 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
+/* $OpenBSD: verr.c,v 1.9 2012/12/05 23:20:00 deraadt Exp $ */
+/*-
+ * Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,28 +28,29 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <signal.h>
+#include <err.h>
#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
-/*
- * Backwards-compatible killpg().
- */
-int
-killpg(pid_t pgid, int sig)
+extern char *__progname; /* Program name, from crt0. */
+
+__dead void
+_verr(int eval, const char *fmt, va_list ap)
{
- if (pgid == 1) {
- errno = ESRCH;
- return (-1);
+ int sverrno;
+
+ sverrno = errno;
+ (void)fprintf(stderr, "%s: ", __progname);
+ if (fmt != NULL) {
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, ": ");
}
- return (kill(-pgid, sig));
+ (void)fprintf(stderr, "%s\n", strerror(sverrno));
+ exit(eval);
}
+
+__weak_alias(verr, _verr);
+
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/gen/verrx.c
similarity index 73%
copy from libc/upstream-netbsd/lib/libc/unistd/killpg.c
copy to libc/upstream-openbsd/lib/libc/gen/verrx.c
index ceac3f4..60da062 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/gen/verrx.c
@@ -1,7 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
+/* $OpenBSD: verrx.c,v 1.9 2012/12/05 23:20:00 deraadt Exp $ */
+/*-
+ * Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,28 +28,22 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
+extern char *__progname; /* Program name, from crt0. */
-/*
- * Backwards-compatible killpg().
- */
-int
-killpg(pid_t pgid, int sig)
+__dead void
+_verrx(int eval, const char *fmt, va_list ap)
{
- if (pgid == 1) {
- errno = ESRCH;
- return (-1);
- }
- return (kill(-pgid, sig));
+ (void)fprintf(stderr, "%s: ", __progname);
+ if (fmt != NULL)
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, "\n");
+ exit(eval);
}
+
+__weak_alias(verrx, _verrx);
+
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/gen/vwarn.c
similarity index 74%
copy from libc/upstream-netbsd/lib/libc/unistd/killpg.c
copy to libc/upstream-openbsd/lib/libc/gen/vwarn.c
index ceac3f4..26b60f3 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/gen/vwarn.c
@@ -1,7 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
+/* $OpenBSD: vwarn.c,v 1.9 2012/12/05 23:20:00 deraadt Exp $ */
+/*-
+ * Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,28 +28,27 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <signal.h>
+#include <err.h>
#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
-/*
- * Backwards-compatible killpg().
- */
-int
-killpg(pid_t pgid, int sig)
+extern char *__progname; /* Program name, from crt0. */
+
+void
+_vwarn(const char *fmt, va_list ap)
{
- if (pgid == 1) {
- errno = ESRCH;
- return (-1);
+ int sverrno;
+
+ sverrno = errno;
+ (void)fprintf(stderr, "%s: ", __progname);
+ if (fmt != NULL) {
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, ": ");
}
- return (kill(-pgid, sig));
+ (void)fprintf(stderr, "%s\n", strerror(sverrno));
}
+
+__weak_alias(vwarn, _vwarn);
+
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/gen/vwarnx.c
similarity index 73%
copy from libc/upstream-netbsd/lib/libc/unistd/killpg.c
copy to libc/upstream-openbsd/lib/libc/gen/vwarnx.c
index ceac3f4..e6b1957 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/gen/vwarnx.c
@@ -1,7 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
+/* $OpenBSD: vwarnx.c,v 1.9 2012/12/05 23:20:00 deraadt Exp $ */
+/*-
+ * Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,28 +28,20 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
+#include <err.h>
+#include <stdio.h>
+#include <stdarg.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
+extern char *__progname; /* Program name, from crt0. */
-/*
- * Backwards-compatible killpg().
- */
-int
-killpg(pid_t pgid, int sig)
+void
+_vwarnx(const char *fmt, va_list ap)
{
- if (pgid == 1) {
- errno = ESRCH;
- return (-1);
- }
- return (kill(-pgid, sig));
+ (void)fprintf(stderr, "%s: ", __progname);
+ if (fmt != NULL)
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, "\n");
}
+
+__weak_alias(vwarnx, _vwarnx);
+
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/gen/warn.c
similarity index 73%
copy from libc/upstream-netbsd/lib/libc/unistd/killpg.c
copy to libc/upstream-openbsd/lib/libc/gen/warn.c
index ceac3f4..c1b47a6 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/gen/warn.c
@@ -1,7 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
+/* $OpenBSD: warn.c,v 1.10 2012/12/05 23:20:00 deraadt Exp $ */
+/*-
+ * Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,28 +28,20 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
+#include <err.h>
+#include <stdarg.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-
-/*
- * Backwards-compatible killpg().
- */
-int
-killpg(pid_t pgid, int sig)
+/* PRINTFLIKE1 */
+void
+_warn(const char *fmt, ...)
{
- if (pgid == 1) {
- errno = ESRCH;
- return (-1);
- }
- return (kill(-pgid, sig));
+ va_list ap;
+
+ va_start(ap, fmt);
+ _vwarn(fmt, ap);
+ va_end(ap);
}
+
+/* PRINTFLIKE1 */
+__weak_alias(warn, _warn);
+
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/gen/warnx.c
similarity index 73%
copy from libc/upstream-netbsd/lib/libc/unistd/killpg.c
copy to libc/upstream-openbsd/lib/libc/gen/warnx.c
index ceac3f4..af2ab66 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/gen/warnx.c
@@ -1,7 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
+/* $OpenBSD: warnx.c,v 1.9 2012/12/05 23:20:00 deraadt Exp $ */
+/*-
+ * Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,28 +28,20 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
+#include <err.h>
+#include <stdarg.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-
-/*
- * Backwards-compatible killpg().
- */
-int
-killpg(pid_t pgid, int sig)
+/* PRINTFLIKE1 */
+void
+_warnx(const char *fmt, ...)
{
- if (pgid == 1) {
- errno = ESRCH;
- return (-1);
- }
- return (kill(-pgid, sig));
+ va_list ap;
+
+ va_start(ap, fmt);
+ _vwarnx(fmt, ap);
+ va_end(ap);
}
+
+/* PRINTFLIKE1 */
+__weak_alias(warnx, _warnx);
+
diff --git a/libc/upstream-openbsd/lib/libc/net/htonl.c b/libc/upstream-openbsd/lib/libc/net/htonl.c
index 5ab4189..6ee6e7e 100644
--- a/libc/upstream-openbsd/lib/libc/net/htonl.c
+++ b/libc/upstream-openbsd/lib/libc/net/htonl.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: htonl.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: htonl.c,v 1.7 2014/07/21 01:51:10 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef htonl
diff --git a/libc/upstream-openbsd/lib/libc/net/htons.c b/libc/upstream-openbsd/lib/libc/net/htons.c
index c8b73fd..f48d91e 100644
--- a/libc/upstream-openbsd/lib/libc/net/htons.c
+++ b/libc/upstream-openbsd/lib/libc/net/htons.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: htons.c,v 1.8 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: htons.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef htons
diff --git a/libc/upstream-openbsd/lib/libc/net/ntohl.c b/libc/upstream-openbsd/lib/libc/net/ntohl.c
index 36414b7..0d05bac 100644
--- a/libc/upstream-openbsd/lib/libc/net/ntohl.c
+++ b/libc/upstream-openbsd/lib/libc/net/ntohl.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: ntohl.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: ntohl.c,v 1.7 2014/07/21 01:51:10 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef ntohl
diff --git a/libc/upstream-openbsd/lib/libc/net/ntohs.c b/libc/upstream-openbsd/lib/libc/net/ntohs.c
index 8f345e8..b5ea361 100644
--- a/libc/upstream-openbsd/lib/libc/net/ntohs.c
+++ b/libc/upstream-openbsd/lib/libc/net/ntohs.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: ntohs.c,v 1.8 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: ntohs.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef ntohs
diff --git a/libc/upstream-openbsd/lib/libc/net/res_random.c b/libc/upstream-openbsd/lib/libc/net/res_random.c
new file mode 100644
index 0000000..f28692f
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/net/res_random.c
@@ -0,0 +1,275 @@
+/* $OpenBSD: res_random.c,v 1.21 2014/07/20 04:22:34 guenther Exp $ */
+
+/*
+ * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
+ * Copyright 2008 Damien Miller <djm@openbsd.org>
+ * All rights reserved.
+ *
+ * Theo de Raadt <deraadt@openbsd.org> came up with the idea of using
+ * such a mathematical system to generate more random (yet non-repeating)
+ * ids to solve the resolver/named problem. But Niels designed the
+ * actual system based on the constraints.
+ *
+ * Later modified by Damien Miller to wrap the LCG output in a 15-bit
+ * permutation generator based on a Luby-Rackoff block cipher. This
+ * ensures the output is non-repeating and preserves the MSB twiddle
+ * trick, but makes it more resistant to LCG prediction.
+ *
+ * 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.
+ */
+
+/*
+ * seed = random 15bit
+ * n = prime, g0 = generator to n,
+ * j = random so that gcd(j,n-1) == 1
+ * g = g0^j mod n will be a generator again.
+ *
+ * X[0] = random seed.
+ * X[n] = a*X[n-1]+b mod m is a Linear Congruential Generator
+ * with a = 7^(even random) mod m,
+ * b = random with gcd(b,m) == 1
+ * m = 31104 and a maximal period of m-1.
+ *
+ * The transaction id is determined by:
+ * id[n] = seed xor (g^X[n] mod n)
+ *
+ * Effectivly the id is restricted to the lower 15 bits, thus
+ * yielding two different cycles by toggling the msb on and off.
+ * This avoids reuse issues caused by reseeding.
+ *
+ * The output of this generator is then randomly permuted though a
+ * custom 15 bit Luby-Rackoff block cipher.
+ */
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <sys/time.h>
+#include <resolv.h>
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "thread_private.h"
+
+#define RU_OUT 180 /* Time after wich will be reseeded */
+#define RU_MAX 30000 /* Uniq cycle, avoid blackjack prediction */
+#define RU_GEN 2 /* Starting generator */
+#define RU_N 32749 /* RU_N-1 = 2*2*3*2729 */
+#define RU_AGEN 7 /* determine ru_a as RU_AGEN^(2*rand) */
+#define RU_M 31104 /* RU_M = 2^7*3^5 - don't change */
+#define RU_ROUNDS 11 /* Number of rounds for permute (odd) */
+
+struct prf_ctx {
+ /* PRF lookup table for odd rounds (7 bits input to 8 bits output) */
+ u_char prf7[(RU_ROUNDS / 2) * (1 << 7)];
+
+ /* PRF lookup table for even rounds (8 bits input to 7 bits output) */
+ u_char prf8[((RU_ROUNDS + 1) / 2) * (1 << 8)];
+};
+
+#define PFAC_N 3
+static const u_int16_t pfacts[PFAC_N] = {
+ 2,
+ 3,
+ 2729
+};
+
+static u_int16_t ru_x;
+static u_int16_t ru_seed, ru_seed2;
+static u_int16_t ru_a, ru_b;
+static u_int16_t ru_g;
+static u_int16_t ru_counter = 0;
+static u_int16_t ru_msb = 0;
+static struct prf_ctx *ru_prf = NULL;
+static time_t ru_reseed;
+
+static u_int16_t pmod(u_int16_t, u_int16_t, u_int16_t);
+static void res_initid(void);
+
+/*
+ * Do a fast modular exponation, returned value will be in the range
+ * of 0 - (mod-1)
+ */
+static u_int16_t
+pmod(u_int16_t gen, u_int16_t exp, u_int16_t mod)
+{
+ u_int16_t s, t, u;
+
+ s = 1;
+ t = gen;
+ u = exp;
+
+ while (u) {
+ if (u & 1)
+ s = (s * t) % mod;
+ u >>= 1;
+ t = (t * t) % mod;
+ }
+ return (s);
+}
+
+/*
+ * 15-bit permutation based on Luby-Rackoff block cipher
+ */
+static u_int
+permute15(u_int in)
+{
+ int i;
+ u_int left, right, tmp;
+
+ if (ru_prf == NULL)
+ return in;
+
+ left = (in >> 8) & 0x7f;
+ right = in & 0xff;
+
+ /*
+ * Each round swaps the width of left and right. Even rounds have
+ * a 7-bit left, odd rounds have an 8-bit left. Since this uses an
+ * odd number of rounds, left is always 8 bits wide at the end.
+ */
+ for (i = 0; i < RU_ROUNDS; i++) {
+ if ((i & 1) == 0)
+ tmp = ru_prf->prf8[(i << (8 - 1)) | right] & 0x7f;
+ else
+ tmp = ru_prf->prf7[((i - 1) << (7 - 1)) | right];
+ tmp ^= left;
+ left = right;
+ right = tmp;
+ }
+
+ return (right << 8) | left;
+}
+
+/*
+ * Initializes the seed and chooses a suitable generator. Also toggles
+ * the msb flag. The msb flag is used to generate two distinct
+ * cycles of random numbers and thus avoiding reuse of ids.
+ *
+ * This function is called from res_randomid() when needed, an
+ * application does not have to worry about it.
+ */
+static void
+res_initid(void)
+{
+ u_int16_t j, i;
+ u_int32_t tmp;
+ int noprime = 1;
+ struct timespec ts;
+
+ ru_x = arc4random_uniform(RU_M);
+
+ /* 15 bits of random seed */
+ tmp = arc4random();
+ ru_seed = (tmp >> 16) & 0x7FFF;
+ ru_seed2 = tmp & 0x7FFF;
+
+ /* Determine the LCG we use */
+ tmp = arc4random();
+ ru_b = (tmp & 0xfffe) | 1;
+ ru_a = pmod(RU_AGEN, (tmp >> 16) & 0xfffe, RU_M);
+ while (ru_b % 3 == 0)
+ ru_b += 2;
+
+ j = arc4random_uniform(RU_N);
+
+ /*
+ * Do a fast gcd(j,RU_N-1), so we can find a j with
+ * gcd(j, RU_N-1) == 1, giving a new generator for
+ * RU_GEN^j mod RU_N
+ */
+
+ while (noprime) {
+ for (i = 0; i < PFAC_N; i++)
+ if (j % pfacts[i] == 0)
+ break;
+
+ if (i >= PFAC_N)
+ noprime = 0;
+ else
+ j = (j + 1) % RU_N;
+ }
+
+ ru_g = pmod(RU_GEN, j, RU_N);
+ ru_counter = 0;
+
+ /* Initialise PRF for Luby-Rackoff permutation */
+ if (ru_prf == NULL)
+ ru_prf = malloc(sizeof(*ru_prf));
+ if (ru_prf != NULL)
+ arc4random_buf(ru_prf, sizeof(*ru_prf));
+
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ ru_reseed = ts.tv_sec + RU_OUT;
+ ru_msb = ru_msb == 0x8000 ? 0 : 0x8000;
+}
+
+u_int
+res_randomid(void)
+{
+ struct timespec ts;
+ u_int r;
+ _THREAD_PRIVATE_MUTEX(random);
+
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+
+ _THREAD_PRIVATE_MUTEX_LOCK(random);
+
+ if (ru_counter >= RU_MAX || ts.tv_sec > ru_reseed)
+ res_initid();
+
+ /* Linear Congruential Generator */
+ ru_x = (ru_a * ru_x + ru_b) % RU_M;
+ ru_counter++;
+
+ r = permute15(ru_seed ^ pmod(ru_g, ru_seed2 + ru_x, RU_N)) | ru_msb;
+
+ _THREAD_PRIVATE_MUTEX_UNLOCK(random);
+
+ return (r);
+}
+
+#if 0
+int
+main(int argc, char **argv)
+{
+ int i, n;
+ u_int16_t wert;
+
+ res_initid();
+
+ printf("Generator: %u\n", ru_g);
+ printf("Seed: %u\n", ru_seed);
+ printf("Reseed at %ld\n", ru_reseed);
+ printf("Ru_X: %u\n", ru_x);
+ printf("Ru_A: %u\n", ru_a);
+ printf("Ru_B: %u\n", ru_b);
+
+ n = argc > 1 ? atoi(argv[1]) : 60001;
+ for (i=0;i<n;i++) {
+ wert = res_randomid();
+ printf("%u\n", wert);
+ }
+ return 0;
+}
+#endif
+
diff --git a/libc/upstream-freebsd/lib/libc/stdio/fclose.c b/libc/upstream-openbsd/lib/libc/stdio/fclose.c
similarity index 75%
rename from libc/upstream-freebsd/lib/libc/stdio/fclose.c
rename to libc/upstream-openbsd/lib/libc/stdio/fclose.c
index 5ed8b2c..c72af54 100644
--- a/libc/upstream-freebsd/lib/libc/stdio/fclose.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fclose.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: fclose.c,v 1.9 2009/11/09 00:18:27 kurt Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,19 +31,9 @@
* SUCH DAMAGE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fclose.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "namespace.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include "un-namespace.h"
-#include <spinlock.h>
-#include "libc_private.h"
#include "local.h"
int
@@ -55,6 +46,7 @@
return (EOF);
}
FLOCKFILE(fp);
+ WCIO_FREE(fp);
r = fp->_flags & __SWR ? __sflush(fp) : 0;
if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
r = EOF;
@@ -64,22 +56,8 @@
FREEUB(fp);
if (HASLB(fp))
FREELB(fp);
- fp->_file = -1;
fp->_r = fp->_w = 0; /* Mess up if reaccessed. */
-
- /*
- * Lock the spinlock used to protect __sglue list walk in
- * __sfp(). The __sfp() uses fp->_flags == 0 test as an
- * indication of the unused FILE.
- *
- * Taking the lock prevents possible compiler or processor
- * reordering of the writes performed before the final _flags
- * cleanup, making sure that we are done with the FILE before
- * it is considered available.
- */
- STDIO_THREAD_LOCK();
fp->_flags = 0; /* Release this FILE for reuse. */
- STDIO_THREAD_UNLOCK();
FUNLOCKFILE(fp);
return (r);
}
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fdopen.c b/libc/upstream-openbsd/lib/libc/stdio/fdopen.c
index 3e47f2c..1c0c813 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fdopen.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fdopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fdopen.c,v 1.6 2008/04/21 12:28:35 otto Exp $ */
+/* $OpenBSD: fdopen.c,v 1.7 2014/08/31 02:21:18 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -66,6 +66,7 @@
if ((fp = __sfp()) == NULL)
return (NULL);
fp->_flags = flags;
+
/*
* If opened for appending, but underlying descriptor does not have
* O_APPEND bit set, assert __SAPP so that __swrite() will lseek to
@@ -73,6 +74,13 @@
*/
if ((oflags & O_APPEND) && !(fdflags & O_APPEND))
fp->_flags |= __SAPP;
+
+ /*
+ * If close-on-exec was requested, then turn it on if not already
+ */
+ if ((oflags & O_CLOEXEC) && !((tmp = fcntl(fd, F_GETFD)) & FD_CLOEXEC))
+ fcntl(fd, F_SETFD, tmp | FD_CLOEXEC);
+
fp->_file = fd;
fp->_cookie = fp;
fp->_read = __sread;
diff --git a/libc/upstream-freebsd/lib/libc/stdio/flags.c b/libc/upstream-openbsd/lib/libc/stdio/flags.c
similarity index 77%
rename from libc/upstream-freebsd/lib/libc/stdio/flags.c
rename to libc/upstream-openbsd/lib/libc/stdio/flags.c
index 1878c2f..d6df6da 100644
--- a/libc/upstream-freebsd/lib/libc/stdio/flags.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/flags.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: flags.c,v 1.8 2014/08/31 02:21:18 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,22 +31,15 @@
* SUCH DAMAGE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)flags.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/types.h>
#include <sys/file.h>
#include <stdio.h>
#include <errno.h>
-
#include "local.h"
/*
* Return the (stdio) flags for a given mode. Store the flags
- * to be passed to an _open() syscall through *optr.
+ * to be passed to an open() syscall through *optr.
* Return 0 on error.
*/
int
@@ -78,34 +72,33 @@
return (0);
}
- /* 'b' (binary) is ignored */
- if (*mode == 'b')
- mode++;
-
- /* [rwa][b]\+ means read and write */
- if (*mode == '+') {
- mode++;
- ret = __SRW;
- m = O_RDWR;
- }
-
- /* 'b' (binary) can appear here, too -- and is ignored again */
- if (*mode == 'b')
- mode++;
-
- /* 'x' means exclusive (fail if the file exists) */
- if (*mode == 'x') {
- mode++;
- if (m == O_RDONLY) {
+ while (*mode != '\0')
+ switch (*mode++) {
+ case 'b':
+ break;
+ case '+':
+ ret = __SRW;
+ m = O_RDWR;
+ break;
+ case 'e':
+ o |= O_CLOEXEC;
+ break;
+ case 'x':
+ if (o & O_CREAT)
+ o |= O_EXCL;
+ break;
+ default:
+ /*
+ * Lots of software passes other extension mode
+ * letters, like Window's 't'
+ */
+#if 0
errno = EINVAL;
return (0);
+#else
+ break;
+#endif
}
- o |= O_EXCL;
- }
-
- /* set close-on-exec */
- if (*mode == 'e')
- o |= O_CLOEXEC;
*optr = m | o;
return (ret);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fmemopen.c b/libc/upstream-openbsd/lib/libc/stdio/fmemopen.c
new file mode 100644
index 0000000..8cda047
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/stdio/fmemopen.c
@@ -0,0 +1,183 @@
+/* $OpenBSD: fmemopen.c,v 1.2 2013/03/27 15:06:25 mpi Exp $ */
+
+/*
+ * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
+ * Copyright (c) 2009 Ted Unangst
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "local.h"
+
+struct state {
+ char *string; /* actual stream */
+ size_t pos; /* current position */
+ size_t size; /* allocated size */
+ size_t len; /* length of the data */
+ int update; /* open for update */
+};
+
+static int
+fmemopen_read(void *v, char *b, int l)
+{
+ struct state *st = v;
+ int i;
+
+ for (i = 0; i < l && i + st->pos < st->len; i++)
+ b[i] = st->string[st->pos + i];
+ st->pos += i;
+
+ return (i);
+}
+
+static int
+fmemopen_write(void *v, const char *b, int l)
+{
+ struct state *st = v;
+ int i;
+
+ for (i = 0; i < l && i + st->pos < st->size; i++)
+ st->string[st->pos + i] = b[i];
+ st->pos += i;
+
+ if (st->pos >= st->len) {
+ st->len = st->pos;
+
+ if (st->len < st->size)
+ st->string[st->len] = '\0';
+ else if (!st->update)
+ st->string[st->size - 1] = '\0';
+ }
+
+ return (i);
+}
+
+static fpos_t
+fmemopen_seek(void *v, fpos_t off, int whence)
+{
+ struct state *st = v;
+ ssize_t base = 0;
+
+ switch (whence) {
+ case SEEK_SET:
+ break;
+ case SEEK_CUR:
+ base = st->pos;
+ break;
+ case SEEK_END:
+ base = st->len;
+ break;
+ }
+
+ if (off > st->size - base || off < -base) {
+ errno = EOVERFLOW;
+ return (-1);
+ }
+
+ st->pos = base + off;
+
+ return (st->pos);
+}
+
+static int
+fmemopen_close(void *v)
+{
+ free(v);
+
+ return (0);
+}
+
+static int
+fmemopen_close_free(void *v)
+{
+ struct state *st = v;
+
+ free(st->string);
+ free(st);
+
+ return (0);
+}
+
+FILE *
+fmemopen(void *buf, size_t size, const char *mode)
+{
+ struct state *st;
+ FILE *fp;
+ int flags, oflags;
+
+ if (size == 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if ((flags = __sflags(mode, &oflags)) == 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if (buf == NULL && ((oflags & O_RDWR) == 0)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if ((st = malloc(sizeof(*st))) == NULL)
+ return (NULL);
+
+ if ((fp = __sfp()) == NULL) {
+ free(st);
+ return (NULL);
+ }
+
+ st->pos = 0;
+ st->len = (oflags & O_WRONLY) ? 0 : size;
+ st->size = size;
+ st->update = oflags & O_RDWR;
+
+ if (buf == NULL) {
+ if ((st->string = malloc(size)) == NULL) {
+ free(st);
+ fp->_flags = 0;
+ return (NULL);
+ }
+ *st->string = '\0';
+ } else {
+ st->string = (char *)buf;
+
+ if (oflags & O_TRUNC)
+ *st->string = '\0';
+
+ if (oflags & O_APPEND) {
+ char *p;
+
+ if ((p = memchr(st->string, '\0', size)) != NULL)
+ st->pos = st->len = (p - st->string);
+ else
+ st->pos = st->len = size;
+ }
+ }
+
+ fp->_flags = (short)flags;
+ fp->_file = -1;
+ fp->_cookie = (void *)st;
+ fp->_read = (flags & __SWR) ? NULL : fmemopen_read;
+ fp->_write = (flags & __SRD) ? NULL : fmemopen_write;
+ fp->_seek = fmemopen_seek;
+ fp->_close = (buf == NULL) ? fmemopen_close_free : fmemopen_close;
+
+ return (fp);
+}
diff --git a/libc/upstream-freebsd/lib/libc/stdio/fopen.c b/libc/upstream-openbsd/lib/libc/stdio/fopen.c
similarity index 79%
rename from libc/upstream-freebsd/lib/libc/stdio/fopen.c
rename to libc/upstream-openbsd/lib/libc/stdio/fopen.c
index b08e336..1465052 100644
--- a/libc/upstream-freebsd/lib/libc/stdio/fopen.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fopen.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: fopen.c,v 1.7 2008/05/03 18:46:41 chl Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,26 +31,17 @@
* SUCH DAMAGE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fopen.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "namespace.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
+#include <limits.h>
#include <stdio.h>
#include <errno.h>
-#include <limits.h>
-#include "un-namespace.h"
-
+#include <unistd.h>
#include "local.h"
FILE *
-fopen(const char * __restrict file, const char * __restrict mode)
+fopen(const char *file, const char *mode)
{
FILE *fp;
int f;
@@ -59,23 +51,19 @@
return (NULL);
if ((fp = __sfp()) == NULL)
return (NULL);
- if ((f = _open(file, oflags, DEFFILEMODE)) < 0) {
+ if ((f = open(file, oflags, DEFFILEMODE)) < 0) {
fp->_flags = 0; /* release */
return (NULL);
}
- /*
- * File descriptors are a full int, but _file is only a short.
- * If we get a valid file descriptor that is greater than
- * SHRT_MAX, then the fd will get sign-extended into an
- * invalid file descriptor. Handle this case by failing the
- * open.
- */
+
+ /* _file is only a short */
if (f > SHRT_MAX) {
fp->_flags = 0; /* release */
- _close(f);
+ close(f);
errno = EMFILE;
return (NULL);
}
+
fp->_file = f;
fp->_flags = flags;
fp->_cookie = fp;
@@ -83,6 +71,7 @@
fp->_write = __swrite;
fp->_seek = __sseek;
fp->_close = __sclose;
+
/*
* When opening in append mode, even though we use O_APPEND,
* we need to seek to the end so that ftell() gets the right
@@ -92,6 +81,6 @@
* fseek and ftell.)
*/
if (oflags & O_APPEND)
- (void)_sseek(fp, (fpos_t)0, SEEK_END);
+ (void) __sseek((void *)fp, (fpos_t)0, SEEK_END);
return (fp);
}
diff --git a/libc/upstream-openbsd/lib/libc/stdio/freopen.c b/libc/upstream-openbsd/lib/libc/stdio/freopen.c
index 3158fb1..82717b1 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/freopen.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/freopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: freopen.c,v 1.13 2009/11/09 00:18:27 kurt Exp $ */
+/* $OpenBSD: freopen.c,v 1.14 2014/08/31 02:21:18 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -134,7 +134,7 @@
* assume stderr is always fd STDERR_FILENO, even if being freopen'd.
*/
if (wantfd >= 0 && f != wantfd) {
- if (dup2(f, wantfd) >= 0) {
+ if (dup3(f, wantfd, oflags & O_CLOEXEC) >= 0) {
(void) close(f);
f = wantfd;
}
diff --git a/libc/upstream-openbsd/lib/libc/stdio/mktemp.c b/libc/upstream-openbsd/lib/libc/stdio/mktemp.c
index cb154c4..2a17e52 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/mktemp.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/mktemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mktemp.c,v 1.33 2014/05/06 22:55:27 millert Exp $ */
+/* $OpenBSD: mktemp.c,v 1.34 2014/08/31 02:21:18 guenther Exp $ */
/*
* Copyright (c) 1996-1998, 2008 Theo de Raadt
* Copyright (c) 1997, 2008-2009 Todd C. Miller
@@ -35,12 +35,14 @@
#define NUM_CHARS (sizeof(TEMPCHARS) - 1)
#define MIN_X 6
+#define MKOTEMP_FLAGS (O_APPEND | O_CLOEXEC | O_DSYNC | O_RSYNC | O_SYNC)
+
#ifndef nitems
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
#endif
static int
-mktemp_internal(char *path, int slen, int mode)
+mktemp_internal(char *path, int slen, int mode, int flags)
{
char *start, *cp, *ep;
const char *tempchars = TEMPCHARS;
@@ -63,6 +65,12 @@
return(-1);
}
+ if (flags & ~MKOTEMP_FLAGS) {
+ errno = EINVAL;
+ return(-1);
+ }
+ flags |= O_CREAT | O_EXCL | O_RDWR;
+
tries = INT_MAX;
do {
cp = start;
@@ -85,7 +93,7 @@
return(errno == ENOENT ? 0 : -1);
break;
case MKTEMP_FILE:
- fd = open(path, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR);
+ fd = open(path, flags, S_IRUSR|S_IWUSR);
if (fd != -1 || errno != EEXIST)
return(fd);
break;
@@ -107,7 +115,7 @@
char *
_mktemp(char *path)
{
- if (mktemp_internal(path, 0, MKTEMP_NAME) == -1)
+ if (mktemp_internal(path, 0, MKTEMP_NAME, 0) == -1)
return(NULL);
return(path);
}
@@ -122,15 +130,27 @@
}
int
+mkostemps(char *path, int slen, int flags)
+{
+ return(mktemp_internal(path, slen, MKTEMP_FILE, flags));
+}
+
+int
mkstemp(char *path)
{
- return(mktemp_internal(path, 0, MKTEMP_FILE));
+ return(mktemp_internal(path, 0, MKTEMP_FILE, 0));
+}
+
+int
+mkostemp(char *path, int flags)
+{
+ return(mktemp_internal(path, 0, MKTEMP_FILE, flags));
}
int
mkstemps(char *path, int slen)
{
- return(mktemp_internal(path, slen, MKTEMP_FILE));
+ return(mktemp_internal(path, slen, MKTEMP_FILE, 0));
}
char *
@@ -138,6 +158,6 @@
{
int error;
- error = mktemp_internal(path, 0, MKTEMP_DIR);
+ error = mktemp_internal(path, 0, MKTEMP_DIR, 0);
return(error ? NULL : path);
}
diff --git a/libc/upstream-openbsd/lib/libc/stdio/open_memstream.c b/libc/upstream-openbsd/lib/libc/stdio/open_memstream.c
new file mode 100644
index 0000000..4610535
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/stdio/open_memstream.c
@@ -0,0 +1,158 @@
+/* $OpenBSD: open_memstream.c,v 1.3 2013/04/03 03:11:53 guenther Exp $ */
+
+/*
+ * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/param.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "local.h"
+
+struct state {
+ char *string; /* actual stream */
+ char **pbuf; /* point to the stream */
+ size_t *psize; /* point to min(pos, len) */
+ size_t pos; /* current position */
+ size_t size; /* number of allocated char */
+ size_t len; /* length of the data */
+};
+
+static int
+memstream_write(void *v, const char *b, int l)
+{
+ struct state *st = v;
+ char *p;
+ size_t i, end;
+
+ end = (st->pos + l);
+
+ if (end >= st->size) {
+ /* 1.6 is (very) close to the golden ratio. */
+ size_t sz = st->size * 8 / 5;
+
+ if (sz < end + 1)
+ sz = end + 1;
+ p = realloc(st->string, sz);
+ if (!p)
+ return (-1);
+ bzero(p + st->size, sz - st->size);
+ *st->pbuf = st->string = p;
+ st->size = sz;
+ }
+
+ for (i = 0; i < l; i++)
+ st->string[st->pos + i] = b[i];
+ st->pos += l;
+
+ if (st->pos > st->len) {
+ st->len = st->pos;
+ st->string[st->len] = '\0';
+ }
+
+ *st->psize = st->pos;
+
+ return (i);
+}
+
+static fpos_t
+memstream_seek(void *v, fpos_t off, int whence)
+{
+ struct state *st = v;
+ ssize_t base = 0;
+
+ switch (whence) {
+ case SEEK_SET:
+ break;
+ case SEEK_CUR:
+ base = st->pos;
+ break;
+ case SEEK_END:
+ base = st->len;
+ break;
+ }
+
+ if (off > SIZE_MAX - base || off < -base) {
+ errno = EOVERFLOW;
+ return (-1);
+ }
+
+ st->pos = base + off;
+ *st->psize = MIN(st->pos, st->len);
+
+ return (st->pos);
+}
+
+static int
+memstream_close(void *v)
+{
+ struct state *st = v;
+
+ free(st);
+
+ return (0);
+}
+
+FILE *
+open_memstream(char **pbuf, size_t *psize)
+{
+ struct state *st;
+ FILE *fp;
+
+ if (pbuf == NULL || psize == NULL) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if ((st = malloc(sizeof(*st))) == NULL)
+ return (NULL);
+
+ if ((fp = __sfp()) == NULL) {
+ free(st);
+ return (NULL);
+ }
+
+ st->size = BUFSIZ;
+ if ((st->string = calloc(1, st->size)) == NULL) {
+ free(st);
+ fp->_flags = 0;
+ return (NULL);
+ }
+
+ *st->string = '\0';
+ st->pos = 0;
+ st->len = 0;
+ st->pbuf = pbuf;
+ st->psize = psize;
+
+ *pbuf = st->string;
+ *psize = st->len;
+
+ fp->_flags = __SWR;
+ fp->_file = -1;
+ fp->_cookie = st;
+ fp->_read = NULL;
+ fp->_write = memstream_write;
+ fp->_seek = memstream_seek;
+ fp->_close = memstream_close;
+ _SET_ORIENTATION(fp, -1);
+
+ return (fp);
+}
diff --git a/libc/upstream-openbsd/lib/libc/stdio/open_wmemstream.c b/libc/upstream-openbsd/lib/libc/stdio/open_wmemstream.c
new file mode 100644
index 0000000..9414187
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/stdio/open_wmemstream.c
@@ -0,0 +1,169 @@
+/* $OpenBSD: open_wmemstream.c,v 1.3 2014/03/06 07:28:21 gerhard Exp $ */
+
+/*
+ * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/param.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+#include "local.h"
+
+struct state {
+ wchar_t *string; /* actual stream */
+ wchar_t **pbuf; /* point to the stream */
+ size_t *psize; /* point to min(pos, len) */
+ size_t pos; /* current position */
+ size_t size; /* number of allocated wchar_t */
+ size_t len; /* length of the data */
+ mbstate_t mbs; /* conversion state of the stream */
+};
+
+static int
+wmemstream_write(void *v, const char *b, int l)
+{
+ struct state *st = v;
+ wchar_t *p;
+ size_t nmc, len, end;
+
+ end = (st->pos + l);
+
+ if (end >= st->size) {
+ /* 1.6 is (very) close to the golden ratio. */
+ size_t sz = st->size * 8 / 5;
+
+ if (sz < end + 1)
+ sz = end + 1;
+ p = realloc(st->string, sz * sizeof(wchar_t));
+ if (!p)
+ return (-1);
+ bzero(p + st->size, (sz - st->size) * sizeof(wchar_t));
+ *st->pbuf = st->string = p;
+ st->size = sz;
+ }
+
+ nmc = (st->size - st->pos) * sizeof(wchar_t);
+ len = mbsnrtowcs(st->string + st->pos, &b, nmc, l, &st->mbs);
+ if (len == (size_t)-1)
+ return (-1);
+ st->pos += len;
+
+ if (st->pos > st->len) {
+ st->len = st->pos;
+ st->string[st->len] = L'\0';
+ }
+
+ *st->psize = st->pos;
+
+ return (len);
+}
+
+static fpos_t
+wmemstream_seek(void *v, fpos_t off, int whence)
+{
+ struct state *st = v;
+ ssize_t base = 0;
+
+ switch (whence) {
+ case SEEK_SET:
+ break;
+ case SEEK_CUR:
+ base = st->pos;
+ break;
+ case SEEK_END:
+ base = st->len;
+ break;
+ }
+
+ if (off > (SIZE_MAX / sizeof(wchar_t)) - base || off < -base) {
+ errno = EOVERFLOW;
+ return (-1);
+ }
+
+ /*
+ * XXX Clearing mbs here invalidates shift state for state-
+ * dependent encodings, but they are not (yet) supported.
+ */
+ bzero(&st->mbs, sizeof(st->mbs));
+
+ st->pos = base + off;
+ *st->psize = MIN(st->pos, st->len);
+
+ return (st->pos);
+}
+
+static int
+wmemstream_close(void *v)
+{
+ struct state *st = v;
+
+ free(st);
+
+ return (0);
+}
+
+FILE *
+open_wmemstream(wchar_t **pbuf, size_t *psize)
+{
+ struct state *st;
+ FILE *fp;
+
+ if (pbuf == NULL || psize == NULL) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if ((st = malloc(sizeof(*st))) == NULL)
+ return (NULL);
+
+ if ((fp = __sfp()) == NULL) {
+ free(st);
+ return (NULL);
+ }
+
+ st->size = BUFSIZ * sizeof(wchar_t);
+ if ((st->string = calloc(1, st->size)) == NULL) {
+ free(st);
+ fp->_flags = 0;
+ return (NULL);
+ }
+
+ *st->string = L'\0';
+ st->pos = 0;
+ st->len = 0;
+ st->pbuf = pbuf;
+ st->psize = psize;
+ bzero(&st->mbs, sizeof(st->mbs));
+
+ *pbuf = st->string;
+ *psize = st->len;
+
+ fp->_flags = __SWR;
+ fp->_file = -1;
+ fp->_cookie = st;
+ fp->_read = NULL;
+ fp->_write = wmemstream_write;
+ fp->_seek = wmemstream_seek;
+ fp->_close = wmemstream_close;
+ _SET_ORIENTATION(fp, 1);
+
+ return (fp);
+}
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/insque.c b/libc/upstream-openbsd/lib/libc/stdlib/insque.c
similarity index 81%
rename from libc/upstream-netbsd/lib/libc/stdlib/insque.c
rename to libc/upstream-openbsd/lib/libc/stdlib/insque.c
index 09020ae..590ff83 100644
--- a/libc/upstream-netbsd/lib/libc/stdlib/insque.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/insque.c
@@ -1,7 +1,9 @@
+/* $OpenBSD: insque.c,v 1.3 2014/08/15 04:14:36 guenther Exp $ */
+
/*
* Copyright (c) 1993 John Brezak
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,7 +14,7 @@
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may 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
@@ -26,12 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: insque.c,v 1.3 2012/06/25 22:32:45 abs Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <assert.h>
+#include <stdlib.h>
#include <search.h>
struct qelem {
@@ -42,17 +39,16 @@
void
insque(void *entry, void *pred)
{
- struct qelem *e = (struct qelem *) entry;
- struct qelem *p = (struct qelem *) pred;
+ struct qelem *e = entry;
+ struct qelem *p = pred;
- _DIAGASSERT(e != 0);
-
- e->q_back = p;
- if (p) {
+ if (p == NULL)
+ e->q_forw = e->q_back = NULL;
+ else {
e->q_forw = p->q_forw;
- if (p->q_forw)
+ e->q_back = p;
+ if (p->q_forw != NULL)
p->q_forw->q_back = e;
p->q_forw = e;
- } else
- e->q_forw = 0;
+ }
}
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/reallocarray.c b/libc/upstream-openbsd/lib/libc/stdlib/reallocarray.c
new file mode 100644
index 0000000..7accd99
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/stdlib/reallocarray.c
@@ -0,0 +1,38 @@
+/* $OpenBSD: reallocarray.c,v 1.1 2014/05/08 21:43:49 deraadt Exp $ */
+/*
+ * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+/*
+ * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
+ * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
+ */
+#define MUL_NO_OVERFLOW (1UL << (sizeof(size_t) * 4))
+
+void *
+reallocarray(void *optr, size_t nmemb, size_t size)
+{
+ if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
+ nmemb > 0 && SIZE_MAX / nmemb < size) {
+ errno = ENOMEM;
+ return NULL;
+ }
+ return realloc(optr, size * nmemb);
+}
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/remque.c b/libc/upstream-openbsd/lib/libc/stdlib/remque.c
similarity index 84%
rename from libc/upstream-netbsd/lib/libc/stdlib/remque.c
rename to libc/upstream-openbsd/lib/libc/stdlib/remque.c
index 6060ad8..71b74b2 100644
--- a/libc/upstream-netbsd/lib/libc/stdlib/remque.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/remque.c
@@ -1,7 +1,9 @@
+/* $OpenBSD: remque.c,v 1.3 2014/08/15 04:14:36 guenther Exp $ */
+
/*
* Copyright (c) 1993 John Brezak
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,7 +14,7 @@
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may 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
@@ -26,12 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: remque.c,v 1.3 2012/06/25 22:32:45 abs Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <assert.h>
+#include <stdlib.h>
#include <search.h>
struct qelem {
@@ -42,12 +39,10 @@
void
remque(void *element)
{
- struct qelem *e = (struct qelem *) element;
+ struct qelem *e = element;
- _DIAGASSERT(e != 0);
-
- if (e->q_forw)
+ if (e->q_forw != NULL)
e->q_forw->q_back = e->q_back;
- if (e->q_back)
+ if (e->q_back != NULL)
e->q_back->q_forw = e->q_forw;
}
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/strtoimax.c b/libc/upstream-openbsd/lib/libc/stdlib/strtoimax.c
index 2c77f41..2fc04e4 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/strtoimax.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/strtoimax.c
@@ -1,6 +1,5 @@
-/* $OpenBSD: strtoimax.c,v 1.1 2006/01/13 17:58:09 millert Exp $ */
-
-/*-
+/* $OpenBSD: strtoimax.c,v 1.2 2014/09/13 20:10:12 schwarze Exp $ */
+/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
*
@@ -48,6 +47,17 @@
int neg, any, cutlim;
/*
+ * Ensure that base is between 2 and 36 inclusive, or the special
+ * value of 0.
+ */
+ if (base < 0 || base == 1 || base > 36) {
+ if (endptr != 0)
+ *endptr = (char *)nptr;
+ errno = EINVAL;
+ return 0;
+ }
+
+ /*
* Skip white space and pick up leading +/- sign if any.
* If base is 0, allow 0x for hex and 0 for octal, else
* assume decimal; if base is already 16, allow 0x.
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/strtol.c b/libc/upstream-openbsd/lib/libc/stdlib/strtol.c
index dc2cf88..86cec35 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/strtol.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/strtol.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: strtol.c,v 1.9 2013/04/17 17:40:35 tedu Exp $ */
-/*-
+/* $OpenBSD: strtol.c,v 1.10 2014/09/13 20:10:12 schwarze Exp $ */
+/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
@@ -33,7 +33,6 @@
#include <limits.h>
#include <stdlib.h>
-
/*
* Convert a string to a long integer.
*
@@ -52,7 +51,7 @@
* Ensure that base is between 2 and 36 inclusive, or the special
* value of 0.
*/
- if (base != 0 && (base < 2 || base > 36)) {
+ if (base < 0 || base == 1 || base > 36) {
if (endptr != 0)
*endptr = (char *)nptr;
errno = EINVAL;
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/strtoll.c b/libc/upstream-openbsd/lib/libc/stdlib/strtoll.c
index 4bcc556..cf82c8e 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/strtoll.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/strtoll.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: strtoll.c,v 1.7 2013/03/28 18:09:38 martynas Exp $ */
-/*-
+/* $OpenBSD: strtoll.c,v 1.8 2014/09/13 20:10:12 schwarze Exp $ */
+/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
*
@@ -50,6 +50,17 @@
int neg, any, cutlim;
/*
+ * Ensure that base is between 2 and 36 inclusive, or the special
+ * value of 0.
+ */
+ if (base < 0 || base == 1 || base > 36) {
+ if (endptr != 0)
+ *endptr = (char *)nptr;
+ errno = EINVAL;
+ return 0;
+ }
+
+ /*
* Skip white space and pick up leading +/- sign if any.
* If base is 0, allow 0x for hex and 0 for octal, else
* assume decimal; if base is already 16, allow 0x.
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/strtoul.c b/libc/upstream-openbsd/lib/libc/stdlib/strtoul.c
index a236365..2aa41b7 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/strtoul.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/strtoul.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: strtoul.c,v 1.8 2013/04/17 17:40:35 tedu Exp $ */
+/* $OpenBSD: strtoul.c,v 1.9 2014/09/13 20:10:12 schwarze Exp $ */
/*
- * Copyright (c) 1990 Regents of the University of California.
+ * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,13 @@
/*
* See strtol for comments as to the logic used.
*/
+ if (base < 0 || base == 1 || base > 36) {
+ if (endptr != 0)
+ *endptr = (char *)nptr;
+ errno = EINVAL;
+ return 0;
+ }
+
s = nptr;
do {
c = (unsigned char) *s++;
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/strtoull.c b/libc/upstream-openbsd/lib/libc/stdlib/strtoull.c
index 28f613a..8464176 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/strtoull.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/strtoull.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: strtoull.c,v 1.6 2013/03/28 18:09:38 martynas Exp $ */
-/*-
+/* $OpenBSD: strtoull.c,v 1.7 2014/09/13 20:10:12 schwarze Exp $ */
+/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
*
@@ -50,8 +50,15 @@
int neg, any, cutlim;
/*
- * See strtoq for comments as to the logic used.
+ * See strtoll for comments as to the logic used.
*/
+ if (base < 0 || base == 1 || base > 36) {
+ if (endptr != 0)
+ *endptr = (char *)nptr;
+ errno = EINVAL;
+ return 0;
+ }
+
s = nptr;
do {
c = (unsigned char) *s++;
@@ -59,7 +66,7 @@
if (c == '-') {
neg = 1;
c = *s++;
- } else {
+ } else {
neg = 0;
if (c == '+')
c = *s++;
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/strtoumax.c b/libc/upstream-openbsd/lib/libc/stdlib/strtoumax.c
index ce6e2c0..c73f7e5 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/strtoumax.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/strtoumax.c
@@ -1,6 +1,5 @@
-/* $OpenBSD: strtoumax.c,v 1.1 2006/01/13 17:58:09 millert Exp $ */
-
-/*-
+/* $OpenBSD: strtoumax.c,v 1.2 2014/09/13 20:10:12 schwarze Exp $ */
+/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
*
@@ -48,8 +47,15 @@
int neg, any, cutlim;
/*
- * See strtoq for comments as to the logic used.
+ * See strtoimax for comments as to the logic used.
*/
+ if (base < 0 || base == 1 || base > 36) {
+ if (endptr != 0)
+ *endptr = (char *)nptr;
+ errno = EINVAL;
+ return 0;
+ }
+
s = nptr;
do {
c = (unsigned char) *s++;
@@ -57,7 +63,7 @@
if (c == '-') {
neg = 1;
c = *s++;
- } else {
+ } else {
neg = 0;
if (c == '+')
c = *s++;
diff --git a/libdl/Android.mk b/libdl/Android.mk
index cb1cb7d..c9fca0e 100644
--- a/libdl/Android.mk
+++ b/libdl/Android.mk
@@ -23,6 +23,7 @@
LOCAL_SRC_FILES:= libdl.c
LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror
+LOCAL_CXX_STL := none
LOCAL_MODULE := libdl
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
@@ -36,3 +37,15 @@
LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_SHARED_LIBRARY)
+
+# A dummy libdl.a. Need for static executables using the LLVM unwinder. Most
+# functions default to failure, others use a sensible default (dl_iterate_phdr()
+# returns 0, as would happen if the user iterated over every phdr).
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES:= libdl.c
+LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror
+LOCAL_CXX_STL := none
+
+LOCAL_MODULE := libdl
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+include $(BUILD_STATIC_LIBRARY)
diff --git a/libm/Android.mk b/libm/Android.mk
index 994caa0..d4cd7c3 100644
--- a/libm/Android.mk
+++ b/libm/Android.mk
@@ -1,6 +1,8 @@
ifneq ($(TARGET_USE_PRIVATE_LIBM),true)
LOCAL_PATH:= $(call my-dir)
+bionic_coverage := false
+
# TODO: this comes from from upstream's libc, not libm, but it's an
# implementation detail that should have hidden visibility, so it needs
# to be in whatever library the math code is in.
@@ -16,6 +18,8 @@
upstream-freebsd/lib/msun/bsdsrc/b_exp.c \
upstream-freebsd/lib/msun/bsdsrc/b_log.c \
upstream-freebsd/lib/msun/bsdsrc/b_tgamma.c \
+ upstream-freebsd/lib/msun/src/catrig.c \
+ upstream-freebsd/lib/msun/src/catrigf.c \
upstream-freebsd/lib/msun/src/e_acos.c \
upstream-freebsd/lib/msun/src/e_acosf.c \
upstream-freebsd/lib/msun/src/e_acosh.c \
@@ -82,6 +86,7 @@
upstream-freebsd/lib/msun/src/s_atanf.c \
upstream-freebsd/lib/msun/src/s_carg.c \
upstream-freebsd/lib/msun/src/s_cargf.c \
+ upstream-freebsd/lib/msun/src/s_cargl.c \
upstream-freebsd/lib/msun/src/s_cbrt.c \
upstream-freebsd/lib/msun/src/s_cbrtf.c \
upstream-freebsd/lib/msun/src/s_ccosh.c \
@@ -92,20 +97,25 @@
upstream-freebsd/lib/msun/src/s_cexpf.c \
upstream-freebsd/lib/msun/src/s_cimag.c \
upstream-freebsd/lib/msun/src/s_cimagf.c \
+ upstream-freebsd/lib/msun/src/s_cimagl.c \
upstream-freebsd/lib/msun/src/s_conj.c \
upstream-freebsd/lib/msun/src/s_conjf.c \
+ upstream-freebsd/lib/msun/src/s_conjl.c \
upstream-freebsd/lib/msun/src/s_copysign.c \
upstream-freebsd/lib/msun/src/s_copysignf.c \
upstream-freebsd/lib/msun/src/s_cos.c \
upstream-freebsd/lib/msun/src/s_cosf.c \
upstream-freebsd/lib/msun/src/s_cproj.c \
upstream-freebsd/lib/msun/src/s_cprojf.c \
+ upstream-freebsd/lib/msun/src/s_cprojl.c \
upstream-freebsd/lib/msun/src/s_creal.c \
upstream-freebsd/lib/msun/src/s_crealf.c \
+ upstream-freebsd/lib/msun/src/s_creall.c \
upstream-freebsd/lib/msun/src/s_csinh.c \
upstream-freebsd/lib/msun/src/s_csinhf.c \
upstream-freebsd/lib/msun/src/s_csqrt.c \
upstream-freebsd/lib/msun/src/s_csqrtf.c \
+ upstream-freebsd/lib/msun/src/s_csqrtl.c \
upstream-freebsd/lib/msun/src/s_ctanh.c \
upstream-freebsd/lib/msun/src/s_ctanhf.c \
upstream-freebsd/lib/msun/src/s_erf.c \
@@ -172,6 +182,7 @@
upstream-freebsd/lib/msun/src/s_truncf.c \
upstream-freebsd/lib/msun/src/w_cabs.c \
upstream-freebsd/lib/msun/src/w_cabsf.c \
+ upstream-freebsd/lib/msun/src/w_cabsl.c \
upstream-freebsd/lib/msun/src/w_drem.c \
upstream-freebsd/lib/msun/src/w_dremf.c \
@@ -179,7 +190,7 @@
fake_long_double.c \
signbit.c \
-libm_ld_src_files = \
+libm_ld128_src_files = \
upstream-freebsd/lib/msun/src/e_acosl.c \
upstream-freebsd/lib/msun/src/e_acoshl.c \
upstream-freebsd/lib/msun/src/e_asinl.c \
@@ -187,6 +198,7 @@
upstream-freebsd/lib/msun/src/e_atanhl.c \
upstream-freebsd/lib/msun/src/e_fmodl.c \
upstream-freebsd/lib/msun/src/e_hypotl.c \
+ upstream-freebsd/lib/msun/src/e_lgammal.c \
upstream-freebsd/lib/msun/src/e_remainderl.c \
upstream-freebsd/lib/msun/src/e_sqrtl.c \
upstream-freebsd/lib/msun/src/s_asinhl.c \
@@ -194,6 +206,7 @@
upstream-freebsd/lib/msun/src/s_cbrtl.c \
upstream-freebsd/lib/msun/src/s_ceill.c \
upstream-freebsd/lib/msun/src/s_copysignl.c \
+ upstream-freebsd/lib/msun/src/e_coshl.c \
upstream-freebsd/lib/msun/src/s_cosl.c \
upstream-freebsd/lib/msun/src/s_fabsl.c \
upstream-freebsd/lib/msun/src/s_floorl.c \
@@ -215,15 +228,19 @@
upstream-freebsd/lib/msun/src/s_rintl.c \
upstream-freebsd/lib/msun/src/s_roundl.c \
upstream-freebsd/lib/msun/src/s_scalbnl.c \
+ upstream-freebsd/lib/msun/src/e_sinhl.c \
upstream-freebsd/lib/msun/src/s_sinl.c \
+ upstream-freebsd/lib/msun/src/s_tanhl.c \
upstream-freebsd/lib/msun/src/s_tanl.c \
upstream-freebsd/lib/msun/src/s_truncl.c \
-libm_ld_src_files += \
+libm_ld128_src_files += \
upstream-freebsd/lib/msun/ld128/invtrig.c \
+ upstream-freebsd/lib/msun/ld128/e_lgammal_r.c \
upstream-freebsd/lib/msun/ld128/k_cosl.c \
upstream-freebsd/lib/msun/ld128/k_sinl.c \
upstream-freebsd/lib/msun/ld128/k_tanl.c \
+ upstream-freebsd/lib/msun/ld128/s_erfl.c \
upstream-freebsd/lib/msun/ld128/s_exp2l.c \
upstream-freebsd/lib/msun/ld128/s_expl.c \
upstream-freebsd/lib/msun/ld128/s_logl.c \
@@ -255,6 +272,10 @@
# libm.a for target.
#
include $(CLEAR_VARS)
+ifneq (,$(filter $(TARGET_ARCH),x86 x86_64))
+# Clang has wrong long double sizes for x86.
+LOCAL_CLANG := false
+endif
LOCAL_MODULE:= libm
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_ARM_MODE := arm
@@ -263,35 +284,46 @@
LOCAL_SRC_FILES := $(libm_common_src_files)
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
+
# arch-specific settings
LOCAL_C_INCLUDES_arm := $(LOCAL_PATH)/arm
LOCAL_SRC_FILES_arm := arm/fenv.c
LOCAL_C_INCLUDES_arm64 := $(libm_ld_includes)
-LOCAL_SRC_FILES_arm64 := arm64/fenv.c $(libm_ld_src_files)
+LOCAL_SRC_FILES_arm64 := arm64/fenv.c $(libm_ld128_src_files)
LOCAL_C_INCLUDES_x86 := $(LOCAL_PATH)/i387
LOCAL_SRC_FILES_x86 := i387/fenv.c
LOCAL_C_INCLUDES_x86_64 := $(libm_ld_includes)
-LOCAL_SRC_FILES_x86_64 := amd64/fenv.c $(libm_ld_src_files)
+LOCAL_SRC_FILES_x86_64 := amd64/fenv.c $(libm_ld128_src_files)
LOCAL_SRC_FILES_mips := mips/fenv.c
LOCAL_C_INCLUDES_mips64 := $(libm_ld_includes)
-LOCAL_SRC_FILES_mips64 := mips/fenv.c $(libm_ld_src_files)
+LOCAL_SRC_FILES_mips64 := mips/fenv.c $(libm_ld128_src_files)
+LOCAL_CXX_STL := none
include $(BUILD_STATIC_LIBRARY)
#
# libm.so for target.
#
include $(CLEAR_VARS)
+ifneq (,$(filter $(TARGET_ARCH),x86 x86_64))
+# Clang has wrong long double sizes for x86.
+LOCAL_CLANG := false
+endif
LOCAL_MODULE:= libm
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
LOCAL_WHOLE_STATIC_LIBRARIES := libm
+LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
+
+LOCAL_CXX_STL := none
+
# We'd really like to do this for all architectures, but since this wasn't done
# before, these symbols must continue to be exported on LP32 for binary
# compatibility.
diff --git a/libc/arch-x86_64/include/machine/fpu.h b/libm/include/amd64/machine/fpu.h
similarity index 100%
rename from libc/arch-x86_64/include/machine/fpu.h
rename to libm/include/amd64/machine/fpu.h
diff --git a/libm/include/complex.h b/libm/include/complex.h
index 0702541..ff6b166 100644
--- a/libm/include/complex.h
+++ b/libm/include/complex.h
@@ -46,14 +46,39 @@
#define complex _Complex
#define I _Complex_I
+#if __ISO_C_VISIBLE >= 2011
+#ifdef __clang__
+#define CMPLX(x, y) ((double complex){ x, y })
+#define CMPLXF(x, y) ((float complex){ x, y })
+#define CMPLXL(x, y) ((long double complex){ x, y })
+#elif __GNUC_PREREQ__(4, 7)
+#define CMPLX(x, y) __builtin_complex((double)(x), (double)(y))
+#define CMPLXF(x, y) __builtin_complex((float)(x), (float)(y))
+#define CMPLXL(x, y) __builtin_complex((long double)(x), (long double)(y))
+#endif
+#endif /* __ISO_C_VISIBLE >= 2011 */
+
__BEGIN_DECLS
+#pragma GCC visibility push(default)
double cabs(double complex);
float cabsf(float complex);
long double cabsl(long double complex);
+double complex cacos(double complex);
+float complex cacosf(float complex);
+double complex cacosh(double complex);
+float complex cacoshf(float complex);
double carg(double complex);
float cargf(float complex);
long double cargl(long double complex);
+double complex casin(double complex);
+float complex casinf(float complex);
+double complex casinh(double complex);
+float complex casinhf(float complex);
+double complex catan(double complex);
+float complex catanf(float complex);
+double complex catanh(double complex);
+float complex catanhf(float complex);
double complex ccos(double complex);
float complex ccosf(float complex);
double complex ccosh(double complex);
@@ -87,6 +112,7 @@
double complex ctanh(double complex);
float complex ctanhf(float complex);
+#pragma GCC visibility pop
__END_DECLS
#endif /* _COMPLEX_H */
diff --git a/libm/include/math.h b/libm/include/math.h
index 3eca140..1542374 100644
--- a/libm/include/math.h
+++ b/libm/include/math.h
@@ -459,14 +459,17 @@
long double tanl(long double);
long double tgammal(long double);
long double truncl(long double);
-
#endif /* __ISO_C_VISIBLE >= 1999 */
-#if defined(_GNU_SOURCE)
+#if __BSD_VISIBLE
+long double lgammal_r(long double, int *);
+#endif
+
+#if defined(__USE_GNU)
void sincos(double, double*, double*);
void sincosf(float, float*, float*);
void sincosl(long double, long double*, long double*);
-#endif /* _GNU_SOURCE */
+#endif /* __USE_GNU */
#pragma GCC visibility pop
__END_DECLS
diff --git a/libm/sincos.c b/libm/sincos.c
index ad75549..a5608cf 100644
--- a/libm/sincos.c
+++ b/libm/sincos.c
@@ -22,8 +22,8 @@
* 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.
- *
*/
+
#define _GNU_SOURCE 1
#include <math.h>
diff --git a/libm/upstream-freebsd/lib/msun/ld128/e_lgammal_r.c b/libm/upstream-freebsd/lib/msun/ld128/e_lgammal_r.c
new file mode 100644
index 0000000..53d3af1
--- /dev/null
+++ b/libm/upstream-freebsd/lib/msun/ld128/e_lgammal_r.c
@@ -0,0 +1,330 @@
+/* @(#)e_lgamma_r.c 1.3 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * See e_lgamma_r.c for complete comments.
+ *
+ * Converted to long double by Steven G. Kargl.
+ */
+
+#include "fpmath.h"
+#include "math.h"
+#include "math_private.h"
+
+static const volatile double vzero = 0;
+
+static const double
+zero= 0,
+half= 0.5,
+one = 1;
+
+static const long double
+pi = 3.14159265358979323846264338327950288e+00L;
+/*
+ * Domain y in [0x1p-119, 0.28], range ~[-1.4065e-36, 1.4065e-36]:
+ * |(lgamma(2 - y) + y / 2) / y - a(y)| < 2**-119.1
+ */
+static const long double
+a0 = 7.72156649015328606065120900824024296e-02L,
+a1 = 3.22467033424113218236207583323018498e-01L,
+a2 = 6.73523010531980951332460538330282217e-02L,
+a3 = 2.05808084277845478790009252803463129e-02L,
+a4 = 7.38555102867398526627292839296001626e-03L,
+a5 = 2.89051033074152328576829509522483468e-03L,
+a6 = 1.19275391170326097618357349881842913e-03L,
+a7 = 5.09669524743042462515256340206203019e-04L,
+a8 = 2.23154758453578096143609255559576017e-04L,
+a9 = 9.94575127818397632126978731542755129e-05L,
+a10 = 4.49262367375420471287545895027098145e-05L,
+a11 = 2.05072127845117995426519671481628849e-05L,
+a12 = 9.43948816959096748454087141447939513e-06L,
+a13 = 4.37486780697359330303852050718287419e-06L,
+a14 = 2.03920783892362558276037363847651809e-06L,
+a15 = 9.55191070057967287877923073200324649e-07L,
+a16 = 4.48993286185740853170657139487620560e-07L,
+a17 = 2.13107543597620911675316728179563522e-07L,
+a18 = 9.70745379855304499867546549551023473e-08L,
+a19 = 5.61889970390290257926487734695402075e-08L,
+a20 = 6.42739653024130071866684358960960951e-09L,
+a21 = 3.34491062143649291746195612991870119e-08L,
+a22 = -1.57068547394315223934653011440641472e-08L,
+a23 = 1.30812825422415841213733487745200632e-08L;
+/*
+ * Domain x in [tc-0.24, tc+0.28], range ~[-6.3201e-37, 6.3201e-37]:
+ * |(lgamma(x) - tf) - t(x - tc)| < 2**-120.3.
+ */
+static const long double
+tc = 1.46163214496836234126265954232572133e+00L,
+tf = -1.21486290535849608095514557177691584e-01L,
+tt = 1.57061739945077675484237837992951704e-36L,
+t0 = -1.99238329499314692728655623767019240e-36L,
+t1 = -6.08453430711711404116887457663281416e-35L,
+t2 = 4.83836122723810585213722380854828904e-01L,
+t3 = -1.47587722994530702030955093950668275e-01L,
+t4 = 6.46249402389127526561003464202671923e-02L,
+t5 = -3.27885410884813055008502586863748063e-02L,
+t6 = 1.79706751152103942928638276067164935e-02L,
+t7 = -1.03142230366363872751602029672767978e-02L,
+t8 = 6.10053602051788840313573150785080958e-03L,
+t9 = -3.68456960831637325470641021892968954e-03L,
+t10 = 2.25976482322181046611440855340968560e-03L,
+t11 = -1.40225144590445082933490395950664961e-03L,
+t12 = 8.78232634717681264035014878172485575e-04L,
+t13 = -5.54194952796682301220684760591403899e-04L,
+t14 = 3.51912956837848209220421213975000298e-04L,
+t15 = -2.24653443695947456542669289367055542e-04L,
+t16 = 1.44070395420840737695611929680511823e-04L,
+t17 = -9.27609865550394140067059487518862512e-05L,
+t18 = 5.99347334438437081412945428365433073e-05L,
+t19 = -3.88458388854572825603964274134801009e-05L,
+t20 = 2.52476631610328129217896436186551043e-05L,
+t21 = -1.64508584981658692556994212457518536e-05L,
+t22 = 1.07434583475987007495523340296173839e-05L,
+t23 = -7.03070407519397260929482550448878399e-06L,
+t24 = 4.60968590693753579648385629003100469e-06L,
+t25 = -3.02765473778832036018438676945512661e-06L,
+t26 = 1.99238771545503819972741288511303401e-06L,
+t27 = -1.31281299822614084861868817951788579e-06L,
+t28 = 8.60844432267399655055574642052370223e-07L,
+t29 = -5.64535486432397413273248363550536374e-07L,
+t30 = 3.99357783676275660934903139592727737e-07L,
+t31 = -2.95849029193433121795495215869311610e-07L,
+t32 = 1.37790144435073124976696250804940384e-07L;
+/*
+ * Domain y in [-0.1, 0.232], range ~[-1.4046e-37, 1.4181e-37]:
+ * |(lgamma(1 + y) + 0.5 * y) / y - u(y) / v(y)| < 2**-122.8
+ */
+static const long double
+u0 = -7.72156649015328606065120900824024311e-02L,
+u1 = 4.24082772271938167430983113242482656e-01L,
+u2 = 2.96194003481457101058321977413332171e+00L,
+u3 = 6.49503267711258043997790983071543710e+00L,
+u4 = 7.40090051288150177152835698948644483e+00L,
+u5 = 4.94698036296756044610805900340723464e+00L,
+u6 = 2.00194224610796294762469550684947768e+00L,
+u7 = 4.82073087750608895996915051568834949e-01L,
+u8 = 6.46694052280506568192333848437585427e-02L,
+u9 = 4.17685526755100259316625348933108810e-03L,
+u10 = 9.06361003550314327144119307810053410e-05L,
+v1 = 5.15937098592887275994320496999951947e+00L,
+v2 = 1.14068418766251486777604403304717558e+01L,
+v3 = 1.41164839437524744055723871839748489e+01L,
+v4 = 1.07170702656179582805791063277960532e+01L,
+v5 = 5.14448694179047879915042998453632434e+00L,
+v6 = 1.55210088094585540637493826431170289e+00L,
+v7 = 2.82975732849424562719893657416365673e-01L,
+v8 = 2.86424622754753198010525786005443539e-02L,
+v9 = 1.35364253570403771005922441442688978e-03L,
+v10 = 1.91514173702398375346658943749580666e-05L,
+v11 = -3.25364686890242327944584691466034268e-08L;
+/*
+ * Domain x in (2, 3], range ~[-1.3341e-36, 1.3536e-36]:
+ * |(lgamma(y+2) - 0.5 * y) / y - s(y)/r(y)| < 2**-120.1
+ * with y = x - 2.
+ */
+static const long double
+s0 = -7.72156649015328606065120900824024297e-02L,
+s1 = 1.23221687850916448903914170805852253e-01L,
+s2 = 5.43673188699937239808255378293820020e-01L,
+s3 = 6.31998137119005233383666791176301800e-01L,
+s4 = 3.75885340179479850993811501596213763e-01L,
+s5 = 1.31572908743275052623410195011261575e-01L,
+s6 = 2.82528453299138685507186287149699749e-02L,
+s7 = 3.70262021550340817867688714880797019e-03L,
+s8 = 2.83374000312371199625774129290973648e-04L,
+s9 = 1.15091830239148290758883505582343691e-05L,
+s10 = 2.04203474281493971326506384646692446e-07L,
+s11 = 9.79544198078992058548607407635645763e-10L,
+r1 = 2.58037466655605285937112832039537492e+00L,
+r2 = 2.86289413392776399262513849911531180e+00L,
+r3 = 1.78691044735267497452847829579514367e+00L,
+r4 = 6.89400381446725342846854215600008055e-01L,
+r5 = 1.70135865462567955867134197595365343e-01L,
+r6 = 2.68794816183964420375498986152766763e-02L,
+r7 = 2.64617234244861832870088893332006679e-03L,
+r8 = 1.52881761239180800640068128681725702e-04L,
+r9 = 4.63264813762296029824851351257638558e-06L,
+r10 = 5.89461519146957343083848967333671142e-08L,
+r11 = 1.79027678176582527798327441636552968e-10L;
+/*
+ * Domain z in [8, 0x1p70], range ~[-9.8214e-35, 9.8214e-35]:
+ * |lgamma(x) - (x - 0.5) * (log(x) - 1) - w(1/x)| < 2**-113.0
+ */
+static const long double
+w0 = 4.18938533204672741780329736405617738e-01L,
+w1 = 8.33333333333333333333333333332852026e-02L,
+w2 = -2.77777777777777777777777727810123528e-03L,
+w3 = 7.93650793650793650791708939493907380e-04L,
+w4 = -5.95238095238095234390450004444370959e-04L,
+w5 = 8.41750841750837633887817658848845695e-04L,
+w6 = -1.91752691752396849943172337347259743e-03L,
+w7 = 6.41025640880333069429106541459015557e-03L,
+w8 = -2.95506530801732133437990433080327074e-02L,
+w9 = 1.79644237328444101596766586979576927e-01L,
+w10 = -1.39240539108367641920172649259736394e+00L,
+w11 = 1.33987701479007233325288857758641761e+01L,
+w12 = -1.56363596431084279780966590116006255e+02L,
+w13 = 2.14830978044410267201172332952040777e+03L,
+w14 = -3.28636067474227378352761516589092334e+04L,
+w15 = 5.06201257747865138432663574251462485e+05L,
+w16 = -6.79720123352023636706247599728048344e+06L,
+w17 = 6.57556601705472106989497289465949255e+07L,
+w18 = -3.26229058141181783534257632389415580e+08L;
+
+static long double
+sin_pil(long double x)
+{
+ volatile long double vz;
+ long double y,z;
+ uint64_t lx, n;
+ uint16_t hx;
+
+ y = -x;
+
+ vz = y+0x1.p112;
+ z = vz-0x1.p112;
+ if (z == y)
+ return zero;
+
+ vz = y+0x1.p110;
+ EXTRACT_LDBL128_WORDS(hx,lx,n,vz);
+ z = vz-0x1.p110;
+ if (z > y) {
+ z -= 0.25;
+ n--;
+ }
+ n &= 7;
+ y = y - z + n * 0.25;
+
+ switch (n) {
+ case 0: y = __kernel_sinl(pi*y,zero,0); break;
+ case 1:
+ case 2: y = __kernel_cosl(pi*(0.5-y),zero); break;
+ case 3:
+ case 4: y = __kernel_sinl(pi*(one-y),zero,0); break;
+ case 5:
+ case 6: y = -__kernel_cosl(pi*(y-1.5),zero); break;
+ default: y = __kernel_sinl(pi*(y-2.0),zero,0); break;
+ }
+ return -y;
+}
+
+long double
+lgammal_r(long double x, int *signgamp)
+{
+ long double nadj,p,p1,p2,p3,q,r,t,w,y,z;
+ uint64_t llx,lx;
+ int i;
+ uint16_t hx,ix;
+
+ EXTRACT_LDBL128_WORDS(hx,lx,llx,x);
+
+ /* purge +-Inf and NaNs */
+ *signgamp = 1;
+ ix = hx&0x7fff;
+ if(ix==0x7fff) return x*x;
+
+ /* purge +-0 and tiny arguments */
+ *signgamp = 1-2*(hx>>15);
+ if(ix<0x3fff-116) { /* |x|<2**-(p+3), return -log(|x|) */
+ if((ix|lx|llx)==0)
+ return one/vzero;
+ return -logl(fabsl(x));
+ }
+
+ /* purge negative integers and start evaluation for other x < 0 */
+ if(hx&0x8000) {
+ *signgamp = 1;
+ if(ix>=0x3fff+112) /* |x|>=2**(p-1), must be -integer */
+ return one/vzero;
+ t = sin_pil(x);
+ if(t==zero) return one/vzero;
+ nadj = logl(pi/fabsl(t*x));
+ if(t<zero) *signgamp = -1;
+ x = -x;
+ }
+
+ /* purge 1 and 2 */
+ if((ix==0x3fff || ix==0x4000) && (lx|llx)==0) r = 0;
+ /* for x < 2.0 */
+ else if(ix<0x4000) {
+ if(x<=8.9999961853027344e-01) {
+ r = -logl(x);
+ if(x>=7.3159980773925781e-01) {y = 1-x; i= 0;}
+ else if(x>=2.3163998126983643e-01) {y= x-(tc-1); i=1;}
+ else {y = x; i=2;}
+ } else {
+ r = 0;
+ if(x>=1.7316312789916992e+00) {y=2-x;i=0;}
+ else if(x>=1.2316322326660156e+00) {y=x-tc;i=1;}
+ else {y=x-1;i=2;}
+ }
+ switch(i) {
+ case 0:
+ z = y*y;
+ p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*(a10+z*(a12+z*(a14+z*(a16+
+ z*(a18+z*(a20+z*a22))))))))));
+ p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*(a11+z*(a13+z*(a15+
+ z*(a17+z*(a19+z*(a21+z*a23)))))))))));
+ p = y*p1+p2;
+ r += p-y/2; break;
+ case 1:
+ p = t0+y*t1+tt+y*y*(t2+y*(t3+y*(t4+y*(t5+y*(t6+y*(t7+y*(t8+
+ y*(t9+y*(t10+y*(t11+y*(t12+y*(t13+y*(t14+y*(t15+y*(t16+
+ y*(t17+y*(t18+y*(t19+y*(t20+y*(t21+y*(t22+y*(t23+
+ y*(t24+y*(t25+y*(t26+y*(t27+y*(t28+y*(t29+y*(t30+
+ y*(t31+y*t32))))))))))))))))))))))))))))));
+ r += tf + p; break;
+ case 2:
+ p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*(u5+y*(u6+y*(u7+
+ y*(u8+y*(u9+y*u10))))))))));
+ p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*(v5+y*(v6+y*(v7+
+ y*(v8+y*(v9+y*(v10+y*v11))))))))));
+ r += p1/p2-y/2;
+ }
+ }
+ /* x < 8.0 */
+ else if(ix<0x4002) {
+ i = x;
+ y = x-i;
+ p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*(s6+y*(s7+y*(s8+
+ y*(s9+y*(s10+y*s11)))))))))));
+ q = one+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*(r6+y*(r7+y*(r8+
+ y*(r9+y*(r10+y*r11))))))))));
+ r = y/2+p/q;
+ z = 1; /* lgamma(1+s) = log(s) + lgamma(s) */
+ switch(i) {
+ case 7: z *= (y+6); /* FALLTHRU */
+ case 6: z *= (y+5); /* FALLTHRU */
+ case 5: z *= (y+4); /* FALLTHRU */
+ case 4: z *= (y+3); /* FALLTHRU */
+ case 3: z *= (y+2); /* FALLTHRU */
+ r += logl(z); break;
+ }
+ /* 8.0 <= x < 2**(p+3) */
+ } else if (ix<0x3fff+116) {
+ t = logl(x);
+ z = one/x;
+ y = z*z;
+ w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*(w6+y*(w7+y*(w8+
+ y*(w9+y*(w10+y*(w11+y*(w12+y*(w13+y*(w14+y*(w15+y*(w16+
+ y*(w17+y*w18)))))))))))))))));
+ r = (x-half)*(t-one)+w;
+ /* 2**(p+3) <= x <= inf */
+ } else
+ r = x*(logl(x)-1);
+ if(hx&0x8000) r = nadj - r;
+ return r;
+}
diff --git a/libm/upstream-freebsd/lib/msun/ld128/e_rem_pio2l.h b/libm/upstream-freebsd/lib/msun/ld128/e_rem_pio2l.h
index 078d0c3..5d78c4d 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/e_rem_pio2l.h
+++ b/libm/upstream-freebsd/lib/msun/ld128/e_rem_pio2l.h
@@ -6,7 +6,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
@@ -17,8 +17,8 @@
__FBSDID("$FreeBSD$");
/* ld128 version of __ieee754_rem_pio2l(x,y)
- *
- * return the remainder of x rem pi/2 in y[0]+y[1]
+ *
+ * return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2()
*/
@@ -88,24 +88,24 @@
union IEEEl2bits u2;
int ex1;
j = ex;
- y[0] = r-w;
+ y[0] = r-w;
u2.e = y[0];
ex1 = u2.xbits.expsign & 0x7fff;
i = j-ex1;
if(i>51) { /* 2nd iteration needed, good to 248 */
t = r;
- w = fn*pio2_2;
+ w = fn*pio2_2;
r = t-w;
- w = fn*pio2_2t-((t-r)-w);
+ w = fn*pio2_2t-((t-r)-w);
y[0] = r-w;
u2.e = y[0];
ex1 = u2.xbits.expsign & 0x7fff;
i = j-ex1;
if(i>119) { /* 3rd iteration need, 316 bits acc */
t = r; /* will cover all possible cases */
- w = fn*pio2_3;
+ w = fn*pio2_3;
r = t-w;
- w = fn*pio2_3t-((t-r)-w);
+ w = fn*pio2_3t-((t-r)-w);
y[0] = r-w;
}
}
@@ -113,7 +113,7 @@
y[1] = (r-y[0])-w;
return n;
}
- /*
+ /*
* all other (large) arguments
*/
if(ex==0x7fff) { /* x is inf or NaN */
diff --git a/libm/upstream-freebsd/lib/msun/ld128/invtrig.c b/libm/upstream-freebsd/lib/msun/ld128/invtrig.c
index df67d16..4ceca8a 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/invtrig.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/invtrig.c
@@ -58,8 +58,8 @@
*/
const long double atanhi[] = {
4.63647609000806116214256231461214397e-01L,
- 7.85398163397448309615660845819875699e-01L,
- 9.82793723247329067985710611014666038e-01L,
+ 7.85398163397448309615660845819875699e-01L,
+ 9.82793723247329067985710611014666038e-01L,
1.57079632679489661923132169163975140e+00L,
};
diff --git a/libm/upstream-freebsd/lib/msun/ld128/k_cosl.c b/libm/upstream-freebsd/lib/msun/ld128/k_cosl.c
index 5f4aa37..fe57773 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/k_cosl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/k_cosl.c
@@ -6,7 +6,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
diff --git a/libm/upstream-freebsd/lib/msun/ld128/k_expl.h b/libm/upstream-freebsd/lib/msun/ld128/k_expl.h
new file mode 100644
index 0000000..a5668fd
--- /dev/null
+++ b/libm/upstream-freebsd/lib/msun/ld128/k_expl.h
@@ -0,0 +1,328 @@
+/* from: FreeBSD: head/lib/msun/ld128/s_expl.c 251345 2013-06-03 20:09:22Z kargl */
+
+/*-
+ * Copyright (c) 2009-2013 Steven G. Kargl
+ * 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 unmodified, 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.
+ *
+ * Optimized by Bruce D. Evans.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * ld128 version of k_expl.h. See ../ld80/s_expl.c for most comments.
+ *
+ * See ../src/e_exp.c and ../src/k_exp.h for precision-independent comments
+ * about the secondary kernels.
+ */
+
+#define INTERVALS 128
+#define LOG2_INTERVALS 7
+#define BIAS (LDBL_MAX_EXP - 1)
+
+static const double
+/*
+ * ln2/INTERVALS = L1+L2 (hi+lo decomposition for multiplication). L1 must
+ * have at least 22 (= log2(|LDBL_MIN_EXP-extras|) + log2(INTERVALS)) lowest
+ * bits zero so that multiplication of it by n is exact.
+ */
+INV_L = 1.8466496523378731e+2, /* 0x171547652b82fe.0p-45 */
+L2 = -1.0253670638894731e-29; /* -0x1.9ff0342542fc3p-97 */
+static const long double
+/* 0x1.62e42fefa39ef35793c768000000p-8 */
+L1 = 5.41521234812457272982212595914567508e-3L;
+
+/*
+ * XXX values in hex in comments have been lost (or were never present)
+ * from here.
+ */
+static const long double
+/*
+ * Domain [-0.002708, 0.002708], range ~[-2.4021e-38, 2.4234e-38]:
+ * |exp(x) - p(x)| < 2**-124.9
+ * (0.002708 is ln2/(2*INTERVALS) rounded up a little).
+ *
+ * XXX the coeffs aren't very carefully rounded, and I get 3.6 more bits.
+ */
+A2 = 0.5,
+A3 = 1.66666666666666666666666666651085500e-1L,
+A4 = 4.16666666666666666666666666425885320e-2L,
+A5 = 8.33333333333333333334522877160175842e-3L,
+A6 = 1.38888888888888888889971139751596836e-3L;
+
+static const double
+A7 = 1.9841269841269470e-4, /* 0x1.a01a01a019f91p-13 */
+A8 = 2.4801587301585286e-5, /* 0x1.71de3ec75a967p-19 */
+A9 = 2.7557324277411235e-6, /* 0x1.71de3ec75a967p-19 */
+A10 = 2.7557333722375069e-7; /* 0x1.27e505ab56259p-22 */
+
+static const struct {
+ /*
+ * hi must be rounded to at most 106 bits so that multiplication
+ * by r1 in expm1l() is exact, but it is rounded to 88 bits due to
+ * historical accidents.
+ *
+ * XXX it is wasteful to use long double for both hi and lo. ld128
+ * exp2l() uses only float for lo (in a very differently organized
+ * table; ld80 exp2l() is different again. It uses 2 doubles in a
+ * table organized like this one. 1 double and 1 float would
+ * suffice). There are different packing/locality/alignment/caching
+ * problems with these methods.
+ *
+ * XXX C's bad %a format makes the bits unreadable. They happen
+ * to all line up for the hi values 1 before the point and 88
+ * in 22 nybbles, but for the low values the nybbles are shifted
+ * randomly.
+ */
+ long double hi;
+ long double lo;
+} tbl[INTERVALS] = {
+ 0x1p0L, 0x0p0L,
+ 0x1.0163da9fb33356d84a66aep0L, 0x3.36dcdfa4003ec04c360be2404078p-92L,
+ 0x1.02c9a3e778060ee6f7cacap0L, 0x4.f7a29bde93d70a2cabc5cb89ba10p-92L,
+ 0x1.04315e86e7f84bd738f9a2p0L, 0xd.a47e6ed040bb4bfc05af6455e9b8p-96L,
+ 0x1.059b0d31585743ae7c548ep0L, 0xb.68ca417fe53e3495f7df4baf84a0p-92L,
+ 0x1.0706b29ddf6ddc6dc403a8p0L, 0x1.d87b27ed07cb8b092ac75e311753p-88L,
+ 0x1.0874518759bc808c35f25cp0L, 0x1.9427fa2b041b2d6829d8993a0d01p-88L,
+ 0x1.09e3ecac6f3834521e060cp0L, 0x5.84d6b74ba2e023da730e7fccb758p-92L,
+ 0x1.0b5586cf9890f6298b92b6p0L, 0x1.1842a98364291408b3ceb0a2a2bbp-88L,
+ 0x1.0cc922b7247f7407b705b8p0L, 0x9.3dc5e8aac564e6fe2ef1d431fd98p-92L,
+ 0x1.0e3ec32d3d1a2020742e4ep0L, 0x1.8af6a552ac4b358b1129e9f966a4p-88L,
+ 0x1.0fb66affed31af232091dcp0L, 0x1.8a1426514e0b627bda694a400a27p-88L,
+ 0x1.11301d0125b50a4ebbf1aep0L, 0xd.9318ceac5cc47ab166ee57427178p-92L,
+ 0x1.12abdc06c31cbfb92bad32p0L, 0x4.d68e2f7270bdf7cedf94eb1cb818p-92L,
+ 0x1.1429aaea92ddfb34101942p0L, 0x1.b2586d01844b389bea7aedd221d4p-88L,
+ 0x1.15a98c8a58e512480d573cp0L, 0x1.d5613bf92a2b618ee31b376c2689p-88L,
+ 0x1.172b83c7d517adcdf7c8c4p0L, 0x1.0eb14a792035509ff7d758693f24p-88L,
+ 0x1.18af9388c8de9bbbf70b9ap0L, 0x3.c2505c97c0102e5f1211941d2840p-92L,
+ 0x1.1a35beb6fcb753cb698f68p0L, 0x1.2d1c835a6c30724d5cfae31b84e5p-88L,
+ 0x1.1bbe084045cd39ab1e72b4p0L, 0x4.27e35f9acb57e473915519a1b448p-92L,
+ 0x1.1d4873168b9aa7805b8028p0L, 0x9.90f07a98b42206e46166cf051d70p-92L,
+ 0x1.1ed5022fcd91cb8819ff60p0L, 0x1.121d1e504d36c47474c9b7de6067p-88L,
+ 0x1.2063b88628cd63b8eeb028p0L, 0x1.50929d0fc487d21c2b84004264dep-88L,
+ 0x1.21f49917ddc962552fd292p0L, 0x9.4bdb4b61ea62477caa1dce823ba0p-92L,
+ 0x1.2387a6e75623866c1fadb0p0L, 0x1.c15cb593b0328566902df69e4de2p-88L,
+ 0x1.251ce4fb2a63f3582ab7dep0L, 0x9.e94811a9c8afdcf796934bc652d0p-92L,
+ 0x1.26b4565e27cdd257a67328p0L, 0x1.d3b249dce4e9186ddd5ff44e6b08p-92L,
+ 0x1.284dfe1f5638096cf15cf0p0L, 0x3.ca0967fdaa2e52d7c8106f2e262cp-92L,
+ 0x1.29e9df51fdee12c25d15f4p0L, 0x1.a24aa3bca890ac08d203fed80a07p-88L,
+ 0x1.2b87fd0dad98ffddea4652p0L, 0x1.8fcab88442fdc3cb6de4519165edp-88L,
+ 0x1.2d285a6e4030b40091d536p0L, 0xd.075384589c1cd1b3e4018a6b1348p-92L,
+ 0x1.2ecafa93e2f5611ca0f45cp0L, 0x1.523833af611bdcda253c554cf278p-88L,
+ 0x1.306fe0a31b7152de8d5a46p0L, 0x3.05c85edecbc27343629f502f1af2p-92L,
+ 0x1.32170fc4cd8313539cf1c2p0L, 0x1.008f86dde3220ae17a005b6412bep-88L,
+ 0x1.33c08b26416ff4c9c8610cp0L, 0x1.96696bf95d1593039539d94d662bp-88L,
+ 0x1.356c55f929ff0c94623476p0L, 0x3.73af38d6d8d6f9506c9bbc93cbc0p-92L,
+ 0x1.371a7373aa9caa7145502ep0L, 0x1.4547987e3e12516bf9c699be432fp-88L,
+ 0x1.38cae6d05d86585a9cb0d8p0L, 0x1.bed0c853bd30a02790931eb2e8f0p-88L,
+ 0x1.3a7db34e59ff6ea1bc9298p0L, 0x1.e0a1d336163fe2f852ceeb134067p-88L,
+ 0x1.3c32dc313a8e484001f228p0L, 0xb.58f3775e06ab66353001fae9fca0p-92L,
+ 0x1.3dea64c12342235b41223ep0L, 0x1.3d773fba2cb82b8244267c54443fp-92L,
+ 0x1.3fa4504ac801ba0bf701aap0L, 0x4.1832fb8c1c8dbdff2c49909e6c60p-92L,
+ 0x1.4160a21f72e29f84325b8ep0L, 0x1.3db61fb352f0540e6ba05634413ep-88L,
+ 0x1.431f5d950a896dc7044394p0L, 0x1.0ccec81e24b0caff7581ef4127f7p-92L,
+ 0x1.44e086061892d03136f408p0L, 0x1.df019fbd4f3b48709b78591d5cb5p-88L,
+ 0x1.46a41ed1d005772512f458p0L, 0x1.229d97df404ff21f39c1b594d3a8p-88L,
+ 0x1.486a2b5c13cd013c1a3b68p0L, 0x1.062f03c3dd75ce8757f780e6ec99p-88L,
+ 0x1.4a32af0d7d3de672d8bcf4p0L, 0x6.f9586461db1d878b1d148bd3ccb8p-92L,
+ 0x1.4bfdad5362a271d4397afep0L, 0xc.42e20e0363ba2e159c579f82e4b0p-92L,
+ 0x1.4dcb299fddd0d63b36ef1ap0L, 0x9.e0cc484b25a5566d0bd5f58ad238p-92L,
+ 0x1.4f9b2769d2ca6ad33d8b68p0L, 0x1.aa073ee55e028497a329a7333dbap-88L,
+ 0x1.516daa2cf6641c112f52c8p0L, 0x4.d822190e718226177d7608d20038p-92L,
+ 0x1.5342b569d4f81df0a83c48p0L, 0x1.d86a63f4e672a3e429805b049465p-88L,
+ 0x1.551a4ca5d920ec52ec6202p0L, 0x4.34ca672645dc6c124d6619a87574p-92L,
+ 0x1.56f4736b527da66ecb0046p0L, 0x1.64eb3c00f2f5ab3d801d7cc7272dp-88L,
+ 0x1.58d12d497c7fd252bc2b72p0L, 0x1.43bcf2ec936a970d9cc266f0072fp-88L,
+ 0x1.5ab07dd48542958c930150p0L, 0x1.91eb345d88d7c81280e069fbdb63p-88L,
+ 0x1.5c9268a5946b701c4b1b80p0L, 0x1.6986a203d84e6a4a92f179e71889p-88L,
+ 0x1.5e76f15ad21486e9be4c20p0L, 0x3.99766a06548a05829e853bdb2b52p-92L,
+ 0x1.605e1b976dc08b076f592ap0L, 0x4.86e3b34ead1b4769df867b9c89ccp-92L,
+ 0x1.6247eb03a5584b1f0fa06ep0L, 0x1.d2da42bb1ceaf9f732275b8aef30p-88L,
+ 0x1.6434634ccc31fc76f8714cp0L, 0x4.ed9a4e41000307103a18cf7a6e08p-92L,
+ 0x1.66238825522249127d9e28p0L, 0x1.b8f314a337f4dc0a3adf1787ff74p-88L,
+ 0x1.68155d44ca973081c57226p0L, 0x1.b9f32706bfe4e627d809a85dcc66p-88L,
+ 0x1.6a09e667f3bcc908b2fb12p0L, 0x1.66ea957d3e3adec17512775099dap-88L,
+ 0x1.6c012750bdabeed76a9980p0L, 0xf.4f33fdeb8b0ecd831106f57b3d00p-96L,
+ 0x1.6dfb23c651a2ef220e2cbep0L, 0x1.bbaa834b3f11577ceefbe6c1c411p-92L,
+ 0x1.6ff7df9519483cf87e1b4ep0L, 0x1.3e213bff9b702d5aa477c12523cep-88L,
+ 0x1.71f75e8ec5f73dd2370f2ep0L, 0xf.0acd6cb434b562d9e8a20adda648p-92L,
+ 0x1.73f9a48a58173bd5c9a4e6p0L, 0x8.ab1182ae217f3a7681759553e840p-92L,
+ 0x1.75feb564267c8bf6e9aa32p0L, 0x1.a48b27071805e61a17b954a2dad8p-88L,
+ 0x1.780694fde5d3f619ae0280p0L, 0x8.58b2bb2bdcf86cd08e35fb04c0f0p-92L,
+ 0x1.7a11473eb0186d7d51023ep0L, 0x1.6cda1f5ef42b66977960531e821bp-88L,
+ 0x1.7c1ed0130c1327c4933444p0L, 0x1.937562b2dc933d44fc828efd4c9cp-88L,
+ 0x1.7e2f336cf4e62105d02ba0p0L, 0x1.5797e170a1427f8fcdf5f3906108p-88L,
+ 0x1.80427543e1a11b60de6764p0L, 0x9.a354ea706b8e4d8b718a672bf7c8p-92L,
+ 0x1.82589994cce128acf88afap0L, 0xb.34a010f6ad65cbbac0f532d39be0p-92L,
+ 0x1.8471a4623c7acce52f6b96p0L, 0x1.c64095370f51f48817914dd78665p-88L,
+ 0x1.868d99b4492ec80e41d90ap0L, 0xc.251707484d73f136fb5779656b70p-92L,
+ 0x1.88ac7d98a669966530bcdep0L, 0x1.2d4e9d61283ef385de170ab20f96p-88L,
+ 0x1.8ace5422aa0db5ba7c55a0p0L, 0x1.92c9bb3e6ed61f2733304a346d8fp-88L,
+ 0x1.8cf3216b5448bef2aa1cd0p0L, 0x1.61c55d84a9848f8c453b3ca8c946p-88L,
+ 0x1.8f1ae991577362b982745cp0L, 0x7.2ed804efc9b4ae1458ae946099d4p-92L,
+ 0x1.9145b0b91ffc588a61b468p0L, 0x1.f6b70e01c2a90229a4c4309ea719p-88L,
+ 0x1.93737b0cdc5e4f4501c3f2p0L, 0x5.40a22d2fc4af581b63e8326efe9cp-92L,
+ 0x1.95a44cbc8520ee9b483694p0L, 0x1.a0fc6f7c7d61b2b3a22a0eab2cadp-88L,
+ 0x1.97d829fde4e4f8b9e920f8p0L, 0x1.1e8bd7edb9d7144b6f6818084cc7p-88L,
+ 0x1.9a0f170ca07b9ba3109b8cp0L, 0x4.6737beb19e1eada6825d3c557428p-92L,
+ 0x1.9c49182a3f0901c7c46b06p0L, 0x1.1f2be58ddade50c217186c90b457p-88L,
+ 0x1.9e86319e323231824ca78ep0L, 0x6.4c6e010f92c082bbadfaf605cfd4p-92L,
+ 0x1.a0c667b5de564b29ada8b8p0L, 0xc.ab349aa0422a8da7d4512edac548p-92L,
+ 0x1.a309bec4a2d3358c171f76p0L, 0x1.0daad547fa22c26d168ea762d854p-88L,
+ 0x1.a5503b23e255c8b424491cp0L, 0xa.f87bc8050a405381703ef7caff50p-92L,
+ 0x1.a799e1330b3586f2dfb2b0p0L, 0x1.58f1a98796ce8908ae852236ca94p-88L,
+ 0x1.a9e6b5579fdbf43eb243bcp0L, 0x1.ff4c4c58b571cf465caf07b4b9f5p-88L,
+ 0x1.ac36bbfd3f379c0db966a2p0L, 0x1.1265fc73e480712d20f8597a8e7bp-88L,
+ 0x1.ae89f995ad3ad5e8734d16p0L, 0x1.73205a7fbc3ae675ea440b162d6cp-88L,
+ 0x1.b0e07298db66590842acdep0L, 0x1.c6f6ca0e5dcae2aafffa7a0554cbp-88L,
+ 0x1.b33a2b84f15faf6bfd0e7ap0L, 0x1.d947c2575781dbb49b1237c87b6ep-88L,
+ 0x1.b59728de559398e3881110p0L, 0x1.64873c7171fefc410416be0a6525p-88L,
+ 0x1.b7f76f2fb5e46eaa7b081ap0L, 0xb.53c5354c8903c356e4b625aacc28p-92L,
+ 0x1.ba5b030a10649840cb3c6ap0L, 0xf.5b47f297203757e1cc6eadc8bad0p-92L,
+ 0x1.bcc1e904bc1d2247ba0f44p0L, 0x1.b3d08cd0b20287092bd59be4ad98p-88L,
+ 0x1.bf2c25bd71e088408d7024p0L, 0x1.18e3449fa073b356766dfb568ff4p-88L,
+ 0x1.c199bdd85529c2220cb12ap0L, 0x9.1ba6679444964a36661240043970p-96L,
+ 0x1.c40ab5fffd07a6d14df820p0L, 0xf.1828a5366fd387a7bdd54cdf7300p-92L,
+ 0x1.c67f12e57d14b4a2137fd2p0L, 0xf.2b301dd9e6b151a6d1f9d5d5f520p-96L,
+ 0x1.c8f6d9406e7b511acbc488p0L, 0x5.c442ddb55820171f319d9e5076a8p-96L,
+ 0x1.cb720dcef90691503cbd1ep0L, 0x9.49db761d9559ac0cb6dd3ed599e0p-92L,
+ 0x1.cdf0b555dc3f9c44f8958ep0L, 0x1.ac51be515f8c58bdfb6f5740a3a4p-88L,
+ 0x1.d072d4a07897b8d0f22f20p0L, 0x1.a158e18fbbfc625f09f4cca40874p-88L,
+ 0x1.d2f87080d89f18ade12398p0L, 0x9.ea2025b4c56553f5cdee4c924728p-92L,
+ 0x1.d5818dcfba48725da05aeap0L, 0x1.66e0dca9f589f559c0876ff23830p-88L,
+ 0x1.d80e316c98397bb84f9d04p0L, 0x8.805f84bec614de269900ddf98d28p-92L,
+ 0x1.da9e603db3285708c01a5ap0L, 0x1.6d4c97f6246f0ec614ec95c99392p-88L,
+ 0x1.dd321f301b4604b695de3cp0L, 0x6.30a393215299e30d4fb73503c348p-96L,
+ 0x1.dfc97337b9b5eb968cac38p0L, 0x1.ed291b7225a944efd5bb5524b927p-88L,
+ 0x1.e264614f5a128a12761fa0p0L, 0x1.7ada6467e77f73bf65e04c95e29dp-88L,
+ 0x1.e502ee78b3ff6273d13014p0L, 0x1.3991e8f49659e1693be17ae1d2f9p-88L,
+ 0x1.e7a51fbc74c834b548b282p0L, 0x1.23786758a84f4956354634a416cep-88L,
+ 0x1.ea4afa2a490d9858f73a18p0L, 0xf.5db301f86dea20610ceee13eb7b8p-92L,
+ 0x1.ecf482d8e67f08db0312fap0L, 0x1.949cef462010bb4bc4ce72a900dfp-88L,
+ 0x1.efa1bee615a27771fd21a8p0L, 0x1.2dac1f6dd5d229ff68e46f27e3dfp-88L,
+ 0x1.f252b376bba974e8696fc2p0L, 0x1.6390d4c6ad5476b5162f40e1d9a9p-88L,
+ 0x1.f50765b6e4540674f84b76p0L, 0x2.862baff99000dfc4352ba29b8908p-92L,
+ 0x1.f7bfdad9cbe138913b4bfep0L, 0x7.2bd95c5ce7280fa4d2344a3f5618p-92L,
+ 0x1.fa7c1819e90d82e90a7e74p0L, 0xb.263c1dc060c36f7650b4c0f233a8p-92L,
+ 0x1.fd3c22b8f71f10975ba4b2p0L, 0x1.2bcf3a5e12d269d8ad7c1a4a8875p-88L
+};
+
+/*
+ * Kernel for expl(x). x must be finite and not tiny or huge.
+ * "tiny" is anything that would make us underflow (|A6*x^6| < ~LDBL_MIN).
+ * "huge" is anything that would make fn*L1 inexact (|x| > ~2**17*ln2).
+ */
+static inline void
+__k_expl(long double x, long double *hip, long double *lop, int *kp)
+{
+ long double q, r, r1, t;
+ double dr, fn, r2;
+ int n, n2;
+
+ /* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */
+ /* Use a specialized rint() to get fn. Assume round-to-nearest. */
+ /* XXX assume no extra precision for the additions, as for trig fns. */
+ /* XXX this set of comments is now quadruplicated. */
+ /* XXX but see ../src/e_exp.c for a fix using double_t. */
+ fn = (double)x * INV_L + 0x1.8p52 - 0x1.8p52;
+#if defined(HAVE_EFFICIENT_IRINT)
+ n = irint(fn);
+#else
+ n = (int)fn;
+#endif
+ n2 = (unsigned)n % INTERVALS;
+ /* Depend on the sign bit being propagated: */
+ *kp = n >> LOG2_INTERVALS;
+ r1 = x - fn * L1;
+ r2 = fn * -L2;
+ r = r1 + r2;
+
+ /* Evaluate expl(endpoint[n2] + r1 + r2) = tbl[n2] * expl(r1 + r2). */
+ dr = r;
+ q = r2 + r * r * (A2 + r * (A3 + r * (A4 + r * (A5 + r * (A6 +
+ dr * (A7 + dr * (A8 + dr * (A9 + dr * A10))))))));
+ t = tbl[n2].lo + tbl[n2].hi;
+ *hip = tbl[n2].hi;
+ *lop = tbl[n2].lo + t * (q + r1);
+}
+
+/*
+ * XXX: the rest of the functions are identical for ld80 and ld128.
+ * However, we should use scalbnl() for ld128, since long double
+ * multiplication is very slow on the only supported ld128 arch (sparc64).
+ */
+
+static inline void
+k_hexpl(long double x, long double *hip, long double *lop)
+{
+ float twopkm1;
+ int k;
+
+ __k_expl(x, hip, lop, &k);
+ SET_FLOAT_WORD(twopkm1, 0x3f800000 + ((k - 1) << 23));
+ *hip *= twopkm1;
+ *lop *= twopkm1;
+}
+
+static inline long double
+hexpl(long double x)
+{
+ long double hi, lo, twopkm2;
+ int k;
+
+ twopkm2 = 1;
+ __k_expl(x, &hi, &lo, &k);
+ SET_LDBL_EXPSIGN(twopkm2, BIAS + k - 2);
+ return (lo + hi) * 2 * twopkm2;
+}
+
+#ifdef _COMPLEX_H
+/*
+ * See ../src/k_exp.c for details.
+ */
+static inline long double complex
+__ldexp_cexpl(long double complex z, int expt)
+{
+ long double exp_x, hi, lo;
+ long double x, y, scale1, scale2;
+ int half_expt, k;
+
+ x = creall(z);
+ y = cimagl(z);
+ __k_expl(x, &hi, &lo, &k);
+
+ exp_x = (lo + hi) * 0x1p16382;
+ expt += k - 16382;
+
+ scale1 = 1;
+ half_expt = expt / 2;
+ SET_LDBL_EXPSIGN(scale1, BIAS + half_expt);
+ scale2 = 1;
+ SET_LDBL_EXPSIGN(scale1, BIAS + expt - half_expt);
+
+ return (cpackl(cos(y) * exp_x * scale1 * scale2,
+ sinl(y) * exp_x * scale1 * scale2));
+}
+#endif /* _COMPLEX_H */
diff --git a/libm/upstream-freebsd/lib/msun/ld128/k_sinl.c b/libm/upstream-freebsd/lib/msun/ld128/k_sinl.c
index bd415c0..09472d6 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/k_sinl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/k_sinl.c
@@ -6,7 +6,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_erfl.c b/libm/upstream-freebsd/lib/msun/ld128/s_erfl.c
new file mode 100644
index 0000000..e29c969
--- /dev/null
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_erfl.c
@@ -0,0 +1,329 @@
+/* @(#)s_erf.c 5.1 93/09/24 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * See s_erf.c for complete comments.
+ *
+ * Converted to long double by Steven G. Kargl.
+ */
+#include <float.h>
+
+#include "fpmath.h"
+#include "math.h"
+#include "math_private.h"
+
+/* XXX Prevent compilers from erroneously constant folding these: */
+static const volatile long double tiny = 0x1p-10000L;
+
+static const double
+half= 0.5,
+one = 1,
+two = 2;
+/*
+ * In the domain [0, 2**-40], only the first term in the power series
+ * expansion of erf(x) is used. The magnitude of the first neglected
+ * terms is less than 2**-120.
+ */
+static const long double
+efx = 1.28379167095512573896158903121545167e-01L, /* 0xecbff6a7, 0x481dd788, 0xb64d21a8, 0xeb06fc3f */
+efx8 = 1.02703333676410059116927122497236133e+00L, /* 0xecbff6a7, 0x481dd788, 0xb64d21a8, 0xeb06ff3f */
+/*
+ * Domain [0, 0.84375], range ~[-1.919e-38, 1.919e-38]:
+ * |(erf(x) - x)/x - pp(x)/qq(x)| < 2**-125.29
+ */
+pp0 = 1.28379167095512573896158903121545167e-01L, /* 0x3ffc06eb, 0xa8214db6, 0x88d71d48, 0xa7f6bfec */
+pp1 = -3.14931554396568573802046931159683404e-01L, /* 0xbffd427d, 0x6ada7263, 0x547eb096, 0x95f37463 */
+pp2 = -5.27514920282183487103576956956725309e-02L, /* 0xbffab023, 0xe5a271e3, 0xb0e79b01, 0x2f7ac962 */
+pp3 = -1.13202828509005281355609495523452713e-02L, /* 0xbff872f1, 0x6a5023a1, 0xe08b3884, 0x326af20f */
+pp4 = -9.18626155872522453865998391206048506e-04L, /* 0xbff4e19f, 0xea5fb024, 0x43247a37, 0xe430b06c */
+pp5 = -7.87518862406176274922506447157284230e-05L, /* 0xbff14a4f, 0x31a85fe0, 0x7fff2204, 0x09c49b37 */
+pp6 = -3.42357944472240436548115331090560881e-06L, /* 0xbfeccb81, 0x4b43c336, 0xcd2eb6c2, 0x903f2d87 */
+pp7 = -1.37317432573890412634717890726745428e-07L, /* 0xbfe826e3, 0x0e915eb6, 0x42aee414, 0xf7e36805 */
+pp8 = -2.71115170113861755855049008732113726e-09L, /* 0xbfe2749e, 0x2b94fd00, 0xecb4d166, 0x0efb91f8 */
+pp9 = -3.37925756196555959454018189718117864e-11L, /* 0xbfdc293e, 0x1d9060cb, 0xd043204a, 0x314cd7f0 */
+qq1 = 4.76672625471551170489978555182449450e-01L, /* 0x3ffde81c, 0xde6531f0, 0x76803bee, 0x526e29e9 */
+qq2 = 1.06713144672281502058807525850732240e-01L, /* 0x3ffbb518, 0xd7a6bb74, 0xcd9bdd33, 0x7601eee5 */
+qq3 = 1.47747613127513761102189201923147490e-02L, /* 0x3ff8e423, 0xae527e18, 0xf12cb447, 0x723b4749 */
+qq4 = 1.39939377672028671891148770908874816e-03L, /* 0x3ff56ed7, 0xba055d84, 0xc21b45c4, 0x388d1812 */
+qq5 = 9.44302939359455241271983309378738276e-05L, /* 0x3ff18c11, 0xc18c99a4, 0x86d0fe09, 0x46387b4c */
+qq6 = 4.56199342312522842161301671745365650e-06L, /* 0x3fed3226, 0x73421d05, 0x08875300, 0x32fa1432 */
+qq7 = 1.53019260483764773845294600092361197e-07L, /* 0x3fe8489b, 0x3a63f627, 0x2b9ad2ce, 0x26516e57 */
+qq8 = 3.25542691121324805094777901250005508e-09L, /* 0x3fe2bf6c, 0x26d93a29, 0x9142be7c, 0x9f1dd043 */
+qq9 = 3.37405581964478060434410167262684979e-11L; /* 0x3fdc28c8, 0xfb8fa1be, 0x10e57eec, 0xaa19e49f */
+
+static const long double
+erx = 8.42700792949714894142232424201210961e-01L, /* 0x3ffeaf76, 0x7a741088, 0xb0000000, 0x00000000 */
+/*
+ * Domain [0.84375, 1.25], range ~[-2.521e-36, 2.523e-36]:
+ * |(erf(x) - erx) - pa(x)/qa(x)| < 2**-120.15
+ */
+pa0 = -2.48010117891186017024438233323795897e-17L, /* 0xbfc7c97f, 0x77812279, 0x6c877f22, 0xef4bfb2e */
+pa1 = 4.15107497420594680894327969504526489e-01L, /* 0x3ffda911, 0xf096fbc2, 0x55662005, 0x2337fa64 */
+pa2 = -3.94180628087084846724448515851892609e-02L, /* 0xbffa42e9, 0xab54528c, 0xad529da1, 0x6efc2af3 */
+pa3 = 4.48897599625192107295954790681677462e-02L, /* 0x3ffa6fbc, 0xa65edba1, 0x0e4cbcea, 0x73ef9a31 */
+pa4 = 8.02069252143016600110972019232995528e-02L, /* 0x3ffb4887, 0x0e8b548e, 0x3230b417, 0x11b553b3 */
+pa5 = -1.02729816533435279443621120242391295e-02L, /* 0xbff850a0, 0x041de3ee, 0xd5bca6c9, 0x4ef5f9f2 */
+pa6 = 5.70777694530755634864821094419982095e-03L, /* 0x3ff77610, 0x9b501e10, 0x4c978382, 0x742df68f */
+pa7 = 1.22635150233075521018231779267077071e-03L, /* 0x3ff5417b, 0x0e623682, 0x60327da0, 0x96b9219e */
+pa8 = 5.36100234820204569428412542856666503e-04L, /* 0x3ff41912, 0x27ceb4c1, 0x1d3298ec, 0x84ced627 */
+pa9 = -1.97753571846365167177187858667583165e-04L, /* 0xbff29eb8, 0x23f5bcf3, 0x15c83c46, 0xe4fda98b */
+pa10 = 6.19333039900846970674794789568415105e-05L, /* 0x3ff103c4, 0x60f88e46, 0xc0c9fb02, 0x13cc7fc1 */
+pa11 = -5.40531400436645861492290270311751349e-06L, /* 0xbfed6abe, 0x9665f8a8, 0xdd0ad3ba, 0xe5dc0ee3 */
+qa1 = 9.05041313265490487793231810291907851e-01L, /* 0x3ffecf61, 0x93340222, 0xe9930620, 0xc4e61168 */
+qa2 = 6.79848064708886864767240880834868092e-01L, /* 0x3ffe5c15, 0x0ba858dc, 0xf7900ae9, 0xfea1e09a */
+qa3 = 4.04720609926471677581066689316516445e-01L, /* 0x3ffd9e6f, 0x145e9b00, 0x6d8c1749, 0xd2928623 */
+qa4 = 1.69183273898369996364661075664302225e-01L, /* 0x3ffc5a7c, 0xc2a363c1, 0xd6c19097, 0xef9b4063 */
+qa5 = 7.44476185988067992342479750486764248e-02L, /* 0x3ffb30ef, 0xfc7259ef, 0x1bcbb089, 0x686dd62d */
+qa6 = 2.02981172725892407200420389604788573e-02L, /* 0x3ff94c90, 0x7976cb0e, 0x21e1d36b, 0x0f09ca2b */
+qa7 = 6.94281866271607668268269403102277234e-03L, /* 0x3ff7c701, 0x2b193250, 0xc5d46ecc, 0x374843d8 */
+qa8 = 1.12952275469171559611651594706820034e-03L, /* 0x3ff52818, 0xfd2a7c06, 0xd13e38fd, 0xda4b34f5 */
+qa9 = 3.13736683241992737197226578597710179e-04L, /* 0x3ff348fa, 0x0cb48d18, 0x051f849b, 0x135ccf74 */
+qa10 = 1.17037675204033225470121134087771410e-05L, /* 0x3fee88b6, 0x98f47704, 0xa5d8f8f2, 0xc6422e11 */
+qa11 = 4.61312518293853991439362806880973592e-06L, /* 0x3fed3594, 0xe31db94f, 0x3592b693, 0xed4386b4 */
+qa12 = -1.02158572037456893687737553657431771e-06L; /* 0xbfeb123a, 0xd60d9b1e, 0x1f6fdeb9, 0x7dc8410a */
+/*
+ * Domain [1.25,2.85715], range ~[-2.922e-37,2.922e-37]:
+ * |log(x*erfc(x)) + x**2 + 0.5625 - ra(x)/sa(x)| < 2**-121.36
+ */
+static const long double
+ra0 = -9.86494292470069009555706994426014461e-03L, /* 0xbff84341, 0x239e8709, 0xe941b06a, 0xcb4b6ec5 */
+ra1 = -1.13580436992565640457579040117568870e+00L, /* 0xbfff22c4, 0x133f7c0d, 0x72d5e231, 0x2eb1ee3f */
+ra2 = -4.89744330295291950661185707066921755e+01L, /* 0xc00487cb, 0xa38b4fc2, 0xc136695b, 0xc1df8047 */
+ra3 = -1.10766149300215937173768072715352140e+03L, /* 0xc00914ea, 0x55e6beb3, 0xabc50e07, 0xb6e5664d */
+ra4 = -1.49991031232170934967642795601952100e+04L, /* 0xc00cd4b8, 0xd33243e6, 0xffbf6545, 0x3c57ef6e */
+ra5 = -1.29805749738318462882524181556996692e+05L, /* 0xc00ffb0d, 0xbfeed9b6, 0x5b2a3ff4, 0xe245bd3c */
+ra6 = -7.42828497044940065828871976644647850e+05L, /* 0xc0126ab5, 0x8fe7caca, 0x473352d9, 0xcd4e0c90 */
+ra7 = -2.85637299581890734287995171242421106e+06L, /* 0xc0145cad, 0xa7f76fe7, 0x3e358051, 0x1799f927 */
+ra8 = -7.40674797129824999383748865571026084e+06L, /* 0xc015c412, 0x6fe29c02, 0x298ad158, 0x7d24e45c */
+ra9 = -1.28653420911930973914078724204151759e+07L, /* 0xc016889e, 0x7c2eb0dc, 0x95d5863b, 0x0aa34dc3 */
+ra10 = -1.47198163599330179552932489109452638e+07L, /* 0xc016c136, 0x90b84923, 0xf9bcb497, 0x19bbd0f5 */
+ra11 = -1.07812992258382800318665248311522624e+07L, /* 0xc0164904, 0xe673a113, 0x35d7f079, 0xe13701f3 */
+ra12 = -4.83545565681708642630419905537756076e+06L, /* 0xc0152721, 0xfea094a8, 0x869eb39d, 0x413d6f13 */
+ra13 = -1.23956521201673964822976917356685286e+06L, /* 0xc0132ea0, 0xd3646baa, 0x2fe62b0d, 0xbae5ce85 */
+ra14 = -1.62289333553652417591275333240371812e+05L, /* 0xc0103cf8, 0xaab1e2d6, 0x4c25e014, 0x248d76ab */
+ra15 = -8.82890392601176969729168894389833110e+03L, /* 0xc00c13e7, 0x3b3d8f94, 0x6fbda6f6, 0xe7049a82 */
+ra16 = -1.22591866337261720023681535568334619e+02L, /* 0xc005ea5e, 0x12358891, 0xcfa712c5, 0x77f050d4 */
+sa1 = 6.44508918884710829371852723353794047e+01L, /* 0x400501cd, 0xb69a6c0f, 0x5716de14, 0x47161af6 */
+sa2 = 1.76118475473171481523704824327358534e+03L, /* 0x4009b84b, 0xd305829f, 0xc4c771b0, 0xbf1f7f9b */
+sa3 = 2.69448346969488374857087646131950188e+04L, /* 0x400da503, 0x56bacc05, 0x4fdba68d, 0x2cca27e6 */
+sa4 = 2.56826633369941456778326497384543763e+05L, /* 0x4010f59d, 0x51124428, 0x69c41de6, 0xbd0d5753 */
+sa5 = 1.60647413092257206847700054645905859e+06L, /* 0x40138834, 0xa2184244, 0x557a1bed, 0x68c9d556 */
+sa6 = 6.76963075165099718574753447122393797e+06L, /* 0x40159d2f, 0x7b01b0cc, 0x8bac9e95, 0x5d35d56e */
+sa7 = 1.94295690905361884290986932493647741e+07L, /* 0x40172878, 0xc1172d61, 0x3068501e, 0x2f3c71da */
+sa8 = 3.79774781017759149060839255547073541e+07L, /* 0x401821be, 0xc30d06fe, 0x410563d7, 0x032111fd */
+sa9 = 5.00659831846029484248302236457727397e+07L, /* 0x40187df9, 0x1f97a111, 0xc51d6ac2, 0x4b389793 */
+sa10 = 4.36486287620506484276130525941972541e+07L, /* 0x40184d03, 0x3a618ae0, 0x2a723357, 0xfa45c60a */
+sa11 = 2.43779678791333894255510508253951934e+07L, /* 0x401773fa, 0x6fe10ee2, 0xc467850d, 0xc6b7ff30 */
+sa12 = 8.30732360384443202039372372212966542e+06L, /* 0x4015fb09, 0xee6a5631, 0xdd98de7e, 0x8b00461a */
+sa13 = 1.60160846942050515734192397495105693e+06L, /* 0x40138704, 0x8782bf13, 0x5b8fb315, 0xa898abe5 */
+sa14 = 1.54255505242533291014555153757001825e+05L, /* 0x40102d47, 0xc0abc98e, 0x843c9490, 0xb4352440 */
+sa15 = 5.87949220002375547561467275493888824e+03L, /* 0x400b6f77, 0xe00d21d1, 0xec4d41e8, 0x2f8e1673 */
+sa16 = 4.97272976346793193860385983372237710e+01L; /* 0x40048dd1, 0x816c1b3f, 0x24f540a6, 0x4cfe03cc */
+/*
+ * Domain [2.85715,9], range ~[-7.886e-37,7.918e-37]:
+ * |log(x*erfc(x)) + x**2 + 0.5625 - rb(x)/sb(x)| < 2**-120
+ */
+static const long double
+rb0 = -9.86494292470008707171371994479162369e-3L, /* 0xbff84341, 0x239e86f4, 0x2f57e561, 0xf4469360 */
+rb1 = -1.57047326624110727986326503729442830L, /* 0xbfff920a, 0x8935bf73, 0x8803b894, 0x4656482d */
+rb2 = -1.03228196364885474342132255440317065e2L, /* 0xc0059ce9, 0xac4ed0ff, 0x2cff0ff7, 0x5e70d1ab */
+rb3 = -3.74000570653418227179358710865224376e3L, /* 0xc00ad380, 0x2ebf7835, 0xf6b07ed2, 0x861242f7 */
+rb4 = -8.35435477739098044190860390632813956e4L, /* 0xc00f4657, 0x8c3ae934, 0x3647d7b3, 0x80e76fb7 */
+rb5 = -1.21398672055223642118716640216747152e6L, /* 0xc0132862, 0x2b8761c8, 0x27d18c0f, 0x137c9463 */
+rb6 = -1.17669175877248796101665344873273970e7L, /* 0xc0166719, 0x0b2cea46, 0x81f14174, 0x11602ea5 */
+rb7 = -7.66108006086998253606773064264599615e7L, /* 0xc019243f, 0x3c26f4f0, 0x1cc05241, 0x3b953728 */
+rb8 = -3.32547117558141845968704725353130804e8L, /* 0xc01b3d24, 0x42d8ee26, 0x24ef6f3b, 0x604a8c65 */
+rb9 = -9.41561252426350696802167711221739746e8L, /* 0xc01cc0f8, 0xad23692a, 0x8ddb2310, 0xe9937145 */
+rb10 = -1.67157110805390944549427329626281063e9L, /* 0xc01d8e88, 0x9a903734, 0x09a55fa3, 0xd205c903 */
+rb11 = -1.74339631004410841337645931421427373e9L, /* 0xc01d9fa8, 0x77582d2a, 0xc183b8ab, 0x7e00cb05 */
+rb12 = -9.57655233596934915727573141357471703e8L, /* 0xc01cc8a5, 0x460cc685, 0xd0271fa0, 0x6a70e3da */
+rb13 = -2.26320062731339353035254704082495066e8L, /* 0xc01aafab, 0xd7d76721, 0xc9720e11, 0x6a8bd489 */
+rb14 = -1.42777302996263256686002973851837039e7L, /* 0xc016b3b8, 0xc499689f, 0x2b88d965, 0xc32414f9 */
+sb1 = 1.08512869705594540211033733976348506e2L, /* 0x4005b20d, 0x2db7528d, 0x00d20dcb, 0x858f6191 */
+sb2 = 5.02757713761390460534494530537572834e3L, /* 0x400b3a39, 0x3bf4a690, 0x3025d28d, 0xfd40a891 */
+sb3 = 1.31019107205412870059331647078328430e5L, /* 0x400fffcb, 0x1b71d05e, 0x3b28361d, 0x2a3c3690 */
+sb4 = 2.13021555152296846166736757455018030e6L, /* 0x40140409, 0x3c6984df, 0xc4491d7c, 0xb04aa08d */
+sb5 = 2.26649105281820861953868568619768286e7L, /* 0x401759d6, 0xce8736f0, 0xf28ad037, 0x2a901e0c */
+sb6 = 1.61071939490875921812318684143076081e8L, /* 0x401a3338, 0x686fb541, 0x6bd27d06, 0x4f95c9ac */
+sb7 = 7.66895673844301852676056750497991966e8L, /* 0x401c6daf, 0x31cec121, 0x54699126, 0x4bd9bf9e */
+sb8 = 2.41884450436101936436023058196042526e9L, /* 0x401e2059, 0x46b0b8d7, 0x87b64cbf, 0x78bc296d */
+sb9 = 4.92403055884071695093305291535107666e9L, /* 0x401f257e, 0xbe5ed739, 0x39e17346, 0xcadd2e55 */
+sb10 = 6.18627786365587486459633615573786416e9L, /* 0x401f70bb, 0x1be7a7e7, 0x6a45b5ae, 0x607c70f0 */
+sb11 = 4.45898013426501378097430226324743199e9L, /* 0x401f09c6, 0xa32643d7, 0xf1724620, 0x9ea46c32 */
+sb12 = 1.63006115763329848117160344854224975e9L, /* 0x401d84a3, 0x0996887f, 0x65a4f43b, 0x978c1d74 */
+sb13 = 2.39216717012421697446304015847567721e8L, /* 0x401ac845, 0x09a065c2, 0x30095da7, 0x9d72d6ae */
+sb14 = 7.84837329009278694937250358810225609e6L; /* 0x4015df06, 0xd5290e15, 0x63031fac, 0x4d9c894c */
+/*
+ * Domain [9,108], range ~[-5.324e-38,5.340e-38]:
+ * |log(x*erfc(x)) + x**2 + 0.5625 - r(x)/s(x)| < 2**-124
+ */
+static const long double
+rc0 = -9.86494292470008707171367567652935673e-3L, /* 0xbff84341, 0x239e86f4, 0x2f57e55b, 0x1aa10fd3 */
+rc1 = -1.26229447747315096406518846411562266L, /* 0xbfff4325, 0xbb1aab28, 0xda395cd9, 0xfb861c15 */
+rc2 = -6.13742634438922591780742637728666162e1L, /* 0xc004eafe, 0x7dd51cd8, 0x3c7c5928, 0x751e50cf */
+rc3 = -1.50455835478908280402912854338421517e3L, /* 0xc0097823, 0xbc15b9ab, 0x3d60745c, 0x523e80a5 */
+rc4 = -2.04415631865861549920184039902945685e4L, /* 0xc00d3f66, 0x40b3fc04, 0x5388f2ec, 0xb009e1f0 */
+rc5 = -1.57625662981714582753490610560037638e5L, /* 0xc01033dc, 0xd4dc95b6, 0xfd4da93b, 0xf355b4a9 */
+rc6 = -6.73473451616752528402917538033283794e5L, /* 0xc01248d8, 0x2e73a4f9, 0xcded49c5, 0xfa3bfeb7 */
+rc7 = -1.47433165421387483167186683764364857e6L, /* 0xc01367f1, 0xba77a8f7, 0xcfdd0dbb, 0x25d554b3 */
+rc8 = -1.38811981807868828563794929997744139e6L, /* 0xc01352e5, 0x7d16d9ad, 0xbbdcbf38, 0x38fbc5ea */
+rc9 = -3.59659700530831825640766479698155060e5L, /* 0xc0115f3a, 0xecd57f45, 0x21f8ad6c, 0x910a5958 */
+sc1 = 7.72730753022908298637508998072635696e1L, /* 0x40053517, 0xa10d52bc, 0xdabb55b6, 0xbd0328cd */
+sc2 = 2.36825757341694050500333261769082182e3L, /* 0x400a2808, 0x3e0a9b42, 0x82977842, 0x9c5de29e */
+sc3 = 3.72210540173034735352888847134073099e4L, /* 0x400e22ca, 0x1ba827ef, 0xac8390d7, 0x1fc39a41 */
+sc4 = 3.24136032646418336712461033591393412e5L, /* 0x40113c8a, 0x0216e100, 0xc59d1e44, 0xf0e68d9d */
+sc5 = 1.57836135851134393802505823370009175e6L, /* 0x40138157, 0x95bc7664, 0x17575961, 0xdbe58eeb */
+sc6 = 4.12881981392063738026679089714182355e6L, /* 0x4014f801, 0x9e82e8d2, 0xb8b3a70e, 0xfd84185d */
+sc7 = 5.24438427289213488410596395361544142e6L, /* 0x40154017, 0x81177109, 0x2aa6c3b0, 0x1f106625 */
+sc8 = 2.59909544563616121735963429710382149e6L, /* 0x40143d45, 0xbb90a9b1, 0x12bf9390, 0xa827a700 */
+sc9 = 2.80930665169282501639651995082335693e5L; /* 0x40111258, 0xaa92222e, 0xa97e3216, 0xa237fa6c */
+
+long double
+erfl(long double x)
+{
+ long double ax,R,S,P,Q,s,y,z,r;
+ uint64_t lx, llx;
+ int32_t i;
+ uint16_t hx;
+
+ EXTRACT_LDBL128_WORDS(hx, lx, llx, x);
+
+ if((hx & 0x7fff) == 0x7fff) { /* erfl(nan)=nan */
+ i = (hx>>15)<<1;
+ return (1-i)+one/x; /* erfl(+-inf)=+-1 */
+ }
+
+ ax = fabsl(x);
+ if(ax < 0.84375) {
+ if(ax < 0x1p-40L) {
+ if(ax < 0x1p-16373L)
+ return (8*x+efx8*x)/8; /* avoid spurious underflow */
+ return x + efx*x;
+ }
+ z = x*x;
+ r = pp0+z*(pp1+z*(pp2+z*(pp3+z*(pp4+z*(pp5+z*(pp6+z*(pp7+
+ z*(pp8+z*pp9))))))));
+ s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*(qq5+z*(qq6+z*(qq7+
+ z*(qq8+z*qq9))))))));
+ y = r/s;
+ return x + x*y;
+ }
+ if(ax < 1.25) {
+ s = ax-one;
+ P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*(pa6+s*(pa7+
+ s*(pa8+s*(pa9+s*(pa10+s*pa11))))))))));
+ Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*(qa6+s*(qa7+
+ s*(qa8+s*(qa9+s*(qa10+s*(qa11+s*qa12)))))))))));
+ if(x>=0) return (erx + P/Q); else return (-erx - P/Q);
+ }
+ if (ax >= 9) { /* inf>|x|>= 9 */
+ if(x>=0) return (one-tiny); else return (tiny-one);
+ }
+ s = one/(ax*ax);
+ if(ax < 2.85715) { /* |x| < 2.85715 */
+ R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*(ra7+
+ s*(ra8+s*(ra9+s*(ra10+s*(ra11+s*(ra12+s*(ra13+s*(ra14+
+ s*(ra15+s*ra16)))))))))))))));
+ S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+
+ s*(sa8+s*(sa9+s*(sa10+s*(sa11+s*(sa12+s*(sa13+s*(sa14+
+ s*(sa15+s*sa16)))))))))))))));
+ } else { /* |x| >= 2.85715 */
+ R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*(rb6+s*(rb7+
+ s*(rb8+s*(rb9+s*(rb10+s*(rb11+s*(rb12+s*(rb13+
+ s*rb14)))))))))))));
+ S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*(sb7+
+ s*(sb8+s*(sb9+s*(sb10+s*(sb11+s*(sb12+s*(sb13+
+ s*sb14)))))))))))));
+ }
+ z = (float)ax;
+ r = expl(-z*z-0.5625)*expl((z-ax)*(z+ax)+R/S);
+ if(x>=0) return (one-r/ax); else return (r/ax-one);
+}
+
+long double
+erfcl(long double x)
+{
+ long double ax,R,S,P,Q,s,y,z,r;
+ uint64_t lx, llx;
+ uint16_t hx;
+
+ EXTRACT_LDBL128_WORDS(hx, lx, llx, x);
+
+ if((hx & 0x7fff) == 0x7fff) { /* erfcl(nan)=nan */
+ /* erfcl(+-inf)=0,2 */
+ return ((hx>>15)<<1)+one/x;
+ }
+
+ ax = fabsl(x);
+ if(ax < 0.84375L) {
+ if(ax < 0x1p-34L)
+ return one-x;
+ z = x*x;
+ r = pp0+z*(pp1+z*(pp2+z*(pp3+z*(pp4+z*(pp5+z*(pp6+z*(pp7+
+ z*(pp8+z*pp9))))))));
+ s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*(qq5+z*(qq6+z*(qq7+
+ z*(qq8+z*qq9))))))));
+ y = r/s;
+ if(ax < 0.25L) { /* x<1/4 */
+ return one-(x+x*y);
+ } else {
+ r = x*y;
+ r += (x-half);
+ return half - r;
+ }
+ }
+ if(ax < 1.25L) {
+ s = ax-one;
+ P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*(pa6+s*(pa7+
+ s*(pa8+s*(pa9+s*(pa10+s*pa11))))))))));
+ Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*(qa6+s*(qa7+
+ s*(qa8+s*(qa9+s*(qa10+s*(qa11+s*qa12)))))))))));
+ if(x>=0) {
+ z = one-erx; return z - P/Q;
+ } else {
+ z = erx+P/Q; return one+z;
+ }
+ }
+
+ if(ax < 108) { /* |x| < 108 */
+ s = one/(ax*ax);
+ if(ax < 2.85715) { /* |x| < 2.85715 */
+ R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*(ra7+
+ s*(ra8+s*(ra9+s*(ra10+s*(ra11+s*(ra12+s*(ra13+s*(ra14+
+ s*(ra15+s*ra16)))))))))))))));
+ S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+
+ s*(sa8+s*(sa9+s*(sa10+s*(sa11+s*(sa12+s*(sa13+s*(sa14+
+ s*(sa15+s*sa16)))))))))))))));
+ } else if(ax < 9) {
+ R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*(rb6+s*(rb7+
+ s*(rb8+s*(rb9+s*(rb10+s*(rb11+s*(rb12+s*(rb13+
+ s*rb14)))))))))))));
+ S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*(sb7+
+ s*(sb8+s*(sb9+s*(sb10+s*(sb11+s*(sb12+s*(sb13+
+ s*sb14)))))))))))));
+ } else {
+ if(x < -9) return two-tiny; /* x < -9 */
+ R=rc0+s*(rc1+s*(rc2+s*(rc3+s*(rc4+s*(rc5+s*(rc6+s*(rc7+
+ s*(rc8+s*rc9))))))));
+ S=one+s*(sc1+s*(sc2+s*(sc3+s*(sc4+s*(sc5+s*(sc6+s*(sc7+
+ s*(sc8+s*sc9))))))));
+ }
+ z = (float)ax;
+ r = expl(-z*z-0.5625)*expl((z-ax)*(z+ax)+R/S);
+ if(x>0) return r/ax; else return two-r/ax;
+ } else {
+ if(x>0) return tiny*tiny; else return two-tiny;
+ }
+}
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_exp2l.c b/libm/upstream-freebsd/lib/msun/ld128/s_exp2l.c
index 5ed514c..5afa37e 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/s_exp2l.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_exp2l.c
@@ -369,7 +369,7 @@
|| u.xbits.manl != 0
|| (hx & 0x8000) == 0)
return (x + x); /* x is NaN or +Inf */
- else
+ else
return (0.0); /* x is -Inf */
}
if (x >= 16384)
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_expl.c b/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
index 176c932..a6a9676 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
@@ -38,16 +38,15 @@
#include "fpmath.h"
#include "math.h"
#include "math_private.h"
+#include "k_expl.h"
-#define INTERVALS 128
-#define LOG2_INTERVALS 7
-#define BIAS (LDBL_MAX_EXP - 1)
+/* XXX Prevent compilers from erroneously constant folding these: */
+static const volatile long double
+huge = 0x1p10000L,
+tiny = 0x1p-10000L;
static const long double
-huge = 0x1p10000L,
twom10000 = 0x1p-10000L;
-/* XXX Prevent gcc from erroneously constant folding this: */
-static volatile const long double tiny = 0x1p-10000L;
static const long double
/* log(2**16384 - 0.5) rounded towards zero: */
@@ -56,184 +55,16 @@
/* log(2**(-16381-64-1)) rounded towards zero: */
u_threshold = -11433.462743336297878837243843452621503L;
-static const double
-/*
- * ln2/INTERVALS = L1+L2 (hi+lo decomposition for multiplication). L1 must
- * have at least 22 (= log2(|LDBL_MIN_EXP-extras|) + log2(INTERVALS)) lowest
- * bits zero so that multiplication of it by n is exact.
- */
-INV_L = 1.8466496523378731e+2, /* 0x171547652b82fe.0p-45 */
-L2 = -1.0253670638894731e-29; /* -0x1.9ff0342542fc3p-97 */
-static const long double
-/* 0x1.62e42fefa39ef35793c768000000p-8 */
-L1 = 5.41521234812457272982212595914567508e-3L;
-
-static const long double
-/*
- * Domain [-0.002708, 0.002708], range ~[-2.4021e-38, 2.4234e-38]:
- * |exp(x) - p(x)| < 2**-124.9
- * (0.002708 is ln2/(2*INTERVALS) rounded up a little).
- */
-A2 = 0.5,
-A3 = 1.66666666666666666666666666651085500e-1L,
-A4 = 4.16666666666666666666666666425885320e-2L,
-A5 = 8.33333333333333333334522877160175842e-3L,
-A6 = 1.38888888888888888889971139751596836e-3L;
-
-static const double
-A7 = 1.9841269841269471e-4,
-A8 = 2.4801587301585284e-5,
-A9 = 2.7557324277411234e-6,
-A10 = 2.7557333722375072e-7;
-
-static const struct {
- /*
- * hi must be rounded to at most 106 bits so that multiplication
- * by r1 in expm1l() is exact, but it is rounded to 88 bits due to
- * historical accidents.
- */
- long double hi;
- long double lo;
-} tbl[INTERVALS] = {
- 0x1p0L, 0x0p0L,
- 0x1.0163da9fb33356d84a66aep0L, 0x3.36dcdfa4003ec04c360be2404078p-92L,
- 0x1.02c9a3e778060ee6f7cacap0L, 0x4.f7a29bde93d70a2cabc5cb89ba10p-92L,
- 0x1.04315e86e7f84bd738f9a2p0L, 0xd.a47e6ed040bb4bfc05af6455e9b8p-96L,
- 0x1.059b0d31585743ae7c548ep0L, 0xb.68ca417fe53e3495f7df4baf84a0p-92L,
- 0x1.0706b29ddf6ddc6dc403a8p0L, 0x1.d87b27ed07cb8b092ac75e311753p-88L,
- 0x1.0874518759bc808c35f25cp0L, 0x1.9427fa2b041b2d6829d8993a0d01p-88L,
- 0x1.09e3ecac6f3834521e060cp0L, 0x5.84d6b74ba2e023da730e7fccb758p-92L,
- 0x1.0b5586cf9890f6298b92b6p0L, 0x1.1842a98364291408b3ceb0a2a2bbp-88L,
- 0x1.0cc922b7247f7407b705b8p0L, 0x9.3dc5e8aac564e6fe2ef1d431fd98p-92L,
- 0x1.0e3ec32d3d1a2020742e4ep0L, 0x1.8af6a552ac4b358b1129e9f966a4p-88L,
- 0x1.0fb66affed31af232091dcp0L, 0x1.8a1426514e0b627bda694a400a27p-88L,
- 0x1.11301d0125b50a4ebbf1aep0L, 0xd.9318ceac5cc47ab166ee57427178p-92L,
- 0x1.12abdc06c31cbfb92bad32p0L, 0x4.d68e2f7270bdf7cedf94eb1cb818p-92L,
- 0x1.1429aaea92ddfb34101942p0L, 0x1.b2586d01844b389bea7aedd221d4p-88L,
- 0x1.15a98c8a58e512480d573cp0L, 0x1.d5613bf92a2b618ee31b376c2689p-88L,
- 0x1.172b83c7d517adcdf7c8c4p0L, 0x1.0eb14a792035509ff7d758693f24p-88L,
- 0x1.18af9388c8de9bbbf70b9ap0L, 0x3.c2505c97c0102e5f1211941d2840p-92L,
- 0x1.1a35beb6fcb753cb698f68p0L, 0x1.2d1c835a6c30724d5cfae31b84e5p-88L,
- 0x1.1bbe084045cd39ab1e72b4p0L, 0x4.27e35f9acb57e473915519a1b448p-92L,
- 0x1.1d4873168b9aa7805b8028p0L, 0x9.90f07a98b42206e46166cf051d70p-92L,
- 0x1.1ed5022fcd91cb8819ff60p0L, 0x1.121d1e504d36c47474c9b7de6067p-88L,
- 0x1.2063b88628cd63b8eeb028p0L, 0x1.50929d0fc487d21c2b84004264dep-88L,
- 0x1.21f49917ddc962552fd292p0L, 0x9.4bdb4b61ea62477caa1dce823ba0p-92L,
- 0x1.2387a6e75623866c1fadb0p0L, 0x1.c15cb593b0328566902df69e4de2p-88L,
- 0x1.251ce4fb2a63f3582ab7dep0L, 0x9.e94811a9c8afdcf796934bc652d0p-92L,
- 0x1.26b4565e27cdd257a67328p0L, 0x1.d3b249dce4e9186ddd5ff44e6b08p-92L,
- 0x1.284dfe1f5638096cf15cf0p0L, 0x3.ca0967fdaa2e52d7c8106f2e262cp-92L,
- 0x1.29e9df51fdee12c25d15f4p0L, 0x1.a24aa3bca890ac08d203fed80a07p-88L,
- 0x1.2b87fd0dad98ffddea4652p0L, 0x1.8fcab88442fdc3cb6de4519165edp-88L,
- 0x1.2d285a6e4030b40091d536p0L, 0xd.075384589c1cd1b3e4018a6b1348p-92L,
- 0x1.2ecafa93e2f5611ca0f45cp0L, 0x1.523833af611bdcda253c554cf278p-88L,
- 0x1.306fe0a31b7152de8d5a46p0L, 0x3.05c85edecbc27343629f502f1af2p-92L,
- 0x1.32170fc4cd8313539cf1c2p0L, 0x1.008f86dde3220ae17a005b6412bep-88L,
- 0x1.33c08b26416ff4c9c8610cp0L, 0x1.96696bf95d1593039539d94d662bp-88L,
- 0x1.356c55f929ff0c94623476p0L, 0x3.73af38d6d8d6f9506c9bbc93cbc0p-92L,
- 0x1.371a7373aa9caa7145502ep0L, 0x1.4547987e3e12516bf9c699be432fp-88L,
- 0x1.38cae6d05d86585a9cb0d8p0L, 0x1.bed0c853bd30a02790931eb2e8f0p-88L,
- 0x1.3a7db34e59ff6ea1bc9298p0L, 0x1.e0a1d336163fe2f852ceeb134067p-88L,
- 0x1.3c32dc313a8e484001f228p0L, 0xb.58f3775e06ab66353001fae9fca0p-92L,
- 0x1.3dea64c12342235b41223ep0L, 0x1.3d773fba2cb82b8244267c54443fp-92L,
- 0x1.3fa4504ac801ba0bf701aap0L, 0x4.1832fb8c1c8dbdff2c49909e6c60p-92L,
- 0x1.4160a21f72e29f84325b8ep0L, 0x1.3db61fb352f0540e6ba05634413ep-88L,
- 0x1.431f5d950a896dc7044394p0L, 0x1.0ccec81e24b0caff7581ef4127f7p-92L,
- 0x1.44e086061892d03136f408p0L, 0x1.df019fbd4f3b48709b78591d5cb5p-88L,
- 0x1.46a41ed1d005772512f458p0L, 0x1.229d97df404ff21f39c1b594d3a8p-88L,
- 0x1.486a2b5c13cd013c1a3b68p0L, 0x1.062f03c3dd75ce8757f780e6ec99p-88L,
- 0x1.4a32af0d7d3de672d8bcf4p0L, 0x6.f9586461db1d878b1d148bd3ccb8p-92L,
- 0x1.4bfdad5362a271d4397afep0L, 0xc.42e20e0363ba2e159c579f82e4b0p-92L,
- 0x1.4dcb299fddd0d63b36ef1ap0L, 0x9.e0cc484b25a5566d0bd5f58ad238p-92L,
- 0x1.4f9b2769d2ca6ad33d8b68p0L, 0x1.aa073ee55e028497a329a7333dbap-88L,
- 0x1.516daa2cf6641c112f52c8p0L, 0x4.d822190e718226177d7608d20038p-92L,
- 0x1.5342b569d4f81df0a83c48p0L, 0x1.d86a63f4e672a3e429805b049465p-88L,
- 0x1.551a4ca5d920ec52ec6202p0L, 0x4.34ca672645dc6c124d6619a87574p-92L,
- 0x1.56f4736b527da66ecb0046p0L, 0x1.64eb3c00f2f5ab3d801d7cc7272dp-88L,
- 0x1.58d12d497c7fd252bc2b72p0L, 0x1.43bcf2ec936a970d9cc266f0072fp-88L,
- 0x1.5ab07dd48542958c930150p0L, 0x1.91eb345d88d7c81280e069fbdb63p-88L,
- 0x1.5c9268a5946b701c4b1b80p0L, 0x1.6986a203d84e6a4a92f179e71889p-88L,
- 0x1.5e76f15ad21486e9be4c20p0L, 0x3.99766a06548a05829e853bdb2b52p-92L,
- 0x1.605e1b976dc08b076f592ap0L, 0x4.86e3b34ead1b4769df867b9c89ccp-92L,
- 0x1.6247eb03a5584b1f0fa06ep0L, 0x1.d2da42bb1ceaf9f732275b8aef30p-88L,
- 0x1.6434634ccc31fc76f8714cp0L, 0x4.ed9a4e41000307103a18cf7a6e08p-92L,
- 0x1.66238825522249127d9e28p0L, 0x1.b8f314a337f4dc0a3adf1787ff74p-88L,
- 0x1.68155d44ca973081c57226p0L, 0x1.b9f32706bfe4e627d809a85dcc66p-88L,
- 0x1.6a09e667f3bcc908b2fb12p0L, 0x1.66ea957d3e3adec17512775099dap-88L,
- 0x1.6c012750bdabeed76a9980p0L, 0xf.4f33fdeb8b0ecd831106f57b3d00p-96L,
- 0x1.6dfb23c651a2ef220e2cbep0L, 0x1.bbaa834b3f11577ceefbe6c1c411p-92L,
- 0x1.6ff7df9519483cf87e1b4ep0L, 0x1.3e213bff9b702d5aa477c12523cep-88L,
- 0x1.71f75e8ec5f73dd2370f2ep0L, 0xf.0acd6cb434b562d9e8a20adda648p-92L,
- 0x1.73f9a48a58173bd5c9a4e6p0L, 0x8.ab1182ae217f3a7681759553e840p-92L,
- 0x1.75feb564267c8bf6e9aa32p0L, 0x1.a48b27071805e61a17b954a2dad8p-88L,
- 0x1.780694fde5d3f619ae0280p0L, 0x8.58b2bb2bdcf86cd08e35fb04c0f0p-92L,
- 0x1.7a11473eb0186d7d51023ep0L, 0x1.6cda1f5ef42b66977960531e821bp-88L,
- 0x1.7c1ed0130c1327c4933444p0L, 0x1.937562b2dc933d44fc828efd4c9cp-88L,
- 0x1.7e2f336cf4e62105d02ba0p0L, 0x1.5797e170a1427f8fcdf5f3906108p-88L,
- 0x1.80427543e1a11b60de6764p0L, 0x9.a354ea706b8e4d8b718a672bf7c8p-92L,
- 0x1.82589994cce128acf88afap0L, 0xb.34a010f6ad65cbbac0f532d39be0p-92L,
- 0x1.8471a4623c7acce52f6b96p0L, 0x1.c64095370f51f48817914dd78665p-88L,
- 0x1.868d99b4492ec80e41d90ap0L, 0xc.251707484d73f136fb5779656b70p-92L,
- 0x1.88ac7d98a669966530bcdep0L, 0x1.2d4e9d61283ef385de170ab20f96p-88L,
- 0x1.8ace5422aa0db5ba7c55a0p0L, 0x1.92c9bb3e6ed61f2733304a346d8fp-88L,
- 0x1.8cf3216b5448bef2aa1cd0p0L, 0x1.61c55d84a9848f8c453b3ca8c946p-88L,
- 0x1.8f1ae991577362b982745cp0L, 0x7.2ed804efc9b4ae1458ae946099d4p-92L,
- 0x1.9145b0b91ffc588a61b468p0L, 0x1.f6b70e01c2a90229a4c4309ea719p-88L,
- 0x1.93737b0cdc5e4f4501c3f2p0L, 0x5.40a22d2fc4af581b63e8326efe9cp-92L,
- 0x1.95a44cbc8520ee9b483694p0L, 0x1.a0fc6f7c7d61b2b3a22a0eab2cadp-88L,
- 0x1.97d829fde4e4f8b9e920f8p0L, 0x1.1e8bd7edb9d7144b6f6818084cc7p-88L,
- 0x1.9a0f170ca07b9ba3109b8cp0L, 0x4.6737beb19e1eada6825d3c557428p-92L,
- 0x1.9c49182a3f0901c7c46b06p0L, 0x1.1f2be58ddade50c217186c90b457p-88L,
- 0x1.9e86319e323231824ca78ep0L, 0x6.4c6e010f92c082bbadfaf605cfd4p-92L,
- 0x1.a0c667b5de564b29ada8b8p0L, 0xc.ab349aa0422a8da7d4512edac548p-92L,
- 0x1.a309bec4a2d3358c171f76p0L, 0x1.0daad547fa22c26d168ea762d854p-88L,
- 0x1.a5503b23e255c8b424491cp0L, 0xa.f87bc8050a405381703ef7caff50p-92L,
- 0x1.a799e1330b3586f2dfb2b0p0L, 0x1.58f1a98796ce8908ae852236ca94p-88L,
- 0x1.a9e6b5579fdbf43eb243bcp0L, 0x1.ff4c4c58b571cf465caf07b4b9f5p-88L,
- 0x1.ac36bbfd3f379c0db966a2p0L, 0x1.1265fc73e480712d20f8597a8e7bp-88L,
- 0x1.ae89f995ad3ad5e8734d16p0L, 0x1.73205a7fbc3ae675ea440b162d6cp-88L,
- 0x1.b0e07298db66590842acdep0L, 0x1.c6f6ca0e5dcae2aafffa7a0554cbp-88L,
- 0x1.b33a2b84f15faf6bfd0e7ap0L, 0x1.d947c2575781dbb49b1237c87b6ep-88L,
- 0x1.b59728de559398e3881110p0L, 0x1.64873c7171fefc410416be0a6525p-88L,
- 0x1.b7f76f2fb5e46eaa7b081ap0L, 0xb.53c5354c8903c356e4b625aacc28p-92L,
- 0x1.ba5b030a10649840cb3c6ap0L, 0xf.5b47f297203757e1cc6eadc8bad0p-92L,
- 0x1.bcc1e904bc1d2247ba0f44p0L, 0x1.b3d08cd0b20287092bd59be4ad98p-88L,
- 0x1.bf2c25bd71e088408d7024p0L, 0x1.18e3449fa073b356766dfb568ff4p-88L,
- 0x1.c199bdd85529c2220cb12ap0L, 0x9.1ba6679444964a36661240043970p-96L,
- 0x1.c40ab5fffd07a6d14df820p0L, 0xf.1828a5366fd387a7bdd54cdf7300p-92L,
- 0x1.c67f12e57d14b4a2137fd2p0L, 0xf.2b301dd9e6b151a6d1f9d5d5f520p-96L,
- 0x1.c8f6d9406e7b511acbc488p0L, 0x5.c442ddb55820171f319d9e5076a8p-96L,
- 0x1.cb720dcef90691503cbd1ep0L, 0x9.49db761d9559ac0cb6dd3ed599e0p-92L,
- 0x1.cdf0b555dc3f9c44f8958ep0L, 0x1.ac51be515f8c58bdfb6f5740a3a4p-88L,
- 0x1.d072d4a07897b8d0f22f20p0L, 0x1.a158e18fbbfc625f09f4cca40874p-88L,
- 0x1.d2f87080d89f18ade12398p0L, 0x9.ea2025b4c56553f5cdee4c924728p-92L,
- 0x1.d5818dcfba48725da05aeap0L, 0x1.66e0dca9f589f559c0876ff23830p-88L,
- 0x1.d80e316c98397bb84f9d04p0L, 0x8.805f84bec614de269900ddf98d28p-92L,
- 0x1.da9e603db3285708c01a5ap0L, 0x1.6d4c97f6246f0ec614ec95c99392p-88L,
- 0x1.dd321f301b4604b695de3cp0L, 0x6.30a393215299e30d4fb73503c348p-96L,
- 0x1.dfc97337b9b5eb968cac38p0L, 0x1.ed291b7225a944efd5bb5524b927p-88L,
- 0x1.e264614f5a128a12761fa0p0L, 0x1.7ada6467e77f73bf65e04c95e29dp-88L,
- 0x1.e502ee78b3ff6273d13014p0L, 0x1.3991e8f49659e1693be17ae1d2f9p-88L,
- 0x1.e7a51fbc74c834b548b282p0L, 0x1.23786758a84f4956354634a416cep-88L,
- 0x1.ea4afa2a490d9858f73a18p0L, 0xf.5db301f86dea20610ceee13eb7b8p-92L,
- 0x1.ecf482d8e67f08db0312fap0L, 0x1.949cef462010bb4bc4ce72a900dfp-88L,
- 0x1.efa1bee615a27771fd21a8p0L, 0x1.2dac1f6dd5d229ff68e46f27e3dfp-88L,
- 0x1.f252b376bba974e8696fc2p0L, 0x1.6390d4c6ad5476b5162f40e1d9a9p-88L,
- 0x1.f50765b6e4540674f84b76p0L, 0x2.862baff99000dfc4352ba29b8908p-92L,
- 0x1.f7bfdad9cbe138913b4bfep0L, 0x7.2bd95c5ce7280fa4d2344a3f5618p-92L,
- 0x1.fa7c1819e90d82e90a7e74p0L, 0xb.263c1dc060c36f7650b4c0f233a8p-92L,
- 0x1.fd3c22b8f71f10975ba4b2p0L, 0x1.2bcf3a5e12d269d8ad7c1a4a8875p-88L
-};
-
long double
expl(long double x)
{
- union IEEEl2bits u, v;
- long double q, r, r1, t, twopk, twopkp10000;
- double dr, fn, r2;
- int k, n, n2;
+ union IEEEl2bits u;
+ long double hi, lo, t, twopk;
+ int k;
uint16_t hx, ix;
+ DOPRINT_START(&x);
+
/* Filter out exceptional cases. */
u.e = x;
hx = u.xbits.expsign;
@@ -241,60 +72,33 @@
if (ix >= BIAS + 13) { /* |x| >= 8192 or x is NaN */
if (ix == BIAS + LDBL_MAX_EXP) {
if (hx & 0x8000) /* x is -Inf or -NaN */
- return (-1 / x);
- return (x + x); /* x is +Inf or +NaN */
+ RETURNP(-1 / x);
+ RETURNP(x + x); /* x is +Inf or +NaN */
}
if (x > o_threshold)
- return (huge * huge);
+ RETURNP(huge * huge);
if (x < u_threshold)
- return (tiny * tiny);
+ RETURNP(tiny * tiny);
} else if (ix < BIAS - 114) { /* |x| < 0x1p-114 */
- return (1 + x); /* 1 with inexact iff x != 0 */
+ RETURN2P(1, x); /* 1 with inexact iff x != 0 */
}
ENTERI();
- /* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */
- /* Use a specialized rint() to get fn. Assume round-to-nearest. */
- /* XXX assume no extra precision for the additions, as for trig fns. */
- /* XXX this set of comments is now quadruplicated. */
- fn = (double)x * INV_L + 0x1.8p52 - 0x1.8p52;
-#if defined(HAVE_EFFICIENT_IRINT)
- n = irint(fn);
-#else
- n = (int)fn;
-#endif
- n2 = (unsigned)n % INTERVALS;
- k = n >> LOG2_INTERVALS;
- r1 = x - fn * L1;
- r2 = fn * -L2;
- r = r1 + r2;
-
- /* Prepare scale factors. */
- /* XXX sparc64 multiplication is so slow that scalbnl() is faster. */
- v.e = 1;
- if (k >= LDBL_MIN_EXP) {
- v.xbits.expsign = BIAS + k;
- twopk = v.e;
- } else {
- v.xbits.expsign = BIAS + k + 10000;
- twopkp10000 = v.e;
- }
-
- /* Evaluate expl(endpoint[n2] + r1 + r2) = tbl[n2] * expl(r1 + r2). */
- dr = r;
- q = r2 + r * r * (A2 + r * (A3 + r * (A4 + r * (A5 + r * (A6 +
- dr * (A7 + dr * (A8 + dr * (A9 + dr * A10))))))));
- t = tbl[n2].lo + tbl[n2].hi;
- t = tbl[n2].lo + t * (q + r1) + tbl[n2].hi;
+ twopk = 1;
+ __k_expl(x, &hi, &lo, &k);
+ t = SUM2P(hi, lo);
/* Scale by 2**k. */
+ /* XXX sparc64 multiplication is so slow that scalbnl() is faster. */
if (k >= LDBL_MIN_EXP) {
if (k == LDBL_MAX_EXP)
RETURNI(t * 2 * 0x1p16383L);
+ SET_LDBL_EXPSIGN(twopk, BIAS + k);
RETURNI(t * twopk);
} else {
- RETURNI(t * twopkp10000 * twom10000);
+ SET_LDBL_EXPSIGN(twopk, BIAS + k + 10000);
+ RETURNI(t * twopk * twom10000);
}
}
@@ -312,6 +116,12 @@
* Setting T3 to 0 would require the |x| < 0x1p-113 condition to appear
* in both subintervals, so set T3 = 2**-5, which places the condition
* into the [T1, T3] interval.
+ *
+ * XXX we now do this more to (partially) balance the number of terms
+ * in the C and D polys than to avoid checking the condition in both
+ * intervals.
+ *
+ * XXX these micro-optimizations are excessive.
*/
static const double
T1 = -0.1659, /* ~-30.625/128 * log(2) */
@@ -321,6 +131,12 @@
/*
* Domain [-0.1659, 0.03125], range ~[2.9134e-44, 1.8404e-37]:
* |(exp(x)-1-x-x**2/2)/x - p(x)| < 2**-122.03
+ *
+ * XXX none of the long double C or D coeffs except C10 is correctly printed.
+ * If you re-print their values in %.35Le format, the result is always
+ * different. For example, the last 2 digits in C3 should be 59, not 67.
+ * 67 is apparently from rounding an extra-precision value to 36 decimal
+ * places.
*/
static const long double
C3 = 1.66666666666666666666666666666666667e-1L,
@@ -335,6 +151,13 @@
C12 = 2.08767569878679576457272282566520649e-9L,
C13 = 1.60590438367252471783548748824255707e-10L;
+/*
+ * XXX this has 1 more coeff than needed.
+ * XXX can start the double coeffs but not the double mults at C10.
+ * With my coeffs (C10-C17 double; s = best_s):
+ * Domain [-0.1659, 0.03125], range ~[-1.1976e-37, 1.1976e-37]:
+ * |(exp(x)-1-x-x**2/2)/x - p(x)| ~< 2**-122.65
+ */
static const double
C14 = 1.1470745580491932e-11, /* 0x1.93974a81dae30p-37 */
C15 = 7.6471620181090468e-13, /* 0x1.ae7f3820adab1p-41 */
@@ -359,6 +182,13 @@
D12 = 2.08767569819738524488686318024854942e-9L,
D13 = 1.60590442297008495301927448122499313e-10L;
+/*
+ * XXX this has 1 more coeff than needed.
+ * XXX can start the double coeffs but not the double mults at D11.
+ * With my coeffs (D11-D16 double):
+ * Domain [0.03125, 0.1659], range ~[-1.1980e-37, 1.1980e-37]:
+ * |(exp(x)-1-x-x**2/2)/x - p(x)| ~< 2**-122.65
+ */
static const double
D14 = 1.1470726176204336e-11, /* 0x1.93971dc395d9ep-37 */
D15 = 7.6478532249581686e-13, /* 0x1.ae892e3D16fcep-41 */
@@ -375,6 +205,8 @@
int k, n, n2;
uint16_t hx, ix;
+ DOPRINT_START(&x);
+
/* Filter out exceptional cases. */
u.e = x;
hx = u.xbits.expsign;
@@ -382,11 +214,11 @@
if (ix >= BIAS + 7) { /* |x| >= 128 or x is NaN */
if (ix == BIAS + LDBL_MAX_EXP) {
if (hx & 0x8000) /* x is -Inf or -NaN */
- return (-1 / x - 1);
- return (x + x); /* x is +Inf or +NaN */
+ RETURNP(-1 / x - 1);
+ RETURNP(x + x); /* x is +Inf or +NaN */
}
if (x > o_threshold)
- return (huge * huge);
+ RETURNP(huge * huge);
/*
* expm1l() never underflows, but it must avoid
* unrepresentable large negative exponents. We used a
@@ -395,7 +227,7 @@
* in the same way as large ones here.
*/
if (hx & 0x8000) /* x <= -128 */
- return (tiny - 1); /* good for x < -114ln2 - eps */
+ RETURN2P(tiny, -1); /* good for x < -114ln2 - eps */
}
ENTERI();
@@ -407,7 +239,7 @@
if (x < T3) {
if (ix < BIAS - 113) { /* |x| < 0x1p-113 */
/* x (rounded) with inexact if x != 0: */
- RETURNI(x == 0 ? x :
+ RETURNPI(x == 0 ? x :
(0x1p200 * x + fabsl(x)) * 0x1p-200);
}
q = x * x2 * C3 + x2 * x2 * (C4 + x * (C5 + x * (C6 +
@@ -428,9 +260,9 @@
hx2_hi = x_hi * x_hi / 2;
hx2_lo = x_lo * (x + x_hi) / 2;
if (ix >= BIAS - 7)
- RETURNI(hx2_lo + x_lo + q + (hx2_hi + x_hi));
+ RETURN2PI(hx2_hi + x_hi, hx2_lo + x_lo + q);
else
- RETURNI(hx2_lo + q + hx2_hi + x);
+ RETURN2PI(x, hx2_lo + q + hx2_hi);
}
/* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */
@@ -463,21 +295,21 @@
t = tbl[n2].lo + tbl[n2].hi;
if (k == 0) {
- t = tbl[n2].lo * (r1 + 1) + t * q + tbl[n2].hi * r1 +
- (tbl[n2].hi - 1);
+ t = SUM2P(tbl[n2].hi - 1, tbl[n2].lo * (r1 + 1) + t * q +
+ tbl[n2].hi * r1);
RETURNI(t);
}
if (k == -1) {
- t = tbl[n2].lo * (r1 + 1) + t * q + tbl[n2].hi * r1 +
- (tbl[n2].hi - 2);
+ t = SUM2P(tbl[n2].hi - 2, tbl[n2].lo * (r1 + 1) + t * q +
+ tbl[n2].hi * r1);
RETURNI(t / 2);
}
if (k < -7) {
- t = tbl[n2].lo + t * (q + r1) + tbl[n2].hi;
+ t = SUM2P(tbl[n2].hi, tbl[n2].lo + t * (q + r1));
RETURNI(t * twopk - 1);
}
if (k > 2 * LDBL_MANT_DIG - 1) {
- t = tbl[n2].lo + t * (q + r1) + tbl[n2].hi;
+ t = SUM2P(tbl[n2].hi, tbl[n2].lo + t * (q + r1));
if (k == LDBL_MAX_EXP)
RETURNI(t * 2 * 0x1p16383L - 1);
RETURNI(t * twopk - 1);
@@ -487,8 +319,8 @@
twomk = v.e;
if (k > LDBL_MANT_DIG - 1)
- t = tbl[n2].lo - twomk + t * (q + r1) + tbl[n2].hi;
+ t = SUM2P(tbl[n2].hi, tbl[n2].lo - twomk + t * (q + r1));
else
- t = tbl[n2].lo + t * (q + r1) + (tbl[n2].hi - twomk);
+ t = SUM2P(tbl[n2].hi - twomk, tbl[n2].lo + t * (q + r1));
RETURNI(t * twopk);
}
diff --git a/libm/upstream-freebsd/lib/msun/src/catrig.c b/libm/upstream-freebsd/lib/msun/src/catrig.c
new file mode 100644
index 0000000..200977c
--- /dev/null
+++ b/libm/upstream-freebsd/lib/msun/src/catrig.c
@@ -0,0 +1,639 @@
+/*-
+ * Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG>
+ * 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 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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <complex.h>
+#include <float.h>
+
+#include "math.h"
+#include "math_private.h"
+
+#undef isinf
+#define isinf(x) (fabs(x) == INFINITY)
+#undef isnan
+#define isnan(x) ((x) != (x))
+#define raise_inexact() do { volatile float junk = 1 + tiny; } while(0)
+#undef signbit
+#define signbit(x) (__builtin_signbit(x))
+
+/* We need that DBL_EPSILON^2/128 is larger than FOUR_SQRT_MIN. */
+static const double
+A_crossover = 10, /* Hull et al suggest 1.5, but 10 works better */
+B_crossover = 0.6417, /* suggested by Hull et al */
+FOUR_SQRT_MIN = 0x1p-509, /* >= 4 * sqrt(DBL_MIN) */
+QUARTER_SQRT_MAX = 0x1p509, /* <= sqrt(DBL_MAX) / 4 */
+m_e = 2.7182818284590452e0, /* 0x15bf0a8b145769.0p-51 */
+m_ln2 = 6.9314718055994531e-1, /* 0x162e42fefa39ef.0p-53 */
+pio2_hi = 1.5707963267948966e0, /* 0x1921fb54442d18.0p-52 */
+RECIP_EPSILON = 1 / DBL_EPSILON,
+SQRT_3_EPSILON = 2.5809568279517849e-8, /* 0x1bb67ae8584caa.0p-78 */
+SQRT_6_EPSILON = 3.6500241499888571e-8, /* 0x13988e1409212e.0p-77 */
+SQRT_MIN = 0x1p-511; /* >= sqrt(DBL_MIN) */
+
+static const volatile double
+pio2_lo = 6.1232339957367659e-17; /* 0x11a62633145c07.0p-106 */
+static const volatile float
+tiny = 0x1p-100;
+
+static double complex clog_for_large_values(double complex z);
+
+/*
+ * Testing indicates that all these functions are accurate up to 4 ULP.
+ * The functions casin(h) and cacos(h) are about 2.5 times slower than asinh.
+ * The functions catan(h) are a little under 2 times slower than atanh.
+ *
+ * The code for casinh, casin, cacos, and cacosh comes first. The code is
+ * rather complicated, and the four functions are highly interdependent.
+ *
+ * The code for catanh and catan comes at the end. It is much simpler than
+ * the other functions, and the code for these can be disconnected from the
+ * rest of the code.
+ */
+
+/*
+ * ================================
+ * | casinh, casin, cacos, cacosh |
+ * ================================
+ */
+
+/*
+ * The algorithm is very close to that in "Implementing the complex arcsine
+ * and arccosine functions using exception handling" by T. E. Hull, Thomas F.
+ * Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on
+ * Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335,
+ * http://dl.acm.org/citation.cfm?id=275324.
+ *
+ * Throughout we use the convention z = x + I*y.
+ *
+ * casinh(z) = sign(x)*log(A+sqrt(A*A-1)) + I*asin(B)
+ * where
+ * A = (|z+I| + |z-I|) / 2
+ * B = (|z+I| - |z-I|) / 2 = y/A
+ *
+ * These formulas become numerically unstable:
+ * (a) for Re(casinh(z)) when z is close to the line segment [-I, I] (that
+ * is, Re(casinh(z)) is close to 0);
+ * (b) for Im(casinh(z)) when z is close to either of the intervals
+ * [I, I*infinity) or (-I*infinity, -I] (that is, |Im(casinh(z))| is
+ * close to PI/2).
+ *
+ * These numerical problems are overcome by defining
+ * f(a, b) = (hypot(a, b) - b) / 2 = a*a / (hypot(a, b) + b) / 2
+ * Then if A < A_crossover, we use
+ * log(A + sqrt(A*A-1)) = log1p((A-1) + sqrt((A-1)*(A+1)))
+ * A-1 = f(x, 1+y) + f(x, 1-y)
+ * and if B > B_crossover, we use
+ * asin(B) = atan2(y, sqrt(A*A - y*y)) = atan2(y, sqrt((A+y)*(A-y)))
+ * A-y = f(x, y+1) + f(x, y-1)
+ * where without loss of generality we have assumed that x and y are
+ * non-negative.
+ *
+ * Much of the difficulty comes because the intermediate computations may
+ * produce overflows or underflows. This is dealt with in the paper by Hull
+ * et al by using exception handling. We do this by detecting when
+ * computations risk underflow or overflow. The hardest part is handling the
+ * underflows when computing f(a, b).
+ *
+ * Note that the function f(a, b) does not appear explicitly in the paper by
+ * Hull et al, but the idea may be found on pages 308 and 309. Introducing the
+ * function f(a, b) allows us to concentrate many of the clever tricks in this
+ * paper into one function.
+ */
+
+/*
+ * Function f(a, b, hypot_a_b) = (hypot(a, b) - b) / 2.
+ * Pass hypot(a, b) as the third argument.
+ */
+static inline double
+f(double a, double b, double hypot_a_b)
+{
+ if (b < 0)
+ return ((hypot_a_b - b) / 2);
+ if (b == 0)
+ return (a / 2);
+ return (a * a / (hypot_a_b + b) / 2);
+}
+
+/*
+ * All the hard work is contained in this function.
+ * x and y are assumed positive or zero, and less than RECIP_EPSILON.
+ * Upon return:
+ * rx = Re(casinh(z)) = -Im(cacos(y + I*x)).
+ * B_is_usable is set to 1 if the value of B is usable.
+ * If B_is_usable is set to 0, sqrt_A2my2 = sqrt(A*A - y*y), and new_y = y.
+ * If returning sqrt_A2my2 has potential to result in an underflow, it is
+ * rescaled, and new_y is similarly rescaled.
+ */
+static inline void
+do_hard_work(double x, double y, double *rx, int *B_is_usable, double *B,
+ double *sqrt_A2my2, double *new_y)
+{
+ double R, S, A; /* A, B, R, and S are as in Hull et al. */
+ double Am1, Amy; /* A-1, A-y. */
+
+ R = hypot(x, y + 1); /* |z+I| */
+ S = hypot(x, y - 1); /* |z-I| */
+
+ /* A = (|z+I| + |z-I|) / 2 */
+ A = (R + S) / 2;
+ /*
+ * Mathematically A >= 1. There is a small chance that this will not
+ * be so because of rounding errors. So we will make certain it is
+ * so.
+ */
+ if (A < 1)
+ A = 1;
+
+ if (A < A_crossover) {
+ /*
+ * Am1 = fp + fm, where fp = f(x, 1+y), and fm = f(x, 1-y).
+ * rx = log1p(Am1 + sqrt(Am1*(A+1)))
+ */
+ if (y == 1 && x < DBL_EPSILON * DBL_EPSILON / 128) {
+ /*
+ * fp is of order x^2, and fm = x/2.
+ * A = 1 (inexactly).
+ */
+ *rx = sqrt(x);
+ } else if (x >= DBL_EPSILON * fabs(y - 1)) {
+ /*
+ * Underflow will not occur because
+ * x >= DBL_EPSILON^2/128 >= FOUR_SQRT_MIN
+ */
+ Am1 = f(x, 1 + y, R) + f(x, 1 - y, S);
+ *rx = log1p(Am1 + sqrt(Am1 * (A + 1)));
+ } else if (y < 1) {
+ /*
+ * fp = x*x/(1+y)/4, fm = x*x/(1-y)/4, and
+ * A = 1 (inexactly).
+ */
+ *rx = x / sqrt((1 - y) * (1 + y));
+ } else { /* if (y > 1) */
+ /*
+ * A-1 = y-1 (inexactly).
+ */
+ *rx = log1p((y - 1) + sqrt((y - 1) * (y + 1)));
+ }
+ } else {
+ *rx = log(A + sqrt(A * A - 1));
+ }
+
+ *new_y = y;
+
+ if (y < FOUR_SQRT_MIN) {
+ /*
+ * Avoid a possible underflow caused by y/A. For casinh this
+ * would be legitimate, but will be picked up by invoking atan2
+ * later on. For cacos this would not be legitimate.
+ */
+ *B_is_usable = 0;
+ *sqrt_A2my2 = A * (2 / DBL_EPSILON);
+ *new_y = y * (2 / DBL_EPSILON);
+ return;
+ }
+
+ /* B = (|z+I| - |z-I|) / 2 = y/A */
+ *B = y / A;
+ *B_is_usable = 1;
+
+ if (*B > B_crossover) {
+ *B_is_usable = 0;
+ /*
+ * Amy = fp + fm, where fp = f(x, y+1), and fm = f(x, y-1).
+ * sqrt_A2my2 = sqrt(Amy*(A+y))
+ */
+ if (y == 1 && x < DBL_EPSILON / 128) {
+ /*
+ * fp is of order x^2, and fm = x/2.
+ * A = 1 (inexactly).
+ */
+ *sqrt_A2my2 = sqrt(x) * sqrt((A + y) / 2);
+ } else if (x >= DBL_EPSILON * fabs(y - 1)) {
+ /*
+ * Underflow will not occur because
+ * x >= DBL_EPSILON/128 >= FOUR_SQRT_MIN
+ * and
+ * x >= DBL_EPSILON^2 >= FOUR_SQRT_MIN
+ */
+ Amy = f(x, y + 1, R) + f(x, y - 1, S);
+ *sqrt_A2my2 = sqrt(Amy * (A + y));
+ } else if (y > 1) {
+ /*
+ * fp = x*x/(y+1)/4, fm = x*x/(y-1)/4, and
+ * A = y (inexactly).
+ *
+ * y < RECIP_EPSILON. So the following
+ * scaling should avoid any underflow problems.
+ */
+ *sqrt_A2my2 = x * (4 / DBL_EPSILON / DBL_EPSILON) * y /
+ sqrt((y + 1) * (y - 1));
+ *new_y = y * (4 / DBL_EPSILON / DBL_EPSILON);
+ } else { /* if (y < 1) */
+ /*
+ * fm = 1-y >= DBL_EPSILON, fp is of order x^2, and
+ * A = 1 (inexactly).
+ */
+ *sqrt_A2my2 = sqrt((1 - y) * (1 + y));
+ }
+ }
+}
+
+/*
+ * casinh(z) = z + O(z^3) as z -> 0
+ *
+ * casinh(z) = sign(x)*clog(sign(x)*z) + O(1/z^2) as z -> infinity
+ * The above formula works for the imaginary part as well, because
+ * Im(casinh(z)) = sign(x)*atan2(sign(x)*y, fabs(x)) + O(y/z^3)
+ * as z -> infinity, uniformly in y
+ */
+double complex
+casinh(double complex z)
+{
+ double x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y;
+ int B_is_usable;
+ double complex w;
+
+ x = creal(z);
+ y = cimag(z);
+ ax = fabs(x);
+ ay = fabs(y);
+
+ if (isnan(x) || isnan(y)) {
+ /* casinh(+-Inf + I*NaN) = +-Inf + I*NaN */
+ if (isinf(x))
+ return (cpack(x, y + y));
+ /* casinh(NaN + I*+-Inf) = opt(+-)Inf + I*NaN */
+ if (isinf(y))
+ return (cpack(y, x + x));
+ /* casinh(NaN + I*0) = NaN + I*0 */
+ if (y == 0)
+ return (cpack(x + x, y));
+ /*
+ * All other cases involving NaN return NaN + I*NaN.
+ * C99 leaves it optional whether to raise invalid if one of
+ * the arguments is not NaN, so we opt not to raise it.
+ */
+ return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ }
+
+ if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
+ /* clog...() will raise inexact unless x or y is infinite. */
+ if (signbit(x) == 0)
+ w = clog_for_large_values(z) + m_ln2;
+ else
+ w = clog_for_large_values(-z) + m_ln2;
+ return (cpack(copysign(creal(w), x), copysign(cimag(w), y)));
+ }
+
+ /* Avoid spuriously raising inexact for z = 0. */
+ if (x == 0 && y == 0)
+ return (z);
+
+ /* All remaining cases are inexact. */
+ raise_inexact();
+
+ if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
+ return (z);
+
+ do_hard_work(ax, ay, &rx, &B_is_usable, &B, &sqrt_A2my2, &new_y);
+ if (B_is_usable)
+ ry = asin(B);
+ else
+ ry = atan2(new_y, sqrt_A2my2);
+ return (cpack(copysign(rx, x), copysign(ry, y)));
+}
+
+/*
+ * casin(z) = reverse(casinh(reverse(z)))
+ * where reverse(x + I*y) = y + I*x = I*conj(z).
+ */
+double complex
+casin(double complex z)
+{
+ double complex w = casinh(cpack(cimag(z), creal(z)));
+
+ return (cpack(cimag(w), creal(w)));
+}
+
+/*
+ * cacos(z) = PI/2 - casin(z)
+ * but do the computation carefully so cacos(z) is accurate when z is
+ * close to 1.
+ *
+ * cacos(z) = PI/2 - z + O(z^3) as z -> 0
+ *
+ * cacos(z) = -sign(y)*I*clog(z) + O(1/z^2) as z -> infinity
+ * The above formula works for the real part as well, because
+ * Re(cacos(z)) = atan2(fabs(y), x) + O(y/z^3)
+ * as z -> infinity, uniformly in y
+ */
+double complex
+cacos(double complex z)
+{
+ double x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x;
+ int sx, sy;
+ int B_is_usable;
+ double complex w;
+
+ x = creal(z);
+ y = cimag(z);
+ sx = signbit(x);
+ sy = signbit(y);
+ ax = fabs(x);
+ ay = fabs(y);
+
+ if (isnan(x) || isnan(y)) {
+ /* cacos(+-Inf + I*NaN) = NaN + I*opt(-)Inf */
+ if (isinf(x))
+ return (cpack(y + y, -INFINITY));
+ /* cacos(NaN + I*+-Inf) = NaN + I*-+Inf */
+ if (isinf(y))
+ return (cpack(x + x, -y));
+ /* cacos(0 + I*NaN) = PI/2 + I*NaN with inexact */
+ if (x == 0)
+ return (cpack(pio2_hi + pio2_lo, y + y));
+ /*
+ * All other cases involving NaN return NaN + I*NaN.
+ * C99 leaves it optional whether to raise invalid if one of
+ * the arguments is not NaN, so we opt not to raise it.
+ */
+ return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ }
+
+ if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
+ /* clog...() will raise inexact unless x or y is infinite. */
+ w = clog_for_large_values(z);
+ rx = fabs(cimag(w));
+ ry = creal(w) + m_ln2;
+ if (sy == 0)
+ ry = -ry;
+ return (cpack(rx, ry));
+ }
+
+ /* Avoid spuriously raising inexact for z = 1. */
+ if (x == 1 && y == 0)
+ return (cpack(0, -y));
+
+ /* All remaining cases are inexact. */
+ raise_inexact();
+
+ if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
+ return (cpack(pio2_hi - (x - pio2_lo), -y));
+
+ do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x);
+ if (B_is_usable) {
+ if (sx == 0)
+ rx = acos(B);
+ else
+ rx = acos(-B);
+ } else {
+ if (sx == 0)
+ rx = atan2(sqrt_A2mx2, new_x);
+ else
+ rx = atan2(sqrt_A2mx2, -new_x);
+ }
+ if (sy == 0)
+ ry = -ry;
+ return (cpack(rx, ry));
+}
+
+/*
+ * cacosh(z) = I*cacos(z) or -I*cacos(z)
+ * where the sign is chosen so Re(cacosh(z)) >= 0.
+ */
+double complex
+cacosh(double complex z)
+{
+ double complex w;
+ double rx, ry;
+
+ w = cacos(z);
+ rx = creal(w);
+ ry = cimag(w);
+ /* cacosh(NaN + I*NaN) = NaN + I*NaN */
+ if (isnan(rx) && isnan(ry))
+ return (cpack(ry, rx));
+ /* cacosh(NaN + I*+-Inf) = +Inf + I*NaN */
+ /* cacosh(+-Inf + I*NaN) = +Inf + I*NaN */
+ if (isnan(rx))
+ return (cpack(fabs(ry), rx));
+ /* cacosh(0 + I*NaN) = NaN + I*NaN */
+ if (isnan(ry))
+ return (cpack(ry, ry));
+ return (cpack(fabs(ry), copysign(rx, cimag(z))));
+}
+
+/*
+ * Optimized version of clog() for |z| finite and larger than ~RECIP_EPSILON.
+ */
+static double complex
+clog_for_large_values(double complex z)
+{
+ double x, y;
+ double ax, ay, t;
+
+ x = creal(z);
+ y = cimag(z);
+ ax = fabs(x);
+ ay = fabs(y);
+ if (ax < ay) {
+ t = ax;
+ ax = ay;
+ ay = t;
+ }
+
+ /*
+ * Avoid overflow in hypot() when x and y are both very large.
+ * Divide x and y by E, and then add 1 to the logarithm. This depends
+ * on E being larger than sqrt(2).
+ * Dividing by E causes an insignificant loss of accuracy; however
+ * this method is still poor since it is uneccessarily slow.
+ */
+ if (ax > DBL_MAX / 2)
+ return (cpack(log(hypot(x / m_e, y / m_e)) + 1, atan2(y, x)));
+
+ /*
+ * Avoid overflow when x or y is large. Avoid underflow when x or
+ * y is small.
+ */
+ if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN)
+ return (cpack(log(hypot(x, y)), atan2(y, x)));
+
+ return (cpack(log(ax * ax + ay * ay) / 2, atan2(y, x)));
+}
+
+/*
+ * =================
+ * | catanh, catan |
+ * =================
+ */
+
+/*
+ * sum_squares(x,y) = x*x + y*y (or just x*x if y*y would underflow).
+ * Assumes x*x and y*y will not overflow.
+ * Assumes x and y are finite.
+ * Assumes y is non-negative.
+ * Assumes fabs(x) >= DBL_EPSILON.
+ */
+static inline double
+sum_squares(double x, double y)
+{
+
+ /* Avoid underflow when y is small. */
+ if (y < SQRT_MIN)
+ return (x * x);
+
+ return (x * x + y * y);
+}
+
+/*
+ * real_part_reciprocal(x, y) = Re(1/(x+I*y)) = x/(x*x + y*y).
+ * Assumes x and y are not NaN, and one of x and y is larger than
+ * RECIP_EPSILON. We avoid unwarranted underflow. It is important to not use
+ * the code creal(1/z), because the imaginary part may produce an unwanted
+ * underflow.
+ * This is only called in a context where inexact is always raised before
+ * the call, so no effort is made to avoid or force inexact.
+ */
+static inline double
+real_part_reciprocal(double x, double y)
+{
+ double scale;
+ uint32_t hx, hy;
+ int32_t ix, iy;
+
+ /*
+ * This code is inspired by the C99 document n1124.pdf, Section G.5.1,
+ * example 2.
+ */
+ GET_HIGH_WORD(hx, x);
+ ix = hx & 0x7ff00000;
+ GET_HIGH_WORD(hy, y);
+ iy = hy & 0x7ff00000;
+#define BIAS (DBL_MAX_EXP - 1)
+/* XXX more guard digits are useful iff there is extra precision. */
+#define CUTOFF (DBL_MANT_DIG / 2 + 1) /* just half or 1 guard digit */
+ if (ix - iy >= CUTOFF << 20 || isinf(x))
+ return (1 / x); /* +-Inf -> +-0 is special */
+ if (iy - ix >= CUTOFF << 20)
+ return (x / y / y); /* should avoid double div, but hard */
+ if (ix <= (BIAS + DBL_MAX_EXP / 2 - CUTOFF) << 20)
+ return (x / (x * x + y * y));
+ scale = 1;
+ SET_HIGH_WORD(scale, 0x7ff00000 - ix); /* 2**(1-ilogb(x)) */
+ x *= scale;
+ y *= scale;
+ return (x / (x * x + y * y) * scale);
+}
+
+/*
+ * catanh(z) = log((1+z)/(1-z)) / 2
+ * = log1p(4*x / |z-1|^2) / 4
+ * + I * atan2(2*y, (1-x)*(1+x)-y*y) / 2
+ *
+ * catanh(z) = z + O(z^3) as z -> 0
+ *
+ * catanh(z) = 1/z + sign(y)*I*PI/2 + O(1/z^3) as z -> infinity
+ * The above formula works for the real part as well, because
+ * Re(catanh(z)) = x/|z|^2 + O(x/z^4)
+ * as z -> infinity, uniformly in x
+ */
+double complex
+catanh(double complex z)
+{
+ double x, y, ax, ay, rx, ry;
+
+ x = creal(z);
+ y = cimag(z);
+ ax = fabs(x);
+ ay = fabs(y);
+
+ /* This helps handle many cases. */
+ if (y == 0 && ax <= 1)
+ return (cpack(atanh(x), y));
+
+ /* To ensure the same accuracy as atan(), and to filter out z = 0. */
+ if (x == 0)
+ return (cpack(x, atan(y)));
+
+ if (isnan(x) || isnan(y)) {
+ /* catanh(+-Inf + I*NaN) = +-0 + I*NaN */
+ if (isinf(x))
+ return (cpack(copysign(0, x), y + y));
+ /* catanh(NaN + I*+-Inf) = sign(NaN)0 + I*+-PI/2 */
+ if (isinf(y))
+ return (cpack(copysign(0, x),
+ copysign(pio2_hi + pio2_lo, y)));
+ /*
+ * All other cases involving NaN return NaN + I*NaN.
+ * C99 leaves it optional whether to raise invalid if one of
+ * the arguments is not NaN, so we opt not to raise it.
+ */
+ return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ }
+
+ if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
+ return (cpack(real_part_reciprocal(x, y),
+ copysign(pio2_hi + pio2_lo, y)));
+
+ if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) {
+ /*
+ * z = 0 was filtered out above. All other cases must raise
+ * inexact, but this is the only only that needs to do it
+ * explicitly.
+ */
+ raise_inexact();
+ return (z);
+ }
+
+ if (ax == 1 && ay < DBL_EPSILON)
+ rx = (m_ln2 - log(ay)) / 2;
+ else
+ rx = log1p(4 * ax / sum_squares(ax - 1, ay)) / 4;
+
+ if (ax == 1)
+ ry = atan2(2, -ay) / 2;
+ else if (ay < DBL_EPSILON)
+ ry = atan2(2 * ay, (1 - ax) * (1 + ax)) / 2;
+ else
+ ry = atan2(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2;
+
+ return (cpack(copysign(rx, x), copysign(ry, y)));
+}
+
+/*
+ * catan(z) = reverse(catanh(reverse(z)))
+ * where reverse(x + I*y) = y + I*x = I*conj(z).
+ */
+double complex
+catan(double complex z)
+{
+ double complex w = catanh(cpack(cimag(z), creal(z)));
+
+ return (cpack(cimag(w), creal(w)));
+}
diff --git a/libm/upstream-freebsd/lib/msun/src/catrigf.c b/libm/upstream-freebsd/lib/msun/src/catrigf.c
new file mode 100644
index 0000000..08ebef7
--- /dev/null
+++ b/libm/upstream-freebsd/lib/msun/src/catrigf.c
@@ -0,0 +1,393 @@
+/*-
+ * Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG>
+ * 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 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 AUTHOR 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 algorithm is very close to that in "Implementing the complex arcsine
+ * and arccosine functions using exception handling" by T. E. Hull, Thomas F.
+ * Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on
+ * Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335,
+ * http://dl.acm.org/citation.cfm?id=275324.
+ *
+ * See catrig.c for complete comments.
+ *
+ * XXX comments were removed automatically, and even short ones on the right
+ * of statements were removed (all of them), contrary to normal style. Only
+ * a few comments on the right of declarations remain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <complex.h>
+#include <float.h>
+
+#include "math.h"
+#include "math_private.h"
+
+#undef isinf
+#define isinf(x) (fabsf(x) == INFINITY)
+#undef isnan
+#define isnan(x) ((x) != (x))
+#define raise_inexact() do { volatile float junk = 1 + tiny; } while(0)
+#undef signbit
+#define signbit(x) (__builtin_signbitf(x))
+
+static const float
+A_crossover = 10,
+B_crossover = 0.6417,
+FOUR_SQRT_MIN = 0x1p-61,
+QUARTER_SQRT_MAX = 0x1p61,
+m_e = 2.7182818285e0, /* 0xadf854.0p-22 */
+m_ln2 = 6.9314718056e-1, /* 0xb17218.0p-24 */
+pio2_hi = 1.5707962513e0, /* 0xc90fda.0p-23 */
+RECIP_EPSILON = 1 / FLT_EPSILON,
+SQRT_3_EPSILON = 5.9801995673e-4, /* 0x9cc471.0p-34 */
+SQRT_6_EPSILON = 8.4572793338e-4, /* 0xddb3d7.0p-34 */
+SQRT_MIN = 0x1p-63;
+
+static const volatile float
+pio2_lo = 7.5497899549e-8, /* 0xa22169.0p-47 */
+tiny = 0x1p-100;
+
+static float complex clog_for_large_values(float complex z);
+
+static inline float
+f(float a, float b, float hypot_a_b)
+{
+ if (b < 0)
+ return ((hypot_a_b - b) / 2);
+ if (b == 0)
+ return (a / 2);
+ return (a * a / (hypot_a_b + b) / 2);
+}
+
+static inline void
+do_hard_work(float x, float y, float *rx, int *B_is_usable, float *B,
+ float *sqrt_A2my2, float *new_y)
+{
+ float R, S, A;
+ float Am1, Amy;
+
+ R = hypotf(x, y + 1);
+ S = hypotf(x, y - 1);
+
+ A = (R + S) / 2;
+ if (A < 1)
+ A = 1;
+
+ if (A < A_crossover) {
+ if (y == 1 && x < FLT_EPSILON * FLT_EPSILON / 128) {
+ *rx = sqrtf(x);
+ } else if (x >= FLT_EPSILON * fabsf(y - 1)) {
+ Am1 = f(x, 1 + y, R) + f(x, 1 - y, S);
+ *rx = log1pf(Am1 + sqrtf(Am1 * (A + 1)));
+ } else if (y < 1) {
+ *rx = x / sqrtf((1 - y) * (1 + y));
+ } else {
+ *rx = log1pf((y - 1) + sqrtf((y - 1) * (y + 1)));
+ }
+ } else {
+ *rx = logf(A + sqrtf(A * A - 1));
+ }
+
+ *new_y = y;
+
+ if (y < FOUR_SQRT_MIN) {
+ *B_is_usable = 0;
+ *sqrt_A2my2 = A * (2 / FLT_EPSILON);
+ *new_y = y * (2 / FLT_EPSILON);
+ return;
+ }
+
+ *B = y / A;
+ *B_is_usable = 1;
+
+ if (*B > B_crossover) {
+ *B_is_usable = 0;
+ if (y == 1 && x < FLT_EPSILON / 128) {
+ *sqrt_A2my2 = sqrtf(x) * sqrtf((A + y) / 2);
+ } else if (x >= FLT_EPSILON * fabsf(y - 1)) {
+ Amy = f(x, y + 1, R) + f(x, y - 1, S);
+ *sqrt_A2my2 = sqrtf(Amy * (A + y));
+ } else if (y > 1) {
+ *sqrt_A2my2 = x * (4 / FLT_EPSILON / FLT_EPSILON) * y /
+ sqrtf((y + 1) * (y - 1));
+ *new_y = y * (4 / FLT_EPSILON / FLT_EPSILON);
+ } else {
+ *sqrt_A2my2 = sqrtf((1 - y) * (1 + y));
+ }
+ }
+}
+
+float complex
+casinhf(float complex z)
+{
+ float x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y;
+ int B_is_usable;
+ float complex w;
+
+ x = crealf(z);
+ y = cimagf(z);
+ ax = fabsf(x);
+ ay = fabsf(y);
+
+ if (isnan(x) || isnan(y)) {
+ if (isinf(x))
+ return (cpackf(x, y + y));
+ if (isinf(y))
+ return (cpackf(y, x + x));
+ if (y == 0)
+ return (cpackf(x + x, y));
+ return (cpackf(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ }
+
+ if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
+ if (signbit(x) == 0)
+ w = clog_for_large_values(z) + m_ln2;
+ else
+ w = clog_for_large_values(-z) + m_ln2;
+ return (cpackf(copysignf(crealf(w), x),
+ copysignf(cimagf(w), y)));
+ }
+
+ if (x == 0 && y == 0)
+ return (z);
+
+ raise_inexact();
+
+ if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
+ return (z);
+
+ do_hard_work(ax, ay, &rx, &B_is_usable, &B, &sqrt_A2my2, &new_y);
+ if (B_is_usable)
+ ry = asinf(B);
+ else
+ ry = atan2f(new_y, sqrt_A2my2);
+ return (cpackf(copysignf(rx, x), copysignf(ry, y)));
+}
+
+float complex
+casinf(float complex z)
+{
+ float complex w = casinhf(cpackf(cimagf(z), crealf(z)));
+
+ return (cpackf(cimagf(w), crealf(w)));
+}
+
+float complex
+cacosf(float complex z)
+{
+ float x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x;
+ int sx, sy;
+ int B_is_usable;
+ float complex w;
+
+ x = crealf(z);
+ y = cimagf(z);
+ sx = signbit(x);
+ sy = signbit(y);
+ ax = fabsf(x);
+ ay = fabsf(y);
+
+ if (isnan(x) || isnan(y)) {
+ if (isinf(x))
+ return (cpackf(y + y, -INFINITY));
+ if (isinf(y))
+ return (cpackf(x + x, -y));
+ if (x == 0)
+ return (cpackf(pio2_hi + pio2_lo, y + y));
+ return (cpackf(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ }
+
+ if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
+ w = clog_for_large_values(z);
+ rx = fabsf(cimagf(w));
+ ry = crealf(w) + m_ln2;
+ if (sy == 0)
+ ry = -ry;
+ return (cpackf(rx, ry));
+ }
+
+ if (x == 1 && y == 0)
+ return (cpackf(0, -y));
+
+ raise_inexact();
+
+ if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
+ return (cpackf(pio2_hi - (x - pio2_lo), -y));
+
+ do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x);
+ if (B_is_usable) {
+ if (sx == 0)
+ rx = acosf(B);
+ else
+ rx = acosf(-B);
+ } else {
+ if (sx == 0)
+ rx = atan2f(sqrt_A2mx2, new_x);
+ else
+ rx = atan2f(sqrt_A2mx2, -new_x);
+ }
+ if (sy == 0)
+ ry = -ry;
+ return (cpackf(rx, ry));
+}
+
+float complex
+cacoshf(float complex z)
+{
+ float complex w;
+ float rx, ry;
+
+ w = cacosf(z);
+ rx = crealf(w);
+ ry = cimagf(w);
+ if (isnan(rx) && isnan(ry))
+ return (cpackf(ry, rx));
+ if (isnan(rx))
+ return (cpackf(fabsf(ry), rx));
+ if (isnan(ry))
+ return (cpackf(ry, ry));
+ return (cpackf(fabsf(ry), copysignf(rx, cimagf(z))));
+}
+
+static float complex
+clog_for_large_values(float complex z)
+{
+ float x, y;
+ float ax, ay, t;
+
+ x = crealf(z);
+ y = cimagf(z);
+ ax = fabsf(x);
+ ay = fabsf(y);
+ if (ax < ay) {
+ t = ax;
+ ax = ay;
+ ay = t;
+ }
+
+ if (ax > FLT_MAX / 2)
+ return (cpackf(logf(hypotf(x / m_e, y / m_e)) + 1,
+ atan2f(y, x)));
+
+ if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN)
+ return (cpackf(logf(hypotf(x, y)), atan2f(y, x)));
+
+ return (cpackf(logf(ax * ax + ay * ay) / 2, atan2f(y, x)));
+}
+
+static inline float
+sum_squares(float x, float y)
+{
+
+ if (y < SQRT_MIN)
+ return (x * x);
+
+ return (x * x + y * y);
+}
+
+static inline float
+real_part_reciprocal(float x, float y)
+{
+ float scale;
+ uint32_t hx, hy;
+ int32_t ix, iy;
+
+ GET_FLOAT_WORD(hx, x);
+ ix = hx & 0x7f800000;
+ GET_FLOAT_WORD(hy, y);
+ iy = hy & 0x7f800000;
+#define BIAS (FLT_MAX_EXP - 1)
+#define CUTOFF (FLT_MANT_DIG / 2 + 1)
+ if (ix - iy >= CUTOFF << 23 || isinf(x))
+ return (1 / x);
+ if (iy - ix >= CUTOFF << 23)
+ return (x / y / y);
+ if (ix <= (BIAS + FLT_MAX_EXP / 2 - CUTOFF) << 23)
+ return (x / (x * x + y * y));
+ SET_FLOAT_WORD(scale, 0x7f800000 - ix);
+ x *= scale;
+ y *= scale;
+ return (x / (x * x + y * y) * scale);
+}
+
+float complex
+catanhf(float complex z)
+{
+ float x, y, ax, ay, rx, ry;
+
+ x = crealf(z);
+ y = cimagf(z);
+ ax = fabsf(x);
+ ay = fabsf(y);
+
+ if (y == 0 && ax <= 1)
+ return (cpackf(atanhf(x), y));
+
+ if (x == 0)
+ return (cpackf(x, atanf(y)));
+
+ if (isnan(x) || isnan(y)) {
+ if (isinf(x))
+ return (cpackf(copysignf(0, x), y + y));
+ if (isinf(y))
+ return (cpackf(copysignf(0, x),
+ copysignf(pio2_hi + pio2_lo, y)));
+ return (cpackf(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ }
+
+ if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
+ return (cpackf(real_part_reciprocal(x, y),
+ copysignf(pio2_hi + pio2_lo, y)));
+
+ if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) {
+ raise_inexact();
+ return (z);
+ }
+
+ if (ax == 1 && ay < FLT_EPSILON)
+ rx = (m_ln2 - logf(ay)) / 2;
+ else
+ rx = log1pf(4 * ax / sum_squares(ax - 1, ay)) / 4;
+
+ if (ax == 1)
+ ry = atan2f(2, -ay) / 2;
+ else if (ay < FLT_EPSILON)
+ ry = atan2f(2 * ay, (1 - ax) * (1 + ax)) / 2;
+ else
+ ry = atan2f(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2;
+
+ return (cpackf(copysignf(rx, x), copysignf(ry, y)));
+}
+
+float complex
+catanf(float complex z)
+{
+ float complex w = catanhf(cpackf(cimagf(z), crealf(z)));
+
+ return (cpackf(cimagf(w), crealf(w)));
+}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_acoshl.c b/libm/upstream-freebsd/lib/msun/src/e_acoshl.c
index 59faeb0..b9f3aed 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_acoshl.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_acoshl.c
@@ -7,7 +7,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
@@ -75,7 +75,7 @@
} else if (hx >= BIAS + EXP_LARGE) { /* x >= LARGE */
if (hx >= 0x7fff) { /* x is inf, NaN or misnormal */
RETURNI(x+x);
- } else
+ } else
RETURNI(logl(x)+ln2); /* acosh(huge)=log(2x), or misnormal */
} else if (hx == 0x3fff && x == 1) {
RETURNI(0.0); /* acosh(1) = 0 */
diff --git a/libm/upstream-freebsd/lib/msun/src/e_atanhl.c b/libm/upstream-freebsd/lib/msun/src/e_atanhl.c
index a888426..11d56ea 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_atanhl.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_atanhl.c
@@ -7,7 +7,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
@@ -68,7 +68,7 @@
if (ix < 0x3ffe) { /* |x| < 0.5, or misnormal */
t = x+x;
t = 0.5*log1pl(t+t*x/(one-x));
- } else
+ } else
t = 0.5*log1pl((x+x)/(one-x));
RETURNI((hx & 0x8000) == 0 ? t : -t);
}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_cosh.c b/libm/upstream-freebsd/lib/msun/src/e_cosh.c
index a363695..246b5fb 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_cosh.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_cosh.c
@@ -35,6 +35,8 @@
* only cosh(0)=1 is exact for finite x.
*/
+#include <float.h>
+
#include "math.h"
#include "math_private.h"
@@ -77,3 +79,7 @@
/* |x| > overflowthresold, cosh(x) overflow */
return huge*huge;
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(cosh, coshl);
+#endif
diff --git a/libm/upstream-freebsd/lib/msun/src/e_coshl.c b/libm/upstream-freebsd/lib/msun/src/e_coshl.c
new file mode 100644
index 0000000..0a21277
--- /dev/null
+++ b/libm/upstream-freebsd/lib/msun/src/e_coshl.c
@@ -0,0 +1,130 @@
+/* from: FreeBSD: head/lib/msun/src/e_coshl.c XXX */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * See e_cosh.c for complete comments.
+ *
+ * Converted to long double by Bruce D. Evans.
+ */
+
+#include <float.h>
+#ifdef __i386__
+#include <ieeefp.h>
+#endif
+
+#include "fpmath.h"
+#include "math.h"
+#include "math_private.h"
+#include "k_expl.h"
+
+#if LDBL_MAX_EXP != 0x4000
+/* We also require the usual expsign encoding. */
+#error "Unsupported long double format"
+#endif
+
+#define BIAS (LDBL_MAX_EXP - 1)
+
+static const volatile long double huge = 0x1p10000L, tiny = 0x1p-10000L;
+#if LDBL_MANT_DIG == 64
+/*
+ * Domain [-1, 1], range ~[-1.8211e-21, 1.8211e-21]:
+ * |cosh(x) - c(x)| < 2**-68.8
+ */
+static const union IEEEl2bits
+C4u = LD80C(0xaaaaaaaaaaaaac78, -5, 4.16666666666666682297e-2L);
+#define C4 C4u.e
+static const double
+C2 = 0.5,
+C6 = 1.3888888888888616e-3, /* 0x16c16c16c16b99.0p-62 */
+C8 = 2.4801587301767953e-5, /* 0x1a01a01a027061.0p-68 */
+C10 = 2.7557319163300398e-7, /* 0x127e4fb6c9b55f.0p-74 */
+C12 = 2.0876768371393075e-9, /* 0x11eed99406a3f4.0p-81 */
+C14 = 1.1469537039374480e-11, /* 0x1938c67cd18c48.0p-89 */
+C16 = 4.8473490896852041e-14; /* 0x1b49c429701e45.0p-97 */
+#elif LDBL_MANT_DIG == 113
+/*
+ * Domain [-1, 1], range ~[-2.3194e-37, 2.3194e-37]:
+ * |cosh(x) - c(x)| < 2**-121.69
+ */
+static const long double
+C4 = 4.16666666666666666666666666666666225e-2L, /* 0x1555555555555555555555555554e.0p-117L */
+C6 = 1.38888888888888888888888888889434831e-3L, /* 0x16c16c16c16c16c16c16c16c1dd7a.0p-122L */
+C8 = 2.48015873015873015873015871870962089e-5L, /* 0x1a01a01a01a01a01a01a017af2756.0p-128L */
+C10 = 2.75573192239858906525574318600800201e-7L, /* 0x127e4fb7789f5c72ef01c8a040640.0p-134L */
+C12 = 2.08767569878680989791444691755468269e-9L, /* 0x11eed8eff8d897b543d0679607399.0p-141L */
+C14= 1.14707455977297247387801189650495351e-11L, /* 0x193974a8c07c9d24ae169a7fa9b54.0p-149L */
+C16 = 4.77947733238737883626416876486279985e-14L; /* 0x1ae7f3e733b814d4e1b90f5727fe4.0p-157L */
+static const double
+C2 = 0.5,
+C18 = 1.5619206968597871e-16, /* 0x16827863b9900b.0p-105 */
+C20 = 4.1103176218528049e-19, /* 0x1e542ba3d3c269.0p-114 */
+C22 = 8.8967926401641701e-22, /* 0x10ce399542a014.0p-122 */
+C24 = 1.6116681626523904e-24, /* 0x1f2c981d1f0cb7.0p-132 */
+C26 = 2.5022374732804632e-27; /* 0x18c7ecf8b2c4a0.0p-141 */
+#else
+#error "Unsupported long double format"
+#endif /* LDBL_MANT_DIG == 64 */
+
+/* log(2**16385 - 0.5) rounded up: */
+static const float
+o_threshold = 1.13572168e4; /* 0xb174de.0p-10 */
+
+long double
+coshl(long double x)
+{
+ long double hi,lo,x2,x4;
+ double dx2;
+ uint16_t ix;
+
+ GET_LDBL_EXPSIGN(ix,x);
+ ix &= 0x7fff;
+
+ /* x is INF or NaN */
+ if(ix>=0x7fff) return x*x;
+
+ ENTERI();
+
+ /* |x| < 1, return 1 or c(x) */
+ if(ix<0x3fff) {
+ if (ix<BIAS-(LDBL_MANT_DIG+1)/2) /* |x| < TINY */
+ RETURNI(1+tiny); /* cosh(tiny) = 1(+) with inexact */
+ x2 = x*x;
+#if LDBL_MANT_DIG == 64
+ x4 = x2*x2;
+ RETURNI(((C16*x2 + C14)*x4 + (C12*x2 + C10))*(x4*x4*x2) +
+ ((C8*x2 + C6)*x2 + C4)*x4 + C2*x2 + 1);
+#elif LDBL_MANT_DIG == 113
+ dx2 = x2;
+ RETURNI((((((((((((C26*dx2 + C24)*dx2 + C22)*dx2 +
+ C20)*x2 + C18)*x2 +
+ C16)*x2 + C14)*x2 + C12)*x2 + C10)*x2 + C8)*x2 + C6)*x2 +
+ C4)*(x2*x2) + C2*x2 + 1);
+#endif
+ }
+
+ /* |x| in [1, 64), return accurate exp(|x|)/2+1/exp(|x|)/2 */
+ if (ix < 0x4005) {
+ k_hexpl(fabsl(x), &hi, &lo);
+ RETURNI(lo + 0.25/(hi + lo) + hi);
+ }
+
+ /* |x| in [64, o_threshold], return correctly-overflowing exp(|x|)/2 */
+ if (fabsl(x) <= o_threshold)
+ RETURNI(hexpl(fabsl(x)));
+
+ /* |x| > o_threshold, cosh(x) overflow */
+ RETURNI(huge*huge);
+}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_lgamma.c b/libm/upstream-freebsd/lib/msun/src/e_lgamma.c
index 4674d9b..43f5175 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_lgamma.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_lgamma.c
@@ -21,6 +21,8 @@
* Method: call __ieee754_lgamma_r
*/
+#include <float.h>
+
#include "math.h"
#include "math_private.h"
@@ -31,3 +33,7 @@
{
return __ieee754_lgamma_r(x,&signgam);
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(lgamma, lgammal);
+#endif
diff --git a/libm/upstream-freebsd/lib/msun/src/e_lgamma_r.c b/libm/upstream-freebsd/lib/msun/src/e_lgamma_r.c
index 1cff592..be70767 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_lgamma_r.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_lgamma_r.c
@@ -1,4 +1,3 @@
-
/* @(#)e_lgamma_r.c 1.3 95/01/18 */
/*
* ====================================================
@@ -6,22 +5,21 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
- *
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* __ieee754_lgamma_r(x, signgamp)
- * Reentrant version of the logarithm of the Gamma function
- * with user provide pointer for the sign of Gamma(x).
+ * Reentrant version of the logarithm of the Gamma function
+ * with user provide pointer for the sign of Gamma(x).
*
* Method:
* 1. Argument Reduction for 0 < x <= 8
- * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
+ * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
* reduce x to a number in [1.5,2.5] by
* lgamma(1+s) = log(s) + lgamma(s)
* for example,
@@ -59,20 +57,20 @@
* by
* 3 5 11
* w = w0 + w1*z + w2*z + w3*z + ... + w6*z
- * where
+ * where
* |w - f(z)| < 2**-58.74
- *
+ *
* 4. For negative x, since (G is gamma function)
* -x*G(-x)*G(x) = pi/sin(pi*x),
* we have
* G(x) = pi/(sin(pi*x)*(-x)*G(-x))
* since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0
- * Hence, for x<0, signgam = sign(sin(pi*x)) and
+ * Hence, for x<0, signgam = sign(sin(pi*x)) and
* lgamma(x) = log(|Gamma(x)|)
* = log(pi/(|x*sin(pi*x)|)) - lgamma(-x);
- * Note: one should avoid compute pi*(-x) directly in the
+ * Note: one should avoid compute pi*(-x) directly in the
* computation of sin(pi*(-x)).
- *
+ *
* 5. Special Cases
* lgamma(2+s) ~ s*(1-Euler) for tiny s
* lgamma(1) = lgamma(2) = 0
@@ -80,14 +78,17 @@
* lgamma(0) = lgamma(neg.integer) = inf and raise divide-by-zero
* lgamma(inf) = inf
* lgamma(-inf) = inf (bug for bug compatible with C99!?)
- *
*/
+#include <float.h>
+
#include "math.h"
#include "math_private.h"
+static const volatile double vzero = 0;
+
static const double
-two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
+zero= 0.00000000000000000000e+00,
half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
@@ -154,44 +155,40 @@
w5 = 8.36339918996282139126e-04, /* 0x3F4B67BA, 0x4CDAD5D1 */
w6 = -1.63092934096575273989e-03; /* 0xBF5AB89D, 0x0B9E43E4 */
-static const double zero= 0.00000000000000000000e+00;
-
- static double sin_pi(double x)
+/*
+ * Compute sin(pi*x) without actually doing the pi*x multiplication.
+ * sin_pi(x) is only called for x < 0 and |x| < 2**(p-1) where p is
+ * the precision of x.
+ */
+static double
+sin_pi(double x)
{
+ volatile double vz;
double y,z;
- int n,ix;
+ int n;
- GET_HIGH_WORD(ix,x);
- ix &= 0x7fffffff;
+ y = -x;
- if(ix<0x3fd00000) return __kernel_sin(pi*x,zero,0);
- y = -x; /* x is assume negative */
+ vz = y+0x1p52; /* depend on 0 <= y < 0x1p52 */
+ z = vz-0x1p52; /* rint(y) for the above range */
+ if (z == y)
+ return zero;
- /*
- * argument reduction, make sure inexact flag not raised if input
- * is an integer
- */
- z = floor(y);
- if(z!=y) { /* inexact anyway */
- y *= 0.5;
- y = 2.0*(y - floor(y)); /* y = |x| mod 2.0 */
- n = (int) (y*4.0);
- } else {
- if(ix>=0x43400000) {
- y = zero; n = 0; /* y must be even */
- } else {
- if(ix<0x43300000) z = y+two52; /* exact */
- GET_LOW_WORD(n,z);
- n &= 1;
- y = n;
- n<<= 2;
- }
- }
+ vz = y+0x1p50;
+ GET_LOW_WORD(n,vz); /* bits for rounded y (units 0.25) */
+ z = vz-0x1p50; /* y rounded to a multiple of 0.25 */
+ if (z > y) {
+ z -= 0.25; /* adjust to round down */
+ n--;
+ }
+ n &= 7; /* octant of y mod 2 */
+ y = y - z + n * 0.25; /* y mod 2 */
+
switch (n) {
case 0: y = __kernel_sin(pi*y,zero,0); break;
- case 1:
+ case 1:
case 2: y = __kernel_cos(pi*(0.5-y),zero); break;
- case 3:
+ case 3:
case 4: y = __kernel_sin(pi*(one-y),zero,0); break;
case 5:
case 6: y = -__kernel_cos(pi*(y-1.5),zero); break;
@@ -204,34 +201,38 @@
double
__ieee754_lgamma_r(double x, int *signgamp)
{
- double t,y,z,nadj,p,p1,p2,p3,q,r,w;
+ double nadj,p,p1,p2,p3,q,r,t,w,y,z;
int32_t hx;
- int i,lx,ix;
+ int i,ix,lx;
EXTRACT_WORDS(hx,lx,x);
- /* purge off +-inf, NaN, +-0, tiny and negative arguments */
+ /* purge +-Inf and NaNs */
*signgamp = 1;
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) return x*x;
- if((ix|lx)==0) return one/zero;
- if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */
- if(hx<0) {
- *signgamp = -1;
- return -__ieee754_log(-x);
- } else return -__ieee754_log(x);
+
+ /* purge +-0 and tiny arguments */
+ *signgamp = 1-2*((uint32_t)hx>>31);
+ if(ix<0x3c700000) { /* |x|<2**-56, return -log(|x|) */
+ if((ix|lx)==0)
+ return one/vzero;
+ return -__ieee754_log(fabs(x));
}
+
+ /* purge negative integers and start evaluation for other x < 0 */
if(hx<0) {
+ *signgamp = 1;
if(ix>=0x43300000) /* |x|>=2**52, must be -integer */
- return one/zero;
+ return one/vzero;
t = sin_pi(x);
- if(t==zero) return one/zero; /* -integer */
+ if(t==zero) return one/vzero; /* -integer */
nadj = __ieee754_log(pi/fabs(t*x));
if(t<zero) *signgamp = -1;
x = -x;
}
- /* purge off 1 and 2 */
+ /* purge 1 and 2 */
if((((ix-0x3ff00000)|lx)==0)||(((ix-0x40000000)|lx)==0)) r = 0;
/* for x < 2.0 */
else if(ix<0x40000000) {
@@ -252,7 +253,7 @@
p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*a10))));
p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*a11)))));
p = y*p1+p2;
- r += (p-0.5*y); break;
+ r += p-y/2; break;
case 1:
z = y*y;
w = z*y;
@@ -260,38 +261,43 @@
p2 = t1+w*(t4+w*(t7+w*(t10+w*t13)));
p3 = t2+w*(t5+w*(t8+w*(t11+w*t14)));
p = z*p1-(tt-w*(p2+y*p3));
- r += (tf + p); break;
- case 2:
+ r += tf + p; break;
+ case 2:
p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5)))));
p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5))));
- r += (-0.5*y + p1/p2);
+ r += p1/p2-y/2;
}
}
- else if(ix<0x40200000) { /* x < 8.0 */
- i = (int)x;
- y = x-(double)i;
+ /* x < 8.0 */
+ else if(ix<0x40200000) {
+ i = x;
+ y = x-i;
p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*s6))))));
q = one+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*r6)))));
- r = half*y+p/q;
+ r = y/2+p/q;
z = one; /* lgamma(1+s) = log(s) + lgamma(s) */
switch(i) {
- case 7: z *= (y+6.0); /* FALLTHRU */
- case 6: z *= (y+5.0); /* FALLTHRU */
- case 5: z *= (y+4.0); /* FALLTHRU */
- case 4: z *= (y+3.0); /* FALLTHRU */
- case 3: z *= (y+2.0); /* FALLTHRU */
+ case 7: z *= (y+6); /* FALLTHRU */
+ case 6: z *= (y+5); /* FALLTHRU */
+ case 5: z *= (y+4); /* FALLTHRU */
+ case 4: z *= (y+3); /* FALLTHRU */
+ case 3: z *= (y+2); /* FALLTHRU */
r += __ieee754_log(z); break;
}
- /* 8.0 <= x < 2**58 */
- } else if (ix < 0x43900000) {
+ /* 8.0 <= x < 2**56 */
+ } else if (ix < 0x43700000) {
t = __ieee754_log(x);
z = one/x;
y = z*z;
w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6)))));
r = (x-half)*(t-one)+w;
- } else
- /* 2**58 <= x <= inf */
+ } else
+ /* 2**56 <= x <= inf */
r = x*(__ieee754_log(x)-one);
if(hx<0) r = nadj - r;
return r;
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(lgamma_r, lgammal_r);
+#endif
diff --git a/libm/upstream-freebsd/lib/msun/src/e_lgammaf_r.c b/libm/upstream-freebsd/lib/msun/src/e_lgammaf_r.c
index e2d90ef..9084e18 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_lgammaf_r.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_lgammaf_r.c
@@ -1,5 +1,6 @@
/* e_lgammaf_r.c -- float version of e_lgamma_r.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ * Conversion to float fixed By Steven G. Kargl.
*/
/*
@@ -19,107 +20,91 @@
#include "math.h"
#include "math_private.h"
+static const volatile float vzero = 0;
+
static const float
-two23= 8.3886080000e+06, /* 0x4b000000 */
-half= 5.0000000000e-01, /* 0x3f000000 */
-one = 1.0000000000e+00, /* 0x3f800000 */
+zero= 0,
+half= 0.5,
+one = 1,
pi = 3.1415927410e+00, /* 0x40490fdb */
-a0 = 7.7215664089e-02, /* 0x3d9e233f */
-a1 = 3.2246702909e-01, /* 0x3ea51a66 */
-a2 = 6.7352302372e-02, /* 0x3d89f001 */
-a3 = 2.0580807701e-02, /* 0x3ca89915 */
-a4 = 7.3855509982e-03, /* 0x3bf2027e */
-a5 = 2.8905137442e-03, /* 0x3b3d6ec6 */
-a6 = 1.1927076848e-03, /* 0x3a9c54a1 */
-a7 = 5.1006977446e-04, /* 0x3a05b634 */
-a8 = 2.2086278477e-04, /* 0x39679767 */
-a9 = 1.0801156895e-04, /* 0x38e28445 */
-a10 = 2.5214456400e-05, /* 0x37d383a2 */
-a11 = 4.4864096708e-05, /* 0x383c2c75 */
-tc = 1.4616321325e+00, /* 0x3fbb16c3 */
-tf = -1.2148628384e-01, /* 0xbdf8cdcd */
-/* tt = -(tail of tf) */
-tt = 6.6971006518e-09, /* 0x31e61c52 */
-t0 = 4.8383611441e-01, /* 0x3ef7b95e */
-t1 = -1.4758771658e-01, /* 0xbe17213c */
-t2 = 6.4624942839e-02, /* 0x3d845a15 */
-t3 = -3.2788541168e-02, /* 0xbd064d47 */
-t4 = 1.7970675603e-02, /* 0x3c93373d */
-t5 = -1.0314224288e-02, /* 0xbc28fcfe */
-t6 = 6.1005386524e-03, /* 0x3bc7e707 */
-t7 = -3.6845202558e-03, /* 0xbb7177fe */
-t8 = 2.2596477065e-03, /* 0x3b141699 */
-t9 = -1.4034647029e-03, /* 0xbab7f476 */
-t10 = 8.8108185446e-04, /* 0x3a66f867 */
-t11 = -5.3859531181e-04, /* 0xba0d3085 */
-t12 = 3.1563205994e-04, /* 0x39a57b6b */
-t13 = -3.1275415677e-04, /* 0xb9a3f927 */
-t14 = 3.3552918467e-04, /* 0x39afe9f7 */
-u0 = -7.7215664089e-02, /* 0xbd9e233f */
-u1 = 6.3282704353e-01, /* 0x3f2200f4 */
-u2 = 1.4549225569e+00, /* 0x3fba3ae7 */
-u3 = 9.7771751881e-01, /* 0x3f7a4bb2 */
-u4 = 2.2896373272e-01, /* 0x3e6a7578 */
-u5 = 1.3381091878e-02, /* 0x3c5b3c5e */
-v1 = 2.4559779167e+00, /* 0x401d2ebe */
-v2 = 2.1284897327e+00, /* 0x4008392d */
-v3 = 7.6928514242e-01, /* 0x3f44efdf */
-v4 = 1.0422264785e-01, /* 0x3dd572af */
-v5 = 3.2170924824e-03, /* 0x3b52d5db */
-s0 = -7.7215664089e-02, /* 0xbd9e233f */
-s1 = 2.1498242021e-01, /* 0x3e5c245a */
-s2 = 3.2577878237e-01, /* 0x3ea6cc7a */
-s3 = 1.4635047317e-01, /* 0x3e15dce6 */
-s4 = 2.6642270386e-02, /* 0x3cda40e4 */
-s5 = 1.8402845599e-03, /* 0x3af135b4 */
-s6 = 3.1947532989e-05, /* 0x3805ff67 */
-r1 = 1.3920053244e+00, /* 0x3fb22d3b */
-r2 = 7.2193557024e-01, /* 0x3f38d0c5 */
-r3 = 1.7193385959e-01, /* 0x3e300f6e */
-r4 = 1.8645919859e-02, /* 0x3c98bf54 */
-r5 = 7.7794247773e-04, /* 0x3a4beed6 */
-r6 = 7.3266842264e-06, /* 0x36f5d7bd */
-w0 = 4.1893854737e-01, /* 0x3ed67f1d */
-w1 = 8.3333335817e-02, /* 0x3daaaaab */
-w2 = -2.7777778450e-03, /* 0xbb360b61 */
-w3 = 7.9365057172e-04, /* 0x3a500cfd */
-w4 = -5.9518753551e-04, /* 0xba1c065c */
-w5 = 8.3633989561e-04, /* 0x3a5b3dd2 */
-w6 = -1.6309292987e-03; /* 0xbad5c4e8 */
+/*
+ * Domain y in [0x1p-27, 0.27], range ~[-3.4599e-10, 3.4590e-10]:
+ * |(lgamma(2 - y) + 0.5 * y) / y - a(y)| < 2**-31.4
+ */
+a0 = 7.72156641e-02, /* 0x3d9e233f */
+a1 = 3.22467119e-01, /* 0x3ea51a69 */
+a2 = 6.73484802e-02, /* 0x3d89ee00 */
+a3 = 2.06395667e-02, /* 0x3ca9144f */
+a4 = 6.98275631e-03, /* 0x3be4cf9b */
+a5 = 4.11768444e-03, /* 0x3b86eda4 */
+/*
+ * Domain x in [tc-0.24, tc+0.28], range ~[-5.6577e-10, 5.5677e-10]:
+ * |(lgamma(x) - tf) - t(x - tc)| < 2**-30.8.
+ */
+tc = 1.46163213e+00, /* 0x3fbb16c3 */
+tf = -1.21486291e-01, /* 0xbdf8cdce */
+t0 = -2.94064460e-11, /* 0xae0154b7 */
+t1 = -2.35939837e-08, /* 0xb2caabb8 */
+t2 = 4.83836412e-01, /* 0x3ef7b968 */
+t3 = -1.47586212e-01, /* 0xbe1720d7 */
+t4 = 6.46013096e-02, /* 0x3d844db1 */
+t5 = -3.28450352e-02, /* 0xbd068884 */
+t6 = 1.86483748e-02, /* 0x3c98c47a */
+t7 = -9.89206228e-03, /* 0xbc221251 */
+/*
+ * Domain y in [-0.1, 0.232], range ~[-8.4931e-10, 8.7794e-10]:
+ * |(lgamma(1 + y) + 0.5 * y) / y - u(y) / v(y)| < 2**-31.2
+ */
+u0 = -7.72156641e-02, /* 0xbd9e233f */
+u1 = 7.36789703e-01, /* 0x3f3c9e40 */
+u2 = 4.95649040e-01, /* 0x3efdc5b6 */
+v1 = 1.10958421e+00, /* 0x3f8e06db */
+v2 = 2.10598111e-01, /* 0x3e57a708 */
+v3 = -1.02995494e-02, /* 0xbc28bf71 */
+/*
+ * Domain x in (2, 3], range ~[-5.5189e-11, 5.2317e-11]:
+ * |(lgamma(y+2) - 0.5 * y) / y - s(y)/r(y)| < 2**-35.0
+ * with y = x - 2.
+ */
+s0 = -7.72156641e-02, /* 0xbd9e233f */
+s1 = 2.69987404e-01, /* 0x3e8a3bca */
+s2 = 1.42851010e-01, /* 0x3e124789 */
+s3 = 1.19389519e-02, /* 0x3c439b98 */
+r1 = 6.79650068e-01, /* 0x3f2dfd8c */
+r2 = 1.16058730e-01, /* 0x3dedb033 */
+r3 = 3.75673687e-03, /* 0x3b763396 */
+/*
+ * Domain z in [8, 0x1p24], range ~[-1.2640e-09, 1.2640e-09]:
+ * |lgamma(x) - (x - 0.5) * (log(x) - 1) - w(1/x)| < 2**-29.6.
+ */
+w0 = 4.18938547e-01, /* 0x3ed67f1d */
+w1 = 8.33332464e-02, /* 0x3daaaa9f */
+w2 = -2.76129087e-03; /* 0xbb34f6c6 */
-static const float zero= 0.0000000000e+00;
-
- static float sin_pif(float x)
+static float
+sin_pif(float x)
{
+ volatile float vz;
float y,z;
- int n,ix;
+ int n;
- GET_FLOAT_WORD(ix,x);
- ix &= 0x7fffffff;
+ y = -x;
- if(ix<0x3e800000) return __kernel_sindf(pi*x);
- y = -x; /* x is assume negative */
+ vz = y+0x1p23F; /* depend on 0 <= y < 0x1p23 */
+ z = vz-0x1p23F; /* rintf(y) for the above range */
+ if (z == y)
+ return zero;
- /*
- * argument reduction, make sure inexact flag not raised if input
- * is an integer
- */
- z = floorf(y);
- if(z!=y) { /* inexact anyway */
- y *= (float)0.5;
- y = (float)2.0*(y - floorf(y)); /* y = |x| mod 2.0 */
- n = (int) (y*(float)4.0);
- } else {
- if(ix>=0x4b800000) {
- y = zero; n = 0; /* y must be even */
- } else {
- if(ix<0x4b000000) z = y+two23; /* exact */
- GET_FLOAT_WORD(n,z);
- n &= 1;
- y = n;
- n<<= 2;
- }
- }
+ vz = y+0x1p21F;
+ GET_FLOAT_WORD(n,vz); /* bits for rounded y (units 0.25) */
+ z = vz-0x1p21F; /* y rounded to a multiple of 0.25 */
+ if (z > y) {
+ z -= 0.25F; /* adjust to round down */
+ n--;
+ }
+ n &= 7; /* octant of y mod 2 */
+ y = y - z + n * 0.25F; /* y mod 2 */
+
switch (n) {
case 0: y = __kernel_sindf(pi*y); break;
case 1:
@@ -137,34 +122,38 @@
float
__ieee754_lgammaf_r(float x, int *signgamp)
{
- float t,y,z,nadj,p,p1,p2,p3,q,r,w;
+ float nadj,p,p1,p2,p3,q,r,t,w,y,z;
int32_t hx;
int i,ix;
GET_FLOAT_WORD(hx,x);
- /* purge off +-inf, NaN, +-0, tiny and negative arguments */
+ /* purge +-Inf and NaNs */
*signgamp = 1;
ix = hx&0x7fffffff;
if(ix>=0x7f800000) return x*x;
- if(ix==0) return one/zero;
- if(ix<0x35000000) { /* |x|<2**-21, return -log(|x|) */
- if(hx<0) {
- *signgamp = -1;
- return -__ieee754_logf(-x);
- } else return -__ieee754_logf(x);
+
+ /* purge +-0 and tiny arguments */
+ *signgamp = 1-2*((uint32_t)hx>>31);
+ if(ix<0x32000000) { /* |x|<2**-27, return -log(|x|) */
+ if(ix==0)
+ return one/vzero;
+ return -__ieee754_logf(fabsf(x));
}
+
+ /* purge negative integers and start evaluation for other x < 0 */
if(hx<0) {
- if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */
- return one/zero;
+ *signgamp = 1;
+ if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */
+ return one/vzero;
t = sin_pif(x);
- if(t==zero) return one/zero; /* -integer */
+ if(t==zero) return one/vzero; /* -integer */
nadj = __ieee754_logf(pi/fabsf(t*x));
if(t<zero) *signgamp = -1;
x = -x;
}
- /* purge off 1 and 2 */
+ /* purge 1 and 2 */
if (ix==0x3f800000||ix==0x40000000) r = 0;
/* for x < 2.0 */
else if(ix<0x40000000) {
@@ -175,55 +164,51 @@
else {y = x; i=2;}
} else {
r = zero;
- if(ix>=0x3fdda618) {y=(float)2.0-x;i=0;} /* [1.7316,2] */
+ if(ix>=0x3fdda618) {y=2-x;i=0;} /* [1.7316,2] */
else if(ix>=0x3F9da620) {y=x-tc;i=1;} /* [1.23,1.73] */
else {y=x-one;i=2;}
}
switch(i) {
case 0:
z = y*y;
- p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*a10))));
- p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*a11)))));
+ p1 = a0+z*(a2+z*a4);
+ p2 = z*(a1+z*(a3+z*a5));
p = y*p1+p2;
- r += (p-(float)0.5*y); break;
+ r += p-y/2; break;
case 1:
- z = y*y;
- w = z*y;
- p1 = t0+w*(t3+w*(t6+w*(t9 +w*t12))); /* parallel comp */
- p2 = t1+w*(t4+w*(t7+w*(t10+w*t13)));
- p3 = t2+w*(t5+w*(t8+w*(t11+w*t14)));
- p = z*p1-(tt-w*(p2+y*p3));
- r += (tf + p); break;
+ p = t0+y*t1+y*y*(t2+y*(t3+y*(t4+y*(t5+y*(t6+y*t7)))));
+ r += tf + p; break;
case 2:
- p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5)))));
- p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5))));
- r += (-(float)0.5*y + p1/p2);
+ p1 = y*(u0+y*(u1+y*u2));
+ p2 = one+y*(v1+y*(v2+y*v3));
+ r += p1/p2-y/2;
}
}
- else if(ix<0x41000000) { /* x < 8.0 */
- i = (int)x;
- y = x-(float)i;
- p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*s6))))));
- q = one+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*r6)))));
- r = half*y+p/q;
+ /* x < 8.0 */
+ else if(ix<0x41000000) {
+ i = x;
+ y = x-i;
+ p = y*(s0+y*(s1+y*(s2+y*s3)));
+ q = one+y*(r1+y*(r2+y*r3));
+ r = y/2+p/q;
z = one; /* lgamma(1+s) = log(s) + lgamma(s) */
switch(i) {
- case 7: z *= (y+(float)6.0); /* FALLTHRU */
- case 6: z *= (y+(float)5.0); /* FALLTHRU */
- case 5: z *= (y+(float)4.0); /* FALLTHRU */
- case 4: z *= (y+(float)3.0); /* FALLTHRU */
- case 3: z *= (y+(float)2.0); /* FALLTHRU */
+ case 7: z *= (y+6); /* FALLTHRU */
+ case 6: z *= (y+5); /* FALLTHRU */
+ case 5: z *= (y+4); /* FALLTHRU */
+ case 4: z *= (y+3); /* FALLTHRU */
+ case 3: z *= (y+2); /* FALLTHRU */
r += __ieee754_logf(z); break;
}
- /* 8.0 <= x < 2**58 */
- } else if (ix < 0x5c800000) {
+ /* 8.0 <= x < 2**27 */
+ } else if (ix < 0x4d000000) {
t = __ieee754_logf(x);
z = one/x;
y = z*z;
- w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6)))));
+ w = w0+z*(w1+y*w2);
r = (x-half)*(t-one)+w;
} else
- /* 2**58 <= x <= inf */
+ /* 2**27 <= x <= inf */
r = x*(__ieee754_logf(x)-one);
if(hx<0) r = nadj - r;
return r;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_lgammal.c b/libm/upstream-freebsd/lib/msun/src/e_lgammal.c
new file mode 100644
index 0000000..ebc2fc7
--- /dev/null
+++ b/libm/upstream-freebsd/lib/msun/src/e_lgammal.c
@@ -0,0 +1,25 @@
+/* @(#)e_lgamma.c 1.3 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "math.h"
+#include "math_private.h"
+
+extern int signgam;
+
+long double
+lgammal(long double x)
+{
+ return lgammal_r(x,&signgam);
+}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_pow.c b/libm/upstream-freebsd/lib/msun/src/e_pow.c
index 7607a4a..d54af9d 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_pow.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_pow.c
@@ -19,20 +19,20 @@
* 1. Compute and return log2(x) in two pieces:
* log2(x) = w1 + w2,
* where w1 has 53-24 = 29 bit trailing zeros.
- * 2. Perform y*log2(x) = n+y' by simulating muti-precision
+ * 2. Perform y*log2(x) = n+y' by simulating multi-precision
* arithmetic, where |y'|<=0.5.
* 3. Return x**y = 2**n*exp(y'*log2)
*
* Special cases:
* 1. (anything) ** 0 is 1
* 2. (anything) ** 1 is itself
- * 3. (anything) ** NAN is NAN
+ * 3. (anything) ** NAN is NAN except 1 ** NAN = 1
* 4. NAN ** (anything except 0) is NAN
* 5. +-(|x| > 1) ** +INF is +INF
* 6. +-(|x| > 1) ** -INF is +0
* 7. +-(|x| < 1) ** +INF is +0
* 8. +-(|x| < 1) ** -INF is +INF
- * 9. +-1 ** +-INF is NAN
+ * 9. +-1 ** +-INF is 1
* 10. +0 ** (+anything except 0, NAN) is +0
* 11. -0 ** (+anything except 0, NAN, odd integer) is +0
* 12. +0 ** (-anything except 0, NAN) is +INF
@@ -141,7 +141,7 @@
if(ly==0) {
if (iy==0x7ff00000) { /* y is +-inf */
if(((ix-0x3ff00000)|lx)==0)
- return one; /* (-1)**+-inf is NaN */
+ return one; /* (-1)**+-inf is 1 */
else if (ix >= 0x3ff00000)/* (|x|>1)**+-inf = inf,0 */
return (hy>=0)? y: zero;
else /* (|x|<1)**-,+inf = inf,0 */
diff --git a/libm/upstream-freebsd/lib/msun/src/e_sinh.c b/libm/upstream-freebsd/lib/msun/src/e_sinh.c
index 17442d0..6c01f4a 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_sinh.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_sinh.c
@@ -32,6 +32,8 @@
* only sinh(0)=0 is exact for finite x.
*/
+#include <float.h>
+
#include "math.h"
#include "math_private.h"
@@ -71,3 +73,7 @@
/* |x| > overflowthresold, sinh(x) overflow */
return x*shuge;
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(sinh, sinhl);
+#endif
diff --git a/libm/upstream-freebsd/lib/msun/src/e_sinhl.c b/libm/upstream-freebsd/lib/msun/src/e_sinhl.c
new file mode 100644
index 0000000..ce7e333
--- /dev/null
+++ b/libm/upstream-freebsd/lib/msun/src/e_sinhl.c
@@ -0,0 +1,131 @@
+/* from: FreeBSD: head/lib/msun/src/e_sinhl.c XXX */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * See e_sinh.c for complete comments.
+ *
+ * Converted to long double by Bruce D. Evans.
+ */
+
+#include <float.h>
+#ifdef __i386__
+#include <ieeefp.h>
+#endif
+
+#include "fpmath.h"
+#include "math.h"
+#include "math_private.h"
+#include "k_expl.h"
+
+#if LDBL_MAX_EXP != 0x4000
+/* We also require the usual expsign encoding. */
+#error "Unsupported long double format"
+#endif
+
+#define BIAS (LDBL_MAX_EXP - 1)
+
+static const long double shuge = 0x1p16383L;
+#if LDBL_MANT_DIG == 64
+/*
+ * Domain [-1, 1], range ~[-6.6749e-22, 6.6749e-22]:
+ * |sinh(x)/x - s(x)| < 2**-70.3
+ */
+static const union IEEEl2bits
+S3u = LD80C(0xaaaaaaaaaaaaaaaa, -3, 1.66666666666666666658e-1L);
+#define S3 S3u.e
+static const double
+S5 = 8.3333333333333332e-3, /* 0x11111111111111.0p-59 */
+S7 = 1.9841269841270074e-4, /* 0x1a01a01a01a070.0p-65 */
+S9 = 2.7557319223873889e-6, /* 0x171de3a5565fe6.0p-71 */
+S11 = 2.5052108406704084e-8, /* 0x1ae6456857530f.0p-78 */
+S13 = 1.6059042748655297e-10, /* 0x161245fa910697.0p-85 */
+S15 = 7.6470006914396920e-13, /* 0x1ae7ce4eff2792.0p-93 */
+S17 = 2.8346142308424267e-15; /* 0x19882ce789ffc6.0p-101 */
+#elif LDBL_MANT_DIG == 113
+/*
+ * Domain [-1, 1], range ~[-2.9673e-36, 2.9673e-36]:
+ * |sinh(x)/x - s(x)| < 2**-118.0
+ */
+static const long double
+S3 = 1.66666666666666666666666666666666033e-1L, /* 0x1555555555555555555555555553b.0p-115L */
+S5 = 8.33333333333333333333333333337643193e-3L, /* 0x111111111111111111111111180f5.0p-119L */
+S7 = 1.98412698412698412698412697391263199e-4L, /* 0x1a01a01a01a01a01a01a0176aad11.0p-125L */
+S9 = 2.75573192239858906525574406205464218e-6L, /* 0x171de3a556c7338faac243aaa9592.0p-131L */
+S11 = 2.50521083854417187749675637460977997e-8L, /* 0x1ae64567f544e38fe59b3380d7413.0p-138L */
+S13 = 1.60590438368216146368737762431552702e-10L, /* 0x16124613a86d098059c7620850fc2.0p-145L */
+S15 = 7.64716373181980539786802470969096440e-13L, /* 0x1ae7f3e733b814193af09ce723043.0p-153L */
+S17 = 2.81145725434775409870584280722701574e-15L; /* 0x1952c77030c36898c3fd0b6dfc562.0p-161L */
+static const double
+S19= 8.2206352435411005e-18, /* 0x12f49b4662b86d.0p-109 */
+S21= 1.9572943931418891e-20, /* 0x171b8f2fab9628.0p-118 */
+S23 = 3.8679983530666939e-23, /* 0x17617002b73afc.0p-127 */
+S25 = 6.5067867911512749e-26; /* 0x1423352626048a.0p-136 */
+#else
+#error "Unsupported long double format"
+#endif /* LDBL_MANT_DIG == 64 */
+
+/* log(2**16385 - 0.5) rounded up: */
+static const float
+o_threshold = 1.13572168e4; /* 0xb174de.0p-10 */
+
+long double
+sinhl(long double x)
+{
+ long double hi,lo,x2,x4;
+ double dx2,s;
+ int16_t ix,jx;
+
+ GET_LDBL_EXPSIGN(jx,x);
+ ix = jx&0x7fff;
+
+ /* x is INF or NaN */
+ if(ix>=0x7fff) return x+x;
+
+ ENTERI();
+
+ s = 1;
+ if (jx<0) s = -1;
+
+ /* |x| < 64, return x, s(x), or accurate s*(exp(|x|)/2-1/exp(|x|)/2) */
+ if (ix<0x4005) { /* |x|<64 */
+ if (ix<BIAS-(LDBL_MANT_DIG+1)/2) /* |x|<TINY */
+ if(shuge+x>1) RETURNI(x); /* sinh(tiny) = tiny with inexact */
+ if (ix<0x3fff) { /* |x|<1 */
+ x2 = x*x;
+#if LDBL_MANT_DIG == 64
+ x4 = x2*x2;
+ RETURNI(((S17*x2 + S15)*x4 + (S13*x2 + S11))*(x2*x*x4*x4) +
+ ((S9*x2 + S7)*x2 + S5)*(x2*x*x2) + S3*(x2*x) + x);
+#elif LDBL_MANT_DIG == 113
+ dx2 = x2;
+ RETURNI(((((((((((S25*dx2 + S23)*dx2 +
+ S21)*x2 + S19)*x2 +
+ S17)*x2 + S15)*x2 + S13)*x2 + S11)*x2 + S9)*x2 + S7)*x2 +
+ S5)* (x2*x*x2) +
+ S3*(x2*x) + x);
+#endif
+ }
+ k_hexpl(fabsl(x), &hi, &lo);
+ RETURNI(s*(lo - 0.25/(hi + lo) + hi));
+ }
+
+ /* |x| in [64, o_threshold], return correctly-overflowing s*exp(|x|)/2 */
+ if (fabsl(x) <= o_threshold)
+ RETURNI(s*hexpl(fabsl(x)));
+
+ /* |x| > o_threshold, sinh(x) overflow */
+ return x*shuge;
+}
diff --git a/libm/upstream-freebsd/lib/msun/src/fenv-softfloat.h b/libm/upstream-freebsd/lib/msun/src/fenv-softfloat.h
deleted file mode 100644
index 02d2a2c..0000000
--- a/libm/upstream-freebsd/lib/msun/src/fenv-softfloat.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/*-
- * Copyright (c) 2004-2011 David Schultz <das@FreeBSD.ORG>
- * 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 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 AUTHOR 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.
- *
- * $FreeBSD$
- */
-
-#ifndef _FENV_H_
-#error "This file is meant to be included only by <fenv.h>."
-#endif
-
-/*
- * This file implements the functionality of <fenv.h> on platforms that
- * lack an FPU and use softfloat in libc for floating point. To use it,
- * you must write an <fenv.h> that provides the following:
- *
- * - a typedef for fenv_t, which may be an integer or struct type
- * - a typedef for fexcept_t (XXX This file assumes fexcept_t is a
- * simple integer type containing the exception mask.)
- * - definitions of FE_* constants for the five exceptions and four
- * rounding modes in IEEE 754, as described in fenv(3)
- * - a definition, and the corresponding external symbol, for FE_DFL_ENV
- * - a macro __set_env(env, flags, mask, rnd), which sets the given fenv_t
- * from the exception flags, mask, and rounding mode
- * - macros __env_flags(env), __env_mask(env), and __env_round(env), which
- * extract fields from an fenv_t
- * - a definition of __fenv_static
- *
- * If the architecture supports an optional FPU, it's recommended that you
- * define fenv_t and fexcept_t to match the hardware ABI. Otherwise, it
- * doesn't matter how you define them.
- */
-
-extern int __softfloat_float_exception_flags;
-extern int __softfloat_float_exception_mask;
-extern int __softfloat_float_rounding_mode;
-void __softfloat_float_raise(int);
-
-__fenv_static inline int
-feclearexcept(int __excepts)
-{
-
- __softfloat_float_exception_flags &= ~__excepts;
- return (0);
-}
-
-__fenv_static inline int
-fegetexceptflag(fexcept_t *__flagp, int __excepts)
-{
-
- *__flagp = __softfloat_float_exception_flags & __excepts;
- return (0);
-}
-
-__fenv_static inline int
-fesetexceptflag(const fexcept_t *__flagp, int __excepts)
-{
-
- __softfloat_float_exception_flags &= ~__excepts;
- __softfloat_float_exception_flags |= *__flagp & __excepts;
- return (0);
-}
-
-__fenv_static inline int
-feraiseexcept(int __excepts)
-{
-
- __softfloat_float_raise(__excepts);
- return (0);
-}
-
-__fenv_static inline int
-fetestexcept(int __excepts)
-{
-
- return (__softfloat_float_exception_flags & __excepts);
-}
-
-__fenv_static inline int
-fegetround(void)
-{
-
- return (__softfloat_float_rounding_mode);
-}
-
-__fenv_static inline int
-fesetround(int __round)
-{
-
- __softfloat_float_rounding_mode = __round;
- return (0);
-}
-
-__fenv_static inline int
-fegetenv(fenv_t *__envp)
-{
-
- __set_env(*__envp, __softfloat_float_exception_flags,
- __softfloat_float_exception_mask, __softfloat_float_rounding_mode);
- return (0);
-}
-
-__fenv_static inline int
-feholdexcept(fenv_t *__envp)
-{
- fenv_t __env;
-
- fegetenv(__envp);
- __softfloat_float_exception_flags = 0;
- __softfloat_float_exception_mask = 0;
- return (0);
-}
-
-__fenv_static inline int
-fesetenv(const fenv_t *__envp)
-{
-
- __softfloat_float_exception_flags = __env_flags(*__envp);
- __softfloat_float_exception_mask = __env_mask(*__envp);
- __softfloat_float_rounding_mode = __env_round(*__envp);
- return (0);
-}
-
-__fenv_static inline int
-feupdateenv(const fenv_t *__envp)
-{
- int __oflags = __softfloat_float_exception_flags;
-
- fesetenv(__envp);
- feraiseexcept(__oflags);
- return (0);
-}
-
-#if __BSD_VISIBLE
-
-/* We currently provide no external definitions of the functions below. */
-
-static inline int
-feenableexcept(int __mask)
-{
- int __omask = __softfloat_float_exception_mask;
-
- __softfloat_float_exception_mask |= __mask;
- return (__omask);
-}
-
-static inline int
-fedisableexcept(int __mask)
-{
- int __omask = __softfloat_float_exception_mask;
-
- __softfloat_float_exception_mask &= ~__mask;
- return (__omask);
-}
-
-static inline int
-fegetexcept(void)
-{
-
- return (__softfloat_float_exception_mask);
-}
-
-#endif /* __BSD_VISIBLE */
diff --git a/libm/upstream-freebsd/lib/msun/src/imprecise.c b/libm/upstream-freebsd/lib/msun/src/imprecise.c
index a7503bf..08cd239 100644
--- a/libm/upstream-freebsd/lib/msun/src/imprecise.c
+++ b/libm/upstream-freebsd/lib/msun/src/imprecise.c
@@ -60,10 +60,4 @@
long double imprecise_ ## f ## l(long double v) { return f(v); }\
DECLARE_WEAK(f ## l)
-DECLARE_IMPRECISE(cosh);
-DECLARE_IMPRECISE(erfc);
-DECLARE_IMPRECISE(erf);
-DECLARE_IMPRECISE(lgamma);
-DECLARE_IMPRECISE(sinh);
-DECLARE_IMPRECISE(tanh);
DECLARE_IMPRECISE(tgamma);
diff --git a/libm/upstream-freebsd/lib/msun/src/s_erf.c b/libm/upstream-freebsd/lib/msun/src/s_erf.c
index 0886e5e..e1d63bc 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_erf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_erf.c
@@ -111,18 +111,25 @@
#include "math.h"
#include "math_private.h"
+/* XXX Prevent compilers from erroneously constant folding: */
+static const volatile double tiny= 1e-300;
+
static const double
-tiny = 1e-300,
-half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
-one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
-two = 2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */
- /* c = (float)0.84506291151 */
+half= 0.5,
+one = 1,
+two = 2,
+/* c = (float)0.84506291151 */
erx = 8.45062911510467529297e-01, /* 0x3FEB0AC1, 0x60000000 */
/*
- * Coefficients for approximation to erf on [0,0.84375]
+ * In the domain [0, 2**-28], only the first term in the power series
+ * expansion of erf(x) is used. The magnitude of the first neglected
+ * terms is less than 2**-84.
*/
efx = 1.28379167095512586316e-01, /* 0x3FC06EBA, 0x8214DB69 */
efx8= 1.02703333676410069053e+00, /* 0x3FF06EBA, 0x8214DB69 */
+/*
+ * Coefficients for approximation to erf on [0,0.84375]
+ */
pp0 = 1.28379167095512558561e-01, /* 0x3FC06EBA, 0x8214DB68 */
pp1 = -3.25042107247001499370e-01, /* 0xBFD4CD7D, 0x691CB913 */
pp2 = -2.84817495755985104766e-02, /* 0xBF9D2A51, 0xDBD7194F */
@@ -134,7 +141,7 @@
qq4 = 1.32494738004321644526e-04, /* 0x3F215DC9, 0x221C1A10 */
qq5 = -3.96022827877536812320e-06, /* 0xBED09C43, 0x42A26120 */
/*
- * Coefficients for approximation to erf in [0.84375,1.25]
+ * Coefficients for approximation to erf in [0.84375,1.25]
*/
pa0 = -2.36211856075265944077e-03, /* 0xBF6359B8, 0xBEF77538 */
pa1 = 4.14856118683748331666e-01, /* 0x3FDA8D00, 0xAD92B34D */
@@ -150,7 +157,7 @@
qa5 = 1.36370839120290507362e-02, /* 0x3F8BEDC2, 0x6B51DD1C */
qa6 = 1.19844998467991074170e-02, /* 0x3F888B54, 0x5735151D */
/*
- * Coefficients for approximation to erfc in [1.25,1/0.35]
+ * Coefficients for approximation to erfc in [1.25,1/0.35]
*/
ra0 = -9.86494403484714822705e-03, /* 0xBF843412, 0x600D6435 */
ra1 = -6.93858572707181764372e-01, /* 0xBFE63416, 0xE4BA7360 */
@@ -169,7 +176,7 @@
sa7 = 6.57024977031928170135e+00, /* 0x401A47EF, 0x8E484A93 */
sa8 = -6.04244152148580987438e-02, /* 0xBFAEEFF2, 0xEE749A62 */
/*
- * Coefficients for approximation to erfc in [1/.35,28]
+ * Coefficients for approximation to erfc in [1/.35,28]
*/
rb0 = -9.86494292470009928597e-03, /* 0xBF843412, 0x39E86F4A */
rb1 = -7.99283237680523006574e-01, /* 0xBFE993BA, 0x70C285DE */
@@ -201,7 +208,7 @@
if(ix < 0x3feb0000) { /* |x|<0.84375 */
if(ix < 0x3e300000) { /* |x|<2**-28 */
if (ix < 0x00800000)
- return 0.125*(8.0*x+efx8*x); /*avoid underflow */
+ return (8*x+efx8*x)/8; /* avoid spurious underflow */
return x + efx*x;
}
z = x*x;
@@ -222,15 +229,12 @@
x = fabs(x);
s = one/(x*x);
if(ix< 0x4006DB6E) { /* |x| < 1/0.35 */
- R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
- ra5+s*(ra6+s*ra7))))));
- S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
- sa5+s*(sa6+s*(sa7+s*sa8)))))));
+ R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*ra7))))));
+ S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+
+ s*sa8)))))));
} else { /* |x| >= 1/0.35 */
- R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
- rb5+s*rb6)))));
- S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
- sb5+s*(sb6+s*sb7))))));
+ R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*rb6)))));
+ S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*sb7))))));
}
z = x;
SET_LOW_WORD(z,0);
@@ -238,6 +242,10 @@
if(hx>=0) return one-r/x; else return r/x-one;
}
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(erf, erfl);
+#endif
+
double
erfc(double x)
{
@@ -279,23 +287,23 @@
x = fabs(x);
s = one/(x*x);
if(ix< 0x4006DB6D) { /* |x| < 1/.35 ~ 2.857143*/
- R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
- ra5+s*(ra6+s*ra7))))));
- S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
- sa5+s*(sa6+s*(sa7+s*sa8)))))));
+ R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*ra7))))));
+ S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+
+ s*sa8)))))));
} else { /* |x| >= 1/.35 ~ 2.857143 */
if(hx<0&&ix>=0x40180000) return two-tiny;/* x < -6 */
- R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
- rb5+s*rb6)))));
- S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
- sb5+s*(sb6+s*sb7))))));
+ R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*rb6)))));
+ S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*sb7))))));
}
z = x;
SET_LOW_WORD(z,0);
- r = __ieee754_exp(-z*z-0.5625)*
- __ieee754_exp((z-x)*(z+x)+R/S);
+ r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
if(hx>0) return r/x; else return two-r/x;
} else {
if(hx>0) return tiny*tiny; else return two-tiny;
}
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(erfc, erfcl);
+#endif
diff --git a/libm/upstream-freebsd/lib/msun/src/s_erff.c b/libm/upstream-freebsd/lib/msun/src/s_erff.c
index a3579f1..d6cfbd2 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_erff.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_erff.c
@@ -19,64 +19,63 @@
#include "math.h"
#include "math_private.h"
+/* XXX Prevent compilers from erroneously constant folding: */
+static const volatile float tiny = 1e-30;
+
static const float
-tiny = 1e-30,
-half= 5.0000000000e-01, /* 0x3F000000 */
-one = 1.0000000000e+00, /* 0x3F800000 */
-two = 2.0000000000e+00, /* 0x40000000 */
+half= 0.5,
+one = 1,
+two = 2,
+erx = 8.42697144e-01, /* 0x3f57bb00 */
/*
- * Coefficients for approximation to erf on [0,0.84375]
+ * In the domain [0, 2**-14], only the first term in the power series
+ * expansion of erf(x) is used. The magnitude of the first neglected
+ * terms is less than 2**-42.
*/
-efx = 1.2837916613e-01, /* 0x3e0375d4 */
-efx8= 1.0270333290e+00, /* 0x3f8375d4 */
+efx = 1.28379166e-01, /* 0x3e0375d4 */
+efx8= 1.02703333e+00, /* 0x3f8375d4 */
/*
- * Domain [0, 0.84375], range ~[-5.4446e-10,5.5197e-10]:
- * |(erf(x) - x)/x - p(x)/q(x)| < 2**-31.
+ * Domain [0, 0.84375], range ~[-5.4419e-10, 5.5179e-10]:
+ * |(erf(x) - x)/x - pp(x)/qq(x)| < 2**-31
*/
-pp0 = 1.28379166e-01F, /* 0x1.06eba8p-3 */
-pp1 = -3.36030394e-01F, /* -0x1.58185ap-2 */
-pp2 = -1.86260219e-03F, /* -0x1.e8451ep-10 */
-qq1 = 3.12324286e-01F, /* 0x1.3fd1f0p-2 */
-qq2 = 2.16070302e-02F, /* 0x1.620274p-6 */
-qq3 = -1.98859419e-03F, /* -0x1.04a626p-9 */
+pp0 = 1.28379166e-01, /* 0x3e0375d4 */
+pp1 = -3.36030394e-01, /* 0xbeac0c2d */
+pp2 = -1.86261395e-03, /* 0xbaf422f4 */
+qq1 = 3.12324315e-01, /* 0x3e9fe8f9 */
+qq2 = 2.16070414e-02, /* 0x3cb10140 */
+qq3 = -1.98859372e-03, /* 0xbb025311 */
/*
- * Domain [0.84375, 1.25], range ~[-1.953e-11,1.940e-11]:
- * |(erf(x) - erx) - p(x)/q(x)| < 2**-36.
+ * Domain [0.84375, 1.25], range ~[-1.023e-9, 1.023e-9]:
+ * |(erf(x) - erx) - pa(x)/qa(x)| < 2**-31
*/
-erx = 8.42697144e-01F, /* 0x1.af7600p-1. erf(1) rounded to 16 bits. */
-pa0 = 3.64939137e-06F, /* 0x1.e9d022p-19 */
-pa1 = 4.15109694e-01F, /* 0x1.a91284p-2 */
-pa2 = -1.65179938e-01F, /* -0x1.5249dcp-3 */
-pa3 = 1.10914491e-01F, /* 0x1.c64e46p-4 */
-qa1 = 6.02074385e-01F, /* 0x1.344318p-1 */
-qa2 = 5.35934687e-01F, /* 0x1.126608p-1 */
-qa3 = 1.68576106e-01F, /* 0x1.593e6ep-3 */
-qa4 = 5.62181212e-02F, /* 0x1.cc89f2p-5 */
+pa0 = 3.65041046e-06, /* 0x3674f993 */
+pa1 = 4.15109307e-01, /* 0x3ed48935 */
+pa2 = -2.09395722e-01, /* 0xbe566bd5 */
+pa3 = 8.67677554e-02, /* 0x3db1b34b */
+qa1 = 4.95560974e-01, /* 0x3efdba2b */
+qa2 = 3.71248513e-01, /* 0x3ebe1449 */
+qa3 = 3.92478965e-02, /* 0x3d20c267 */
/*
- * Domain [1.25,1/0.35], range ~[-7.043e-10,7.457e-10]:
- * |log(x*erfc(x)) + x**2 + 0.5625 - r(x)/s(x)| < 2**-30
+ * Domain [1.25,1/0.35], range ~[-4.821e-9, 4.927e-9]:
+ * |log(x*erfc(x)) + x**2 + 0.5625 - ra(x)/sa(x)| < 2**-28
*/
-ra0 = -9.87132732e-03F, /* -0x1.4376b2p-7 */
-ra1 = -5.53605914e-01F, /* -0x1.1b723cp-1 */
-ra2 = -2.17589188e+00F, /* -0x1.1683a0p+1 */
-ra3 = -1.43268085e+00F, /* -0x1.6ec42cp+0 */
-sa1 = 5.45995426e+00F, /* 0x1.5d6fe4p+2 */
-sa2 = 6.69798088e+00F, /* 0x1.acabb8p+2 */
-sa3 = 1.43113089e+00F, /* 0x1.6e5e98p+0 */
-sa4 = -5.77397496e-02F, /* -0x1.d90108p-5 */
+ra0 = -9.88156721e-03, /* 0xbc21e64c */
+ra1 = -5.43658376e-01, /* 0xbf0b2d32 */
+ra2 = -1.66828310e+00, /* 0xbfd58a4d */
+ra3 = -6.91554189e-01, /* 0xbf3109b2 */
+sa1 = 4.48581553e+00, /* 0x408f8bcd */
+sa2 = 4.10799170e+00, /* 0x408374ab */
+sa3 = 5.53855181e-01, /* 0x3f0dc974 */
/*
- * Domain [1/0.35, 11], range ~[-2.264e-13,2.336e-13]:
- * |log(x*erfc(x)) + x**2 + 0.5625 - r(x)/s(x)| < 2**-42
+ * Domain [2.85715, 11], range ~[-1.484e-9, 1.505e-9]:
+ * |log(x*erfc(x)) + x**2 + 0.5625 - rb(x)/sb(x)| < 2**-30
*/
-rb0 = -9.86494310e-03F, /* -0x1.434124p-7 */
-rb1 = -6.25171244e-01F, /* -0x1.401672p-1 */
-rb2 = -6.16498327e+00F, /* -0x1.8a8f16p+2 */
-rb3 = -1.66696873e+01F, /* -0x1.0ab70ap+4 */
-rb4 = -9.53764343e+00F, /* -0x1.313460p+3 */
-sb1 = 1.26884899e+01F, /* 0x1.96081cp+3 */
-sb2 = 4.51839523e+01F, /* 0x1.6978bcp+5 */
-sb3 = 4.72810211e+01F, /* 0x1.7a3f88p+5 */
-sb4 = 8.93033314e+00F; /* 0x1.1dc54ap+3 */
+rb0 = -9.86496918e-03, /* 0xbc21a0ae */
+rb1 = -5.48049808e-01, /* 0xbf0c4cfe */
+rb2 = -1.84115684e+00, /* 0xbfebab07 */
+sb1 = 4.87132740e+00, /* 0x409be1ea */
+sb2 = 3.04982710e+00, /* 0x4043305e */
+sb3 = -7.61900663e-01; /* 0xbf430bec */
float
erff(float x)
@@ -85,9 +84,9 @@
float R,S,P,Q,s,y,z,r;
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
- if(ix>=0x7f800000) { /* erf(nan)=nan */
+ if(ix>=0x7f800000) { /* erff(nan)=nan */
i = ((u_int32_t)hx>>31)<<1;
- return (float)(1-i)+one/x; /* erf(+-inf)=+-1 */
+ return (float)(1-i)+one/x; /* erff(+-inf)=+-1 */
}
if(ix < 0x3f580000) { /* |x|<0.84375 */
@@ -105,7 +104,7 @@
if(ix < 0x3fa00000) { /* 0.84375 <= |x| < 1.25 */
s = fabsf(x)-one;
P = pa0+s*(pa1+s*(pa2+s*pa3));
- Q = one+s*(qa1+s*(qa2+s*(qa3+s*qa4)));
+ Q = one+s*(qa1+s*(qa2+s*qa3));
if(hx>=0) return erx + P/Q; else return -erx - P/Q;
}
if (ix >= 0x40800000) { /* inf>|x|>=4 */
@@ -113,12 +112,12 @@
}
x = fabsf(x);
s = one/(x*x);
- if(ix< 0x4036DB6E) { /* |x| < 1/0.35 */
+ if(ix< 0x4036db8c) { /* |x| < 2.85715 ~ 1/0.35 */
R=ra0+s*(ra1+s*(ra2+s*ra3));
- S=one+s*(sa1+s*(sa2+s*(sa3+s*sa4)));
- } else { /* |x| >= 1/0.35 */
- R=rb0+s*(rb1+s*(rb2+s*(rb3+s*rb4)));
- S=one+s*(sb1+s*(sb2+s*(sb3+s*sb4)));
+ S=one+s*(sa1+s*(sa2+s*sa3));
+ } else { /* |x| >= 2.85715 ~ 1/0.35 */
+ R=rb0+s*(rb1+s*rb2);
+ S=one+s*(sb1+s*(sb2+s*sb3));
}
SET_FLOAT_WORD(z,hx&0xffffe000);
r = expf(-z*z-0.5625F)*expf((z-x)*(z+x)+R/S);
@@ -132,8 +131,8 @@
float R,S,P,Q,s,y,z,r;
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
- if(ix>=0x7f800000) { /* erfc(nan)=nan */
- /* erfc(+-inf)=0,2 */
+ if(ix>=0x7f800000) { /* erfcf(nan)=nan */
+ /* erfcf(+-inf)=0,2 */
return (float)(((u_int32_t)hx>>31)<<1)+one/x;
}
@@ -155,7 +154,7 @@
if(ix < 0x3fa00000) { /* 0.84375 <= |x| < 1.25 */
s = fabsf(x)-one;
P = pa0+s*(pa1+s*(pa2+s*pa3));
- Q = one+s*(qa1+s*(qa2+s*(qa3+s*qa4)));
+ Q = one+s*(qa1+s*(qa2+s*qa3));
if(hx>=0) {
z = one-erx; return z - P/Q;
} else {
@@ -165,13 +164,13 @@
if (ix < 0x41300000) { /* |x|<11 */
x = fabsf(x);
s = one/(x*x);
- if(ix< 0x4036DB6D) { /* |x| < 1/.35 ~ 2.857143*/
- R=ra0+s*(ra1+s*(ra2+s*ra3));
- S=one+s*(sa1+s*(sa2+s*(sa3+s*sa4)));
- } else { /* |x| >= 1/.35 ~ 2.857143 */
+ if(ix< 0x4036db8c) { /* |x| < 2.85715 ~ 1/.35 */
+ R=ra0+s*(ra1+s*(ra2+s*ra3));
+ S=one+s*(sa1+s*(sa2+s*sa3));
+ } else { /* |x| >= 2.85715 ~ 1/.35 */
if(hx<0&&ix>=0x40a00000) return two-tiny;/* x < -5 */
- R=rb0+s*(rb1+s*(rb2+s*(rb3+s*rb4)));
- S=one+s*(sb1+s*(sb2+s*(sb3+s*sb4)));
+ R=rb0+s*(rb1+s*rb2);
+ S=one+s*(sb1+s*(sb2+s*sb3));
}
SET_FLOAT_WORD(z,hx&0xffffe000);
r = expf(-z*z-0.5625F)*expf((z-x)*(z+x)+R/S);
diff --git a/libm/upstream-freebsd/lib/msun/src/s_remquol.c b/libm/upstream-freebsd/lib/msun/src/s_remquol.c
index 8899293..712651c 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_remquol.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_remquol.c
@@ -5,7 +5,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
diff --git a/libm/upstream-freebsd/lib/msun/src/s_rintl.c b/libm/upstream-freebsd/lib/msun/src/s_rintl.c
index e55b40e..b43df89 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_rintl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_rintl.c
@@ -29,7 +29,6 @@
#include <float.h>
#include <math.h>
-#include <stdint.h>
#include "fpmath.h"
diff --git a/libm/upstream-freebsd/lib/msun/src/s_round.c b/libm/upstream-freebsd/lib/msun/src/s_round.c
index 65de31b..fab3019 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_round.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_round.c
@@ -27,25 +27,34 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <math.h>
+#include <float.h>
+
+#include "math.h"
+#include "math_private.h"
double
round(double x)
{
double t;
+ uint32_t hx;
- if (!isfinite(x))
- return (x);
+ GET_HIGH_WORD(hx, x);
+ if ((hx & 0x7fffffff) == 0x7ff00000)
+ return (x + x);
- if (x >= 0.0) {
+ if (!(hx & 0x80000000)) {
t = floor(x);
if (t - x <= -0.5)
- t += 1.0;
+ t += 1;
return (t);
} else {
t = floor(-x);
if (t + x <= -0.5)
- t += 1.0;
+ t += 1;
return (-t);
}
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(round, roundl);
+#endif
diff --git a/libm/upstream-freebsd/lib/msun/src/s_roundf.c b/libm/upstream-freebsd/lib/msun/src/s_roundf.c
index 952e8e7..e7e2eb9 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_roundf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_roundf.c
@@ -27,25 +27,28 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <math.h>
+#include "math.h"
+#include "math_private.h"
float
roundf(float x)
{
float t;
+ uint32_t hx;
- if (!isfinite(x))
- return (x);
+ GET_FLOAT_WORD(hx, x);
+ if ((hx & 0x7fffffff) == 0x7f800000)
+ return (x + x);
- if (x >= 0.0) {
+ if (!(hx & 0x80000000)) {
t = floorf(x);
- if (t - x <= -0.5)
- t += 1.0;
+ if (t - x <= -0.5F)
+ t += 1;
return (t);
} else {
t = floorf(-x);
- if (t + x <= -0.5)
- t += 1.0;
+ if (t + x <= -0.5F)
+ t += 1;
return (-t);
}
}
diff --git a/libm/upstream-freebsd/lib/msun/src/s_roundl.c b/libm/upstream-freebsd/lib/msun/src/s_roundl.c
index a70b617..2d15e13 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_roundl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_roundl.c
@@ -27,25 +27,36 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <math.h>
+#include <float.h>
+#ifdef __i386__
+#include <ieeefp.h>
+#endif
+
+#include "fpmath.h"
+#include "math.h"
+#include "math_private.h"
long double
roundl(long double x)
{
long double t;
+ uint16_t hx;
- if (!isfinite(x))
- return (x);
+ GET_LDBL_EXPSIGN(hx, x);
+ if ((hx & 0x7fff) == 0x7fff)
+ return (x + x);
- if (x >= 0.0) {
+ ENTERI();
+
+ if (!(hx & 0x8000)) {
t = floorl(x);
- if (t - x <= -0.5)
- t += 1.0;
- return (t);
+ if (t - x <= -0.5L)
+ t += 1;
+ RETURNI(t);
} else {
t = floorl(-x);
- if (t + x <= -0.5)
- t += 1.0;
- return (-t);
+ if (t + x <= -0.5L)
+ t += 1;
+ RETURNI(-t);
}
}
diff --git a/libm/upstream-freebsd/lib/msun/src/s_tanh.c b/libm/upstream-freebsd/lib/msun/src/s_tanh.c
index 96e3565..6d26c69 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_tanh.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_tanh.c
@@ -37,10 +37,13 @@
* only tanh(0)=0 is exact for finite argument.
*/
+#include <float.h>
+
#include "math.h"
#include "math_private.h"
-static const double one = 1.0, two = 2.0, tiny = 1.0e-300, huge = 1.0e300;
+static const volatile double tiny = 1.0e-300;
+static const double one = 1.0, two = 2.0, huge = 1.0e300;
double
tanh(double x)
@@ -75,3 +78,7 @@
}
return (jx>=0)? z: -z;
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(tanh, tanhl);
+#endif
diff --git a/libm/upstream-freebsd/lib/msun/src/s_tanhf.c b/libm/upstream-freebsd/lib/msun/src/s_tanhf.c
index 04f09c6..f537be4 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_tanhf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_tanhf.c
@@ -19,7 +19,9 @@
#include "math.h"
#include "math_private.h"
-static const float one=1.0, two=2.0, tiny = 1.0e-30, huge = 1.0e30;
+static const volatile float tiny = 1.0e-30;
+static const float one=1.0, two=2.0, huge = 1.0e30;
+
float
tanhf(float x)
{
diff --git a/libm/upstream-freebsd/lib/msun/src/s_tanhl.c b/libm/upstream-freebsd/lib/msun/src/s_tanhl.c
new file mode 100644
index 0000000..886158b
--- /dev/null
+++ b/libm/upstream-freebsd/lib/msun/src/s_tanhl.c
@@ -0,0 +1,172 @@
+/* from: FreeBSD: head/lib/msun/src/s_tanhl.c XXX */
+
+/* @(#)s_tanh.c 5.1 93/09/24 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * See s_tanh.c for complete comments.
+ *
+ * Converted to long double by Bruce D. Evans.
+ */
+
+#include <float.h>
+#ifdef __i386__
+#include <ieeefp.h>
+#endif
+
+#include "math.h"
+#include "math_private.h"
+#include "fpmath.h"
+#include "k_expl.h"
+
+#if LDBL_MAX_EXP != 0x4000
+/* We also require the usual expsign encoding. */
+#error "Unsupported long double format"
+#endif
+
+#define BIAS (LDBL_MAX_EXP - 1)
+
+static const volatile double tiny = 1.0e-300;
+static const double one = 1.0;
+#if LDBL_MANT_DIG == 64
+/*
+ * Domain [-0.25, 0.25], range ~[-1.6304e-22, 1.6304e-22]:
+ * |tanh(x)/x - t(x)| < 2**-72.3
+ */
+static const union IEEEl2bits
+T3u = LD80C(0xaaaaaaaaaaaaaa9f, -2, -3.33333333333333333017e-1L);
+#define T3 T3u.e
+static const double
+T5 = 1.3333333333333314e-1, /* 0x1111111111110a.0p-55 */
+T7 = -5.3968253968210485e-2, /* -0x1ba1ba1ba1a1a1.0p-57 */
+T9 = 2.1869488531393817e-2, /* 0x1664f488172022.0p-58 */
+T11 = -8.8632352345964591e-3, /* -0x1226e34bc138d5.0p-59 */
+T13 = 3.5921169709993771e-3, /* 0x1d6d371d3e400f.0p-61 */
+T15 = -1.4555786415756001e-3, /* -0x17d923aa63814d.0p-62 */
+T17 = 5.8645267876296793e-4, /* 0x13378589b85aa7.0p-63 */
+T19 = -2.1121033571392224e-4; /* -0x1baf0af80c4090.0p-65 */
+#elif LDBL_MANT_DIG == 113
+/*
+ * Domain [-0.25, 0.25], range ~[-2.4211e-37, 2.4211e-37]:
+ * |tanh(x)/x - t(x)| < 2**121.6
+ */
+static const long double
+T3 = -3.33333333333333333333333333333332980e-1L, /* -0x1555555555555555555555555554e.0p-114L */
+T5 = 1.33333333333333333333333333332707260e-1L, /* 0x1111111111111111111111110ab7b.0p-115L */
+T7 = -5.39682539682539682539682535723482314e-2L, /* -0x1ba1ba1ba1ba1ba1ba1ba17b5fc98.0p-117L */
+T9 = 2.18694885361552028218693591149061717e-2L, /* 0x1664f4882c10f9f32d6b1a12a25e5.0p-118L */
+T11 = -8.86323552990219656883762347736381851e-3L, /* -0x1226e355e6c23c8f5a5a0f386cb4d.0p-119L */
+T13 = 3.59212803657248101358314398220822722e-3L, /* 0x1d6d3d0e157ddfb403ad3637442c6.0p-121L */
+T15 = -1.45583438705131796512568010348874662e-3L; /* -0x17da36452b75e150c44cc34253b34.0p-122L */
+static const double
+T17 = 5.9002744094556621e-4, /* 0x1355824803668e.0p-63 */
+T19 = -2.3912911424260516e-4, /* -0x1f57d7734c8dde.0p-65 */
+T21 = 9.6915379535512898e-5, /* 0x1967e18ad6a6ca.0p-66 */
+T23 = -3.9278322983156353e-5, /* -0x1497d8e6b75729.0p-67 */
+T25 = 1.5918887220143869e-5, /* 0x10b1319998cafa.0p-68 */
+T27 = -6.4514295231630956e-6, /* -0x1b0f2b71b218eb.0p-70 */
+T29 = 2.6120754043964365e-6, /* 0x15e963a3cf3a39.0p-71 */
+T31 = -1.0407567231003314e-6, /* -0x1176041e656869.0p-72 */
+T33 = 3.4744117554063574e-7; /* 0x1750fe732cab9c.0p-74 */
+#endif /* LDBL_MANT_DIG == 64 */
+
+static inline long double
+divl(long double a, long double b, long double c, long double d,
+ long double e, long double f)
+{
+ long double inv, r;
+ float fr, fw;
+
+ _2sumF(a, c);
+ b = b + c;
+ _2sumF(d, f);
+ e = e + f;
+
+ inv = 1 / (d + e);
+
+ r = (a + b) * inv;
+ fr = r;
+ r = fr;
+
+ fw = d + e;
+ e = d - fw + e;
+ d = fw;
+
+ r = r + (a - d * r + b - e * r) * inv;
+
+ return r;
+}
+
+long double
+tanhl(long double x)
+{
+ long double hi,lo,s,x2,x4,z;
+ double dx2;
+ int16_t jx,ix;
+
+ GET_LDBL_EXPSIGN(jx,x);
+ ix = jx&0x7fff;
+
+ /* x is INF or NaN */
+ if(ix>=0x7fff) {
+ if (jx>=0) return one/x+one; /* tanh(+-inf)=+-1 */
+ else return one/x-one; /* tanh(NaN) = NaN */
+ }
+
+ ENTERI();
+
+ /* |x| < 40 */
+ if (ix < 0x4004 || fabsl(x) < 40) { /* |x|<40 */
+ if (__predict_false(ix<BIAS-(LDBL_MANT_DIG+1)/2)) { /* |x|<TINY */
+ /* tanh(+-0) = +0; tanh(tiny) = tiny(-+) with inexact: */
+ return (x == 0 ? x : (0x1p200 * x - x) * 0x1p-200);
+ }
+ if (ix<0x3ffd) { /* |x|<0.25 */
+ x2 = x*x;
+#if LDBL_MANT_DIG == 64
+ x4 = x2*x2;
+ RETURNI(((T19*x2 + T17)*x4 + (T15*x2 + T13))*(x2*x*x2*x4*x4) +
+ ((T11*x2 + T9)*x4 + (T7*x2 + T5))*(x2*x*x2) +
+ T3*(x2*x) + x);
+#elif LDBL_MANT_DIG == 113
+ dx2 = x2;
+#if 0
+ RETURNI(((((((((((((((T33*dx2 + T31)*dx2 + T29)*dx2 + T27)*dx2 +
+ T25)*x2 + T23)*x2 + T21)*x2 + T19)*x2 + T17)*x2 +
+ T15)*x2 + T13)*x2 + T11)*x2 + T9)*x2 + T7)*x2 + T5)*
+ (x2*x*x2) +
+ T3*(x2*x) + x);
+#else
+ long double q = ((((((((((((((T33*dx2 + T31)*dx2 + T29)*dx2 + T27)*dx2 +
+ T25)*x2 + T23)*x2 + T21)*x2 + T19)*x2 + T17)*x2 +
+ T15)*x2 + T13)*x2 + T11)*x2 + T9)*x2 + T7)*x2 + T5)*
+ (x2*x*x2);
+ RETURNI(q + T3*(x2*x) + x);
+#endif
+#endif
+ }
+ k_hexpl(2*fabsl(x), &hi, &lo);
+ if (ix<0x4001 && fabsl(x) < 1.5) /* |x|<1.5 */
+ z = divl(hi, lo, -0.5, hi, lo, 0.5);
+ else
+ z = one - one/(lo+0.5+hi);
+ /* |x| >= 40, return +-1 */
+ } else {
+ z = one - tiny; /* raise inexact flag */
+ }
+ s = 1;
+ if (jx<0) s = -1;
+ RETURNI(s*z);
+}
diff --git a/libstdc++/include/cmath b/libstdc++/include/cmath
index be70343..a15b2ac 100644
--- a/libstdc++/include/cmath
+++ b/libstdc++/include/cmath
@@ -31,7 +31,7 @@
#define BIONIC_LIBSTDCPP_INCLUDE_CMATH__
/*
- * Standard C++ Library wrapper around the C time.h header file.
+ * Standard C++ Library wrapper around the C math.h header file.
*/
#include <cstddef>
diff --git a/libstdc++/include/new b/libstdc++/include/new
index 0253e8b..c5a43de 100644
--- a/libstdc++/include/new
+++ b/libstdc++/include/new
@@ -13,19 +13,19 @@
void* operator new(std::size_t);
void* operator new[](std::size_t);
-void operator delete(void*);
-void operator delete[](void*);
+void operator delete(void*) throw();
+void operator delete[](void*) throw();
void* operator new(std::size_t, const std::nothrow_t&);
void* operator new[](std::size_t, const std::nothrow_t&);
-void operator delete(void*, const std::nothrow_t&);
-void operator delete[](void*, const std::nothrow_t&);
+void operator delete(void*, const std::nothrow_t&) throw();
+void operator delete[](void*, const std::nothrow_t&) throw();
inline void* operator new(std::size_t, void* p) { return p; }
inline void* operator new[](std::size_t, void* p) { return p; }
// these next two are not really required, since exceptions are off
-inline void operator delete(void*, void*) { }
-inline void operator delete[](void*, void*) { }
+inline void operator delete(void*, void*) throw() { }
+inline void operator delete[](void*, void*) throw() { }
} // extern C++
diff --git a/linker/Android.mk b/linker/Android.mk
index 4298032..d6e0095 100644
--- a/linker/Android.mk
+++ b/linker/Android.mk
@@ -45,13 +45,11 @@
# TODO: split out the asflags.
LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/linker_executable.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_STATIC_LIBRARIES := libc_nomalloc
-LOCAL_FORCE_STATIC_EXECUTABLE := true # not necessary when not including BUILD_EXECUTABLE
-
-LOCAL_2ND_ARCH_VAR_PREFIX := $(linker_2nd_arch_var_prefix)
+LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE := linker
LOCAL_MODULE_STEM_32 := linker
@@ -62,17 +60,12 @@
# meaningful name resolution.
LOCAL_STRIP_MODULE := keep_symbols
-include $(LOCAL_PATH)/linker_executable.mk
-ifdef TARGET_2ND_ARCH
-LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
-OVERRIDE_BUILT_MODULE_PATH :=
-LOCAL_BUILT_MODULE :=
-LOCAL_INSTALLED_MODULE :=
-LOCAL_MODULE_STEM :=
-LOCAL_BUILT_MODULE_STEM :=
-LOCAL_INSTALLED_MODULE_STEM :=
-LOCAL_INTERMEDIATE_TARGETS :=
-include $(LOCAL_PATH)/linker_executable.mk
-endif
+# Insert an extra objcopy step to add prefix to symbols.
+# Note we are using "=" instead of ":=" to defer the evaluation,
+# because LOCAL_2ND_ARCH_VAR_PREFIX or linked_module isn't set properly yet at this point.
+LOCAL_POST_LINK_CMD = $(hide) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY) \
+ --prefix-symbols=__dl_ $(linked_module)
+
+include $(BUILD_EXECUTABLE)
include $(call first-makefiles-under,$(LOCAL_PATH))
diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp
index 3eb5bea..57b2c23 100644
--- a/linker/dlfcn.cpp
+++ b/linker/dlfcn.cpp
@@ -29,7 +29,7 @@
/* This file hijacks the symbols stubbed out in libdl.so. */
-static pthread_mutex_t g_dl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+static pthread_mutex_t g_dl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static const char* __bionic_set_dlerror(char* new_value) {
char** dlerror_slot = &reinterpret_cast<char**>(__get_tls())[TLS_SLOT_DLERROR];
@@ -145,7 +145,7 @@
info->dli_fbase = reinterpret_cast<void*>(si->base);
// Determine if any symbol in the library contains the specified address.
- ElfW(Sym)* sym = dladdr_find_symbol(si, addr);
+ ElfW(Sym)* sym = si->find_symbol_by_address(addr);
if (sym != nullptr) {
info->dli_sname = si->get_string(sym->st_name);
info->dli_saddr = reinterpret_cast<void*>(si->resolve_symbol_address(sym));
@@ -232,20 +232,20 @@
static unsigned g_libdl_chains[] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
#endif
-static soinfo __libdl_info("libdl.so", nullptr, 0);
+static soinfo __libdl_info("libdl.so", nullptr, 0, RTLD_GLOBAL);
// This is used by the dynamic linker. Every process gets these symbols for free.
soinfo* get_libdl_info() {
if ((__libdl_info.flags & FLAG_LINKED) == 0) {
__libdl_info.flags |= FLAG_LINKED;
- __libdl_info.strtab = ANDROID_LIBDL_STRTAB;
- __libdl_info.symtab = g_libdl_symtab;
- __libdl_info.nbucket = sizeof(g_libdl_buckets)/sizeof(unsigned);
- __libdl_info.nchain = sizeof(g_libdl_chains)/sizeof(unsigned);
- __libdl_info.bucket = g_libdl_buckets;
- __libdl_info.chain = g_libdl_chains;
+ __libdl_info.strtab_ = ANDROID_LIBDL_STRTAB;
+ __libdl_info.symtab_ = g_libdl_symtab;
+ __libdl_info.nbucket_ = sizeof(g_libdl_buckets)/sizeof(unsigned);
+ __libdl_info.nchain_ = sizeof(g_libdl_chains)/sizeof(unsigned);
+ __libdl_info.bucket_ = g_libdl_buckets;
+ __libdl_info.chain_ = g_libdl_chains;
__libdl_info.ref_count = 1;
- __libdl_info.strtab_size = sizeof(ANDROID_LIBDL_STRTAB);
+ __libdl_info.strtab_size_ = sizeof(ANDROID_LIBDL_STRTAB);
}
return &__libdl_info;
diff --git a/linker/linked_list.h b/linker/linked_list.h
index 4e62e20..b088061 100644
--- a/linker/linked_list.h
+++ b/linker/linked_list.h
@@ -36,6 +36,12 @@
clear();
}
+ LinkedList(LinkedList&& that) {
+ this->head_ = that.head_;
+ this->tail_ = that.tail_;
+ that.head_ = that.tail_ = nullptr;
+ }
+
void push_front(T* const element) {
LinkedListEntry<T>* new_entry = Allocator::alloc();
new_entry->next = head_;
@@ -86,7 +92,7 @@
}
template<typename F>
- void for_each(F action) {
+ void for_each(F action) const {
visit([&] (T* si) {
action(si);
return true;
@@ -94,7 +100,7 @@
}
template<typename F>
- bool visit(F action) {
+ bool visit(F action) const {
for (LinkedListEntry<T>* e = head_; e != nullptr; e = e->next) {
if (!action(e->element)) {
return false;
@@ -140,6 +146,12 @@
return false;
}
+ static LinkedList make_list(T* const element) {
+ LinkedList<T, Allocator> one_element_list;
+ one_element_list.push_back(element);
+ return one_element_list;
+ }
+
private:
LinkedListEntry<T>* head_;
LinkedListEntry<T>* tail_;
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 35c8cbd..902584a 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
+#include <sys/param.h>
#include <unistd.h>
#include <new>
@@ -194,7 +195,7 @@
// Copy the necessary fields into the debug structure.
link_map* map = &(info->link_map_head);
map->l_addr = info->load_bias;
- map->l_name = reinterpret_cast<char*>(info->name);
+ map->l_name = info->name;
map->l_ld = info->dynamic;
// Stick the new library at the end of the list.
@@ -282,13 +283,13 @@
g_soinfo_links_allocator.protect_all(protection);
}
-static soinfo* soinfo_alloc(const char* name, struct stat* file_stat, off64_t file_offset) {
+static soinfo* soinfo_alloc(const char* name, struct stat* file_stat, off64_t file_offset, uint32_t rtld_flags) {
if (strlen(name) >= SOINFO_NAME_LEN) {
DL_ERR("library name \"%s\" too long", name);
return nullptr;
}
- soinfo* si = new (g_soinfo_allocator.alloc()) soinfo(name, file_stat, file_offset);
+ soinfo* si = new (g_soinfo_allocator.alloc()) soinfo(name, file_stat, file_offset, rtld_flags);
sonext->next = si;
sonext = si;
@@ -316,6 +317,7 @@
}
prev = trav;
}
+
if (trav == nullptr) {
// si was not in solist
DL_ERR("name \"%s\" is not in solist!", si->name);
@@ -335,7 +337,6 @@
g_soinfo_allocator.free(si);
}
-
static void parse_path(const char* path, const char* delimiters,
const char** array, char* buf, size_t buf_size, size_t max_count) {
if (path == nullptr) {
@@ -415,72 +416,130 @@
return rv;
}
-static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name) {
- ElfW(Sym)* symtab = si->symtab;
+ElfW(Sym)* soinfo::find_symbol_by_name(SymbolName& symbol_name) {
+ return is_gnu_hash() ? gnu_lookup(symbol_name) : elf_lookup(symbol_name);
+}
- TRACE_TYPE(LOOKUP, "SEARCH %s in %s@%p %x %zd",
- name, si->name, reinterpret_cast<void*>(si->base), hash, hash % si->nbucket);
-
- for (unsigned n = si->bucket[hash % si->nbucket]; n != 0; n = si->chain[n]) {
- ElfW(Sym)* s = symtab + n;
- if (strcmp(si->get_string(s->st_name), name)) continue;
-
- // only concern ourselves with global and weak symbol definitions
- switch (ELF_ST_BIND(s->st_info)) {
- case STB_GLOBAL:
- case STB_WEAK:
- if (s->st_shndx == SHN_UNDEF) {
- continue;
- }
-
- TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zd",
- name, si->name, reinterpret_cast<void*>(s->st_value),
- static_cast<size_t>(s->st_size));
- return s;
- case STB_LOCAL:
- continue;
- default:
- __libc_fatal("ERROR: Unexpected ST_BIND value: %d for '%s' in '%s'",
- ELF_ST_BIND(s->st_info), name, si->name);
- }
+static bool is_symbol_global_and_defined(const soinfo* si, const ElfW(Sym)* s) {
+ if (ELF_ST_BIND(s->st_info) == STB_GLOBAL ||
+ ELF_ST_BIND(s->st_info) == STB_WEAK) {
+ return s->st_shndx != SHN_UNDEF;
+ } else if (ELF_ST_BIND(s->st_info) != STB_LOCAL) {
+ DL_WARN("unexpected ST_BIND value: %d for '%s' in '%s'",
+ ELF_ST_BIND(s->st_info), si->get_string(s->st_name), si->name);
}
- TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zd",
- name, si->name, reinterpret_cast<void*>(si->base), hash, hash % si->nbucket);
+ return false;
+}
+ElfW(Sym)* soinfo::gnu_lookup(SymbolName& symbol_name) {
+ uint32_t hash = symbol_name.gnu_hash();
+ uint32_t h2 = hash >> gnu_shift2_;
+
+ uint32_t bloom_mask_bits = sizeof(ElfW(Addr))*8;
+ uint32_t word_num = (hash / bloom_mask_bits) & gnu_maskwords_;
+ ElfW(Addr) bloom_word = gnu_bloom_filter_[word_num];
+
+ // test against bloom filter
+ if ((1 & (bloom_word >> (hash % bloom_mask_bits)) & (bloom_word >> (h2 % bloom_mask_bits))) == 0) {
+ return nullptr;
+ }
+
+ // bloom test says "probably yes"...
+ uint32_t n = bucket_[hash % nbucket_];
+
+ if (n == 0) {
+ return nullptr;
+ }
+
+ do {
+ ElfW(Sym)* s = symtab_ + n;
+ if (((chain_[n] ^ hash) >> 1) == 0 &&
+ strcmp(get_string(s->st_name), symbol_name.get_name()) == 0 &&
+ is_symbol_global_and_defined(this, s)) {
+ return s;
+ }
+ } while ((chain_[n++] & 1) == 0);
return nullptr;
}
-soinfo::soinfo(const char* name, const struct stat* file_stat, off64_t file_offset) {
+ElfW(Sym)* soinfo::elf_lookup(SymbolName& symbol_name) {
+ uint32_t hash = symbol_name.elf_hash();
+
+ TRACE_TYPE(LOOKUP, "SEARCH %s in %s@%p h=%x(elf) %zd",
+ symbol_name.get_name(), name, reinterpret_cast<void*>(base), hash, hash % nbucket_);
+
+ for (uint32_t n = bucket_[hash % nbucket_]; n != 0; n = chain_[n]) {
+ ElfW(Sym)* s = symtab_ + n;
+ if (strcmp(get_string(s->st_name), symbol_name.get_name()) == 0 && is_symbol_global_and_defined(this, s)) {
+ TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zd",
+ symbol_name.get_name(), name, reinterpret_cast<void*>(s->st_value),
+ static_cast<size_t>(s->st_size));
+ return s;
+ }
+ }
+
+ TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zd",
+ symbol_name.get_name(), name, reinterpret_cast<void*>(base), hash, hash % nbucket_);
+
+ return nullptr;
+}
+
+soinfo::soinfo(const char* name, const struct stat* file_stat, off64_t file_offset, int rtld_flags) {
memset(this, 0, sizeof(*this));
strlcpy(this->name, name, sizeof(this->name));
flags = FLAG_NEW_SOINFO;
- version = SOINFO_VERSION;
+ version_ = SOINFO_VERSION;
if (file_stat != nullptr) {
- this->st_dev = file_stat->st_dev;
- this->st_ino = file_stat->st_ino;
- this->file_offset = file_offset;
+ this->st_dev_ = file_stat->st_dev;
+ this->st_ino_ = file_stat->st_ino;
+ this->file_offset_ = file_offset;
}
+
+ this->rtld_flags_ = rtld_flags;
}
-static unsigned elfhash(const char* _name) {
- const unsigned char* name = reinterpret_cast<const unsigned char*>(_name);
- unsigned h = 0, g;
- while (*name) {
- h = (h << 4) + *name++;
- g = h & 0xf0000000;
- h ^= g;
- h ^= g >> 24;
+uint32_t SymbolName::elf_hash() {
+ if (!has_elf_hash_) {
+ const unsigned char* name = reinterpret_cast<const unsigned char*>(name_);
+ uint32_t h = 0, g;
+
+ while (*name) {
+ h = (h << 4) + *name++;
+ g = h & 0xf0000000;
+ h ^= g;
+ h ^= g >> 24;
+ }
+
+ elf_hash_ = h;
+ has_elf_hash_ = true;
}
- return h;
+
+ return elf_hash_;
}
-static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi) {
- unsigned elf_hash = elfhash(name);
+uint32_t SymbolName::gnu_hash() {
+ if (!has_gnu_hash_) {
+ uint32_t h = 5381;
+ const unsigned char* name = reinterpret_cast<const unsigned char*>(name_);
+ while (*name != 0) {
+ h += (h << 5) + *name++; // h*33 + c = h + h * 32 + c = h + h << 5 + c
+ }
+
+ gnu_hash_ = h;
+ has_gnu_hash_ = true;
+ }
+
+ return gnu_hash_;
+}
+
+static ElfW(Sym)* soinfo_do_lookup(soinfo* si_from, const char* name, soinfo** si_found_in,
+ const soinfo::soinfo_list_t& global_group, const soinfo::soinfo_list_t& local_group) {
+ SymbolName symbol_name(name);
ElfW(Sym)* s = nullptr;
/* "This element's presence in a shared object library alters the dynamic linker's
@@ -494,63 +553,43 @@
* Note that this is unlikely since static linker avoids generating
* relocations for -Bsymbolic linked dynamic executables.
*/
- if (si->has_DT_SYMBOLIC) {
- DEBUG("%s: looking up %s in local scope (DT_SYMBOLIC)", si->name, name);
- s = soinfo_elf_lookup(si, elf_hash, name);
+ if (si_from->has_DT_SYMBOLIC) {
+ DEBUG("%s: looking up %s in local scope (DT_SYMBOLIC)", si_from->name, name);
+ s = si_from->find_symbol_by_name(symbol_name);
if (s != nullptr) {
- *lsi = si;
+ *si_found_in = si_from;
}
}
- if (s == nullptr && somain != nullptr) {
- // 1. Look for it in the main executable unless we already did.
- if (si != somain || !si->has_DT_SYMBOLIC) {
- DEBUG("%s: looking up %s in executable %s",
- si->name, name, somain->name);
- s = soinfo_elf_lookup(somain, elf_hash, name);
- if (s != nullptr) {
- *lsi = somain;
- }
- }
-
- // 2. Look for it in the ld_preloads
- if (s == nullptr) {
- for (int i = 0; g_ld_preloads[i] != NULL; i++) {
- s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name);
- if (s != nullptr) {
- *lsi = g_ld_preloads[i];
- break;
- }
- }
- }
- }
-
- /* Look for symbols in the local scope (the object who is
- * searching). This happens with C++ templates on x86 for some
- * reason.
- *
- * Notes on weak symbols:
- * The ELF specs are ambiguous about treatment of weak definitions in
- * dynamic linking. Some systems return the first definition found
- * and some the first non-weak definition. This is system dependent.
- * Here we return the first definition found for simplicity. */
-
- if (s == nullptr && !si->has_DT_SYMBOLIC) {
- DEBUG("%s: looking up %s in local scope", si->name, name);
- s = soinfo_elf_lookup(si, elf_hash, name);
- if (s != nullptr) {
- *lsi = si;
- }
- }
-
+ // 1. Look for it in global_group
if (s == nullptr) {
- si->get_children().visit([&](soinfo* child) {
- DEBUG("%s: looking up %s in %s", si->name, name, child->name);
- s = soinfo_elf_lookup(child, elf_hash, name);
+ global_group.visit([&](soinfo* global_si) {
+ DEBUG("%s: looking up %s in %s (from global group)", si_from->name, name, global_si->name);
+ s = global_si->find_symbol_by_name(symbol_name);
if (s != nullptr) {
- *lsi = child;
+ *si_found_in = global_si;
return false;
}
+
+ return true;
+ });
+ }
+
+ // 2. Look for it in the local group
+ if (s == nullptr) {
+ local_group.visit([&](soinfo* local_si) {
+ if (local_si == si_from && si_from->has_DT_SYMBOLIC) {
+ // we already did this - skip
+ return true;
+ }
+
+ DEBUG("%s: looking up %s in %s (from local group)", si_from->name, name, local_si->name);
+ s = local_si->find_symbol_by_name(symbol_name);
+ if (s != nullptr) {
+ *si_found_in = local_si;
+ return false;
+ }
+
return true;
});
}
@@ -558,9 +597,9 @@
if (s != nullptr) {
TRACE_TYPE(LOOKUP, "si %s sym %s s->st_value = %p, "
"found in %s, base = %p, load bias = %p",
- si->name, name, reinterpret_cast<void*>(s->st_value),
- (*lsi)->name, reinterpret_cast<void*>((*lsi)->base),
- reinterpret_cast<void*>((*lsi)->load_bias));
+ si_from->name, name, reinterpret_cast<void*>(s->st_value),
+ (*si_found_in)->name, reinterpret_cast<void*>((*si_found_in)->base),
+ reinterpret_cast<void*>((*si_found_in)->load_bias));
}
return s;
@@ -641,33 +680,61 @@
typedef linked_list_t<LoadTask> LoadTaskList;
-// This is used by dlsym(3). It performs symbol lookup only within the
-// specified soinfo object and its dependencies in breadth first order.
-ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name) {
+// This function walks down the tree of soinfo dependencies
+// in breadth-first order and
+// * calls action(soinfo* si) for each node, and
+// * terminates walk if action returns false.
+//
+// walk_dependencies_tree returns false if walk was terminated
+// by the action and true otherwise.
+template<typename F>
+static bool walk_dependencies_tree(soinfo* root_soinfos[], size_t root_soinfos_size, F action) {
SoinfoLinkedList visit_list;
SoinfoLinkedList visited;
- visit_list.push_back(si);
- soinfo* current_soinfo;
- while ((current_soinfo = visit_list.pop_front()) != nullptr) {
- if (visited.contains(current_soinfo)) {
+ for (size_t i = 0; i < root_soinfos_size; ++i) {
+ visit_list.push_back(root_soinfos[i]);
+ }
+
+ soinfo* si;
+ while ((si = visit_list.pop_front()) != nullptr) {
+ if (visited.contains(si)) {
continue;
}
- ElfW(Sym)* result = soinfo_elf_lookup(current_soinfo, elfhash(name), name);
-
- if (result != nullptr) {
- *found = current_soinfo;
- return result;
+ if (!action(si)) {
+ return false;
}
- visited.push_back(current_soinfo);
- current_soinfo->get_children().for_each([&](soinfo* child) {
+ visited.push_back(si);
+
+ si->get_children().for_each([&](soinfo* child) {
visit_list.push_back(child);
});
}
- return nullptr;
+ return true;
+}
+
+
+// This is used by dlsym(3). It performs symbol lookup only within the
+// specified soinfo object and its dependencies in breadth first order.
+ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name) {
+ ElfW(Sym)* result = nullptr;
+ SymbolName symbol_name(name);
+
+
+ walk_dependencies_tree(&si, 1, [&](soinfo* current_soinfo) {
+ result = current_soinfo->find_symbol_by_name(symbol_name);
+ if (result != nullptr) {
+ *found = current_soinfo;
+ return false;
+ }
+
+ return true;
+ });
+
+ return result;
}
/* This is used by dlsym(3) to performs a global symbol lookup. If the
@@ -676,7 +743,7 @@
specified soinfo (for RTLD_NEXT).
*/
ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start) {
- unsigned elf_hash = elfhash(name);
+ SymbolName symbol_name(name);
if (start == nullptr) {
start = solist;
@@ -684,7 +751,11 @@
ElfW(Sym)* s = nullptr;
for (soinfo* si = start; (s == nullptr) && (si != nullptr); si = si->next) {
- s = soinfo_elf_lookup(si, elf_hash, name);
+ if ((si->get_rtld_flags() & RTLD_GLOBAL) == 0) {
+ continue;
+ }
+
+ s = si->find_symbol_by_name(symbol_name);
if (s != nullptr) {
*found = si;
break;
@@ -709,16 +780,45 @@
return nullptr;
}
-ElfW(Sym)* dladdr_find_symbol(soinfo* si, const void* addr) {
- ElfW(Addr) soaddr = reinterpret_cast<ElfW(Addr)>(addr) - si->base;
+ElfW(Sym)* soinfo::find_symbol_by_address(const void* addr) {
+ return is_gnu_hash() ? gnu_addr_lookup(addr) : elf_addr_lookup(addr);
+}
+
+static bool symbol_matches_soaddr(const ElfW(Sym)* sym, ElfW(Addr) soaddr) {
+ return sym->st_shndx != SHN_UNDEF &&
+ soaddr >= sym->st_value &&
+ soaddr < sym->st_value + sym->st_size;
+}
+
+ElfW(Sym)* soinfo::gnu_addr_lookup(const void* addr) {
+ ElfW(Addr) soaddr = reinterpret_cast<ElfW(Addr)>(addr) - base;
+
+ for (size_t i = 0; i < nbucket_; ++i) {
+ uint32_t n = bucket_[i];
+
+ if (n == 0) {
+ continue;
+ }
+
+ do {
+ ElfW(Sym)* sym = symtab_ + n;
+ if (symbol_matches_soaddr(sym, soaddr)) {
+ return sym;
+ }
+ } while ((chain_[n++] & 1) == 0);
+ }
+
+ return nullptr;
+}
+
+ElfW(Sym)* soinfo::elf_addr_lookup(const void* addr) {
+ ElfW(Addr) soaddr = reinterpret_cast<ElfW(Addr)>(addr) - base;
// Search the library's symbol table for any defined symbol which
// contains this address.
- for (size_t i = 0; i < si->nchain; ++i) {
- ElfW(Sym)* sym = &si->symtab[i];
- if (sym->st_shndx != SHN_UNDEF &&
- soaddr >= sym->st_value &&
- soaddr < sym->st_value + sym->st_size) {
+ for (size_t i = 0; i < nchain_; ++i) {
+ ElfW(Sym)* sym = symtab_ + i;
+ if (symbol_matches_soaddr(sym, soaddr)) {
return sym;
}
}
@@ -774,7 +874,7 @@
}
}
-static soinfo* load_library(LoadTaskList& load_tasks, const char* name, int dlflags, const android_dlextinfo* extinfo) {
+static soinfo* load_library(LoadTaskList& load_tasks, const char* name, int rtld_flags, const android_dlextinfo* extinfo) {
int fd = -1;
off64_t file_offset = 0;
ScopedFd file_guard(-1);
@@ -799,12 +899,20 @@
DL_ERR("file offset for the library \"%s\" is not page-aligned: %" PRId64, name, file_offset);
return nullptr;
}
+ if (file_offset < 0) {
+ DL_ERR("file offset for the library \"%s\" is negative: %" PRId64, name, file_offset);
+ return nullptr;
+ }
struct stat file_stat;
if (TEMP_FAILURE_RETRY(fstat(fd, &file_stat)) != 0) {
DL_ERR("unable to stat file for the library \"%s\": %s", name, strerror(errno));
return nullptr;
}
+ if (file_offset >= file_stat.st_size) {
+ DL_ERR("file offset for the library \"%s\" >= file size: %" PRId64 " >= %" PRId64, name, file_offset, file_stat.st_size);
+ return nullptr;
+ }
// Check for symlink and other situations where
// file can have different names.
@@ -819,7 +927,7 @@
}
}
- if ((dlflags & RTLD_NOLOAD) != 0) {
+ if ((rtld_flags & RTLD_NOLOAD) != 0) {
DL_ERR("library \"%s\" wasn't loaded and RTLD_NOLOAD prevented it", name);
return nullptr;
}
@@ -830,7 +938,7 @@
return nullptr;
}
- soinfo* si = soinfo_alloc(SEARCH_NAME(name), &file_stat, file_offset);
+ soinfo* si = soinfo_alloc(SEARCH_NAME(name), &file_stat, file_offset, rtld_flags);
if (si == nullptr) {
return nullptr;
}
@@ -840,7 +948,7 @@
si->phnum = elf_reader.phdr_count();
si->phdr = elf_reader.loaded_phdr();
- if (!si->PrelinkImage()) {
+ if (!si->prelink_image()) {
soinfo_free(si);
return nullptr;
}
@@ -862,7 +970,7 @@
return nullptr;
}
-static soinfo* find_library_internal(LoadTaskList& load_tasks, const char* name, int dlflags, const android_dlextinfo* extinfo) {
+static soinfo* find_library_internal(LoadTaskList& load_tasks, const char* name, int rtld_flags, const android_dlextinfo* extinfo) {
soinfo* si = find_loaded_library_by_name(name);
@@ -870,7 +978,7 @@
// of this fact is done by load_library.
if (si == nullptr) {
TRACE("[ '%s' has not been found by name. Trying harder...]", name);
- si = load_library(load_tasks, name, dlflags, extinfo);
+ si = load_library(load_tasks, name, rtld_flags, extinfo);
}
return si;
@@ -893,19 +1001,51 @@
});
}
-static bool find_libraries(const char* const library_names[], size_t library_names_size, soinfo* soinfos[],
- soinfo* ld_preloads[], size_t ld_preloads_size, int dlflags, const android_dlextinfo* extinfo) {
- // Step 0: prepare.
- LoadTaskList load_tasks;
- for (size_t i = 0; i < library_names_size; ++i) {
- const char* name = library_names[i];
- load_tasks.push_back(LoadTask::create(name, nullptr));
+// TODO: this is slightly unusual way to construct
+// the global group for relocation. Not every RTLD_GLOBAL
+// library is included in this group for backwards-compatibility
+// reasons.
+//
+// This group consists of the main executable, LD_PRELOADs
+// and libraries with the DF_1_GLOBAL flag set.
+static soinfo::soinfo_list_t make_global_group() {
+ soinfo::soinfo_list_t global_group;
+ for (soinfo* si = somain; si != nullptr; si = si->next) {
+ if ((si->get_dt_flags_1() & DF_1_GLOBAL) != 0) {
+ global_group.push_back(si);
+ }
}
- // Libraries added to this list in reverse order so that we can
- // start linking from bottom-up - see step 2.
- SoinfoLinkedList found_libs;
- size_t soinfos_size = 0;
+ return global_group;
+}
+
+static bool find_libraries(soinfo* start_with, const char* const library_names[], size_t library_names_count, soinfo* soinfos[],
+ soinfo* ld_preloads[], size_t ld_preloads_count, int rtld_flags, const android_dlextinfo* extinfo) {
+ // Step 0: prepare.
+ LoadTaskList load_tasks;
+ for (size_t i = 0; i < library_names_count; ++i) {
+ const char* name = library_names[i];
+ load_tasks.push_back(LoadTask::create(name, start_with));
+ }
+
+ // Construct global_group.
+ soinfo::soinfo_list_t global_group = make_global_group();
+
+ // If soinfos array is null allocate one on stack.
+ // The array is needed in case of failure; for example
+ // when library_names[] = {libone.so, libtwo.so} and libone.so
+ // is loaded correctly but libtwo.so failed for some reason.
+ // In this case libone.so should be unloaded on return.
+ // See also implementation of failure_guard below.
+
+ if (soinfos == nullptr) {
+ size_t soinfos_size = sizeof(soinfo*)*library_names_count;
+ soinfos = reinterpret_cast<soinfo**>(alloca(soinfos_size));
+ memset(soinfos, 0, soinfos_size);
+ }
+
+ // list of libraries to link - see step 2.
+ size_t soinfos_count = 0;
auto failure_guard = make_scope_guard([&]() {
// Housekeeping
@@ -913,14 +1053,14 @@
LoadTask::deleter(t);
});
- for (size_t i = 0; i<soinfos_size; ++i) {
+ for (size_t i = 0; i<soinfos_count; ++i) {
soinfo_unload(soinfos[i]);
}
});
// Step 1: load and pre-link all DT_NEEDED libraries in breadth first order.
for (LoadTask::unique_ptr task(load_tasks.pop_front()); task.get() != nullptr; task.reset(load_tasks.pop_front())) {
- soinfo* si = find_library_internal(load_tasks, task->get_name(), dlflags, extinfo);
+ soinfo* si = find_library_internal(load_tasks, task->get_name(), rtld_flags, extinfo);
if (si == nullptr) {
return false;
}
@@ -935,37 +1075,52 @@
if (needed_by != nullptr) {
needed_by->add_child(si);
}
- found_libs.push_front(si);
- // When ld_preloads is not null first
- // ld_preloads_size libs are in fact ld_preloads.
- if (ld_preloads != nullptr && soinfos_size < ld_preloads_size) {
- ld_preloads[soinfos_size] = si;
+ // When ld_preloads is not null, the first
+ // ld_preloads_count libs are in fact ld_preloads.
+ if (ld_preloads != nullptr && soinfos_count < ld_preloads_count) {
+ // Add LD_PRELOADed libraries to the global group for future runs.
+ // There is no need to explicitly add them to the global group
+ // for this run because they are going to appear in the local
+ // group in the correct order.
+ si->set_dt_flags_1(si->get_dt_flags_1() | DF_1_GLOBAL);
+ ld_preloads[soinfos_count] = si;
}
- if (soinfos_size<library_names_size) {
- soinfos[soinfos_size++] = si;
+ if (soinfos_count < library_names_count) {
+ soinfos[soinfos_count++] = si;
}
}
// Step 2: link libraries.
- soinfo* si;
- while ((si = found_libs.pop_front()) != nullptr) {
+ soinfo::soinfo_list_t local_group;
+ walk_dependencies_tree(
+ start_with == nullptr ? soinfos : &start_with,
+ start_with == nullptr ? soinfos_count : 1,
+ [&] (soinfo* si) {
+ local_group.push_back(si);
+ return true;
+ });
+
+ bool linked = local_group.visit([&](soinfo* si) {
if ((si->flags & FLAG_LINKED) == 0) {
- if (!si->LinkImage(extinfo)) {
+ if (!si->link_image(global_group, local_group, extinfo)) {
return false;
}
si->flags |= FLAG_LINKED;
}
+
+ return true;
+ });
+
+ if (linked) {
+ failure_guard.disable();
}
- // All is well - found_libs and load_tasks are empty at this point
- // and all libs are successfully linked.
- failure_guard.disable();
- return true;
+ return linked;
}
-static soinfo* find_library(const char* name, int dlflags, const android_dlextinfo* extinfo) {
+static soinfo* find_library(const char* name, int rtld_flags, const android_dlextinfo* extinfo) {
if (name == nullptr) {
somain->ref_count++;
return somain;
@@ -973,30 +1128,34 @@
soinfo* si;
- if (!find_libraries(&name, 1, &si, nullptr, 0, dlflags, extinfo)) {
+ if (!find_libraries(nullptr, &name, 1, &si, nullptr, 0, rtld_flags, extinfo)) {
return nullptr;
}
return si;
}
-static void soinfo_unload(soinfo* si) {
+static void soinfo_unload_schedule(soinfo::soinfo_list_t& unload_list, soinfo* si) {
+ if (!si->can_unload()) {
+ TRACE("not unloading '%s' - the binary is flagged with NODELETE", si->name);
+ return;
+ }
+
if (si->ref_count == 1) {
- TRACE("unloading '%s'", si->name);
- si->CallDestructors();
+ unload_list.push_back(si);
if (si->has_min_version(0)) {
soinfo* child = nullptr;
while ((child = si->get_children().pop_front()) != nullptr) {
TRACE("%s needs to unload %s", si->name, child->name);
- soinfo_unload(child);
+ soinfo_unload_schedule(unload_list, child);
}
} else {
for_each_dt_needed(si, [&] (const char* library_name) {
TRACE("deprecated (old format of soinfo): %s needs to unload %s", si->name, library_name);
soinfo* needed = find_library(library_name, RTLD_NOLOAD, nullptr);
if (needed != nullptr) {
- soinfo_unload(needed);
+ soinfo_unload_schedule(unload_list, needed);
} else {
// Not found: for example if symlink was deleted between dlopen and dlclose
// Since we cannot really handle errors at this point - print and continue.
@@ -1005,15 +1164,28 @@
});
}
- notify_gdb_of_unload(si);
si->ref_count = 0;
- soinfo_free(si);
} else {
si->ref_count--;
TRACE("not unloading '%s', decrementing ref_count to %zd", si->name, si->ref_count);
}
}
+static void soinfo_unload(soinfo* root) {
+ soinfo::soinfo_list_t unload_list;
+ soinfo_unload_schedule(unload_list, root);
+ unload_list.for_each([](soinfo* si) {
+ si->call_destructors();
+ });
+
+ soinfo* si = nullptr;
+ while ((si = unload_list.pop_front()) != nullptr) {
+ TRACE("unloading '%s'", si->name);
+ notify_gdb_of_unload(si);
+ soinfo_free(si);
+ }
+}
+
void do_android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size) {
// Use basic string manipulation calls to avoid snprintf.
// snprintf indirectly calls pthread_getspecific to get the size of a buffer.
@@ -1039,7 +1211,7 @@
}
soinfo* do_dlopen(const char* name, int flags, const android_dlextinfo* extinfo) {
- if ((flags & ~(RTLD_NOW|RTLD_LAZY|RTLD_LOCAL|RTLD_GLOBAL|RTLD_NOLOAD)) != 0) {
+ if ((flags & ~(RTLD_NOW|RTLD_LAZY|RTLD_LOCAL|RTLD_GLOBAL|RTLD_NODELETE|RTLD_NOLOAD)) != 0) {
DL_ERR("invalid flags to dlopen: %x", flags);
return nullptr;
}
@@ -1057,7 +1229,7 @@
protect_data(PROT_READ | PROT_WRITE);
soinfo* si = find_library(name, flags, extinfo);
if (si != nullptr) {
- si->CallConstructors();
+ si->call_constructors();
}
protect_data(PROT_READ);
return si;
@@ -1079,7 +1251,7 @@
}
#if defined(USE_RELA)
-int soinfo::Relocate(ElfW(Rela)* rela, unsigned count) {
+int soinfo::relocate(ElfW(Rela)* rela, unsigned count, const soinfo_list_t& global_group, const soinfo_list_t& local_group) {
for (size_t idx = 0; idx < count; ++idx, ++rela) {
unsigned type = ELFW(R_TYPE)(rela->r_info);
unsigned sym = ELFW(R_SYM)(rela->r_info);
@@ -1096,11 +1268,11 @@
soinfo* lsi = nullptr;
if (sym != 0) {
- sym_name = get_string(symtab[sym].st_name);
- s = soinfo_do_lookup(this, sym_name, &lsi);
+ sym_name = get_string(symtab_[sym].st_name);
+ s = soinfo_do_lookup(this, sym_name, &lsi, global_group,local_group);
if (s == nullptr) {
// We only allow an undefined symbol if this is a weak reference...
- s = &symtab[sym];
+ s = &symtab_[sym];
if (ELF_ST_BIND(s->st_info) != STB_WEAK) {
DL_ERR("cannot locate symbol \"%s\" referenced by \"%s\"...", sym_name, name);
return -1;
@@ -1356,7 +1528,7 @@
}
#else // REL, not RELA.
-int soinfo::Relocate(ElfW(Rel)* rel, unsigned count) {
+int soinfo::relocate(ElfW(Rel)* rel, unsigned count, const soinfo_list_t& global_group, const soinfo_list_t& local_group) {
for (size_t idx = 0; idx < count; ++idx, ++rel) {
unsigned type = ELFW(R_TYPE)(rel->r_info);
// TODO: don't use unsigned for 'sym'. Use uint32_t or ElfW(Addr) instead.
@@ -1374,11 +1546,11 @@
soinfo* lsi = nullptr;
if (sym != 0) {
- sym_name = get_string(symtab[sym].st_name);
- s = soinfo_do_lookup(this, sym_name, &lsi);
+ sym_name = get_string(symtab_[sym].st_name);
+ s = soinfo_do_lookup(this, sym_name, &lsi, global_group, local_group);
if (s == nullptr) {
// We only allow an undefined symbol if this is a weak reference...
- s = &symtab[sym];
+ s = &symtab_[sym];
if (ELF_ST_BIND(s->st_info) != STB_WEAK) {
DL_ERR("cannot locate symbol \"%s\" referenced by \"%s\"...", sym_name, name);
return -1;
@@ -1561,43 +1733,39 @@
#endif
#if defined(__mips__)
-static bool mips_relocate_got(soinfo* si) {
- ElfW(Addr)** got = si->plt_got;
+bool soinfo::mips_relocate_got(const soinfo_list_t& global_group, const soinfo_list_t& local_group) {
+ ElfW(Addr)** got = plt_got_;
if (got == nullptr) {
return true;
}
- unsigned local_gotno = si->mips_local_gotno;
- unsigned gotsym = si->mips_gotsym;
- unsigned symtabno = si->mips_symtabno;
- ElfW(Sym)* symtab = si->symtab;
// got[0] is the address of the lazy resolver function.
// got[1] may be used for a GNU extension.
// Set it to a recognizable address in case someone calls it (should be _rtld_bind_start).
// FIXME: maybe this should be in a separate routine?
- if ((si->flags & FLAG_LINKER) == 0) {
+ if ((flags & FLAG_LINKER) == 0) {
size_t g = 0;
got[g++] = reinterpret_cast<ElfW(Addr)*>(0xdeadbeef);
if (reinterpret_cast<intptr_t>(got[g]) < 0) {
got[g++] = reinterpret_cast<ElfW(Addr)*>(0xdeadfeed);
}
// Relocate the local GOT entries.
- for (; g < local_gotno; g++) {
- got[g] = reinterpret_cast<ElfW(Addr)*>(reinterpret_cast<uintptr_t>(got[g]) + si->load_bias);
+ for (; g < mips_local_gotno_; g++) {
+ got[g] = reinterpret_cast<ElfW(Addr)*>(reinterpret_cast<uintptr_t>(got[g]) + load_bias);
}
}
// Now for the global GOT entries...
- ElfW(Sym)* sym = symtab + gotsym;
- got = si->plt_got + local_gotno;
- for (size_t g = gotsym; g < symtabno; g++, sym++, got++) {
+ ElfW(Sym)* sym = symtab_ + mips_gotsym_;
+ got = plt_got_ + mips_local_gotno_;
+ for (size_t g = mips_gotsym_; g < mips_symtabno_; g++, sym++, got++) {
// This is an undefined reference... try to locate it.
- const char* sym_name = si->get_string(sym->st_name);
+ const char* sym_name = get_string(sym->st_name);
soinfo* lsi = nullptr;
- ElfW(Sym)* s = soinfo_do_lookup(si, sym_name, &lsi);
+ ElfW(Sym)* s = soinfo_do_lookup(this, sym_name, &lsi, global_group, local_group);
if (s == nullptr) {
// We only allow an undefined symbol if this is a weak reference.
- s = &symtab[g];
+ s = &symtab_[g];
if (ELF_ST_BIND(s->st_info) != STB_WEAK) {
DL_ERR("cannot locate \"%s\"...", sym_name);
return false;
@@ -1614,7 +1782,7 @@
}
#endif
-void soinfo::CallArray(const char* array_name __unused, linker_function_t* functions, size_t count, bool reverse) {
+void soinfo::call_array(const char* array_name __unused, linker_function_t* functions, size_t count, bool reverse) {
if (functions == nullptr) {
return;
}
@@ -1627,13 +1795,13 @@
for (int i = begin; i != end; i += step) {
TRACE("[ %s[%d] == %p ]", array_name, i, functions[i]);
- CallFunction("function", functions[i]);
+ call_function("function", functions[i]);
}
TRACE("[ Done calling %s for '%s' ]", array_name, name);
}
-void soinfo::CallFunction(const char* function_name __unused, linker_function_t function) {
+void soinfo::call_function(const char* function_name __unused, linker_function_t function) {
if (function == nullptr || reinterpret_cast<uintptr_t>(function) == static_cast<uintptr_t>(-1)) {
return;
}
@@ -1647,13 +1815,13 @@
protect_data(PROT_READ | PROT_WRITE);
}
-void soinfo::CallPreInitConstructors() {
+void soinfo::call_pre_init_constructors() {
// DT_PREINIT_ARRAY functions are called before any other constructors for executables,
// but ignored in a shared library.
- CallArray("DT_PREINIT_ARRAY", preinit_array, preinit_array_count, false);
+ call_array("DT_PREINIT_ARRAY", preinit_array_, preinit_array_count_, false);
}
-void soinfo::CallConstructors() {
+void soinfo::call_constructors() {
if (constructors_called) {
return;
}
@@ -1670,34 +1838,34 @@
// out above, the libc constructor will be called again (recursively!).
constructors_called = true;
- if ((flags & FLAG_EXE) == 0 && preinit_array != nullptr) {
+ if ((flags & FLAG_EXE) == 0 && preinit_array_ != nullptr) {
// The GNU dynamic linker silently ignores these, but we warn the developer.
PRINT("\"%s\": ignoring %zd-entry DT_PREINIT_ARRAY in shared library!",
- name, preinit_array_count);
+ name, preinit_array_count_);
}
get_children().for_each([] (soinfo* si) {
- si->CallConstructors();
+ si->call_constructors();
});
TRACE("\"%s\": calling constructors", name);
// DT_INIT should be called before DT_INIT_ARRAY if both are present.
- CallFunction("DT_INIT", init_func);
- CallArray("DT_INIT_ARRAY", init_array, init_array_count, false);
+ call_function("DT_INIT", init_func_);
+ call_array("DT_INIT_ARRAY", init_array_, init_array_count_, false);
}
-void soinfo::CallDestructors() {
+void soinfo::call_destructors() {
if (!constructors_called) {
return;
}
TRACE("\"%s\": calling destructors", name);
// DT_FINI_ARRAY must be parsed in reverse order.
- CallArray("DT_FINI_ARRAY", fini_array, fini_array_count, true);
+ call_array("DT_FINI_ARRAY", fini_array_, fini_array_count_, true);
// DT_FINI should be called after DT_FINI_ARRAY if both are present.
- CallFunction("DT_FINI", fini_func);
+ call_function("DT_FINI", fini_func_);
// This is needed on second call to dlopen
// after library has been unloaded with RTLD_NODELETE
@@ -1706,8 +1874,8 @@
void soinfo::add_child(soinfo* child) {
if (has_min_version(0)) {
- child->parents.push_back(this);
- this->children.push_back(child);
+ child->parents_.push_back(this);
+ this->children_.push_back(child);
}
}
@@ -1717,65 +1885,94 @@
}
// 1. Untie connected soinfos from 'this'.
- children.for_each([&] (soinfo* child) {
- child->parents.remove_if([&] (const soinfo* parent) {
+ children_.for_each([&] (soinfo* child) {
+ child->parents_.remove_if([&] (const soinfo* parent) {
return parent == this;
});
});
- parents.for_each([&] (soinfo* parent) {
- parent->children.remove_if([&] (const soinfo* child) {
+ parents_.for_each([&] (soinfo* parent) {
+ parent->children_.remove_if([&] (const soinfo* child) {
return child == this;
});
});
// 2. Once everything untied - clear local lists.
- parents.clear();
- children.clear();
+ parents_.clear();
+ children_.clear();
}
-dev_t soinfo::get_st_dev() {
+dev_t soinfo::get_st_dev() const {
if (has_min_version(0)) {
- return st_dev;
+ return st_dev_;
}
return 0;
};
-ino_t soinfo::get_st_ino() {
+ino_t soinfo::get_st_ino() const {
if (has_min_version(0)) {
- return st_ino;
+ return st_ino_;
}
return 0;
}
-off64_t soinfo::get_file_offset() {
+off64_t soinfo::get_file_offset() const {
if (has_min_version(1)) {
- return file_offset;
+ return file_offset_;
}
return 0;
}
+uint32_t soinfo::get_rtld_flags() const {
+ if (has_min_version(1)) {
+ return rtld_flags_;
+ }
+
+ return 0;
+}
+
+uint32_t soinfo::get_dt_flags_1() const {
+ if (has_min_version(1)) {
+ return dt_flags_1_;
+ }
+
+ return 0;
+}
+void soinfo::set_dt_flags_1(uint32_t dt_flags_1) {
+ if (has_min_version(1)) {
+ if ((dt_flags_1 & DF_1_GLOBAL) != 0) {
+ rtld_flags_ |= RTLD_GLOBAL;
+ }
+
+ if ((dt_flags_1 & DF_1_NODELETE) != 0) {
+ rtld_flags_ |= RTLD_NODELETE;
+ }
+
+ dt_flags_1_ = dt_flags_1;
+ }
+}
+
// This is a return on get_children()/get_parents() if
// 'this->flags' does not have FLAG_NEW_SOINFO set.
static soinfo::soinfo_list_t g_empty_list;
soinfo::soinfo_list_t& soinfo::get_children() {
if (has_min_version(0)) {
- return this->children;
+ return children_;
}
return g_empty_list;
}
soinfo::soinfo_list_t& soinfo::get_parents() {
- if ((this->flags & FLAG_NEW_SOINFO) == 0) {
- return g_empty_list;
+ if (has_min_version(0)) {
+ return parents_;
}
- return this->parents;
+ return g_empty_list;
}
ElfW(Addr) soinfo::resolve_symbol_address(ElfW(Sym)* s) {
@@ -1787,11 +1984,19 @@
}
const char* soinfo::get_string(ElfW(Word) index) const {
- if (has_min_version(1) && (index >= strtab_size)) {
- __libc_fatal("%s: strtab out of bounds error; STRSZ=%zd, name=%d", name, strtab_size, index);
+ if (has_min_version(1) && (index >= strtab_size_)) {
+ __libc_fatal("%s: strtab out of bounds error; STRSZ=%zd, name=%d", name, strtab_size_, index);
}
- return strtab + index;
+ return strtab_ + index;
+}
+
+bool soinfo::is_gnu_hash() const {
+ return (flags & FLAG_GNU_HASH) != 0;
+}
+
+bool soinfo::can_unload() const {
+ return (get_rtld_flags() & (RTLD_NODELETE | RTLD_GLOBAL)) == 0;
}
/* Force any of the closed stdin, stdout and stderr to be associated with
@@ -1855,7 +2060,7 @@
return return_value;
}
-bool soinfo::PrelinkImage() {
+bool soinfo::prelink_image() {
/* Extract dynamic section */
ElfW(Word) dynamic_flags = 0;
phdr_table_get_dynamic_section(phdr, phnum, load_bias, &dynamic, &dynamic_flags);
@@ -1895,27 +2100,57 @@
break;
case DT_HASH:
- nbucket = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr)[0];
- nchain = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr)[1];
- bucket = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr + 8);
- chain = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr + 8 + nbucket * 4);
+ if (nbucket_ != 0) {
+ // in case of --hash-style=both, we prefer gnu
+ break;
+ }
+
+ nbucket_ = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr)[0];
+ nchain_ = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr)[1];
+ bucket_ = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr + 8);
+ chain_ = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr + 8 + nbucket_ * 4);
+ break;
+
+ case DT_GNU_HASH:
+ if (nbucket_ != 0) {
+ // in case of --hash-style=both, we prefer gnu
+ nchain_ = 0;
+ }
+
+ nbucket_ = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr)[0];
+ // skip symndx
+ gnu_maskwords_ = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr)[2];
+ gnu_shift2_ = reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr)[3];
+
+ gnu_bloom_filter_ = reinterpret_cast<ElfW(Addr)*>(load_bias + d->d_un.d_ptr + 16);
+ bucket_ = reinterpret_cast<uint32_t*>(gnu_bloom_filter_ + gnu_maskwords_);
+ // amend chain for symndx = header[1]
+ chain_ = bucket_ + nbucket_ - reinterpret_cast<uint32_t*>(load_bias + d->d_un.d_ptr)[1];
+
+ if (!powerof2(gnu_maskwords_)) {
+ DL_ERR("invalid maskwords for gnu_hash = 0x%x, in \"%s\" expecting power to two", gnu_maskwords_, name);
+ return false;
+ }
+ --gnu_maskwords_;
+
+ flags |= FLAG_GNU_HASH;
break;
case DT_STRTAB:
- strtab = reinterpret_cast<const char*>(load_bias + d->d_un.d_ptr);
+ strtab_ = reinterpret_cast<const char*>(load_bias + d->d_un.d_ptr);
break;
case DT_STRSZ:
- strtab_size = d->d_un.d_val;
+ strtab_size_ = d->d_un.d_val;
break;
case DT_SYMTAB:
- symtab = reinterpret_cast<ElfW(Sym)*>(load_bias + d->d_un.d_ptr);
+ symtab_ = reinterpret_cast<ElfW(Sym)*>(load_bias + d->d_un.d_ptr);
break;
case DT_SYMENT:
if (d->d_un.d_val != sizeof(ElfW(Sym))) {
- DL_ERR("invalid DT_SYMENT: %zd", static_cast<size_t>(d->d_un.d_val));
+ DL_ERR("invalid DT_SYMENT: %zd in \"%s\"", static_cast<size_t>(d->d_un.d_val), name);
return false;
}
break;
@@ -1936,24 +2171,24 @@
case DT_JMPREL:
#if defined(USE_RELA)
- plt_rela = reinterpret_cast<ElfW(Rela)*>(load_bias + d->d_un.d_ptr);
+ plt_rela_ = reinterpret_cast<ElfW(Rela)*>(load_bias + d->d_un.d_ptr);
#else
- plt_rel = reinterpret_cast<ElfW(Rel)*>(load_bias + d->d_un.d_ptr);
+ plt_rel_ = reinterpret_cast<ElfW(Rel)*>(load_bias + d->d_un.d_ptr);
#endif
break;
case DT_PLTRELSZ:
#if defined(USE_RELA)
- plt_rela_count = d->d_un.d_val / sizeof(ElfW(Rela));
+ plt_rela_count_ = d->d_un.d_val / sizeof(ElfW(Rela));
#else
- plt_rel_count = d->d_un.d_val / sizeof(ElfW(Rel));
+ plt_rel_count_ = d->d_un.d_val / sizeof(ElfW(Rel));
#endif
break;
case DT_PLTGOT:
#if defined(__mips__)
// Used by mips and mips64.
- plt_got = reinterpret_cast<ElfW(Addr)**>(load_bias + d->d_un.d_ptr);
+ plt_got_ = reinterpret_cast<ElfW(Addr)**>(load_bias + d->d_un.d_ptr);
#endif
// Ignore for other platforms... (because RTLD_LAZY is not supported)
break;
@@ -1973,11 +2208,11 @@
#endif
#if defined(USE_RELA)
case DT_RELA:
- rela = reinterpret_cast<ElfW(Rela)*>(load_bias + d->d_un.d_ptr);
+ rela_ = reinterpret_cast<ElfW(Rela)*>(load_bias + d->d_un.d_ptr);
break;
case DT_RELASZ:
- rela_count = d->d_un.d_val / sizeof(ElfW(Rela));
+ rela_count_ = d->d_un.d_val / sizeof(ElfW(Rela));
break;
case DT_RELAENT:
@@ -2000,11 +2235,11 @@
return false;
#else
case DT_REL:
- rel = reinterpret_cast<ElfW(Rel)*>(load_bias + d->d_un.d_ptr);
+ rel_ = reinterpret_cast<ElfW(Rel)*>(load_bias + d->d_un.d_ptr);
break;
case DT_RELSZ:
- rel_count = d->d_un.d_val / sizeof(ElfW(Rel));
+ rel_count_ = d->d_un.d_val / sizeof(ElfW(Rel));
break;
case DT_RELENT:
@@ -2026,40 +2261,40 @@
return false;
#endif
case DT_INIT:
- init_func = reinterpret_cast<linker_function_t>(load_bias + d->d_un.d_ptr);
- DEBUG("%s constructors (DT_INIT) found at %p", name, init_func);
+ init_func_ = reinterpret_cast<linker_function_t>(load_bias + d->d_un.d_ptr);
+ DEBUG("%s constructors (DT_INIT) found at %p", name, init_func_);
break;
case DT_FINI:
- fini_func = reinterpret_cast<linker_function_t>(load_bias + d->d_un.d_ptr);
- DEBUG("%s destructors (DT_FINI) found at %p", name, fini_func);
+ fini_func_ = reinterpret_cast<linker_function_t>(load_bias + d->d_un.d_ptr);
+ DEBUG("%s destructors (DT_FINI) found at %p", name, fini_func_);
break;
case DT_INIT_ARRAY:
- init_array = reinterpret_cast<linker_function_t*>(load_bias + d->d_un.d_ptr);
- DEBUG("%s constructors (DT_INIT_ARRAY) found at %p", name, init_array);
+ init_array_ = reinterpret_cast<linker_function_t*>(load_bias + d->d_un.d_ptr);
+ DEBUG("%s constructors (DT_INIT_ARRAY) found at %p", name, init_array_);
break;
case DT_INIT_ARRAYSZ:
- init_array_count = ((unsigned)d->d_un.d_val) / sizeof(ElfW(Addr));
+ init_array_count_ = ((unsigned)d->d_un.d_val) / sizeof(ElfW(Addr));
break;
case DT_FINI_ARRAY:
- fini_array = reinterpret_cast<linker_function_t*>(load_bias + d->d_un.d_ptr);
- DEBUG("%s destructors (DT_FINI_ARRAY) found at %p", name, fini_array);
+ fini_array_ = reinterpret_cast<linker_function_t*>(load_bias + d->d_un.d_ptr);
+ DEBUG("%s destructors (DT_FINI_ARRAY) found at %p", name, fini_array_);
break;
case DT_FINI_ARRAYSZ:
- fini_array_count = ((unsigned)d->d_un.d_val) / sizeof(ElfW(Addr));
+ fini_array_count_ = ((unsigned)d->d_un.d_val) / sizeof(ElfW(Addr));
break;
case DT_PREINIT_ARRAY:
- preinit_array = reinterpret_cast<linker_function_t*>(load_bias + d->d_un.d_ptr);
- DEBUG("%s constructors (DT_PREINIT_ARRAY) found at %p", name, preinit_array);
+ preinit_array_ = reinterpret_cast<linker_function_t*>(load_bias + d->d_un.d_ptr);
+ DEBUG("%s constructors (DT_PREINIT_ARRAY) found at %p", name, preinit_array_);
break;
case DT_PREINIT_ARRAYSZ:
- preinit_array_count = ((unsigned)d->d_un.d_val) / sizeof(ElfW(Addr));
+ preinit_array_count_ = ((unsigned)d->d_un.d_val) / sizeof(ElfW(Addr));
break;
case DT_TEXTREL:
@@ -2094,12 +2329,9 @@
break;
case DT_FLAGS_1:
- if ((d->d_un.d_val & DF_1_GLOBAL) != 0) {
- rtld_flags |= RTLD_GLOBAL;
- }
- // TODO: Implement other flags
+ set_dt_flags_1(d->d_un.d_val);
- if ((d->d_un.d_val & ~(DF_1_NOW | DF_1_GLOBAL)) != 0) {
+ if ((d->d_un.d_val & ~SUPPORTED_DT_FLAGS_1) != 0) {
DL_WARN("Unsupported flags DT_FLAGS_1=%p", reinterpret_cast<void*>(d->d_un.d_val));
}
break;
@@ -2119,15 +2351,15 @@
break;
case DT_MIPS_SYMTABNO:
- mips_symtabno = d->d_un.d_val;
+ mips_symtabno_ = d->d_un.d_val;
break;
case DT_MIPS_LOCAL_GOTNO:
- mips_local_gotno = d->d_un.d_val;
+ mips_local_gotno_ = d->d_un.d_val;
break;
case DT_MIPS_GOTSYM:
- mips_gotsym = d->d_un.d_val;
+ mips_gotsym_ = d->d_un.d_val;
break;
#endif
// Ignored: "Its use has been superseded by the DF_BIND_NOW flag"
@@ -2138,6 +2370,8 @@
case DT_VERSYM:
case DT_VERDEF:
case DT_VERDEFNUM:
+ case DT_VERNEED:
+ case DT_VERNEEDNUM:
break;
default:
@@ -2150,29 +2384,29 @@
}
DEBUG("si->base = %p, si->strtab = %p, si->symtab = %p",
- reinterpret_cast<void*>(base), strtab, symtab);
+ reinterpret_cast<void*>(base), strtab_, symtab_);
// Sanity checks.
if (relocating_linker && needed_count != 0) {
DL_ERR("linker cannot have DT_NEEDED dependencies on other libraries");
return false;
}
- if (nbucket == 0) {
- DL_ERR("empty/missing DT_HASH in \"%s\" (built with --hash-style=gnu?)", name);
+ if (nbucket_ == 0) {
+ DL_ERR("empty/missing DT_HASH/DT_GNU_HASH in \"%s\" (new hash type from the future?)", name);
return false;
}
- if (strtab == 0) {
+ if (strtab_ == 0) {
DL_ERR("empty/missing DT_STRTAB in \"%s\"", name);
return false;
}
- if (symtab == 0) {
+ if (symtab_ == 0) {
DL_ERR("empty/missing DT_SYMTAB in \"%s\"", name);
return false;
}
return true;
}
-bool soinfo::LinkImage(const android_dlextinfo* extinfo) {
+bool soinfo::link_image(const soinfo_list_t& global_group, const soinfo_list_t& local_group, const android_dlextinfo* extinfo) {
#if !defined(__LP64__)
if (has_text_relocations) {
@@ -2189,35 +2423,35 @@
#endif
#if defined(USE_RELA)
- if (rela != nullptr) {
+ if (rela_ != nullptr) {
DEBUG("[ relocating %s ]", name);
- if (Relocate(rela, rela_count)) {
+ if (relocate(rela_, rela_count_, global_group, local_group)) {
return false;
}
}
- if (plt_rela != nullptr) {
+ if (plt_rela_ != nullptr) {
DEBUG("[ relocating %s plt ]", name);
- if (Relocate(plt_rela, plt_rela_count)) {
+ if (relocate(plt_rela_, plt_rela_count_, global_group, local_group)) {
return false;
}
}
#else
- if (rel != nullptr) {
+ if (rel_ != nullptr) {
DEBUG("[ relocating %s ]", name);
- if (Relocate(rel, rel_count)) {
+ if (relocate(rel_, rel_count_, global_group, local_group)) {
return false;
}
}
- if (plt_rel != nullptr) {
+ if (plt_rel_ != nullptr) {
DEBUG("[ relocating %s plt ]", name);
- if (Relocate(plt_rel, plt_rel_count)) {
+ if (relocate(plt_rel_, plt_rel_count_, global_group, local_group)) {
return false;
}
}
#endif
#if defined(__mips__)
- if (!mips_relocate_got(this)) {
+ if (!mips_relocate_got(global_group, local_group)) {
return false;
}
#endif
@@ -2275,7 +2509,7 @@
return;
}
- soinfo* si = soinfo_alloc("[vdso]", nullptr, 0);
+ soinfo* si = soinfo_alloc("[vdso]", nullptr, 0, 0);
si->phdr = reinterpret_cast<ElfW(Phdr)*>(reinterpret_cast<char*>(ehdr_vdso) + ehdr_vdso->e_phoff);
si->phnum = ehdr_vdso->e_phnum;
@@ -2283,8 +2517,8 @@
si->size = phdr_table_get_load_size(si->phdr, si->phnum);
si->load_bias = get_elf_exec_load_bias(ehdr_vdso);
- si->PrelinkImage();
- si->LinkImage(nullptr);
+ si->prelink_image();
+ si->link_image(g_empty_list, soinfo::soinfo_list_t::make_list(si), nullptr);
#endif
}
@@ -2296,7 +2530,7 @@
#else
#define LINKER_PATH "/system/bin/linker"
#endif
-static soinfo linker_soinfo_for_gdb(LINKER_PATH, nullptr, 0);
+static soinfo linker_soinfo_for_gdb(LINKER_PATH, nullptr, 0, 0);
/* gdb expects the linker to be in the debug shared object list.
* Without this, gdb has trouble locating the linker's ".text"
@@ -2360,7 +2594,7 @@
INFO("[ android linker & debugger ]");
- soinfo* si = soinfo_alloc(args.argv[0], nullptr, 0);
+ soinfo* si = soinfo_alloc(args.argv[0], nullptr, 0, RTLD_GLOBAL);
if (si == nullptr) {
exit(EXIT_FAILURE);
}
@@ -2413,7 +2647,10 @@
somain = si;
- si->PrelinkImage();
+ si->prelink_image();
+
+ // add somain to global group
+ si->set_dt_flags_1(si->get_dt_flags_1() | DF_1_GLOBAL);
// Load ld_preloads and dependencies.
StringLinkedList needed_library_name_list;
@@ -2430,36 +2667,26 @@
});
const char* needed_library_names[needed_libraries_count];
- soinfo* needed_library_si[needed_libraries_count];
memset(needed_library_names, 0, sizeof(needed_library_names));
needed_library_name_list.copy_to_array(needed_library_names, needed_libraries_count);
- if (needed_libraries_count > 0 && !find_libraries(needed_library_names, needed_libraries_count, needed_library_si, g_ld_preloads, ld_preloads_count, 0, nullptr)) {
- __libc_format_fd(2, "CANNOT LINK EXECUTABLE DEPENDENCIES: %s\n", linker_get_error_buffer());
- exit(EXIT_FAILURE);
- }
-
- for (size_t i = 0; i<needed_libraries_count; ++i) {
- si->add_child(needed_library_si[i]);
- }
-
- if (!si->LinkImage(nullptr)) {
+ if (needed_libraries_count > 0 && !find_libraries(si, needed_library_names, needed_libraries_count, nullptr, g_ld_preloads, ld_preloads_count, RTLD_GLOBAL, nullptr)) {
__libc_format_fd(2, "CANNOT LINK EXECUTABLE: %s\n", linker_get_error_buffer());
exit(EXIT_FAILURE);
}
add_vdso(args);
- si->CallPreInitConstructors();
+ si->call_pre_init_constructors();
- /* After the PrelinkImage, the si->load_bias is initialized.
+ /* After the prelink_image, the si->load_bias is initialized.
* For so lib, the map->l_addr will be updated in notify_gdb_of_load.
* We need to update this value for so exe here. So Unwind_Backtrace
* for some arch like x86 could work correctly within so exe.
*/
map->l_addr = si->load_bias;
- si->CallConstructors();
+ si->call_constructors();
#if TIMING
gettimeofday(&t1, nullptr);
@@ -2548,7 +2775,7 @@
ElfW(Ehdr)* elf_hdr = reinterpret_cast<ElfW(Ehdr)*>(linker_addr);
ElfW(Phdr)* phdr = reinterpret_cast<ElfW(Phdr)*>(linker_addr + elf_hdr->e_phoff);
- soinfo linker_so("[dynamic linker]", nullptr, 0);
+ soinfo linker_so("[dynamic linker]", nullptr, 0, 0);
// If the linker is not acting as PT_INTERP entry_point is equal to
// _start. Which means that the linker is running as an executable and
@@ -2568,7 +2795,13 @@
linker_so.phnum = elf_hdr->e_phnum;
linker_so.flags |= FLAG_LINKER;
- if (!(linker_so.PrelinkImage() && linker_so.LinkImage(nullptr))) {
+ // This might not be obvious... The reasons why we pass g_empty_list
+ // in place of local_group here are (1) we do not really need it, because
+ // linker is built with DT_SYMBOLIC and therefore relocates its symbols against
+ // itself without having to look into local_group and (2) allocators
+ // are not yet initialized, and therefore we cannot use linked_list.push_*
+ // functions at this point.
+ if (!(linker_so.prelink_image() && linker_so.link_image(g_empty_list, g_empty_list, nullptr))) {
// It would be nice to print an error message, but if the linker
// can't link itself, there's no guarantee that we'll be able to
// call write() (because it involves a GOT reference). We may as
@@ -2583,7 +2816,7 @@
__libc_init_tls(args);
// Initialize the linker's own global variables
- linker_so.CallConstructors();
+ linker_so.call_constructors();
// Initialize static variables. Note that in order to
// get correct libdl_info we need to call constructors
diff --git a/linker/linker.h b/linker/linker.h
index fa38c7f..d28f70e 100644
--- a/linker/linker.h
+++ b/linker/linker.h
@@ -87,9 +87,12 @@
#define FLAG_LINKED 0x00000001
#define FLAG_EXE 0x00000004 // The main executable
#define FLAG_LINKER 0x00000010 // The linker itself
+#define FLAG_GNU_HASH 0x00000040 // uses gnu hash
#define FLAG_NEW_SOINFO 0x40000000 // new soinfo format
-#define SOINFO_VERSION 0
+#define SUPPORTED_DT_FLAGS_1 (DF_1_NOW | DF_1_GLOBAL | DF_1_NODELETE)
+
+#define SOINFO_VERSION 1
#define SOINFO_NAME_LEN 128
@@ -103,14 +106,38 @@
struct soinfo;
class SoinfoListAllocator {
-public:
+ public:
static LinkedListEntry<soinfo>* alloc();
static void free(LinkedListEntry<soinfo>* entry);
-private:
+
+ private:
// unconstructable
DISALLOW_IMPLICIT_CONSTRUCTORS(SoinfoListAllocator);
};
+class SymbolName {
+ public:
+ explicit SymbolName(const char* name)
+ : name_(name), has_elf_hash_(false), has_gnu_hash_(false),
+ elf_hash_(0), gnu_hash_(0) { }
+
+ const char* get_name() {
+ return name_;
+ }
+
+ uint32_t elf_hash();
+ uint32_t gnu_hash();
+
+ private:
+ const char* name_;
+ bool has_elf_hash_;
+ bool has_gnu_hash_;
+ uint32_t elf_hash_;
+ uint32_t gnu_hash_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(SymbolName);
+};
+
struct soinfo {
public:
typedef LinkedList<soinfo, SoinfoListAllocator> soinfo_list_t;
@@ -134,59 +161,63 @@
#endif
soinfo* next;
- unsigned flags;
+ uint32_t flags;
private:
- const char* strtab;
- public:
- ElfW(Sym)* symtab;
+ const char* strtab_;
+ ElfW(Sym)* symtab_;
- size_t nbucket;
- size_t nchain;
- unsigned* bucket;
- unsigned* chain;
+ size_t nbucket_;
+ size_t nchain_;
+ uint32_t* bucket_;
+ uint32_t* chain_;
#if defined(__mips__) || !defined(__LP64__)
// This is only used by mips and mips64, but needs to be here for
// all 32-bit architectures to preserve binary compatibility.
- ElfW(Addr)** plt_got;
+ ElfW(Addr)** plt_got_;
#endif
#if defined(USE_RELA)
- ElfW(Rela)* plt_rela;
- size_t plt_rela_count;
+ ElfW(Rela)* plt_rela_;
+ size_t plt_rela_count_;
- ElfW(Rela)* rela;
- size_t rela_count;
+ ElfW(Rela)* rela_;
+ size_t rela_count_;
#else
- ElfW(Rel)* plt_rel;
- size_t plt_rel_count;
+ ElfW(Rel)* plt_rel_;
+ size_t plt_rel_count_;
- ElfW(Rel)* rel;
- size_t rel_count;
+ ElfW(Rel)* rel_;
+ size_t rel_count_;
#endif
- linker_function_t* preinit_array;
- size_t preinit_array_count;
+ linker_function_t* preinit_array_;
+ size_t preinit_array_count_;
- linker_function_t* init_array;
- size_t init_array_count;
- linker_function_t* fini_array;
- size_t fini_array_count;
+ linker_function_t* init_array_;
+ size_t init_array_count_;
+ linker_function_t* fini_array_;
+ size_t fini_array_count_;
- linker_function_t init_func;
- linker_function_t fini_func;
+ linker_function_t init_func_;
+ linker_function_t fini_func_;
+ public:
#if defined(__arm__)
// ARM EABI section used for stack unwinding.
- unsigned* ARM_exidx;
+ uint32_t* ARM_exidx;
size_t ARM_exidx_count;
#elif defined(__mips__)
- unsigned mips_symtabno;
- unsigned mips_local_gotno;
- unsigned mips_gotsym;
+ private:
+ uint32_t mips_symtabno_;
+ uint32_t mips_local_gotno_;
+ uint32_t mips_gotsym_;
+ bool mips_relocate_got(const soinfo_list_t& global_group, const soinfo_list_t& local_group);
+
#endif
+ public:
size_t ref_count;
link_map link_map_head;
@@ -201,62 +232,84 @@
#endif
bool has_DT_SYMBOLIC;
- soinfo(const char* name, const struct stat* file_stat, off64_t file_offset);
+ public:
+ soinfo(const char* name, const struct stat* file_stat, off64_t file_offset, int rtld_flags);
- void CallConstructors();
- void CallDestructors();
- void CallPreInitConstructors();
- bool PrelinkImage();
- bool LinkImage(const android_dlextinfo* extinfo);
+ void call_constructors();
+ void call_destructors();
+ void call_pre_init_constructors();
+ bool prelink_image();
+ bool link_image(const soinfo_list_t& global_group, const soinfo_list_t& local_group, const android_dlextinfo* extinfo);
void add_child(soinfo* child);
void remove_all_links();
- ino_t get_st_ino();
- dev_t get_st_dev();
- off64_t get_file_offset();
+ ino_t get_st_ino() const;
+ dev_t get_st_dev() const;
+ off64_t get_file_offset() const;
+
+ uint32_t get_rtld_flags() const;
+ uint32_t get_dt_flags_1() const;
+ void set_dt_flags_1(uint32_t dt_flags_1);
soinfo_list_t& get_children();
soinfo_list_t& get_parents();
+ ElfW(Sym)* find_symbol_by_name(SymbolName& symbol_name);
+ ElfW(Sym)* find_symbol_by_address(const void* addr);
ElfW(Addr) resolve_symbol_address(ElfW(Sym)* s);
const char* get_string(ElfW(Word) index) const;
+ bool can_unload() const;
+ bool is_gnu_hash() const;
bool inline has_min_version(uint32_t min_version) const {
- return (flags & FLAG_NEW_SOINFO) != 0 && version >= min_version;
+ return (flags & FLAG_NEW_SOINFO) != 0 && version_ >= min_version;
}
+
private:
- void CallArray(const char* array_name, linker_function_t* functions, size_t count, bool reverse);
- void CallFunction(const char* function_name, linker_function_t function);
+ ElfW(Sym)* elf_lookup(SymbolName& symbol_name);
+ ElfW(Sym)* elf_addr_lookup(const void* addr);
+ ElfW(Sym)* gnu_lookup(SymbolName& symbol_name);
+ ElfW(Sym)* gnu_addr_lookup(const void* addr);
+
+ void call_array(const char* array_name, linker_function_t* functions, size_t count, bool reverse);
+ void call_function(const char* function_name, linker_function_t function);
#if defined(USE_RELA)
- int Relocate(ElfW(Rela)* rela, unsigned count);
+ int relocate(ElfW(Rela)* rela, unsigned count, const soinfo_list_t& global_group, const soinfo_list_t& local_group);
#else
- int Relocate(ElfW(Rel)* rel, unsigned count);
+ int relocate(ElfW(Rel)* rel, unsigned count, const soinfo_list_t& global_group, const soinfo_list_t& local_group);
#endif
private:
// This part of the structure is only available
// when FLAG_NEW_SOINFO is set in this->flags.
- uint32_t version;
+ uint32_t version_;
// version >= 0
- dev_t st_dev;
- ino_t st_ino;
+ dev_t st_dev_;
+ ino_t st_ino_;
// dependency graph
- soinfo_list_t children;
- soinfo_list_t parents;
+ soinfo_list_t children_;
+ soinfo_list_t parents_;
// version >= 1
- off64_t file_offset;
- int rtld_flags;
- size_t strtab_size;
+ off64_t file_offset_;
+ uint32_t rtld_flags_;
+ uint32_t dt_flags_1_;
+ size_t strtab_size_;
+
+ // version >= 2
+ uint32_t gnu_maskwords_;
+ uint32_t gnu_shift2_;
+
+ ElfW(Addr)* gnu_bloom_filter_;
friend soinfo* get_libdl_info();
};
-extern soinfo* get_libdl_info();
+soinfo* get_libdl_info();
void do_android_get_LD_LIBRARY_PATH(char*, size_t);
void do_android_update_LD_LIBRARY_PATH(const char* ld_library_path);
@@ -266,7 +319,6 @@
ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start);
soinfo* find_containing_library(const void* addr);
-ElfW(Sym)* dladdr_find_symbol(soinfo* si, const void* addr);
ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name);
void debuggerd_init();
diff --git a/linker/linker_executable.mk b/linker/linker_executable.mk
deleted file mode 100644
index a596a48..0000000
--- a/linker/linker_executable.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-
-#
-# Instead of including $(BUILD_EXECUTABLE), we execute the steps to create an executable by
-# hand, as we want to insert an extra objcopy step that is not supported by the build
-# system, and is probably specific the linker only, so there's no need to modify the build
-# system for the purpose.
-#
-
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_SUFFIX := $(TARGET_EXECUTABLE_SUFFIX)
-
-# Clang calls /usr/bin/ld: unrecognized option '--icf=safe', http://b/17403674.
-LOCAL_CLANG := false
-include $(BUILD_SYSTEM)/dynamic_binary.mk
-
-# See build/core/executable_internal.mk
-$(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LD_DIRS)
-$(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LDFLAGS)
-$(linked_module): PRIVATE_TARGET_FDO_LIB := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_LIB)
-$(linked_module): PRIVATE_TARGET_LIBGCC := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBGCC)
-$(linked_module): PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_CRTBEGIN_DYNAMIC_O)
-$(linked_module): PRIVATE_TARGET_CRTBEGIN_STATIC_O := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_CRTBEGIN_STATIC_O)
-$(linked_module): PRIVATE_TARGET_CRTEND_O := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_CRTEND_O)
-$(linked_module): PRIVATE_TARGET_OBJCOPY := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY)
-$(linked_module): $(TARGET_CRTBEGIN_STATIC_O) $(all_objects) $(all_libraries) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_CRTEND_O)
- $(transform-o-to-static-executable)
- @echo "target PrefixSymbols: $(PRIVATE_MODULE) ($@)"
- $(hide) $(PRIVATE_TARGET_OBJCOPY) --prefix-symbols=__dl_ $@
diff --git a/linker/linker_libc_support.c b/linker/linker_libc_support.c
index 17db6d4..4c49384 100644
--- a/linker/linker_libc_support.c
+++ b/linker/linker_libc_support.c
@@ -15,3 +15,7 @@
*/
#include "../libc/arch-common/bionic/__dso_handle.h"
+
+int atexit(void (*function)(void) __attribute__((__unused__))) {
+ return -1;
+}
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index 4b1c0ca..61ae5ab 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -722,9 +722,9 @@
}
}
-// Returns the address of the program header table as it appears in the loaded
-// segments in memory. This is in contrast with 'phdr_table_' which
-// is temporary and will be released before the library is relocated.
+// Sets loaded_phdr_ to the address of the program header table as it appears
+// in the loaded segments in memory. This is in contrast with phdr_table_,
+// which is temporary and will be released before the library is relocated.
bool ElfReader::FindPhdr() {
const ElfW(Phdr)* phdr_limit = phdr_table_ + phdr_num_;
diff --git a/tests/Android.build.mk b/tests/Android.build.mk
index 63729da..5b2b417 100644
--- a/tests/Android.build.mk
+++ b/tests/Android.build.mk
@@ -36,8 +36,14 @@
LOCAL_CLANG := $($(module)_clang_$(build_type))
+ifneq ($($(module)_allow_asan),true)
+LOCAL_ADDRESS_SANITIZER := false
+endif
+
LOCAL_FORCE_STATIC_EXECUTABLE := $($(module)_force_static_executable)
+LOCAL_ALLOW_UNDEFINED_SYMBOLS := $($(module)_allow_undefined_symbols)
+
ifneq ($($(module)_multilib),)
LOCAL_MULTILIB := $($(module)_multilib)
endif
@@ -86,9 +92,13 @@
$($(module)_ldlibs) \
$($(module)_ldlibs_$(build_type)) \
-ifeq ($(build_type),target)
- include external/stlport/libstlport.mk
+ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
+LOCAL_CXX_STL := libc++_static
+else
+LOCAL_CXX_STL := libc++
+endif
+ifeq ($(build_type),target)
include $(BUILD_$(build_target))
endif
diff --git a/tests/Android.mk b/tests/Android.mk
index 8b0b0a0..4c4ee13 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -54,6 +54,7 @@
libBionicStandardTests_src_files := \
arpa_inet_test.cpp \
buffer_tests.cpp \
+ complex_test.cpp \
ctype_test.cpp \
dirent_test.cpp \
eventfd_test.cpp \
@@ -67,20 +68,6 @@
libgen_test.cpp \
locale_test.cpp \
malloc_test.cpp \
- math_cos_test.cpp \
- math_cosf_test.cpp \
- math_exp_test.cpp \
- math_expf_test.cpp \
- math_log_test.cpp \
- math_logf_test.cpp \
- math_pow_test.cpp \
- math_powf_test.cpp \
- math_sin_test.cpp \
- math_sinf_test.cpp \
- math_sincos_test.cpp \
- math_sincosf_test.cpp \
- math_tan_test.cpp \
- math_tanf_test.cpp \
math_test.cpp \
mntent_test.cpp \
netdb_test.cpp \
@@ -88,14 +75,18 @@
regex_test.cpp \
sched_test.cpp \
search_test.cpp \
+ semaphore_test.cpp \
+ setjmp_test.cpp \
signal_test.cpp \
stack_protector_test.cpp \
stack_unwinding_test.cpp \
stdatomic_test.cpp \
stdint_test.cpp \
stdio_test.cpp \
+ stdio_ext_test.cpp \
stdlib_test.cpp \
string_test.cpp \
+ string_posix_strerror_r_test.cpp \
strings_test.cpp \
stubs_test.cpp \
sstream_test.cpp \
@@ -108,6 +99,7 @@
sys_stat_test.cpp \
sys_statvfs_test.cpp \
sys_syscall_test.cpp \
+ sys_sysinfo_test.cpp \
sys_time_test.cpp \
sys_types_test.cpp \
sys_vfs_test.cpp \
@@ -132,6 +124,7 @@
libBionicStandardTests_c_includes := \
bionic/libc \
+ external/tinyxml2 \
libBionicStandardTests_ldlibs_host := \
-lrt \
@@ -223,8 +216,13 @@
bionic-unit-tests_whole_static_libraries := \
libBionicTests \
+bionic-unit-tests_static_libraries := \
+ libtinyxml2 \
+ liblog \
+
bionic-unit-tests_src_files := \
atexit_test.cpp \
+ dl_test.cpp \
dlext_test.cpp \
dlfcn_test.cpp \
@@ -237,8 +235,7 @@
bionic-unit-tests_cppflags := $(test_cppflags)
bionic-unit-tests_ldflags := \
- -Wl,--export-dynamic \
- -Wl,-u,DlSymTestFunction \
+ -Wl,--export-dynamic
bionic-unit-tests_c_includes := \
bionic/libc \
@@ -247,6 +244,12 @@
bionic-unit-tests_shared_libraries_target := \
libdl \
libpagemap \
+ libdl_preempt_test_1 \
+ libdl_preempt_test_2
+
+ifneq ($(filter $(TARGET_ARCH),arm arm64),$(TARGET_ARCH))
+bionic-unit-tests_shared_libraries_target += libdl_test_df_1_global
+endif
module := bionic-unit-tests
module_tag := optional
@@ -263,13 +266,21 @@
libBionicTests \
bionic-unit-tests-static_static_libraries := \
- libstlport_static \
libm \
libc \
- libstdc++ \
+ libc++_static \
+ libdl \
+ libtinyxml2 \
+ liblog \
bionic-unit-tests-static_force_static_executable := true
+# libc and libc++ both define std::nothrow. libc's is a private symbol, but this
+# still causes issues when linking libc.a and libc++.a, since private isn't
+# effective until it has been linked. To fix this, just allow multiple symbol
+# definitions for the static tests.
+bionic-unit-tests-static_ldflags := -Wl,--allow-multiple-definition
+
module := bionic-unit-tests-static
module_tag := optional
build_type := target
@@ -286,6 +297,13 @@
bionic-unit-tests-glibc_src_files := \
atexit_test.cpp \
dlfcn_test.cpp \
+ dl_test.cpp \
+
+bionic-unit-tests-glibc_shared_libraries := \
+ libdl_preempt_test_1 \
+ libdl_preempt_test_2
+
+bionic-unit-tests-glibc_shared_libraries += libdl_test_df_1_global
bionic-unit-tests-glibc_whole_static_libraries := \
libBionicStandardTests \
@@ -300,12 +318,61 @@
bionic-unit-tests-glibc_cppflags := $(test_cppflags)
bionic-unit-tests-glibc_ldflags := -Wl,--export-dynamic
+bionic-unit-tests-glibc_allow_asan := true
+
module := bionic-unit-tests-glibc
module_tag := optional
build_type := host
build_target := NATIVE_TEST
include $(LOCAL_PATH)/Android.build.mk
+# -----------------------------------------------------------------------------
+# Compile time tests.
+# -----------------------------------------------------------------------------
+
+# Some of these are intentionally using = instead of := since we need access to
+# some variables not initialtized until we're in the build system.
+
+include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := \
+ $(LOCAL_PATH)/Android.mk \
+ $(LOCAL_PATH)/file-check-cxx \
+ | $(HOST_OUT_EXECUTABLES)/FileCheck$(HOST_EXECUTABLE_SUFFIX) \
+
+LOCAL_CXX = $(LOCAL_PATH)/file-check-cxx \
+ $(HOST_OUT_EXECUTABLES)/FileCheck \
+ $($(LOCAL_2ND_ARCH_VAR_PREFIX)CXX_BARE) \
+ GCC \
+
+LOCAL_CLANG := false
+LOCAL_MODULE := bionic-compile-time-tests-g++
+LOCAL_CXXFLAGS := -Wall
+LOCAL_SRC_FILES := fortify_sprintf_warnings.cpp
+include $(BUILD_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := \
+ $(LOCAL_PATH)/Android.mk \
+ $(LOCAL_PATH)/file-check-cxx \
+ | $(HOST_OUT_EXECUTABLES)/FileCheck$(HOST_EXECUTABLE_SUFFIX) \
+
+LOCAL_CXX := $(LOCAL_PATH)/file-check-cxx \
+ $(HOST_OUT_EXECUTABLES)/FileCheck \
+ $(LLVM_PREBUILTS_PATH)/clang++ \
+ CLANG \
+
+LOCAL_CLANG := true
+LOCAL_MODULE := bionic-compile-time-tests-clang++
+LOCAL_CXXFLAGS := -Wall
+# FileCheck will error if there aren't any CLANG: lines in the file, but there
+# don't appear to be any cases where clang _does_ emit warnings for sn?printf :(
+LOCAL_SRC_FILES :=
+include $(BUILD_STATIC_LIBRARY)
+
+# -----------------------------------------------------------------------------
+# Host glibc tests.
+# -----------------------------------------------------------------------------
+
ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm mips x86))
LINKER = linker64
NATIVE_TEST_SUFFIX=64
@@ -333,15 +400,18 @@
# Make sure to create ANDROID_DATA/local/tmp if doesn't exist.
# bionic itself should always work relative to ANDROID_DATA or ANDROID_ROOT.
# BIONIC_TEST_FLAGS is either empty or it comes from the user.
-bionic-unit-tests-run-on-host: bionic-unit-tests $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh
- if [ ! -d /system -o ! -d /system/bin ]; then \
- echo "Attempting to create /system/bin"; \
- sudo mkdir -p -m 0777 /system/bin; \
+bionic-unit-tests-run-on-host-prepare: $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT)/etc/hosts $(TARGET_OUT_EXECUTABLES)/sh
+ if [ ! -d /system ]; then \
+ echo "Attempting to create /system"; \
+ sudo mkdir -p -m 0777 /system; \
fi
mkdir -p $(TARGET_OUT_DATA)/local/tmp
- cp $(TARGET_OUT_EXECUTABLES)/$(LINKER) /system/bin
- cp $(TARGET_OUT_EXECUTABLES)/sh /system/bin
+ ln -fs `realpath $(TARGET_OUT)/bin` /system/
+ ln -fs `realpath $(TARGET_OUT)/etc` /system/
+
+bionic-unit-tests-run-on-host: bionic-unit-tests bionic-unit-tests-run-on-host-prepare
ANDROID_DATA=$(TARGET_OUT_DATA) \
+ ANDROID_DNS_MODE=local \
ANDROID_ROOT=$(TARGET_OUT) \
LD_LIBRARY_PATH=$(TARGET_OUT_SHARED_LIBRARIES) \
$(TARGET_OUT_DATA_NATIVE_TESTS)/bionic-unit-tests/bionic-unit-tests$(NATIVE_TEST_SUFFIX) $(BIONIC_TEST_FLAGS)
@@ -349,15 +419,9 @@
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86_64))
# add target to run lp32 tests
-bionic-unit-tests-run-on-host32: bionic-unit-tests_32 $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh
- if [ ! -d /system -o ! -d /system/bin ]; then \
- echo "Attempting to create /system/bin"; \
- sudo mkdir -p -m 0777 /system/bin; \
- fi
- mkdir -p $(TARGET_OUT_DATA)/local/tmp
- cp $(TARGET_OUT_EXECUTABLES)/linker /system/bin
- cp $(TARGET_OUT_EXECUTABLES)/sh /system/bin
+bionic-unit-tests-run-on-host32: bionic-unit-tests_32 bionic-unit-tests-run-on-host-prepare
ANDROID_DATA=$(TARGET_OUT_DATA) \
+ ANDROID_DNS_MODE=local \
ANDROID_ROOT=$(TARGET_OUT) \
LD_LIBRARY_PATH=$(2ND_TARGET_OUT_SHARED_LIBRARIES) \
$(2ND_TARGET_OUT_DATA_NATIVE_TESTS)/bionic-unit-tests/bionic-unit-tests32 $(BIONIC_TEST_FLAGS)
diff --git a/tests/BionicDeathTest.h b/tests/BionicDeathTest.h
new file mode 100644
index 0000000..31d2d6e
--- /dev/null
+++ b/tests/BionicDeathTest.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BIONIC_TESTS_BIONIC_DEATH_TEST_H_
+#define BIONIC_TESTS_BIONIC_DEATH_TEST_H_
+
+#include <gtest/gtest.h>
+
+#include <sys/prctl.h>
+
+class BionicDeathTest : public testing::Test {
+ protected:
+ virtual void SetUp() {
+ // Suppress debuggerd stack traces. Too slow.
+ old_dumpable_ = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0);
+ prctl(PR_SET_DUMPABLE, 0, 0, 0, 0);
+ ::testing::FLAGS_gtest_death_test_style = "threadsafe";
+ }
+
+ virtual void TearDown() {
+ prctl(PR_SET_DUMPABLE, old_dumpable_, 0, 0, 0, 0);
+ }
+
+ private:
+ int old_dumpable_;
+};
+
+#endif // BIONIC_TESTS_BIONIC_DEATH_TEST_H_
diff --git a/tests/TemporaryFile.h b/tests/TemporaryFile.h
index c4ee2d5..5c2fe4f 100644
--- a/tests/TemporaryFile.h
+++ b/tests/TemporaryFile.h
@@ -17,24 +17,26 @@
#include <fcntl.h>
#include <unistd.h>
-template<int (*mk_fn)(char*)>
+#include "private/bionic_macros.h"
+
+template <typename T = int (*)(char*)>
class GenericTemporaryFile {
public:
- GenericTemporaryFile(const char* dirpath = NULL) {
- if (dirpath != NULL) {
- init(dirpath);
- } else {
- // Since we might be running on the host or the target, and if we're
- // running on the host we might be running under bionic or glibc,
- // let's just try both possible temporary directories and take the
- // first one that works.
- init("/data/local/tmp");
- if (fd == -1) {
- init("/tmp");
- }
+ GenericTemporaryFile(T mk_fn = mkstemp) : mk_fn(mk_fn) {
+ // Since we might be running on the host or the target, and if we're
+ // running on the host we might be running under bionic or glibc,
+ // let's just try both possible temporary directories and take the
+ // first one that works.
+ init("/data/local/tmp");
+ if (fd == -1) {
+ init("/tmp");
}
}
+ GenericTemporaryFile(const char* dirpath, T mk_fn = mkstemp) : mk_fn(mk_fn) {
+ init(dirpath);
+ }
+
~GenericTemporaryFile() {
close(fd);
unlink(filename);
@@ -49,13 +51,17 @@
char filename[1024];
private:
+ T mk_fn;
+
void init(const char* tmp_dir) {
snprintf(filename, sizeof(filename), "%s/TemporaryFile-XXXXXX", tmp_dir);
fd = mk_fn(filename);
}
+
+ DISALLOW_COPY_AND_ASSIGN(GenericTemporaryFile);
};
-typedef GenericTemporaryFile<mkstemp> TemporaryFile;
+typedef GenericTemporaryFile<> TemporaryFile;
class TemporaryDir {
public:
@@ -77,4 +83,5 @@
return (mkdtemp(dirname) != NULL);
}
+ DISALLOW_COPY_AND_ASSIGN(TemporaryDir);
};
diff --git a/tests/atexit_test.cpp b/tests/atexit_test.cpp
index e01220e..e92889d 100644
--- a/tests/atexit_test.cpp
+++ b/tests/atexit_test.cpp
@@ -24,20 +24,33 @@
#include <string>
-TEST(atexit, dlclose) {
+TEST(atexit, sofile) {
std::string atexit_call_sequence;
bool valid_this_in_static_dtor = false;
+ bool attr_dtor_called = false;
+
void* handle = dlopen("libtest_atexit.so", RTLD_NOW);
- ASSERT_TRUE(handle != NULL);
+ ASSERT_TRUE(handle != nullptr);
+
+ typedef int (*int_fn)(void);
+ int_fn get_cxx_ctor_called, get_attr_ctor_called;
+ get_cxx_ctor_called = reinterpret_cast<int_fn>(dlsym(handle, "get_cxx_ctor_called"));
+ get_attr_ctor_called = reinterpret_cast<int_fn>(dlsym(handle, "get_attr_ctor_called"));
+ ASSERT_TRUE(get_cxx_ctor_called != nullptr);
+ ASSERT_TRUE(get_attr_ctor_called != nullptr);
+
+ ASSERT_EQ(1, get_cxx_ctor_called());
+ ASSERT_EQ(1, get_attr_ctor_called());
void* sym = dlsym(handle, "register_atexit");
- ASSERT_TRUE(sym != NULL);
- reinterpret_cast<void (*)(std::string*, bool*)>(sym)(&atexit_call_sequence, &valid_this_in_static_dtor);
+ ASSERT_TRUE(sym != nullptr);
+ reinterpret_cast<void (*)(std::string*, bool*, bool*)>(sym)(&atexit_call_sequence, &valid_this_in_static_dtor, &attr_dtor_called);
ASSERT_EQ(0, dlclose(handle));
// this test verifies atexit call from atexit handler. as well as the order of calls
ASSERT_EQ("Humpty Dumpty sat on a wall", atexit_call_sequence);
ASSERT_TRUE(valid_this_in_static_dtor);
+ ASSERT_TRUE(attr_dtor_called);
}
class TestMainStaticDtorClass {
@@ -57,7 +70,7 @@
static const TestMainStaticDtorClass* expected_this;
};
-const TestMainStaticDtorClass* TestMainStaticDtorClass::expected_this = NULL;
+const TestMainStaticDtorClass* TestMainStaticDtorClass::expected_this = nullptr;
static void atexit_func5() {
fprintf(stderr, "5");
diff --git a/tests/complex_test.cpp b/tests/complex_test.cpp
new file mode 100644
index 0000000..47964f6
--- /dev/null
+++ b/tests/complex_test.cpp
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+
+// libc++ actively gets in the way of including <complex.h> from C++, so we
+// have to declare the complex math functions ourselves.
+// (libc++ also seems to have really bad implementations of its own that ignore
+// the intricacies of floating point math.)
+// http://llvm.org/bugs/show_bug.cgi?id=21504
+
+#include <math.h> // For M_PI.
+
+extern "C" double cabs(double _Complex);
+TEST(complex, cabs) {
+ ASSERT_EQ(0.0, cabs(0));
+}
+
+extern "C" float cabsf(float _Complex);
+TEST(complex, cabsf) {
+ ASSERT_EQ(0.0, cabsf(0));
+}
+
+extern "C" long double cabsl(long double _Complex);
+TEST(complex, cabsl) {
+ ASSERT_EQ(0.0, cabsl(0));
+}
+
+extern "C" double _Complex cacos(double _Complex);
+TEST(complex, cacos) {
+ ASSERT_EQ(M_PI/2.0, cacos(0.0));
+}
+
+extern "C" float _Complex cacosf(float _Complex);
+TEST(complex, cacosf) {
+ ASSERT_EQ(static_cast<float>(M_PI)/2.0f, cacosf(0.0));
+}
+
+extern "C" double _Complex cacosh(double _Complex);
+TEST(complex, cacosh) {
+ ASSERT_EQ(0.0, cacosh(1.0));
+}
+
+extern "C" float _Complex cacoshf(float _Complex);
+TEST(complex, cacoshf) {
+ ASSERT_EQ(0.0, cacoshf(1.0));
+}
+
+extern "C" double carg(double _Complex);
+TEST(complex, carg) {
+ ASSERT_EQ(0.0, carg(0));
+}
+
+extern "C" float cargf(float _Complex);
+TEST(complex, cargf) {
+ ASSERT_EQ(0.0, cargf(0));
+}
+
+extern "C" long double cargl(long double _Complex);
+TEST(complex, cargl) {
+ ASSERT_EQ(0.0, cargl(0));
+}
+
+extern "C" double _Complex casin(double _Complex);
+TEST(complex, casin) {
+ ASSERT_EQ(0.0, casin(0));
+}
+
+extern "C" float _Complex casinf(float _Complex);
+TEST(complex, casinf) {
+ ASSERT_EQ(0.0, casinf(0));
+}
+
+extern "C" double _Complex casinh(double _Complex);
+TEST(complex, casinh) {
+ ASSERT_EQ(0.0, casinh(0));
+}
+
+extern "C" float _Complex casinhf(float _Complex);
+TEST(complex, casinhf) {
+ ASSERT_EQ(0.0, casinhf(0));
+}
+
+extern "C" double _Complex catan(double _Complex);
+TEST(complex, catan) {
+ ASSERT_EQ(0.0, catan(0));
+}
+
+extern "C" float _Complex catanf(float _Complex);
+TEST(complex, catanf) {
+ ASSERT_EQ(0.0, catanf(0));
+}
+
+extern "C" double _Complex catanh(double _Complex);
+TEST(complex, catanh) {
+ ASSERT_EQ(0.0, catanh(0));
+}
+
+extern "C" float _Complex catanhf(float _Complex);
+TEST(complex, catanhf) {
+ ASSERT_EQ(0.0, catanhf(0));
+}
+
+extern "C" double _Complex ccos(double _Complex);
+TEST(complex, ccos) {
+ ASSERT_EQ(1.0, ccos(0));
+}
+
+extern "C" float _Complex ccosf(float _Complex);
+TEST(complex, ccosf) {
+ ASSERT_EQ(1.0, ccosf(0));
+}
+
+extern "C" double _Complex ccosh(double _Complex);
+TEST(complex, ccosh) {
+ ASSERT_EQ(1.0, ccosh(0));
+}
+
+extern "C" float _Complex ccoshf(float _Complex);
+TEST(complex, ccoshf) {
+ ASSERT_EQ(1.0, ccoshf(0));
+}
+
+extern "C" double _Complex cexp(double _Complex);
+TEST(complex, cexp) {
+ ASSERT_EQ(1.0, cexp(0));
+}
+
+extern "C" float _Complex cexpf(float _Complex);
+TEST(complex, cexpf) {
+ ASSERT_EQ(1.0, cexpf(0));
+}
+
+extern "C" double cimag(double _Complex);
+TEST(complex, cimag) {
+ ASSERT_EQ(0.0, cimag(0));
+}
+
+extern "C" float cimagf(float _Complex);
+TEST(complex, cimagf) {
+ ASSERT_EQ(0.0f, cimagf(0));
+}
+
+extern "C" long double cimagl(long double _Complex);
+TEST(complex, cimagl) {
+ ASSERT_EQ(0.0, cimagl(0));
+}
+
+extern "C" double _Complex conj(double _Complex);
+TEST(complex, conj) {
+ ASSERT_EQ(0.0, conj(0));
+}
+
+extern "C" float _Complex conjf(float _Complex);
+TEST(complex, conjf) {
+ ASSERT_EQ(0.0f, conjf(0));
+}
+
+extern "C" long double _Complex conjl(long double _Complex);
+TEST(complex, conjl) {
+ ASSERT_EQ(0.0, conjl(0));
+}
+
+extern "C" double _Complex cproj(double _Complex);
+TEST(complex, cproj) {
+ ASSERT_EQ(0.0, cproj(0));
+}
+
+extern "C" float _Complex cprojf(float _Complex);
+TEST(complex, cprojf) {
+ ASSERT_EQ(0.0f, cprojf(0));
+}
+
+extern "C" long double _Complex cprojl(long double _Complex);
+TEST(complex, cprojl) {
+ ASSERT_EQ(0.0, cprojl(0));
+}
+
+extern "C" double creal(double _Complex);
+TEST(complex, creal) {
+ ASSERT_EQ(0.0, creal(0));
+}
+
+extern "C" float crealf(float _Complex);
+TEST(complex, crealf) {
+ ASSERT_EQ(0.0f, crealf(0));
+}
+
+extern "C" long double creall(long double _Complex);
+TEST(complex, creall) {
+ ASSERT_EQ(0.0, creall(0));
+}
+
+extern "C" double _Complex csin(double _Complex);
+TEST(complex, csin) {
+ ASSERT_EQ(0.0, csin(0));
+}
+
+extern "C" float _Complex csinf(float _Complex);
+TEST(complex, csinf) {
+ ASSERT_EQ(0.0, csinf(0));
+}
+
+extern "C" double _Complex csinh(double _Complex);
+TEST(complex, csinh) {
+ ASSERT_EQ(0.0, csinh(0));
+}
+
+extern "C" float _Complex csinhf(float _Complex);
+TEST(complex, csinhf) {
+ ASSERT_EQ(0.0, csinhf(0));
+}
+
+extern "C" double _Complex csqrt(double _Complex);
+TEST(complex, csqrt) {
+ ASSERT_EQ(0.0, csqrt(0));
+}
+
+extern "C" float _Complex csqrtf(float _Complex);
+TEST(complex, csqrtf) {
+ ASSERT_EQ(0.0f, csqrt(0));
+}
+
+extern "C" long double _Complex csqrtl(long double _Complex);
+TEST(complex, csqrtl) {
+ ASSERT_EQ(0.0, csqrtl(0));
+}
+
+extern "C" double _Complex ctan(double _Complex);
+TEST(complex, ctan) {
+ ASSERT_EQ(0.0, ctan(0));
+}
+
+extern "C" float _Complex ctanf(float _Complex);
+TEST(complex, ctanf) {
+ ASSERT_EQ(0.0, ctanf(0));
+}
+
+extern "C" double _Complex ctanh(double _Complex);
+TEST(complex, ctanh) {
+ ASSERT_EQ(0.0, ctanh(0));
+}
+
+extern "C" float _Complex ctanhf(float _Complex);
+TEST(complex, ctanhf) {
+ ASSERT_EQ(0.0, ctanhf(0));
+}
diff --git a/tests/dirent_test.cpp b/tests/dirent_test.cpp
index 6aadb37..214dd78 100644
--- a/tests/dirent_test.cpp
+++ b/tests/dirent_test.cpp
@@ -231,3 +231,50 @@
ASSERT_EQ(pass1[i], pass2[i]);
}
}
+
+TEST(dirent, seekdir_telldir) {
+ DIR* d = opendir("/proc/self");
+ ASSERT_TRUE(d != NULL);
+ std::vector<long> offset_list;
+ std::vector<std::string> name_list;
+ dirent* e = NULL;
+
+ offset_list.push_back(telldir(d));
+ ASSERT_EQ(0L, offset_list.back());
+
+ while ((e = readdir(d)) != NULL) {
+ name_list.push_back(e->d_name);
+ offset_list.push_back(telldir(d));
+ // Make sure telldir() point to the next entry.
+ ASSERT_EQ(e->d_off, offset_list.back());
+ }
+
+ long end_offset = telldir(d);
+ // telldir() should not pass the end of the file.
+ ASSERT_EQ(offset_list.back(), end_offset);
+ offset_list.pop_back();
+
+ for (size_t i = 0; i < offset_list.size(); ++i) {
+ seekdir(d, offset_list[i]);
+ ASSERT_EQ(offset_list[i], telldir(d));
+ e = readdir(d);
+ ASSERT_TRUE(e != NULL);
+ ASSERT_STREQ(name_list[i].c_str(), e->d_name);
+ }
+ for (int i = static_cast<int>(offset_list.size()) - 1; i >= 0; --i) {
+ seekdir(d, offset_list[i]);
+ ASSERT_EQ(offset_list[i], telldir(d));
+ e = readdir(d);
+ ASSERT_TRUE(e != NULL);
+ ASSERT_STREQ(name_list[i].c_str(), e->d_name);
+ }
+
+ // Seek to the end, read NULL.
+ seekdir(d, end_offset);
+ ASSERT_EQ(end_offset, telldir(d));
+ errno = 0;
+ ASSERT_EQ(NULL, readdir(d));
+ ASSERT_EQ(0, errno);
+
+ ASSERT_EQ(0, closedir(d));
+}
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp
new file mode 100644
index 0000000..74c7b51
--- /dev/null
+++ b/tests/dl_test.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+
+#include <dlfcn.h>
+#include <libgen.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdint.h>
+
+#include <string>
+
+extern "C" int main_global_default_serial() {
+ return 3370318;
+}
+
+extern "C" int main_global_protected_serial() {
+ return 2716057;
+}
+
+// The following functions are defined in DT_NEEDED
+// libdl_preempt_test.so library.
+
+// This one calls main_global_default_serial
+extern "C" int main_global_default_get_serial();
+
+// This one calls main_global_protected_serial
+extern "C" int main_global_protected_get_serial();
+
+// This one calls lib_global_default_serial
+extern "C" int lib_global_default_get_serial();
+
+// This one calls lib_global_protected_serial
+extern "C" int lib_global_protected_get_serial();
+
+// This test verifies that the global default function
+// main_global_default_serial() is preempted by
+// the function defined above.
+TEST(dl, main_preempts_global_default) {
+ ASSERT_EQ(3370318, main_global_default_get_serial());
+}
+
+// This one makes sure that the global protected
+// symbols do not get preempted
+TEST(dl, main_does_not_preempt_global_protected) {
+ ASSERT_EQ(3370318, main_global_protected_get_serial());
+}
+
+// check same things for lib
+TEST(dl, lib_preempts_global_default) {
+ ASSERT_EQ(3370318, lib_global_default_get_serial());
+}
+
+TEST(dl, lib_does_not_preempt_global_protected) {
+ ASSERT_EQ(3370318, lib_global_protected_get_serial());
+}
+
+// TODO: Add tests for LD_PRELOADs
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index 7f706c1..5b31364 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -17,8 +17,10 @@
#include <gtest/gtest.h>
#include <dlfcn.h>
+#include <elf.h>
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -39,6 +41,9 @@
#define ASSERT_NOERROR(i) \
ASSERT_NE(-1, i) << "errno: " << strerror(errno)
+#define ASSERT_SUBSTR(needle, haystack) \
+ ASSERT_PRED_FORMAT2(::testing::IsSubstring, needle, haystack)
+
typedef int (*fn)(void);
#define LIBNAME "libdlext_test.so"
@@ -138,7 +143,7 @@
ASSERT_TRUE(android_data != nullptr);
char lib_path[PATH_MAX];
- snprintf(lib_path, sizeof(lib_path), LIBZIPPATH, android_data);
+ snprintf(lib_path, sizeof(lib_path), LIBPATH, android_data);
android_dlextinfo extinfo;
extinfo.flags = ANDROID_DLEXT_USE_LIBRARY_FD | ANDROID_DLEXT_USE_LIBRARY_FD_OFFSET;
@@ -149,11 +154,20 @@
ASSERT_TRUE(handle_ == nullptr);
ASSERT_STREQ("dlopen failed: file offset for the library \"libname_placeholder\" is not page-aligned: 17", dlerror());
- extinfo.library_fd_offset = (5LL<<58) + PAGE_SIZE;
+ // Test an address above 2^44, for http://b/18178121 .
+ extinfo.library_fd_offset = (5LL<<48) + PAGE_SIZE;
handle_ = android_dlopen_ext("libname_placeholder", RTLD_NOW, &extinfo);
-
ASSERT_TRUE(handle_ == nullptr);
- // TODO: Better error message when reading with offset > file_size
+ ASSERT_SUBSTR("dlopen failed: file offset for the library \"libname_placeholder\" >= file size", dlerror());
+
+ extinfo.library_fd_offset = 0LL - PAGE_SIZE;
+ handle_ = android_dlopen_ext("libname_placeholder", RTLD_NOW, &extinfo);
+ ASSERT_TRUE(handle_ == nullptr);
+ ASSERT_SUBSTR("dlopen failed: file offset for the library \"libname_placeholder\" is negative", dlerror());
+
+ extinfo.library_fd_offset = PAGE_SIZE;
+ handle_ = android_dlopen_ext("libname_placeholder", RTLD_NOW, &extinfo);
+ ASSERT_TRUE(handle_ == nullptr);
ASSERT_STREQ("dlopen failed: \"libname_placeholder\" has bad ELF magic", dlerror());
close(extinfo.library_fd);
@@ -181,7 +195,7 @@
ASSERT_DL_NOTNULL(handle_);
fn f = reinterpret_cast<fn>(dlsym(handle_, "getRandomNumber"));
ASSERT_DL_NOTNULL(f);
- EXPECT_GE(f, start);
+ EXPECT_GE(reinterpret_cast<void*>(f), start);
EXPECT_LT(reinterpret_cast<void*>(f),
reinterpret_cast<char*>(start) + LIBSIZE);
EXPECT_EQ(4, f());
@@ -211,7 +225,7 @@
ASSERT_DL_NOTNULL(handle_);
fn f = reinterpret_cast<fn>(dlsym(handle_, "getRandomNumber"));
ASSERT_DL_NOTNULL(f);
- EXPECT_GE(f, start);
+ EXPECT_GE(reinterpret_cast<void*>(f), start);
EXPECT_LT(reinterpret_cast<void*>(f),
reinterpret_cast<char*>(start) + LIBSIZE);
EXPECT_EQ(4, f());
@@ -229,8 +243,9 @@
ASSERT_DL_NOTNULL(handle_);
fn f = reinterpret_cast<fn>(dlsym(handle_, "getRandomNumber"));
ASSERT_DL_NOTNULL(f);
- EXPECT_TRUE(f < start || (reinterpret_cast<void*>(f) >=
- reinterpret_cast<char*>(start) + PAGE_SIZE));
+ EXPECT_TRUE(reinterpret_cast<void*>(f) < start ||
+ (reinterpret_cast<void*>(f) >=
+ reinterpret_cast<char*>(start) + PAGE_SIZE));
EXPECT_EQ(4, f());
}
@@ -323,6 +338,11 @@
}
TEST_F(DlExtRelroSharingTest, VerifyMemorySaving) {
+ if (geteuid() != 0) {
+ GTEST_LOG_(INFO) << "This test must be run as root.\n";
+ return;
+ }
+
ASSERT_NO_FATAL_FAILURE(CreateRelroFile(LIBNAME));
int relro_fd = open(relro_file_, O_RDONLY);
ASSERT_NOERROR(relro_fd);
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index e24af13..ea20869 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -90,7 +90,7 @@
}
// ifuncs are only supported on intel and arm64 for now
-#if defined(__i386__) || defined(__x86_64__)
+#if defined (__aarch64__) || defined(__i386__) || defined(__x86_64__)
TEST(dlfcn, ifunc) {
typedef const char* (*fn_ptr)();
@@ -162,39 +162,39 @@
ASSERT_EQ(1, fn());
}
-TEST(dlfcn, dlopen_check_order) {
+TEST(dlfcn, dlopen_check_order_dlsym) {
// Here is how the test library and its dt_needed
// libraries are arranged
//
- // libtest_check_order.so
+ // libtest_check_order_children.so
// |
- // +-> libtest_check_order_1_left.so
+ // +-> ..._1_left.so
// | |
- // | +-> libtest_check_order_a.so
+ // | +-> ..._a.so
// | |
- // | +-> libtest_check_order_b.so
+ // | +-> ...r_b.so
// |
- // +-> libtest_check_order_2_right.so
+ // +-> ..._2_right.so
// | |
- // | +-> libtest_check_order_d.so
+ // | +-> ..._d.so
// | |
- // | +-> libtest_check_order_b.so
+ // | +-> ..._b.so
// |
- // +-> libtest_check_order_3_c.so
+ // +-> ..._3_c.so
//
// load order should be (1, 2, 3, a, b, d)
//
// get_answer() is defined in (2, 3, a, b, c)
// get_answer2() is defined in (b, d)
- void* sym = dlsym(RTLD_DEFAULT, "dlopen_test_get_answer");
+ void* sym = dlsym(RTLD_DEFAULT, "check_order_dlsym_get_answer");
ASSERT_TRUE(sym == nullptr);
- void* handle = dlopen("libtest_check_order.so", RTLD_NOW | RTLD_GLOBAL);
- ASSERT_TRUE(handle != nullptr);
+ void* handle = dlopen("libtest_check_order_dlsym.so", RTLD_NOW | RTLD_GLOBAL);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
typedef int (*fn_t) (void);
fn_t fn, fn2;
- fn = reinterpret_cast<fn_t>(dlsym(RTLD_DEFAULT, "dlopen_test_get_answer"));
+ fn = reinterpret_cast<fn_t>(dlsym(RTLD_DEFAULT, "check_order_dlsym_get_answer"));
ASSERT_TRUE(fn != NULL) << dlerror();
- fn2 = reinterpret_cast<fn_t>(dlsym(RTLD_DEFAULT, "dlopen_test_get_answer2"));
+ fn2 = reinterpret_cast<fn_t>(dlsym(RTLD_DEFAULT, "check_order_dlsym_get_answer2"));
ASSERT_TRUE(fn2 != NULL) << dlerror();
ASSERT_EQ(42, fn());
@@ -202,6 +202,242 @@
dlclose(handle);
}
+TEST(dlfcn, dlopen_check_order_reloc_siblings) {
+ // This is how this one works:
+ // we lookup and call get_answer which is defined in '_2.so'
+ // and in turn calls external get_answer_impl() defined in _1.so and in '_[a-f].so'
+ // the correct _impl() is implemented by '_a.so';
+ //
+ // Note that this is test for RTLD_LOCAL (TODO: test for GLOBAL?)
+ //
+ // Here is the picture:
+ //
+ // libtest_check_order_reloc_siblings.so
+ // |
+ // +-> ..._1.so <- empty
+ // | |
+ // | +-> ..._a.so <- exports correct answer_impl()
+ // | |
+ // | +-> ..._b.so <- every other letter exporting incorrect one.
+ // |
+ // +-> ..._2.so <- empty
+ // | |
+ // | +-> ..._c.so
+ // | |
+ // | +-> ..._d.so
+ // |
+ // +-> ..._3.so <- empty
+ // |
+ // +-> ..._e.so
+ // |
+ // +-> ..._f.so <- exports get_answer() that calls get_anser_impl();
+ // implements incorrect get_answer_impl()
+
+ void* handle = dlopen("libtest_check_order_reloc_siblings.so", RTLD_NOW | RTLD_NOLOAD);
+ ASSERT_TRUE(handle == nullptr);
+#ifdef __BIONIC__
+ // TODO: glibc returns nullptr on dlerror() here. Is it bug?
+ ASSERT_STREQ("dlopen failed: library \"libtest_check_order_reloc_siblings.so\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror());
+#endif
+
+ handle = dlopen("libtest_check_order_reloc_siblings.so", RTLD_NOW | RTLD_LOCAL);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+
+ typedef int (*fn_t) (void);
+ fn_t fn = reinterpret_cast<fn_t>(dlsym(handle, "check_order_reloc_get_answer"));
+ ASSERT_TRUE(fn != nullptr) << dlerror();
+ ASSERT_EQ(42, fn());
+
+ ASSERT_EQ(0, dlclose(handle));
+}
+
+TEST(dlfcn, dlopen_check_order_reloc_siblings_with_preload) {
+ // This test uses the same library as dlopen_check_order_reloc_siblings.
+ // Unlike dlopen_check_order_reloc_siblings it preloads
+ // libtest_check_order_reloc_siblings_1.so (first dependency) prior to
+ // dlopen(libtest_check_order_reloc_siblings.so)
+
+ void* handle = dlopen("libtest_check_order_reloc_siblings.so", RTLD_NOW | RTLD_NOLOAD);
+ ASSERT_TRUE(handle == nullptr);
+ handle = dlopen("libtest_check_order_reloc_siblings_1.so", RTLD_NOW | RTLD_NOLOAD);
+ ASSERT_TRUE(handle == nullptr);
+
+ void* handle_for_1 = dlopen("libtest_check_order_reloc_siblings_1.so", RTLD_NOW | RTLD_LOCAL);
+ ASSERT_TRUE(handle_for_1 != nullptr) << dlerror();
+
+ handle = dlopen("libtest_check_order_reloc_siblings.so", RTLD_NOW | RTLD_LOCAL);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+
+ ASSERT_EQ(0, dlclose(handle_for_1));
+
+ typedef int (*fn_t) (void);
+ fn_t fn = reinterpret_cast<fn_t>(dlsym(handle, "check_order_reloc_get_answer"));
+ ASSERT_TRUE(fn != nullptr) << dlerror();
+ ASSERT_EQ(42, fn());
+
+ ASSERT_EQ(0, dlclose(handle));
+}
+
+TEST(dlfcn, dlopen_check_order_reloc_grandchild) {
+ // This is how this one works:
+ // we lookup and call grandchild_get_answer which is defined in '_2.so'
+ // and in turn calls external get_answer_impl() defined in '_c_1.so and _c_2.so'
+ // the correct _impl() is implemented by '_c_1.so';
+ //
+ // Here is the picture of subtree:
+ //
+ // libtest_check_order_reloc_siblings.so
+ // |
+ // +-> ..._2.so <- grandchild_get_answer()
+ // |
+ // +-> ..._c.so <- empty
+ // | |
+ // | +-> _c_1.so <- exports correct answer_impl()
+ // | |
+ // | +-> _c_2.so <- exports incorrect answer_impl()
+ // |
+ // +-> ..._d.so <- empty
+
+ void* handle = dlopen("libtest_check_order_reloc_siblings.so", RTLD_NOW | RTLD_NOLOAD);
+ ASSERT_TRUE(handle == nullptr);
+#ifdef __BIONIC__
+ // TODO: glibc returns nullptr on dlerror() here. Is it bug?
+ ASSERT_STREQ("dlopen failed: library \"libtest_check_order_reloc_siblings.so\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror());
+#endif
+
+ handle = dlopen("libtest_check_order_reloc_siblings.so", RTLD_NOW | RTLD_LOCAL);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+
+ typedef int (*fn_t) (void);
+ fn_t fn = reinterpret_cast<fn_t>(dlsym(handle, "check_order_reloc_grandchild_get_answer"));
+ ASSERT_TRUE(fn != nullptr) << dlerror();
+ ASSERT_EQ(42, fn());
+
+ ASSERT_EQ(0, dlclose(handle));
+}
+
+TEST(dlfcn, dlopen_check_order_reloc_nephew) {
+ // This is how this one works:
+ // we lookup and call nephew_get_answer which is defined in '_2.so'
+ // and in turn calls external get_answer_impl() defined in '_[a-f].so'
+ // the correct _impl() is implemented by '_a.so';
+ //
+ // Here is the picture:
+ //
+ // libtest_check_order_reloc_siblings.so
+ // |
+ // +-> ..._1.so <- empty
+ // | |
+ // | +-> ..._a.so <- exports correct answer_impl()
+ // | |
+ // | +-> ..._b.so <- every other letter exporting incorrect one.
+ // |
+ // +-> ..._2.so <- empty
+ // | |
+ // | +-> ..._c.so
+ // | |
+ // | +-> ..._d.so
+ // |
+ // +-> ..._3.so <- nephew_get_answer() that calls get_answer_impl();
+ // |
+ // +-> ..._e.so
+ // |
+ // +-> ..._f.so
+
+ void* handle = dlopen("libtest_check_order_reloc_siblings.so", RTLD_NOW | RTLD_NOLOAD);
+ ASSERT_TRUE(handle == nullptr);
+#ifdef __BIONIC__
+ // TODO: glibc returns nullptr on dlerror() here. Is it bug?
+ ASSERT_STREQ("dlopen failed: library \"libtest_check_order_reloc_siblings.so\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror());
+#endif
+
+ handle = dlopen("libtest_check_order_reloc_siblings.so", RTLD_NOW | RTLD_LOCAL);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+
+ typedef int (*fn_t) (void);
+ fn_t fn = reinterpret_cast<fn_t>(dlsym(handle, "check_order_reloc_nephew_get_answer"));
+ ASSERT_TRUE(fn != nullptr) << dlerror();
+ ASSERT_EQ(42, fn());
+
+ ASSERT_EQ(0, dlclose(handle));
+}
+
+extern "C" int check_order_reloc_root_get_answer_impl() {
+ return 42;
+}
+
+TEST(dlfcn, dlopen_check_order_reloc_main_executable) {
+ // This is how this one works:
+ // we lookup and call get_answer3 which is defined in 'root.so'
+ // and in turn calls external root_get_answer_impl() defined in _2.so and
+ // above the correct _impl() is one in the executable.
+ //
+ // libtest_check_order_reloc_root.so
+ // |
+ // +-> ..._1.so <- empty
+ // |
+ // +-> ..._2.so <- gives incorrect answer for answer_main_impl()
+ //
+
+ void* handle = dlopen("libtest_check_order_reloc_root.so", RTLD_NOW | RTLD_NOLOAD);
+ ASSERT_TRUE(handle == nullptr);
+#ifdef __BIONIC__
+ // TODO: glibc returns nullptr on dlerror() here. Is it bug?
+ ASSERT_STREQ("dlopen failed: library \"libtest_check_order_reloc_root.so\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror());
+#endif
+
+ handle = dlopen("libtest_check_order_reloc_root.so", RTLD_NOW | RTLD_LOCAL);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+
+ typedef int (*fn_t) (void);
+ fn_t fn = reinterpret_cast<fn_t>(dlsym(handle, "check_order_reloc_root_get_answer"));
+ ASSERT_TRUE(fn != nullptr) << dlerror();
+ ASSERT_EQ(42, fn());
+
+ ASSERT_EQ(0, dlclose(handle));
+}
+
+TEST(dlfcn, dlopen_check_rtld_local) {
+ void* sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
+ ASSERT_TRUE(sym == nullptr);
+
+ // implicit RTLD_LOCAL
+ void* handle = dlopen("libtest_simple.so", RTLD_NOW);
+ sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
+ ASSERT_TRUE(sym == nullptr);
+ ASSERT_SUBSTR("undefined symbol: dlopen_testlib_simple_func", dlerror());
+ sym = dlsym(handle, "dlopen_testlib_simple_func");
+ ASSERT_TRUE(sym != nullptr);
+ ASSERT_TRUE(reinterpret_cast<bool (*)(void)>(sym)());
+ dlclose(handle);
+
+ // explicit RTLD_LOCAL
+ handle = dlopen("libtest_simple.so", RTLD_NOW | RTLD_LOCAL);
+ sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
+ ASSERT_TRUE(sym == nullptr);
+ ASSERT_SUBSTR("undefined symbol: dlopen_testlib_simple_func", dlerror());
+ sym = dlsym(handle, "dlopen_testlib_simple_func");
+ ASSERT_TRUE(sym != nullptr);
+ ASSERT_TRUE(reinterpret_cast<bool (*)(void)>(sym)());
+ dlclose(handle);
+}
+
+TEST(dlfcn, dlopen_check_rtld_global) {
+ void* sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
+ ASSERT_TRUE(sym == nullptr);
+
+ void* handle = dlopen("libtest_simple.so", RTLD_NOW | RTLD_GLOBAL);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+ sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
+ ASSERT_TRUE(sym != nullptr) << dlerror();
+ ASSERT_TRUE(reinterpret_cast<bool (*)(void)>(sym)());
+ dlclose(handle);
+
+ // RTLD_GLOBAL implies RTLD_NODELETE, let's check that
+ void* sym_after_dlclose = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
+ ASSERT_EQ(sym, sym_after_dlclose);
+}
+
// libtest_with_dependency_loop.so -> libtest_with_dependency_loop_a.so ->
// libtest_with_dependency_loop_b.so -> libtest_with_dependency_loop_c.so ->
// libtest_with_dependency_loop_a.so
@@ -227,6 +463,94 @@
#endif
}
+TEST(dlfcn, dlopen_nodelete) {
+ static bool is_unloaded = false;
+
+ void* handle = dlopen("libtest_nodelete_1.so", RTLD_NOW | RTLD_NODELETE);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+ void (*set_unload_flag_ptr)(bool*);
+ set_unload_flag_ptr = reinterpret_cast<void (*)(bool*)>(dlsym(handle, "dlopen_nodelete_1_set_unload_flag_ptr"));
+ ASSERT_TRUE(set_unload_flag_ptr != nullptr) << dlerror();
+ set_unload_flag_ptr(&is_unloaded);
+
+ uint32_t* taxicab_number = reinterpret_cast<uint32_t*>(dlsym(handle, "dlopen_nodelete_1_taxicab_number"));
+ ASSERT_TRUE(taxicab_number != nullptr) << dlerror();
+ ASSERT_EQ(1729U, *taxicab_number);
+ *taxicab_number = 2;
+
+ dlclose(handle);
+ ASSERT_TRUE(!is_unloaded);
+
+ uint32_t* taxicab_number_after_dlclose = reinterpret_cast<uint32_t*>(dlsym(handle, "dlopen_nodelete_1_taxicab_number"));
+ ASSERT_EQ(taxicab_number_after_dlclose, taxicab_number);
+ ASSERT_EQ(2U, *taxicab_number_after_dlclose);
+
+
+ handle = dlopen("libtest_nodelete_1.so", RTLD_NOW);
+ uint32_t* taxicab_number2 = reinterpret_cast<uint32_t*>(dlsym(handle, "dlopen_nodelete_1_taxicab_number"));
+ ASSERT_EQ(taxicab_number2, taxicab_number);
+
+ ASSERT_EQ(2U, *taxicab_number2);
+
+ dlclose(handle);
+ ASSERT_TRUE(!is_unloaded);
+}
+
+TEST(dlfcn, dlopen_nodelete_on_second_dlopen) {
+ static bool is_unloaded = false;
+
+ void* handle = dlopen("libtest_nodelete_2.so", RTLD_NOW);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+ void (*set_unload_flag_ptr)(bool*);
+ set_unload_flag_ptr = reinterpret_cast<void (*)(bool*)>(dlsym(handle, "dlopen_nodelete_2_set_unload_flag_ptr"));
+ ASSERT_TRUE(set_unload_flag_ptr != nullptr) << dlerror();
+ set_unload_flag_ptr(&is_unloaded);
+
+ uint32_t* taxicab_number = reinterpret_cast<uint32_t*>(dlsym(handle, "dlopen_nodelete_2_taxicab_number"));
+ ASSERT_TRUE(taxicab_number != nullptr) << dlerror();
+
+ ASSERT_EQ(1729U, *taxicab_number);
+ *taxicab_number = 2;
+
+ // This RTLD_NODELETE should be ignored
+ void* handle1 = dlopen("libtest_nodelete_2.so", RTLD_NOW | RTLD_NODELETE);
+ ASSERT_TRUE(handle1 != nullptr) << dlerror();
+ ASSERT_EQ(handle, handle1);
+
+ dlclose(handle1);
+ dlclose(handle);
+
+ ASSERT_TRUE(is_unloaded);
+}
+
+TEST(dlfcn, dlopen_nodelete_dt_flags_1) {
+ static bool is_unloaded = false;
+
+ void* handle = dlopen("libtest_nodelete_dt_flags_1.so", RTLD_NOW);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+ void (*set_unload_flag_ptr)(bool*);
+ set_unload_flag_ptr = reinterpret_cast<void (*)(bool*)>(dlsym(handle, "dlopen_nodelete_dt_flags_1_set_unload_flag_ptr"));
+ ASSERT_TRUE(set_unload_flag_ptr != nullptr) << dlerror();
+ set_unload_flag_ptr(&is_unloaded);
+
+ dlclose(handle);
+ ASSERT_TRUE(!is_unloaded);
+}
+
+TEST(dlfcn, dlsym_df_1_global) {
+#if !defined(__arm__) && !defined(__aarch64__)
+ void* handle = dlopen("libtest_dlsym_df_1_global.so", RTLD_NOW);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+ int (*get_answer)();
+ get_answer = reinterpret_cast<int (*)()>(dlsym(handle, "dl_df_1_global_get_answer"));
+ ASSERT_TRUE(get_answer != nullptr) << dlerror();
+ ASSERT_EQ(42, get_answer());
+ ASSERT_EQ(0, dlclose(handle));
+#else
+ GTEST_LOG_(INFO) << "This test does nothing on arm/arm64 (to be reenabled once b/18137520 or b/18130452 are fixed).\n";
+#endif
+}
+
TEST(dlfcn, dlopen_failure) {
void* self = dlopen("/does/not/exist", RTLD_NOW);
ASSERT_TRUE(self == NULL);
@@ -362,19 +686,52 @@
ASSERT_TRUE(dlerror() == NULL); // dladdr(3) doesn't set dlerror(3).
}
-// Our dynamic linker doesn't support GNU hash tables.
-#if defined(__BIONIC__)
// GNU-style ELF hash tables are incompatible with the MIPS ABI.
// MIPS requires .dynsym to be sorted to match the GOT but GNU-style requires sorting by hash code.
-#if !defined(__mips__)
TEST(dlfcn, dlopen_library_with_only_gnu_hash) {
+#if !defined(__mips__)
dlerror(); // Clear any pending errors.
- void* handle = dlopen("no-elf-hash-table-library.so", RTLD_NOW);
- ASSERT_TRUE(handle == NULL);
- ASSERT_STREQ("dlopen failed: empty/missing DT_HASH in \"no-elf-hash-table-library.so\" (built with --hash-style=gnu?)", dlerror());
+ void* handle = dlopen("libgnu-hash-table-library.so", RTLD_NOW);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+ auto guard = make_scope_guard([&]() {
+ dlclose(handle);
+ });
+ void* sym = dlsym(handle, "getRandomNumber");
+ ASSERT_TRUE(sym != nullptr) << dlerror();
+ int (*fn)(void);
+ fn = reinterpret_cast<int (*)(void)>(sym);
+ EXPECT_EQ(4, fn());
+
+ Dl_info dlinfo;
+ ASSERT_TRUE(0 != dladdr(reinterpret_cast<void*>(fn), &dlinfo));
+
+ ASSERT_TRUE(fn == dlinfo.dli_saddr);
+ ASSERT_STREQ("getRandomNumber", dlinfo.dli_sname);
+ ASSERT_SUBSTR("libgnu-hash-table-library.so", dlinfo.dli_fname);
+#else
+ GTEST_LOG_(INFO) << "This test does nothing for mips/mips64; mips toolchain does not support '--hash-style=gnu'\n";
+#endif
}
-#endif
-#endif
+
+TEST(dlfcn, dlopen_library_with_only_sysv_hash) {
+ void* handle = dlopen("libsysv-hash-table-library.so", RTLD_NOW);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+ auto guard = make_scope_guard([&]() {
+ dlclose(handle);
+ });
+ void* sym = dlsym(handle, "getRandomNumber");
+ ASSERT_TRUE(sym != nullptr) << dlerror();
+ int (*fn)(void);
+ fn = reinterpret_cast<int (*)(void)>(sym);
+ EXPECT_EQ(4, fn());
+
+ Dl_info dlinfo;
+ ASSERT_TRUE(0 != dladdr(reinterpret_cast<void*>(fn), &dlinfo));
+
+ ASSERT_TRUE(fn == dlinfo.dli_saddr);
+ ASSERT_STREQ("getRandomNumber", dlinfo.dli_sname);
+ ASSERT_SUBSTR("libsysv-hash-table-library.so", dlinfo.dli_fname);
+}
TEST(dlfcn, dlopen_bad_flags) {
dlerror(); // Clear any pending errors.
@@ -435,4 +792,6 @@
ASSERT_TRUE(handle1 != NULL);
ASSERT_TRUE(handle2 != NULL);
ASSERT_EQ(handle1, handle2);
+ dlclose(handle1);
+ dlclose(handle2);
}
diff --git a/tests/file-check-cxx b/tests/file-check-cxx
new file mode 100755
index 0000000..8ece835
--- /dev/null
+++ b/tests/file-check-cxx
@@ -0,0 +1,13 @@
+#!/bin/bash
+FILECHECK=$1
+CXX=$2
+PREFIX=$3
+ARGS=${*:4}
+SOURCE=$(echo $ARGS | grep -oP '\S+\.cpp\b')
+OBJ=$(echo $ARGS | grep -oP '\S+\.o\b')
+$CXX $ARGS 2>&1 | $FILECHECK -check-prefix=$PREFIX $SOURCE
+if [ "$?" -eq 0 ]; then
+ touch $OBJ
+else
+ exit 1
+fi
diff --git a/tests/fortify_sprintf_warnings.cpp b/tests/fortify_sprintf_warnings.cpp
new file mode 100644
index 0000000..3a2d3c4
--- /dev/null
+++ b/tests/fortify_sprintf_warnings.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#undef _FORTIFY_SOURCE
+#define _FORTIFY_SOURCE 2
+#include <stdio.h>
+
+void test_sprintf() {
+ char buf[4];
+
+ // NOLINTNEXTLINE(whitespace/line_length)
+ // GCC: warning: call to int __builtin___sprintf_chk(char*, int, {{(long )?}}unsigned int, const char*, ...) will always overflow destination buffer
+ // clang should emit a warning, but doesn't
+ sprintf(buf, "foobar"); // NOLINT(runtime/printf)
+
+ // NOLINTNEXTLINE(whitespace/line_length)
+ // GCC: warning: call to int __builtin___sprintf_chk(char*, int, {{(long )?}}unsigned int, const char*, ...) will always overflow destination buffer
+ // clang should emit a warning, but doesn't
+ sprintf(buf, "%s", "foobar"); // NOLINT(runtime/printf)
+}
+
+void test_snprintf() {
+ char buf[4];
+
+ // NOLINTNEXTLINE(whitespace/line_length)
+ // GCC: warning: call to int __builtin___snprintf_chk(char*, {{(long )?}}unsigned int, int, {{(long )?}}unsigned int, const char*, ...) will always overflow destination buffer
+ // clang should emit a warning, but doesn't
+ snprintf(buf, 5, "foobar"); // NOLINT(runtime/printf)
+
+ // NOLINTNEXTLINE(whitespace/line_length)
+ // GCC: warning: call to int __builtin___snprintf_chk(char*, {{(long )?}}unsigned int, int, {{(long )?}}unsigned int, const char*, ...) will always overflow destination buffer
+ // clang should emit a warning, but doesn't
+ snprintf(buf, 5, "%s", "foobar"); // NOLINT(runtime/printf)
+
+ // NOLINTNEXTLINE(whitespace/line_length)
+ // GCC: warning: call to int __builtin___snprintf_chk(char*, {{(long )?}}unsigned int, int, {{(long )?}}unsigned int, const char*, ...) will always overflow destination buffer
+ // clang should emit a warning, but doesn't
+ snprintf(buf, 5, " %s ", "foobar"); // NOLINT(runtime/printf)
+
+ // NOLINTNEXTLINE(whitespace/line_length)
+ // GCC: warning: call to int __builtin___snprintf_chk(char*, {{(long )?}}unsigned int, int, {{(long )?}}unsigned int, const char*, ...) will always overflow destination buffer
+ // clang should emit a warning, but doesn't
+ snprintf(buf, 5, "%d", 100000); // NOLINT(runtime/printf)
+}
diff --git a/tests/fortify_test.cpp b/tests/fortify_test.cpp
index 352cac6..48764aa 100644
--- a/tests/fortify_test.cpp
+++ b/tests/fortify_test.cpp
@@ -15,38 +15,24 @@
*/
#include <gtest/gtest.h>
-#include <signal.h>
-#include <string.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <malloc.h>
-#include <fcntl.h>
-#include <sys/prctl.h>
+#include "BionicDeathTest.h"
-// We have to say "DeathTest" here so gtest knows to run this test (which exits)
-// in its own process. Unfortunately, the C preprocessor doesn't give us an
-// easy way to concatenate strings, so we need to use the complicated method
-// below. *sigh*
+#include <fcntl.h>
+#include <malloc.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+// Fortify test code needs to run multiple times, so TEST_NAME macro is used to
+// distinguish different tests. TEST_NAME is defined in compilation command.
#define DEATHTEST_PASTER(name) name##_DeathTest
#define DEATHTEST_EVALUATOR(name) DEATHTEST_PASTER(name)
#define DEATHTEST DEATHTEST_EVALUATOR(TEST_NAME)
-class DEATHTEST : public testing::Test {
- protected:
- virtual void SetUp() {
- old_dumpable_ = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0);
- // Suppress debuggerd stack traces. Too slow.
- prctl(PR_SET_DUMPABLE, 0, 0, 0, 0);
- }
-
- virtual void TearDown() {
- prctl(PR_SET_DUMPABLE, old_dumpable_, 0, 0, 0, 0);
- }
- private:
- int old_dumpable_;
-};
+class DEATHTEST : public BionicDeathTest {};
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE == 2
struct foo {
@@ -60,7 +46,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, stpncpy_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
int copy_amt = atoi("11");
ASSERT_EXIT(stpncpy(myfoo.a, "01234567890", copy_amt),
@@ -72,7 +57,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, stpncpy2_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
memset(&myfoo, 0, sizeof(myfoo));
myfoo.one[0] = 'A'; // not null terminated string
@@ -85,7 +69,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strncpy_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
int copy_amt = atoi("11");
ASSERT_EXIT(strncpy(myfoo.a, "01234567890", copy_amt),
@@ -97,7 +80,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strncpy2_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
memset(&myfoo, 0, sizeof(myfoo));
myfoo.one[0] = 'A'; // not null terminated string
@@ -110,7 +92,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, sprintf_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
char source_buf[15];
memcpy(source_buf, "12345678901234", 15);
@@ -123,7 +104,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, sprintf2_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
ASSERT_EXIT(sprintf(myfoo.a, "0123456789"),
testing::KilledBySignal(SIGABRT), "");
@@ -145,12 +125,10 @@
}
TEST_F(DEATHTEST, vsprintf_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(vsprintf_helper2("%s", "0123456789"), testing::KilledBySignal(SIGABRT), "");
}
TEST_F(DEATHTEST, vsprintf2_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(vsprintf_helper2("0123456789"), testing::KilledBySignal(SIGABRT), "");
}
#endif
@@ -171,12 +149,10 @@
}
TEST_F(DEATHTEST, vsnprintf_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(vsnprintf_helper2("%s", "0123456789"), testing::KilledBySignal(SIGABRT), "");
}
TEST_F(DEATHTEST, vsnprintf2_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(vsnprintf_helper2("0123456789"), testing::KilledBySignal(SIGABRT), "");
}
#endif
@@ -187,7 +163,6 @@
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, stpcpy_fortified2) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
char* src = strdup("");
ASSERT_EXIT(stpcpy(myfoo.empty, src),
@@ -205,7 +180,6 @@
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strcpy_fortified2) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
char* src = strdup("");
ASSERT_EXIT(strcpy(myfoo.empty, src),
@@ -223,7 +197,6 @@
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strcpy2_fortified2) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
char* src = strdup("1");
ASSERT_EXIT(strcpy(myfoo.empty, src),
@@ -241,7 +214,6 @@
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strcpy3_fortified2) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
char* src = strdup("12");
ASSERT_EXIT(strcpy(myfoo.one, src),
@@ -258,7 +230,6 @@
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strchr_fortified2) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
memcpy(myfoo.a, "0123456789", sizeof(myfoo.a));
myfoo.b[0] = '\0';
@@ -275,7 +246,6 @@
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strrchr_fortified2) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
memcpy(myfoo.a, "0123456789", 10);
memcpy(myfoo.b, "01234", 6);
@@ -292,7 +262,6 @@
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strlcpy_fortified2) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
strcpy(myfoo.a, "01");
size_t n = strlen(myfoo.a);
@@ -309,7 +278,6 @@
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strlcat_fortified2) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
strcpy(myfoo.a, "01");
myfoo.one[0] = '\0';
@@ -326,7 +294,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strncat_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
size_t n = atoi("10"); // avoid compiler optimizations
strncpy(myfoo.a, "012345678", n);
@@ -338,7 +305,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strncat2_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
myfoo.a[0] = '\0';
size_t n = atoi("10"); // avoid compiler optimizations
@@ -347,7 +313,6 @@
#endif
TEST_F(DEATHTEST, strncat3_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
memcpy(myfoo.a, "0123456789", sizeof(myfoo.a)); // unterminated string
myfoo.b[0] = '\0';
@@ -359,7 +324,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, strcat_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char src[11];
strcpy(src, "0123456789");
foo myfoo;
@@ -369,7 +333,6 @@
#endif
TEST_F(DEATHTEST, strcat2_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
memcpy(myfoo.a, "0123456789", sizeof(myfoo.a)); // unterminated string
myfoo.b[0] = '\0';
@@ -377,7 +340,6 @@
}
TEST_F(DEATHTEST, snprintf_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
strcpy(myfoo.a, "012345678");
size_t n = strlen(myfoo.a) + 2;
@@ -385,7 +347,6 @@
}
TEST_F(DEATHTEST, bzero_fortified2) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
memcpy(myfoo.b, "0123456789", sizeof(myfoo.b));
size_t n = atoi("11");
@@ -397,7 +358,6 @@
// multibyte target where we over fill (should fail)
TEST_F(DEATHTEST, strcpy_fortified) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[10];
char *orig = strdup("0123456789");
ASSERT_EXIT(strcpy(buf, orig), testing::KilledBySignal(SIGABRT), "");
@@ -410,7 +370,6 @@
// zero sized target with "\0" source (should fail)
TEST_F(DEATHTEST, strcpy2_fortified) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[0];
char *orig = strdup("");
ASSERT_EXIT(strcpy(buf, orig), testing::KilledBySignal(SIGABRT), "");
@@ -423,7 +382,6 @@
// zero sized target with longer source (should fail)
TEST_F(DEATHTEST, strcpy3_fortified) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[0];
char *orig = strdup("1");
ASSERT_EXIT(strcpy(buf, orig), testing::KilledBySignal(SIGABRT), "");
@@ -436,7 +394,6 @@
// one byte target with longer source (should fail)
TEST_F(DEATHTEST, strcpy4_fortified) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[1];
char *orig = strdup("12");
ASSERT_EXIT(strcpy(buf, orig), testing::KilledBySignal(SIGABRT), "");
@@ -448,7 +405,6 @@
TEST_F(DEATHTEST, strlen_fortified) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[10];
memcpy(buf, "0123456789", sizeof(buf));
ASSERT_EXIT(printf("%zd", strlen(buf)), testing::KilledBySignal(SIGABRT), "");
@@ -459,7 +415,6 @@
TEST_F(DEATHTEST, strchr_fortified) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[10];
memcpy(buf, "0123456789", sizeof(buf));
ASSERT_EXIT(printf("%s", strchr(buf, 'a')), testing::KilledBySignal(SIGABRT), "");
@@ -470,7 +425,6 @@
TEST_F(DEATHTEST, strrchr_fortified) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[10];
memcpy(buf, "0123456789", sizeof(buf));
ASSERT_EXIT(printf("%s", strrchr(buf, 'a')), testing::KilledBySignal(SIGABRT), "");
@@ -481,7 +435,6 @@
TEST_F(DEATHTEST, strlcpy_fortified) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char bufa[15];
char bufb[10];
strcpy(bufa, "01234567890123");
@@ -494,7 +447,6 @@
TEST_F(DEATHTEST, strlcat_fortified) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char bufa[15];
char bufb[10];
bufb[0] = '\0';
@@ -507,7 +459,6 @@
}
TEST_F(DEATHTEST, sprintf_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[10];
char source_buf[15];
memcpy(source_buf, "12345678901234", 15);
@@ -518,7 +469,6 @@
// This test is disabled in clang because clang doesn't properly detect
// this buffer overflow. TODO: Fix clang.
TEST_F(DEATHTEST, sprintf_malloc_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char* buf = (char *) malloc(10);
char source_buf[11];
memcpy(source_buf, "1234567890", 11);
@@ -528,7 +478,6 @@
#endif
TEST_F(DEATHTEST, sprintf2_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[5];
ASSERT_EXIT(sprintf(buf, "aaaaa"), testing::KilledBySignal(SIGABRT), "");
}
@@ -545,12 +494,10 @@
}
TEST_F(DEATHTEST, vsprintf_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(vsprintf_helper("%s", "0123456789"), testing::KilledBySignal(SIGABRT), "");
}
TEST_F(DEATHTEST, vsprintf2_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(vsprintf_helper("0123456789"), testing::KilledBySignal(SIGABRT), "");
}
@@ -567,17 +514,14 @@
}
TEST_F(DEATHTEST, vsnprintf_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(vsnprintf_helper("%s", "0123456789"), testing::KilledBySignal(SIGABRT), "");
}
TEST_F(DEATHTEST, vsnprintf2_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(vsnprintf_helper("0123456789"), testing::KilledBySignal(SIGABRT), "");
}
TEST_F(DEATHTEST, strncat_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[10];
size_t n = atoi("10"); // avoid compiler optimizations
strncpy(buf, "012345678", n);
@@ -585,7 +529,6 @@
}
TEST_F(DEATHTEST, strncat2_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[10];
buf[0] = '\0';
size_t n = atoi("10"); // avoid compiler optimizations
@@ -593,7 +536,6 @@
}
TEST_F(DEATHTEST, strcat_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char src[11];
strcpy(src, "0123456789");
char buf[10];
@@ -602,7 +544,6 @@
}
TEST_F(DEATHTEST, memmove_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[20];
strcpy(buf, "0123456789");
size_t n = atoi("10");
@@ -610,7 +551,6 @@
}
TEST_F(DEATHTEST, memcpy_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char bufa[10];
char bufb[10];
strcpy(bufa, "012345678");
@@ -619,7 +559,6 @@
}
TEST_F(DEATHTEST, stpncpy_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char bufa[15];
char bufb[10];
strcpy(bufa, "01234567890123");
@@ -628,7 +567,6 @@
}
TEST_F(DEATHTEST, stpncpy2_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char dest[11];
char src[10];
memcpy(src, "0123456789", sizeof(src)); // src is not null terminated
@@ -636,7 +574,6 @@
}
TEST_F(DEATHTEST, strncpy_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char bufa[15];
char bufb[10];
strcpy(bufa, "01234567890123");
@@ -646,7 +583,6 @@
TEST_F(DEATHTEST, strncpy2_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char dest[11];
char src[10];
memcpy(src, "0123456789", sizeof(src)); // src is not null terminated
@@ -654,7 +590,6 @@
}
TEST_F(DEATHTEST, snprintf_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char bufa[15];
char bufb[10];
strcpy(bufa, "0123456789");
@@ -663,7 +598,6 @@
}
TEST_F(DEATHTEST, bzero_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[10];
memcpy(buf, "0123456789", sizeof(buf));
size_t n = atoi("11");
@@ -671,13 +605,11 @@
}
TEST_F(DEATHTEST, umask_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
mode_t mask = atoi("1023"); // 01777 in octal
ASSERT_EXIT(umask(mask), testing::KilledBySignal(SIGABRT), "");
}
TEST_F(DEATHTEST, recv_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
size_t data_len = atoi("11"); // suppress compiler optimizations
char buf[10];
ASSERT_EXIT(recv(0, buf, data_len, 0), testing::KilledBySignal(SIGABRT), "");
@@ -685,7 +617,6 @@
TEST_F(DEATHTEST, FD_ISSET_fortified) {
#if defined(__BIONIC__) // glibc catches this at compile-time.
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
fd_set set;
memset(&set, 0, sizeof(set));
ASSERT_EXIT(FD_ISSET(-1, &set), testing::KilledBySignal(SIGABRT), "");
@@ -693,7 +624,6 @@
}
TEST_F(DEATHTEST, FD_ISSET_2_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[1];
fd_set* set = (fd_set*) buf;
ASSERT_EXIT(FD_ISSET(0, set), testing::KilledBySignal(SIGABRT), "");
@@ -703,14 +633,12 @@
static void FD_ZERO_function(fd_set* s) { FD_ZERO(s); }
TEST_F(DEATHTEST, FD_ZERO_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[1];
fd_set* set = (fd_set*) buf;
ASSERT_EXIT(FD_ZERO_function(set), testing::KilledBySignal(SIGABRT), "");
}
TEST_F(DEATHTEST, read_fortified) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
char buf[1];
size_t ct = atoi("2"); // prevent optimizations
int fd = open("/dev/null", O_RDONLY);
diff --git a/tests/ftw_test.cpp b/tests/ftw_test.cpp
index 6d3a308..38b3d49 100644
--- a/tests/ftw_test.cpp
+++ b/tests/ftw_test.cpp
@@ -14,27 +14,36 @@
* limitations under the License.
*/
-#include <gtest/gtest.h>
-#include "TemporaryFile.h"
-
#include <ftw.h>
+
#include <stdlib.h>
#include <sys/stat.h>
+#include <gtest/gtest.h>
+
void sanity_check_ftw(const char* fpath, const struct stat* sb, int tflag) {
ASSERT_TRUE(fpath != NULL);
ASSERT_TRUE(sb != NULL);
- bool is_dir = S_ISDIR(sb->st_mode);
- ASSERT_TRUE((is_dir && tflag == FTW_D) || (!is_dir && tflag == FTW_F));
+ if (S_ISDIR(sb->st_mode)) {
+ ASSERT_TRUE(tflag == FTW_D || tflag == FTW_DNR || tflag == FTW_DP) << fpath;
+ } else if (S_ISLNK(sb->st_mode)) {
+ ASSERT_EQ(FTW_SL, tflag) << fpath;
+ } else {
+ ASSERT_EQ(FTW_F, tflag) << fpath;
+ }
}
-void sanity_check_nftw(
- const char* fpath, const struct stat* sb, int tflag, struct FTW* ftwbuf) {
+void sanity_check_nftw(const char* fpath, const struct stat* sb, int tflag, struct FTW* ftwbuf) {
sanity_check_ftw(fpath, sb, tflag);
- // either the parent dir or the file
- bool is_dir = S_ISDIR(sb->st_mode);
- ASSERT_TRUE(
- (is_dir && ftwbuf->level == 0) || (!is_dir && ftwbuf->level == 1));
+
+ size_t slash_count = 0;
+ const char* p = fpath;
+ while ((p = strchr(p + 1, '/')) != NULL) {
+ ++slash_count;
+ }
+
+ ASSERT_EQ('/', fpath[ftwbuf->base - 1]) << fpath;
+ ASSERT_EQ(slash_count, static_cast<size_t>(ftwbuf->level)) << fpath;
}
int check_ftw(const char* fpath, const struct stat* sb, int tflag) {
@@ -47,39 +56,28 @@
return 0;
}
-int check_nftw(
- const char* fpath, const struct stat* sb, int tflag, struct FTW* ftwbuf) {
+int check_nftw(const char* fpath, const struct stat* sb, int tflag, struct FTW* ftwbuf) {
sanity_check_nftw(fpath, sb, tflag, ftwbuf);
return 0;
}
-int check_nftw64(
- const char* fpath, const struct stat64* sb, int tflag, struct FTW* ftwbuf) {
- sanity_check_nftw(fpath, reinterpret_cast<const struct stat*>(sb),
- tflag, ftwbuf);
+int check_nftw64(const char* fpath, const struct stat64* sb, int tflag, struct FTW* ftwbuf) {
+ sanity_check_nftw(fpath, reinterpret_cast<const struct stat*>(sb), tflag, ftwbuf);
return 0;
}
TEST(ftw, ftw) {
- TemporaryDir td;
- TemporaryFile tf(td.dirname);
- ftw(td.dirname, check_ftw, 1);
+ ASSERT_EQ(0, ftw("/sys", check_ftw, 128));
}
TEST(ftw, ftw64) {
- TemporaryDir td;
- GenericTemporaryFile<mkstemp64> tf(td.dirname);
- ftw64(td.dirname, check_ftw64, 1);
+ ASSERT_EQ(0, ftw64("/sys", check_ftw64, 128));
}
TEST(ftw, nftw) {
- TemporaryDir td;
- TemporaryFile tf(td.dirname);
- nftw(td.dirname, check_nftw, 1, 0);
+ ASSERT_EQ(0, nftw("/sys", check_nftw, 128, 0));
}
TEST(ftw, nftw64) {
- TemporaryDir td;
- GenericTemporaryFile<mkstemp64> tf(td.dirname);
- nftw64(td.dirname, check_nftw64, 1, 0);
+ ASSERT_EQ(0, nftw64("/sys", check_nftw64, 128, 0));
}
diff --git a/tests/getauxval_test.cpp b/tests/getauxval_test.cpp
index 51c9db8..b331150 100644
--- a/tests/getauxval_test.cpp
+++ b/tests/getauxval_test.cpp
@@ -15,7 +15,6 @@
*/
#include <sys/cdefs.h>
-#include <features.h>
#include <gtest/gtest.h>
// getauxval() was only added as of glibc version 2.16.
diff --git a/tests/gtest_ex.h b/tests/gtest_ex.h
new file mode 100644
index 0000000..fe1d894
--- /dev/null
+++ b/tests/gtest_ex.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+template<typename F>
+void test_isolated(F test) {
+ int pid = fork();
+ ASSERT_NE(-1, pid) << strerror(errno);
+
+ if (pid == 0) {
+ test();
+ _exit(testing::Test::HasFailure() ? 1 : 0);
+ }
+
+ int status;
+ ASSERT_EQ(pid, waitpid(pid, &status, 0));
+ ASSERT_TRUE(WIFEXITED(status));
+ ASSERT_EQ(0, WEXITSTATUS(status)) << "Forked test has failed, see above..";
+}
diff --git a/tests/inttypes_test.cpp b/tests/inttypes_test.cpp
index e588503..dbbb6d4 100644
--- a/tests/inttypes_test.cpp
+++ b/tests/inttypes_test.cpp
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-#include <gtest/gtest.h>
-
-#include <stdio.h>
#include <inttypes.h>
+#include <errno.h>
+#include <gtest/gtest.h>
+#include <stdio.h>
+
TEST(inttypes, misc) {
char buf[512];
@@ -46,3 +47,51 @@
TEST(inttypes, wcstoumax) {
ASSERT_EQ(123U, wcstoumax(L"123", NULL, 10));
}
+
+TEST(inttypes, strtoimax_EINVAL) {
+ errno = 0;
+ strtoimax("123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoimax("123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoimax("123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(inttypes, strtoumax_EINVAL) {
+ errno = 0;
+ strtoumax("123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoumax("123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoumax("123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(inttypes, wcstoimax_EINVAL) {
+ errno = 0;
+ wcstoimax(L"123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoimax(L"123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoimax(L"123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(inttypes, wcstoumax_EINVAL) {
+ errno = 0;
+ wcstoumax(L"123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoumax(L"123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoumax(L"123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
diff --git a/tests/libc_logging_test.cpp b/tests/libc_logging_test.cpp
index 950161e..d4ceded 100644
--- a/tests/libc_logging_test.cpp
+++ b/tests/libc_logging_test.cpp
@@ -176,3 +176,15 @@
GTEST_LOG_(INFO) << "This test does nothing.\n";
#endif // __BIONIC__
}
+
+TEST(libc_logging, buffer_overrun) {
+#if defined(__BIONIC__)
+ char buf[BUFSIZ];
+ ASSERT_EQ(11, __libc_format_buffer(buf, sizeof(buf), "hello %s", "world"));
+ EXPECT_STREQ("hello world", buf);
+ ASSERT_EQ(11, __libc_format_buffer(buf, 8, "hello %s", "world"));
+ EXPECT_STREQ("hello w", buf);
+#else // __BIONIC__
+ GTEST_LOG_(INFO) << "This test does nothing.\n";
+#endif // __BIONIC__
+}
diff --git a/tests/libgen_test.cpp b/tests/libgen_test.cpp
index 3958f81..e9a5d5c 100644
--- a/tests/libgen_test.cpp
+++ b/tests/libgen_test.cpp
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-#include <gtest/gtest.h>
-
#include <libgen.h>
#include <errno.h>
+#include <gtest/gtest.h>
static void TestBasename(const char* in, const char* expected_out) {
char* writable_in = (in != NULL) ? strdup(in) : NULL;
@@ -40,7 +39,7 @@
// Do not use basename as the test name, it's defined to another value in glibc
// so leads to a differently named test on host versus target architectures.
-TEST(libgen, basename_smoke) {
+TEST(libgen, posix_basename) {
TestBasename(NULL, ".");
TestBasename("", ".");
TestBasename("/usr/lib", "lib");
diff --git a/tests/libs/Android.build.dlopen_check_order_dlsym.mk b/tests/libs/Android.build.dlopen_check_order_dlsym.mk
new file mode 100644
index 0000000..73d8c1a
--- /dev/null
+++ b/tests/libs/Android.build.dlopen_check_order_dlsym.mk
@@ -0,0 +1,90 @@
+#
+# Copyright (C) 2012 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# -----------------------------------------------------------------------------
+# Libraries used by dlfcn tests to verify correct load order:
+# libtest_check_order_2_right.so
+# -----------------------------------------------------------------------------
+libtest_check_order_dlsym_2_right_src_files := \
+ dlopen_check_order_dlsym_answer.cpp
+
+libtest_check_order_dlsym_2_right_cflags := -D__ANSWER=42
+module := libtest_check_order_dlsym_2_right
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_a.so
+# -----------------------------------------------------------------------------
+libtest_check_order_dlsym_a_src_files := \
+ dlopen_check_order_dlsym_answer.cpp
+
+libtest_check_order_dlsym_a_cflags := -D__ANSWER=1
+module := libtest_check_order_dlsym_a
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_b.so
+# -----------------------------------------------------------------------------
+libtest_check_order_dlsym_b_src_files := \
+ dlopen_check_order_dlsym_answer.cpp
+
+libtest_check_order_dlsym_b_cflags := -D__ANSWER=2 -D__ANSWER2=43
+module := libtest_check_order_dlsym_b
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_c.so
+# -----------------------------------------------------------------------------
+libtest_check_order_dlsym_3_c_src_files := \
+ dlopen_check_order_dlsym_answer.cpp
+
+libtest_check_order_dlsym_3_c_cflags := -D__ANSWER=3
+module := libtest_check_order_dlsym_3_c
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_d.so
+# -----------------------------------------------------------------------------
+libtest_check_order_dlsym_d_src_files := \
+ dlopen_check_order_dlsym_answer.cpp
+
+libtest_check_order_dlsym_d_shared_libraries := libtest_check_order_dlsym_b
+libtest_check_order_dlsym_d_cflags := -D__ANSWER=4 -D__ANSWER2=4
+module := libtest_check_order_dlsym_d
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_left.so
+# -----------------------------------------------------------------------------
+libtest_check_order_dlsym_1_left_src_files := \
+ empty.cpp
+
+libtest_check_order_dlsym_1_left_shared_libraries := libtest_check_order_dlsym_a libtest_check_order_dlsym_b
+
+module := libtest_check_order_dlsym_1_left
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order.so
+# -----------------------------------------------------------------------------
+libtest_check_order_dlsym_src_files := \
+ empty.cpp
+
+libtest_check_order_dlsym_shared_libraries := libtest_check_order_dlsym_1_left \
+ libtest_check_order_dlsym_2_right libtest_check_order_dlsym_3_c
+
+module := libtest_check_order_dlsym
+include $(LOCAL_PATH)/Android.build.testlib.mk
diff --git a/tests/libs/Android.build.dlopen_check_order_reloc_main_executable.mk b/tests/libs/Android.build.dlopen_check_order_reloc_main_executable.mk
new file mode 100644
index 0000000..639696b
--- /dev/null
+++ b/tests/libs/Android.build.dlopen_check_order_reloc_main_executable.mk
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2012 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# -----------------------------------------------------------------------------
+# Libraries used by dlfcn tests to verify correct relocation order:
+# libtest_check_order_reloc_root*.so
+# -----------------------------------------------------------------------------
+
+
+# -----------------------------------------------------------------------------
+# ..._1.so - empty
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_root_1_src_files := \
+ empty.cpp
+
+
+module := libtest_check_order_reloc_root_1
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+
+# -----------------------------------------------------------------------------
+# ..._2.so - this one has the incorrect answer
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_root_2_src_files := \
+ dlopen_check_order_reloc_root_answer_impl.cpp
+
+libtest_check_order_reloc_root_2_cflags := -D__ANSWER=2
+
+module := libtest_check_order_reloc_root_2
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_reloc_root.so <- implements get_answer3()
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_root_src_files := \
+ dlopen_check_order_reloc_root_answer.cpp
+
+libtest_check_order_reloc_root_shared_libraries := \
+ libtest_check_order_reloc_root_1 \
+ libtest_check_order_reloc_root_2
+
+module := libtest_check_order_reloc_root
+include $(LOCAL_PATH)/Android.build.testlib.mk
diff --git a/tests/libs/Android.build.dlopen_check_order_reloc_siblings.mk b/tests/libs/Android.build.dlopen_check_order_reloc_siblings.mk
new file mode 100644
index 0000000..bd35a51
--- /dev/null
+++ b/tests/libs/Android.build.dlopen_check_order_reloc_siblings.mk
@@ -0,0 +1,158 @@
+#
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# -----------------------------------------------------------------------------
+# Libraries used by dlfcn tests to verify correct relocation order:
+# libtest_check_order_reloc_siblings*.so
+# -----------------------------------------------------------------------------
+
+# -----------------------------------------------------------------------------
+# ..._1.so - empty
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_1_src_files := \
+ empty.cpp
+
+libtest_check_order_reloc_siblings_1_shared_libraries := \
+ libtest_check_order_reloc_siblings_a \
+ libtest_check_order_reloc_siblings_b
+
+module := libtest_check_order_reloc_siblings_1
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+
+# -----------------------------------------------------------------------------
+# ..._2.so - empty
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_2_src_files := \
+ dlopen_check_order_reloc_grandchild_answer.cpp
+
+libtest_check_order_reloc_siblings_2_shared_libraries := \
+ libtest_check_order_reloc_siblings_c \
+ libtest_check_order_reloc_siblings_d
+
+libtest_check_order_reloc_siblings_2_allow_undefined_symbols := true
+module := libtest_check_order_reloc_siblings_2
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# ..._3.so - get_answer2();
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_3_src_files := \
+ dlopen_check_order_reloc_nephew_answer.cpp
+
+libtest_check_order_reloc_siblings_3_shared_libraries := \
+ libtest_check_order_reloc_siblings_e \
+ libtest_check_order_reloc_siblings_f
+
+module := libtest_check_order_reloc_siblings_3
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# ..._a.so <- correct impl
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_a_src_files := \
+ dlopen_check_order_reloc_answer_impl.cpp
+
+libtest_check_order_reloc_siblings_a_cflags := -D__ANSWER=42
+module := libtest_check_order_reloc_siblings_a
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# ..._b.so
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_b_src_files := \
+ dlopen_check_order_reloc_answer_impl.cpp
+
+libtest_check_order_reloc_siblings_b_cflags := -D__ANSWER=1
+module := libtest_check_order_reloc_siblings_b
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# ..._c.so
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_c_src_files := \
+ dlopen_check_order_reloc_answer_impl.cpp
+
+libtest_check_order_reloc_siblings_c_cflags := -D__ANSWER=2
+libtest_check_order_reloc_siblings_c_shared_libraries := \
+ libtest_check_order_reloc_siblings_c_1 \
+ libtest_check_order_reloc_siblings_c_2
+
+module := libtest_check_order_reloc_siblings_c
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# ..._d.so
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_d_src_files := \
+ dlopen_check_order_reloc_answer_impl.cpp
+
+libtest_check_order_reloc_siblings_d_cflags := -D__ANSWER=3
+module := libtest_check_order_reloc_siblings_d
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# ..._e.so
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_e_src_files := \
+ dlopen_check_order_reloc_answer_impl.cpp
+
+libtest_check_order_reloc_siblings_e_cflags := -D__ANSWER=4
+module := libtest_check_order_reloc_siblings_e
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# ..._f.so <- get_answer()
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_f_src_files := \
+ dlopen_check_order_reloc_answer.cpp
+
+module := libtest_check_order_reloc_siblings_f
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# ..._c_1.so
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_c_1_src_files := \
+ dlopen_check_order_reloc_grandchild_answer_impl.cpp
+
+libtest_check_order_reloc_siblings_c_1_cflags := -D__ANSWER=42
+module := libtest_check_order_reloc_siblings_c_1
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# ..._c_2.so
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_c_2_src_files := \
+ dlopen_check_order_reloc_grandchild_answer_impl.cpp
+
+libtest_check_order_reloc_siblings_c_2_cflags := -D__ANSWER=0
+module := libtest_check_order_reloc_siblings_c_2
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_reloc_siblings.so
+# -----------------------------------------------------------------------------
+libtest_check_order_reloc_siblings_src_files := \
+ empty.cpp
+
+libtest_check_order_reloc_siblings_shared_libraries := \
+ libtest_check_order_reloc_siblings_1 \
+ libtest_check_order_reloc_siblings_2 \
+ libtest_check_order_reloc_siblings_3
+
+module := libtest_check_order_reloc_siblings
+include $(LOCAL_PATH)/Android.build.testlib.mk
diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk
index af3e070..fafb9e0 100644
--- a/tests/libs/Android.mk
+++ b/tests/libs/Android.mk
@@ -21,25 +21,41 @@
common_additional_dependencies := \
$(LOCAL_PATH)/Android.mk \
$(LOCAL_PATH)/Android.build.dlext_testzip.mk \
+ $(LOCAL_PATH)/Android.build.dlopen_check_order_dlsym.mk \
+ $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_siblings.mk \
+ $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_main_executable.mk \
$(LOCAL_PATH)/Android.build.testlib.mk \
$(TEST_PATH)/Android.build.mk
# -----------------------------------------------------------------------------
-# Library used by dlfcn tests.
+# Library to test gnu-styled hash
# -----------------------------------------------------------------------------
ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64))
-no-elf-hash-table-library_src_files := \
- empty.cpp \
+libgnu-hash-table-library_src_files := \
+ dlext_test_library.cpp \
-no-elf-hash-table-library_ldflags := \
+libgnu-hash-table-library_ldflags := \
-Wl,--hash-style=gnu \
-module := no-elf-hash-table-library
+module := libgnu-hash-table-library
module_tag := optional
include $(LOCAL_PATH)/Android.build.testlib.mk
endif
# -----------------------------------------------------------------------------
+# Library to test sysv-styled hash
+# -----------------------------------------------------------------------------
+libsysv-hash-table-library_src_files := \
+ dlext_test_library.cpp \
+
+libsysv-hash-table-library_ldflags := \
+ -Wl,--hash-style=sysv \
+
+module := libsysv-hash-table-library
+module_tag := optional
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
# Library used by dlext tests - with GNU RELRO program header
# -----------------------------------------------------------------------------
libdlext_test_src_files := \
@@ -121,79 +137,48 @@
include $(LOCAL_PATH)/Android.build.testlib.mk
# -----------------------------------------------------------------------------
-# Libraries used by dlfcn tests to verify correct load order:
-# libtest_check_order_2_right.so
+# Library used by dlfcn nodelete tests
# -----------------------------------------------------------------------------
-libtest_check_order_2_right_src_files := \
- dlopen_testlib_answer.cpp
+libtest_nodelete_1_src_files := \
+ dlopen_nodelete_1.cpp
-libtest_check_order_2_right_cflags := -D__ANSWER=42
-module := libtest_check_order_2_right
+module := libtest_nodelete_1
include $(LOCAL_PATH)/Android.build.testlib.mk
# -----------------------------------------------------------------------------
-# libtest_check_order_a.so
+# Library used by dlfcn nodelete tests
# -----------------------------------------------------------------------------
-libtest_check_order_a_src_files := \
- dlopen_testlib_answer.cpp
+libtest_nodelete_2_src_files := \
+ dlopen_nodelete_2.cpp
-libtest_check_order_a_cflags := -D__ANSWER=1
-module := libtest_check_order_a
+module := libtest_nodelete_2
include $(LOCAL_PATH)/Android.build.testlib.mk
# -----------------------------------------------------------------------------
-# libtest_check_order_b.so
+# Library used by dlfcn nodelete tests
# -----------------------------------------------------------------------------
-libtest_check_order_b_src_files := \
- dlopen_testlib_answer.cpp
+libtest_nodelete_dt_flags_1_src_files := \
+ dlopen_nodelete_dt_flags_1.cpp
-libtest_check_order_b_cflags := -D__ANSWER=2 -D__ANSWER2=43
-module := libtest_check_order_b
+libtest_nodelete_dt_flags_1_ldflags := -Wl,-z,nodelete
+
+module := libtest_nodelete_dt_flags_1
include $(LOCAL_PATH)/Android.build.testlib.mk
# -----------------------------------------------------------------------------
-# libtest_check_order_c.so
+# Build libtest_check_order_dlsym.so with its dependencies.
# -----------------------------------------------------------------------------
-libtest_check_order_3_c_src_files := \
- dlopen_testlib_answer.cpp
-
-libtest_check_order_3_c_cflags := -D__ANSWER=3
-module := libtest_check_order_3_c
-include $(LOCAL_PATH)/Android.build.testlib.mk
+include $(LOCAL_PATH)/Android.build.dlopen_check_order_dlsym.mk
# -----------------------------------------------------------------------------
-# libtest_check_order_d.so
+# Build libtest_check_order_siblings.so with its dependencies.
# -----------------------------------------------------------------------------
-libtest_check_order_d_src_files := \
- dlopen_testlib_answer.cpp
-
-libtest_check_order_d_shared_libraries := libtest_check_order_b
-libtest_check_order_d_cflags := -D__ANSWER=4 -D__ANSWER2=4
-module := libtest_check_order_d
-include $(LOCAL_PATH)/Android.build.testlib.mk
+include $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_siblings.mk
# -----------------------------------------------------------------------------
-# libtest_check_order_left.so
+# Build libtest_check_order_root.so with its dependencies.
# -----------------------------------------------------------------------------
-libtest_check_order_1_left_src_files := \
- empty.cpp
-
-libtest_check_order_1_left_shared_libraries := libtest_check_order_a libtest_check_order_b
-
-module := libtest_check_order_1_left
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# libtest_check_order.so
-# -----------------------------------------------------------------------------
-libtest_check_order_src_files := \
- empty.cpp
-
-libtest_check_order_shared_libraries := libtest_check_order_1_left \
- libtest_check_order_2_right libtest_check_order_3_c
-
-module := libtest_check_order
-include $(LOCAL_PATH)/Android.build.testlib.mk
+include $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_main_executable.mk
# -----------------------------------------------------------------------------
# Library with dependency loop used by dlfcn tests
@@ -295,7 +280,7 @@
build_type := host
include $(TEST_PATH)/Android.build.mk
-ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
+ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm64 x86 x86_64))
ifeq ($(TARGET_ARCH),arm64)
libtest_ifunc_multilib := 64
# TODO: This is a workaround - remove it once gcc
@@ -304,6 +289,7 @@
endif
build_type := target
+ libtest_ifunc_clang_target := false
include $(TEST_PATH)/Android.build.mk
endif
@@ -318,6 +304,47 @@
include $(LOCAL_PATH)/Android.build.testlib.mk
# -----------------------------------------------------------------------------
+# This library is used by dl_load test to check symbol preempting
+# by main executable
+# -----------------------------------------------------------------------------
+libdl_preempt_test_1_src_files := dl_preempt_library_1.cpp
+
+module := libdl_preempt_test_1
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# This library is used by dl_load test to check symbol preempting
+# by libdl_preempt_test_1.so
+# -----------------------------------------------------------------------------
+libdl_preempt_test_2_src_files := dl_preempt_library_2.cpp
+
+module := libdl_preempt_test_2
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# Library with DF_1_GLOBAL
+# -----------------------------------------------------------------------------
+libdl_test_df_1_global_src_files := dl_df_1_global.cpp
+libdl_test_df_1_global_ldflags := -fuse-ld=bfd -Wl,-z,global
+module := libdl_test_df_1_global
+# TODO: re-enable arm once b/18137520 or b/18130452 are fixed
+ifeq ($(filter $(TARGET_ARCH),arm arm64),)
+include $(LOCAL_PATH)/Android.build.testlib.mk
+else
+# build it for host only
+build_target := SHARED_LIBRARY
+build_type := host
+include $(TEST_PATH)/Android.build.mk
+endif
+
+# -----------------------------------------------------------------------------
+# Library using symbol from libdl_test_df_1_global
+# -----------------------------------------------------------------------------
+libtest_dlsym_df_1_global_src_files := dl_df_1_use_global.cpp
+module := libtest_dlsym_df_1_global
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
# Library with weak function
# -----------------------------------------------------------------------------
libtest_dlsym_weak_func_src_files := \
diff --git a/tests/libs/atexit_testlib.cpp b/tests/libs/atexit_testlib.cpp
index d35f57b..314e8de 100644
--- a/tests/libs/atexit_testlib.cpp
+++ b/tests/libs/atexit_testlib.cpp
@@ -19,12 +19,19 @@
#include <string>
// use external control number from main test
-static std::string* atexit_sequence = NULL;
-static bool* atexit_valid_this_in_static_dtor = NULL;
+static std::string* atexit_sequence = nullptr;
+static bool* atexit_valid_this_in_static_dtor = nullptr;
+static bool* atexit_attr_dtor_called = nullptr;
+
+static int cxx_ctor_called = 0;
+static int attr_ctor_called = 0;
static class AtExitStaticClass {
public:
- AtExitStaticClass() { expected_this = this; }
+ AtExitStaticClass() {
+ expected_this = this;
+ cxx_ctor_called = 1;
+ }
~AtExitStaticClass() {
if (atexit_valid_this_in_static_dtor) {
*atexit_valid_this_in_static_dtor = (expected_this == this);
@@ -35,7 +42,7 @@
} static_obj;
-const AtExitStaticClass* AtExitStaticClass::expected_this = NULL;
+const AtExitStaticClass* AtExitStaticClass::expected_this = nullptr;
// 4
static void atexit_handler_from_atexit_from_atexit2() {
@@ -66,10 +73,30 @@
*atexit_sequence += " a wall";
}
-extern "C" void register_atexit(std::string* sequence, bool* valid_this_in_static_dtor) {
+// attribute c-tor and d-tor
+static void __attribute__((constructor)) atexit_attr_ctor() {
+ attr_ctor_called = 1;
+}
+
+static void __attribute__((destructor)) atexit_attr_dtor() {
+ if (atexit_attr_dtor_called) {
+ *atexit_attr_dtor_called = true;
+ }
+}
+
+extern "C" void register_atexit(std::string* sequence, bool* valid_this_in_static_dtor, bool* attr_dtor_called) {
atexit_sequence = sequence;
atexit_valid_this_in_static_dtor = valid_this_in_static_dtor;
+ atexit_attr_dtor_called = attr_dtor_called;
atexit(atexit_handler_regular);
atexit(atexit_handler_with_atexit);
}
+extern "C" int get_cxx_ctor_called() {
+ return cxx_ctor_called;
+}
+
+extern "C" int get_attr_ctor_called() {
+ return attr_ctor_called;
+}
+
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dl_df_1_global.cpp
similarity index 80%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dl_df_1_global.cpp
index a4d7504..39856fd 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dl_df_1_global.cpp
@@ -14,12 +14,6 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
+extern "C" int dl_df_1_global_get_answer_impl() {
+ return 42;
}
-
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
-}
-#endif
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dl_df_1_use_global.cpp
similarity index 78%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dl_df_1_use_global.cpp
index a4d7504..e14910d 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dl_df_1_use_global.cpp
@@ -14,12 +14,10 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
+extern "C" int __attribute__((weak)) dl_df_1_global_get_answer_impl() {
+ return 0;
}
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
+extern "C" int dl_df_1_global_get_answer() {
+ return dl_df_1_global_get_answer_impl();
}
-#endif
diff --git a/tests/libs/dl_preempt_library_1.cpp b/tests/libs/dl_preempt_library_1.cpp
new file mode 100644
index 0000000..b4d81d5
--- /dev/null
+++ b/tests/libs/dl_preempt_library_1.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// This one should be preempted by the function
+// defined in the main executable.
+extern "C" int __attribute__((weak)) main_global_default_serial() {
+ return 2716057;
+}
+
+// Even though this one is defined by the main
+// executable it should not be preempted
+// because of protected visibility
+extern "C" int __attribute__((weak, visibility("protected"))) main_global_protected_serial() {
+ return 3370318;
+}
+
+extern "C" int main_global_default_get_serial() {
+ return main_global_default_serial();
+}
+
+extern "C" int main_global_protected_get_serial() {
+ return main_global_protected_serial();
+}
+
+// Trying to preempt functions from a DT_NEEDED .so
+extern "C" int lib_global_default_serial() {
+ return 3370318;
+}
+
+extern "C" int lib_global_protected_serial() {
+ return 2716057;
+}
diff --git a/tests/libs/dl_preempt_library_2.cpp b/tests/libs/dl_preempt_library_2.cpp
new file mode 100644
index 0000000..8df9a16
--- /dev/null
+++ b/tests/libs/dl_preempt_library_2.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// This one should be preempted by the function
+// defined in libdl_preempt_test_1.so
+extern "C" int __attribute__((weak)) lib_global_default_serial() {
+ return 2716057;
+}
+
+// Even though this one is defined by
+// libdl_preempt_test_1.so it should not be
+// preempted because of protected visibility
+extern "C" int __attribute__((weak,visibility("protected"))) lib_global_protected_serial() {
+ return 3370318;
+}
+
+extern "C" int lib_global_default_get_serial() {
+ return lib_global_default_serial();
+}
+
+extern "C" int lib_global_protected_get_serial() {
+ return lib_global_protected_serial();
+}
+
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_check_order_dlsym_answer.cpp
similarity index 87%
rename from tests/libs/dlopen_testlib_answer.cpp
rename to tests/libs/dlopen_check_order_dlsym_answer.cpp
index a4d7504..2ae6cf7 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_check_order_dlsym_answer.cpp
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
+extern "C" int check_order_dlsym_get_answer() {
return __ANSWER;
}
#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
+extern "C" int check_order_dlsym_get_answer2() {
return __ANSWER2;
}
#endif
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_check_order_reloc_answer.cpp
similarity index 77%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dlopen_check_order_reloc_answer.cpp
index a4d7504..036670b 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_check_order_reloc_answer.cpp
@@ -14,12 +14,10 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
+extern "C" int __attribute__((weak)) check_order_reloc_get_answer_impl() {
+ return 0;
}
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
+extern "C" int check_order_reloc_get_answer() {
+ return check_order_reloc_get_answer_impl();
}
-#endif
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_check_order_reloc_answer_impl.cpp
similarity index 82%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dlopen_check_order_reloc_answer_impl.cpp
index a4d7504..324b905 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_check_order_reloc_answer_impl.cpp
@@ -14,12 +14,6 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
+extern "C" int check_order_reloc_get_answer_impl() {
return __ANSWER;
}
-
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
-}
-#endif
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_check_order_reloc_grandchild_answer.cpp
similarity index 77%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dlopen_check_order_reloc_grandchild_answer.cpp
index a4d7504..afb5f2c 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_check_order_reloc_grandchild_answer.cpp
@@ -14,12 +14,9 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
+extern "C" int check_order_reloc_grandchild_get_answer_impl();
+
+extern "C" int check_order_reloc_grandchild_get_answer() {
+ return check_order_reloc_grandchild_get_answer_impl();
}
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
-}
-#endif
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_check_order_reloc_grandchild_answer_impl.cpp
similarity index 82%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dlopen_check_order_reloc_grandchild_answer_impl.cpp
index a4d7504..32d2b24 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_check_order_reloc_grandchild_answer_impl.cpp
@@ -14,12 +14,6 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
+extern "C" int check_order_reloc_grandchild_get_answer_impl() {
return __ANSWER;
}
-
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
-}
-#endif
diff --git a/tests/libs/dlopen_check_order_reloc_nephew_answer.cpp b/tests/libs/dlopen_check_order_reloc_nephew_answer.cpp
new file mode 100644
index 0000000..d6d1f09
--- /dev/null
+++ b/tests/libs/dlopen_check_order_reloc_nephew_answer.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+extern "C" int check_order_reloc_get_answer_impl();
+
+extern "C" int check_order_reloc_nephew_get_answer() {
+ return check_order_reloc_get_answer_impl();
+}
+
+namespace {
+// The d-tor for this class is called on dlclose() -> __on_dlclose() -> __cxa_finalize()
+// We use it to detect calls to prematurely unmapped libraries during dlclose.
+// See also b/18338888
+class CallNephewInDtor {
+ public:
+ ~CallNephewInDtor() {
+ check_order_reloc_get_answer_impl();
+ }
+} instance;
+};
+
+extern "C" void* get_instance() {
+ return &instance;
+}
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_check_order_reloc_root_answer.cpp
similarity index 79%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dlopen_check_order_reloc_root_answer.cpp
index a4d7504..b21abd7 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_check_order_reloc_root_answer.cpp
@@ -14,12 +14,8 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
-}
+extern "C" int check_order_reloc_root_get_answer_impl();
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
+extern "C" int check_order_reloc_root_get_answer() {
+ return check_order_reloc_root_get_answer_impl();
}
-#endif
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_check_order_reloc_root_answer_impl.cpp
similarity index 82%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dlopen_check_order_reloc_root_answer_impl.cpp
index a4d7504..25fb9ac 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_check_order_reloc_root_answer_impl.cpp
@@ -14,12 +14,6 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
+extern "C" int check_order_reloc_root_get_answer_impl() {
return __ANSWER;
}
-
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
-}
-#endif
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_nodelete_1.cpp
similarity index 64%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dlopen_nodelete_1.cpp
index a4d7504..9438978 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_nodelete_1.cpp
@@ -14,12 +14,18 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
+#include <stdint.h>
+#include <stdlib.h>
+
+uint32_t dlopen_nodelete_1_taxicab_number = 1729;
+static bool* unload_flag_ptr = nullptr;
+
+extern "C" void dlopen_nodelete_1_set_unload_flag_ptr(bool* ptr) {
+ unload_flag_ptr = ptr;
}
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
+static void __attribute__((destructor)) unload_guard() {
+ if (unload_flag_ptr != nullptr) {
+ *unload_flag_ptr = true;
+ }
}
-#endif
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_nodelete_2.cpp
similarity index 64%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dlopen_nodelete_2.cpp
index a4d7504..b5ab5c1 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_nodelete_2.cpp
@@ -14,12 +14,18 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
+#include <stdint.h>
+#include <stdlib.h>
+
+uint32_t dlopen_nodelete_2_taxicab_number = 1729;
+static bool* unload_flag_ptr = nullptr;
+
+extern "C" void dlopen_nodelete_2_set_unload_flag_ptr(bool* ptr) {
+ unload_flag_ptr = ptr;
}
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
+static void __attribute__((destructor)) unload_guard() {
+ if (unload_flag_ptr != nullptr) {
+ *unload_flag_ptr = true;
+ }
}
-#endif
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/libs/dlopen_nodelete_dt_flags_1.cpp
similarity index 66%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/libs/dlopen_nodelete_dt_flags_1.cpp
index a4d7504..39c0a7e 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/libs/dlopen_nodelete_dt_flags_1.cpp
@@ -14,12 +14,17 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
+#include <stdint.h>
+#include <stdlib.h>
+
+static bool* unload_flag_ptr = nullptr;
+
+extern "C" void dlopen_nodelete_dt_flags_1_set_unload_flag_ptr(bool* ptr) {
+ unload_flag_ptr = ptr;
}
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
+static void __attribute__((destructor)) unload_guard() {
+ if (unload_flag_ptr != nullptr) {
+ *unload_flag_ptr = true;
+ }
}
-#endif
diff --git a/tests/libs/dlopen_testlib_simple.cpp b/tests/libs/dlopen_testlib_simple.cpp
index bf750b2..3226955 100644
--- a/tests/libs/dlopen_testlib_simple.cpp
+++ b/tests/libs/dlopen_testlib_simple.cpp
@@ -19,6 +19,6 @@
uint32_t dlopen_testlib_taxicab_number = 1729;
-bool dlopen_testlib_simple_func() {
+extern "C" bool dlopen_testlib_simple_func() {
return true;
}
diff --git a/tests/locale_test.cpp b/tests/locale_test.cpp
index 7ec607a..f308af5 100644
--- a/tests/locale_test.cpp
+++ b/tests/locale_test.cpp
@@ -71,20 +71,30 @@
EXPECT_EQ(ENOENT, errno); // POSIX specified, not an implementation detail!
}
-TEST(locale, newlocale) {
+TEST(locale, newlocale_invalid_category_mask) {
errno = 0;
EXPECT_EQ(0, newlocale(1 << 20, "C", 0));
EXPECT_EQ(EINVAL, errno);
+}
- locale_t l = newlocale(LC_ALL, "C", 0);
- ASSERT_TRUE(l != NULL);
- freelocale(l);
+TEST(locale, newlocale_NULL_locale_name) {
+ errno = 0;
+ EXPECT_EQ(0, newlocale(LC_ALL, NULL, 0));
+ EXPECT_EQ(EINVAL, errno);
+}
+TEST(locale, newlocale_bad_locale_name) {
errno = 0;
EXPECT_EQ(0, newlocale(LC_ALL, "this-is-not-a-locale", 0));
EXPECT_EQ(ENOENT, errno); // POSIX specified, not an implementation detail!
}
+TEST(locale, newlocale) {
+ locale_t l = newlocale(LC_ALL, "C", 0);
+ ASSERT_TRUE(l != NULL);
+ freelocale(l);
+}
+
TEST(locale, duplocale) {
locale_t cloned_global = duplocale(LC_GLOBAL_LOCALE);
ASSERT_TRUE(cloned_global != NULL);
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index 6b7a28b..b76625a 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -22,6 +22,8 @@
#include <malloc.h>
#include <unistd.h>
+#include <tinyxml2.h>
+
#include "private/bionic_config.h"
TEST(malloc, malloc_std) {
@@ -322,3 +324,51 @@
ASSERT_EQ(NULL, valloc(SIZE_MAX));
}
#endif
+
+TEST(malloc, malloc_info) {
+#ifdef __BIONIC__
+ char* buf;
+ size_t bufsize;
+ FILE* memstream = open_memstream(&buf, &bufsize);
+ ASSERT_NE(nullptr, memstream);
+ ASSERT_EQ(0, malloc_info(0, memstream));
+ ASSERT_EQ(0, fclose(memstream));
+
+ tinyxml2::XMLDocument doc;
+ ASSERT_EQ(tinyxml2::XML_SUCCESS, doc.Parse(buf));
+
+ auto root = doc.FirstChildElement();
+ ASSERT_NE(nullptr, root);
+ ASSERT_STREQ("malloc", root->Name());
+ ASSERT_STREQ("jemalloc-1", root->Attribute("version"));
+
+ auto arena = root->FirstChildElement();
+ for (; arena != nullptr; arena = arena->NextSiblingElement()) {
+ int val;
+
+ ASSERT_STREQ("heap", arena->Name());
+ ASSERT_EQ(tinyxml2::XML_SUCCESS, arena->QueryIntAttribute("nr", &val));
+ ASSERT_EQ(tinyxml2::XML_SUCCESS,
+ arena->FirstChildElement("allocated-large")->QueryIntText(&val));
+ ASSERT_EQ(tinyxml2::XML_SUCCESS,
+ arena->FirstChildElement("allocated-huge")->QueryIntText(&val));
+ ASSERT_EQ(tinyxml2::XML_SUCCESS,
+ arena->FirstChildElement("allocated-bins")->QueryIntText(&val));
+ ASSERT_EQ(tinyxml2::XML_SUCCESS,
+ arena->FirstChildElement("bins-total")->QueryIntText(&val));
+
+ auto bin = arena->FirstChildElement("bin");
+ for (; bin != nullptr; bin = bin ->NextSiblingElement()) {
+ if (strcmp(bin->Name(), "bin") == 0) {
+ ASSERT_EQ(tinyxml2::XML_SUCCESS, bin->QueryIntAttribute("nr", &val));
+ ASSERT_EQ(tinyxml2::XML_SUCCESS,
+ bin->FirstChildElement("allocated")->QueryIntText(&val));
+ ASSERT_EQ(tinyxml2::XML_SUCCESS,
+ bin->FirstChildElement("nmalloc")->QueryIntText(&val));
+ ASSERT_EQ(tinyxml2::XML_SUCCESS,
+ bin->FirstChildElement("ndalloc")->QueryIntText(&val));
+ }
+ }
+ }
+#endif
+}
diff --git a/tests/math_cos_test.cpp b/tests/math_cos_intel_data.h
similarity index 99%
rename from tests/math_cos_test.cpp
rename to tests/math_cos_intel_data.h
index c0a2d82..22ec0bc 100644
--- a/tests/math_cos_test.cpp
+++ b/tests/math_cos_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- double expected;
- double call_data;
-} cos_intel_data_t;
-
-static cos_intel_data_t g_cos_intel_data[] = {
+static data_1_1_t<double, double> g_cos_intel_data[] = {
{ // Entry 0
0x1.c1a27ae836f128000000000000504e9bp-1,
0x1.feb1f7920e248p-2
@@ -5630,14 +5620,3 @@
-0.0
},
};
-#endif // __BIONIC__
-
-TEST(math_cos, cos_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_cos_intel_data)/sizeof(cos_intel_data_t); i++) {
- EXPECT_DOUBLE_EQ(g_cos_intel_data[i].expected, cos(g_cos_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_cosf_test.cpp b/tests/math_cosf_intel_data.h
similarity index 98%
rename from tests/math_cosf_test.cpp
rename to tests/math_cosf_intel_data.h
index ea95ff3..d606021 100644
--- a/tests/math_cosf_test.cpp
+++ b/tests/math_cosf_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- float expected;
- float call_data;
-} cosf_intel_data_t;
-
-static cosf_intel_data_t g_cosf_intel_data[] = {
+static data_1_1_t<float, float> g_cosf_intel_data[] = {
{ // Entry 0
0x1.bc7b66ffb7689d646dd1af83e9661d2dp-1,
-0x1.09ebacp-1
@@ -4342,14 +4332,3 @@
-0.0f
},
};
-#endif // __BIONIC__
-
-TEST(math_cosf, cosf_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_cosf_intel_data)/sizeof(cosf_intel_data_t); i++) {
- EXPECT_FLOAT_EQ(g_cosf_intel_data[i].expected, cosf(g_cosf_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_data_test.h b/tests/math_data_test.h
new file mode 100644
index 0000000..f3d25ef
--- /dev/null
+++ b/tests/math_data_test.h
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+
+#include <fenv.h>
+
+template <typename RT, typename T1>
+struct data_1_1_t {
+ RT expected;
+ T1 input;
+};
+
+template <typename RT, typename T1, typename T2>
+struct data_1_2_t {
+ RT expected;
+ T1 input1;
+ T2 input2;
+};
+
+template <typename RT1, typename RT2, typename T>
+struct data_2_1_t {
+ RT1 expected1;
+ RT2 expected2;
+ T input;
+};
+
+template <typename T> union fp_u;
+
+template <> union fp_u<float> {
+ float value;
+ struct {
+ unsigned frac:23;
+ unsigned exp:8;
+ unsigned sign:1;
+ } bits;
+ uint32_t sign_magnitude;
+};
+
+template <> union fp_u<double> {
+ double value;
+ struct {
+ unsigned fracl;
+ unsigned frach:20;
+ unsigned exp:11;
+ unsigned sign:1;
+ } bits;
+ uint64_t sign_magnitude;
+};
+
+// TODO: long double.
+
+template <typename T>
+static inline auto SignAndMagnitudeToBiased(const T& value) -> decltype(fp_u<T>::sign_magnitude) {
+ fp_u<T> u;
+ u.value = value;
+ if (u.bits.sign) {
+ return ~u.sign_magnitude + 1;
+ } else {
+ u.bits.sign = 1;
+ return u.sign_magnitude;
+ }
+}
+
+// Based on the existing googletest implementation, which uses a fixed 4 ulp bound.
+template <typename T>
+size_t UlpDistance(T lhs, T rhs) {
+ const auto biased1 = SignAndMagnitudeToBiased(lhs);
+ const auto biased2 = SignAndMagnitudeToBiased(rhs);
+ return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
+}
+
+template <size_t ULP, typename T>
+struct FpUlpEq {
+ ::testing::AssertionResult operator()(const char* /* expected_expression */,
+ const char* /* actual_expression */,
+ T expected,
+ T actual) {
+ if (!isnan(expected) && !isnan(actual) && UlpDistance(expected, actual) <= ULP) {
+ return ::testing::AssertionSuccess();
+ }
+
+ // Output the actual and expected values as hex floating point.
+ char expected_str[64];
+ char actual_str[64];
+ snprintf(expected_str, sizeof(expected_str), "%a", expected);
+ snprintf(actual_str, sizeof(actual_str), "%a", actual);
+
+ return ::testing::AssertionFailure()
+ << "expected (" << expected_str << ") != actual (" << actual_str << ")";
+ }
+};
+
+// Runs through the array 'data' applying 'f' to each of the input values
+// and asserting that the result is within ULP ulps of the expected value.
+// For testing a (double) -> double function like sin(3).
+template <size_t ULP, typename RT, typename T, size_t N>
+void DoMathDataTest(data_1_1_t<RT, T> (&data)[N], RT f(T)) {
+ fesetenv(FE_DFL_ENV);
+ FpUlpEq<ULP, RT> predicate;
+ for (size_t i = 0; i < N; ++i) {
+ EXPECT_PRED_FORMAT2(predicate,
+ data[i].expected, f(data[i].input)) << "Failed on element " << i;
+ }
+}
+
+// Runs through the array 'data' applying 'f' to each of the pairs of input values
+// and asserting that the result is within ULP ulps of the expected value.
+// For testing a (double, double) -> double function like pow(3).
+template <size_t ULP, typename RT, typename T1, typename T2, size_t N>
+void DoMathDataTest(data_1_2_t<RT, T1, T2> (&data)[N], RT f(T1, T2)) {
+ fesetenv(FE_DFL_ENV);
+ FpUlpEq<ULP, RT> predicate;
+ for (size_t i = 0; i < N; ++i) {
+ EXPECT_PRED_FORMAT2(predicate,
+ data[i].expected, f(data[i].input1, data[i].input2)) << "Failed on element " << i;
+ }
+}
+
+// Runs through the array 'data' applying 'f' to each of the input values
+// and asserting that the results are within ULP ulps of the expected values.
+// For testing a (double, double*, double*) -> void function like sincos(3).
+template <size_t ULP, typename RT1, typename RT2, typename T1, size_t N>
+void DoMathDataTest(data_2_1_t<RT1, RT2, T1> (&data)[N], void f(T1, RT1*, RT2*)) {
+ fesetenv(FE_DFL_ENV);
+ FpUlpEq<ULP, RT1> predicate1;
+ FpUlpEq<ULP, RT2> predicate2;
+ for (size_t i = 0; i < N; ++i) {
+ RT1 out1;
+ RT2 out2;
+ f(data[i].input, &out1, &out2);
+ EXPECT_PRED_FORMAT2(predicate1, data[i].expected1, out1) << "Failed on element " << i;
+ EXPECT_PRED_FORMAT2(predicate2, data[i].expected2, out2) << "Failed on element " << i;
+ }
+}
diff --git a/tests/math_exp_test.cpp b/tests/math_exp_intel_data.h
similarity index 98%
rename from tests/math_exp_test.cpp
rename to tests/math_exp_intel_data.h
index beb2584..0ca3813 100644
--- a/tests/math_exp_test.cpp
+++ b/tests/math_exp_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- double expected;
- double call_data;
-} exp_intel_data_t;
-
-static exp_intel_data_t g_exp_intel_data[] = {
+static data_1_1_t<double, double> g_exp_intel_data[] = {
{ // Entry 0
0x1.0000000000001fffffffffffffffffffp0,
0x1.ffffffffffffep-52
@@ -1962,14 +1952,3 @@
-0x1.6232bdd7abcd3p9
},
};
-#endif // __BIONIC__
-
-TEST(math_exp, exp_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_exp_intel_data)/sizeof(exp_intel_data_t); i++) {
- EXPECT_DOUBLE_EQ(g_exp_intel_data[i].expected, exp(g_exp_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_expf_test.cpp b/tests/math_expf_intel_data.h
similarity index 97%
rename from tests/math_expf_test.cpp
rename to tests/math_expf_intel_data.h
index 257aa26..7007458 100644
--- a/tests/math_expf_test.cpp
+++ b/tests/math_expf_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- float expected;
- float call_data;
-} expf_intel_data_t;
-
-static expf_intel_data_t g_expf_intel_data[] = {
+static data_1_1_t<float, float> g_expf_intel_data[] = {
{ // Entry 0
0x1.e0fabf081222780d74c00fda30aa3943p-1,
-0x1.000006p-4
@@ -1426,14 +1416,3 @@
-0x1.5d58a0p6
},
};
-#endif // __BIONIC__
-
-TEST(math_expf, expf_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_expf_intel_data)/sizeof(expf_intel_data_t); i++) {
- EXPECT_FLOAT_EQ(g_expf_intel_data[i].expected, expf(g_expf_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_log_test.cpp b/tests/math_log_intel_data.h
similarity index 98%
rename from tests/math_log_test.cpp
rename to tests/math_log_intel_data.h
index da2a848..95ae60e 100644
--- a/tests/math_log_test.cpp
+++ b/tests/math_log_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- double expected;
- double call_data;
-} log_intel_data_t;
-
-static log_intel_data_t g_log_intel_data[] = {
+static data_1_1_t<double, double> g_log_intel_data[] = {
{ // Entry 0
0x1.d77fd13d27ffefffffffffffb5ed9843p-11,
0x1.003af6c37c1d3p0
@@ -1662,14 +1652,3 @@
-0.0
},
};
-#endif // __BIONIC__
-
-TEST(math_log, log_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_log_intel_data)/sizeof(log_intel_data_t); i++) {
- EXPECT_DOUBLE_EQ(g_log_intel_data[i].expected, log(g_log_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_logf_test.cpp b/tests/math_logf_intel_data.h
similarity index 97%
rename from tests/math_logf_test.cpp
rename to tests/math_logf_intel_data.h
index e5d0921..b69776c 100644
--- a/tests/math_logf_test.cpp
+++ b/tests/math_logf_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- float expected;
- float call_data;
-} logf_intel_data_t;
-
-static logf_intel_data_t g_logf_intel_data[] = {
+static data_1_1_t<float, float> g_logf_intel_data[] = {
{ // Entry 0
-0x1.bb9d3aeb8c87b02d7763eba8b48a102dp1,
0x1.000002p-5
@@ -1314,14 +1304,3 @@
-0.0f
},
};
-#endif // __BIONIC__
-
-TEST(math_logf, logf_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_logf_intel_data)/sizeof(logf_intel_data_t); i++) {
- EXPECT_FLOAT_EQ(g_logf_intel_data[i].expected, logf(g_logf_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_pow_test.cpp b/tests/math_pow_intel_data.h
similarity index 98%
rename from tests/math_pow_test.cpp
rename to tests/math_pow_intel_data.h
index c185424..ac9f5af 100644
--- a/tests/math_pow_test.cpp
+++ b/tests/math_pow_intel_data.h
@@ -14,18 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- double expected;
- double x_call_data;
- double y_call_data;
-} pow_intel_data_t;
-
-static pow_intel_data_t g_pow_intel_data[] = {
+static data_1_2_t<double, double, double> g_pow_intel_data[] = {
{ // Entry 0
0x1.p0,
-0x1.0p-10, 0.0
@@ -3287,14 +3276,3 @@
0x1.4p3, 0x1.4p3
},
};
-#endif // __BIONIC__
-
-TEST(math_pow, pow_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_pow_intel_data)/sizeof(pow_intel_data_t); i++) {
- EXPECT_DOUBLE_EQ(g_pow_intel_data[i].expected, pow(g_pow_intel_data[i].x_call_data, g_pow_intel_data[i].y_call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_powf_test.cpp b/tests/math_powf_intel_data.h
similarity index 98%
rename from tests/math_powf_test.cpp
rename to tests/math_powf_intel_data.h
index f77b23a..3a1765b 100644
--- a/tests/math_powf_test.cpp
+++ b/tests/math_powf_intel_data.h
@@ -14,18 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- float expected;
- float x_call_data;
- float y_call_data;
-} powf_intel_data_t;
-
-static powf_intel_data_t g_powf_intel_data[] = {
+static data_1_2_t<float, float, float> g_powf_intel_data[] = {
{ // Entry 0
HUGE_VALF,
-0.0, -0x1.000002p-1
@@ -2775,14 +2764,3 @@
0x1.40p3, 0x1.40p3
},
};
-#endif // __BIONIC__
-
-TEST(math_powf, powf_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_powf_intel_data)/sizeof(powf_intel_data_t); i++) {
- EXPECT_FLOAT_EQ(g_powf_intel_data[i].expected, powf(g_powf_intel_data[i].x_call_data, g_powf_intel_data[i].y_call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_sin_test.cpp b/tests/math_sin_intel_data.h
similarity index 99%
rename from tests/math_sin_test.cpp
rename to tests/math_sin_intel_data.h
index ffa4340..c341cfe 100644
--- a/tests/math_sin_test.cpp
+++ b/tests/math_sin_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- double expected;
- double call_data;
-} sin_intel_data_t;
-
-static sin_intel_data_t g_sin_intel_data[] = {
+static data_1_1_t<double, double> g_sin_intel_data[] = {
{ // Entry 0
0x1.9259e3708bd39ffffffffffffff1bdbep-5,
0x1.9283586503fe0p-5
@@ -5782,14 +5772,3 @@
-0.0
},
};
-#endif // __BIONIC__
-
-TEST(math_sin, sin_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_sin_intel_data)/sizeof(sin_intel_data_t); i++) {
- EXPECT_DOUBLE_EQ(g_sin_intel_data[i].expected, sin(g_sin_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_sincos_test.cpp b/tests/math_sincos_intel_data.h
similarity index 98%
rename from tests/math_sincos_test.cpp
rename to tests/math_sincos_intel_data.h
index 0fab2c2..71ba6b1 100644
--- a/tests/math_sincos_test.cpp
+++ b/tests/math_sincos_intel_data.h
@@ -14,18 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- double sin_expected;
- double cos_expected;
- double call_data;
-} sincos_intel_data_t;
-
-static sincos_intel_data_t g_sincos_intel_data[] = {
+static data_2_1_t<double, double, double> g_sincos_intel_data[] = {
{ // Entry 0
-0x1.ce9a94ea9c2ad95597b1193b2300d19ap-1,
-0x1.b6d3057776dc38335b16745f2d756ab6p-2,
@@ -4772,17 +4761,3 @@
-0.0,
},
};
-#endif // __BIONIC__
-
-TEST(math_sincos, sincos_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_sincos_intel_data)/sizeof(sincos_intel_data_t); i++) {
- double dsin, dcos;
- sincos(g_sincos_intel_data[i].call_data, &dsin, &dcos);
- EXPECT_DOUBLE_EQ(g_sincos_intel_data[i].sin_expected, dsin) << "Failed on element " << i;
- EXPECT_DOUBLE_EQ(g_sincos_intel_data[i].cos_expected, dcos) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_sincosf_test.cpp b/tests/math_sincosf_intel_data.h
similarity index 98%
rename from tests/math_sincosf_test.cpp
rename to tests/math_sincosf_intel_data.h
index c1a32c9..5b1b535 100644
--- a/tests/math_sincosf_test.cpp
+++ b/tests/math_sincosf_intel_data.h
@@ -14,18 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- float sin_expected;
- float cos_expected;
- float call_data;
-} sincosf_intel_data_t;
-
-static sincosf_intel_data_t g_sincosf_intel_data[] = {
+static data_2_1_t<float, float, float> g_sincosf_intel_data[] = {
{ // Entry 0
-0x1.b6a7abffaf59a5ac181e3e1abf961698p-1,
0x1.080e74c116863cfab82a0fd59c71b363p-1,
@@ -4642,17 +4631,3 @@
-0.0f,
},
};
-#endif // __BIONIC__
-
-TEST(math_sincosf, sincosf_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_sincosf_intel_data)/sizeof(sincosf_intel_data_t); i++) {
- float fsin, fcos;
- sincosf(g_sincosf_intel_data[i].call_data, &fsin, &fcos);
- EXPECT_FLOAT_EQ(g_sincosf_intel_data[i].sin_expected, fsin) << "Failed on element " << i;
- EXPECT_FLOAT_EQ(g_sincosf_intel_data[i].cos_expected, fcos) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_sinf_test.cpp b/tests/math_sinf_intel_data.h
similarity index 98%
rename from tests/math_sinf_test.cpp
rename to tests/math_sinf_intel_data.h
index bb1e2c9..9cda0fd 100644
--- a/tests/math_sinf_test.cpp
+++ b/tests/math_sinf_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- float expected;
- float call_data;
-} sinf_intel_data_t;
-
-static sinf_intel_data_t g_sinf_intel_data[] = {
+static data_1_1_t<float, float> g_sinf_intel_data[] = {
{ // Entry 0
-0x1.0003fffffff554d5535552cccf778ccdp-21,
-0x1.0004p-21
@@ -4382,14 +4372,3 @@
-0.0f
},
};
-#endif // __BIONIC__
-
-TEST(math_sinf, sinf_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_sinf_intel_data)/sizeof(sinf_intel_data_t); i++) {
- EXPECT_FLOAT_EQ(g_sinf_intel_data[i].expected, sinf(g_sinf_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_tan_test.cpp b/tests/math_tan_intel_data.h
similarity index 99%
rename from tests/math_tan_test.cpp
rename to tests/math_tan_intel_data.h
index 6862019..32d733e 100644
--- a/tests/math_tan_test.cpp
+++ b/tests/math_tan_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- double expected;
- double call_data;
-} tan_intel_data_t;
-
-static tan_intel_data_t g_tan_intel_data[] = {
+static data_1_1_t<double, double> g_tan_intel_data[] = {
{ // Entry 0
0x1.5078cebff9c728000000000000024df8p-5,
0x1.50486b2f87014p-5
@@ -5190,14 +5180,3 @@
-0.0
},
};
-#endif // __BIONIC__
-
-TEST(math_tan, tan_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_tan_intel_data)/sizeof(tan_intel_data_t); i++) {
- EXPECT_DOUBLE_EQ(g_tan_intel_data[i].expected, tan(g_tan_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_tanf_test.cpp b/tests/math_tanf_intel_data.h
similarity index 98%
rename from tests/math_tanf_test.cpp
rename to tests/math_tanf_intel_data.h
index 9319046..0669115 100644
--- a/tests/math_tanf_test.cpp
+++ b/tests/math_tanf_intel_data.h
@@ -14,17 +14,7 @@
* limitations under the License.
*/
-#include <math.h>
-
-#include <gtest/gtest.h>
-
-#if defined(__BIONIC__)
-typedef struct {
- float expected;
- float call_data;
-} tanf_intel_data_t;
-
-static tanf_intel_data_t g_tanf_intel_data[] = {
+static data_1_1_t<float, float> g_tanf_intel_data[] = {
{ // Entry 0
-0x1.00000000001555555555577777777777p-21,
-0x1.p-21
@@ -4446,14 +4436,3 @@
-0.0f
},
};
-#endif // __BIONIC__
-
-TEST(math_tanf, tanf_intel) {
-#if defined(__BIONIC__)
- for (size_t i = 0; i < sizeof(g_tanf_intel_data)/sizeof(tanf_intel_data_t); i++) {
- EXPECT_FLOAT_EQ(g_tanf_intel_data[i].expected, tanf(g_tanf_intel_data[i].call_data)) << "Failed on element " << i;
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.";
-#endif // __BIONIC__
-}
diff --git a/tests/math_test.cpp b/tests/math_test.cpp
index 2203db9..e14d3dd 100644
--- a/tests/math_test.cpp
+++ b/tests/math_test.cpp
@@ -14,6 +14,9 @@
* limitations under the License.
*/
+#define _GNU_SOURCE 1
+#include <math.h>
+
// This include (and the associated definition of __test_capture_signbit)
// must be placed before any files that include <cmath> (gtest.h in this case).
//
@@ -29,7 +32,6 @@
// sure that we're testing the bionic version of signbit. The C++ libraries
// are free to reimplement signbit or delegate to compiler builtins if they
// please.
-#include <math.h>
namespace {
template<typename T> inline int test_capture_signbit(const T in) {
@@ -46,6 +48,8 @@
}
}
+#include "math_data_test.h"
+
#include <gtest/gtest.h>
#include <fenv.h>
@@ -167,39 +171,30 @@
}
TEST(math, __fpclassifyd) {
-#if defined(__BIONIC__)
+#if defined(__GLIBC__)
+#define __fpclassifyd __fpclassify
+#endif
ASSERT_EQ(FP_INFINITE, __fpclassifyd(HUGE_VAL));
ASSERT_EQ(FP_NAN, __fpclassifyd(nan("")));
ASSERT_EQ(FP_NORMAL, __fpclassifyd(1.0));
ASSERT_EQ(FP_SUBNORMAL, __fpclassifyd(double_subnormal()));
ASSERT_EQ(FP_ZERO, __fpclassifyd(0.0));
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
}
TEST(math, __fpclassifyf) {
-#if defined(__BIONIC__)
ASSERT_EQ(FP_INFINITE, __fpclassifyf(HUGE_VALF));
ASSERT_EQ(FP_NAN, __fpclassifyf(nanf("")));
ASSERT_EQ(FP_NORMAL, __fpclassifyf(1.0f));
ASSERT_EQ(FP_SUBNORMAL, __fpclassifyf(float_subnormal()));
ASSERT_EQ(FP_ZERO, __fpclassifyf(0.0f));
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
}
TEST(math, __fpclassifyl) {
-#if defined(__BIONIC__)
EXPECT_EQ(FP_INFINITE, __fpclassifyl(HUGE_VALL));
EXPECT_EQ(FP_NAN, __fpclassifyl(nanl("")));
EXPECT_EQ(FP_NORMAL, __fpclassifyl(1.0L));
EXPECT_EQ(FP_SUBNORMAL, __fpclassifyl(ldouble_subnormal()));
EXPECT_EQ(FP_ZERO, __fpclassifyl(0.0L));
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
}
TEST(math, finitef) {
@@ -208,30 +203,27 @@
}
TEST(math, __isfinite) {
-#if defined(__BIONIC__)
+#if defined(__GLIBC__)
+#define __isfinite __finite
+#endif
ASSERT_TRUE(__isfinite(123.0));
ASSERT_FALSE(__isfinite(HUGE_VAL));
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
}
TEST(math, __isfinitef) {
-#if defined(__BIONIC__)
+#if defined(__GLIBC__)
+#define __isfinitef __finitef
+#endif
ASSERT_TRUE(__isfinitef(123.0f));
ASSERT_FALSE(__isfinitef(HUGE_VALF));
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
}
TEST(math, __isfinitel) {
-#if defined(__BIONIC__)
+#if defined(__GLIBC__)
+#define __isfinitel __finitel
+#endif
ASSERT_TRUE(__isfinitel(123.0L));
ASSERT_FALSE(__isfinitel(HUGE_VALL));
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
}
TEST(math, finite) {
@@ -281,7 +273,7 @@
ASSERT_TRUE(__isnormal(123.0));
ASSERT_FALSE(__isnormal(double_subnormal()));
#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
+ GTEST_LOG_(INFO) << "glibc doesn't have __isnormal.\n";
#endif // __BIONIC__
}
@@ -290,7 +282,7 @@
ASSERT_TRUE(__isnormalf(123.0f));
ASSERT_FALSE(__isnormalf(float_subnormal()));
#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
+ GTEST_LOG_(INFO) << "glibc doesn't have __isnormalf.\n";
#endif // __BIONIC__
}
@@ -299,7 +291,7 @@
ASSERT_TRUE(__isnormall(123.0L));
ASSERT_FALSE(__isnormall(ldouble_subnormal()));
#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
+ GTEST_LOG_(INFO) << "glibc doesn't have __isnormall.\n";
#endif // __BIONIC__
}
@@ -1032,13 +1024,13 @@
TEST(math, nextafter) {
ASSERT_DOUBLE_EQ(0.0, nextafter(0.0, 0.0));
ASSERT_DOUBLE_EQ(4.9406564584124654e-324, nextafter(0.0, 1.0));
- ASSERT_DOUBLE_EQ(0.0, nextafter(0.0, -1.0));
+ ASSERT_DOUBLE_EQ(-4.9406564584124654e-324, nextafter(0.0, -1.0));
}
TEST(math, nextafterf) {
ASSERT_FLOAT_EQ(0.0f, nextafterf(0.0f, 0.0f));
ASSERT_FLOAT_EQ(1.4012985e-45f, nextafterf(0.0f, 1.0f));
- ASSERT_FLOAT_EQ(0.0f, nextafterf(0.0f, -1.0f));
+ ASSERT_FLOAT_EQ(-1.4012985e-45f, nextafterf(0.0f, -1.0f));
}
TEST(math, nextafterl) {
@@ -1047,19 +1039,19 @@
// sizeof(double) == sizeof(long double)
long double smallest_positive = ldexpl(1.0L, LDBL_MIN_EXP - LDBL_MANT_DIG);
ASSERT_DOUBLE_EQ(smallest_positive, nextafterl(0.0L, 1.0L));
- ASSERT_DOUBLE_EQ(0.0L, nextafterl(0.0L, -1.0L));
+ ASSERT_DOUBLE_EQ(-smallest_positive, nextafterl(0.0L, -1.0L));
}
TEST(math, nexttoward) {
ASSERT_DOUBLE_EQ(0.0, nexttoward(0.0, 0.0L));
ASSERT_DOUBLE_EQ(4.9406564584124654e-324, nexttoward(0.0, 1.0L));
- ASSERT_DOUBLE_EQ(0.0, nexttoward(0.0, -1.0L));
+ ASSERT_DOUBLE_EQ(-4.9406564584124654e-324, nexttoward(0.0, -1.0L));
}
TEST(math, nexttowardf) {
ASSERT_FLOAT_EQ(0.0f, nexttowardf(0.0f, 0.0L));
ASSERT_FLOAT_EQ(1.4012985e-45f, nexttowardf(0.0f, 1.0L));
- ASSERT_FLOAT_EQ(0.0f, nexttowardf(0.0f, -1.0L));
+ ASSERT_FLOAT_EQ(-1.4012985e-45f, nexttowardf(0.0f, -1.0L));
}
TEST(math, nexttowardl) {
@@ -1068,7 +1060,7 @@
// sizeof(double) == sizeof(long double)
long double smallest_positive = ldexpl(1.0L, LDBL_MIN_EXP - LDBL_MANT_DIG);
ASSERT_DOUBLE_EQ(smallest_positive, nexttowardl(0.0L, 1.0L));
- ASSERT_DOUBLE_EQ(0.0L, nexttowardl(0.0L, -1.0L));
+ ASSERT_DOUBLE_EQ(-smallest_positive, nexttowardl(0.0L, -1.0L));
}
TEST(math, copysign) {
@@ -1095,19 +1087,19 @@
TEST(math, significand) {
ASSERT_DOUBLE_EQ(0.0, significand(0.0));
ASSERT_DOUBLE_EQ(1.2, significand(1.2));
- ASSERT_DOUBLE_EQ(1.5375, significand(12.3));
+ ASSERT_DOUBLE_EQ(1.53125, significand(12.25));
}
TEST(math, significandf) {
ASSERT_FLOAT_EQ(0.0f, significandf(0.0f));
ASSERT_FLOAT_EQ(1.2f, significandf(1.2f));
- ASSERT_FLOAT_EQ(1.5375f, significandf(12.3f));
+ ASSERT_FLOAT_EQ(1.53125f, significandf(12.25f));
}
TEST(math, significandl) {
ASSERT_DOUBLE_EQ(0.0L, significandl(0.0L));
ASSERT_DOUBLE_EQ(1.2L, significandl(1.2L));
- ASSERT_DOUBLE_EQ(1.5375L, significandl(12.3L));
+ ASSERT_DOUBLE_EQ(1.53125L, significandl(12.25L));
}
TEST(math, scalb) {
@@ -1156,7 +1148,7 @@
ASSERT_DOUBLE_EQ(log(24.0), gamma_r(5.0, &sign));
ASSERT_EQ(1, sign);
#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
+ GTEST_LOG_(INFO) << "glibc doesn't have gamma_r.\n";
#endif // __BIONIC__
}
@@ -1166,7 +1158,7 @@
ASSERT_FLOAT_EQ(logf(24.0f), gammaf_r(5.0f, &sign));
ASSERT_EQ(1, sign);
#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
+ GTEST_LOG_(INFO) << "glibc doesn't have gammaf_r.\n";
#endif // __BIONIC__
}
@@ -1188,12 +1180,51 @@
ASSERT_EQ(1, sign);
}
+TEST(math, lgamma_r_17471883) {
+ int sign;
+
+ sign = 0;
+ ASSERT_DOUBLE_EQ(HUGE_VAL, lgamma_r(0.0, &sign));
+ ASSERT_EQ(1, sign);
+ sign = 0;
+ ASSERT_DOUBLE_EQ(HUGE_VAL, lgamma_r(-0.0, &sign));
+ ASSERT_EQ(-1, sign);
+}
+
TEST(math, lgammaf_r) {
int sign;
ASSERT_FLOAT_EQ(logf(24.0f), lgammaf_r(5.0f, &sign));
ASSERT_EQ(1, sign);
}
+TEST(math, lgammaf_r_17471883) {
+ int sign;
+
+ sign = 0;
+ ASSERT_FLOAT_EQ(HUGE_VALF, lgammaf_r(0.0f, &sign));
+ ASSERT_EQ(1, sign);
+ sign = 0;
+ ASSERT_FLOAT_EQ(HUGE_VALF, lgammaf_r(-0.0f, &sign));
+ ASSERT_EQ(-1, sign);
+}
+
+TEST(math, lgammal_r) {
+ int sign;
+ ASSERT_DOUBLE_EQ(log(24.0L), lgamma_r(5.0L, &sign));
+ ASSERT_EQ(1, sign);
+}
+
+TEST(math, lgammal_r_17471883) {
+ int sign;
+
+ sign = 0;
+ ASSERT_DOUBLE_EQ(HUGE_VAL, lgammal_r(0.0L, &sign));
+ ASSERT_EQ(1, sign);
+ sign = 0;
+ ASSERT_DOUBLE_EQ(HUGE_VAL, lgammal_r(-0.0L, &sign));
+ ASSERT_EQ(-1, sign);
+}
+
TEST(math, tgamma) {
ASSERT_DOUBLE_EQ(24.0, tgamma(5.0));
}
@@ -1347,3 +1378,73 @@
ASSERT_TRUE(nextafterf(1.0f, 0.0f) - 1.0f < 0.0f);
ASSERT_TRUE(nextafterl(1.0L, 0.0L) - 1.0L < 0.0L);
}
+
+#include "math_cos_intel_data.h"
+TEST(math, cos_intel) {
+ DoMathDataTest<1>(g_cos_intel_data, cos);
+}
+
+#include "math_cosf_intel_data.h"
+TEST(math, cosf_intel) {
+ DoMathDataTest<1>(g_cosf_intel_data, cosf);
+}
+
+#include "math_exp_intel_data.h"
+TEST(math, exp_intel) {
+ DoMathDataTest<1>(g_exp_intel_data, exp);
+}
+
+#include "math_expf_intel_data.h"
+TEST(math, expf_intel) {
+ DoMathDataTest<1>(g_expf_intel_data, expf);
+}
+
+#include "math_log_intel_data.h"
+TEST(math, log_intel) {
+ DoMathDataTest<1>(g_log_intel_data, log);
+}
+
+#include "math_logf_intel_data.h"
+TEST(math, logf_intel) {
+ DoMathDataTest<1>(g_logf_intel_data, logf);
+}
+
+#include "math_pow_intel_data.h"
+TEST(math, pow_intel) {
+ DoMathDataTest<1>(g_pow_intel_data, pow);
+}
+
+#include "math_powf_intel_data.h"
+TEST(math, powf_intel) {
+ DoMathDataTest<1>(g_powf_intel_data, powf);
+}
+
+#include "math_sin_intel_data.h"
+TEST(math, sin_intel) {
+ DoMathDataTest<1>(g_sin_intel_data, sin);
+}
+
+#include "math_sincos_intel_data.h"
+TEST(math, sincos_intel) {
+ DoMathDataTest<1>(g_sincos_intel_data, sincos);
+}
+
+#include "math_sincosf_intel_data.h"
+TEST(math, sincosf_intel) {
+ DoMathDataTest<1>(g_sincosf_intel_data, sincosf);
+}
+
+#include "math_sinf_intel_data.h"
+TEST(math, sinf_intel) {
+ DoMathDataTest<1>(g_sinf_intel_data, sinf);
+}
+
+#include "math_tan_intel_data.h"
+TEST(math, tan_intel) {
+ DoMathDataTest<1>(g_tan_intel_data, tan);
+}
+
+#include "math_tanf_intel_data.h"
+TEST(math, tanf_intel) {
+ DoMathDataTest<1>(g_tanf_intel_data, tanf);
+}
diff --git a/tests/mntent_test.cpp b/tests/mntent_test.cpp
index 637cb52..a102849 100644
--- a/tests/mntent_test.cpp
+++ b/tests/mntent_test.cpp
@@ -19,16 +19,22 @@
#include <mntent.h>
TEST(mntent, mntent_smoke) {
- FILE* fp = setmntent("/no/mnt/tab/on/android", "r");
- ASSERT_TRUE(fp == NULL);
+ FILE* fp = setmntent("/proc/mounts", "r");
+ ASSERT_TRUE(fp != NULL);
-#if __BIONIC__ // glibc doesn't let you call getmntent/getmntent_r with a NULL FILE*.
- ASSERT_TRUE(getmntent(fp) == NULL);
+ ASSERT_TRUE(getmntent(fp) != NULL);
- struct mntent mbuf;
- char cbuf[32];
- ASSERT_TRUE(getmntent_r(fp, &mbuf, cbuf, sizeof(cbuf)) == NULL);
-#endif
+ bool saw_proc = false;
+
+ struct mntent entry;
+ char buf[BUFSIZ];
+ while (getmntent_r(fp, &entry, buf, sizeof(buf)) != NULL) {
+ if (strcmp(entry.mnt_fsname, "proc") == 0 && strcmp(entry.mnt_dir, "/proc") == 0) {
+ saw_proc = true;
+ }
+ }
+
+ ASSERT_TRUE(saw_proc);
ASSERT_EQ(1, endmntent(fp));
}
diff --git a/tests/netdb_test.cpp b/tests/netdb_test.cpp
index 33f6c01..0cebe4e 100644
--- a/tests/netdb_test.cpp
+++ b/tests/netdb_test.cpp
@@ -21,9 +21,67 @@
#include <netdb.h>
#include <netinet/in.h>
+TEST(netdb, getaddrinfo_NULL_host) {
+ // It's okay for the host argument to be NULL, as long as service isn't.
+ addrinfo* ai = NULL;
+ ASSERT_EQ(0, getaddrinfo(NULL, "smtp", NULL, &ai));
+ // (sockaddr_in::sin_port and sockaddr_in6::sin6_port overlap.)
+ ASSERT_EQ(25U, ntohs(reinterpret_cast<sockaddr_in*>(ai->ai_addr)->sin_port));
+ freeaddrinfo(ai);
+}
+
+TEST(netdb, getaddrinfo_NULL_service) {
+ // It's okay for the service argument to be NULL, as long as host isn't.
+ addrinfo* ai = NULL;
+ ASSERT_EQ(0, getaddrinfo("localhost", NULL, NULL, &ai));
+ ASSERT_TRUE(ai != NULL);
+ freeaddrinfo(ai);
+}
+
TEST(netdb, getaddrinfo_NULL_hints) {
addrinfo* ai = NULL;
ASSERT_EQ(0, getaddrinfo("localhost", "9999", NULL, &ai));
+
+ bool saw_tcp = false;
+ bool saw_udp = false;
+ for (addrinfo* p = ai; p != NULL; p = p->ai_next) {
+ ASSERT_TRUE(p->ai_family == AF_INET || p->ai_family == AF_INET6);
+ if (p->ai_socktype == SOCK_STREAM) {
+ ASSERT_EQ(IPPROTO_TCP, p->ai_protocol);
+ saw_tcp = true;
+ } else if (p->ai_socktype == SOCK_DGRAM) {
+ ASSERT_EQ(IPPROTO_UDP, p->ai_protocol);
+ saw_udp = true;
+ }
+ }
+ ASSERT_TRUE(saw_tcp);
+ ASSERT_TRUE(saw_udp);
+
+ freeaddrinfo(ai);
+}
+
+TEST(netdb, getaddrinfo_service_lookup) {
+ addrinfo* ai = NULL;
+ ASSERT_EQ(0, getaddrinfo("localhost", "smtp", NULL, &ai));
+ ASSERT_EQ(SOCK_STREAM, ai->ai_socktype);
+ ASSERT_EQ(IPPROTO_TCP, ai->ai_protocol);
+ ASSERT_EQ(25, ntohs(reinterpret_cast<sockaddr_in*>(ai->ai_addr)->sin_port));
+ freeaddrinfo(ai);
+}
+
+TEST(netdb, getaddrinfo_hints) {
+ addrinfo hints;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
+
+ addrinfo* ai = NULL;
+ ASSERT_EQ(0, getaddrinfo( "localhost", "9999", &hints, &ai));
+ ASSERT_EQ(AF_INET, ai->ai_family);
+ ASSERT_EQ(SOCK_STREAM, ai->ai_socktype);
+ ASSERT_EQ(IPPROTO_TCP, ai->ai_protocol);
+ ASSERT_TRUE(ai->ai_next == NULL);
freeaddrinfo(ai);
}
@@ -55,3 +113,37 @@
ASSERT_STREQ("::", tmp);
ASSERT_EQ(EAI_FAMILY, getnameinfo(sa, too_little, tmp, sizeof(tmp), NULL, 0, NI_NUMERICHOST));
}
+
+TEST(netdb, gethostbyname) {
+ hostent* hent = gethostbyname("localhost");
+ ASSERT_TRUE(hent != NULL);
+ ASSERT_EQ(hent->h_addrtype, AF_INET);
+ ASSERT_EQ(hent->h_addr[0], 127);
+ ASSERT_EQ(hent->h_addr[1], 0);
+ ASSERT_EQ(hent->h_addr[2], 0);
+ ASSERT_EQ(hent->h_addr[3], 1);
+}
+
+TEST(netdb, getservbyname) {
+ // smtp is TCP-only, so we know we'll get 25/tcp back.
+ servent* s = getservbyname("smtp", NULL);
+ ASSERT_TRUE(s != NULL);
+ ASSERT_EQ(25, ntohs(s->s_port));
+ ASSERT_STREQ("tcp", s->s_proto);
+
+ // We get the same result by explicitly asking for tcp.
+ s = getservbyname("smtp", "tcp");
+ ASSERT_TRUE(s != NULL);
+ ASSERT_EQ(25, ntohs(s->s_port));
+ ASSERT_STREQ("tcp", s->s_proto);
+
+ // And we get a failure if we explicitly ask for udp.
+ s = getservbyname("smtp", "udp");
+ ASSERT_TRUE(s == NULL);
+
+ // But there are actually udp services.
+ s = getservbyname("echo", "udp");
+ ASSERT_TRUE(s != NULL);
+ ASSERT_EQ(7, ntohs(s->s_port));
+ ASSERT_STREQ("udp", s->s_proto);
+}
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index 32bb54c..797468e 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -16,6 +16,11 @@
#include <gtest/gtest.h>
+#include "private/ScopeGuard.h"
+#include "BionicDeathTest.h"
+#include "ScopedSignalHandler.h"
+#include "gtest_ex.h"
+
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
@@ -27,8 +32,6 @@
#include <time.h>
#include <unistd.h>
-#include "private/ScopeGuard.h"
-#include "ScopedSignalHandler.h"
TEST(pthread, pthread_key_create) {
pthread_key_t key;
@@ -38,37 +41,71 @@
ASSERT_EQ(EINVAL, pthread_key_delete(key));
}
-TEST(pthread, pthread_key_create_lots) {
-#if defined(__BIONIC__) // glibc uses keys internally that its sysconf value doesn't account for.
+TEST(pthread, pthread_keys_max) {
// POSIX says PTHREAD_KEYS_MAX should be at least 128.
ASSERT_GE(PTHREAD_KEYS_MAX, 128);
+}
+TEST(pthread, _SC_THREAD_KEYS_MAX_big_enough_for_POSIX) {
+ // sysconf shouldn't return a smaller value.
+ int sysconf_max = sysconf(_SC_THREAD_KEYS_MAX);
+ ASSERT_GE(sysconf_max, PTHREAD_KEYS_MAX);
+}
+
+TEST(pthread, pthread_key_many_distinct) {
+ // We should be able to allocate at least this many keys.
+ int nkeys = sysconf(_SC_THREAD_KEYS_MAX) / 2;
+ std::vector<pthread_key_t> keys;
+
+ auto scope_guard = make_scope_guard([&keys]{
+ for (auto key : keys) {
+ EXPECT_EQ(0, pthread_key_delete(key));
+ }
+ });
+
+ for (int i = 0; i < nkeys; ++i) {
+ pthread_key_t key;
+ // If this fails, it's likely that GLOBAL_INIT_THREAD_LOCAL_BUFFER_COUNT is
+ // wrong.
+ ASSERT_EQ(0, pthread_key_create(&key, NULL)) << i << " of " << nkeys;
+ keys.push_back(key);
+ ASSERT_EQ(0, pthread_setspecific(key, reinterpret_cast<void*>(i)));
+ }
+
+ for (int i = keys.size() - 1; i >= 0; --i) {
+ ASSERT_EQ(reinterpret_cast<void*>(i), pthread_getspecific(keys.back()));
+ pthread_key_t key = keys.back();
+ keys.pop_back();
+ ASSERT_EQ(0, pthread_key_delete(key));
+ }
+}
+
+TEST(pthread, pthread_key_EAGAIN) {
int sysconf_max = sysconf(_SC_THREAD_KEYS_MAX);
- // sysconf shouldn't return a smaller value.
- ASSERT_GE(sysconf_max, PTHREAD_KEYS_MAX);
-
- // We can allocate _SC_THREAD_KEYS_MAX keys.
- sysconf_max -= 2; // (Except that gtest takes two for itself.)
std::vector<pthread_key_t> keys;
- for (int i = 0; i < sysconf_max; ++i) {
+ int rv = 0;
+ // Two keys are used by gtest, so sysconf_max should be more than we are
+ // allowed to allocate now.
+ for (int i = 0; i < sysconf_max; i++) {
pthread_key_t key;
- // If this fails, it's likely that GLOBAL_INIT_THREAD_LOCAL_BUFFER_COUNT is wrong.
- ASSERT_EQ(0, pthread_key_create(&key, NULL)) << i << " of " << sysconf_max;
+ rv = pthread_key_create(&key, NULL);
+ if (rv == EAGAIN) {
+ break;
+ }
+ EXPECT_EQ(0, rv);
keys.push_back(key);
}
- // ...and that really is the maximum.
- pthread_key_t key;
- ASSERT_EQ(EAGAIN, pthread_key_create(&key, NULL));
-
- // (Don't leak all those keys!)
- for (size_t i = 0; i < keys.size(); ++i) {
- ASSERT_EQ(0, pthread_key_delete(keys[i]));
+ // Don't leak keys.
+ for (auto key : keys) {
+ EXPECT_EQ(0, pthread_key_delete(key));
}
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
+ keys.clear();
+
+ // We should have eventually reached the maximum number of keys and received
+ // EAGAIN.
+ ASSERT_EQ(EAGAIN, rv);
}
TEST(pthread, pthread_key_delete) {
@@ -106,6 +143,7 @@
ASSERT_EQ(99, WEXITSTATUS(status));
ASSERT_EQ(expected, pthread_getspecific(key));
+ ASSERT_EQ(0, pthread_key_delete(key));
}
static void* DirtyKeyFn(void* key) {
@@ -133,6 +171,7 @@
ASSERT_EQ(nullptr, result); // Not ~0!
ASSERT_EQ(0, munmap(stack, stack_size));
+ ASSERT_EQ(0, pthread_key_delete(key));
}
static void* IdFn(void* arg) {
@@ -166,8 +205,7 @@
static void MakeDeadThread(pthread_t& t) {
ASSERT_EQ(0, pthread_create(&t, NULL, IdFn, NULL));
- void* result;
- ASSERT_EQ(0, pthread_join(t, &result));
+ ASSERT_EQ(0, pthread_join(t, NULL));
}
TEST(pthread, pthread_create) {
@@ -199,8 +237,7 @@
AssertDetached(t1, true);
// ...pthread_join should fail.
- void* result;
- ASSERT_EQ(EINVAL, pthread_join(t1, &result));
+ ASSERT_EQ(EINVAL, pthread_join(t1, NULL));
}
TEST(pthread, pthread_no_op_detach_after_join) {
@@ -228,8 +265,7 @@
}
TEST(pthread, pthread_join_self) {
- void* result;
- ASSERT_EQ(EDEADLK, pthread_join(pthread_self(), &result));
+ ASSERT_EQ(EDEADLK, pthread_join(pthread_self(), NULL));
}
struct TestBug37410 {
@@ -269,9 +305,11 @@
// Even though this isn't really a death test, we have to say "DeathTest" here so gtest knows to
// run this test (which exits normally) in its own process.
-TEST(pthread_DeathTest, pthread_bug_37410) {
+
+class pthread_DeathTest : public BionicDeathTest {};
+
+TEST_F(pthread_DeathTest, pthread_bug_37410) {
// http://code.google.com/p/android/issues/detail?id=37410
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(TestBug37410::main(), ::testing::ExitedWithCode(0), "");
}
@@ -323,52 +361,25 @@
}
TEST(pthread, pthread_setname_np__too_long) {
-#if defined(__BIONIC__) // Not all build servers have a new enough glibc? TODO: remove when they're on gprecise.
ASSERT_EQ(ERANGE, pthread_setname_np(pthread_self(), "this name is far too long for linux"));
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
}
TEST(pthread, pthread_setname_np__self) {
-#if defined(__BIONIC__) // Not all build servers have a new enough glibc? TODO: remove when they're on gprecise.
ASSERT_EQ(0, pthread_setname_np(pthread_self(), "short 1"));
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
}
TEST(pthread, pthread_setname_np__other) {
-#if defined(__BIONIC__) // Not all build servers have a new enough glibc? TODO: remove when they're on gprecise.
- // Emulator kernels don't currently support setting the name of other threads.
- char* filename = NULL;
- asprintf(&filename, "/proc/self/task/%d/comm", gettid());
- struct stat sb;
- bool has_comm = (stat(filename, &sb) != -1);
- free(filename);
-
- if (has_comm) {
- pthread_t t1;
- ASSERT_EQ(0, pthread_create(&t1, NULL, SleepFn, reinterpret_cast<void*>(5)));
- ASSERT_EQ(0, pthread_setname_np(t1, "short 2"));
- } else {
- fprintf(stderr, "skipping test: this kernel doesn't have /proc/self/task/tid/comm files!\n");
- }
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
+ pthread_t t1;
+ ASSERT_EQ(0, pthread_create(&t1, NULL, SleepFn, reinterpret_cast<void*>(5)));
+ ASSERT_EQ(0, pthread_setname_np(t1, "short 2"));
}
TEST(pthread, pthread_setname_np__no_such_thread) {
-#if defined(__BIONIC__) // Not all build servers have a new enough glibc? TODO: remove when they're on gprecise.
pthread_t dead_thread;
MakeDeadThread(dead_thread);
// Call pthread_setname_np after thread has already exited.
- ASSERT_EQ(ESRCH, pthread_setname_np(dead_thread, "short 3"));
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
+ ASSERT_EQ(ENOENT, pthread_setname_np(dead_thread, "short 3"));
}
TEST(pthread, pthread_kill__0) {
@@ -479,8 +490,7 @@
pthread_t dead_thread;
MakeDeadThread(dead_thread);
- void* result;
- ASSERT_EQ(ESRCH, pthread_join(dead_thread, &result));
+ ASSERT_EQ(ESRCH, pthread_join(dead_thread, NULL));
}
TEST(pthread, pthread_kill__no_such_thread) {
@@ -541,8 +551,7 @@
size_t result;
pthread_t t;
pthread_create(&t, &attributes, GetActualGuardSizeFn, &result);
- void* join_result;
- pthread_join(t, &join_result);
+ pthread_join(t, NULL);
return result;
}
@@ -557,8 +566,7 @@
size_t result;
pthread_t t;
pthread_create(&t, &attributes, GetActualStackSizeFn, &result);
- void* join_result;
- pthread_join(t, &join_result);
+ pthread_join(t, NULL);
return result;
}
@@ -714,22 +722,24 @@
static void AtForkChild1() { g_atfork_child_calls = (g_atfork_child_calls << 4) | 1; }
static void AtForkChild2() { g_atfork_child_calls = (g_atfork_child_calls << 4) | 2; }
-TEST(pthread, pthread_atfork) {
- ASSERT_EQ(0, pthread_atfork(AtForkPrepare1, AtForkParent1, AtForkChild1));
- ASSERT_EQ(0, pthread_atfork(AtForkPrepare2, AtForkParent2, AtForkChild2));
+TEST(pthread, pthread_atfork_smoke) {
+ test_isolated([] {
+ ASSERT_EQ(0, pthread_atfork(AtForkPrepare1, AtForkParent1, AtForkChild1));
+ ASSERT_EQ(0, pthread_atfork(AtForkPrepare2, AtForkParent2, AtForkChild2));
- int pid = fork();
- ASSERT_NE(-1, pid) << strerror(errno);
+ int pid = fork();
+ ASSERT_NE(-1, pid) << strerror(errno);
- // Child and parent calls are made in the order they were registered.
- if (pid == 0) {
- ASSERT_EQ(0x12, g_atfork_child_calls);
- _exit(0);
- }
- ASSERT_EQ(0x12, g_atfork_parent_calls);
+ // Child and parent calls are made in the order they were registered.
+ if (pid == 0) {
+ ASSERT_EQ(0x12, g_atfork_child_calls);
+ _exit(0);
+ }
+ ASSERT_EQ(0x12, g_atfork_parent_calls);
- // Prepare calls are made in the reverse order.
- ASSERT_EQ(0x21, g_atfork_prepare_calls);
+ // Prepare calls are made in the reverse order.
+ ASSERT_EQ(0x21, g_atfork_prepare_calls);
+ });
}
TEST(pthread, pthread_attr_getscope) {
@@ -907,3 +917,137 @@
EXPECT_EQ(stack_size, stack_size2);
ASSERT_EQ(6666U, stack_size);
}
+
+#if defined(__BIONIC__)
+static void* pthread_gettid_np_helper(void* arg) {
+ *reinterpret_cast<pid_t*>(arg) = gettid();
+ return NULL;
+}
+#endif
+
+TEST(pthread, pthread_gettid_np) {
+#if defined(__BIONIC__)
+ ASSERT_EQ(gettid(), pthread_gettid_np(pthread_self()));
+
+ pid_t t_gettid_result;
+ pthread_t t;
+ pthread_create(&t, NULL, pthread_gettid_np_helper, &t_gettid_result);
+
+ pid_t t_pthread_gettid_np_result = pthread_gettid_np(t);
+
+ pthread_join(t, NULL);
+
+ ASSERT_EQ(t_gettid_result, t_pthread_gettid_np_result);
+#else
+ GTEST_LOG_(INFO) << "This test does nothing.\n";
+#endif
+}
+
+static size_t cleanup_counter = 0;
+
+static void AbortCleanupRoutine(void*) {
+ abort();
+}
+
+static void CountCleanupRoutine(void*) {
+ ++cleanup_counter;
+}
+
+static void PthreadCleanupTester() {
+ pthread_cleanup_push(CountCleanupRoutine, NULL);
+ pthread_cleanup_push(CountCleanupRoutine, NULL);
+ pthread_cleanup_push(AbortCleanupRoutine, NULL);
+
+ pthread_cleanup_pop(0); // Pop the abort without executing it.
+ pthread_cleanup_pop(1); // Pop one count while executing it.
+ ASSERT_EQ(1U, cleanup_counter);
+ // Exit while the other count is still on the cleanup stack.
+ pthread_exit(NULL);
+
+ // Calls to pthread_cleanup_pop/pthread_cleanup_push must always be balanced.
+ pthread_cleanup_pop(0);
+}
+
+static void* PthreadCleanupStartRoutine(void*) {
+ PthreadCleanupTester();
+ return NULL;
+}
+
+TEST(pthread, pthread_cleanup_push__pthread_cleanup_pop) {
+ pthread_t t;
+ ASSERT_EQ(0, pthread_create(&t, NULL, PthreadCleanupStartRoutine, NULL));
+ pthread_join(t, NULL);
+ ASSERT_EQ(2U, cleanup_counter);
+}
+
+TEST(pthread, PTHREAD_MUTEX_DEFAULT_is_PTHREAD_MUTEX_NORMAL) {
+ ASSERT_EQ(PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_DEFAULT);
+}
+
+TEST(pthread, pthread_mutexattr_gettype) {
+ pthread_mutexattr_t attr;
+ ASSERT_EQ(0, pthread_mutexattr_init(&attr));
+
+ int attr_type;
+
+ ASSERT_EQ(0, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL));
+ ASSERT_EQ(0, pthread_mutexattr_gettype(&attr, &attr_type));
+ ASSERT_EQ(PTHREAD_MUTEX_NORMAL, attr_type);
+
+ ASSERT_EQ(0, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK));
+ ASSERT_EQ(0, pthread_mutexattr_gettype(&attr, &attr_type));
+ ASSERT_EQ(PTHREAD_MUTEX_ERRORCHECK, attr_type);
+
+ ASSERT_EQ(0, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE));
+ ASSERT_EQ(0, pthread_mutexattr_gettype(&attr, &attr_type));
+ ASSERT_EQ(PTHREAD_MUTEX_RECURSIVE, attr_type);
+}
+
+TEST(pthread, pthread_mutex_lock_NORMAL) {
+ pthread_mutexattr_t attr;
+ ASSERT_EQ(0, pthread_mutexattr_init(&attr));
+ ASSERT_EQ(0, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL));
+
+ pthread_mutex_t lock;
+ ASSERT_EQ(0, pthread_mutex_init(&lock, &attr));
+
+ ASSERT_EQ(0, pthread_mutex_lock(&lock));
+ ASSERT_EQ(0, pthread_mutex_unlock(&lock));
+ ASSERT_EQ(0, pthread_mutex_destroy(&lock));
+}
+
+TEST(pthread, pthread_mutex_lock_ERRORCHECK) {
+ pthread_mutexattr_t attr;
+ ASSERT_EQ(0, pthread_mutexattr_init(&attr));
+ ASSERT_EQ(0, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK));
+
+ pthread_mutex_t lock;
+ ASSERT_EQ(0, pthread_mutex_init(&lock, &attr));
+
+ ASSERT_EQ(0, pthread_mutex_lock(&lock));
+ ASSERT_EQ(EDEADLK, pthread_mutex_lock(&lock));
+ ASSERT_EQ(0, pthread_mutex_unlock(&lock));
+ ASSERT_EQ(0, pthread_mutex_trylock(&lock));
+ ASSERT_EQ(EBUSY, pthread_mutex_trylock(&lock));
+ ASSERT_EQ(0, pthread_mutex_unlock(&lock));
+ ASSERT_EQ(EPERM, pthread_mutex_unlock(&lock));
+ ASSERT_EQ(0, pthread_mutex_destroy(&lock));
+}
+
+TEST(pthread, pthread_mutex_lock_RECURSIVE) {
+ pthread_mutexattr_t attr;
+ ASSERT_EQ(0, pthread_mutexattr_init(&attr));
+ ASSERT_EQ(0, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE));
+
+ pthread_mutex_t lock;
+ ASSERT_EQ(0, pthread_mutex_init(&lock, &attr));
+
+ ASSERT_EQ(0, pthread_mutex_lock(&lock));
+ ASSERT_EQ(0, pthread_mutex_lock(&lock));
+ ASSERT_EQ(0, pthread_mutex_unlock(&lock));
+ ASSERT_EQ(0, pthread_mutex_unlock(&lock));
+ ASSERT_EQ(0, pthread_mutex_trylock(&lock));
+ ASSERT_EQ(0, pthread_mutex_unlock(&lock));
+ ASSERT_EQ(EPERM, pthread_mutex_unlock(&lock));
+ ASSERT_EQ(0, pthread_mutex_destroy(&lock));
+}
diff --git a/tests/semaphore_test.cpp b/tests/semaphore_test.cpp
new file mode 100644
index 0000000..e517f81
--- /dev/null
+++ b/tests/semaphore_test.cpp
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <semaphore.h>
+
+#include <errno.h>
+#include <gtest/gtest.h>
+#include <limits.h>
+#include <pthread.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "private/bionic_constants.h"
+
+TEST(semaphore, sem_init) {
+ sem_t s;
+
+ // Perfectly fine initial values.
+ ASSERT_EQ(0, sem_init(&s, 0, 0));
+ ASSERT_EQ(0, sem_init(&s, 0, 1));
+ ASSERT_EQ(0, sem_init(&s, 0, 123));
+
+ // Too small an initial value.
+ errno = 0;
+ ASSERT_EQ(-1, sem_init(&s, 0, -1));
+ ASSERT_EQ(EINVAL, errno);
+
+ ASSERT_EQ(SEM_VALUE_MAX, sysconf(_SC_SEM_VALUE_MAX));
+
+ // The largest initial value.
+ ASSERT_EQ(0, sem_init(&s, 0, SEM_VALUE_MAX));
+
+ // Too large an initial value.
+ errno = 0;
+ ASSERT_EQ(-1, sem_init(&s, 0, SEM_VALUE_MAX + 1));
+ ASSERT_EQ(EINVAL, errno);
+
+ ASSERT_EQ(0, sem_destroy(&s));
+}
+
+TEST(semaphore, sem_trywait) {
+ sem_t s;
+ ASSERT_EQ(0, sem_init(&s, 0, 3));
+ ASSERT_EQ(0, sem_trywait(&s));
+ ASSERT_EQ(0, sem_trywait(&s));
+ ASSERT_EQ(0, sem_trywait(&s));
+ errno = 0;
+ ASSERT_EQ(-1, sem_trywait(&s));
+ ASSERT_EQ(EAGAIN, errno);
+ ASSERT_EQ(0, sem_destroy(&s));
+}
+
+static void SemWaitThreadTestFn(sem_t& sem) {
+ ASSERT_EQ(0, sem_wait(&sem));
+}
+
+static void* SemWaitThreadFn(void* arg) {
+ SemWaitThreadTestFn(*reinterpret_cast<sem_t*>(arg));
+ return nullptr;
+}
+
+TEST(semaphore, sem_wait__sem_post) {
+ sem_t s;
+ ASSERT_EQ(0, sem_init(&s, 0, 0));
+
+ pthread_t t1, t2, t3;
+ ASSERT_EQ(0, pthread_create(&t1, NULL, SemWaitThreadFn, &s));
+ ASSERT_EQ(0, pthread_create(&t2, NULL, SemWaitThreadFn, &s));
+ ASSERT_EQ(0, pthread_create(&t3, NULL, SemWaitThreadFn, &s));
+
+ ASSERT_EQ(0, sem_post(&s));
+ ASSERT_EQ(0, sem_post(&s));
+ ASSERT_EQ(0, sem_post(&s));
+
+ void* result;
+ ASSERT_EQ(0, pthread_join(t1, &result));
+ ASSERT_EQ(0, pthread_join(t2, &result));
+ ASSERT_EQ(0, pthread_join(t3, &result));
+}
+
+static inline void timespec_add_ms(timespec& ts, size_t ms) {
+ ts.tv_sec += ms / 1000;
+ ts.tv_nsec += (ms % 1000) * 1000000;
+ if (ts.tv_nsec >= NS_PER_S) {
+ ts.tv_sec++;
+ ts.tv_nsec -= NS_PER_S;
+ }
+}
+
+TEST(semaphore, sem_timedwait) {
+ sem_t s;
+ ASSERT_EQ(0, sem_init(&s, 0, 0));
+
+ timespec ts;
+ ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts));
+ timespec_add_ms(ts, 100);
+
+ errno = 0;
+ ASSERT_EQ(-1, sem_timedwait(&s, &ts));
+ ASSERT_EQ(ETIMEDOUT, errno);
+
+ // A negative timeout is an error.
+ errno = 0;
+ ts.tv_nsec = -1;
+ ASSERT_EQ(-1, sem_timedwait(&s, &ts));
+ ASSERT_EQ(EINVAL, errno);
+
+ ASSERT_EQ(0, sem_destroy(&s));
+}
+
+TEST(semaphore, sem_getvalue) {
+ sem_t s;
+ ASSERT_EQ(0, sem_init(&s, 0, 0));
+
+ int i;
+ ASSERT_EQ(0, sem_getvalue(&s, &i));
+ ASSERT_EQ(0, i);
+
+ ASSERT_EQ(0, sem_post(&s));
+ ASSERT_EQ(0, sem_getvalue(&s, &i));
+ ASSERT_EQ(1, i);
+
+ ASSERT_EQ(0, sem_post(&s));
+ ASSERT_EQ(0, sem_getvalue(&s, &i));
+ ASSERT_EQ(2, i);
+
+ ASSERT_EQ(0, sem_wait(&s));
+ ASSERT_EQ(0, sem_getvalue(&s, &i));
+ ASSERT_EQ(1, i);
+}
diff --git a/tests/setjmp_test.cpp b/tests/setjmp_test.cpp
new file mode 100644
index 0000000..2df0135
--- /dev/null
+++ b/tests/setjmp_test.cpp
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+
+#include <setjmp.h>
+#include <stdlib.h>
+
+TEST(setjmp, setjmp_smoke) {
+ int value;
+ jmp_buf jb;
+ if ((value = setjmp(jb)) == 0) {
+ longjmp(jb, 123);
+ FAIL(); // Unreachable.
+ } else {
+ ASSERT_EQ(123, value);
+ }
+}
+
+TEST(setjmp, _setjmp_smoke) {
+ int value;
+ jmp_buf jb;
+ if ((value = _setjmp(jb)) == 0) {
+ _longjmp(jb, 456);
+ FAIL(); // Unreachable.
+ } else {
+ ASSERT_EQ(456, value);
+ }
+}
+
+TEST(setjmp, sigsetjmp_0_smoke) {
+ int value;
+ sigjmp_buf jb;
+ if ((value = sigsetjmp(jb, 0)) == 0) {
+ siglongjmp(jb, 789);
+ FAIL(); // Unreachable.
+ } else {
+ ASSERT_EQ(789, value);
+ }
+}
+
+TEST(setjmp, sigsetjmp_1_smoke) {
+ int value;
+ sigjmp_buf jb;
+ if ((value = sigsetjmp(jb, 0)) == 0) {
+ siglongjmp(jb, 0xabc);
+ FAIL(); // Unreachable.
+ } else {
+ ASSERT_EQ(0xabc, value);
+ }
+}
+
+static sigset_t SigSetOf(int signal) {
+ sigset_t ss;
+ sigemptyset(&ss);
+ sigaddset(&ss, signal);
+ return ss;
+}
+
+TEST(setjmp, _setjmp_signal_mask) {
+ // _setjmp/_longjmp do not save/restore the signal mask.
+ sigset_t ss1(SigSetOf(SIGUSR1));
+ sigset_t ss2(SigSetOf(SIGUSR2));
+ sigset_t original_set;
+ sigprocmask(SIG_SETMASK, &ss1, &original_set);
+ jmp_buf jb;
+ if (_setjmp(jb) == 0) {
+ sigprocmask(SIG_SETMASK, &ss2, NULL);
+ _longjmp(jb, 1);
+ FAIL(); // Unreachable.
+ } else {
+ sigset_t ss;
+ sigprocmask(SIG_SETMASK, NULL, &ss);
+ EXPECT_TRUE(sigismember(&ss, SIGUSR2));
+ }
+ sigprocmask(SIG_SETMASK, &original_set, NULL);
+}
+
+TEST(setjmp, setjmp_signal_mask) {
+ // setjmp/longjmp do save/restore the signal mask on bionic, but not on glibc.
+ // This is a BSD versus System V historical accident. POSIX leaves the
+ // behavior unspecified, so any code that cares needs to use sigsetjmp.
+ sigset_t ss1(SigSetOf(SIGUSR1));
+ sigset_t ss2(SigSetOf(SIGUSR2));
+ sigset_t original_set;
+ sigprocmask(SIG_SETMASK, &ss1, &original_set);
+ jmp_buf jb;
+ if (setjmp(jb) == 0) {
+ sigprocmask(SIG_SETMASK, &ss2, NULL);
+ longjmp(jb, 1);
+ FAIL(); // Unreachable.
+ } else {
+ sigset_t ss;
+ sigprocmask(SIG_SETMASK, NULL, &ss);
+#if defined(__BIONIC__)
+ // bionic behaves like BSD and does save/restore the signal mask.
+ EXPECT_TRUE(sigismember(&ss, SIGUSR1));
+#else
+ // glibc behaves like System V and doesn't save/restore the signal mask.
+ EXPECT_TRUE(sigismember(&ss, SIGUSR2));
+#endif
+ }
+ sigprocmask(SIG_SETMASK, &original_set, NULL);
+}
+
+TEST(setjmp, sigsetjmp_0_signal_mask) {
+ // sigsetjmp(0)/siglongjmp do not save/restore the signal mask.
+ sigset_t ss1(SigSetOf(SIGUSR1));
+ sigset_t ss2(SigSetOf(SIGUSR2));
+ sigset_t original_set;
+ sigprocmask(SIG_SETMASK, &ss1, &original_set);
+ sigjmp_buf sjb;
+ if (sigsetjmp(sjb, 0) == 0) {
+ sigprocmask(SIG_SETMASK, &ss2, NULL);
+ siglongjmp(sjb, 1);
+ FAIL(); // Unreachable.
+ } else {
+ sigset_t ss;
+ sigprocmask(SIG_SETMASK, NULL, &ss);
+ EXPECT_TRUE(sigismember(&ss, SIGUSR2));
+ }
+ sigprocmask(SIG_SETMASK, &original_set, NULL);
+}
+
+TEST(setjmp, sigsetjmp_1_signal_mask) {
+ // sigsetjmp(1)/siglongjmp does save/restore the signal mask.
+ sigset_t ss1(SigSetOf(SIGUSR1));
+ sigset_t ss2(SigSetOf(SIGUSR2));
+ sigset_t original_set;
+ sigprocmask(SIG_SETMASK, &ss1, &original_set);
+ sigjmp_buf sjb;
+ if (sigsetjmp(sjb, 1) == 0) {
+ sigprocmask(SIG_SETMASK, &ss2, NULL);
+ siglongjmp(sjb, 1);
+ FAIL(); // Unreachable.
+ } else {
+ sigset_t ss;
+ sigprocmask(SIG_SETMASK, NULL, &ss);
+ EXPECT_TRUE(sigismember(&ss, SIGUSR1));
+ }
+ sigprocmask(SIG_SETMASK, &original_set, NULL);
+}
diff --git a/tests/stack_protector_test.cpp b/tests/stack_protector_test.cpp
index fea24d8..aad51ec 100644
--- a/tests/stack_protector_test.cpp
+++ b/tests/stack_protector_test.cpp
@@ -19,6 +19,7 @@
*/
#include <gtest/gtest.h>
+#include "BionicDeathTest.h"
#include <pthread.h>
#include <stdint.h>
@@ -120,9 +121,10 @@
#endif // TEST_STACK_CHK_GUARD
}
-TEST(stack_protector_DeathTest, modify_stack_protector) {
+class stack_protector_DeathTest : public BionicDeathTest {};
+
+TEST_F(stack_protector_DeathTest, modify_stack_protector) {
#if defined(TEST_STACK_CHK_GUARD)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(do_modify_stack_chk_guard(), testing::KilledBySignal(SIGABRT), "");
#else // TEST_STACK_CHK_GUARD
GTEST_LOG_(INFO) << "This test does nothing.\n";
diff --git a/tests/stack_unwinding_test.cpp b/tests/stack_unwinding_test.cpp
index 3fc45c5..3d3f22d 100644
--- a/tests/stack_unwinding_test.cpp
+++ b/tests/stack_unwinding_test.cpp
@@ -73,6 +73,7 @@
ASSERT_EQ(count + 1, deeper_count);
}
+static volatile bool signal_handler_run = false;
static int killer_count = 0;
static int handler_count = 0;
static int handler_one_deeper_count = 0;
@@ -83,6 +84,7 @@
handler_one_deeper_count = unwind_one_frame_deeper();
ASSERT_EQ(handler_count + 1, handler_one_deeper_count);
+ signal_handler_run = true;
}
TEST(stack_unwinding, unwind_through_signal_frame) {
@@ -90,8 +92,9 @@
ScopedSignalHandler ssh(SIGUSR1, UnwindSignalHandler);
_Unwind_Backtrace(FrameCounter, &killer_count);
-
+ signal_handler_run = false;
ASSERT_EQ(0, kill(getpid(), SIGUSR1));
+ while (!signal_handler_run) {}
}
// On LP32, the SA_SIGINFO flag gets you __restore_rt instead of __restore.
@@ -100,6 +103,7 @@
ScopedSignalHandler ssh(SIGUSR1, UnwindSignalHandler, SA_SIGINFO);
_Unwind_Backtrace(FrameCounter, &killer_count);
-
+ signal_handler_run = false;
ASSERT_EQ(0, kill(getpid(), SIGUSR1));
+ while (!signal_handler_run) {}
}
diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp
index b7fb19b..eb030bf 100644
--- a/tests/stdatomic_test.cpp
+++ b/tests/stdatomic_test.cpp
@@ -14,8 +14,10 @@
* limitations under the License.
*/
-#include <stdatomic.h>
#include <gtest/gtest.h>
+// Fool stdatomic.h into not using <atomic>.
+#undef _USING_LIBCXX
+#include <stdatomic.h>
#include <pthread.h>
#include <stdint.h>
diff --git a/tests/stdio_ext_test.cpp b/tests/stdio_ext_test.cpp
new file mode 100644
index 0000000..3dbc485
--- /dev/null
+++ b/tests/stdio_ext_test.cpp
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio_ext.h>
+
+#include <gtest/gtest.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <wchar.h>
+#include <locale.h>
+
+#include "TemporaryFile.h"
+
+TEST(stdio_ext, __fbufsize) {
+ FILE* fp = fopen("/proc/version", "r");
+
+ char buf[128];
+
+ ASSERT_EQ(0, setvbuf(fp, buf, _IOFBF, 1));
+ ASSERT_EQ(1U, __fbufsize(fp));
+
+ ASSERT_EQ(0, setvbuf(fp, buf, _IOFBF, 8));
+ ASSERT_EQ(8U, __fbufsize(fp));
+
+ fclose(fp);
+}
+
+TEST(stdio_ext, __flbf) {
+ FILE* fp = fopen("/proc/version", "r");
+
+ ASSERT_FALSE(__flbf(fp));
+
+ char buf[128];
+ ASSERT_EQ(0, setvbuf(fp, buf, _IOLBF, sizeof(buf)));
+
+ ASSERT_TRUE(__flbf(fp));
+
+ fclose(fp);
+}
+
+TEST(stdio_ext, __fpending) {
+ FILE* fp = fopen("/dev/null", "w");
+ ASSERT_EQ(0U, __fpending(fp));
+ ASSERT_EQ('x', fputc('x', fp));
+ ASSERT_EQ(1U, __fpending(fp));
+ ASSERT_EQ('y', fputc('y', fp));
+ ASSERT_EQ(2U, __fpending(fp));
+ fflush(fp);
+ ASSERT_EQ(0U, __fpending(fp));
+ fclose(fp);
+}
+
+TEST(stdio_ext, __fpurge) {
+ FILE* fp = tmpfile();
+
+ ASSERT_EQ('a', fputc('a', fp));
+ ASSERT_EQ(1U, __fpending(fp));
+ __fpurge(fp);
+ ASSERT_EQ(0U, __fpending(fp));
+
+ ASSERT_EQ('b', fputc('b', fp));
+ ASSERT_EQ('\n', fputc('\n', fp));
+ ASSERT_EQ(2U, __fpending(fp));
+
+ rewind(fp);
+
+ char buf[16];
+ char* s = fgets(buf, sizeof(buf), fp);
+ ASSERT_TRUE(s != NULL);
+ ASSERT_STREQ("b\n", s);
+
+ fclose(fp);
+}
+
+TEST(stdio_ext, _flushlbf) {
+ FILE* fp = fopen("/dev/null", "w");
+
+ char buf[128];
+ ASSERT_EQ(0, setvbuf(fp, buf, _IOLBF, sizeof(buf)));
+
+ ASSERT_EQ('a', fputc('a', fp));
+ ASSERT_EQ(1U, __fpending(fp));
+
+ _flushlbf();
+
+ ASSERT_EQ(0U, __fpending(fp));
+
+ fclose(fp);
+}
+
+TEST(stdio_ext, __freadable__fwritable) {
+ FILE* fp = fopen("/dev/null", "r");
+ ASSERT_TRUE(__freadable(fp));
+ ASSERT_FALSE(__fwritable(fp));
+ fclose(fp);
+
+ fp = fopen("/dev/null", "w");
+ ASSERT_FALSE(__freadable(fp));
+ ASSERT_TRUE(__fwritable(fp));
+ fclose(fp);
+
+ fp = fopen("/dev/null", "w+");
+ ASSERT_TRUE(__freadable(fp));
+ ASSERT_TRUE(__fwritable(fp));
+ fclose(fp);
+}
+
+TEST(stdio_ext, __fsetlocking) {
+ FILE* fp = fopen("/proc/version", "r");
+ // Android doesn't actually support the other modes.
+ ASSERT_EQ(FSETLOCKING_INTERNAL, __fsetlocking(fp, FSETLOCKING_QUERY));
+ fclose(fp);
+}
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index 6a2991f..6be372c 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -77,7 +77,7 @@
int rc = dprintf(tf.fd, "hello\n");
ASSERT_EQ(rc, 6);
- lseek(tf.fd, SEEK_SET, 0);
+ lseek(tf.fd, 0, SEEK_SET);
FILE* tfile = fdopen(tf.fd, "r");
ASSERT_TRUE(tfile != NULL);
@@ -694,3 +694,122 @@
fclose(fp);
}
+
+TEST(stdio, fmemopen) {
+ char buf[16];
+ memset(buf, 0, sizeof(buf));
+ FILE* fp = fmemopen(buf, sizeof(buf), "r+");
+ ASSERT_EQ('<', fputc('<', fp));
+ ASSERT_NE(EOF, fputs("abc>\n", fp));
+ fflush(fp);
+
+ ASSERT_STREQ("<abc>\n", buf);
+
+ rewind(fp);
+
+ char line[16];
+ char* s = fgets(line, sizeof(line), fp);
+ ASSERT_TRUE(s != NULL);
+ ASSERT_STREQ("<abc>\n", s);
+
+ fclose(fp);
+}
+
+TEST(stdio, fmemopen_NULL) {
+ FILE* fp = fmemopen(nullptr, 128, "r+");
+ ASSERT_NE(EOF, fputs("xyz\n", fp));
+
+ rewind(fp);
+
+ char line[16];
+ char* s = fgets(line, sizeof(line), fp);
+ ASSERT_TRUE(s != NULL);
+ ASSERT_STREQ("xyz\n", s);
+
+ fclose(fp);
+}
+
+TEST(stdio, fmemopen_EINVAL) {
+ char buf[16];
+
+ // Invalid size.
+ errno = 0;
+ ASSERT_EQ(nullptr, fmemopen(buf, 0, "r+"));
+ ASSERT_EQ(EINVAL, errno);
+
+ // No '+' with NULL buffer.
+ errno = 0;
+ ASSERT_EQ(nullptr, fmemopen(nullptr, 0, "r"));
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(stdio, open_memstream) {
+ char* p = nullptr;
+ size_t size = 0;
+ FILE* fp = open_memstream(&p, &size);
+ ASSERT_NE(EOF, fputs("hello, world!", fp));
+ fclose(fp);
+
+ ASSERT_STREQ("hello, world!", p);
+ ASSERT_EQ(strlen("hello, world!"), size);
+ free(p);
+}
+
+TEST(stdio, open_memstream_EINVAL) {
+#if defined(__BIONIC__)
+ char* p;
+ size_t size;
+
+ // Invalid buffer.
+ errno = 0;
+ ASSERT_EQ(nullptr, open_memstream(nullptr, &size));
+ ASSERT_EQ(EINVAL, errno);
+
+ // Invalid size.
+ errno = 0;
+ ASSERT_EQ(nullptr, open_memstream(&p, nullptr));
+ ASSERT_EQ(EINVAL, errno);
+#else
+ GTEST_LOG_(INFO) << "This test does nothing.\n";
+#endif
+}
+
+TEST(stdio, fdopen_CLOEXEC) {
+ int fd = open("/proc/version", O_RDONLY);
+ ASSERT_TRUE(fd != -1);
+
+ // This fd doesn't have O_CLOEXEC...
+ int flags = fcntl(fd, F_GETFD);
+ ASSERT_TRUE(flags != -1);
+ ASSERT_EQ(0, flags & FD_CLOEXEC);
+
+ FILE* fp = fdopen(fd, "re");
+ ASSERT_TRUE(fp != NULL);
+
+ // ...but the new one does.
+ flags = fcntl(fileno(fp), F_GETFD);
+ ASSERT_TRUE(flags != -1);
+ ASSERT_EQ(FD_CLOEXEC, flags & FD_CLOEXEC);
+
+ fclose(fp);
+ close(fd);
+}
+
+TEST(stdio, freopen_CLOEXEC) {
+ FILE* fp = fopen("/proc/version", "r");
+ ASSERT_TRUE(fp != NULL);
+
+ // This FILE* doesn't have O_CLOEXEC...
+ int flags = fcntl(fileno(fp), F_GETFD);
+ ASSERT_TRUE(flags != -1);
+ ASSERT_EQ(0, flags & FD_CLOEXEC);
+
+ fp = freopen("/proc/version", "re", fp);
+
+ // ...but the new one does.
+ flags = fcntl(fileno(fp), F_GETFD);
+ ASSERT_TRUE(flags != -1);
+ ASSERT_EQ(FD_CLOEXEC, flags & FD_CLOEXEC);
+
+ fclose(fp);
+}
diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp
index 553f018..050f5a7 100644
--- a/tests/stdlib_test.cpp
+++ b/tests/stdlib_test.cpp
@@ -15,6 +15,7 @@
*/
#include <gtest/gtest.h>
+#include "BionicDeathTest.h"
#include "TemporaryFile.h"
#include <errno.h>
@@ -27,12 +28,54 @@
#include <sys/types.h>
#include <sys/wait.h>
+// The random number generator tests all set the seed, get four values, reset the seed and check
+// that they get the first two values repeated, and then reset the seed and check two more values
+// to rule out the possibility that we're just going round a cycle of four values.
+// TODO: factor this out.
+
TEST(stdlib, drand48) {
srand48(0x01020304);
EXPECT_DOUBLE_EQ(0.65619299195623526, drand48());
EXPECT_DOUBLE_EQ(0.18522597229772941, drand48());
EXPECT_DOUBLE_EQ(0.42015087072844537, drand48());
EXPECT_DOUBLE_EQ(0.061637783047395089, drand48());
+ srand48(0x01020304);
+ EXPECT_DOUBLE_EQ(0.65619299195623526, drand48());
+ EXPECT_DOUBLE_EQ(0.18522597229772941, drand48());
+ srand48(0x01020304);
+ EXPECT_DOUBLE_EQ(0.65619299195623526, drand48());
+ EXPECT_DOUBLE_EQ(0.18522597229772941, drand48());
+}
+
+TEST(stdlib, erand48) {
+ const unsigned short seed[3] = { 0x330e, 0xabcd, 0x1234 };
+ unsigned short xsubi[3];
+ memcpy(xsubi, seed, sizeof(seed));
+ EXPECT_DOUBLE_EQ(0.39646477376027534, erand48(xsubi));
+ EXPECT_DOUBLE_EQ(0.84048536941142515, erand48(xsubi));
+ EXPECT_DOUBLE_EQ(0.35333609724524351, erand48(xsubi));
+ EXPECT_DOUBLE_EQ(0.44658343479654405, erand48(xsubi));
+ memcpy(xsubi, seed, sizeof(seed));
+ EXPECT_DOUBLE_EQ(0.39646477376027534, erand48(xsubi));
+ EXPECT_DOUBLE_EQ(0.84048536941142515, erand48(xsubi));
+ memcpy(xsubi, seed, sizeof(seed));
+ EXPECT_DOUBLE_EQ(0.39646477376027534, erand48(xsubi));
+ EXPECT_DOUBLE_EQ(0.84048536941142515, erand48(xsubi));
+}
+
+TEST(stdlib, lcong48) {
+ unsigned short p[7] = { 0x0102, 0x0304, 0x0506, 0x0708, 0x090a, 0x0b0c, 0x0d0e };
+ lcong48(p);
+ EXPECT_EQ(1531389981, lrand48());
+ EXPECT_EQ(1598801533, lrand48());
+ EXPECT_EQ(2080534853, lrand48());
+ EXPECT_EQ(1102488897, lrand48());
+ lcong48(p);
+ EXPECT_EQ(1531389981, lrand48());
+ EXPECT_EQ(1598801533, lrand48());
+ lcong48(p);
+ EXPECT_EQ(1531389981, lrand48());
+ EXPECT_EQ(1598801533, lrand48());
}
TEST(stdlib, lrand48) {
@@ -41,6 +84,12 @@
EXPECT_EQ(397769746, lrand48());
EXPECT_EQ(902267124, lrand48());
EXPECT_EQ(132366131, lrand48());
+ srand48(0x01020304);
+ EXPECT_EQ(1409163720, lrand48());
+ EXPECT_EQ(397769746, lrand48());
+ srand48(0x01020304);
+ EXPECT_EQ(1409163720, lrand48());
+ EXPECT_EQ(397769746, lrand48());
}
TEST(stdlib, random) {
@@ -49,6 +98,12 @@
EXPECT_EQ(1399865117, random());
EXPECT_EQ(2032643283, random());
EXPECT_EQ(571329216, random());
+ srandom(0x01020304);
+ EXPECT_EQ(55436735, random());
+ EXPECT_EQ(1399865117, random());
+ srandom(0x01020304);
+ EXPECT_EQ(55436735, random());
+ EXPECT_EQ(1399865117, random());
}
TEST(stdlib, rand) {
@@ -57,6 +112,12 @@
EXPECT_EQ(1399865117, rand());
EXPECT_EQ(2032643283, rand());
EXPECT_EQ(571329216, rand());
+ srand(0x01020304);
+ EXPECT_EQ(55436735, rand());
+ EXPECT_EQ(1399865117, rand());
+ srand(0x01020304);
+ EXPECT_EQ(55436735, rand());
+ EXPECT_EQ(1399865117, rand());
}
TEST(stdlib, mrand48) {
@@ -65,6 +126,12 @@
EXPECT_EQ(795539493, mrand48());
EXPECT_EQ(1804534249, mrand48());
EXPECT_EQ(264732262, mrand48());
+ srand48(0x01020304);
+ EXPECT_EQ(-1476639856, mrand48());
+ EXPECT_EQ(795539493, mrand48());
+ srand48(0x01020304);
+ EXPECT_EQ(-1476639856, mrand48());
+ EXPECT_EQ(795539493, mrand48());
}
TEST(stdlib, posix_memalign) {
@@ -99,6 +166,18 @@
ASSERT_EQ(ENOENT, errno);
}
+TEST(stdlib, realpath__component_after_non_directory) {
+ errno = 0;
+ char* p = realpath("/dev/null/.", NULL);
+ ASSERT_TRUE(p == NULL);
+ ASSERT_EQ(ENOTDIR, errno);
+
+ errno = 0;
+ p = realpath("/dev/null/..", NULL);
+ ASSERT_TRUE(p == NULL);
+ ASSERT_EQ(ENOTDIR, errno);
+}
+
TEST(stdlib, realpath) {
// Get the name of this executable.
char executable_path[PATH_MAX];
@@ -156,25 +235,41 @@
// Even though this isn't really a death test, we have to say "DeathTest" here so gtest knows to
// run this test (which exits normally) in its own process.
-TEST(stdlib_DeathTest, getenv_after_main_thread_exits) {
+
+class stdlib_DeathTest : public BionicDeathTest {};
+
+TEST_F(stdlib_DeathTest, getenv_after_main_thread_exits) {
// https://code.google.com/p/android/issues/detail?id=57421
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
ASSERT_EXIT(TestBug57421_main(), ::testing::ExitedWithCode(0), "");
}
+TEST(stdlib, mkostemp64) {
+ TemporaryFile tf([](char* path) { return mkostemp64(path, O_CLOEXEC); });
+ int flags = fcntl(tf.fd, F_GETFD);
+ ASSERT_TRUE(flags != -1);
+ ASSERT_EQ(FD_CLOEXEC, flags & FD_CLOEXEC);
+}
+
+TEST(stdlib, mkostemp) {
+ TemporaryFile tf([](char* path) { return mkostemp(path, O_CLOEXEC); });
+ int flags = fcntl(tf.fd, F_GETFD);
+ ASSERT_TRUE(flags != -1);
+ ASSERT_EQ(FD_CLOEXEC, flags & FD_CLOEXEC);
+}
+
+TEST(stdlib, mkstemp64) {
+ TemporaryFile tf(mkstemp64);
+ struct stat64 sb;
+ ASSERT_EQ(0, fstat64(tf.fd, &sb));
+ ASSERT_EQ(O_LARGEFILE, fcntl(tf.fd, F_GETFL) & O_LARGEFILE);
+}
+
TEST(stdlib, mkstemp) {
TemporaryFile tf;
struct stat sb;
ASSERT_EQ(0, fstat(tf.fd, &sb));
}
-TEST(stdlib, mkstemp64) {
- GenericTemporaryFile<mkstemp64> tf;
- struct stat64 sb;
- ASSERT_EQ(0, fstat64(tf.fd, &sb));
- ASSERT_EQ(O_LARGEFILE, fcntl(tf.fd, F_GETFL) & O_LARGEFILE);
-}
-
TEST(stdlib, system) {
int status;
@@ -203,6 +298,23 @@
ASSERT_DOUBLE_EQ(1.23, strtold("1.23", NULL));
}
+TEST(stdlib, strtof_2206701) {
+ ASSERT_EQ(0.0f, strtof("7.0064923216240853546186479164495e-46", NULL));
+ ASSERT_EQ(1.4e-45f, strtof("7.0064923216240853546186479164496e-46", NULL));
+}
+
+TEST(stdlib, strtod_largest_subnormal) {
+ // This value has been known to cause javac and java to infinite loop.
+ // http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
+ ASSERT_EQ(2.2250738585072014e-308, strtod("2.2250738585072012e-308", NULL));
+ ASSERT_EQ(2.2250738585072014e-308, strtod("0.00022250738585072012e-304", NULL));
+ ASSERT_EQ(2.2250738585072014e-308, strtod("00000002.2250738585072012e-308", NULL));
+ ASSERT_EQ(2.2250738585072014e-308, strtod("2.225073858507201200000e-308", NULL));
+ ASSERT_EQ(2.2250738585072014e-308, strtod("2.2250738585072012e-00308", NULL));
+ ASSERT_EQ(2.2250738585072014e-308, strtod("2.22507385850720129978001e-308", NULL));
+ ASSERT_EQ(-2.2250738585072014e-308, strtod("-2.2250738585072012e-308", NULL));
+}
+
TEST(stdlib, quick_exit) {
pid_t pid = fork();
ASSERT_NE(-1, pid) << strerror(errno);
@@ -361,3 +473,51 @@
ASSERT_EQ(ENOTTY, errno);
close(fd);
}
+
+TEST(stdlib, strtol_EINVAL) {
+ errno = 0;
+ strtol("123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtol("123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtol("123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(stdlib, strtoll_EINVAL) {
+ errno = 0;
+ strtoll("123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoll("123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoll("123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(stdlib, strtoul_EINVAL) {
+ errno = 0;
+ strtoul("123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoul("123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoul("123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(stdlib, strtoull_EINVAL) {
+ errno = 0;
+ strtoull("123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoull("123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ strtoull("123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
diff --git a/tests/string_posix_strerror_r_test.cpp b/tests/string_posix_strerror_r_test.cpp
new file mode 100644
index 0000000..ae3b41a
--- /dev/null
+++ b/tests/string_posix_strerror_r_test.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#undef _GNU_SOURCE
+#include <features.h> // Get __BIONIC__ or __GLIBC__ so we can tell what we're using.
+
+#if defined(__GLIBC__)
+
+// At the time of writing, libcxx -- which is dragged in by gtest -- assumes
+// declarations from glibc of things that aren't available without __USE_GNU.
+// This means we can't even build this test (which is a problem because that
+// means it doesn't get included in CTS).
+// For glibc 2.15, the symbols in question are:
+// at_quick_exit, quick_exit, vasprintf, strtoll_l, strtoull_l, and strtold_l.
+
+# if __GLIBC_PREREQ(2, 19)
+# error check whether we can build this now...
+# endif
+
+#else
+
+#include <string.h>
+
+#include <errno.h>
+#include <gtest/gtest.h>
+
+TEST(string, posix_strerror_r) {
+ char buf[256];
+
+ // Valid.
+ ASSERT_EQ(0, strerror_r(0, buf, sizeof(buf)));
+ ASSERT_STREQ("Success", buf);
+ ASSERT_EQ(0, strerror_r(1, buf, sizeof(buf)));
+ ASSERT_STREQ("Operation not permitted", buf);
+
+ // Invalid.
+ ASSERT_EQ(0, strerror_r(-1, buf, sizeof(buf)));
+ ASSERT_STREQ("Unknown error -1", buf);
+ ASSERT_EQ(0, strerror_r(1234, buf, sizeof(buf)));
+ ASSERT_STREQ("Unknown error 1234", buf);
+
+ // Buffer too small.
+ errno = 0;
+ memset(buf, 0, sizeof(buf));
+ ASSERT_EQ(-1, strerror_r(4567, buf, 2));
+ ASSERT_STREQ("U", buf);
+ // The POSIX strerror_r sets errno to ERANGE (the GNU one doesn't).
+ ASSERT_EQ(ERANGE, errno);
+}
+
+#endif
diff --git a/tests/string_test.cpp b/tests/string_test.cpp
index f1ac9dd..137565e 100644
--- a/tests/string_test.cpp
+++ b/tests/string_test.cpp
@@ -14,15 +14,22 @@
* limitations under the License.
*/
-#include <gtest/gtest.h>
+#define _GNU_SOURCE 1
-#include <errno.h>
-#include <malloc.h>
-#include <math.h>
#include <string.h>
+#include <errno.h>
+#include <gtest/gtest.h>
+#include <malloc.h>
+#include <math.h>
+
#include "buffer_tests.h"
+#if defined(__BIONIC__)
+#define STRLCPY_SUPPORTED
+#define STRLCAT_SUPPORTED
+#endif
+
#define KB 1024
#define SMALL 1*KB
#define MEDIUM 4*KB
@@ -68,32 +75,38 @@
ASSERT_STREQ("Unknown error 1001", strerror1001);
#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
+ GTEST_LOG_(INFO) << "Skipping test, requires a thread safe strerror.";
#endif // __BIONIC__
}
-TEST(string, strerror_r) {
-#if defined(__BIONIC__) // glibc's strerror_r doesn't even have the same signature as the POSIX one.
+TEST(string, gnu_strerror_r) {
char buf[256];
+ // Note that glibc doesn't necessarily write into the buffer.
+
// Valid.
- ASSERT_EQ(0, strerror_r(0, buf, sizeof(buf)));
+ ASSERT_STREQ("Success", strerror_r(0, buf, sizeof(buf)));
+#if defined(__BIONIC__)
ASSERT_STREQ("Success", buf);
- ASSERT_EQ(0, strerror_r(1, buf, sizeof(buf)));
+#endif
+ ASSERT_STREQ("Operation not permitted", strerror_r(1, buf, sizeof(buf)));
+#if defined(__BIONIC__)
ASSERT_STREQ("Operation not permitted", buf);
+#endif
// Invalid.
- ASSERT_EQ(0, strerror_r(-1, buf, sizeof(buf)));
+ ASSERT_STREQ("Unknown error -1", strerror_r(-1, buf, sizeof(buf)));
ASSERT_STREQ("Unknown error -1", buf);
- ASSERT_EQ(0, strerror_r(1234, buf, sizeof(buf)));
+ ASSERT_STREQ("Unknown error 1234", strerror_r(1234, buf, sizeof(buf)));
ASSERT_STREQ("Unknown error 1234", buf);
// Buffer too small.
- ASSERT_EQ(-1, strerror_r(0, buf, 2));
- ASSERT_EQ(ERANGE, errno);
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
+ errno = 0;
+ memset(buf, 0, sizeof(buf));
+ ASSERT_EQ(buf, strerror_r(4567, buf, 2));
+ ASSERT_STREQ("U", buf);
+ // The GNU strerror_r doesn't set errno (the POSIX one sets it to ERANGE).
+ ASSERT_EQ(0, errno);
}
TEST(string, strsignal) {
@@ -129,8 +142,7 @@
ASSERT_STREQ("Unknown signal 1001", strsignal1001);
}
-// TODO: where did these numbers come from?
-#define POS_ITER 10
+// TODO: where did this number come from?
#define ITER 500
// For every length we want to test, vary and change alignment
@@ -139,8 +151,9 @@
// These tests contributed by Intel Corporation.
// TODO: make these tests more intention-revealing and less random.
template<class Character>
-struct StringTestState {
- StringTestState(size_t MAX_LEN) : MAX_LEN(MAX_LEN) {
+class StringTestState {
+ public:
+ StringTestState(size_t MAX_LEN) : MAX_LEN(MAX_LEN), align1_index_(0), align2_index_(0) {
int max_alignment = 64;
// TODO: fix the tests to not sometimes use twice their specified "MAX_LEN".
@@ -159,15 +172,30 @@
free(glob_ptr2);
}
- void NewIteration() {
- int alignments[] = { 24, 32, 16, 48, 1, 2, 3, 0, 5, 11 };
- int usable_alignments = 10;
- int align1 = alignments[random() % (usable_alignments - 1)];
- int align2 = alignments[random() % (usable_alignments - 1)];
+ void BeginIterations() {
+ align1_index_ = 0;
+ align2_index_ = 0;
- ptr = glob_ptr + align1;
- ptr1 = glob_ptr1 + align1;
- ptr2 = glob_ptr2 + align2;
+ ResetPointers();
+ }
+
+ bool HasNextIteration() {
+ return (align1_index_ != (alignments_size - 1) || align2_index_ != (alignments_size - 1));
+ }
+
+ void NextIteration() {
+ if (align1_index_ == (alignments_size - 1) && align2_index_ == (alignments_size - 1)) {
+ return;
+ }
+
+ if (align1_index_ == (alignments_size - 1)) {
+ align1_index_ = 0;
+ align2_index_++;
+ } else {
+ align1_index_++;
+ }
+
+ ResetPointers();
}
const size_t MAX_LEN;
@@ -176,7 +204,10 @@
size_t len[ITER + 1];
private:
+ static size_t alignments[];
+ static size_t alignments_size;
Character *glob_ptr, *glob_ptr1, *glob_ptr2;
+ size_t align1_index_, align2_index_;
// Calculate input lengths and fill state.len with them.
// Test small lengths with more density than big ones. Manually push
@@ -193,19 +224,33 @@
}
len[n++] = MAX_LEN;
}
+
+ void ResetPointers() {
+ if (align1_index_ == alignments_size || align2_index_ == alignments_size) {
+ ptr = ptr1 = ptr2 = nullptr;
+ } else {
+ ptr = glob_ptr + alignments[align1_index_];
+ ptr1 = glob_ptr1 + alignments[align1_index_];
+ ptr2 = glob_ptr2 + alignments[align2_index_];
+ }
+ }
};
+template<class Character>
+size_t StringTestState<Character>::alignments[] = { 24, 32, 16, 48, 0, 1, 2, 3, 4, 5, 6, 7, 11 };
+
+template<class Character>
+size_t StringTestState<Character>::alignments_size = sizeof(alignments)/sizeof(size_t);
+
TEST(string, strcat) {
StringTestState<char> state(SMALL);
for (size_t i = 1; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
memset(state.ptr2, '\2', state.MAX_LEN);
state.ptr2[state.MAX_LEN - 1] = '\0';
memcpy(state.ptr, state.ptr2, 2 * state.MAX_LEN);
- memset(state.ptr1, random() & 255, state.len[i]);
+ memset(state.ptr1, 'L', state.len[i]);
state.ptr1[random() % state.len[i]] = '\0';
state.ptr1[state.len[i] - 1] = '\0';
@@ -378,13 +423,11 @@
}
TEST(string, strchr) {
- int seek_char = random() & 255;
+ int seek_char = 'R';
StringTestState<char> state(SMALL);
for (size_t i = 1; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
if (~seek_char > 0) {
memset(state.ptr1, ~seek_char, state.len[i]);
} else {
@@ -413,9 +456,7 @@
TEST(string, strcmp) {
StringTestState<char> state(SMALL);
for (size_t i = 1; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
memset(state.ptr1, 'v', state.MAX_LEN);
memset(state.ptr2, 'n', state.MAX_LEN);
state.ptr1[state.len[i] - 1] = '\0';
@@ -449,9 +490,7 @@
TEST(string, stpcpy) {
StringTestState<char> state(SMALL);
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
size_t pos = random() % state.MAX_LEN;
memset(state.ptr1, '\2', pos);
@@ -475,9 +514,7 @@
TEST(string, strcpy) {
StringTestState<char> state(SMALL);
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
size_t pos = random() % state.MAX_LEN;
memset(state.ptr1, '\2', pos);
@@ -500,12 +537,10 @@
}
TEST(string, strlcat) {
-#if defined(__BIONIC__)
+#if defined(STRLCAT_SUPPORTED)
StringTestState<char> state(SMALL);
for (size_t i = 0; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
memset(state.ptr2, '\2', state.MAX_LEN + state.len[i]);
state.ptr2[state.MAX_LEN - 1] = '\0';
memcpy(state.ptr, state.ptr2, state.MAX_LEN + state.len[i]);
@@ -525,21 +560,16 @@
ASSERT_TRUE(memcmp(state.ptr, state.ptr2, state.MAX_LEN + state.len[i]) == 0);
}
}
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
+#else
+ GTEST_LOG_(INFO) << "Skipping test, strlcat not supported on this platform.";
+#endif
}
TEST(string, strlcpy) {
-#if defined(__BIONIC__)
+#if defined(STRLCPY_SUPPORTED)
StringTestState<char> state(SMALL);
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
- int rand = random() & 255;
- if (rand < 1) {
- rand = 1;
- }
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
+ int rand = 'O';
memset(state.ptr1, rand, state.MAX_LEN);
size_t pos = random() % state.MAX_LEN;
@@ -548,7 +578,7 @@
}
memcpy(state.ptr, state.ptr1, state.MAX_LEN);
- memset(state.ptr2, random() & 255, state.MAX_LEN);
+ memset(state.ptr2, 'I', state.MAX_LEN);
memcpy(state.ptr + state.MAX_LEN, state.ptr2, state.MAX_LEN);
if (pos > state.MAX_LEN - 1) {
@@ -562,22 +592,20 @@
ASSERT_FALSE((memcmp(state.ptr1, state.ptr, state.MAX_LEN) != 0) ||
(memcmp(state.ptr2, state.ptr + state.MAX_LEN, state.MAX_LEN) != 0));
}
-#else // __BIONIC__
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif // __BIONIC__
+#else
+ GTEST_LOG_(INFO) << "Skipping test, strlcpy not supported on this platform.";
+#endif
}
TEST(string, strncat) {
StringTestState<char> state(SMALL);
for (size_t i = 1; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
memset(state.ptr2, '\2', state.MAX_LEN);
state.ptr2[state.MAX_LEN - 1] = '\0';
memcpy(state.ptr, state.ptr2, 2 * state.MAX_LEN);
- memset(state.ptr1, random() & 255, state.len[i]);
+ memset(state.ptr1, 'I', state.len[i]);
state.ptr1[random() % state.len[i]] = '\0';
state.ptr1[state.len[i] - 1] = '\0';
@@ -596,9 +624,7 @@
TEST(string, strncmp) {
StringTestState<char> state(SMALL);
for (size_t i = 1; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
memset(state.ptr1, 'v', state.MAX_LEN);
memset(state.ptr2, 'n', state.MAX_LEN);
state.ptr1[state.len[i] - 1] = '\0';
@@ -632,12 +658,8 @@
TEST(string, stpncpy) {
StringTestState<char> state(SMALL);
- for (size_t j = 0; j < ITER; j++) {
- state.NewIteration();
-
- // Choose a random value to fill the string, except \0 (string terminator),
- // or \1 (guarantees it's different from anything in ptr2).
- memset(state.ptr1, (random() % 254) + 2, state.MAX_LEN);
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
+ memset(state.ptr1, 'J', state.MAX_LEN);
// Choose a random size for our src buffer.
size_t ptr1_len = random() % state.MAX_LEN;
state.ptr1[ptr1_len] = '\0';
@@ -671,12 +693,10 @@
TEST(string, strncpy) {
StringTestState<char> state(SMALL);
- for (size_t j = 0; j < ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
// Choose a random value to fill the string, except \0 (string terminator),
// or \1 (guarantees it's different from anything in ptr2).
- memset(state.ptr1, (random() % 254) + 2, state.MAX_LEN);
+ memset(state.ptr1, 'K', state.MAX_LEN);
// Choose a random size for our src buffer.
size_t ptr1_len = random() % state.MAX_LEN;
state.ptr1[ptr1_len] = '\0';
@@ -709,12 +729,10 @@
}
TEST(string, strrchr) {
- int seek_char = random() & 255;
+ int seek_char = 'M';
StringTestState<char> state(SMALL);
for (size_t i = 1; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
if (~seek_char > 0) {
memset(state.ptr1, ~seek_char, state.len[i]);
} else {
@@ -741,12 +759,10 @@
}
TEST(string, memchr) {
- int seek_char = random() & 255;
+ int seek_char = 'N';
StringTestState<char> state(SMALL);
for (size_t i = 0; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
memset(state.ptr1, ~seek_char, state.len[i]);
size_t pos = random() % state.MAX_LEN;
@@ -772,12 +788,10 @@
}
TEST(string, memrchr) {
- int seek_char = random() & 255;
+ int seek_char = 'P';
StringTestState<char> state(SMALL);
for (size_t i = 0; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
memset(state.ptr1, ~seek_char, state.len[i]);
size_t pos = random() % state.MAX_LEN;
@@ -797,11 +811,9 @@
TEST(string, memcmp) {
StringTestState<char> state(SMALL);
for (size_t i = 0; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
- int c1 = random() & 0xff;
- int c2 = random() & 0xff;
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
+ int c1 = 'A';
+ int c2 = 'N';
memset(state.ptr1, c1, state.MAX_LEN);
memset(state.ptr2, c1, state.MAX_LEN);
@@ -820,9 +832,7 @@
StringTestState<wchar_t> state(SMALL);
for (size_t i = 0; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
long long mask = ((long long) 1 << 8 * sizeof(wchar_t)) - 1;
int c1 = rand() & mask;
int c2 = rand() & mask;
@@ -842,11 +852,9 @@
TEST(string, memcpy) {
StringTestState<char> state(LARGE);
- int rand = random() & 255;
+ int rand = 4;
for (size_t i = 0; i < state.n - 1; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
size_t pos = random() % (state.MAX_LEN - state.len[i]);
memset(state.ptr1, rand, state.len[i]);
@@ -864,11 +872,9 @@
TEST(string, memset) {
StringTestState<char> state(LARGE);
- char ch = random () & 255;
+ char ch = 'P';
for (size_t i = 0; i < state.n - 1; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
memset(state.ptr1, ~ch, state.MAX_LEN);
memcpy(state.ptr2, state.ptr1, state.MAX_LEN);
@@ -887,14 +893,12 @@
TEST(string, memmove) {
StringTestState<char> state(LARGE);
for (size_t i = 0; i < state.n - 1; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
- memset(state.ptr1, random() & 255, 2 * state.MAX_LEN);
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
+ memset(state.ptr1, 'Q', 2 * state.MAX_LEN);
size_t pos = random() % (state.MAX_LEN - state.len[i]);
- memset(state.ptr1, random() & 255, state.len[i]);
+ memset(state.ptr1, 'R', state.len[i]);
memcpy(state.ptr2, state.ptr1, 2 * state.MAX_LEN);
memcpy(state.ptr, state.ptr1, state.len[i]);
memcpy(state.ptr1 + pos, state.ptr, state.len[i]);
@@ -920,8 +924,8 @@
for (int i = 0; i < 5; i++) {
char* ptr2 = glob_ptr2 + alignments[i];
- memset(ptr1, random() & 255, 2 * len);
- memset(ptr1, random() & 255, len);
+ memset(ptr1, 'S', 2 * len);
+ memset(ptr1, 'T', len);
memcpy(ptr2, ptr1, 2 * len);
memcpy(ptr, ptr1, len);
memcpy(ptr1 + pos, ptr, len);
@@ -987,11 +991,9 @@
TEST(string, bcopy) {
StringTestState<char> state(LARGE);
for (size_t i = 0; i < state.n; i++) {
- for (size_t j = 0; j < POS_ITER; j++) {
- state.NewIteration();
-
- memset(state.ptr1, random() & 255, state.MAX_LEN);
- memset(state.ptr1 + state.MAX_LEN, random() & 255, state.MAX_LEN);
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
+ memset(state.ptr1, '4', state.MAX_LEN);
+ memset(state.ptr1 + state.MAX_LEN, 'a', state.MAX_LEN);
memcpy(state.ptr2, state.ptr1, 2 * state.MAX_LEN);
size_t start = random() % (2 * state.MAX_LEN - state.len[i]);
@@ -1005,10 +1007,8 @@
TEST(string, bzero) {
StringTestState<char> state(LARGE);
- for (size_t j = 0; j < ITER; j++) {
- state.NewIteration();
-
- memset(state.ptr1, random() & 255, state.MAX_LEN);
+ for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
+ memset(state.ptr1, 'R', state.MAX_LEN);
size_t start = random() % state.MAX_LEN;
size_t end = start + random() % (state.MAX_LEN - start);
@@ -1105,6 +1105,36 @@
RunSrcDstBufferOverreadTest(DoStrcpyTest);
}
+#if defined(STRLCPY_SUPPORTED)
+static void DoStrlcpyTest(uint8_t* src, uint8_t* dst, size_t len) {
+ if (len >= 1) {
+ memset(src, (32 + (len % 96)), len - 1);
+ src[len-1] = '\0';
+ memset(dst, 0, len);
+ ASSERT_EQ(len-1, strlcpy(reinterpret_cast<char*>(dst),
+ reinterpret_cast<char*>(src), len));
+ ASSERT_TRUE(memcmp(src, dst, len) == 0);
+ }
+}
+#endif
+
+TEST(string, strlcpy_align) {
+#if defined(STRLCPY_SUPPORTED)
+ RunSrcDstBufferAlignTest(LARGE, DoStrlcpyTest);
+#else
+ GTEST_LOG_(INFO) << "Skipping test, strlcpy not supported on this platform.";
+#endif
+}
+
+TEST(string, strlcpy_overread) {
+#if defined(STRLCPY_SUPPORTED)
+ RunSrcDstBufferOverreadTest(DoStrlcpyTest);
+#else
+ GTEST_LOG_(INFO) << "Skipping test, strlcpy not supported on this platform.";
+#endif
+}
+
+
static void DoStpcpyTest(uint8_t* src, uint8_t* dst, size_t len) {
if (len >= 1) {
memset(src, (32 + (len % 96)), len - 1);
@@ -1177,6 +1207,55 @@
RunSrcDstBufferOverreadTest(DoStrcatTest);
}
+#if defined(STRLCAT_SUPPORTED)
+static void DoStrlcatTest(uint8_t* src, uint8_t* dst, size_t len) {
+ if (len >= 1) {
+ int value = 32 + (len % 96);
+ memset(src, value, len - 1);
+ src[len-1] = '\0';
+
+ if (len >= STRCAT_DST_LEN) {
+ // Create a small buffer for doing quick compares in each loop.
+ uint8_t cmp_buf[STRCAT_DST_LEN];
+ // Make sure dst string contains a different value then the src string.
+ int value2 = 32 + (value + 2) % 96;
+ memset(cmp_buf, value2, sizeof(cmp_buf));
+
+ for (size_t i = 1; i <= STRCAT_DST_LEN; i++) {
+ memset(dst, value2, i-1);
+ memset(dst+i-1, 0, len-i);
+ src[len-i] = '\0';
+ ASSERT_EQ(len-1, strlcat(reinterpret_cast<char*>(dst),
+ reinterpret_cast<char*>(src), len));
+ ASSERT_TRUE(memcmp(dst, cmp_buf, i-1) == 0);
+ ASSERT_TRUE(memcmp(src, dst+i-1, len-i+1) == 0);
+ }
+ } else {
+ dst[0] = '\0';
+ ASSERT_EQ(len-1, strlcat(reinterpret_cast<char*>(dst),
+ reinterpret_cast<char*>(src), len));
+ ASSERT_TRUE(memcmp(src, dst, len) == 0);
+ }
+ }
+}
+#endif
+
+TEST(string, strlcat_align) {
+#if defined(STRLCAT_SUPPORTED)
+ RunSrcDstBufferAlignTest(MEDIUM, DoStrlcatTest, LargeSetIncrement);
+#else
+ GTEST_LOG_(INFO) << "Skipping test, strlcat not supported on this platform.";
+#endif
+}
+
+TEST(string, strlcat_overread) {
+#if defined(STRLCAT_SUPPORTED)
+ RunSrcDstBufferOverreadTest(DoStrlcatTest);
+#else
+ GTEST_LOG_(INFO) << "Skipping test, strlcat not supported on this platform.";
+#endif
+}
+
static void DoStrcmpTest(uint8_t* buf1, uint8_t* buf2, size_t len) {
if (len >= 1) {
memset(buf1, (32 + (len % 96)), len - 1);
@@ -1287,3 +1366,22 @@
TEST(string, strchr_overread) {
RunSingleBufferOverreadTest(DoStrchrTest);
}
+
+static void TestBasename(const char* in, const char* expected_out) {
+ errno = 0;
+ const char* out = basename(in);
+ ASSERT_STREQ(expected_out, out) << in;
+ ASSERT_EQ(0, errno) << in;
+}
+
+TEST(string, __gnu_basename) {
+ TestBasename("", "");
+ TestBasename("/usr/lib", "lib");
+ TestBasename("/usr/", "");
+ TestBasename("usr", "usr");
+ TestBasename("/", "");
+ TestBasename(".", ".");
+ TestBasename("..", "..");
+ TestBasename("///", "");
+ TestBasename("//usr//lib//", "");
+}
diff --git a/tests/strings_test.cpp b/tests/strings_test.cpp
index 5200859..823aa4f 100644
--- a/tests/strings_test.cpp
+++ b/tests/strings_test.cpp
@@ -17,6 +17,7 @@
#include <gtest/gtest.h>
#include <errno.h>
+#include <locale.h>
#include <strings.h>
TEST(strings, ffs) {
@@ -30,3 +31,33 @@
ASSERT_EQ(27, ffs(0x04000000));
ASSERT_EQ(32, ffs(0x80000000));
}
+
+TEST(strings, strcasecmp) {
+ ASSERT_EQ(0, strcasecmp("hello", "HELLO"));
+ ASSERT_LT(strcasecmp("hello1", "hello2"), 0);
+ ASSERT_GT(strcasecmp("hello2", "hello1"), 0);
+}
+
+TEST(strings, strcasecmp_l) {
+ locale_t l = newlocale(LC_ALL, "C", 0);
+ ASSERT_EQ(0, strcasecmp_l("hello", "HELLO", l));
+ ASSERT_LT(strcasecmp_l("hello1", "hello2", l), 0);
+ ASSERT_GT(strcasecmp_l("hello2", "hello1", l), 0);
+ freelocale(l);
+}
+
+TEST(strings, strncasecmp) {
+ ASSERT_EQ(0, strncasecmp("hello", "HELLO", 3));
+ ASSERT_EQ(0, strncasecmp("abcXX", "ABCYY", 3));
+ ASSERT_LT(strncasecmp("hello1", "hello2", 6), 0);
+ ASSERT_GT(strncasecmp("hello2", "hello1", 6), 0);
+}
+
+TEST(strings, strncasecmp_l) {
+ locale_t l = newlocale(LC_ALL, "C", 0);
+ ASSERT_EQ(0, strncasecmp_l("hello", "HELLO", 3, l));
+ ASSERT_EQ(0, strncasecmp_l("abcXX", "ABCYY", 3, l));
+ ASSERT_LT(strncasecmp_l("hello1", "hello2", 6, l), 0);
+ ASSERT_GT(strncasecmp_l("hello2", "hello1", 6, l), 0);
+ freelocale(l);
+}
diff --git a/tests/stubs_test.cpp b/tests/stubs_test.cpp
index 9b0c231..89d67cb 100644
--- a/tests/stubs_test.cpp
+++ b/tests/stubs_test.cpp
@@ -16,98 +16,246 @@
#include <gtest/gtest.h>
-#include <sys/types.h>
-#include <sys/cdefs.h>
+// Below are the header files we want to test.
+#include <grp.h>
#include <pwd.h>
+
#include <errno.h>
#include <limits.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
#include <unistd.h>
-#if defined(__BIONIC__)
-#define CHECK_GETPWNAM_FOR(username, uid, uid_type) \
- SCOPED_TRACE(username); \
- ASSERT_NO_FATAL_FAILURE(check_getpwnam(username, uid, uid_type));
-
-typedef enum {
+enum uid_type_t {
TYPE_SYSTEM,
TYPE_APP
-} uid_type_t;
+};
-static void check_getpwnam(const char* username, uid_t uid, uid_type_t uid_type) {
- errno = 0;
- passwd* pwd = getpwuid(uid);
+#if defined(__BIONIC__)
+
+static void check_passwd(const passwd* pwd, const char* username, uid_t uid, uid_type_t uid_type) {
ASSERT_TRUE(pwd != NULL);
- ASSERT_EQ(0, errno);
- EXPECT_STREQ(username, pwd->pw_name);
- EXPECT_EQ(uid, pwd->pw_uid);
- EXPECT_EQ(uid, pwd->pw_gid);
+ ASSERT_STREQ(username, pwd->pw_name);
+ ASSERT_EQ(uid, pwd->pw_uid);
+ ASSERT_EQ(uid, pwd->pw_gid);
ASSERT_EQ(NULL, pwd->pw_passwd);
#ifdef __LP64__
ASSERT_EQ(NULL, pwd->pw_gecos);
#endif
if (uid_type == TYPE_SYSTEM) {
- EXPECT_STREQ("/", pwd->pw_dir);
- } else if (uid_type == TYPE_APP) {
- EXPECT_STREQ("/data", pwd->pw_dir);
+ ASSERT_STREQ("/", pwd->pw_dir);
+ } else {
+ ASSERT_STREQ("/data", pwd->pw_dir);
}
-
- EXPECT_STREQ("/system/bin/sh", pwd->pw_shell);
+ ASSERT_STREQ("/system/bin/sh", pwd->pw_shell);
}
-#else
-#define CHECK_GETPWNAM_FOR(username, uid, uid_type) \
- GTEST_LOG_(INFO) << "This test does nothing.\n";
+
+static void check_getpwuid(const char* username, uid_t uid, uid_type_t uid_type) {
+ errno = 0;
+ passwd* pwd = getpwuid(uid);
+ ASSERT_EQ(0, errno);
+ SCOPED_TRACE("getpwuid");
+ check_passwd(pwd, username, uid, uid_type);
+}
+
+static void check_getpwnam(const char* username, uid_t uid, uid_type_t uid_type) {
+ errno = 0;
+ passwd* pwd = getpwnam(username);
+ ASSERT_EQ(0, errno);
+ SCOPED_TRACE("getpwnam");
+ check_passwd(pwd, username, uid, uid_type);
+}
+
+static void check_getpwuid_r(const char* username, uid_t uid, uid_type_t uid_type) {
+ passwd pwd_storage;
+ char buf[512];
+ int result;
+
+ errno = 0;
+ passwd* pwd = NULL;
+ result = getpwuid_r(uid, &pwd_storage, buf, sizeof(buf), &pwd);
+ ASSERT_EQ(0, result);
+ ASSERT_EQ(0, errno);
+ SCOPED_TRACE("getpwuid_r");
+ check_passwd(pwd, username, uid, uid_type);
+}
+
+static void check_getpwnam_r(const char* username, uid_t uid, uid_type_t uid_type) {
+ passwd pwd_storage;
+ char buf[512];
+ int result;
+
+ errno = 0;
+ passwd* pwd = NULL;
+ result = getpwnam_r(username, &pwd_storage, buf, sizeof(buf), &pwd);
+ ASSERT_EQ(0, result);
+ ASSERT_EQ(0, errno);
+ SCOPED_TRACE("getpwnam_r");
+ check_passwd(pwd, username, uid, uid_type);
+}
+
+static void check_get_passwd(const char* username, uid_t uid, uid_type_t uid_type) {
+ check_getpwuid(username, uid, uid_type);
+ check_getpwnam(username, uid, uid_type);
+ check_getpwuid_r(username, uid, uid_type);
+ check_getpwnam_r(username, uid, uid_type);
+}
+
+#else // !defined(__BIONIC__)
+
+static void check_get_passwd(const char* /* username */, uid_t /* uid */, uid_type_t /* uid_type */) {
+ GTEST_LOG_(INFO) << "This test is about uid/username translation for Android, which does nothing on libc other than bionic.\n";
+}
+
#endif
TEST(getpwnam, system_id_root) {
- CHECK_GETPWNAM_FOR("root", 0, TYPE_SYSTEM);
+ check_get_passwd("root", 0, TYPE_SYSTEM);
}
TEST(getpwnam, system_id_system) {
- CHECK_GETPWNAM_FOR("system", 1000, TYPE_SYSTEM);
+ check_get_passwd("system", 1000, TYPE_SYSTEM);
}
TEST(getpwnam, app_id_radio) {
- CHECK_GETPWNAM_FOR("radio", 1001, TYPE_SYSTEM);
+ check_get_passwd("radio", 1001, TYPE_SYSTEM);
}
TEST(getpwnam, app_id_nobody) {
- CHECK_GETPWNAM_FOR("nobody", 9999, TYPE_SYSTEM);
-}
-
-TEST(getpwnam, app_id_all_a0) {
- CHECK_GETPWNAM_FOR("all_a0", 50000, TYPE_APP);
-}
-
-TEST(getpwnam, app_id_u1_a40000) {
- CHECK_GETPWNAM_FOR("u1_a40000", 150000, TYPE_APP);
+ check_get_passwd("nobody", 9999, TYPE_SYSTEM);
}
TEST(getpwnam, app_id_u0_a0) {
- CHECK_GETPWNAM_FOR("u0_a0", 10000, TYPE_APP);
+ check_get_passwd("u0_a0", 10000, TYPE_APP);
}
TEST(getpwnam, app_id_u0_a1234) {
- CHECK_GETPWNAM_FOR("u0_a1234", 11234, TYPE_APP);
+ check_get_passwd("u0_a1234", 11234, TYPE_APP);
}
-TEST(getpwnam, app_id_u0_a9999) {
- CHECK_GETPWNAM_FOR("u0_a9999", 19999, TYPE_APP);
+// Test the difference between uid and shared gid.
+TEST(getpwnam, app_id_u0_a49999) {
+ check_get_passwd("u0_a49999", 59999, TYPE_APP);
}
-// nonsensical, but expected
+TEST(getpwnam, app_id_u0_i1) {
+ check_get_passwd("u0_i1", 99001, TYPE_APP);
+}
+
TEST(getpwnam, app_id_u1_root) {
- CHECK_GETPWNAM_FOR("u1_root", 100000, TYPE_SYSTEM);
+ check_get_passwd("u1_root", 100000, TYPE_SYSTEM);
}
TEST(getpwnam, app_id_u1_radio) {
- CHECK_GETPWNAM_FOR("u1_radio", 101001, TYPE_SYSTEM);
+ check_get_passwd("u1_radio", 101001, TYPE_SYSTEM);
}
TEST(getpwnam, app_id_u1_a0) {
- CHECK_GETPWNAM_FOR("u1_a0", 110000, TYPE_APP);
+ check_get_passwd("u1_a0", 110000, TYPE_APP);
+}
+
+TEST(getpwnam, app_id_u1_a40000) {
+ check_get_passwd("u1_a40000", 150000, TYPE_APP);
}
TEST(getpwnam, app_id_u1_i0) {
- CHECK_GETPWNAM_FOR("u1_i0", 199000, TYPE_APP);
+ check_get_passwd("u1_i0", 199000, TYPE_APP);
+}
+
+#if defined(__BIONIC__)
+
+static void check_group(const group* grp, const char* group_name, gid_t gid) {
+ ASSERT_TRUE(grp != NULL);
+ ASSERT_STREQ(group_name, grp->gr_name);
+ ASSERT_EQ(gid, grp->gr_gid);
+ ASSERT_TRUE(grp->gr_mem != NULL);
+ ASSERT_STREQ(group_name, grp->gr_mem[0]);
+ ASSERT_TRUE(grp->gr_mem[1] == NULL);
+}
+
+static void check_getgrgid(const char* group_name, gid_t gid) {
+ errno = 0;
+ group* grp = getgrgid(gid);
+ ASSERT_EQ(0, errno);
+ SCOPED_TRACE("getgrgid");
+ check_group(grp, group_name, gid);
+}
+
+static void check_getgrnam(const char* group_name, gid_t gid) {
+ errno = 0;
+ group* grp = getgrnam(group_name);
+ ASSERT_EQ(0, errno);
+ SCOPED_TRACE("getgrnam");
+ check_group(grp, group_name, gid);
+}
+
+static void check_get_group(const char* group_name, gid_t gid) {
+ check_getgrgid(group_name, gid);
+ check_getgrnam(group_name, gid);
+}
+
+#else // !defined(__BIONIC__)
+
+static void check_get_group(const char* /* group_name */, gid_t /* gid */) {
+ GTEST_LOG_(INFO) << "This test is about gid/group_name translation for Android, which does nothing on libc other than bionic.\n";
+}
+
+#endif
+
+TEST(getgrnam, system_id_root) {
+ check_get_group("root", 0);
+}
+
+TEST(getgrnam, system_id_system) {
+ check_get_group("system", 1000);
+}
+
+TEST(getgrnam, app_id_radio) {
+ check_get_group("radio", 1001);
+}
+
+TEST(getgrnam, app_id_nobody) {
+ check_get_group("nobody", 9999);
+}
+
+TEST(getgrnam, app_id_u0_a0) {
+ check_get_group("u0_a0", 10000);
+}
+
+TEST(getgrnam, app_id_u0_a1234) {
+ check_get_group("u0_a1234", 11234);
+}
+
+TEST(getgrnam, app_id_u0_a9999) {
+ check_get_group("u0_a9999", 19999);
+}
+
+// Test the difference between uid and shared gid.
+TEST(getgrnam, app_id_all_a9999) {
+ check_get_group("all_a9999", 59999);
+}
+
+TEST(getgrnam, app_id_u0_i1) {
+ check_get_group("u0_i1", 99001);
+}
+
+TEST(getgrnam, app_id_u1_root) {
+ check_get_group("u1_root", 100000);
+}
+
+TEST(getgrnam, app_id_u1_radio) {
+ check_get_group("u1_radio", 101001);
+}
+
+TEST(getgrnam, app_id_u1_a0) {
+ check_get_group("u1_a0", 110000);
+}
+
+TEST(getgrnam, app_id_u1_a40000) {
+ check_get_group("u1_a40000", 150000);
+}
+
+TEST(getgrnam, app_id_u1_i0) {
+ check_get_group("u1_i0", 199000);
}
diff --git a/tests/sys_resource_test.cpp b/tests/sys_resource_test.cpp
index d6d99a0..91d07ab 100644
--- a/tests/sys_resource_test.cpp
+++ b/tests/sys_resource_test.cpp
@@ -18,17 +18,6 @@
#include <sys/resource.h>
-#if defined(__GLIBC__)
-/* The host glibc we're currently building with doesn't have prlimit64 yet. */
-static int prlimit64(pid_t, int resource, const struct rlimit64* new_limit, struct rlimit64* old_limit) {
- if (new_limit != NULL) {
- return setrlimit64(resource, new_limit);
- } else {
- return getrlimit64(resource, old_limit);
- }
-}
-#endif
-
TEST(sys_resource, smoke) {
#if defined(__LP64__) || defined(__GLIBC__)
ASSERT_EQ(sizeof(rlimit), sizeof(rlimit64));
diff --git a/tests/sys_socket_test.cpp b/tests/sys_socket_test.cpp
index 0bde024..eb8c33e 100644
--- a/tests/sys_socket_test.cpp
+++ b/tests/sys_socket_test.cpp
@@ -22,24 +22,6 @@
#include <sys/un.h>
#include <fcntl.h>
-#if defined(__BIONIC__)
- #define ACCEPT4_SUPPORTED 1
- #define RECVMMSG_SUPPORTED 1
- #define SENDMMSG_SUPPORTED 1
-#elif defined(__GLIBC_PREREQ)
- #if __GLIBC_PREREQ(2, 9)
- #define ACCEPT4_SUPPORTED 1
- #endif
- #if __GLIBC_PREREQ(2, 12)
- #define RECVMMSG_SUPPORTED 1
- #endif
- #if __GLIBC_PREREQ(2, 14)
- #define SENDMMSG_SUPPORTED 1
- #endif
-#endif
-
-#if defined(ACCEPT4_SUPPORTED) || defined(RECVMMSG_SUPPORTED) || defined(SENDMMSG_SUPPORTED)
-
#define SOCK_PATH "test"
static void* ConnectFn(void* data) {
@@ -105,18 +87,12 @@
close(fd);
}
-#endif
TEST(sys_socket, accept4_error) {
-#if defined(ACCEPT4_SUPPORTED)
ASSERT_EQ(-1, accept4(-1, NULL, NULL, 0));
ASSERT_EQ(EBADF, errno);
-#else
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif
}
-#if defined(ACCEPT4_SUPPORTED)
static void TestAccept4(struct sockaddr_un* addr, int fd) {
socklen_t len = sizeof(*addr);
int fd_acc = accept4(fd, reinterpret_cast<struct sockaddr*>(addr), &len, SOCK_CLOEXEC);
@@ -127,17 +103,11 @@
close(fd_acc);
}
-#endif
TEST(sys_socket, accept4_smoke) {
-#if defined(ACCEPT4_SUPPORTED)
RunTest(TestAccept4, NULL);
-#else
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif
}
-#if defined(RECVMMSG_SUPPORTED)
const char* g_RecvMsgs[] = {
"RECVMMSG_ONE",
"RECVMMSG_TWO",
@@ -188,26 +158,16 @@
close(fd_acc);
}
-#endif
TEST(sys_socket, recvmmsg_smoke) {
-#if defined(RECVMMSG_SUPPORTED)
RunTest(TestRecvMMsg, SendMultiple);
-#else
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif
}
TEST(sys_socket, recvmmsg_error) {
-#if defined(RECVMMSG_SUPPORTED)
ASSERT_EQ(-1, recvmmsg(-1, NULL, 0, 0, NULL));
ASSERT_EQ(EBADF, errno);
-#else
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif
}
-#if defined(SENDMMSG_SUPPORTED)
const char* g_SendMsgs[] = {
"MSG_ONE",
"MSG_TWO",
@@ -256,21 +216,12 @@
close(fd_acc);
}
-#endif
TEST(sys_socket, sendmmsg_smoke) {
-#if defined(SENDMMSG_SUPPORTED)
RunTest(TestSendMMsg, SendMMsg);
-#else
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif
}
TEST(sys_socket, sendmmsg_error) {
-#if defined(SENDMMSG_SUPPORTED)
ASSERT_EQ(-1, sendmmsg(-1, NULL, 0, 0));
ASSERT_EQ(EBADF, errno);
-#else
- GTEST_LOG_(INFO) << "This test does nothing.\n";
-#endif
}
diff --git a/tests/sys_stat_test.cpp b/tests/sys_stat_test.cpp
index 64049ab..e465774 100644
--- a/tests/sys_stat_test.cpp
+++ b/tests/sys_stat_test.cpp
@@ -55,6 +55,18 @@
ASSERT_EQ(EBADF, errno);
}
+TEST(sys_stat, mkfifo_failure) {
+ errno = 0;
+ ASSERT_EQ(-1, mkfifo("/", 0666));
+ ASSERT_EQ(EEXIST, errno);
+}
+
+TEST(sys_stat, mkfifoat_failure) {
+ errno = 0;
+ ASSERT_EQ(-1, mkfifoat(-2, "x", 0666));
+ ASSERT_EQ(EBADF, errno);
+}
+
TEST(sys_stat, mkfifo) {
if (getuid() == 0) {
// Racy but probably sufficient way to get a suitable filename.
@@ -70,6 +82,7 @@
ASSERT_TRUE(S_ISFIFO(sb.st_mode));
unlink(path.c_str());
} else {
+ // SELinux policy forbids us from creating FIFOs. http://b/17646702.
GTEST_LOG_(INFO) << "This test only performs a test when run as root.";
}
}
diff --git a/tests/libs/dlopen_testlib_answer.cpp b/tests/sys_sysinfo_test.cpp
similarity index 61%
copy from tests/libs/dlopen_testlib_answer.cpp
copy to tests/sys_sysinfo_test.cpp
index a4d7504..b00e13f 100644
--- a/tests/libs/dlopen_testlib_answer.cpp
+++ b/tests/sys_sysinfo_test.cpp
@@ -14,12 +14,20 @@
* limitations under the License.
*/
-extern "C" int dlopen_test_get_answer() {
- return __ANSWER;
-}
+#include <gtest/gtest.h>
-#ifdef __ANSWER2
-extern "C" int dlopen_test_get_answer2() {
- return __ANSWER2;
+#include <sys/sysinfo.h>
+
+TEST(sys_sysinfo, smoke) {
+ int nprocessor = get_nprocs();
+ ASSERT_GT(nprocessor, 0);
+
+ int nprocessor_conf = get_nprocs_conf();
+ ASSERT_GE(nprocessor_conf, nprocessor);
+
+ long avail_phys_pages = get_avphys_pages();
+ ASSERT_GT(avail_phys_pages, 0);
+
+ long phys_pages = get_phys_pages();
+ ASSERT_GE(phys_pages, avail_phys_pages);
}
-#endif
diff --git a/tests/system_properties_test.cpp b/tests/system_properties_test.cpp
index bfd5854..c7bfee6 100644
--- a/tests/system_properties_test.cpp
+++ b/tests/system_properties_test.cpp
@@ -15,8 +15,10 @@
*/
#include <gtest/gtest.h>
-#include <sys/wait.h>
+#include "BionicDeathTest.h"
+
#include <errno.h>
+#include <sys/wait.h>
#include <unistd.h>
#include <string>
@@ -398,9 +400,10 @@
WTERMSIG(exit_status) == SIGABRT);
}
-TEST(properties_DeathTest, read_only) {
+class properties_DeathTest : public BionicDeathTest {};
+
+TEST_F(properties_DeathTest, read_only) {
#if defined(__BIONIC__)
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
// This test only makes sense if we're talking to the real system property service.
struct stat sb;
diff --git a/tests/time_test.cpp b/tests/time_test.cpp
index d637df2..691d8ff 100644
--- a/tests/time_test.cpp
+++ b/tests/time_test.cpp
@@ -17,16 +17,18 @@
#include <time.h>
#include <errno.h>
-#include <features.h>
#include <gtest/gtest.h>
#include <pthread.h>
#include <signal.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <unistd.h>
#include "ScopedSignalHandler.h"
+#include "private/bionic_constants.h"
+
TEST(time, gmtime) {
time_t t = 0;
tm* broken_down = gmtime(&t);
@@ -70,6 +72,30 @@
ASSERT_EQ(0, pthread_join(t, &result));
}
+TEST(time, mktime_empty_TZ) {
+ // tzcode used to have a bug where it didn't reinitialize some internal state.
+
+ // Choose a time where DST is set.
+ struct tm t;
+ memset(&t, 0, sizeof(tm));
+ t.tm_year = 1980 - 1900;
+ t.tm_mon = 6;
+ t.tm_mday = 2;
+
+ setenv("TZ", "America/Los_Angeles", 1);
+ tzset();
+ ASSERT_EQ(static_cast<time_t>(331372800U), mktime(&t));
+
+ memset(&t, 0, sizeof(tm));
+ t.tm_year = 1980 - 1900;
+ t.tm_mon = 6;
+ t.tm_mday = 2;
+
+ setenv("TZ", "", 1); // Implies UTC.
+ tzset();
+ ASSERT_EQ(static_cast<time_t>(331344000U), mktime(&t));
+}
+
TEST(time, mktime_10310929) {
struct tm t;
memset(&t, 0, sizeof(tm));
@@ -417,7 +443,7 @@
ts2.tv_nsec -= ts1.tv_nsec;
if (ts2.tv_nsec < 0) {
--ts2.tv_sec;
- ts2.tv_nsec += 1000000000;
+ ts2.tv_nsec += NS_PER_S;
}
// Should be less than (a very generous, to try to avoid flakiness) 1000000ns.
@@ -425,6 +451,55 @@
ASSERT_LT(ts2.tv_nsec, 1000000);
}
+TEST(time, clock) {
+ // clock(3) is hard to test, but a 1s sleep should cost less than 1ms.
+ clock_t t0 = clock();
+ sleep(1);
+ clock_t t1 = clock();
+ ASSERT_LT(t1 - t0, CLOCKS_PER_SEC / 1000);
+}
+
+pid_t GetInvalidPid() {
+ FILE* fp = fopen("/proc/sys/kernel/pid_max", "r");
+ long pid_max;
+ fscanf(fp, "%ld", &pid_max);
+ pid_t invalid_pid = static_cast<pid_t>(pid_max + 1);
+ fclose(fp);
+ return invalid_pid;
+}
+
+TEST(time, clock_getcpuclockid) {
+ // For current process.
+ clockid_t clockid;
+ ASSERT_EQ(0, clock_getcpuclockid(getpid(), &clockid));
+
+ timespec ts;
+ ASSERT_EQ(0, clock_gettime(clockid, &ts));
+
+ // For parent process.
+ ASSERT_EQ(0, clock_getcpuclockid(getppid(), &clockid));
+ ASSERT_EQ(0, clock_gettime(clockid, &ts));
+
+ // For invalid process.
+ // We can't use -1 for invalid pid here, because clock_getcpuclockid() can't detect it.
+ errno = 0;
+ ASSERT_EQ(ESRCH, clock_getcpuclockid(GetInvalidPid(), &clockid));
+ ASSERT_EQ(0, errno);
+}
+
+TEST(time, clock_settime) {
+ errno = 0;
+ timespec ts;
+ ASSERT_EQ(-1, clock_settime(-1, &ts));
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(time, clock_nanosleep) {
+ timespec in;
+ timespec out;
+ ASSERT_EQ(EINVAL, clock_nanosleep(-1, 0, &in, &out));
+}
+
// Test to verify that disarming a repeatable timer disables the
// callbacks.
TEST(time, timer_disarm_terminates) {
diff --git a/tests/uchar_test.cpp b/tests/uchar_test.cpp
index eca3c5e..c887f8a 100644
--- a/tests/uchar_test.cpp
+++ b/tests/uchar_test.cpp
@@ -19,7 +19,6 @@
#if defined(__BIONIC__)
#define HAVE_UCHAR 1
#elif defined(__GLIBC__)
-#include <features.h>
#define HAVE_UCHAR __GLIBC_PREREQ(2, 16)
#endif
diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp
index 8195ea8..34b7bf3 100644
--- a/tests/unistd_test.cpp
+++ b/tests/unistd_test.cpp
@@ -15,6 +15,7 @@
*/
#include <gtest/gtest.h>
+#include "BionicDeathTest.h"
#include "ScopedSignalHandler.h"
#include "TemporaryFile.h"
@@ -22,14 +23,12 @@
#include <fcntl.h>
#include <limits.h>
#include <stdint.h>
-#include <unistd.h>
+#include <sys/param.h>
#include <sys/syscall.h>
#include <sys/types.h>
+#include <sys/utsname.h>
#include <sys/wait.h>
-
-TEST(unistd, sysconf_SC_MONOTONIC_CLOCK) {
- ASSERT_GT(sysconf(_SC_MONOTONIC_CLOCK), 0);
-}
+#include <unistd.h>
static void* get_brk() {
return sbrk(0);
@@ -247,8 +246,6 @@
}
TEST(unistd, unsetenv_EINVAL) {
- EXPECT_EQ(-1, unsetenv(NULL));
- EXPECT_EQ(EINVAL, errno);
EXPECT_EQ(-1, unsetenv(""));
EXPECT_EQ(EINVAL, errno);
EXPECT_EQ(-1, unsetenv("a=b"));
@@ -462,3 +459,345 @@
ASSERT_EQ(0, pthread_join(t, &result));
ASSERT_EQ(NULL, result);
}
+
+class unistd_DeathTest : public BionicDeathTest {};
+
+TEST_F(unistd_DeathTest, abort) {
+ ASSERT_EXIT(abort(), testing::KilledBySignal(SIGABRT), "");
+}
+
+TEST(unistd, sethostname) {
+ // The permissions check happens before the argument check, so this will
+ // fail for a different reason if you're running as root than if you're
+ // not, but it'll fail either way. Checking that we have the symbol is about
+ // all we can do for sethostname(2).
+ ASSERT_EQ(-1, sethostname("", -1));
+}
+
+TEST(unistd, gethostname) {
+ char hostname[HOST_NAME_MAX + 1];
+ memset(hostname, 0, sizeof(hostname));
+
+ // Can we get the hostname with a big buffer?
+ ASSERT_EQ(0, gethostname(hostname, HOST_NAME_MAX));
+
+ // Can we get the hostname with a right-sized buffer?
+ errno = 0;
+ ASSERT_EQ(0, gethostname(hostname, strlen(hostname) + 1));
+
+ // Does uname(2) agree?
+ utsname buf;
+ ASSERT_EQ(0, uname(&buf));
+ ASSERT_EQ(0, strncmp(hostname, buf.nodename, SYS_NMLN));
+ ASSERT_GT(strlen(hostname), 0U);
+
+ // Do we correctly detect truncation?
+ errno = 0;
+ ASSERT_EQ(-1, gethostname(hostname, strlen(hostname)));
+ ASSERT_EQ(ENAMETOOLONG, errno);
+}
+
+TEST(unistd, pathconf_fpathconf) {
+ TemporaryFile tf;
+ long rc = 0L;
+ // As a file system's block size is always power of 2, the configure values
+ // for ALLOC and XFER should be power of 2 as well.
+ rc = pathconf(tf.filename, _PC_ALLOC_SIZE_MIN);
+ ASSERT_TRUE(rc > 0 && powerof2(rc));
+ rc = pathconf(tf.filename, _PC_REC_MIN_XFER_SIZE);
+ ASSERT_TRUE(rc > 0 && powerof2(rc));
+ rc = pathconf(tf.filename, _PC_REC_XFER_ALIGN);
+ ASSERT_TRUE(rc > 0 && powerof2(rc));
+
+ rc = fpathconf(tf.fd, _PC_ALLOC_SIZE_MIN);
+ ASSERT_TRUE(rc > 0 && powerof2(rc));
+ rc = fpathconf(tf.fd, _PC_REC_MIN_XFER_SIZE);
+ ASSERT_TRUE(rc > 0 && powerof2(rc));
+ rc = fpathconf(tf.fd, _PC_REC_XFER_ALIGN);
+ ASSERT_TRUE(rc > 0 && powerof2(rc));
+}
+
+
+TEST(unistd, _POSIX_macros_smoke) {
+ // Make a tight verification of _POSIX_* / _POSIX2_* / _XOPEN_* macros, to prevent change by mistake.
+ // Verify according to POSIX.1-2008.
+ EXPECT_EQ(200809L, _POSIX_VERSION);
+
+ EXPECT_GT(_POSIX_AIO_LISTIO_MAX, 0);
+ EXPECT_GT(_POSIX_AIO_MAX, 0);
+ EXPECT_GT(_POSIX_ARG_MAX, 0);
+ EXPECT_GT(_POSIX_CHILD_MAX, 0);
+ EXPECT_NE(_POSIX_CHOWN_RESTRICTED, -1);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_CLOCK_SELECTION);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_CPUTIME);
+ EXPECT_GT(_POSIX_DELAYTIMER_MAX, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_FSYNC);
+ EXPECT_GT(_POSIX_HOST_NAME_MAX, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_IPV6);
+ EXPECT_GT(_POSIX_JOB_CONTROL, 0);
+ EXPECT_GT(_POSIX_LINK_MAX, 0);
+ EXPECT_GT(_POSIX_LOGIN_NAME_MAX, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_MAPPED_FILES);
+ EXPECT_GT(_POSIX_MAX_CANON, 0);
+ EXPECT_GT(_POSIX_MAX_INPUT, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_MEMLOCK);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_MEMLOCK_RANGE);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_MEMORY_PROTECTION);
+ EXPECT_EQ(0, _POSIX_MONOTONIC_CLOCK);
+ EXPECT_GT(_POSIX_MQ_OPEN_MAX, 0);
+ EXPECT_GT(_POSIX_MQ_PRIO_MAX, 0);
+ EXPECT_GT(_POSIX_NAME_MAX, 0);
+ EXPECT_GT(_POSIX_NGROUPS_MAX, 0);
+ EXPECT_GT(_POSIX_NO_TRUNC, 0);
+ EXPECT_GT(_POSIX_OPEN_MAX, 0);
+ EXPECT_GT(_POSIX_PATH_MAX, 0);
+ EXPECT_GT(_POSIX_PIPE_BUF, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_PRIORITY_SCHEDULING);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_RAW_SOCKETS);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_READER_WRITER_LOCKS);
+ EXPECT_GT(_POSIX_REGEXP, 0);
+ EXPECT_GT(_POSIX_RE_DUP_MAX, 0);
+ EXPECT_GT(_POSIX_SAVED_IDS, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_SEMAPHORES);
+ EXPECT_GT(_POSIX_SEM_NSEMS_MAX, 0);
+ EXPECT_GT(_POSIX_SEM_VALUE_MAX, 0);
+ EXPECT_GT(_POSIX_SHELL, 0);
+ EXPECT_GT(_POSIX_SIGQUEUE_MAX, 0);
+ EXPECT_EQ(-1, _POSIX_SPORADIC_SERVER);
+ EXPECT_GT(_POSIX_SSIZE_MAX, 0);
+ EXPECT_GT(_POSIX_STREAM_MAX, 0);
+ EXPECT_GT(_POSIX_SYMLINK_MAX, 0);
+ EXPECT_GT(_POSIX_SYMLOOP_MAX, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_SYNCHRONIZED_IO);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_THREADS);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_ATTR_STACKADDR);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_ATTR_STACKSIZE);
+ EXPECT_TRUE(_POSIX_VERSION == _POSIX_THREAD_CPUTIME || 0 == _POSIX_THREAD_CPUTIME);
+ EXPECT_GT(_POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0);
+ EXPECT_GT(_POSIX_THREAD_KEYS_MAX, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_PRIORITY_SCHEDULING);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_PRIO_INHERIT);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_PRIO_PROTECT);
+ EXPECT_EQ(-1, _POSIX_THREAD_ROBUST_PRIO_PROTECT);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_SAFE_FUNCTIONS);
+ EXPECT_EQ(-1, _POSIX_THREAD_SPORADIC_SERVER);
+ EXPECT_GT(_POSIX_THREAD_THREADS_MAX, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_TIMEOUTS);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX_TIMERS);
+ EXPECT_GT(_POSIX_TIMER_MAX, 0);
+ EXPECT_EQ(-1, _POSIX_TRACE);
+ EXPECT_EQ(-1, _POSIX_TRACE_EVENT_FILTER);
+ EXPECT_EQ(-1, _POSIX_TRACE_INHERIT);
+ EXPECT_EQ(-1, _POSIX_TRACE_LOG);
+ EXPECT_GT(_POSIX_TTY_NAME_MAX, 0);
+ EXPECT_EQ(-1, _POSIX_TYPED_MEMORY_OBJECTS);
+ EXPECT_GT(_POSIX_TZNAME_MAX, 0);
+ EXPECT_NE(-1, _POSIX_VDISABLE);
+
+ EXPECT_GT(_POSIX2_BC_BASE_MAX, 0);
+ EXPECT_GT(_POSIX2_BC_DIM_MAX, 0);
+ EXPECT_GT(_POSIX2_BC_SCALE_MAX, 0);
+ EXPECT_GT(_POSIX2_BC_STRING_MAX, 0);
+ EXPECT_GT(_POSIX2_CHARCLASS_NAME_MAX, 0);
+ EXPECT_GT(_POSIX2_COLL_WEIGHTS_MAX, 0);
+ EXPECT_EQ(_POSIX_VERSION, _POSIX2_C_BIND);
+ EXPECT_GT(_POSIX2_EXPR_NEST_MAX, 0);
+ EXPECT_GT(_POSIX2_LINE_MAX, 0);
+ EXPECT_GT(_POSIX2_RE_DUP_MAX, 0);
+
+ EXPECT_EQ(700, _XOPEN_VERSION);
+ EXPECT_GT(_XOPEN_IOV_MAX, 0);
+ EXPECT_GT(_XOPEN_UNIX, 0);
+
+#if defined(__BIONIC__)
+ // These tests only pass on bionic, as bionic and glibc has different support on these macros.
+ // Macros like _POSIX_ADVISORY_INFO are not supported on bionic yet.
+ EXPECT_EQ(-1, _POSIX_ADVISORY_INFO);
+ EXPECT_EQ(-1, _POSIX_ASYNCHRONOUS_IO);
+ EXPECT_EQ(-1, _POSIX_BARRIERS);
+ EXPECT_EQ(-1, _POSIX_MESSAGE_PASSING);
+ EXPECT_EQ(-1, _POSIX_PRIORITIZED_IO);
+ EXPECT_EQ(-1, _POSIX_REALTIME_SIGNALS);
+ EXPECT_EQ(-1, _POSIX_SHARED_MEMORY_OBJECTS);
+ EXPECT_EQ(-1, _POSIX_SPAWN);
+ EXPECT_EQ(-1, _POSIX_SPIN_LOCKS);
+ EXPECT_EQ(-1, _POSIX_THREAD_PROCESS_SHARED);
+ EXPECT_EQ(-1, _POSIX_THREAD_ROBUST_PRIO_INHERIT);
+
+ EXPECT_EQ(-1, _POSIX2_VERSION);
+ EXPECT_EQ(-1, _POSIX2_CHAR_TERM);
+ EXPECT_EQ(-1, _POSIX2_C_DEV);
+ EXPECT_EQ(-1, _POSIX2_LOCALEDEF);
+ EXPECT_EQ(-1, _POSIX2_SW_DEV);
+ EXPECT_EQ(-1, _POSIX2_UPE);
+
+ EXPECT_EQ(-1, _XOPEN_ENH_I18N);
+ EXPECT_EQ(-1, _XOPEN_CRYPT);
+ EXPECT_EQ(-1, _XOPEN_LEGACY);
+ EXPECT_EQ(-1, _XOPEN_REALTIME);
+ EXPECT_EQ(-1, _XOPEN_REALTIME_THREADS);
+ EXPECT_EQ(-1, _XOPEN_SHM);
+
+#endif // defined(__BIONIC__)
+}
+
+#define VERIFY_SYSCONF_NOT_SUPPORT(name) VerifySysconf(name, #name, [](long v){return v == -1;})
+
+// sysconf() means unlimited when it returns -1 with errno unchanged.
+#define VERIFY_SYSCONF_POSITIVE(name) \
+ VerifySysconf(name, #name, [](long v){return (v > 0 || v == -1);})
+
+#define VERIFY_SYSCONF_POSIX_VERSION(name) \
+ VerifySysconf(name, #name, [](long v){return v == _POSIX_VERSION;})
+
+static void VerifySysconf(int option, const char *option_name, bool (*verify)(long)) {
+ errno = 0;
+ long ret = sysconf(option);
+ EXPECT_TRUE(0 == errno && verify(ret)) << "name = " << option_name << ", ret = "
+ << ret <<", Error Message: " << strerror(errno);
+}
+
+TEST(unistd, sysconf) {
+ VERIFY_SYSCONF_POSITIVE(_SC_ARG_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_BC_BASE_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_BC_DIM_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_BC_SCALE_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_CHILD_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_CLK_TCK);
+ VERIFY_SYSCONF_POSITIVE(_SC_COLL_WEIGHTS_MAX);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_CPUTIME);
+ VERIFY_SYSCONF_POSITIVE(_SC_EXPR_NEST_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_LINE_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_NGROUPS_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_OPEN_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_PASS_MAX);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_2_C_BIND);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_FORT_DEV);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_FORT_RUN);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_UPE);
+ VERIFY_SYSCONF_POSITIVE(_SC_JOB_CONTROL);
+ VERIFY_SYSCONF_POSITIVE(_SC_SAVED_IDS);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_VERSION);
+ VERIFY_SYSCONF_POSITIVE(_SC_RE_DUP_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_STREAM_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_TZNAME_MAX);
+ VerifySysconf(_SC_XOPEN_VERSION, "_SC_XOPEN_VERSION", [](long v){return v == _XOPEN_VERSION;});
+ VERIFY_SYSCONF_POSITIVE(_SC_ATEXIT_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_IOV_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_PAGESIZE);
+ VERIFY_SYSCONF_POSITIVE(_SC_PAGE_SIZE);
+ VERIFY_SYSCONF_POSITIVE(_SC_XOPEN_UNIX);
+ VERIFY_SYSCONF_POSITIVE(_SC_AIO_LISTIO_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_AIO_MAX);
+ VerifySysconf(_SC_AIO_PRIO_DELTA_MAX, "_SC_AIO_PRIO_DELTA_MAX", [](long v){return v >= 0;});
+ VERIFY_SYSCONF_POSITIVE(_SC_DELAYTIMER_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_MQ_OPEN_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_MQ_PRIO_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_RTSIG_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_SEM_NSEMS_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_SEM_VALUE_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_TIMER_MAX);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_FSYNC);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_MAPPED_FILES);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_MEMLOCK);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_MEMLOCK_RANGE);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_MEMORY_PROTECTION);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_PRIORITY_SCHEDULING);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_SEMAPHORES);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_SYNCHRONIZED_IO);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_TIMERS);
+ VERIFY_SYSCONF_POSITIVE(_SC_GETGR_R_SIZE_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_GETPW_R_SIZE_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_LOGIN_NAME_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_THREAD_DESTRUCTOR_ITERATIONS);
+ VERIFY_SYSCONF_POSITIVE(_SC_THREAD_KEYS_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_THREAD_STACK_MIN);
+ VERIFY_SYSCONF_POSITIVE(_SC_THREAD_THREADS_MAX);
+ VERIFY_SYSCONF_POSITIVE(_SC_TTY_NAME_MAX);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_THREADS);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_ATTR_STACKADDR);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_ATTR_STACKSIZE);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_PRIORITY_SCHEDULING);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_PRIO_INHERIT);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_PRIO_PROTECT);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_SAFE_FUNCTIONS);
+ VERIFY_SYSCONF_POSITIVE(_SC_NPROCESSORS_CONF);
+ VERIFY_SYSCONF_POSITIVE(_SC_NPROCESSORS_ONLN);
+ VERIFY_SYSCONF_POSITIVE(_SC_PHYS_PAGES);
+ VERIFY_SYSCONF_POSITIVE(_SC_AVPHYS_PAGES);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_MONOTONIC_CLOCK);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_ACCOUNTING);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_CHECKPOINT);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_LOCATE);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_MESSAGE);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_TRACK);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_CLOCK_SELECTION);
+ VERIFY_SYSCONF_POSITIVE(_SC_HOST_NAME_MAX);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_IPV6);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_RAW_SOCKETS);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_READER_WRITER_LOCKS);
+ VERIFY_SYSCONF_POSITIVE(_SC_REGEXP);
+ VERIFY_SYSCONF_POSITIVE(_SC_SHELL);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_SPORADIC_SERVER);
+ VERIFY_SYSCONF_POSITIVE(_SC_SYMLOOP_MAX);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_CPUTIME);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_THREAD_SPORADIC_SERVER);
+ VERIFY_SYSCONF_POSIX_VERSION(_SC_TIMEOUTS);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_EVENT_FILTER);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_EVENT_NAME_MAX);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_INHERIT);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_LOG);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_NAME_MAX);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_SYS_MAX);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_USER_EVENT_MAX);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_TYPED_MEMORY_OBJECTS);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_STREAMS);
+
+#if defined(__LP64__)
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_ILP32_OFF32);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_ILP32_OFFBIG);
+ VERIFY_SYSCONF_POSITIVE(_SC_V7_LP64_OFF64);
+ VERIFY_SYSCONF_POSITIVE(_SC_V7_LPBIG_OFFBIG);
+#else
+ VERIFY_SYSCONF_POSITIVE(_SC_V7_ILP32_OFF32);
+#if defined(__BIONIC__)
+ // bionic does not support 64 bits off_t type on 32bit machine.
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_ILP32_OFFBIG);
+#endif
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_LP64_OFF64);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_LPBIG_OFFBIG);
+#endif
+
+#if defined(__BIONIC__)
+ // Tests can only run on bionic, as bionic and glibc have different support for these options.
+ // Below options are not supported on bionic yet.
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_ADVISORY_INFO);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_ASYNCHRONOUS_IO);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_BARRIERS);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_MESSAGE_PASSING);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_PRIORITIZED_IO);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_REALTIME_SIGNALS);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_SHARED_MEMORY_OBJECTS);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_SPAWN);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_SPIN_LOCKS);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_THREAD_PROCESS_SHARED);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_THREAD_ROBUST_PRIO_INHERIT);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_THREAD_ROBUST_PRIO_PROTECT);
+
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_C_DEV);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_CHAR_TERM);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_LOCALEDEF);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_SW_DEV);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_VERSION);
+
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_CRYPT);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_ENH_I18N);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_LEGACY);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_REALTIME);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_REALTIME_THREADS);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_SHM);
+ VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_UUCP);
+#endif // defined(__BIONIC__)
+}
diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp
index d02c4bf..63f3760 100644
--- a/tests/wchar_test.cpp
+++ b/tests/wchar_test.cpp
@@ -22,6 +22,8 @@
#include <stdint.h>
#include <wchar.h>
+#define NUM_WCHARS(num_bytes) (num_bytes/sizeof(wchar_t))
+
TEST(wchar, sizeof_wchar_t) {
EXPECT_EQ(4U, sizeof(wchar_t));
EXPECT_EQ(4U, sizeof(wint_t));
@@ -343,7 +345,7 @@
// Check that valid has advanced to the next unread character.
ASSERT_EQ('e', *valid);
- wmemset(out, L'x', sizeof(out) / sizeof(wchar_t));
+ wmemset(out, L'x', NUM_WCHARS(sizeof(out)));
ASSERT_EQ(2U, mbsrtowcs(out, &valid, 4, ps));
ASSERT_EQ(L'e', out[0]);
ASSERT_EQ(L'f', out[1]);
@@ -450,17 +452,85 @@
EXPECT_STREQ(L"Sun Mar 10 00:00:00 2100", buf);
}
-TEST(wchar, wmemmove) {
+TEST(wchar, wmemmove_smoke) {
const wchar_t const_wstr[] = L"This is a test of something or other.....";
- wchar_t* wstr = new wchar_t[sizeof(const_wstr)];
+ wchar_t wstr[NUM_WCHARS(sizeof(const_wstr))];
- wmemmove(wstr, const_wstr, sizeof(const_wstr)/sizeof(wchar_t));
+ EXPECT_EQ(wstr, wmemmove(wstr, const_wstr, NUM_WCHARS(sizeof(const_wstr))));
EXPECT_STREQ(const_wstr, wstr);
- wmemmove(wstr+5, wstr, sizeof(const_wstr)/sizeof(wchar_t) - 6);
+ EXPECT_EQ(wstr+5, wmemmove(wstr+5, wstr, NUM_WCHARS(sizeof(const_wstr)) - 6));
EXPECT_STREQ(L"This This is a test of something or other", wstr);
}
+TEST(wchar, wmemcpy_smoke) {
+ const wchar_t src[] = L"Source string";
+ wchar_t dst[NUM_WCHARS(sizeof(src))];
+
+ EXPECT_EQ(dst, wmemcpy(dst, src, NUM_WCHARS(sizeof(src))));
+ EXPECT_STREQ(dst, src);
+}
+
+TEST(wchar, wcpcpy_smoke) {
+ const wchar_t src[] = L"Source string";
+ wchar_t dst[NUM_WCHARS(sizeof(src))];
+
+ EXPECT_EQ(dst + NUM_WCHARS(sizeof(src)) - 1, wcpcpy(dst, src));
+ EXPECT_STREQ(dst, src);
+}
+
+TEST(wchar, wcpncpy_smoke) {
+ const wchar_t src[] = L"Source string";
+ wchar_t dst[NUM_WCHARS(sizeof(src)) + 5];
+
+ size_t src_len = NUM_WCHARS(sizeof(src)) - 1;
+ EXPECT_EQ(dst + src_len, wcpncpy(dst, src, src_len + 1));
+ EXPECT_STREQ(dst, src);
+
+ EXPECT_EQ(dst + 6, wcpncpy(dst, src, 6));
+ dst[6] = L'\0';
+ EXPECT_STREQ(dst, L"Source");
+
+ wmemset(dst, L'x', NUM_WCHARS(sizeof(dst)));
+ EXPECT_EQ(dst + src_len, wcpncpy(dst, src, src_len + 4));
+ EXPECT_STREQ(dst, src);
+ EXPECT_EQ(dst[src_len], L'\0');
+ EXPECT_EQ(dst[src_len+1], L'\0');
+ EXPECT_EQ(dst[src_len+2], L'\0');
+ EXPECT_EQ(dst[src_len+3], L'\0');
+ EXPECT_EQ(dst[src_len+4], L'x');
+}
+
+TEST(wchar, wcscpy_smoke) {
+ const wchar_t src[] = L"Source string";
+ wchar_t dst[NUM_WCHARS(sizeof(src))];
+
+ EXPECT_EQ(dst, wcscpy(dst, src));
+ EXPECT_STREQ(src, dst);
+}
+
+TEST(wchar, wcsncpy_smoke) {
+ const wchar_t src[] = L"Source string";
+ wchar_t dst[NUM_WCHARS(sizeof(src)) + 5];
+
+ size_t src_len = NUM_WCHARS(sizeof(src)) - 1;
+ EXPECT_EQ(dst, wcsncpy(dst, src, src_len + 1));
+ EXPECT_STREQ(dst, src);
+
+ EXPECT_EQ(dst, wcsncpy(dst, src, 6));
+ dst[6] = L'\0';
+ EXPECT_STREQ(dst, L"Source");
+
+ wmemset(dst, L'x', NUM_WCHARS(sizeof(dst)));
+ EXPECT_EQ(dst, wcsncpy(dst, src, src_len + 4));
+ EXPECT_STREQ(dst, src);
+ EXPECT_EQ(dst[src_len], L'\0');
+ EXPECT_EQ(dst[src_len+1], L'\0');
+ EXPECT_EQ(dst[src_len+2], L'\0');
+ EXPECT_EQ(dst[src_len+3], L'\0');
+ EXPECT_EQ(dst[src_len+4], L'x');
+}
+
TEST(wchar, mbrtowc_15439554) {
// http://b/15439554
ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
@@ -489,3 +559,106 @@
EXPECT_EQ(4U, n);
EXPECT_EQ(L'𤭢', wc);
}
+
+TEST(wchar, open_wmemstream) {
+ wchar_t* p = nullptr;
+ size_t size = 0;
+ FILE* fp = open_wmemstream(&p, &size);
+ ASSERT_NE(EOF, fputws(L"hello, world!", fp));
+ fclose(fp);
+
+ ASSERT_STREQ(L"hello, world!", p);
+ ASSERT_EQ(wcslen(L"hello, world!"), size);
+ free(p);
+}
+
+TEST(stdio, open_wmemstream_EINVAL) {
+#if defined(__BIONIC__)
+ wchar_t* p;
+ size_t size;
+
+ // Invalid buffer.
+ errno = 0;
+ ASSERT_EQ(nullptr, open_wmemstream(nullptr, &size));
+ ASSERT_EQ(EINVAL, errno);
+
+ // Invalid size.
+ errno = 0;
+ ASSERT_EQ(nullptr, open_wmemstream(&p, nullptr));
+ ASSERT_EQ(EINVAL, errno);
+#else
+ GTEST_LOG_(INFO) << "This test does nothing.\n";
+#endif
+}
+
+TEST(wchar, wcstol_EINVAL) {
+ errno = 0;
+ wcstol(L"123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstol(L"123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstol(L"123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(wchar, wcstoll_EINVAL) {
+ errno = 0;
+ wcstoll(L"123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoll(L"123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoll(L"123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(wchar, wcstoul_EINVAL) {
+ errno = 0;
+ wcstoul(L"123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoul(L"123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoul(L"123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(wchar, wcstoull_EINVAL) {
+ errno = 0;
+ wcstoull(L"123", NULL, -1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoull(L"123", NULL, 1);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoull(L"123", NULL, 37);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(wchar, wcstoll_l_EINVAL) {
+ errno = 0;
+ wcstoll_l(L"123", NULL, -1, LC_GLOBAL_LOCALE);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoll_l(L"123", NULL, 1, LC_GLOBAL_LOCALE);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoll_l(L"123", NULL, 37, LC_GLOBAL_LOCALE);
+ ASSERT_EQ(EINVAL, errno);
+}
+
+TEST(wchar, wcstoull_l_EINVAL) {
+ errno = 0;
+ wcstoull_l(L"123", NULL, -1, LC_GLOBAL_LOCALE);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoull_l(L"123", NULL, 1, LC_GLOBAL_LOCALE);
+ ASSERT_EQ(EINVAL, errno);
+ errno = 0;
+ wcstoull_l(L"123", NULL, 37, LC_GLOBAL_LOCALE);
+ ASSERT_EQ(EINVAL, errno);
+}