Merge remote-tracking branch 'origin/upstream/main' into 'main'
Change-Id: Ic08a77677480d8c4f957e889026ffbb21c27a0ab
diff --git a/README.md b/README.md
index 8d8e583..aafbcff 100644
--- a/README.md
+++ b/README.md
@@ -48,7 +48,9 @@
#### tests/ --- unit tests
The `tests/` directory contains unit tests. Roughly arranged as one file per
-publicly-exported header file.
+publicly-exported header file. `tests/headers/` contains compile-only tests
+that just check that things are _in_ the headers, whereas the "real" tests
+check actual _behavior_.
#### benchmarks/ --- benchmarks
@@ -132,9 +134,9 @@
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.
+ # timezone data.
zoneinfo/
- # Android-format time zone data.
+ # Android-format timezone data.
# See 'Updating tzdata' later.
```
@@ -372,6 +374,19 @@
$ ./tests/run-on-host.sh glibc
+### Against musl
+
+Another way to verify test behavior is to run against musl on the host. glibc
+musl don't always match, so this can be a good way to find the more complicated
+corners of the spec. If they *do* match, bionic probably should too!
+
+ $ OUT_DIR=$(ANDROID_BUILD_TOP)/musl-out ./tests/run-on-host.sh musl
+
+Note: the alternate OUT_DIR is used to avoid causing excessive rebuilding when
+switching between glibc and musl. The first musl test run will be expensive
+because it will not reuse any already built artifacts, but subsequent runs will
+be cheaper than if you hadn't used it.
+
## Gathering test coverage
To get test coverage for bionic, use `//bionic/build/coverage.sh`. Before
diff --git a/android-changes-for-ndk-developers.md b/android-changes-for-ndk-developers.md
index 8ffd96f..ab3b247 100644
--- a/android-changes-for-ndk-developers.md
+++ b/android-changes-for-ndk-developers.md
@@ -146,8 +146,8 @@
(on a 4096-byte boundary) in the zip file and stored uncompressed.
Current versions of the zipalign tool take care of alignment.
-Note that in API level 23 and above dlopen(3) will open a library from
-any zip file, not just your APK. Just give dlopen(3) a path of the form
+Note that in API level 23 and above dlopen(3) can open a library from
+any zip file, not just an APK. Just give dlopen(3) a path of the form
"my_zip_file.zip!/libs/libstuff.so". As with APKs, the library must be
page-aligned and stored uncompressed for this to work.
@@ -479,3 +479,20 @@
You can read more about relative relocations
and their long and complicated history at
https://maskray.me/blog/2021-10-31-relative-relocations-and-relr.
+
+## No more sentinels in .preinit_array/.init_array/.fini_array sections of executables (in All API levels)
+
+In Android <= U and NDK <= 26, Android used sentinels in these sections of
+executables to locate the start and end of arrays. However, when building with
+LTO, the function pointers in the arrays can be reordered, making sentinels no
+longer work. This prevents constructors for global C++ variables from being
+called in static executables when using LTO.
+
+To fix this, in Android >= V and NDK >= 27, we removed sentinels and switched
+to using symbols inserted by LLD (like `__init_array_start`,
+`__init_array_end`) to locate the arrays. This also avoids keeping a section
+when there are no corresponding functions.
+
+For dynamic executables, we kept sentinel support in crtbegin_dynamic.o and
+libc.so. This ensures that executables built with newer crtbegin_dynamic.o
+(in NDK >= 27) work with older libc.so (in Android <= U), and vice versa.
diff --git a/benchmarks/Android.bp b/benchmarks/Android.bp
index 17d2d68..f31e127 100644
--- a/benchmarks/Android.bp
+++ b/benchmarks/Android.bp
@@ -154,7 +154,13 @@
"libbase",
"libBionicBenchmarksUtils",
],
- data: ["test_suites/*"],
+ data: [
+ "test_suites/*",
+ "suites/*",
+ ":bionic-benchmarks",
+ ],
+ test_suites: ["device-tests"],
+ require_root: true,
}
cc_binary {
diff --git a/benchmarks/TEST_MAPPING b/benchmarks/TEST_MAPPING
new file mode 100644
index 0000000..1864b2b
--- /dev/null
+++ b/benchmarks/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+ "presubmit": [
+ {
+ "name": "bionic-benchmarks-tests"
+ }
+ ]
+}
diff --git a/benchmarks/bionic_benchmarks.cpp b/benchmarks/bionic_benchmarks.cpp
index 187ee76..74966c0 100644
--- a/benchmarks/bionic_benchmarks.cpp
+++ b/benchmarks/bionic_benchmarks.cpp
@@ -336,16 +336,36 @@
return to_populate;
}
- to_populate->push_back(std::vector<int64_t>());
- std::stringstream sstream(args);
- std::string argstr;
- while (sstream >> argstr) {
- char* check_null;
- int converted = static_cast<int>(strtol(argstr.c_str(), &check_null, 10));
- if (*check_null) {
- errx(1, "ERROR: Args str %s contains an invalid macro or int.", args.c_str());
+ std::string trimmed_args = android::base::Trim(args);
+ if (!trimmed_args.empty()) {
+ std::stringstream sstream(trimmed_args);
+ std::string argstr;
+ while (sstream >> argstr) {
+ char* check_null;
+ int converted = static_cast<int>(strtol(argstr.c_str(), &check_null, 10));
+ if (*check_null == '\0') {
+ to_populate->emplace_back(std::vector<int64_t>{converted});
+ continue;
+ } else if (*check_null == '/') {
+ // The only supported format with a / is \d+(/\d+)\s*. Example 8/8/8 or 16/23.
+ std::vector<int64_t> test_args{converted};
+ while (true) {
+ converted = static_cast<int>(strtol(check_null + 1, &check_null, 10));
+ test_args.push_back(converted);
+ if (*check_null == '\0') {
+ to_populate->emplace_back(std::move(test_args));
+ break;
+ } else if (*check_null != '/') {
+ errx(1, "ERROR: Args str %s contains an invalid macro or int.", args.c_str());
+ }
+ }
+ } else {
+ errx(1, "ERROR: Args str %s contains an invalid macro or int.", args.c_str());
+ }
}
- (*to_populate)[0].push_back(converted);
+ } else {
+ // No arguments, only the base benchmark.
+ to_populate->emplace_back(std::vector<int64_t>{});
}
return to_populate;
}
diff --git a/benchmarks/linker_relocation/gen/Android.bp b/benchmarks/linker_relocation/gen/Android.bp
index c8f0b4a..d07ebf7 100644
--- a/benchmarks/linker_relocation/gen/Android.bp
+++ b/benchmarks/linker_relocation/gen/Android.bp
@@ -1,8 +1,5 @@
// AUTO-GENERATED BY gen_bench.py -- do not edit
-package {
- default_applicable_licenses: ["bionic_benchmarks_license"],
-}
-
+package { default_applicable_licenses: ["bionic_benchmarks_license"], }
cc_defaults {
name: "linker_reloc_bench_all_libs",
runtime_libs: [
diff --git a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_000.S b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_000.S
index c0ad782..f04726f 100644
--- a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_000.S
+++ b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_000.S
@@ -7572,7 +7572,6 @@
CALL(b_wavGuebjRkprcgvbaSzg)
CALL(b__MAX7naqebvq9MvcSvyrEB12trgRagelVasbRCiCgCwF3_CyF3_F3_)
CALL(mktime)
-CALL(lstat64)
CALL(b_pep32)
CALL(read)
CALL(close)
@@ -9757,7 +9756,6 @@
.weak b__MAFg3__16__gerrVAF_12__inyhr_glcrVAF_12onfvp_fgevatVpAF_11pune_genvgfVpRRAF_9nyybpngbeVpRRRRAF_10funerq_cgeVA7zvavxva14SbagPbyyrpgvbaRRRRRAF_19__znc_inyhr_pbzcnerVF7_FP_AF_4yrffVF7_RRYo1RRRAF5_VFP_RRR12__svaq_rdhnyVF7_RRECAF_16__gerr_abqr_onfrVCiRRECAF_15__gerr_raq_abqrVFA_RREXG_
CALL(b__MAFg3__16__gerrVAF_12__inyhr_glcrVAF_12onfvp_fgevatVpAF_11pune_genvgfVpRRAF_9nyybpngbeVpRRRRAF_10funerq_cgeVA7zvavxva14SbagPbyyrpgvbaRRRRRAF_19__znc_inyhr_pbzcnerVF7_FP_AF_4yrffVF7_RRYo1RRRAF5_VFP_RRR12__svaq_rdhnyVF7_RRECAF_16__gerr_abqr_onfrVCiRRECAF_15__gerr_raq_abqrVFA_RREXG_)
CALL(b__MA6FxQngn17ZnxrHavavgvnyvmrqRz)
-CALL(lseek64)
CALL(longjmp)
CALL(b__MA22fxwcrt_qrfgvangvba_zteP1RC9FxJFgernz)
CALL(b_wcrt_fgq_reebe)
diff --git a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_001.S b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_001.S
index c2d5ef2..61b9a55 100644
--- a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_001.S
+++ b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_001.S
@@ -3798,7 +3798,6 @@
CALL(b__MA7naqebvq4onfr10YbtZrffntrQ1Ri)
CALL(b__MA7naqebvq9NcxNffrgf19PerngrNffrgSebzSvyrREXAFg3__112onfvp_fgevatVpAF1_11pune_genvgfVpRRAF1_9nyybpngbeVpRRRR)
CALL(b__MA7naqebvq11YbnqrqVqznc4YbnqREXAF_16OnfvpFgevatCvrprVpRR)
-CALL(lseek64)
CALL(b__MA7naqebvq7SvyrZncP1Ri)
CALL(b__MA7naqebvq7SvyrZnc6perngrRCXpvyzo)
CALL(b__MA7naqebvq5Nffrg25perngrSebzHapbzcerffrqZncRAFg3__110havdhr_cgeVAF_7SvyrZncRAF1_14qrsnhyg_qryrgrVF3_RRRRAF0_10NpprffZbqrR)
@@ -4301,7 +4300,6 @@
CALL(b_pep32)
CALL(b__MA7naqebvq16OnpxhcQngnJevgre17JevgrRagvglUrnqreREXAF_7Fgevat8Rz)
CALL(b__MA7naqebvq16OnpxhcQngnJevgre15JevgrRagvglQngnRCXiz)
-CALL(lstat64)
CALL(b__MA7naqebvq16OnpxhcQngnErnqre16ErnqRagvglUrnqreRCAF_7Fgevat8RCz)
CALL(b__MA7naqebvq16OnpxhcQngnErnqre14ErnqRagvglQngnRCiz)
CALL(open)
diff --git a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_070.S b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_070.S
index 7a8310d..ddfc3d4 100644
--- a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_070.S
+++ b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_070.S
@@ -2299,16 +2299,14 @@
DATA_WORD(local_label)
.space (__SIZEOF_POINTER__ * 2)
DATA_WORD(local_label)
-DATA_WORD(pread64)
-.space (__SIZEOF_POINTER__ * 1)
+.space (__SIZEOF_POINTER__ * 2)
DATA_WORD(local_label)
DATA_WORD(write)
.space (__SIZEOF_POINTER__ * 1)
DATA_WORD(local_label)
.space (__SIZEOF_POINTER__ * 2)
DATA_WORD(local_label)
-DATA_WORD(pwrite64)
-.space (__SIZEOF_POINTER__ * 1)
+.space (__SIZEOF_POINTER__ * 2)
DATA_WORD(local_label)
DATA_WORD(fchmod)
.space (__SIZEOF_POINTER__ * 1)
diff --git a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_074.S b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_074.S
index 340a9cf..471bed0 100644
--- a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_074.S
+++ b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_074.S
@@ -460,7 +460,6 @@
CALL(__stack_chk_fail)
CALL(open)
CALL(strerror)
-CALL(lseek64)
CALL(b__MA10MvcNepuvirQ2Ri)
CALL(memcpy)
CALL(b__MAXFg3__121__onfvp_fgevat_pbzzbaVYo1RR20__guebj_yratgu_reebeRi)
diff --git a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_081.S b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_081.S
index 410c57a..ac7bd42 100644
--- a/benchmarks/linker_relocation/gen/liblinker_reloc_bench_081.S
+++ b/benchmarks/linker_relocation/gen/liblinker_reloc_bench_081.S
@@ -272,11 +272,9 @@
CALL(b__MA7naqebvq4onfr10YbtZrffntrQ1Ri)
CALL(__stack_chk_fail)
CALL(b__MA7naqebvq7zrzvasb8CntrNppg12VavgCntrNppgRo)
-CALL(pread64)
CALL(b__MAFg3__113onfvp_bfgernzVpAF_11pune_genvgfVpRRRyfRz)
CALL(b__MAX7naqebvq7zrzvasb8CntrNppg12ZnexCntrVqyrRz)
CALL(b__MAX7naqebvq7zrzvasb8CntrNppg11TrgCntrVqyrRz)
-CALL(pwrite64)
CALL(b__MAFg3__113onfvp_bfgernzVpAF_11pune_genvgfVpRRR6fragelP1REF3_)
CALL(b__MAXFg3__18vbf_onfr6trgybpRi)
CALL(b__MAXFg3__16ybpnyr9hfr_snprgREAF0_2vqR)
diff --git a/benchmarks/linker_relocation/regen/gen_bench.py b/benchmarks/linker_relocation/regen/gen_bench.py
index 6533189..d34a9a9 100755
--- a/benchmarks/linker_relocation/regen/gen_bench.py
+++ b/benchmarks/linker_relocation/regen/gen_bench.py
@@ -115,9 +115,13 @@
'getprogname',
'gettid',
'isnanf',
+ 'lseek64',
+ 'lstat64',
'mallinfo',
'malloc_info',
+ 'pread64',
'pthread_gettid_np',
+ 'pwrite64',
'res_mkquery',
'strlcpy',
'strtoll_l',
diff --git a/benchmarks/malloc_benchmark.cpp b/benchmarks/malloc_benchmark.cpp
index e733cd0..258343f 100644
--- a/benchmarks/malloc_benchmark.cpp
+++ b/benchmarks/malloc_benchmark.cpp
@@ -29,6 +29,10 @@
#include <malloc.h>
#include <unistd.h>
+#include <condition_variable>
+#include <mutex>
+#include <random>
+#include <thread>
#include <vector>
#include <benchmark/benchmark.h>
@@ -68,6 +72,89 @@
mallopt(M_DECAY_TIME, 0);
}
+static void RunThreadsThroughput(benchmark::State& state, size_t size, size_t num_threads) {
+ constexpr size_t kMaxBytes = 1 << 24;
+ constexpr size_t kMaxThreads = 8;
+ constexpr size_t kMinRounds = 4;
+ const size_t MaxAllocCounts = kMaxBytes / size;
+ std::mutex m;
+ bool ready = false;
+ std::condition_variable cv;
+ std::thread* threads[kMaxThreads];
+
+ // The goal is to create malloc/free interleaving patterns across threads.
+ // The bytes processed by each thread will be the same. The difference is the
+ // patterns. Here's an example:
+ //
+ // A: Allocation
+ // D: Deallocation
+ //
+ // T1 T2 T3
+ // A A A
+ // A A D
+ // A D A
+ // A D D
+ // D A A
+ // D A D
+ // D D A
+ // D D D
+ //
+ // To do this, `AllocCounts` and `AllocRounds` will be adjusted according to the
+ // thread id.
+ auto thread_task = [&](size_t id) {
+ {
+ std::unique_lock lock(m);
+ // Wait until all threads are created.
+ cv.wait(lock, [&] { return ready; });
+ }
+
+ void** MemPool;
+ const size_t AllocCounts = (MaxAllocCounts >> id);
+ const size_t AllocRounds = (kMinRounds << id);
+ MemPool = new void*[AllocCounts];
+
+ for (size_t i = 0; i < AllocRounds; ++i) {
+ for (size_t j = 0; j < AllocCounts; ++j) {
+ void* ptr = malloc(size);
+ MemPool[j] = ptr;
+ }
+
+ // Use a fix seed to reduce the noise of different round of benchmark.
+ const unsigned seed = 33529;
+ std::shuffle(MemPool, &MemPool[AllocCounts], std::default_random_engine(seed));
+
+ for (size_t j = 0; j < AllocCounts; ++j) free(MemPool[j]);
+ }
+
+ delete[] MemPool;
+ };
+
+ for (auto _ : state) {
+ state.PauseTiming();
+ // Don't need to acquire the lock because no thread is created.
+ ready = false;
+
+ for (size_t i = 0; i < num_threads; ++i) threads[i] = new std::thread(thread_task, i);
+
+ state.ResumeTiming();
+
+ {
+ std::unique_lock lock(m);
+ ready = true;
+ }
+
+ cv.notify_all();
+
+ for (size_t i = 0; i < num_threads; ++i) {
+ threads[i]->join();
+ delete threads[i];
+ }
+ }
+
+ const size_t ThreadsBytesProcessed = kMaxBytes * kMinRounds * num_threads;
+ state.SetBytesProcessed(ThreadsBytesProcessed * static_cast<size_t>(state.iterations()));
+}
+
static void BM_mallopt_purge(benchmark::State& state) {
RunMalloptPurge(state, M_PURGE);
}
@@ -78,4 +165,23 @@
}
BIONIC_BENCHMARK(BM_mallopt_purge_all);
+// Note that this will only test a single size class at a time so that we can
+// observe the impact of contention more often.
+#define BM_MALLOC_THREADS_THROUGHPUT(SIZE, NUM_THREADS) \
+ static void BM_malloc_threads_throughput_##SIZE##_##NUM_THREADS(benchmark::State& state) { \
+ RunThreadsThroughput(state, SIZE, NUM_THREADS); \
+ } \
+ BIONIC_BENCHMARK(BM_malloc_threads_throughput_##SIZE##_##NUM_THREADS);
+
+// There are three block categories in Scudo, we choose 1 from each category.
+BM_MALLOC_THREADS_THROUGHPUT(64, 2);
+BM_MALLOC_THREADS_THROUGHPUT(64, 4);
+BM_MALLOC_THREADS_THROUGHPUT(64, 8);
+BM_MALLOC_THREADS_THROUGHPUT(512, 2);
+BM_MALLOC_THREADS_THROUGHPUT(512, 4);
+BM_MALLOC_THREADS_THROUGHPUT(512, 8);
+BM_MALLOC_THREADS_THROUGHPUT(8192, 2);
+BM_MALLOC_THREADS_THROUGHPUT(8192, 4);
+BM_MALLOC_THREADS_THROUGHPUT(8192, 8);
+
#endif
diff --git a/benchmarks/malloc_map_benchmark.cpp b/benchmarks/malloc_map_benchmark.cpp
index 5757325..04c9a07 100644
--- a/benchmarks/malloc_map_benchmark.cpp
+++ b/benchmarks/malloc_map_benchmark.cpp
@@ -52,7 +52,7 @@
android::base::StartsWith(vma.name, "[anon:GWP-ASan")) {
android::meminfo::Vma update_vma(vma);
if (!proc_mem.FillInVmaStats(update_vma)) {
- err(1, "FillInVmaStats failed\n");
+ err(1, "FillInVmaStats failed");
}
*rss_bytes += update_vma.usage.rss;
}
diff --git a/benchmarks/test_suites/test_from_each.xml b/benchmarks/test_suites/test_from_each.xml
index bad18e7..51c14b6 100644
--- a/benchmarks/test_suites/test_from_each.xml
+++ b/benchmarks/test_suites/test_from_each.xml
@@ -20,7 +20,7 @@
</fn>
<fn>
<name>BM_string_memcpy</name>
- <args>512 4 4</args>
+ <args>512/4/4</args>
</fn>
<fn>
<name>BM_time_clock_gettime</name>
diff --git a/benchmarks/test_suites/test_medium.xml b/benchmarks/test_suites/test_medium.xml
index 9528af3..0d29a99 100644
--- a/benchmarks/test_suites/test_medium.xml
+++ b/benchmarks/test_suites/test_medium.xml
@@ -8,7 +8,7 @@
<fn>
<name>BM_string_memcpy</name>
<iterations>25</iterations>
- <args>512 4 4</args>
+ <args>512/4/4</args>
</fn>
<fn>
<name>BM_property_get</name>
diff --git a/benchmarks/test_suites/test_small.xml b/benchmarks/test_suites/test_small.xml
index a4cc285..66d3732 100644
--- a/benchmarks/test_suites/test_small.xml
+++ b/benchmarks/test_suites/test_small.xml
@@ -1,11 +1,11 @@
<fn>
<name>BM_string_memcmp</name>
- <args>8 8 8</args>
+ <args>8/8/8</args>
</fn>
<fn>
<name>BM_math_sqrt</name>
</fn>
<fn>
<name>BM_property_get</name>
- <args>1</args>
+ <args>1 2 3</args>
</fn>
diff --git a/benchmarks/tests/interface_test.cpp b/benchmarks/tests/interface_test.cpp
index 301c294..1d620d1 100644
--- a/benchmarks/tests/interface_test.cpp
+++ b/benchmarks/tests/interface_test.cpp
@@ -49,12 +49,8 @@
int fd_;
};
-static const char* GetBenchmarkExe() {
-#if defined(__LP64__)
- return "/data/benchmarktest64/bionic-benchmarks/bionic-benchmarks";
-#else
- return "/data/benchmarktest/bionic-benchmarks/bionic-benchmarks";
-#endif
+static std::string GetBenchmarkExe() {
+ return android::base::GetExecutableDirectory() + "/bionic-benchmarks";
}
static std::string GetBionicXmlArg(const char* xml_file) {
@@ -90,7 +86,8 @@
ASSERT_NE(0, dup2(fds[1], STDERR_FILENO));
close(fds[1]);
- args.insert(args.begin(), GetBenchmarkExe());
+ const std::string exe(GetBenchmarkExe());
+ args.insert(args.begin(), exe.c_str());
args.push_back(nullptr);
execv(args[0], reinterpret_cast<char* const*>(const_cast<char**>(args.data())));
exit(1);
@@ -145,10 +142,10 @@
TEST_F(SystemTests, check_benchmark_exe) {
// Verify that the benchmark exe is present.
- const char* exe = GetBenchmarkExe();
+ const std::string exe(GetBenchmarkExe());
struct stat st;
- ASSERT_NE(-1, stat(exe, &st)) << "Stat of " << exe << " failed";
+ ASSERT_NE(-1, stat(exe.c_str(), &st)) << "Stat of " << exe << " failed";
ASSERT_TRUE(S_ISREG(st.st_mode)) << exe << " is not a file, or doesn't exist.";
}
@@ -195,27 +192,31 @@
TEST_F(SystemTests, small) {
std::string expected =
- "BM_string_memcmp/8/8/8/iterations:1\n"
- "BM_math_sqrt/iterations:1\n"
- "BM_property_get/1/iterations:1\n";
+ "BM_string_memcmp/8/8/8/iterations:1\n"
+ "BM_math_sqrt/iterations:1\n"
+ "BM_property_get/1/iterations:1\n"
+ "BM_property_get/2/iterations:1\n"
+ "BM_property_get/3/iterations:1\n";
Verify(expected, 0, std::vector<const char*>{GetBionicXmlArg("test_small.xml").c_str(),
"--bionic_iterations=1"});
}
TEST_F(SystemTests, medium) {
std::string expected =
- "BM_string_memcmp/8/0/0/iterations:1\n"
- "BM_string_memcmp/64/0/0/iterations:1\n"
- "BM_string_memcmp/512/0/0/iterations:1\n"
- "BM_string_memcmp/1024/0/0/iterations:1\n"
- "BM_string_memcmp/8192/0/0/iterations:1\n"
- "BM_string_memcmp/16384/0/0/iterations:1\n"
- "BM_string_memcmp/32768/0/0/iterations:1\n"
- "BM_string_memcmp/65536/0/0/iterations:1\n"
- "BM_string_memcmp/131072/0/0/iterations:1\n"
- "BM_math_sqrt/iterations:1\n"
- "BM_string_memcpy/512/4/4/iterations:25\n"
- "BM_property_get/1/iterations:1\n";
+ "BM_string_memcmp/8/0/0/iterations:1\n"
+ "BM_string_memcmp/16/0/0/iterations:1\n"
+ "BM_string_memcmp/32/0/0/iterations:1\n"
+ "BM_string_memcmp/64/0/0/iterations:1\n"
+ "BM_string_memcmp/512/0/0/iterations:1\n"
+ "BM_string_memcmp/1024/0/0/iterations:1\n"
+ "BM_string_memcmp/8192/0/0/iterations:1\n"
+ "BM_string_memcmp/16384/0/0/iterations:1\n"
+ "BM_string_memcmp/32768/0/0/iterations:1\n"
+ "BM_string_memcmp/65536/0/0/iterations:1\n"
+ "BM_string_memcmp/131072/0/0/iterations:1\n"
+ "BM_math_sqrt/iterations:1\n"
+ "BM_string_memcpy/512/4/4/iterations:25\n"
+ "BM_property_get/1/iterations:1\n";
Verify(expected, 0, std::vector<const char*>{GetBionicXmlArg("test_medium.xml").c_str(),
"--bionic_iterations=1"});
}
@@ -239,43 +240,48 @@
std::string expected =
"BM_string_memcpy/8/8/8/iterations:1\n"
"BM_math_log10/iterations:1\n";
- Verify(expected, 0, std::vector<const char*>{"--bionic_extra=BM_string_memcpy 8 8 8",
- "--bionic_extra=BM_math_log10",
- "--bionic_iterations=1"});
+ Verify(expected, 0,
+ std::vector<const char*>{"--bionic_extra=BM_string_memcpy 8/8/8",
+ "--bionic_extra=BM_math_log10", "--bionic_iterations=1"});
}
TEST_F(SystemTests, cmd_args_no_iter) {
std::string expected =
"BM_string_memcpy/8/8/8\n"
"BM_math_log10\n";
- Verify(expected, 0, std::vector<const char*>{"--bionic_extra=BM_string_memcpy 8 8 8",
- "--bionic_extra=BM_math_log10"});
+ Verify(expected, 0,
+ std::vector<const char*>{"--bionic_extra=BM_string_memcpy 8/8/8",
+ "--bionic_extra=BM_math_log10"});
}
TEST_F(SystemTests, xml_and_args) {
std::string expected =
- "BM_string_memcmp/8/0/0/iterations:1\n"
- "BM_string_memcmp/64/0/0/iterations:1\n"
- "BM_string_memcmp/512/0/0/iterations:1\n"
- "BM_string_memcmp/1024/0/0/iterations:1\n"
- "BM_string_memcmp/8192/0/0/iterations:1\n"
- "BM_string_memcmp/16384/0/0/iterations:1\n"
- "BM_string_memcmp/32768/0/0/iterations:1\n"
- "BM_string_memcmp/65536/0/0/iterations:1\n"
- "BM_string_memcmp/131072/0/0/iterations:1\n"
- "BM_math_sqrt/iterations:1\n"
- "BM_string_memcpy/512/4/4/iterations:25\n"
- "BM_property_get/1/iterations:1\n"
- "BM_string_memcpy/8/0/0/iterations:1\n"
- "BM_string_memcpy/64/0/0/iterations:1\n"
- "BM_string_memcpy/512/0/0/iterations:1\n"
- "BM_string_memcpy/1024/0/0/iterations:1\n"
- "BM_string_memcpy/8192/0/0/iterations:1\n"
- "BM_string_memcpy/16384/0/0/iterations:1\n"
- "BM_string_memcpy/32768/0/0/iterations:1\n"
- "BM_string_memcpy/65536/0/0/iterations:1\n"
- "BM_string_memcpy/131072/0/0/iterations:1\n"
- "BM_math_log10/iterations:1\n";
+ "BM_string_memcmp/8/0/0/iterations:1\n"
+ "BM_string_memcmp/16/0/0/iterations:1\n"
+ "BM_string_memcmp/32/0/0/iterations:1\n"
+ "BM_string_memcmp/64/0/0/iterations:1\n"
+ "BM_string_memcmp/512/0/0/iterations:1\n"
+ "BM_string_memcmp/1024/0/0/iterations:1\n"
+ "BM_string_memcmp/8192/0/0/iterations:1\n"
+ "BM_string_memcmp/16384/0/0/iterations:1\n"
+ "BM_string_memcmp/32768/0/0/iterations:1\n"
+ "BM_string_memcmp/65536/0/0/iterations:1\n"
+ "BM_string_memcmp/131072/0/0/iterations:1\n"
+ "BM_math_sqrt/iterations:1\n"
+ "BM_string_memcpy/512/4/4/iterations:25\n"
+ "BM_property_get/1/iterations:1\n"
+ "BM_string_memcpy/8/0/0/iterations:1\n"
+ "BM_string_memcpy/16/0/0/iterations:1\n"
+ "BM_string_memcpy/32/0/0/iterations:1\n"
+ "BM_string_memcpy/64/0/0/iterations:1\n"
+ "BM_string_memcpy/512/0/0/iterations:1\n"
+ "BM_string_memcpy/1024/0/0/iterations:1\n"
+ "BM_string_memcpy/8192/0/0/iterations:1\n"
+ "BM_string_memcpy/16384/0/0/iterations:1\n"
+ "BM_string_memcpy/32768/0/0/iterations:1\n"
+ "BM_string_memcpy/65536/0/0/iterations:1\n"
+ "BM_string_memcpy/131072/0/0/iterations:1\n"
+ "BM_math_log10/iterations:1\n";
Verify(expected, 0, std::vector<const char*>{"--bionic_extra=BM_string_memcpy AT_ALIGNED_TWOBUF",
"--bionic_extra=BM_math_log10",
"--bionic_cpu=0",
@@ -285,580 +291,584 @@
TEST_F(SystemTests, sizes) {
std::string expected =
- "BM_stdio_fwrite/8/iterations:1\n"
- "BM_stdio_fwrite/64/iterations:1\n"
- "BM_stdio_fwrite/512/iterations:1\n"
- "BM_stdio_fwrite/1024/iterations:1\n"
- "BM_stdio_fwrite/8192/iterations:1\n"
- "BM_stdio_fwrite/16384/iterations:1\n"
- "BM_stdio_fwrite/32768/iterations:1\n"
- "BM_stdio_fwrite/65536/iterations:1\n"
- "BM_stdio_fwrite/131072/iterations:1\n"
- "BM_stdio_fread/1/iterations:1\n"
- "BM_stdio_fread/2/iterations:1\n"
- "BM_stdio_fread/3/iterations:1\n"
- "BM_stdio_fread/4/iterations:1\n"
- "BM_stdio_fread/5/iterations:1\n"
- "BM_stdio_fread/6/iterations:1\n"
- "BM_stdio_fread/7/iterations:1\n"
- "BM_stdio_fread/8/iterations:1\n"
- "BM_stdio_fread/9/iterations:1\n"
- "BM_stdio_fread/10/iterations:1\n"
- "BM_stdio_fread/11/iterations:1\n"
- "BM_stdio_fread/12/iterations:1\n"
- "BM_stdio_fread/13/iterations:1\n"
- "BM_stdio_fread/14/iterations:1\n"
- "BM_stdio_fread/15/iterations:1\n"
- "BM_stdio_fread/16/iterations:1\n"
- "BM_stdio_fread/24/iterations:1\n"
- "BM_stdio_fread/32/iterations:1\n"
- "BM_stdio_fread/40/iterations:1\n"
- "BM_stdio_fread/48/iterations:1\n"
- "BM_stdio_fread/56/iterations:1\n"
- "BM_stdio_fread/64/iterations:1\n"
- "BM_stdio_fread/72/iterations:1\n"
- "BM_stdio_fread/80/iterations:1\n"
- "BM_stdio_fread/88/iterations:1\n"
- "BM_stdio_fread/96/iterations:1\n"
- "BM_stdio_fread/104/iterations:1\n"
- "BM_stdio_fread/112/iterations:1\n"
- "BM_stdio_fread/120/iterations:1\n"
- "BM_stdio_fread/128/iterations:1\n"
- "BM_stdio_fread/136/iterations:1\n"
- "BM_stdio_fread/144/iterations:1\n"
- "BM_stdio_fread/160/iterations:1\n"
- "BM_stdio_fread/176/iterations:1\n"
- "BM_stdio_fread/192/iterations:1\n"
- "BM_stdio_fread/208/iterations:1\n"
- "BM_stdio_fread/224/iterations:1\n"
- "BM_stdio_fread/240/iterations:1\n"
- "BM_stdio_fread/256/iterations:1\n"
- "BM_stdio_fwrite/512/iterations:1\n"
- "BM_stdio_fwrite/1024/iterations:1\n"
- "BM_stdio_fwrite/8192/iterations:1\n"
- "BM_stdio_fwrite/16384/iterations:1\n"
- "BM_stdio_fwrite/32768/iterations:1\n"
- "BM_stdio_fwrite/65536/iterations:1\n"
- "BM_stdio_fwrite/131072/iterations:1\n"
- "BM_stdio_fread/262144/iterations:1\n"
- "BM_stdio_fread/524288/iterations:1\n"
- "BM_stdio_fread/1048576/iterations:1\n"
- "BM_stdio_fread/2097152/iterations:1\n"
- "BM_stdio_fwrite/1/iterations:1\n"
- "BM_stdio_fwrite/2/iterations:1\n"
- "BM_stdio_fwrite/3/iterations:1\n"
- "BM_stdio_fwrite/4/iterations:1\n"
- "BM_stdio_fwrite/5/iterations:1\n"
- "BM_stdio_fwrite/6/iterations:1\n"
- "BM_stdio_fwrite/7/iterations:1\n"
- "BM_stdio_fwrite/8/iterations:1\n"
- "BM_stdio_fwrite/9/iterations:1\n"
- "BM_stdio_fwrite/10/iterations:1\n"
- "BM_stdio_fwrite/11/iterations:1\n"
- "BM_stdio_fwrite/12/iterations:1\n"
- "BM_stdio_fwrite/13/iterations:1\n"
- "BM_stdio_fwrite/14/iterations:1\n"
- "BM_stdio_fwrite/15/iterations:1\n"
- "BM_stdio_fwrite/16/iterations:1\n"
- "BM_stdio_fwrite/24/iterations:1\n"
- "BM_stdio_fwrite/32/iterations:1\n"
- "BM_stdio_fwrite/40/iterations:1\n"
- "BM_stdio_fwrite/48/iterations:1\n"
- "BM_stdio_fwrite/56/iterations:1\n"
- "BM_stdio_fwrite/64/iterations:1\n"
- "BM_stdio_fwrite/72/iterations:1\n"
- "BM_stdio_fwrite/80/iterations:1\n"
- "BM_stdio_fwrite/88/iterations:1\n"
- "BM_stdio_fwrite/96/iterations:1\n"
- "BM_stdio_fwrite/104/iterations:1\n"
- "BM_stdio_fwrite/112/iterations:1\n"
- "BM_stdio_fwrite/120/iterations:1\n"
- "BM_stdio_fwrite/128/iterations:1\n"
- "BM_stdio_fwrite/136/iterations:1\n"
- "BM_stdio_fwrite/144/iterations:1\n"
- "BM_stdio_fwrite/160/iterations:1\n"
- "BM_stdio_fwrite/176/iterations:1\n"
- "BM_stdio_fwrite/192/iterations:1\n"
- "BM_stdio_fwrite/208/iterations:1\n"
- "BM_stdio_fwrite/224/iterations:1\n"
- "BM_stdio_fwrite/240/iterations:1\n"
- "BM_stdio_fwrite/256/iterations:1\n"
- "BM_stdio_fwrite/512/iterations:1\n"
- "BM_stdio_fwrite/1024/iterations:1\n"
- "BM_stdio_fwrite/8192/iterations:1\n"
- "BM_stdio_fwrite/16384/iterations:1\n"
- "BM_stdio_fwrite/32768/iterations:1\n"
- "BM_stdio_fwrite/65536/iterations:1\n"
- "BM_stdio_fwrite/131072/iterations:1\n"
- "BM_stdio_fwrite/262144/iterations:1\n"
- "BM_stdio_fwrite/524288/iterations:1\n"
- "BM_stdio_fwrite/1048576/iterations:1\n"
- "BM_stdio_fwrite/2097152/iterations:1\n";
+ "BM_stdio_fwrite/8/iterations:1\n"
+ "BM_stdio_fwrite/16/iterations:1\n"
+ "BM_stdio_fwrite/32/iterations:1\n"
+ "BM_stdio_fwrite/64/iterations:1\n"
+ "BM_stdio_fwrite/512/iterations:1\n"
+ "BM_stdio_fwrite/1024/iterations:1\n"
+ "BM_stdio_fwrite/8192/iterations:1\n"
+ "BM_stdio_fwrite/16384/iterations:1\n"
+ "BM_stdio_fwrite/32768/iterations:1\n"
+ "BM_stdio_fwrite/65536/iterations:1\n"
+ "BM_stdio_fwrite/131072/iterations:1\n"
+ "BM_stdio_fread/1/iterations:1\n"
+ "BM_stdio_fread/2/iterations:1\n"
+ "BM_stdio_fread/3/iterations:1\n"
+ "BM_stdio_fread/4/iterations:1\n"
+ "BM_stdio_fread/5/iterations:1\n"
+ "BM_stdio_fread/6/iterations:1\n"
+ "BM_stdio_fread/7/iterations:1\n"
+ "BM_stdio_fread/8/iterations:1\n"
+ "BM_stdio_fread/9/iterations:1\n"
+ "BM_stdio_fread/10/iterations:1\n"
+ "BM_stdio_fread/11/iterations:1\n"
+ "BM_stdio_fread/12/iterations:1\n"
+ "BM_stdio_fread/13/iterations:1\n"
+ "BM_stdio_fread/14/iterations:1\n"
+ "BM_stdio_fread/15/iterations:1\n"
+ "BM_stdio_fread/16/iterations:1\n"
+ "BM_stdio_fread/24/iterations:1\n"
+ "BM_stdio_fread/32/iterations:1\n"
+ "BM_stdio_fread/40/iterations:1\n"
+ "BM_stdio_fread/48/iterations:1\n"
+ "BM_stdio_fread/56/iterations:1\n"
+ "BM_stdio_fread/64/iterations:1\n"
+ "BM_stdio_fread/72/iterations:1\n"
+ "BM_stdio_fread/80/iterations:1\n"
+ "BM_stdio_fread/88/iterations:1\n"
+ "BM_stdio_fread/96/iterations:1\n"
+ "BM_stdio_fread/104/iterations:1\n"
+ "BM_stdio_fread/112/iterations:1\n"
+ "BM_stdio_fread/120/iterations:1\n"
+ "BM_stdio_fread/128/iterations:1\n"
+ "BM_stdio_fread/136/iterations:1\n"
+ "BM_stdio_fread/144/iterations:1\n"
+ "BM_stdio_fread/160/iterations:1\n"
+ "BM_stdio_fread/176/iterations:1\n"
+ "BM_stdio_fread/192/iterations:1\n"
+ "BM_stdio_fread/208/iterations:1\n"
+ "BM_stdio_fread/224/iterations:1\n"
+ "BM_stdio_fread/240/iterations:1\n"
+ "BM_stdio_fread/256/iterations:1\n"
+ "BM_stdio_fwrite/512/iterations:1\n"
+ "BM_stdio_fwrite/1024/iterations:1\n"
+ "BM_stdio_fwrite/8192/iterations:1\n"
+ "BM_stdio_fwrite/16384/iterations:1\n"
+ "BM_stdio_fwrite/32768/iterations:1\n"
+ "BM_stdio_fwrite/65536/iterations:1\n"
+ "BM_stdio_fwrite/131072/iterations:1\n"
+ "BM_stdio_fread/262144/iterations:1\n"
+ "BM_stdio_fread/524288/iterations:1\n"
+ "BM_stdio_fread/1048576/iterations:1\n"
+ "BM_stdio_fread/2097152/iterations:1\n"
+ "BM_stdio_fwrite/1/iterations:1\n"
+ "BM_stdio_fwrite/2/iterations:1\n"
+ "BM_stdio_fwrite/3/iterations:1\n"
+ "BM_stdio_fwrite/4/iterations:1\n"
+ "BM_stdio_fwrite/5/iterations:1\n"
+ "BM_stdio_fwrite/6/iterations:1\n"
+ "BM_stdio_fwrite/7/iterations:1\n"
+ "BM_stdio_fwrite/8/iterations:1\n"
+ "BM_stdio_fwrite/9/iterations:1\n"
+ "BM_stdio_fwrite/10/iterations:1\n"
+ "BM_stdio_fwrite/11/iterations:1\n"
+ "BM_stdio_fwrite/12/iterations:1\n"
+ "BM_stdio_fwrite/13/iterations:1\n"
+ "BM_stdio_fwrite/14/iterations:1\n"
+ "BM_stdio_fwrite/15/iterations:1\n"
+ "BM_stdio_fwrite/16/iterations:1\n"
+ "BM_stdio_fwrite/24/iterations:1\n"
+ "BM_stdio_fwrite/32/iterations:1\n"
+ "BM_stdio_fwrite/40/iterations:1\n"
+ "BM_stdio_fwrite/48/iterations:1\n"
+ "BM_stdio_fwrite/56/iterations:1\n"
+ "BM_stdio_fwrite/64/iterations:1\n"
+ "BM_stdio_fwrite/72/iterations:1\n"
+ "BM_stdio_fwrite/80/iterations:1\n"
+ "BM_stdio_fwrite/88/iterations:1\n"
+ "BM_stdio_fwrite/96/iterations:1\n"
+ "BM_stdio_fwrite/104/iterations:1\n"
+ "BM_stdio_fwrite/112/iterations:1\n"
+ "BM_stdio_fwrite/120/iterations:1\n"
+ "BM_stdio_fwrite/128/iterations:1\n"
+ "BM_stdio_fwrite/136/iterations:1\n"
+ "BM_stdio_fwrite/144/iterations:1\n"
+ "BM_stdio_fwrite/160/iterations:1\n"
+ "BM_stdio_fwrite/176/iterations:1\n"
+ "BM_stdio_fwrite/192/iterations:1\n"
+ "BM_stdio_fwrite/208/iterations:1\n"
+ "BM_stdio_fwrite/224/iterations:1\n"
+ "BM_stdio_fwrite/240/iterations:1\n"
+ "BM_stdio_fwrite/256/iterations:1\n"
+ "BM_stdio_fwrite/512/iterations:1\n"
+ "BM_stdio_fwrite/1024/iterations:1\n"
+ "BM_stdio_fwrite/8192/iterations:1\n"
+ "BM_stdio_fwrite/16384/iterations:1\n"
+ "BM_stdio_fwrite/32768/iterations:1\n"
+ "BM_stdio_fwrite/65536/iterations:1\n"
+ "BM_stdio_fwrite/131072/iterations:1\n"
+ "BM_stdio_fwrite/262144/iterations:1\n"
+ "BM_stdio_fwrite/524288/iterations:1\n"
+ "BM_stdio_fwrite/1048576/iterations:1\n"
+ "BM_stdio_fwrite/2097152/iterations:1\n";
Verify(expected, 0, std::vector<const char*>{GetBionicXmlArg("test_size.xml").c_str()});
}
TEST_F(SystemTests, alignment_onebuf) {
std::string expected =
- "BM_string_strlen/8/0/iterations:1\n"
- "BM_string_strlen/64/0/iterations:1\n"
- "BM_string_strlen/512/0/iterations:1\n"
- "BM_string_strlen/1024/0/iterations:1\n"
- "BM_string_strlen/8192/0/iterations:1\n"
- "BM_string_strlen/16384/0/iterations:1\n"
- "BM_string_strlen/32768/0/iterations:1\n"
- "BM_string_strlen/65536/0/iterations:1\n"
- "BM_string_strlen/131072/0/iterations:1\n"
- "BM_string_memset/1/0/iterations:1\n"
- "BM_string_memset/2/0/iterations:1\n"
- "BM_string_memset/3/0/iterations:1\n"
- "BM_string_memset/4/0/iterations:1\n"
- "BM_string_memset/5/0/iterations:1\n"
- "BM_string_memset/6/0/iterations:1\n"
- "BM_string_memset/7/0/iterations:1\n"
- "BM_string_memset/8/0/iterations:1\n"
- "BM_string_memset/9/0/iterations:1\n"
- "BM_string_memset/10/0/iterations:1\n"
- "BM_string_memset/11/0/iterations:1\n"
- "BM_string_memset/12/0/iterations:1\n"
- "BM_string_memset/13/0/iterations:1\n"
- "BM_string_memset/14/0/iterations:1\n"
- "BM_string_memset/15/0/iterations:1\n"
- "BM_string_memset/16/0/iterations:1\n"
- "BM_string_memset/24/0/iterations:1\n"
- "BM_string_memset/32/0/iterations:1\n"
- "BM_string_memset/40/0/iterations:1\n"
- "BM_string_memset/48/0/iterations:1\n"
- "BM_string_memset/56/0/iterations:1\n"
- "BM_string_memset/64/0/iterations:1\n"
- "BM_string_memset/72/0/iterations:1\n"
- "BM_string_memset/80/0/iterations:1\n"
- "BM_string_memset/88/0/iterations:1\n"
- "BM_string_memset/96/0/iterations:1\n"
- "BM_string_memset/104/0/iterations:1\n"
- "BM_string_memset/112/0/iterations:1\n"
- "BM_string_memset/120/0/iterations:1\n"
- "BM_string_memset/128/0/iterations:1\n"
- "BM_string_memset/136/0/iterations:1\n"
- "BM_string_memset/144/0/iterations:1\n"
- "BM_string_memset/160/0/iterations:1\n"
- "BM_string_memset/176/0/iterations:1\n"
- "BM_string_memset/192/0/iterations:1\n"
- "BM_string_memset/208/0/iterations:1\n"
- "BM_string_memset/224/0/iterations:1\n"
- "BM_string_memset/240/0/iterations:1\n"
- "BM_string_memset/256/0/iterations:1\n"
- "BM_string_strlen/512/0/iterations:1\n"
- "BM_string_strlen/1024/0/iterations:1\n"
- "BM_string_strlen/8192/0/iterations:1\n"
- "BM_string_strlen/16384/0/iterations:1\n"
- "BM_string_strlen/32768/0/iterations:1\n"
- "BM_string_strlen/65536/0/iterations:1\n"
- "BM_string_strlen/131072/0/iterations:1\n"
- "BM_string_memset/262144/0/iterations:1\n"
- "BM_string_memset/524288/0/iterations:1\n"
- "BM_string_memset/1048576/0/iterations:1\n"
- "BM_string_memset/2097152/0/iterations:1\n"
- "BM_string_strlen/1/0/iterations:1\n"
- "BM_string_strlen/2/0/iterations:1\n"
- "BM_string_strlen/3/0/iterations:1\n"
- "BM_string_strlen/4/0/iterations:1\n"
- "BM_string_strlen/5/0/iterations:1\n"
- "BM_string_strlen/6/0/iterations:1\n"
- "BM_string_strlen/7/0/iterations:1\n"
- "BM_string_strlen/8/0/iterations:1\n"
- "BM_string_strlen/9/0/iterations:1\n"
- "BM_string_strlen/10/0/iterations:1\n"
- "BM_string_strlen/11/0/iterations:1\n"
- "BM_string_strlen/12/0/iterations:1\n"
- "BM_string_strlen/13/0/iterations:1\n"
- "BM_string_strlen/14/0/iterations:1\n"
- "BM_string_strlen/15/0/iterations:1\n"
- "BM_string_strlen/16/0/iterations:1\n"
- "BM_string_strlen/24/0/iterations:1\n"
- "BM_string_strlen/32/0/iterations:1\n"
- "BM_string_strlen/40/0/iterations:1\n"
- "BM_string_strlen/48/0/iterations:1\n"
- "BM_string_strlen/56/0/iterations:1\n"
- "BM_string_strlen/64/0/iterations:1\n"
- "BM_string_strlen/72/0/iterations:1\n"
- "BM_string_strlen/80/0/iterations:1\n"
- "BM_string_strlen/88/0/iterations:1\n"
- "BM_string_strlen/96/0/iterations:1\n"
- "BM_string_strlen/104/0/iterations:1\n"
- "BM_string_strlen/112/0/iterations:1\n"
- "BM_string_strlen/120/0/iterations:1\n"
- "BM_string_strlen/128/0/iterations:1\n"
- "BM_string_strlen/136/0/iterations:1\n"
- "BM_string_strlen/144/0/iterations:1\n"
- "BM_string_strlen/160/0/iterations:1\n"
- "BM_string_strlen/176/0/iterations:1\n"
- "BM_string_strlen/192/0/iterations:1\n"
- "BM_string_strlen/208/0/iterations:1\n"
- "BM_string_strlen/224/0/iterations:1\n"
- "BM_string_strlen/240/0/iterations:1\n"
- "BM_string_strlen/256/0/iterations:1\n"
- "BM_string_strlen/512/0/iterations:1\n"
- "BM_string_strlen/1024/0/iterations:1\n"
- "BM_string_strlen/8192/0/iterations:1\n"
- "BM_string_strlen/16384/0/iterations:1\n"
- "BM_string_strlen/32768/0/iterations:1\n"
- "BM_string_strlen/65536/0/iterations:1\n"
- "BM_string_strlen/131072/0/iterations:1\n"
- "BM_string_strlen/262144/0/iterations:1\n"
- "BM_string_strlen/524288/0/iterations:1\n"
- "BM_string_strlen/1048576/0/iterations:1\n"
- "BM_string_strlen/2097152/0/iterations:1\n"
- "BM_string_memset/1/0/iterations:1\n"
- "BM_string_memset/1/1/iterations:1\n"
- "BM_string_memset/1/2/iterations:1\n"
- "BM_string_memset/1/4/iterations:1\n"
- "BM_string_memset/1/8/iterations:1\n"
- "BM_string_memset/1/16/iterations:1\n"
- "BM_string_memset/1/32/iterations:1\n"
- "BM_string_memset/2/0/iterations:1\n"
- "BM_string_memset/2/1/iterations:1\n"
- "BM_string_memset/2/2/iterations:1\n"
- "BM_string_memset/2/4/iterations:1\n"
- "BM_string_memset/2/8/iterations:1\n"
- "BM_string_memset/2/16/iterations:1\n"
- "BM_string_memset/2/32/iterations:1\n"
- "BM_string_memset/3/0/iterations:1\n"
- "BM_string_memset/3/1/iterations:1\n"
- "BM_string_memset/3/2/iterations:1\n"
- "BM_string_memset/3/4/iterations:1\n"
- "BM_string_memset/3/8/iterations:1\n"
- "BM_string_memset/3/16/iterations:1\n"
- "BM_string_memset/3/32/iterations:1\n"
- "BM_string_memset/4/0/iterations:1\n"
- "BM_string_memset/4/1/iterations:1\n"
- "BM_string_memset/4/2/iterations:1\n"
- "BM_string_memset/4/4/iterations:1\n"
- "BM_string_memset/4/8/iterations:1\n"
- "BM_string_memset/4/16/iterations:1\n"
- "BM_string_memset/4/32/iterations:1\n"
- "BM_string_memset/5/0/iterations:1\n"
- "BM_string_memset/5/1/iterations:1\n"
- "BM_string_memset/5/2/iterations:1\n"
- "BM_string_memset/5/4/iterations:1\n"
- "BM_string_memset/5/8/iterations:1\n"
- "BM_string_memset/5/16/iterations:1\n"
- "BM_string_memset/5/32/iterations:1\n"
- "BM_string_memset/6/0/iterations:1\n"
- "BM_string_memset/6/1/iterations:1\n"
- "BM_string_memset/6/2/iterations:1\n"
- "BM_string_memset/6/4/iterations:1\n"
- "BM_string_memset/6/8/iterations:1\n"
- "BM_string_memset/6/16/iterations:1\n"
- "BM_string_memset/6/32/iterations:1\n"
- "BM_string_memset/7/0/iterations:1\n"
- "BM_string_memset/7/1/iterations:1\n"
- "BM_string_memset/7/2/iterations:1\n"
- "BM_string_memset/7/4/iterations:1\n"
- "BM_string_memset/7/8/iterations:1\n"
- "BM_string_memset/7/16/iterations:1\n"
- "BM_string_memset/7/32/iterations:1\n"
- "BM_string_memset/8/0/iterations:1\n"
- "BM_string_memset/8/1/iterations:1\n"
- "BM_string_memset/8/2/iterations:1\n"
- "BM_string_memset/8/4/iterations:1\n"
- "BM_string_memset/8/8/iterations:1\n"
- "BM_string_memset/8/16/iterations:1\n"
- "BM_string_memset/8/32/iterations:1\n"
- "BM_string_memset/9/0/iterations:1\n"
- "BM_string_memset/9/1/iterations:1\n"
- "BM_string_memset/9/2/iterations:1\n"
- "BM_string_memset/9/4/iterations:1\n"
- "BM_string_memset/9/8/iterations:1\n"
- "BM_string_memset/9/16/iterations:1\n"
- "BM_string_memset/9/32/iterations:1\n"
- "BM_string_memset/10/0/iterations:1\n"
- "BM_string_memset/10/1/iterations:1\n"
- "BM_string_memset/10/2/iterations:1\n"
- "BM_string_memset/10/4/iterations:1\n"
- "BM_string_memset/10/8/iterations:1\n"
- "BM_string_memset/10/16/iterations:1\n"
- "BM_string_memset/10/32/iterations:1\n"
- "BM_string_memset/11/0/iterations:1\n"
- "BM_string_memset/11/1/iterations:1\n"
- "BM_string_memset/11/2/iterations:1\n"
- "BM_string_memset/11/4/iterations:1\n"
- "BM_string_memset/11/8/iterations:1\n"
- "BM_string_memset/11/16/iterations:1\n"
- "BM_string_memset/11/32/iterations:1\n"
- "BM_string_memset/12/0/iterations:1\n"
- "BM_string_memset/12/1/iterations:1\n"
- "BM_string_memset/12/2/iterations:1\n"
- "BM_string_memset/12/4/iterations:1\n"
- "BM_string_memset/12/8/iterations:1\n"
- "BM_string_memset/12/16/iterations:1\n"
- "BM_string_memset/12/32/iterations:1\n"
- "BM_string_memset/13/0/iterations:1\n"
- "BM_string_memset/13/1/iterations:1\n"
- "BM_string_memset/13/2/iterations:1\n"
- "BM_string_memset/13/4/iterations:1\n"
- "BM_string_memset/13/8/iterations:1\n"
- "BM_string_memset/13/16/iterations:1\n"
- "BM_string_memset/13/32/iterations:1\n"
- "BM_string_memset/14/0/iterations:1\n"
- "BM_string_memset/14/1/iterations:1\n"
- "BM_string_memset/14/2/iterations:1\n"
- "BM_string_memset/14/4/iterations:1\n"
- "BM_string_memset/14/8/iterations:1\n"
- "BM_string_memset/14/16/iterations:1\n"
- "BM_string_memset/14/32/iterations:1\n"
- "BM_string_memset/15/0/iterations:1\n"
- "BM_string_memset/15/1/iterations:1\n"
- "BM_string_memset/15/2/iterations:1\n"
- "BM_string_memset/15/4/iterations:1\n"
- "BM_string_memset/15/8/iterations:1\n"
- "BM_string_memset/15/16/iterations:1\n"
- "BM_string_memset/15/32/iterations:1\n"
- "BM_string_memset/16/0/iterations:1\n"
- "BM_string_memset/16/1/iterations:1\n"
- "BM_string_memset/16/2/iterations:1\n"
- "BM_string_memset/16/4/iterations:1\n"
- "BM_string_memset/16/8/iterations:1\n"
- "BM_string_memset/16/16/iterations:1\n"
- "BM_string_memset/16/32/iterations:1\n"
- "BM_string_memset/24/0/iterations:1\n"
- "BM_string_memset/24/1/iterations:1\n"
- "BM_string_memset/24/2/iterations:1\n"
- "BM_string_memset/24/4/iterations:1\n"
- "BM_string_memset/24/8/iterations:1\n"
- "BM_string_memset/24/16/iterations:1\n"
- "BM_string_memset/24/32/iterations:1\n"
- "BM_string_memset/32/0/iterations:1\n"
- "BM_string_memset/32/1/iterations:1\n"
- "BM_string_memset/32/2/iterations:1\n"
- "BM_string_memset/32/4/iterations:1\n"
- "BM_string_memset/32/8/iterations:1\n"
- "BM_string_memset/32/16/iterations:1\n"
- "BM_string_memset/32/32/iterations:1\n"
- "BM_string_memset/40/0/iterations:1\n"
- "BM_string_memset/40/1/iterations:1\n"
- "BM_string_memset/40/2/iterations:1\n"
- "BM_string_memset/40/4/iterations:1\n"
- "BM_string_memset/40/8/iterations:1\n"
- "BM_string_memset/40/16/iterations:1\n"
- "BM_string_memset/40/32/iterations:1\n"
- "BM_string_memset/48/0/iterations:1\n"
- "BM_string_memset/48/1/iterations:1\n"
- "BM_string_memset/48/2/iterations:1\n"
- "BM_string_memset/48/4/iterations:1\n"
- "BM_string_memset/48/8/iterations:1\n"
- "BM_string_memset/48/16/iterations:1\n"
- "BM_string_memset/48/32/iterations:1\n"
- "BM_string_memset/56/0/iterations:1\n"
- "BM_string_memset/56/1/iterations:1\n"
- "BM_string_memset/56/2/iterations:1\n"
- "BM_string_memset/56/4/iterations:1\n"
- "BM_string_memset/56/8/iterations:1\n"
- "BM_string_memset/56/16/iterations:1\n"
- "BM_string_memset/56/32/iterations:1\n"
- "BM_string_memset/64/0/iterations:1\n"
- "BM_string_memset/64/1/iterations:1\n"
- "BM_string_memset/64/2/iterations:1\n"
- "BM_string_memset/64/4/iterations:1\n"
- "BM_string_memset/64/8/iterations:1\n"
- "BM_string_memset/64/16/iterations:1\n"
- "BM_string_memset/64/32/iterations:1\n"
- "BM_string_memset/72/0/iterations:1\n"
- "BM_string_memset/72/1/iterations:1\n"
- "BM_string_memset/72/2/iterations:1\n"
- "BM_string_memset/72/4/iterations:1\n"
- "BM_string_memset/72/8/iterations:1\n"
- "BM_string_memset/72/16/iterations:1\n"
- "BM_string_memset/72/32/iterations:1\n"
- "BM_string_memset/80/0/iterations:1\n"
- "BM_string_memset/80/1/iterations:1\n"
- "BM_string_memset/80/2/iterations:1\n"
- "BM_string_memset/80/4/iterations:1\n"
- "BM_string_memset/80/8/iterations:1\n"
- "BM_string_memset/80/16/iterations:1\n"
- "BM_string_memset/80/32/iterations:1\n"
- "BM_string_memset/88/0/iterations:1\n"
- "BM_string_memset/88/1/iterations:1\n"
- "BM_string_memset/88/2/iterations:1\n"
- "BM_string_memset/88/4/iterations:1\n"
- "BM_string_memset/88/8/iterations:1\n"
- "BM_string_memset/88/16/iterations:1\n"
- "BM_string_memset/88/32/iterations:1\n"
- "BM_string_memset/96/0/iterations:1\n"
- "BM_string_memset/96/1/iterations:1\n"
- "BM_string_memset/96/2/iterations:1\n"
- "BM_string_memset/96/4/iterations:1\n"
- "BM_string_memset/96/8/iterations:1\n"
- "BM_string_memset/96/16/iterations:1\n"
- "BM_string_memset/96/32/iterations:1\n"
- "BM_string_memset/104/0/iterations:1\n"
- "BM_string_memset/104/1/iterations:1\n"
- "BM_string_memset/104/2/iterations:1\n"
- "BM_string_memset/104/4/iterations:1\n"
- "BM_string_memset/104/8/iterations:1\n"
- "BM_string_memset/104/16/iterations:1\n"
- "BM_string_memset/104/32/iterations:1\n"
- "BM_string_memset/112/0/iterations:1\n"
- "BM_string_memset/112/1/iterations:1\n"
- "BM_string_memset/112/2/iterations:1\n"
- "BM_string_memset/112/4/iterations:1\n"
- "BM_string_memset/112/8/iterations:1\n"
- "BM_string_memset/112/16/iterations:1\n"
- "BM_string_memset/112/32/iterations:1\n"
- "BM_string_memset/120/0/iterations:1\n"
- "BM_string_memset/120/1/iterations:1\n"
- "BM_string_memset/120/2/iterations:1\n"
- "BM_string_memset/120/4/iterations:1\n"
- "BM_string_memset/120/8/iterations:1\n"
- "BM_string_memset/120/16/iterations:1\n"
- "BM_string_memset/120/32/iterations:1\n"
- "BM_string_memset/128/0/iterations:1\n"
- "BM_string_memset/128/1/iterations:1\n"
- "BM_string_memset/128/2/iterations:1\n"
- "BM_string_memset/128/4/iterations:1\n"
- "BM_string_memset/128/8/iterations:1\n"
- "BM_string_memset/128/16/iterations:1\n"
- "BM_string_memset/128/32/iterations:1\n"
- "BM_string_memset/136/0/iterations:1\n"
- "BM_string_memset/136/1/iterations:1\n"
- "BM_string_memset/136/2/iterations:1\n"
- "BM_string_memset/136/4/iterations:1\n"
- "BM_string_memset/136/8/iterations:1\n"
- "BM_string_memset/136/16/iterations:1\n"
- "BM_string_memset/136/32/iterations:1\n"
- "BM_string_memset/144/0/iterations:1\n"
- "BM_string_memset/144/1/iterations:1\n"
- "BM_string_memset/144/2/iterations:1\n"
- "BM_string_memset/144/4/iterations:1\n"
- "BM_string_memset/144/8/iterations:1\n"
- "BM_string_memset/144/16/iterations:1\n"
- "BM_string_memset/144/32/iterations:1\n"
- "BM_string_memset/160/0/iterations:1\n"
- "BM_string_memset/160/1/iterations:1\n"
- "BM_string_memset/160/2/iterations:1\n"
- "BM_string_memset/160/4/iterations:1\n"
- "BM_string_memset/160/8/iterations:1\n"
- "BM_string_memset/160/16/iterations:1\n"
- "BM_string_memset/160/32/iterations:1\n"
- "BM_string_memset/176/0/iterations:1\n"
- "BM_string_memset/176/1/iterations:1\n"
- "BM_string_memset/176/2/iterations:1\n"
- "BM_string_memset/176/4/iterations:1\n"
- "BM_string_memset/176/8/iterations:1\n"
- "BM_string_memset/176/16/iterations:1\n"
- "BM_string_memset/176/32/iterations:1\n"
- "BM_string_memset/192/0/iterations:1\n"
- "BM_string_memset/192/1/iterations:1\n"
- "BM_string_memset/192/2/iterations:1\n"
- "BM_string_memset/192/4/iterations:1\n"
- "BM_string_memset/192/8/iterations:1\n"
- "BM_string_memset/192/16/iterations:1\n"
- "BM_string_memset/192/32/iterations:1\n"
- "BM_string_memset/208/0/iterations:1\n"
- "BM_string_memset/208/1/iterations:1\n"
- "BM_string_memset/208/2/iterations:1\n"
- "BM_string_memset/208/4/iterations:1\n"
- "BM_string_memset/208/8/iterations:1\n"
- "BM_string_memset/208/16/iterations:1\n"
- "BM_string_memset/208/32/iterations:1\n"
- "BM_string_memset/224/0/iterations:1\n"
- "BM_string_memset/224/1/iterations:1\n"
- "BM_string_memset/224/2/iterations:1\n"
- "BM_string_memset/224/4/iterations:1\n"
- "BM_string_memset/224/8/iterations:1\n"
- "BM_string_memset/224/16/iterations:1\n"
- "BM_string_memset/224/32/iterations:1\n"
- "BM_string_memset/240/0/iterations:1\n"
- "BM_string_memset/240/1/iterations:1\n"
- "BM_string_memset/240/2/iterations:1\n"
- "BM_string_memset/240/4/iterations:1\n"
- "BM_string_memset/240/8/iterations:1\n"
- "BM_string_memset/240/16/iterations:1\n"
- "BM_string_memset/240/32/iterations:1\n"
- "BM_string_memset/256/0/iterations:1\n"
- "BM_string_memset/256/1/iterations:1\n"
- "BM_string_memset/256/2/iterations:1\n"
- "BM_string_memset/256/4/iterations:1\n"
- "BM_string_memset/256/8/iterations:1\n"
- "BM_string_memset/256/16/iterations:1\n"
- "BM_string_memset/256/32/iterations:1\n"
- "BM_string_memset/512/0/iterations:1\n"
- "BM_string_memset/512/1/iterations:1\n"
- "BM_string_memset/512/2/iterations:1\n"
- "BM_string_memset/512/4/iterations:1\n"
- "BM_string_memset/512/8/iterations:1\n"
- "BM_string_memset/512/16/iterations:1\n"
- "BM_string_memset/512/32/iterations:1\n"
- "BM_string_memset/1024/0/iterations:1\n"
- "BM_string_memset/1024/1/iterations:1\n"
- "BM_string_memset/1024/2/iterations:1\n"
- "BM_string_memset/1024/4/iterations:1\n"
- "BM_string_memset/1024/8/iterations:1\n"
- "BM_string_memset/1024/16/iterations:1\n"
- "BM_string_memset/1024/32/iterations:1\n"
- "BM_string_memset/8192/0/iterations:1\n"
- "BM_string_memset/8192/1/iterations:1\n"
- "BM_string_memset/8192/2/iterations:1\n"
- "BM_string_memset/8192/4/iterations:1\n"
- "BM_string_memset/8192/8/iterations:1\n"
- "BM_string_memset/8192/16/iterations:1\n"
- "BM_string_memset/8192/32/iterations:1\n"
- "BM_string_memset/16384/0/iterations:1\n"
- "BM_string_memset/16384/1/iterations:1\n"
- "BM_string_memset/16384/2/iterations:1\n"
- "BM_string_memset/16384/4/iterations:1\n"
- "BM_string_memset/16384/8/iterations:1\n"
- "BM_string_memset/16384/16/iterations:1\n"
- "BM_string_memset/16384/32/iterations:1\n"
- "BM_string_memset/32768/0/iterations:1\n"
- "BM_string_memset/32768/1/iterations:1\n"
- "BM_string_memset/32768/2/iterations:1\n"
- "BM_string_memset/32768/4/iterations:1\n"
- "BM_string_memset/32768/8/iterations:1\n"
- "BM_string_memset/32768/16/iterations:1\n"
- "BM_string_memset/32768/32/iterations:1\n"
- "BM_string_memset/65536/0/iterations:1\n"
- "BM_string_memset/65536/1/iterations:1\n"
- "BM_string_memset/65536/2/iterations:1\n"
- "BM_string_memset/65536/4/iterations:1\n"
- "BM_string_memset/65536/8/iterations:1\n"
- "BM_string_memset/65536/16/iterations:1\n"
- "BM_string_memset/65536/32/iterations:1\n"
- "BM_string_memset/131072/0/iterations:1\n"
- "BM_string_memset/131072/1/iterations:1\n"
- "BM_string_memset/131072/2/iterations:1\n"
- "BM_string_memset/131072/4/iterations:1\n"
- "BM_string_memset/131072/8/iterations:1\n"
- "BM_string_memset/131072/16/iterations:1\n"
- "BM_string_memset/131072/32/iterations:1\n"
- "BM_string_memset/262144/0/iterations:1\n"
- "BM_string_memset/262144/1/iterations:1\n"
- "BM_string_memset/262144/2/iterations:1\n"
- "BM_string_memset/262144/4/iterations:1\n"
- "BM_string_memset/262144/8/iterations:1\n"
- "BM_string_memset/262144/16/iterations:1\n"
- "BM_string_memset/262144/32/iterations:1\n"
- "BM_string_memset/524288/0/iterations:1\n"
- "BM_string_memset/524288/1/iterations:1\n"
- "BM_string_memset/524288/2/iterations:1\n"
- "BM_string_memset/524288/4/iterations:1\n"
- "BM_string_memset/524288/8/iterations:1\n"
- "BM_string_memset/524288/16/iterations:1\n"
- "BM_string_memset/524288/32/iterations:1\n"
- "BM_string_memset/1048576/0/iterations:1\n"
- "BM_string_memset/1048576/1/iterations:1\n"
- "BM_string_memset/1048576/2/iterations:1\n"
- "BM_string_memset/1048576/4/iterations:1\n"
- "BM_string_memset/1048576/8/iterations:1\n"
- "BM_string_memset/1048576/16/iterations:1\n"
- "BM_string_memset/1048576/32/iterations:1\n"
- "BM_string_memset/2097152/0/iterations:1\n"
- "BM_string_memset/2097152/1/iterations:1\n"
- "BM_string_memset/2097152/2/iterations:1\n"
- "BM_string_memset/2097152/4/iterations:1\n"
- "BM_string_memset/2097152/8/iterations:1\n"
- "BM_string_memset/2097152/16/iterations:1\n"
- "BM_string_memset/2097152/32/iterations:1\n";
+ "BM_string_strlen/8/0/iterations:1\n"
+ "BM_string_strlen/16/0/iterations:1\n"
+ "BM_string_strlen/32/0/iterations:1\n"
+ "BM_string_strlen/64/0/iterations:1\n"
+ "BM_string_strlen/512/0/iterations:1\n"
+ "BM_string_strlen/1024/0/iterations:1\n"
+ "BM_string_strlen/8192/0/iterations:1\n"
+ "BM_string_strlen/16384/0/iterations:1\n"
+ "BM_string_strlen/32768/0/iterations:1\n"
+ "BM_string_strlen/65536/0/iterations:1\n"
+ "BM_string_strlen/131072/0/iterations:1\n"
+ "BM_string_memset/1/0/iterations:1\n"
+ "BM_string_memset/2/0/iterations:1\n"
+ "BM_string_memset/3/0/iterations:1\n"
+ "BM_string_memset/4/0/iterations:1\n"
+ "BM_string_memset/5/0/iterations:1\n"
+ "BM_string_memset/6/0/iterations:1\n"
+ "BM_string_memset/7/0/iterations:1\n"
+ "BM_string_memset/8/0/iterations:1\n"
+ "BM_string_memset/9/0/iterations:1\n"
+ "BM_string_memset/10/0/iterations:1\n"
+ "BM_string_memset/11/0/iterations:1\n"
+ "BM_string_memset/12/0/iterations:1\n"
+ "BM_string_memset/13/0/iterations:1\n"
+ "BM_string_memset/14/0/iterations:1\n"
+ "BM_string_memset/15/0/iterations:1\n"
+ "BM_string_memset/16/0/iterations:1\n"
+ "BM_string_memset/24/0/iterations:1\n"
+ "BM_string_memset/32/0/iterations:1\n"
+ "BM_string_memset/40/0/iterations:1\n"
+ "BM_string_memset/48/0/iterations:1\n"
+ "BM_string_memset/56/0/iterations:1\n"
+ "BM_string_memset/64/0/iterations:1\n"
+ "BM_string_memset/72/0/iterations:1\n"
+ "BM_string_memset/80/0/iterations:1\n"
+ "BM_string_memset/88/0/iterations:1\n"
+ "BM_string_memset/96/0/iterations:1\n"
+ "BM_string_memset/104/0/iterations:1\n"
+ "BM_string_memset/112/0/iterations:1\n"
+ "BM_string_memset/120/0/iterations:1\n"
+ "BM_string_memset/128/0/iterations:1\n"
+ "BM_string_memset/136/0/iterations:1\n"
+ "BM_string_memset/144/0/iterations:1\n"
+ "BM_string_memset/160/0/iterations:1\n"
+ "BM_string_memset/176/0/iterations:1\n"
+ "BM_string_memset/192/0/iterations:1\n"
+ "BM_string_memset/208/0/iterations:1\n"
+ "BM_string_memset/224/0/iterations:1\n"
+ "BM_string_memset/240/0/iterations:1\n"
+ "BM_string_memset/256/0/iterations:1\n"
+ "BM_string_strlen/512/0/iterations:1\n"
+ "BM_string_strlen/1024/0/iterations:1\n"
+ "BM_string_strlen/8192/0/iterations:1\n"
+ "BM_string_strlen/16384/0/iterations:1\n"
+ "BM_string_strlen/32768/0/iterations:1\n"
+ "BM_string_strlen/65536/0/iterations:1\n"
+ "BM_string_strlen/131072/0/iterations:1\n"
+ "BM_string_memset/262144/0/iterations:1\n"
+ "BM_string_memset/524288/0/iterations:1\n"
+ "BM_string_memset/1048576/0/iterations:1\n"
+ "BM_string_memset/2097152/0/iterations:1\n"
+ "BM_string_strlen/1/0/iterations:1\n"
+ "BM_string_strlen/2/0/iterations:1\n"
+ "BM_string_strlen/3/0/iterations:1\n"
+ "BM_string_strlen/4/0/iterations:1\n"
+ "BM_string_strlen/5/0/iterations:1\n"
+ "BM_string_strlen/6/0/iterations:1\n"
+ "BM_string_strlen/7/0/iterations:1\n"
+ "BM_string_strlen/8/0/iterations:1\n"
+ "BM_string_strlen/9/0/iterations:1\n"
+ "BM_string_strlen/10/0/iterations:1\n"
+ "BM_string_strlen/11/0/iterations:1\n"
+ "BM_string_strlen/12/0/iterations:1\n"
+ "BM_string_strlen/13/0/iterations:1\n"
+ "BM_string_strlen/14/0/iterations:1\n"
+ "BM_string_strlen/15/0/iterations:1\n"
+ "BM_string_strlen/16/0/iterations:1\n"
+ "BM_string_strlen/24/0/iterations:1\n"
+ "BM_string_strlen/32/0/iterations:1\n"
+ "BM_string_strlen/40/0/iterations:1\n"
+ "BM_string_strlen/48/0/iterations:1\n"
+ "BM_string_strlen/56/0/iterations:1\n"
+ "BM_string_strlen/64/0/iterations:1\n"
+ "BM_string_strlen/72/0/iterations:1\n"
+ "BM_string_strlen/80/0/iterations:1\n"
+ "BM_string_strlen/88/0/iterations:1\n"
+ "BM_string_strlen/96/0/iterations:1\n"
+ "BM_string_strlen/104/0/iterations:1\n"
+ "BM_string_strlen/112/0/iterations:1\n"
+ "BM_string_strlen/120/0/iterations:1\n"
+ "BM_string_strlen/128/0/iterations:1\n"
+ "BM_string_strlen/136/0/iterations:1\n"
+ "BM_string_strlen/144/0/iterations:1\n"
+ "BM_string_strlen/160/0/iterations:1\n"
+ "BM_string_strlen/176/0/iterations:1\n"
+ "BM_string_strlen/192/0/iterations:1\n"
+ "BM_string_strlen/208/0/iterations:1\n"
+ "BM_string_strlen/224/0/iterations:1\n"
+ "BM_string_strlen/240/0/iterations:1\n"
+ "BM_string_strlen/256/0/iterations:1\n"
+ "BM_string_strlen/512/0/iterations:1\n"
+ "BM_string_strlen/1024/0/iterations:1\n"
+ "BM_string_strlen/8192/0/iterations:1\n"
+ "BM_string_strlen/16384/0/iterations:1\n"
+ "BM_string_strlen/32768/0/iterations:1\n"
+ "BM_string_strlen/65536/0/iterations:1\n"
+ "BM_string_strlen/131072/0/iterations:1\n"
+ "BM_string_strlen/262144/0/iterations:1\n"
+ "BM_string_strlen/524288/0/iterations:1\n"
+ "BM_string_strlen/1048576/0/iterations:1\n"
+ "BM_string_strlen/2097152/0/iterations:1\n"
+ "BM_string_memset/1/0/iterations:1\n"
+ "BM_string_memset/1/1/iterations:1\n"
+ "BM_string_memset/1/2/iterations:1\n"
+ "BM_string_memset/1/4/iterations:1\n"
+ "BM_string_memset/1/8/iterations:1\n"
+ "BM_string_memset/1/16/iterations:1\n"
+ "BM_string_memset/1/32/iterations:1\n"
+ "BM_string_memset/2/0/iterations:1\n"
+ "BM_string_memset/2/1/iterations:1\n"
+ "BM_string_memset/2/2/iterations:1\n"
+ "BM_string_memset/2/4/iterations:1\n"
+ "BM_string_memset/2/8/iterations:1\n"
+ "BM_string_memset/2/16/iterations:1\n"
+ "BM_string_memset/2/32/iterations:1\n"
+ "BM_string_memset/3/0/iterations:1\n"
+ "BM_string_memset/3/1/iterations:1\n"
+ "BM_string_memset/3/2/iterations:1\n"
+ "BM_string_memset/3/4/iterations:1\n"
+ "BM_string_memset/3/8/iterations:1\n"
+ "BM_string_memset/3/16/iterations:1\n"
+ "BM_string_memset/3/32/iterations:1\n"
+ "BM_string_memset/4/0/iterations:1\n"
+ "BM_string_memset/4/1/iterations:1\n"
+ "BM_string_memset/4/2/iterations:1\n"
+ "BM_string_memset/4/4/iterations:1\n"
+ "BM_string_memset/4/8/iterations:1\n"
+ "BM_string_memset/4/16/iterations:1\n"
+ "BM_string_memset/4/32/iterations:1\n"
+ "BM_string_memset/5/0/iterations:1\n"
+ "BM_string_memset/5/1/iterations:1\n"
+ "BM_string_memset/5/2/iterations:1\n"
+ "BM_string_memset/5/4/iterations:1\n"
+ "BM_string_memset/5/8/iterations:1\n"
+ "BM_string_memset/5/16/iterations:1\n"
+ "BM_string_memset/5/32/iterations:1\n"
+ "BM_string_memset/6/0/iterations:1\n"
+ "BM_string_memset/6/1/iterations:1\n"
+ "BM_string_memset/6/2/iterations:1\n"
+ "BM_string_memset/6/4/iterations:1\n"
+ "BM_string_memset/6/8/iterations:1\n"
+ "BM_string_memset/6/16/iterations:1\n"
+ "BM_string_memset/6/32/iterations:1\n"
+ "BM_string_memset/7/0/iterations:1\n"
+ "BM_string_memset/7/1/iterations:1\n"
+ "BM_string_memset/7/2/iterations:1\n"
+ "BM_string_memset/7/4/iterations:1\n"
+ "BM_string_memset/7/8/iterations:1\n"
+ "BM_string_memset/7/16/iterations:1\n"
+ "BM_string_memset/7/32/iterations:1\n"
+ "BM_string_memset/8/0/iterations:1\n"
+ "BM_string_memset/8/1/iterations:1\n"
+ "BM_string_memset/8/2/iterations:1\n"
+ "BM_string_memset/8/4/iterations:1\n"
+ "BM_string_memset/8/8/iterations:1\n"
+ "BM_string_memset/8/16/iterations:1\n"
+ "BM_string_memset/8/32/iterations:1\n"
+ "BM_string_memset/9/0/iterations:1\n"
+ "BM_string_memset/9/1/iterations:1\n"
+ "BM_string_memset/9/2/iterations:1\n"
+ "BM_string_memset/9/4/iterations:1\n"
+ "BM_string_memset/9/8/iterations:1\n"
+ "BM_string_memset/9/16/iterations:1\n"
+ "BM_string_memset/9/32/iterations:1\n"
+ "BM_string_memset/10/0/iterations:1\n"
+ "BM_string_memset/10/1/iterations:1\n"
+ "BM_string_memset/10/2/iterations:1\n"
+ "BM_string_memset/10/4/iterations:1\n"
+ "BM_string_memset/10/8/iterations:1\n"
+ "BM_string_memset/10/16/iterations:1\n"
+ "BM_string_memset/10/32/iterations:1\n"
+ "BM_string_memset/11/0/iterations:1\n"
+ "BM_string_memset/11/1/iterations:1\n"
+ "BM_string_memset/11/2/iterations:1\n"
+ "BM_string_memset/11/4/iterations:1\n"
+ "BM_string_memset/11/8/iterations:1\n"
+ "BM_string_memset/11/16/iterations:1\n"
+ "BM_string_memset/11/32/iterations:1\n"
+ "BM_string_memset/12/0/iterations:1\n"
+ "BM_string_memset/12/1/iterations:1\n"
+ "BM_string_memset/12/2/iterations:1\n"
+ "BM_string_memset/12/4/iterations:1\n"
+ "BM_string_memset/12/8/iterations:1\n"
+ "BM_string_memset/12/16/iterations:1\n"
+ "BM_string_memset/12/32/iterations:1\n"
+ "BM_string_memset/13/0/iterations:1\n"
+ "BM_string_memset/13/1/iterations:1\n"
+ "BM_string_memset/13/2/iterations:1\n"
+ "BM_string_memset/13/4/iterations:1\n"
+ "BM_string_memset/13/8/iterations:1\n"
+ "BM_string_memset/13/16/iterations:1\n"
+ "BM_string_memset/13/32/iterations:1\n"
+ "BM_string_memset/14/0/iterations:1\n"
+ "BM_string_memset/14/1/iterations:1\n"
+ "BM_string_memset/14/2/iterations:1\n"
+ "BM_string_memset/14/4/iterations:1\n"
+ "BM_string_memset/14/8/iterations:1\n"
+ "BM_string_memset/14/16/iterations:1\n"
+ "BM_string_memset/14/32/iterations:1\n"
+ "BM_string_memset/15/0/iterations:1\n"
+ "BM_string_memset/15/1/iterations:1\n"
+ "BM_string_memset/15/2/iterations:1\n"
+ "BM_string_memset/15/4/iterations:1\n"
+ "BM_string_memset/15/8/iterations:1\n"
+ "BM_string_memset/15/16/iterations:1\n"
+ "BM_string_memset/15/32/iterations:1\n"
+ "BM_string_memset/16/0/iterations:1\n"
+ "BM_string_memset/16/1/iterations:1\n"
+ "BM_string_memset/16/2/iterations:1\n"
+ "BM_string_memset/16/4/iterations:1\n"
+ "BM_string_memset/16/8/iterations:1\n"
+ "BM_string_memset/16/16/iterations:1\n"
+ "BM_string_memset/16/32/iterations:1\n"
+ "BM_string_memset/24/0/iterations:1\n"
+ "BM_string_memset/24/1/iterations:1\n"
+ "BM_string_memset/24/2/iterations:1\n"
+ "BM_string_memset/24/4/iterations:1\n"
+ "BM_string_memset/24/8/iterations:1\n"
+ "BM_string_memset/24/16/iterations:1\n"
+ "BM_string_memset/24/32/iterations:1\n"
+ "BM_string_memset/32/0/iterations:1\n"
+ "BM_string_memset/32/1/iterations:1\n"
+ "BM_string_memset/32/2/iterations:1\n"
+ "BM_string_memset/32/4/iterations:1\n"
+ "BM_string_memset/32/8/iterations:1\n"
+ "BM_string_memset/32/16/iterations:1\n"
+ "BM_string_memset/32/32/iterations:1\n"
+ "BM_string_memset/40/0/iterations:1\n"
+ "BM_string_memset/40/1/iterations:1\n"
+ "BM_string_memset/40/2/iterations:1\n"
+ "BM_string_memset/40/4/iterations:1\n"
+ "BM_string_memset/40/8/iterations:1\n"
+ "BM_string_memset/40/16/iterations:1\n"
+ "BM_string_memset/40/32/iterations:1\n"
+ "BM_string_memset/48/0/iterations:1\n"
+ "BM_string_memset/48/1/iterations:1\n"
+ "BM_string_memset/48/2/iterations:1\n"
+ "BM_string_memset/48/4/iterations:1\n"
+ "BM_string_memset/48/8/iterations:1\n"
+ "BM_string_memset/48/16/iterations:1\n"
+ "BM_string_memset/48/32/iterations:1\n"
+ "BM_string_memset/56/0/iterations:1\n"
+ "BM_string_memset/56/1/iterations:1\n"
+ "BM_string_memset/56/2/iterations:1\n"
+ "BM_string_memset/56/4/iterations:1\n"
+ "BM_string_memset/56/8/iterations:1\n"
+ "BM_string_memset/56/16/iterations:1\n"
+ "BM_string_memset/56/32/iterations:1\n"
+ "BM_string_memset/64/0/iterations:1\n"
+ "BM_string_memset/64/1/iterations:1\n"
+ "BM_string_memset/64/2/iterations:1\n"
+ "BM_string_memset/64/4/iterations:1\n"
+ "BM_string_memset/64/8/iterations:1\n"
+ "BM_string_memset/64/16/iterations:1\n"
+ "BM_string_memset/64/32/iterations:1\n"
+ "BM_string_memset/72/0/iterations:1\n"
+ "BM_string_memset/72/1/iterations:1\n"
+ "BM_string_memset/72/2/iterations:1\n"
+ "BM_string_memset/72/4/iterations:1\n"
+ "BM_string_memset/72/8/iterations:1\n"
+ "BM_string_memset/72/16/iterations:1\n"
+ "BM_string_memset/72/32/iterations:1\n"
+ "BM_string_memset/80/0/iterations:1\n"
+ "BM_string_memset/80/1/iterations:1\n"
+ "BM_string_memset/80/2/iterations:1\n"
+ "BM_string_memset/80/4/iterations:1\n"
+ "BM_string_memset/80/8/iterations:1\n"
+ "BM_string_memset/80/16/iterations:1\n"
+ "BM_string_memset/80/32/iterations:1\n"
+ "BM_string_memset/88/0/iterations:1\n"
+ "BM_string_memset/88/1/iterations:1\n"
+ "BM_string_memset/88/2/iterations:1\n"
+ "BM_string_memset/88/4/iterations:1\n"
+ "BM_string_memset/88/8/iterations:1\n"
+ "BM_string_memset/88/16/iterations:1\n"
+ "BM_string_memset/88/32/iterations:1\n"
+ "BM_string_memset/96/0/iterations:1\n"
+ "BM_string_memset/96/1/iterations:1\n"
+ "BM_string_memset/96/2/iterations:1\n"
+ "BM_string_memset/96/4/iterations:1\n"
+ "BM_string_memset/96/8/iterations:1\n"
+ "BM_string_memset/96/16/iterations:1\n"
+ "BM_string_memset/96/32/iterations:1\n"
+ "BM_string_memset/104/0/iterations:1\n"
+ "BM_string_memset/104/1/iterations:1\n"
+ "BM_string_memset/104/2/iterations:1\n"
+ "BM_string_memset/104/4/iterations:1\n"
+ "BM_string_memset/104/8/iterations:1\n"
+ "BM_string_memset/104/16/iterations:1\n"
+ "BM_string_memset/104/32/iterations:1\n"
+ "BM_string_memset/112/0/iterations:1\n"
+ "BM_string_memset/112/1/iterations:1\n"
+ "BM_string_memset/112/2/iterations:1\n"
+ "BM_string_memset/112/4/iterations:1\n"
+ "BM_string_memset/112/8/iterations:1\n"
+ "BM_string_memset/112/16/iterations:1\n"
+ "BM_string_memset/112/32/iterations:1\n"
+ "BM_string_memset/120/0/iterations:1\n"
+ "BM_string_memset/120/1/iterations:1\n"
+ "BM_string_memset/120/2/iterations:1\n"
+ "BM_string_memset/120/4/iterations:1\n"
+ "BM_string_memset/120/8/iterations:1\n"
+ "BM_string_memset/120/16/iterations:1\n"
+ "BM_string_memset/120/32/iterations:1\n"
+ "BM_string_memset/128/0/iterations:1\n"
+ "BM_string_memset/128/1/iterations:1\n"
+ "BM_string_memset/128/2/iterations:1\n"
+ "BM_string_memset/128/4/iterations:1\n"
+ "BM_string_memset/128/8/iterations:1\n"
+ "BM_string_memset/128/16/iterations:1\n"
+ "BM_string_memset/128/32/iterations:1\n"
+ "BM_string_memset/136/0/iterations:1\n"
+ "BM_string_memset/136/1/iterations:1\n"
+ "BM_string_memset/136/2/iterations:1\n"
+ "BM_string_memset/136/4/iterations:1\n"
+ "BM_string_memset/136/8/iterations:1\n"
+ "BM_string_memset/136/16/iterations:1\n"
+ "BM_string_memset/136/32/iterations:1\n"
+ "BM_string_memset/144/0/iterations:1\n"
+ "BM_string_memset/144/1/iterations:1\n"
+ "BM_string_memset/144/2/iterations:1\n"
+ "BM_string_memset/144/4/iterations:1\n"
+ "BM_string_memset/144/8/iterations:1\n"
+ "BM_string_memset/144/16/iterations:1\n"
+ "BM_string_memset/144/32/iterations:1\n"
+ "BM_string_memset/160/0/iterations:1\n"
+ "BM_string_memset/160/1/iterations:1\n"
+ "BM_string_memset/160/2/iterations:1\n"
+ "BM_string_memset/160/4/iterations:1\n"
+ "BM_string_memset/160/8/iterations:1\n"
+ "BM_string_memset/160/16/iterations:1\n"
+ "BM_string_memset/160/32/iterations:1\n"
+ "BM_string_memset/176/0/iterations:1\n"
+ "BM_string_memset/176/1/iterations:1\n"
+ "BM_string_memset/176/2/iterations:1\n"
+ "BM_string_memset/176/4/iterations:1\n"
+ "BM_string_memset/176/8/iterations:1\n"
+ "BM_string_memset/176/16/iterations:1\n"
+ "BM_string_memset/176/32/iterations:1\n"
+ "BM_string_memset/192/0/iterations:1\n"
+ "BM_string_memset/192/1/iterations:1\n"
+ "BM_string_memset/192/2/iterations:1\n"
+ "BM_string_memset/192/4/iterations:1\n"
+ "BM_string_memset/192/8/iterations:1\n"
+ "BM_string_memset/192/16/iterations:1\n"
+ "BM_string_memset/192/32/iterations:1\n"
+ "BM_string_memset/208/0/iterations:1\n"
+ "BM_string_memset/208/1/iterations:1\n"
+ "BM_string_memset/208/2/iterations:1\n"
+ "BM_string_memset/208/4/iterations:1\n"
+ "BM_string_memset/208/8/iterations:1\n"
+ "BM_string_memset/208/16/iterations:1\n"
+ "BM_string_memset/208/32/iterations:1\n"
+ "BM_string_memset/224/0/iterations:1\n"
+ "BM_string_memset/224/1/iterations:1\n"
+ "BM_string_memset/224/2/iterations:1\n"
+ "BM_string_memset/224/4/iterations:1\n"
+ "BM_string_memset/224/8/iterations:1\n"
+ "BM_string_memset/224/16/iterations:1\n"
+ "BM_string_memset/224/32/iterations:1\n"
+ "BM_string_memset/240/0/iterations:1\n"
+ "BM_string_memset/240/1/iterations:1\n"
+ "BM_string_memset/240/2/iterations:1\n"
+ "BM_string_memset/240/4/iterations:1\n"
+ "BM_string_memset/240/8/iterations:1\n"
+ "BM_string_memset/240/16/iterations:1\n"
+ "BM_string_memset/240/32/iterations:1\n"
+ "BM_string_memset/256/0/iterations:1\n"
+ "BM_string_memset/256/1/iterations:1\n"
+ "BM_string_memset/256/2/iterations:1\n"
+ "BM_string_memset/256/4/iterations:1\n"
+ "BM_string_memset/256/8/iterations:1\n"
+ "BM_string_memset/256/16/iterations:1\n"
+ "BM_string_memset/256/32/iterations:1\n"
+ "BM_string_memset/512/0/iterations:1\n"
+ "BM_string_memset/512/1/iterations:1\n"
+ "BM_string_memset/512/2/iterations:1\n"
+ "BM_string_memset/512/4/iterations:1\n"
+ "BM_string_memset/512/8/iterations:1\n"
+ "BM_string_memset/512/16/iterations:1\n"
+ "BM_string_memset/512/32/iterations:1\n"
+ "BM_string_memset/1024/0/iterations:1\n"
+ "BM_string_memset/1024/1/iterations:1\n"
+ "BM_string_memset/1024/2/iterations:1\n"
+ "BM_string_memset/1024/4/iterations:1\n"
+ "BM_string_memset/1024/8/iterations:1\n"
+ "BM_string_memset/1024/16/iterations:1\n"
+ "BM_string_memset/1024/32/iterations:1\n"
+ "BM_string_memset/8192/0/iterations:1\n"
+ "BM_string_memset/8192/1/iterations:1\n"
+ "BM_string_memset/8192/2/iterations:1\n"
+ "BM_string_memset/8192/4/iterations:1\n"
+ "BM_string_memset/8192/8/iterations:1\n"
+ "BM_string_memset/8192/16/iterations:1\n"
+ "BM_string_memset/8192/32/iterations:1\n"
+ "BM_string_memset/16384/0/iterations:1\n"
+ "BM_string_memset/16384/1/iterations:1\n"
+ "BM_string_memset/16384/2/iterations:1\n"
+ "BM_string_memset/16384/4/iterations:1\n"
+ "BM_string_memset/16384/8/iterations:1\n"
+ "BM_string_memset/16384/16/iterations:1\n"
+ "BM_string_memset/16384/32/iterations:1\n"
+ "BM_string_memset/32768/0/iterations:1\n"
+ "BM_string_memset/32768/1/iterations:1\n"
+ "BM_string_memset/32768/2/iterations:1\n"
+ "BM_string_memset/32768/4/iterations:1\n"
+ "BM_string_memset/32768/8/iterations:1\n"
+ "BM_string_memset/32768/16/iterations:1\n"
+ "BM_string_memset/32768/32/iterations:1\n"
+ "BM_string_memset/65536/0/iterations:1\n"
+ "BM_string_memset/65536/1/iterations:1\n"
+ "BM_string_memset/65536/2/iterations:1\n"
+ "BM_string_memset/65536/4/iterations:1\n"
+ "BM_string_memset/65536/8/iterations:1\n"
+ "BM_string_memset/65536/16/iterations:1\n"
+ "BM_string_memset/65536/32/iterations:1\n"
+ "BM_string_memset/131072/0/iterations:1\n"
+ "BM_string_memset/131072/1/iterations:1\n"
+ "BM_string_memset/131072/2/iterations:1\n"
+ "BM_string_memset/131072/4/iterations:1\n"
+ "BM_string_memset/131072/8/iterations:1\n"
+ "BM_string_memset/131072/16/iterations:1\n"
+ "BM_string_memset/131072/32/iterations:1\n"
+ "BM_string_memset/262144/0/iterations:1\n"
+ "BM_string_memset/262144/1/iterations:1\n"
+ "BM_string_memset/262144/2/iterations:1\n"
+ "BM_string_memset/262144/4/iterations:1\n"
+ "BM_string_memset/262144/8/iterations:1\n"
+ "BM_string_memset/262144/16/iterations:1\n"
+ "BM_string_memset/262144/32/iterations:1\n"
+ "BM_string_memset/524288/0/iterations:1\n"
+ "BM_string_memset/524288/1/iterations:1\n"
+ "BM_string_memset/524288/2/iterations:1\n"
+ "BM_string_memset/524288/4/iterations:1\n"
+ "BM_string_memset/524288/8/iterations:1\n"
+ "BM_string_memset/524288/16/iterations:1\n"
+ "BM_string_memset/524288/32/iterations:1\n"
+ "BM_string_memset/1048576/0/iterations:1\n"
+ "BM_string_memset/1048576/1/iterations:1\n"
+ "BM_string_memset/1048576/2/iterations:1\n"
+ "BM_string_memset/1048576/4/iterations:1\n"
+ "BM_string_memset/1048576/8/iterations:1\n"
+ "BM_string_memset/1048576/16/iterations:1\n"
+ "BM_string_memset/1048576/32/iterations:1\n"
+ "BM_string_memset/2097152/0/iterations:1\n"
+ "BM_string_memset/2097152/1/iterations:1\n"
+ "BM_string_memset/2097152/2/iterations:1\n"
+ "BM_string_memset/2097152/4/iterations:1\n"
+ "BM_string_memset/2097152/8/iterations:1\n"
+ "BM_string_memset/2097152/16/iterations:1\n"
+ "BM_string_memset/2097152/32/iterations:1\n";
Verify(expected, 0,
std::vector<const char*>{GetBionicXmlArg("test_alignment_onebuf.xml").c_str()});
@@ -888,1965 +898,1967 @@
TEST_F(SystemTests, alignment_twobuf) {
std::string expected =
- "BM_string_strcpy/8/0/0/iterations:1\n"
- "BM_string_strcpy/64/0/0/iterations:1\n"
- "BM_string_strcpy/512/0/0/iterations:1\n"
- "BM_string_strcpy/1024/0/0/iterations:1\n"
- "BM_string_strcpy/8192/0/0/iterations:1\n"
- "BM_string_strcpy/16384/0/0/iterations:1\n"
- "BM_string_strcpy/32768/0/0/iterations:1\n"
- "BM_string_strcpy/65536/0/0/iterations:1\n"
- "BM_string_strcpy/131072/0/0/iterations:1\n"
- "BM_string_memcpy/1/0/0/iterations:1\n"
- "BM_string_memcpy/2/0/0/iterations:1\n"
- "BM_string_memcpy/3/0/0/iterations:1\n"
- "BM_string_memcpy/4/0/0/iterations:1\n"
- "BM_string_memcpy/5/0/0/iterations:1\n"
- "BM_string_memcpy/6/0/0/iterations:1\n"
- "BM_string_memcpy/7/0/0/iterations:1\n"
- "BM_string_memcpy/8/0/0/iterations:1\n"
- "BM_string_memcpy/9/0/0/iterations:1\n"
- "BM_string_memcpy/10/0/0/iterations:1\n"
- "BM_string_memcpy/11/0/0/iterations:1\n"
- "BM_string_memcpy/12/0/0/iterations:1\n"
- "BM_string_memcpy/13/0/0/iterations:1\n"
- "BM_string_memcpy/14/0/0/iterations:1\n"
- "BM_string_memcpy/15/0/0/iterations:1\n"
- "BM_string_memcpy/16/0/0/iterations:1\n"
- "BM_string_memcpy/24/0/0/iterations:1\n"
- "BM_string_memcpy/32/0/0/iterations:1\n"
- "BM_string_memcpy/40/0/0/iterations:1\n"
- "BM_string_memcpy/48/0/0/iterations:1\n"
- "BM_string_memcpy/56/0/0/iterations:1\n"
- "BM_string_memcpy/64/0/0/iterations:1\n"
- "BM_string_memcpy/72/0/0/iterations:1\n"
- "BM_string_memcpy/80/0/0/iterations:1\n"
- "BM_string_memcpy/88/0/0/iterations:1\n"
- "BM_string_memcpy/96/0/0/iterations:1\n"
- "BM_string_memcpy/104/0/0/iterations:1\n"
- "BM_string_memcpy/112/0/0/iterations:1\n"
- "BM_string_memcpy/120/0/0/iterations:1\n"
- "BM_string_memcpy/128/0/0/iterations:1\n"
- "BM_string_memcpy/136/0/0/iterations:1\n"
- "BM_string_memcpy/144/0/0/iterations:1\n"
- "BM_string_memcpy/160/0/0/iterations:1\n"
- "BM_string_memcpy/176/0/0/iterations:1\n"
- "BM_string_memcpy/192/0/0/iterations:1\n"
- "BM_string_memcpy/208/0/0/iterations:1\n"
- "BM_string_memcpy/224/0/0/iterations:1\n"
- "BM_string_memcpy/240/0/0/iterations:1\n"
- "BM_string_memcpy/256/0/0/iterations:1\n"
- "BM_string_strcpy/512/0/0/iterations:1\n"
- "BM_string_strcpy/1024/0/0/iterations:1\n"
- "BM_string_strcpy/8192/0/0/iterations:1\n"
- "BM_string_strcpy/16384/0/0/iterations:1\n"
- "BM_string_strcpy/32768/0/0/iterations:1\n"
- "BM_string_strcpy/65536/0/0/iterations:1\n"
- "BM_string_strcpy/131072/0/0/iterations:1\n"
- "BM_string_memcpy/262144/0/0/iterations:1\n"
- "BM_string_memcpy/524288/0/0/iterations:1\n"
- "BM_string_memcpy/1048576/0/0/iterations:1\n"
- "BM_string_memcpy/2097152/0/0/iterations:1\n"
- "BM_string_strcpy/1/0/0/iterations:1\n"
- "BM_string_strcpy/2/0/0/iterations:1\n"
- "BM_string_strcpy/3/0/0/iterations:1\n"
- "BM_string_strcpy/4/0/0/iterations:1\n"
- "BM_string_strcpy/5/0/0/iterations:1\n"
- "BM_string_strcpy/6/0/0/iterations:1\n"
- "BM_string_strcpy/7/0/0/iterations:1\n"
- "BM_string_strcpy/8/0/0/iterations:1\n"
- "BM_string_strcpy/9/0/0/iterations:1\n"
- "BM_string_strcpy/10/0/0/iterations:1\n"
- "BM_string_strcpy/11/0/0/iterations:1\n"
- "BM_string_strcpy/12/0/0/iterations:1\n"
- "BM_string_strcpy/13/0/0/iterations:1\n"
- "BM_string_strcpy/14/0/0/iterations:1\n"
- "BM_string_strcpy/15/0/0/iterations:1\n"
- "BM_string_strcpy/16/0/0/iterations:1\n"
- "BM_string_strcpy/24/0/0/iterations:1\n"
- "BM_string_strcpy/32/0/0/iterations:1\n"
- "BM_string_strcpy/40/0/0/iterations:1\n"
- "BM_string_strcpy/48/0/0/iterations:1\n"
- "BM_string_strcpy/56/0/0/iterations:1\n"
- "BM_string_strcpy/64/0/0/iterations:1\n"
- "BM_string_strcpy/72/0/0/iterations:1\n"
- "BM_string_strcpy/80/0/0/iterations:1\n"
- "BM_string_strcpy/88/0/0/iterations:1\n"
- "BM_string_strcpy/96/0/0/iterations:1\n"
- "BM_string_strcpy/104/0/0/iterations:1\n"
- "BM_string_strcpy/112/0/0/iterations:1\n"
- "BM_string_strcpy/120/0/0/iterations:1\n"
- "BM_string_strcpy/128/0/0/iterations:1\n"
- "BM_string_strcpy/136/0/0/iterations:1\n"
- "BM_string_strcpy/144/0/0/iterations:1\n"
- "BM_string_strcpy/160/0/0/iterations:1\n"
- "BM_string_strcpy/176/0/0/iterations:1\n"
- "BM_string_strcpy/192/0/0/iterations:1\n"
- "BM_string_strcpy/208/0/0/iterations:1\n"
- "BM_string_strcpy/224/0/0/iterations:1\n"
- "BM_string_strcpy/240/0/0/iterations:1\n"
- "BM_string_strcpy/256/0/0/iterations:1\n"
- "BM_string_strcpy/512/0/0/iterations:1\n"
- "BM_string_strcpy/1024/0/0/iterations:1\n"
- "BM_string_strcpy/8192/0/0/iterations:1\n"
- "BM_string_strcpy/16384/0/0/iterations:1\n"
- "BM_string_strcpy/32768/0/0/iterations:1\n"
- "BM_string_strcpy/65536/0/0/iterations:1\n"
- "BM_string_strcpy/131072/0/0/iterations:1\n"
- "BM_string_strcpy/262144/0/0/iterations:1\n"
- "BM_string_strcpy/524288/0/0/iterations:1\n"
- "BM_string_strcpy/1048576/0/0/iterations:1\n"
- "BM_string_strcpy/2097152/0/0/iterations:1\n"
- "BM_string_memcpy/1/0/0/iterations:1\n"
- "BM_string_memcpy/1/1/1/iterations:1\n"
- "BM_string_memcpy/1/1/2/iterations:1\n"
- "BM_string_memcpy/1/1/4/iterations:1\n"
- "BM_string_memcpy/1/1/8/iterations:1\n"
- "BM_string_memcpy/1/1/16/iterations:1\n"
- "BM_string_memcpy/1/1/32/iterations:1\n"
- "BM_string_memcpy/1/2/1/iterations:1\n"
- "BM_string_memcpy/1/2/2/iterations:1\n"
- "BM_string_memcpy/1/2/4/iterations:1\n"
- "BM_string_memcpy/1/2/8/iterations:1\n"
- "BM_string_memcpy/1/2/16/iterations:1\n"
- "BM_string_memcpy/1/2/32/iterations:1\n"
- "BM_string_memcpy/1/4/1/iterations:1\n"
- "BM_string_memcpy/1/4/2/iterations:1\n"
- "BM_string_memcpy/1/4/4/iterations:1\n"
- "BM_string_memcpy/1/4/8/iterations:1\n"
- "BM_string_memcpy/1/4/16/iterations:1\n"
- "BM_string_memcpy/1/4/32/iterations:1\n"
- "BM_string_memcpy/1/8/1/iterations:1\n"
- "BM_string_memcpy/1/8/2/iterations:1\n"
- "BM_string_memcpy/1/8/4/iterations:1\n"
- "BM_string_memcpy/1/8/8/iterations:1\n"
- "BM_string_memcpy/1/8/16/iterations:1\n"
- "BM_string_memcpy/1/8/32/iterations:1\n"
- "BM_string_memcpy/1/16/1/iterations:1\n"
- "BM_string_memcpy/1/16/2/iterations:1\n"
- "BM_string_memcpy/1/16/4/iterations:1\n"
- "BM_string_memcpy/1/16/8/iterations:1\n"
- "BM_string_memcpy/1/16/16/iterations:1\n"
- "BM_string_memcpy/1/16/32/iterations:1\n"
- "BM_string_memcpy/1/32/1/iterations:1\n"
- "BM_string_memcpy/1/32/2/iterations:1\n"
- "BM_string_memcpy/1/32/4/iterations:1\n"
- "BM_string_memcpy/1/32/8/iterations:1\n"
- "BM_string_memcpy/1/32/16/iterations:1\n"
- "BM_string_memcpy/1/32/32/iterations:1\n"
- "BM_string_memcpy/2/0/0/iterations:1\n"
- "BM_string_memcpy/2/1/1/iterations:1\n"
- "BM_string_memcpy/2/1/2/iterations:1\n"
- "BM_string_memcpy/2/1/4/iterations:1\n"
- "BM_string_memcpy/2/1/8/iterations:1\n"
- "BM_string_memcpy/2/1/16/iterations:1\n"
- "BM_string_memcpy/2/1/32/iterations:1\n"
- "BM_string_memcpy/2/2/1/iterations:1\n"
- "BM_string_memcpy/2/2/2/iterations:1\n"
- "BM_string_memcpy/2/2/4/iterations:1\n"
- "BM_string_memcpy/2/2/8/iterations:1\n"
- "BM_string_memcpy/2/2/16/iterations:1\n"
- "BM_string_memcpy/2/2/32/iterations:1\n"
- "BM_string_memcpy/2/4/1/iterations:1\n"
- "BM_string_memcpy/2/4/2/iterations:1\n"
- "BM_string_memcpy/2/4/4/iterations:1\n"
- "BM_string_memcpy/2/4/8/iterations:1\n"
- "BM_string_memcpy/2/4/16/iterations:1\n"
- "BM_string_memcpy/2/4/32/iterations:1\n"
- "BM_string_memcpy/2/8/1/iterations:1\n"
- "BM_string_memcpy/2/8/2/iterations:1\n"
- "BM_string_memcpy/2/8/4/iterations:1\n"
- "BM_string_memcpy/2/8/8/iterations:1\n"
- "BM_string_memcpy/2/8/16/iterations:1\n"
- "BM_string_memcpy/2/8/32/iterations:1\n"
- "BM_string_memcpy/2/16/1/iterations:1\n"
- "BM_string_memcpy/2/16/2/iterations:1\n"
- "BM_string_memcpy/2/16/4/iterations:1\n"
- "BM_string_memcpy/2/16/8/iterations:1\n"
- "BM_string_memcpy/2/16/16/iterations:1\n"
- "BM_string_memcpy/2/16/32/iterations:1\n"
- "BM_string_memcpy/2/32/1/iterations:1\n"
- "BM_string_memcpy/2/32/2/iterations:1\n"
- "BM_string_memcpy/2/32/4/iterations:1\n"
- "BM_string_memcpy/2/32/8/iterations:1\n"
- "BM_string_memcpy/2/32/16/iterations:1\n"
- "BM_string_memcpy/2/32/32/iterations:1\n"
- "BM_string_memcpy/3/0/0/iterations:1\n"
- "BM_string_memcpy/3/1/1/iterations:1\n"
- "BM_string_memcpy/3/1/2/iterations:1\n"
- "BM_string_memcpy/3/1/4/iterations:1\n"
- "BM_string_memcpy/3/1/8/iterations:1\n"
- "BM_string_memcpy/3/1/16/iterations:1\n"
- "BM_string_memcpy/3/1/32/iterations:1\n"
- "BM_string_memcpy/3/2/1/iterations:1\n"
- "BM_string_memcpy/3/2/2/iterations:1\n"
- "BM_string_memcpy/3/2/4/iterations:1\n"
- "BM_string_memcpy/3/2/8/iterations:1\n"
- "BM_string_memcpy/3/2/16/iterations:1\n"
- "BM_string_memcpy/3/2/32/iterations:1\n"
- "BM_string_memcpy/3/4/1/iterations:1\n"
- "BM_string_memcpy/3/4/2/iterations:1\n"
- "BM_string_memcpy/3/4/4/iterations:1\n"
- "BM_string_memcpy/3/4/8/iterations:1\n"
- "BM_string_memcpy/3/4/16/iterations:1\n"
- "BM_string_memcpy/3/4/32/iterations:1\n"
- "BM_string_memcpy/3/8/1/iterations:1\n"
- "BM_string_memcpy/3/8/2/iterations:1\n"
- "BM_string_memcpy/3/8/4/iterations:1\n"
- "BM_string_memcpy/3/8/8/iterations:1\n"
- "BM_string_memcpy/3/8/16/iterations:1\n"
- "BM_string_memcpy/3/8/32/iterations:1\n"
- "BM_string_memcpy/3/16/1/iterations:1\n"
- "BM_string_memcpy/3/16/2/iterations:1\n"
- "BM_string_memcpy/3/16/4/iterations:1\n"
- "BM_string_memcpy/3/16/8/iterations:1\n"
- "BM_string_memcpy/3/16/16/iterations:1\n"
- "BM_string_memcpy/3/16/32/iterations:1\n"
- "BM_string_memcpy/3/32/1/iterations:1\n"
- "BM_string_memcpy/3/32/2/iterations:1\n"
- "BM_string_memcpy/3/32/4/iterations:1\n"
- "BM_string_memcpy/3/32/8/iterations:1\n"
- "BM_string_memcpy/3/32/16/iterations:1\n"
- "BM_string_memcpy/3/32/32/iterations:1\n"
- "BM_string_memcpy/4/0/0/iterations:1\n"
- "BM_string_memcpy/4/1/1/iterations:1\n"
- "BM_string_memcpy/4/1/2/iterations:1\n"
- "BM_string_memcpy/4/1/4/iterations:1\n"
- "BM_string_memcpy/4/1/8/iterations:1\n"
- "BM_string_memcpy/4/1/16/iterations:1\n"
- "BM_string_memcpy/4/1/32/iterations:1\n"
- "BM_string_memcpy/4/2/1/iterations:1\n"
- "BM_string_memcpy/4/2/2/iterations:1\n"
- "BM_string_memcpy/4/2/4/iterations:1\n"
- "BM_string_memcpy/4/2/8/iterations:1\n"
- "BM_string_memcpy/4/2/16/iterations:1\n"
- "BM_string_memcpy/4/2/32/iterations:1\n"
- "BM_string_memcpy/4/4/1/iterations:1\n"
- "BM_string_memcpy/4/4/2/iterations:1\n"
- "BM_string_memcpy/4/4/4/iterations:1\n"
- "BM_string_memcpy/4/4/8/iterations:1\n"
- "BM_string_memcpy/4/4/16/iterations:1\n"
- "BM_string_memcpy/4/4/32/iterations:1\n"
- "BM_string_memcpy/4/8/1/iterations:1\n"
- "BM_string_memcpy/4/8/2/iterations:1\n"
- "BM_string_memcpy/4/8/4/iterations:1\n"
- "BM_string_memcpy/4/8/8/iterations:1\n"
- "BM_string_memcpy/4/8/16/iterations:1\n"
- "BM_string_memcpy/4/8/32/iterations:1\n"
- "BM_string_memcpy/4/16/1/iterations:1\n"
- "BM_string_memcpy/4/16/2/iterations:1\n"
- "BM_string_memcpy/4/16/4/iterations:1\n"
- "BM_string_memcpy/4/16/8/iterations:1\n"
- "BM_string_memcpy/4/16/16/iterations:1\n"
- "BM_string_memcpy/4/16/32/iterations:1\n"
- "BM_string_memcpy/4/32/1/iterations:1\n"
- "BM_string_memcpy/4/32/2/iterations:1\n"
- "BM_string_memcpy/4/32/4/iterations:1\n"
- "BM_string_memcpy/4/32/8/iterations:1\n"
- "BM_string_memcpy/4/32/16/iterations:1\n"
- "BM_string_memcpy/4/32/32/iterations:1\n"
- "BM_string_memcpy/5/0/0/iterations:1\n"
- "BM_string_memcpy/5/1/1/iterations:1\n"
- "BM_string_memcpy/5/1/2/iterations:1\n"
- "BM_string_memcpy/5/1/4/iterations:1\n"
- "BM_string_memcpy/5/1/8/iterations:1\n"
- "BM_string_memcpy/5/1/16/iterations:1\n"
- "BM_string_memcpy/5/1/32/iterations:1\n"
- "BM_string_memcpy/5/2/1/iterations:1\n"
- "BM_string_memcpy/5/2/2/iterations:1\n"
- "BM_string_memcpy/5/2/4/iterations:1\n"
- "BM_string_memcpy/5/2/8/iterations:1\n"
- "BM_string_memcpy/5/2/16/iterations:1\n"
- "BM_string_memcpy/5/2/32/iterations:1\n"
- "BM_string_memcpy/5/4/1/iterations:1\n"
- "BM_string_memcpy/5/4/2/iterations:1\n"
- "BM_string_memcpy/5/4/4/iterations:1\n"
- "BM_string_memcpy/5/4/8/iterations:1\n"
- "BM_string_memcpy/5/4/16/iterations:1\n"
- "BM_string_memcpy/5/4/32/iterations:1\n"
- "BM_string_memcpy/5/8/1/iterations:1\n"
- "BM_string_memcpy/5/8/2/iterations:1\n"
- "BM_string_memcpy/5/8/4/iterations:1\n"
- "BM_string_memcpy/5/8/8/iterations:1\n"
- "BM_string_memcpy/5/8/16/iterations:1\n"
- "BM_string_memcpy/5/8/32/iterations:1\n"
- "BM_string_memcpy/5/16/1/iterations:1\n"
- "BM_string_memcpy/5/16/2/iterations:1\n"
- "BM_string_memcpy/5/16/4/iterations:1\n"
- "BM_string_memcpy/5/16/8/iterations:1\n"
- "BM_string_memcpy/5/16/16/iterations:1\n"
- "BM_string_memcpy/5/16/32/iterations:1\n"
- "BM_string_memcpy/5/32/1/iterations:1\n"
- "BM_string_memcpy/5/32/2/iterations:1\n"
- "BM_string_memcpy/5/32/4/iterations:1\n"
- "BM_string_memcpy/5/32/8/iterations:1\n"
- "BM_string_memcpy/5/32/16/iterations:1\n"
- "BM_string_memcpy/5/32/32/iterations:1\n"
- "BM_string_memcpy/6/0/0/iterations:1\n"
- "BM_string_memcpy/6/1/1/iterations:1\n"
- "BM_string_memcpy/6/1/2/iterations:1\n"
- "BM_string_memcpy/6/1/4/iterations:1\n"
- "BM_string_memcpy/6/1/8/iterations:1\n"
- "BM_string_memcpy/6/1/16/iterations:1\n"
- "BM_string_memcpy/6/1/32/iterations:1\n"
- "BM_string_memcpy/6/2/1/iterations:1\n"
- "BM_string_memcpy/6/2/2/iterations:1\n"
- "BM_string_memcpy/6/2/4/iterations:1\n"
- "BM_string_memcpy/6/2/8/iterations:1\n"
- "BM_string_memcpy/6/2/16/iterations:1\n"
- "BM_string_memcpy/6/2/32/iterations:1\n"
- "BM_string_memcpy/6/4/1/iterations:1\n"
- "BM_string_memcpy/6/4/2/iterations:1\n"
- "BM_string_memcpy/6/4/4/iterations:1\n"
- "BM_string_memcpy/6/4/8/iterations:1\n"
- "BM_string_memcpy/6/4/16/iterations:1\n"
- "BM_string_memcpy/6/4/32/iterations:1\n"
- "BM_string_memcpy/6/8/1/iterations:1\n"
- "BM_string_memcpy/6/8/2/iterations:1\n"
- "BM_string_memcpy/6/8/4/iterations:1\n"
- "BM_string_memcpy/6/8/8/iterations:1\n"
- "BM_string_memcpy/6/8/16/iterations:1\n"
- "BM_string_memcpy/6/8/32/iterations:1\n"
- "BM_string_memcpy/6/16/1/iterations:1\n"
- "BM_string_memcpy/6/16/2/iterations:1\n"
- "BM_string_memcpy/6/16/4/iterations:1\n"
- "BM_string_memcpy/6/16/8/iterations:1\n"
- "BM_string_memcpy/6/16/16/iterations:1\n"
- "BM_string_memcpy/6/16/32/iterations:1\n"
- "BM_string_memcpy/6/32/1/iterations:1\n"
- "BM_string_memcpy/6/32/2/iterations:1\n"
- "BM_string_memcpy/6/32/4/iterations:1\n"
- "BM_string_memcpy/6/32/8/iterations:1\n"
- "BM_string_memcpy/6/32/16/iterations:1\n"
- "BM_string_memcpy/6/32/32/iterations:1\n"
- "BM_string_memcpy/7/0/0/iterations:1\n"
- "BM_string_memcpy/7/1/1/iterations:1\n"
- "BM_string_memcpy/7/1/2/iterations:1\n"
- "BM_string_memcpy/7/1/4/iterations:1\n"
- "BM_string_memcpy/7/1/8/iterations:1\n"
- "BM_string_memcpy/7/1/16/iterations:1\n"
- "BM_string_memcpy/7/1/32/iterations:1\n"
- "BM_string_memcpy/7/2/1/iterations:1\n"
- "BM_string_memcpy/7/2/2/iterations:1\n"
- "BM_string_memcpy/7/2/4/iterations:1\n"
- "BM_string_memcpy/7/2/8/iterations:1\n"
- "BM_string_memcpy/7/2/16/iterations:1\n"
- "BM_string_memcpy/7/2/32/iterations:1\n"
- "BM_string_memcpy/7/4/1/iterations:1\n"
- "BM_string_memcpy/7/4/2/iterations:1\n"
- "BM_string_memcpy/7/4/4/iterations:1\n"
- "BM_string_memcpy/7/4/8/iterations:1\n"
- "BM_string_memcpy/7/4/16/iterations:1\n"
- "BM_string_memcpy/7/4/32/iterations:1\n"
- "BM_string_memcpy/7/8/1/iterations:1\n"
- "BM_string_memcpy/7/8/2/iterations:1\n"
- "BM_string_memcpy/7/8/4/iterations:1\n"
- "BM_string_memcpy/7/8/8/iterations:1\n"
- "BM_string_memcpy/7/8/16/iterations:1\n"
- "BM_string_memcpy/7/8/32/iterations:1\n"
- "BM_string_memcpy/7/16/1/iterations:1\n"
- "BM_string_memcpy/7/16/2/iterations:1\n"
- "BM_string_memcpy/7/16/4/iterations:1\n"
- "BM_string_memcpy/7/16/8/iterations:1\n"
- "BM_string_memcpy/7/16/16/iterations:1\n"
- "BM_string_memcpy/7/16/32/iterations:1\n"
- "BM_string_memcpy/7/32/1/iterations:1\n"
- "BM_string_memcpy/7/32/2/iterations:1\n"
- "BM_string_memcpy/7/32/4/iterations:1\n"
- "BM_string_memcpy/7/32/8/iterations:1\n"
- "BM_string_memcpy/7/32/16/iterations:1\n"
- "BM_string_memcpy/7/32/32/iterations:1\n"
- "BM_string_memcpy/8/0/0/iterations:1\n"
- "BM_string_memcpy/8/1/1/iterations:1\n"
- "BM_string_memcpy/8/1/2/iterations:1\n"
- "BM_string_memcpy/8/1/4/iterations:1\n"
- "BM_string_memcpy/8/1/8/iterations:1\n"
- "BM_string_memcpy/8/1/16/iterations:1\n"
- "BM_string_memcpy/8/1/32/iterations:1\n"
- "BM_string_memcpy/8/2/1/iterations:1\n"
- "BM_string_memcpy/8/2/2/iterations:1\n"
- "BM_string_memcpy/8/2/4/iterations:1\n"
- "BM_string_memcpy/8/2/8/iterations:1\n"
- "BM_string_memcpy/8/2/16/iterations:1\n"
- "BM_string_memcpy/8/2/32/iterations:1\n"
- "BM_string_memcpy/8/4/1/iterations:1\n"
- "BM_string_memcpy/8/4/2/iterations:1\n"
- "BM_string_memcpy/8/4/4/iterations:1\n"
- "BM_string_memcpy/8/4/8/iterations:1\n"
- "BM_string_memcpy/8/4/16/iterations:1\n"
- "BM_string_memcpy/8/4/32/iterations:1\n"
- "BM_string_memcpy/8/8/1/iterations:1\n"
- "BM_string_memcpy/8/8/2/iterations:1\n"
- "BM_string_memcpy/8/8/4/iterations:1\n"
- "BM_string_memcpy/8/8/8/iterations:1\n"
- "BM_string_memcpy/8/8/16/iterations:1\n"
- "BM_string_memcpy/8/8/32/iterations:1\n"
- "BM_string_memcpy/8/16/1/iterations:1\n"
- "BM_string_memcpy/8/16/2/iterations:1\n"
- "BM_string_memcpy/8/16/4/iterations:1\n"
- "BM_string_memcpy/8/16/8/iterations:1\n"
- "BM_string_memcpy/8/16/16/iterations:1\n"
- "BM_string_memcpy/8/16/32/iterations:1\n"
- "BM_string_memcpy/8/32/1/iterations:1\n"
- "BM_string_memcpy/8/32/2/iterations:1\n"
- "BM_string_memcpy/8/32/4/iterations:1\n"
- "BM_string_memcpy/8/32/8/iterations:1\n"
- "BM_string_memcpy/8/32/16/iterations:1\n"
- "BM_string_memcpy/8/32/32/iterations:1\n"
- "BM_string_memcpy/9/0/0/iterations:1\n"
- "BM_string_memcpy/9/1/1/iterations:1\n"
- "BM_string_memcpy/9/1/2/iterations:1\n"
- "BM_string_memcpy/9/1/4/iterations:1\n"
- "BM_string_memcpy/9/1/8/iterations:1\n"
- "BM_string_memcpy/9/1/16/iterations:1\n"
- "BM_string_memcpy/9/1/32/iterations:1\n"
- "BM_string_memcpy/9/2/1/iterations:1\n"
- "BM_string_memcpy/9/2/2/iterations:1\n"
- "BM_string_memcpy/9/2/4/iterations:1\n"
- "BM_string_memcpy/9/2/8/iterations:1\n"
- "BM_string_memcpy/9/2/16/iterations:1\n"
- "BM_string_memcpy/9/2/32/iterations:1\n"
- "BM_string_memcpy/9/4/1/iterations:1\n"
- "BM_string_memcpy/9/4/2/iterations:1\n"
- "BM_string_memcpy/9/4/4/iterations:1\n"
- "BM_string_memcpy/9/4/8/iterations:1\n"
- "BM_string_memcpy/9/4/16/iterations:1\n"
- "BM_string_memcpy/9/4/32/iterations:1\n"
- "BM_string_memcpy/9/8/1/iterations:1\n"
- "BM_string_memcpy/9/8/2/iterations:1\n"
- "BM_string_memcpy/9/8/4/iterations:1\n"
- "BM_string_memcpy/9/8/8/iterations:1\n"
- "BM_string_memcpy/9/8/16/iterations:1\n"
- "BM_string_memcpy/9/8/32/iterations:1\n"
- "BM_string_memcpy/9/16/1/iterations:1\n"
- "BM_string_memcpy/9/16/2/iterations:1\n"
- "BM_string_memcpy/9/16/4/iterations:1\n"
- "BM_string_memcpy/9/16/8/iterations:1\n"
- "BM_string_memcpy/9/16/16/iterations:1\n"
- "BM_string_memcpy/9/16/32/iterations:1\n"
- "BM_string_memcpy/9/32/1/iterations:1\n"
- "BM_string_memcpy/9/32/2/iterations:1\n"
- "BM_string_memcpy/9/32/4/iterations:1\n"
- "BM_string_memcpy/9/32/8/iterations:1\n"
- "BM_string_memcpy/9/32/16/iterations:1\n"
- "BM_string_memcpy/9/32/32/iterations:1\n"
- "BM_string_memcpy/10/0/0/iterations:1\n"
- "BM_string_memcpy/10/1/1/iterations:1\n"
- "BM_string_memcpy/10/1/2/iterations:1\n"
- "BM_string_memcpy/10/1/4/iterations:1\n"
- "BM_string_memcpy/10/1/8/iterations:1\n"
- "BM_string_memcpy/10/1/16/iterations:1\n"
- "BM_string_memcpy/10/1/32/iterations:1\n"
- "BM_string_memcpy/10/2/1/iterations:1\n"
- "BM_string_memcpy/10/2/2/iterations:1\n"
- "BM_string_memcpy/10/2/4/iterations:1\n"
- "BM_string_memcpy/10/2/8/iterations:1\n"
- "BM_string_memcpy/10/2/16/iterations:1\n"
- "BM_string_memcpy/10/2/32/iterations:1\n"
- "BM_string_memcpy/10/4/1/iterations:1\n"
- "BM_string_memcpy/10/4/2/iterations:1\n"
- "BM_string_memcpy/10/4/4/iterations:1\n"
- "BM_string_memcpy/10/4/8/iterations:1\n"
- "BM_string_memcpy/10/4/16/iterations:1\n"
- "BM_string_memcpy/10/4/32/iterations:1\n"
- "BM_string_memcpy/10/8/1/iterations:1\n"
- "BM_string_memcpy/10/8/2/iterations:1\n"
- "BM_string_memcpy/10/8/4/iterations:1\n"
- "BM_string_memcpy/10/8/8/iterations:1\n"
- "BM_string_memcpy/10/8/16/iterations:1\n"
- "BM_string_memcpy/10/8/32/iterations:1\n"
- "BM_string_memcpy/10/16/1/iterations:1\n"
- "BM_string_memcpy/10/16/2/iterations:1\n"
- "BM_string_memcpy/10/16/4/iterations:1\n"
- "BM_string_memcpy/10/16/8/iterations:1\n"
- "BM_string_memcpy/10/16/16/iterations:1\n"
- "BM_string_memcpy/10/16/32/iterations:1\n"
- "BM_string_memcpy/10/32/1/iterations:1\n"
- "BM_string_memcpy/10/32/2/iterations:1\n"
- "BM_string_memcpy/10/32/4/iterations:1\n"
- "BM_string_memcpy/10/32/8/iterations:1\n"
- "BM_string_memcpy/10/32/16/iterations:1\n"
- "BM_string_memcpy/10/32/32/iterations:1\n"
- "BM_string_memcpy/11/0/0/iterations:1\n"
- "BM_string_memcpy/11/1/1/iterations:1\n"
- "BM_string_memcpy/11/1/2/iterations:1\n"
- "BM_string_memcpy/11/1/4/iterations:1\n"
- "BM_string_memcpy/11/1/8/iterations:1\n"
- "BM_string_memcpy/11/1/16/iterations:1\n"
- "BM_string_memcpy/11/1/32/iterations:1\n"
- "BM_string_memcpy/11/2/1/iterations:1\n"
- "BM_string_memcpy/11/2/2/iterations:1\n"
- "BM_string_memcpy/11/2/4/iterations:1\n"
- "BM_string_memcpy/11/2/8/iterations:1\n"
- "BM_string_memcpy/11/2/16/iterations:1\n"
- "BM_string_memcpy/11/2/32/iterations:1\n"
- "BM_string_memcpy/11/4/1/iterations:1\n"
- "BM_string_memcpy/11/4/2/iterations:1\n"
- "BM_string_memcpy/11/4/4/iterations:1\n"
- "BM_string_memcpy/11/4/8/iterations:1\n"
- "BM_string_memcpy/11/4/16/iterations:1\n"
- "BM_string_memcpy/11/4/32/iterations:1\n"
- "BM_string_memcpy/11/8/1/iterations:1\n"
- "BM_string_memcpy/11/8/2/iterations:1\n"
- "BM_string_memcpy/11/8/4/iterations:1\n"
- "BM_string_memcpy/11/8/8/iterations:1\n"
- "BM_string_memcpy/11/8/16/iterations:1\n"
- "BM_string_memcpy/11/8/32/iterations:1\n"
- "BM_string_memcpy/11/16/1/iterations:1\n"
- "BM_string_memcpy/11/16/2/iterations:1\n"
- "BM_string_memcpy/11/16/4/iterations:1\n"
- "BM_string_memcpy/11/16/8/iterations:1\n"
- "BM_string_memcpy/11/16/16/iterations:1\n"
- "BM_string_memcpy/11/16/32/iterations:1\n"
- "BM_string_memcpy/11/32/1/iterations:1\n"
- "BM_string_memcpy/11/32/2/iterations:1\n"
- "BM_string_memcpy/11/32/4/iterations:1\n"
- "BM_string_memcpy/11/32/8/iterations:1\n"
- "BM_string_memcpy/11/32/16/iterations:1\n"
- "BM_string_memcpy/11/32/32/iterations:1\n"
- "BM_string_memcpy/12/0/0/iterations:1\n"
- "BM_string_memcpy/12/1/1/iterations:1\n"
- "BM_string_memcpy/12/1/2/iterations:1\n"
- "BM_string_memcpy/12/1/4/iterations:1\n"
- "BM_string_memcpy/12/1/8/iterations:1\n"
- "BM_string_memcpy/12/1/16/iterations:1\n"
- "BM_string_memcpy/12/1/32/iterations:1\n"
- "BM_string_memcpy/12/2/1/iterations:1\n"
- "BM_string_memcpy/12/2/2/iterations:1\n"
- "BM_string_memcpy/12/2/4/iterations:1\n"
- "BM_string_memcpy/12/2/8/iterations:1\n"
- "BM_string_memcpy/12/2/16/iterations:1\n"
- "BM_string_memcpy/12/2/32/iterations:1\n"
- "BM_string_memcpy/12/4/1/iterations:1\n"
- "BM_string_memcpy/12/4/2/iterations:1\n"
- "BM_string_memcpy/12/4/4/iterations:1\n"
- "BM_string_memcpy/12/4/8/iterations:1\n"
- "BM_string_memcpy/12/4/16/iterations:1\n"
- "BM_string_memcpy/12/4/32/iterations:1\n"
- "BM_string_memcpy/12/8/1/iterations:1\n"
- "BM_string_memcpy/12/8/2/iterations:1\n"
- "BM_string_memcpy/12/8/4/iterations:1\n"
- "BM_string_memcpy/12/8/8/iterations:1\n"
- "BM_string_memcpy/12/8/16/iterations:1\n"
- "BM_string_memcpy/12/8/32/iterations:1\n"
- "BM_string_memcpy/12/16/1/iterations:1\n"
- "BM_string_memcpy/12/16/2/iterations:1\n"
- "BM_string_memcpy/12/16/4/iterations:1\n"
- "BM_string_memcpy/12/16/8/iterations:1\n"
- "BM_string_memcpy/12/16/16/iterations:1\n"
- "BM_string_memcpy/12/16/32/iterations:1\n"
- "BM_string_memcpy/12/32/1/iterations:1\n"
- "BM_string_memcpy/12/32/2/iterations:1\n"
- "BM_string_memcpy/12/32/4/iterations:1\n"
- "BM_string_memcpy/12/32/8/iterations:1\n"
- "BM_string_memcpy/12/32/16/iterations:1\n"
- "BM_string_memcpy/12/32/32/iterations:1\n"
- "BM_string_memcpy/13/0/0/iterations:1\n"
- "BM_string_memcpy/13/1/1/iterations:1\n"
- "BM_string_memcpy/13/1/2/iterations:1\n"
- "BM_string_memcpy/13/1/4/iterations:1\n"
- "BM_string_memcpy/13/1/8/iterations:1\n"
- "BM_string_memcpy/13/1/16/iterations:1\n"
- "BM_string_memcpy/13/1/32/iterations:1\n"
- "BM_string_memcpy/13/2/1/iterations:1\n"
- "BM_string_memcpy/13/2/2/iterations:1\n"
- "BM_string_memcpy/13/2/4/iterations:1\n"
- "BM_string_memcpy/13/2/8/iterations:1\n"
- "BM_string_memcpy/13/2/16/iterations:1\n"
- "BM_string_memcpy/13/2/32/iterations:1\n"
- "BM_string_memcpy/13/4/1/iterations:1\n"
- "BM_string_memcpy/13/4/2/iterations:1\n"
- "BM_string_memcpy/13/4/4/iterations:1\n"
- "BM_string_memcpy/13/4/8/iterations:1\n"
- "BM_string_memcpy/13/4/16/iterations:1\n"
- "BM_string_memcpy/13/4/32/iterations:1\n"
- "BM_string_memcpy/13/8/1/iterations:1\n"
- "BM_string_memcpy/13/8/2/iterations:1\n"
- "BM_string_memcpy/13/8/4/iterations:1\n"
- "BM_string_memcpy/13/8/8/iterations:1\n"
- "BM_string_memcpy/13/8/16/iterations:1\n"
- "BM_string_memcpy/13/8/32/iterations:1\n"
- "BM_string_memcpy/13/16/1/iterations:1\n"
- "BM_string_memcpy/13/16/2/iterations:1\n"
- "BM_string_memcpy/13/16/4/iterations:1\n"
- "BM_string_memcpy/13/16/8/iterations:1\n"
- "BM_string_memcpy/13/16/16/iterations:1\n"
- "BM_string_memcpy/13/16/32/iterations:1\n"
- "BM_string_memcpy/13/32/1/iterations:1\n"
- "BM_string_memcpy/13/32/2/iterations:1\n"
- "BM_string_memcpy/13/32/4/iterations:1\n"
- "BM_string_memcpy/13/32/8/iterations:1\n"
- "BM_string_memcpy/13/32/16/iterations:1\n"
- "BM_string_memcpy/13/32/32/iterations:1\n"
- "BM_string_memcpy/14/0/0/iterations:1\n"
- "BM_string_memcpy/14/1/1/iterations:1\n"
- "BM_string_memcpy/14/1/2/iterations:1\n"
- "BM_string_memcpy/14/1/4/iterations:1\n"
- "BM_string_memcpy/14/1/8/iterations:1\n"
- "BM_string_memcpy/14/1/16/iterations:1\n"
- "BM_string_memcpy/14/1/32/iterations:1\n"
- "BM_string_memcpy/14/2/1/iterations:1\n"
- "BM_string_memcpy/14/2/2/iterations:1\n"
- "BM_string_memcpy/14/2/4/iterations:1\n"
- "BM_string_memcpy/14/2/8/iterations:1\n"
- "BM_string_memcpy/14/2/16/iterations:1\n"
- "BM_string_memcpy/14/2/32/iterations:1\n"
- "BM_string_memcpy/14/4/1/iterations:1\n"
- "BM_string_memcpy/14/4/2/iterations:1\n"
- "BM_string_memcpy/14/4/4/iterations:1\n"
- "BM_string_memcpy/14/4/8/iterations:1\n"
- "BM_string_memcpy/14/4/16/iterations:1\n"
- "BM_string_memcpy/14/4/32/iterations:1\n"
- "BM_string_memcpy/14/8/1/iterations:1\n"
- "BM_string_memcpy/14/8/2/iterations:1\n"
- "BM_string_memcpy/14/8/4/iterations:1\n"
- "BM_string_memcpy/14/8/8/iterations:1\n"
- "BM_string_memcpy/14/8/16/iterations:1\n"
- "BM_string_memcpy/14/8/32/iterations:1\n"
- "BM_string_memcpy/14/16/1/iterations:1\n"
- "BM_string_memcpy/14/16/2/iterations:1\n"
- "BM_string_memcpy/14/16/4/iterations:1\n"
- "BM_string_memcpy/14/16/8/iterations:1\n"
- "BM_string_memcpy/14/16/16/iterations:1\n"
- "BM_string_memcpy/14/16/32/iterations:1\n"
- "BM_string_memcpy/14/32/1/iterations:1\n"
- "BM_string_memcpy/14/32/2/iterations:1\n"
- "BM_string_memcpy/14/32/4/iterations:1\n"
- "BM_string_memcpy/14/32/8/iterations:1\n"
- "BM_string_memcpy/14/32/16/iterations:1\n"
- "BM_string_memcpy/14/32/32/iterations:1\n"
- "BM_string_memcpy/15/0/0/iterations:1\n"
- "BM_string_memcpy/15/1/1/iterations:1\n"
- "BM_string_memcpy/15/1/2/iterations:1\n"
- "BM_string_memcpy/15/1/4/iterations:1\n"
- "BM_string_memcpy/15/1/8/iterations:1\n"
- "BM_string_memcpy/15/1/16/iterations:1\n"
- "BM_string_memcpy/15/1/32/iterations:1\n"
- "BM_string_memcpy/15/2/1/iterations:1\n"
- "BM_string_memcpy/15/2/2/iterations:1\n"
- "BM_string_memcpy/15/2/4/iterations:1\n"
- "BM_string_memcpy/15/2/8/iterations:1\n"
- "BM_string_memcpy/15/2/16/iterations:1\n"
- "BM_string_memcpy/15/2/32/iterations:1\n"
- "BM_string_memcpy/15/4/1/iterations:1\n"
- "BM_string_memcpy/15/4/2/iterations:1\n"
- "BM_string_memcpy/15/4/4/iterations:1\n"
- "BM_string_memcpy/15/4/8/iterations:1\n"
- "BM_string_memcpy/15/4/16/iterations:1\n"
- "BM_string_memcpy/15/4/32/iterations:1\n"
- "BM_string_memcpy/15/8/1/iterations:1\n"
- "BM_string_memcpy/15/8/2/iterations:1\n"
- "BM_string_memcpy/15/8/4/iterations:1\n"
- "BM_string_memcpy/15/8/8/iterations:1\n"
- "BM_string_memcpy/15/8/16/iterations:1\n"
- "BM_string_memcpy/15/8/32/iterations:1\n"
- "BM_string_memcpy/15/16/1/iterations:1\n"
- "BM_string_memcpy/15/16/2/iterations:1\n"
- "BM_string_memcpy/15/16/4/iterations:1\n"
- "BM_string_memcpy/15/16/8/iterations:1\n"
- "BM_string_memcpy/15/16/16/iterations:1\n"
- "BM_string_memcpy/15/16/32/iterations:1\n"
- "BM_string_memcpy/15/32/1/iterations:1\n"
- "BM_string_memcpy/15/32/2/iterations:1\n"
- "BM_string_memcpy/15/32/4/iterations:1\n"
- "BM_string_memcpy/15/32/8/iterations:1\n"
- "BM_string_memcpy/15/32/16/iterations:1\n"
- "BM_string_memcpy/15/32/32/iterations:1\n"
- "BM_string_memcpy/16/0/0/iterations:1\n"
- "BM_string_memcpy/16/1/1/iterations:1\n"
- "BM_string_memcpy/16/1/2/iterations:1\n"
- "BM_string_memcpy/16/1/4/iterations:1\n"
- "BM_string_memcpy/16/1/8/iterations:1\n"
- "BM_string_memcpy/16/1/16/iterations:1\n"
- "BM_string_memcpy/16/1/32/iterations:1\n"
- "BM_string_memcpy/16/2/1/iterations:1\n"
- "BM_string_memcpy/16/2/2/iterations:1\n"
- "BM_string_memcpy/16/2/4/iterations:1\n"
- "BM_string_memcpy/16/2/8/iterations:1\n"
- "BM_string_memcpy/16/2/16/iterations:1\n"
- "BM_string_memcpy/16/2/32/iterations:1\n"
- "BM_string_memcpy/16/4/1/iterations:1\n"
- "BM_string_memcpy/16/4/2/iterations:1\n"
- "BM_string_memcpy/16/4/4/iterations:1\n"
- "BM_string_memcpy/16/4/8/iterations:1\n"
- "BM_string_memcpy/16/4/16/iterations:1\n"
- "BM_string_memcpy/16/4/32/iterations:1\n"
- "BM_string_memcpy/16/8/1/iterations:1\n"
- "BM_string_memcpy/16/8/2/iterations:1\n"
- "BM_string_memcpy/16/8/4/iterations:1\n"
- "BM_string_memcpy/16/8/8/iterations:1\n"
- "BM_string_memcpy/16/8/16/iterations:1\n"
- "BM_string_memcpy/16/8/32/iterations:1\n"
- "BM_string_memcpy/16/16/1/iterations:1\n"
- "BM_string_memcpy/16/16/2/iterations:1\n"
- "BM_string_memcpy/16/16/4/iterations:1\n"
- "BM_string_memcpy/16/16/8/iterations:1\n"
- "BM_string_memcpy/16/16/16/iterations:1\n"
- "BM_string_memcpy/16/16/32/iterations:1\n"
- "BM_string_memcpy/16/32/1/iterations:1\n"
- "BM_string_memcpy/16/32/2/iterations:1\n"
- "BM_string_memcpy/16/32/4/iterations:1\n"
- "BM_string_memcpy/16/32/8/iterations:1\n"
- "BM_string_memcpy/16/32/16/iterations:1\n"
- "BM_string_memcpy/16/32/32/iterations:1\n"
- "BM_string_memcpy/24/0/0/iterations:1\n"
- "BM_string_memcpy/24/1/1/iterations:1\n"
- "BM_string_memcpy/24/1/2/iterations:1\n"
- "BM_string_memcpy/24/1/4/iterations:1\n"
- "BM_string_memcpy/24/1/8/iterations:1\n"
- "BM_string_memcpy/24/1/16/iterations:1\n"
- "BM_string_memcpy/24/1/32/iterations:1\n"
- "BM_string_memcpy/24/2/1/iterations:1\n"
- "BM_string_memcpy/24/2/2/iterations:1\n"
- "BM_string_memcpy/24/2/4/iterations:1\n"
- "BM_string_memcpy/24/2/8/iterations:1\n"
- "BM_string_memcpy/24/2/16/iterations:1\n"
- "BM_string_memcpy/24/2/32/iterations:1\n"
- "BM_string_memcpy/24/4/1/iterations:1\n"
- "BM_string_memcpy/24/4/2/iterations:1\n"
- "BM_string_memcpy/24/4/4/iterations:1\n"
- "BM_string_memcpy/24/4/8/iterations:1\n"
- "BM_string_memcpy/24/4/16/iterations:1\n"
- "BM_string_memcpy/24/4/32/iterations:1\n"
- "BM_string_memcpy/24/8/1/iterations:1\n"
- "BM_string_memcpy/24/8/2/iterations:1\n"
- "BM_string_memcpy/24/8/4/iterations:1\n"
- "BM_string_memcpy/24/8/8/iterations:1\n"
- "BM_string_memcpy/24/8/16/iterations:1\n"
- "BM_string_memcpy/24/8/32/iterations:1\n"
- "BM_string_memcpy/24/16/1/iterations:1\n"
- "BM_string_memcpy/24/16/2/iterations:1\n"
- "BM_string_memcpy/24/16/4/iterations:1\n"
- "BM_string_memcpy/24/16/8/iterations:1\n"
- "BM_string_memcpy/24/16/16/iterations:1\n"
- "BM_string_memcpy/24/16/32/iterations:1\n"
- "BM_string_memcpy/24/32/1/iterations:1\n"
- "BM_string_memcpy/24/32/2/iterations:1\n"
- "BM_string_memcpy/24/32/4/iterations:1\n"
- "BM_string_memcpy/24/32/8/iterations:1\n"
- "BM_string_memcpy/24/32/16/iterations:1\n"
- "BM_string_memcpy/24/32/32/iterations:1\n"
- "BM_string_memcpy/32/0/0/iterations:1\n"
- "BM_string_memcpy/32/1/1/iterations:1\n"
- "BM_string_memcpy/32/1/2/iterations:1\n"
- "BM_string_memcpy/32/1/4/iterations:1\n"
- "BM_string_memcpy/32/1/8/iterations:1\n"
- "BM_string_memcpy/32/1/16/iterations:1\n"
- "BM_string_memcpy/32/1/32/iterations:1\n"
- "BM_string_memcpy/32/2/1/iterations:1\n"
- "BM_string_memcpy/32/2/2/iterations:1\n"
- "BM_string_memcpy/32/2/4/iterations:1\n"
- "BM_string_memcpy/32/2/8/iterations:1\n"
- "BM_string_memcpy/32/2/16/iterations:1\n"
- "BM_string_memcpy/32/2/32/iterations:1\n"
- "BM_string_memcpy/32/4/1/iterations:1\n"
- "BM_string_memcpy/32/4/2/iterations:1\n"
- "BM_string_memcpy/32/4/4/iterations:1\n"
- "BM_string_memcpy/32/4/8/iterations:1\n"
- "BM_string_memcpy/32/4/16/iterations:1\n"
- "BM_string_memcpy/32/4/32/iterations:1\n"
- "BM_string_memcpy/32/8/1/iterations:1\n"
- "BM_string_memcpy/32/8/2/iterations:1\n"
- "BM_string_memcpy/32/8/4/iterations:1\n"
- "BM_string_memcpy/32/8/8/iterations:1\n"
- "BM_string_memcpy/32/8/16/iterations:1\n"
- "BM_string_memcpy/32/8/32/iterations:1\n"
- "BM_string_memcpy/32/16/1/iterations:1\n"
- "BM_string_memcpy/32/16/2/iterations:1\n"
- "BM_string_memcpy/32/16/4/iterations:1\n"
- "BM_string_memcpy/32/16/8/iterations:1\n"
- "BM_string_memcpy/32/16/16/iterations:1\n"
- "BM_string_memcpy/32/16/32/iterations:1\n"
- "BM_string_memcpy/32/32/1/iterations:1\n"
- "BM_string_memcpy/32/32/2/iterations:1\n"
- "BM_string_memcpy/32/32/4/iterations:1\n"
- "BM_string_memcpy/32/32/8/iterations:1\n"
- "BM_string_memcpy/32/32/16/iterations:1\n"
- "BM_string_memcpy/32/32/32/iterations:1\n"
- "BM_string_memcpy/40/0/0/iterations:1\n"
- "BM_string_memcpy/40/1/1/iterations:1\n"
- "BM_string_memcpy/40/1/2/iterations:1\n"
- "BM_string_memcpy/40/1/4/iterations:1\n"
- "BM_string_memcpy/40/1/8/iterations:1\n"
- "BM_string_memcpy/40/1/16/iterations:1\n"
- "BM_string_memcpy/40/1/32/iterations:1\n"
- "BM_string_memcpy/40/2/1/iterations:1\n"
- "BM_string_memcpy/40/2/2/iterations:1\n"
- "BM_string_memcpy/40/2/4/iterations:1\n"
- "BM_string_memcpy/40/2/8/iterations:1\n"
- "BM_string_memcpy/40/2/16/iterations:1\n"
- "BM_string_memcpy/40/2/32/iterations:1\n"
- "BM_string_memcpy/40/4/1/iterations:1\n"
- "BM_string_memcpy/40/4/2/iterations:1\n"
- "BM_string_memcpy/40/4/4/iterations:1\n"
- "BM_string_memcpy/40/4/8/iterations:1\n"
- "BM_string_memcpy/40/4/16/iterations:1\n"
- "BM_string_memcpy/40/4/32/iterations:1\n"
- "BM_string_memcpy/40/8/1/iterations:1\n"
- "BM_string_memcpy/40/8/2/iterations:1\n"
- "BM_string_memcpy/40/8/4/iterations:1\n"
- "BM_string_memcpy/40/8/8/iterations:1\n"
- "BM_string_memcpy/40/8/16/iterations:1\n"
- "BM_string_memcpy/40/8/32/iterations:1\n"
- "BM_string_memcpy/40/16/1/iterations:1\n"
- "BM_string_memcpy/40/16/2/iterations:1\n"
- "BM_string_memcpy/40/16/4/iterations:1\n"
- "BM_string_memcpy/40/16/8/iterations:1\n"
- "BM_string_memcpy/40/16/16/iterations:1\n"
- "BM_string_memcpy/40/16/32/iterations:1\n"
- "BM_string_memcpy/40/32/1/iterations:1\n"
- "BM_string_memcpy/40/32/2/iterations:1\n"
- "BM_string_memcpy/40/32/4/iterations:1\n"
- "BM_string_memcpy/40/32/8/iterations:1\n"
- "BM_string_memcpy/40/32/16/iterations:1\n"
- "BM_string_memcpy/40/32/32/iterations:1\n"
- "BM_string_memcpy/48/0/0/iterations:1\n"
- "BM_string_memcpy/48/1/1/iterations:1\n"
- "BM_string_memcpy/48/1/2/iterations:1\n"
- "BM_string_memcpy/48/1/4/iterations:1\n"
- "BM_string_memcpy/48/1/8/iterations:1\n"
- "BM_string_memcpy/48/1/16/iterations:1\n"
- "BM_string_memcpy/48/1/32/iterations:1\n"
- "BM_string_memcpy/48/2/1/iterations:1\n"
- "BM_string_memcpy/48/2/2/iterations:1\n"
- "BM_string_memcpy/48/2/4/iterations:1\n"
- "BM_string_memcpy/48/2/8/iterations:1\n"
- "BM_string_memcpy/48/2/16/iterations:1\n"
- "BM_string_memcpy/48/2/32/iterations:1\n"
- "BM_string_memcpy/48/4/1/iterations:1\n"
- "BM_string_memcpy/48/4/2/iterations:1\n"
- "BM_string_memcpy/48/4/4/iterations:1\n"
- "BM_string_memcpy/48/4/8/iterations:1\n"
- "BM_string_memcpy/48/4/16/iterations:1\n"
- "BM_string_memcpy/48/4/32/iterations:1\n"
- "BM_string_memcpy/48/8/1/iterations:1\n"
- "BM_string_memcpy/48/8/2/iterations:1\n"
- "BM_string_memcpy/48/8/4/iterations:1\n"
- "BM_string_memcpy/48/8/8/iterations:1\n"
- "BM_string_memcpy/48/8/16/iterations:1\n"
- "BM_string_memcpy/48/8/32/iterations:1\n"
- "BM_string_memcpy/48/16/1/iterations:1\n"
- "BM_string_memcpy/48/16/2/iterations:1\n"
- "BM_string_memcpy/48/16/4/iterations:1\n"
- "BM_string_memcpy/48/16/8/iterations:1\n"
- "BM_string_memcpy/48/16/16/iterations:1\n"
- "BM_string_memcpy/48/16/32/iterations:1\n"
- "BM_string_memcpy/48/32/1/iterations:1\n"
- "BM_string_memcpy/48/32/2/iterations:1\n"
- "BM_string_memcpy/48/32/4/iterations:1\n"
- "BM_string_memcpy/48/32/8/iterations:1\n"
- "BM_string_memcpy/48/32/16/iterations:1\n"
- "BM_string_memcpy/48/32/32/iterations:1\n"
- "BM_string_memcpy/56/0/0/iterations:1\n"
- "BM_string_memcpy/56/1/1/iterations:1\n"
- "BM_string_memcpy/56/1/2/iterations:1\n"
- "BM_string_memcpy/56/1/4/iterations:1\n"
- "BM_string_memcpy/56/1/8/iterations:1\n"
- "BM_string_memcpy/56/1/16/iterations:1\n"
- "BM_string_memcpy/56/1/32/iterations:1\n"
- "BM_string_memcpy/56/2/1/iterations:1\n"
- "BM_string_memcpy/56/2/2/iterations:1\n"
- "BM_string_memcpy/56/2/4/iterations:1\n"
- "BM_string_memcpy/56/2/8/iterations:1\n"
- "BM_string_memcpy/56/2/16/iterations:1\n"
- "BM_string_memcpy/56/2/32/iterations:1\n"
- "BM_string_memcpy/56/4/1/iterations:1\n"
- "BM_string_memcpy/56/4/2/iterations:1\n"
- "BM_string_memcpy/56/4/4/iterations:1\n"
- "BM_string_memcpy/56/4/8/iterations:1\n"
- "BM_string_memcpy/56/4/16/iterations:1\n"
- "BM_string_memcpy/56/4/32/iterations:1\n"
- "BM_string_memcpy/56/8/1/iterations:1\n"
- "BM_string_memcpy/56/8/2/iterations:1\n"
- "BM_string_memcpy/56/8/4/iterations:1\n"
- "BM_string_memcpy/56/8/8/iterations:1\n"
- "BM_string_memcpy/56/8/16/iterations:1\n"
- "BM_string_memcpy/56/8/32/iterations:1\n"
- "BM_string_memcpy/56/16/1/iterations:1\n"
- "BM_string_memcpy/56/16/2/iterations:1\n"
- "BM_string_memcpy/56/16/4/iterations:1\n"
- "BM_string_memcpy/56/16/8/iterations:1\n"
- "BM_string_memcpy/56/16/16/iterations:1\n"
- "BM_string_memcpy/56/16/32/iterations:1\n"
- "BM_string_memcpy/56/32/1/iterations:1\n"
- "BM_string_memcpy/56/32/2/iterations:1\n"
- "BM_string_memcpy/56/32/4/iterations:1\n"
- "BM_string_memcpy/56/32/8/iterations:1\n"
- "BM_string_memcpy/56/32/16/iterations:1\n"
- "BM_string_memcpy/56/32/32/iterations:1\n"
- "BM_string_memcpy/64/0/0/iterations:1\n"
- "BM_string_memcpy/64/1/1/iterations:1\n"
- "BM_string_memcpy/64/1/2/iterations:1\n"
- "BM_string_memcpy/64/1/4/iterations:1\n"
- "BM_string_memcpy/64/1/8/iterations:1\n"
- "BM_string_memcpy/64/1/16/iterations:1\n"
- "BM_string_memcpy/64/1/32/iterations:1\n"
- "BM_string_memcpy/64/2/1/iterations:1\n"
- "BM_string_memcpy/64/2/2/iterations:1\n"
- "BM_string_memcpy/64/2/4/iterations:1\n"
- "BM_string_memcpy/64/2/8/iterations:1\n"
- "BM_string_memcpy/64/2/16/iterations:1\n"
- "BM_string_memcpy/64/2/32/iterations:1\n"
- "BM_string_memcpy/64/4/1/iterations:1\n"
- "BM_string_memcpy/64/4/2/iterations:1\n"
- "BM_string_memcpy/64/4/4/iterations:1\n"
- "BM_string_memcpy/64/4/8/iterations:1\n"
- "BM_string_memcpy/64/4/16/iterations:1\n"
- "BM_string_memcpy/64/4/32/iterations:1\n"
- "BM_string_memcpy/64/8/1/iterations:1\n"
- "BM_string_memcpy/64/8/2/iterations:1\n"
- "BM_string_memcpy/64/8/4/iterations:1\n"
- "BM_string_memcpy/64/8/8/iterations:1\n"
- "BM_string_memcpy/64/8/16/iterations:1\n"
- "BM_string_memcpy/64/8/32/iterations:1\n"
- "BM_string_memcpy/64/16/1/iterations:1\n"
- "BM_string_memcpy/64/16/2/iterations:1\n"
- "BM_string_memcpy/64/16/4/iterations:1\n"
- "BM_string_memcpy/64/16/8/iterations:1\n"
- "BM_string_memcpy/64/16/16/iterations:1\n"
- "BM_string_memcpy/64/16/32/iterations:1\n"
- "BM_string_memcpy/64/32/1/iterations:1\n"
- "BM_string_memcpy/64/32/2/iterations:1\n"
- "BM_string_memcpy/64/32/4/iterations:1\n"
- "BM_string_memcpy/64/32/8/iterations:1\n"
- "BM_string_memcpy/64/32/16/iterations:1\n"
- "BM_string_memcpy/64/32/32/iterations:1\n"
- "BM_string_memcpy/72/0/0/iterations:1\n"
- "BM_string_memcpy/72/1/1/iterations:1\n"
- "BM_string_memcpy/72/1/2/iterations:1\n"
- "BM_string_memcpy/72/1/4/iterations:1\n"
- "BM_string_memcpy/72/1/8/iterations:1\n"
- "BM_string_memcpy/72/1/16/iterations:1\n"
- "BM_string_memcpy/72/1/32/iterations:1\n"
- "BM_string_memcpy/72/2/1/iterations:1\n"
- "BM_string_memcpy/72/2/2/iterations:1\n"
- "BM_string_memcpy/72/2/4/iterations:1\n"
- "BM_string_memcpy/72/2/8/iterations:1\n"
- "BM_string_memcpy/72/2/16/iterations:1\n"
- "BM_string_memcpy/72/2/32/iterations:1\n"
- "BM_string_memcpy/72/4/1/iterations:1\n"
- "BM_string_memcpy/72/4/2/iterations:1\n"
- "BM_string_memcpy/72/4/4/iterations:1\n"
- "BM_string_memcpy/72/4/8/iterations:1\n"
- "BM_string_memcpy/72/4/16/iterations:1\n"
- "BM_string_memcpy/72/4/32/iterations:1\n"
- "BM_string_memcpy/72/8/1/iterations:1\n"
- "BM_string_memcpy/72/8/2/iterations:1\n"
- "BM_string_memcpy/72/8/4/iterations:1\n"
- "BM_string_memcpy/72/8/8/iterations:1\n"
- "BM_string_memcpy/72/8/16/iterations:1\n"
- "BM_string_memcpy/72/8/32/iterations:1\n"
- "BM_string_memcpy/72/16/1/iterations:1\n"
- "BM_string_memcpy/72/16/2/iterations:1\n"
- "BM_string_memcpy/72/16/4/iterations:1\n"
- "BM_string_memcpy/72/16/8/iterations:1\n"
- "BM_string_memcpy/72/16/16/iterations:1\n"
- "BM_string_memcpy/72/16/32/iterations:1\n"
- "BM_string_memcpy/72/32/1/iterations:1\n"
- "BM_string_memcpy/72/32/2/iterations:1\n"
- "BM_string_memcpy/72/32/4/iterations:1\n"
- "BM_string_memcpy/72/32/8/iterations:1\n"
- "BM_string_memcpy/72/32/16/iterations:1\n"
- "BM_string_memcpy/72/32/32/iterations:1\n"
- "BM_string_memcpy/80/0/0/iterations:1\n"
- "BM_string_memcpy/80/1/1/iterations:1\n"
- "BM_string_memcpy/80/1/2/iterations:1\n"
- "BM_string_memcpy/80/1/4/iterations:1\n"
- "BM_string_memcpy/80/1/8/iterations:1\n"
- "BM_string_memcpy/80/1/16/iterations:1\n"
- "BM_string_memcpy/80/1/32/iterations:1\n"
- "BM_string_memcpy/80/2/1/iterations:1\n"
- "BM_string_memcpy/80/2/2/iterations:1\n"
- "BM_string_memcpy/80/2/4/iterations:1\n"
- "BM_string_memcpy/80/2/8/iterations:1\n"
- "BM_string_memcpy/80/2/16/iterations:1\n"
- "BM_string_memcpy/80/2/32/iterations:1\n"
- "BM_string_memcpy/80/4/1/iterations:1\n"
- "BM_string_memcpy/80/4/2/iterations:1\n"
- "BM_string_memcpy/80/4/4/iterations:1\n"
- "BM_string_memcpy/80/4/8/iterations:1\n"
- "BM_string_memcpy/80/4/16/iterations:1\n"
- "BM_string_memcpy/80/4/32/iterations:1\n"
- "BM_string_memcpy/80/8/1/iterations:1\n"
- "BM_string_memcpy/80/8/2/iterations:1\n"
- "BM_string_memcpy/80/8/4/iterations:1\n"
- "BM_string_memcpy/80/8/8/iterations:1\n"
- "BM_string_memcpy/80/8/16/iterations:1\n"
- "BM_string_memcpy/80/8/32/iterations:1\n"
- "BM_string_memcpy/80/16/1/iterations:1\n"
- "BM_string_memcpy/80/16/2/iterations:1\n"
- "BM_string_memcpy/80/16/4/iterations:1\n"
- "BM_string_memcpy/80/16/8/iterations:1\n"
- "BM_string_memcpy/80/16/16/iterations:1\n"
- "BM_string_memcpy/80/16/32/iterations:1\n"
- "BM_string_memcpy/80/32/1/iterations:1\n"
- "BM_string_memcpy/80/32/2/iterations:1\n"
- "BM_string_memcpy/80/32/4/iterations:1\n"
- "BM_string_memcpy/80/32/8/iterations:1\n"
- "BM_string_memcpy/80/32/16/iterations:1\n"
- "BM_string_memcpy/80/32/32/iterations:1\n"
- "BM_string_memcpy/88/0/0/iterations:1\n"
- "BM_string_memcpy/88/1/1/iterations:1\n"
- "BM_string_memcpy/88/1/2/iterations:1\n"
- "BM_string_memcpy/88/1/4/iterations:1\n"
- "BM_string_memcpy/88/1/8/iterations:1\n"
- "BM_string_memcpy/88/1/16/iterations:1\n"
- "BM_string_memcpy/88/1/32/iterations:1\n"
- "BM_string_memcpy/88/2/1/iterations:1\n"
- "BM_string_memcpy/88/2/2/iterations:1\n"
- "BM_string_memcpy/88/2/4/iterations:1\n"
- "BM_string_memcpy/88/2/8/iterations:1\n"
- "BM_string_memcpy/88/2/16/iterations:1\n"
- "BM_string_memcpy/88/2/32/iterations:1\n"
- "BM_string_memcpy/88/4/1/iterations:1\n"
- "BM_string_memcpy/88/4/2/iterations:1\n"
- "BM_string_memcpy/88/4/4/iterations:1\n"
- "BM_string_memcpy/88/4/8/iterations:1\n"
- "BM_string_memcpy/88/4/16/iterations:1\n"
- "BM_string_memcpy/88/4/32/iterations:1\n"
- "BM_string_memcpy/88/8/1/iterations:1\n"
- "BM_string_memcpy/88/8/2/iterations:1\n"
- "BM_string_memcpy/88/8/4/iterations:1\n"
- "BM_string_memcpy/88/8/8/iterations:1\n"
- "BM_string_memcpy/88/8/16/iterations:1\n"
- "BM_string_memcpy/88/8/32/iterations:1\n"
- "BM_string_memcpy/88/16/1/iterations:1\n"
- "BM_string_memcpy/88/16/2/iterations:1\n"
- "BM_string_memcpy/88/16/4/iterations:1\n"
- "BM_string_memcpy/88/16/8/iterations:1\n"
- "BM_string_memcpy/88/16/16/iterations:1\n"
- "BM_string_memcpy/88/16/32/iterations:1\n"
- "BM_string_memcpy/88/32/1/iterations:1\n"
- "BM_string_memcpy/88/32/2/iterations:1\n"
- "BM_string_memcpy/88/32/4/iterations:1\n"
- "BM_string_memcpy/88/32/8/iterations:1\n"
- "BM_string_memcpy/88/32/16/iterations:1\n"
- "BM_string_memcpy/88/32/32/iterations:1\n"
- "BM_string_memcpy/96/0/0/iterations:1\n"
- "BM_string_memcpy/96/1/1/iterations:1\n"
- "BM_string_memcpy/96/1/2/iterations:1\n"
- "BM_string_memcpy/96/1/4/iterations:1\n"
- "BM_string_memcpy/96/1/8/iterations:1\n"
- "BM_string_memcpy/96/1/16/iterations:1\n"
- "BM_string_memcpy/96/1/32/iterations:1\n"
- "BM_string_memcpy/96/2/1/iterations:1\n"
- "BM_string_memcpy/96/2/2/iterations:1\n"
- "BM_string_memcpy/96/2/4/iterations:1\n"
- "BM_string_memcpy/96/2/8/iterations:1\n"
- "BM_string_memcpy/96/2/16/iterations:1\n"
- "BM_string_memcpy/96/2/32/iterations:1\n"
- "BM_string_memcpy/96/4/1/iterations:1\n"
- "BM_string_memcpy/96/4/2/iterations:1\n"
- "BM_string_memcpy/96/4/4/iterations:1\n"
- "BM_string_memcpy/96/4/8/iterations:1\n"
- "BM_string_memcpy/96/4/16/iterations:1\n"
- "BM_string_memcpy/96/4/32/iterations:1\n"
- "BM_string_memcpy/96/8/1/iterations:1\n"
- "BM_string_memcpy/96/8/2/iterations:1\n"
- "BM_string_memcpy/96/8/4/iterations:1\n"
- "BM_string_memcpy/96/8/8/iterations:1\n"
- "BM_string_memcpy/96/8/16/iterations:1\n"
- "BM_string_memcpy/96/8/32/iterations:1\n"
- "BM_string_memcpy/96/16/1/iterations:1\n"
- "BM_string_memcpy/96/16/2/iterations:1\n"
- "BM_string_memcpy/96/16/4/iterations:1\n"
- "BM_string_memcpy/96/16/8/iterations:1\n"
- "BM_string_memcpy/96/16/16/iterations:1\n"
- "BM_string_memcpy/96/16/32/iterations:1\n"
- "BM_string_memcpy/96/32/1/iterations:1\n"
- "BM_string_memcpy/96/32/2/iterations:1\n"
- "BM_string_memcpy/96/32/4/iterations:1\n"
- "BM_string_memcpy/96/32/8/iterations:1\n"
- "BM_string_memcpy/96/32/16/iterations:1\n"
- "BM_string_memcpy/96/32/32/iterations:1\n"
- "BM_string_memcpy/104/0/0/iterations:1\n"
- "BM_string_memcpy/104/1/1/iterations:1\n"
- "BM_string_memcpy/104/1/2/iterations:1\n"
- "BM_string_memcpy/104/1/4/iterations:1\n"
- "BM_string_memcpy/104/1/8/iterations:1\n"
- "BM_string_memcpy/104/1/16/iterations:1\n"
- "BM_string_memcpy/104/1/32/iterations:1\n"
- "BM_string_memcpy/104/2/1/iterations:1\n"
- "BM_string_memcpy/104/2/2/iterations:1\n"
- "BM_string_memcpy/104/2/4/iterations:1\n"
- "BM_string_memcpy/104/2/8/iterations:1\n"
- "BM_string_memcpy/104/2/16/iterations:1\n"
- "BM_string_memcpy/104/2/32/iterations:1\n"
- "BM_string_memcpy/104/4/1/iterations:1\n"
- "BM_string_memcpy/104/4/2/iterations:1\n"
- "BM_string_memcpy/104/4/4/iterations:1\n"
- "BM_string_memcpy/104/4/8/iterations:1\n"
- "BM_string_memcpy/104/4/16/iterations:1\n"
- "BM_string_memcpy/104/4/32/iterations:1\n"
- "BM_string_memcpy/104/8/1/iterations:1\n"
- "BM_string_memcpy/104/8/2/iterations:1\n"
- "BM_string_memcpy/104/8/4/iterations:1\n"
- "BM_string_memcpy/104/8/8/iterations:1\n"
- "BM_string_memcpy/104/8/16/iterations:1\n"
- "BM_string_memcpy/104/8/32/iterations:1\n"
- "BM_string_memcpy/104/16/1/iterations:1\n"
- "BM_string_memcpy/104/16/2/iterations:1\n"
- "BM_string_memcpy/104/16/4/iterations:1\n"
- "BM_string_memcpy/104/16/8/iterations:1\n"
- "BM_string_memcpy/104/16/16/iterations:1\n"
- "BM_string_memcpy/104/16/32/iterations:1\n"
- "BM_string_memcpy/104/32/1/iterations:1\n"
- "BM_string_memcpy/104/32/2/iterations:1\n"
- "BM_string_memcpy/104/32/4/iterations:1\n"
- "BM_string_memcpy/104/32/8/iterations:1\n"
- "BM_string_memcpy/104/32/16/iterations:1\n"
- "BM_string_memcpy/104/32/32/iterations:1\n"
- "BM_string_memcpy/112/0/0/iterations:1\n"
- "BM_string_memcpy/112/1/1/iterations:1\n"
- "BM_string_memcpy/112/1/2/iterations:1\n"
- "BM_string_memcpy/112/1/4/iterations:1\n"
- "BM_string_memcpy/112/1/8/iterations:1\n"
- "BM_string_memcpy/112/1/16/iterations:1\n"
- "BM_string_memcpy/112/1/32/iterations:1\n"
- "BM_string_memcpy/112/2/1/iterations:1\n"
- "BM_string_memcpy/112/2/2/iterations:1\n"
- "BM_string_memcpy/112/2/4/iterations:1\n"
- "BM_string_memcpy/112/2/8/iterations:1\n"
- "BM_string_memcpy/112/2/16/iterations:1\n"
- "BM_string_memcpy/112/2/32/iterations:1\n"
- "BM_string_memcpy/112/4/1/iterations:1\n"
- "BM_string_memcpy/112/4/2/iterations:1\n"
- "BM_string_memcpy/112/4/4/iterations:1\n"
- "BM_string_memcpy/112/4/8/iterations:1\n"
- "BM_string_memcpy/112/4/16/iterations:1\n"
- "BM_string_memcpy/112/4/32/iterations:1\n"
- "BM_string_memcpy/112/8/1/iterations:1\n"
- "BM_string_memcpy/112/8/2/iterations:1\n"
- "BM_string_memcpy/112/8/4/iterations:1\n"
- "BM_string_memcpy/112/8/8/iterations:1\n"
- "BM_string_memcpy/112/8/16/iterations:1\n"
- "BM_string_memcpy/112/8/32/iterations:1\n"
- "BM_string_memcpy/112/16/1/iterations:1\n"
- "BM_string_memcpy/112/16/2/iterations:1\n"
- "BM_string_memcpy/112/16/4/iterations:1\n"
- "BM_string_memcpy/112/16/8/iterations:1\n"
- "BM_string_memcpy/112/16/16/iterations:1\n"
- "BM_string_memcpy/112/16/32/iterations:1\n"
- "BM_string_memcpy/112/32/1/iterations:1\n"
- "BM_string_memcpy/112/32/2/iterations:1\n"
- "BM_string_memcpy/112/32/4/iterations:1\n"
- "BM_string_memcpy/112/32/8/iterations:1\n"
- "BM_string_memcpy/112/32/16/iterations:1\n"
- "BM_string_memcpy/112/32/32/iterations:1\n"
- "BM_string_memcpy/120/0/0/iterations:1\n"
- "BM_string_memcpy/120/1/1/iterations:1\n"
- "BM_string_memcpy/120/1/2/iterations:1\n"
- "BM_string_memcpy/120/1/4/iterations:1\n"
- "BM_string_memcpy/120/1/8/iterations:1\n"
- "BM_string_memcpy/120/1/16/iterations:1\n"
- "BM_string_memcpy/120/1/32/iterations:1\n"
- "BM_string_memcpy/120/2/1/iterations:1\n"
- "BM_string_memcpy/120/2/2/iterations:1\n"
- "BM_string_memcpy/120/2/4/iterations:1\n"
- "BM_string_memcpy/120/2/8/iterations:1\n"
- "BM_string_memcpy/120/2/16/iterations:1\n"
- "BM_string_memcpy/120/2/32/iterations:1\n"
- "BM_string_memcpy/120/4/1/iterations:1\n"
- "BM_string_memcpy/120/4/2/iterations:1\n"
- "BM_string_memcpy/120/4/4/iterations:1\n"
- "BM_string_memcpy/120/4/8/iterations:1\n"
- "BM_string_memcpy/120/4/16/iterations:1\n"
- "BM_string_memcpy/120/4/32/iterations:1\n"
- "BM_string_memcpy/120/8/1/iterations:1\n"
- "BM_string_memcpy/120/8/2/iterations:1\n"
- "BM_string_memcpy/120/8/4/iterations:1\n"
- "BM_string_memcpy/120/8/8/iterations:1\n"
- "BM_string_memcpy/120/8/16/iterations:1\n"
- "BM_string_memcpy/120/8/32/iterations:1\n"
- "BM_string_memcpy/120/16/1/iterations:1\n"
- "BM_string_memcpy/120/16/2/iterations:1\n"
- "BM_string_memcpy/120/16/4/iterations:1\n"
- "BM_string_memcpy/120/16/8/iterations:1\n"
- "BM_string_memcpy/120/16/16/iterations:1\n"
- "BM_string_memcpy/120/16/32/iterations:1\n"
- "BM_string_memcpy/120/32/1/iterations:1\n"
- "BM_string_memcpy/120/32/2/iterations:1\n"
- "BM_string_memcpy/120/32/4/iterations:1\n"
- "BM_string_memcpy/120/32/8/iterations:1\n"
- "BM_string_memcpy/120/32/16/iterations:1\n"
- "BM_string_memcpy/120/32/32/iterations:1\n"
- "BM_string_memcpy/128/0/0/iterations:1\n"
- "BM_string_memcpy/128/1/1/iterations:1\n"
- "BM_string_memcpy/128/1/2/iterations:1\n"
- "BM_string_memcpy/128/1/4/iterations:1\n"
- "BM_string_memcpy/128/1/8/iterations:1\n"
- "BM_string_memcpy/128/1/16/iterations:1\n"
- "BM_string_memcpy/128/1/32/iterations:1\n"
- "BM_string_memcpy/128/2/1/iterations:1\n"
- "BM_string_memcpy/128/2/2/iterations:1\n"
- "BM_string_memcpy/128/2/4/iterations:1\n"
- "BM_string_memcpy/128/2/8/iterations:1\n"
- "BM_string_memcpy/128/2/16/iterations:1\n"
- "BM_string_memcpy/128/2/32/iterations:1\n"
- "BM_string_memcpy/128/4/1/iterations:1\n"
- "BM_string_memcpy/128/4/2/iterations:1\n"
- "BM_string_memcpy/128/4/4/iterations:1\n"
- "BM_string_memcpy/128/4/8/iterations:1\n"
- "BM_string_memcpy/128/4/16/iterations:1\n"
- "BM_string_memcpy/128/4/32/iterations:1\n"
- "BM_string_memcpy/128/8/1/iterations:1\n"
- "BM_string_memcpy/128/8/2/iterations:1\n"
- "BM_string_memcpy/128/8/4/iterations:1\n"
- "BM_string_memcpy/128/8/8/iterations:1\n"
- "BM_string_memcpy/128/8/16/iterations:1\n"
- "BM_string_memcpy/128/8/32/iterations:1\n"
- "BM_string_memcpy/128/16/1/iterations:1\n"
- "BM_string_memcpy/128/16/2/iterations:1\n"
- "BM_string_memcpy/128/16/4/iterations:1\n"
- "BM_string_memcpy/128/16/8/iterations:1\n"
- "BM_string_memcpy/128/16/16/iterations:1\n"
- "BM_string_memcpy/128/16/32/iterations:1\n"
- "BM_string_memcpy/128/32/1/iterations:1\n"
- "BM_string_memcpy/128/32/2/iterations:1\n"
- "BM_string_memcpy/128/32/4/iterations:1\n"
- "BM_string_memcpy/128/32/8/iterations:1\n"
- "BM_string_memcpy/128/32/16/iterations:1\n"
- "BM_string_memcpy/128/32/32/iterations:1\n"
- "BM_string_memcpy/136/0/0/iterations:1\n"
- "BM_string_memcpy/136/1/1/iterations:1\n"
- "BM_string_memcpy/136/1/2/iterations:1\n"
- "BM_string_memcpy/136/1/4/iterations:1\n"
- "BM_string_memcpy/136/1/8/iterations:1\n"
- "BM_string_memcpy/136/1/16/iterations:1\n"
- "BM_string_memcpy/136/1/32/iterations:1\n"
- "BM_string_memcpy/136/2/1/iterations:1\n"
- "BM_string_memcpy/136/2/2/iterations:1\n"
- "BM_string_memcpy/136/2/4/iterations:1\n"
- "BM_string_memcpy/136/2/8/iterations:1\n"
- "BM_string_memcpy/136/2/16/iterations:1\n"
- "BM_string_memcpy/136/2/32/iterations:1\n"
- "BM_string_memcpy/136/4/1/iterations:1\n"
- "BM_string_memcpy/136/4/2/iterations:1\n"
- "BM_string_memcpy/136/4/4/iterations:1\n"
- "BM_string_memcpy/136/4/8/iterations:1\n"
- "BM_string_memcpy/136/4/16/iterations:1\n"
- "BM_string_memcpy/136/4/32/iterations:1\n"
- "BM_string_memcpy/136/8/1/iterations:1\n"
- "BM_string_memcpy/136/8/2/iterations:1\n"
- "BM_string_memcpy/136/8/4/iterations:1\n"
- "BM_string_memcpy/136/8/8/iterations:1\n"
- "BM_string_memcpy/136/8/16/iterations:1\n"
- "BM_string_memcpy/136/8/32/iterations:1\n"
- "BM_string_memcpy/136/16/1/iterations:1\n"
- "BM_string_memcpy/136/16/2/iterations:1\n"
- "BM_string_memcpy/136/16/4/iterations:1\n"
- "BM_string_memcpy/136/16/8/iterations:1\n"
- "BM_string_memcpy/136/16/16/iterations:1\n"
- "BM_string_memcpy/136/16/32/iterations:1\n"
- "BM_string_memcpy/136/32/1/iterations:1\n"
- "BM_string_memcpy/136/32/2/iterations:1\n"
- "BM_string_memcpy/136/32/4/iterations:1\n"
- "BM_string_memcpy/136/32/8/iterations:1\n"
- "BM_string_memcpy/136/32/16/iterations:1\n"
- "BM_string_memcpy/136/32/32/iterations:1\n"
- "BM_string_memcpy/144/0/0/iterations:1\n"
- "BM_string_memcpy/144/1/1/iterations:1\n"
- "BM_string_memcpy/144/1/2/iterations:1\n"
- "BM_string_memcpy/144/1/4/iterations:1\n"
- "BM_string_memcpy/144/1/8/iterations:1\n"
- "BM_string_memcpy/144/1/16/iterations:1\n"
- "BM_string_memcpy/144/1/32/iterations:1\n"
- "BM_string_memcpy/144/2/1/iterations:1\n"
- "BM_string_memcpy/144/2/2/iterations:1\n"
- "BM_string_memcpy/144/2/4/iterations:1\n"
- "BM_string_memcpy/144/2/8/iterations:1\n"
- "BM_string_memcpy/144/2/16/iterations:1\n"
- "BM_string_memcpy/144/2/32/iterations:1\n"
- "BM_string_memcpy/144/4/1/iterations:1\n"
- "BM_string_memcpy/144/4/2/iterations:1\n"
- "BM_string_memcpy/144/4/4/iterations:1\n"
- "BM_string_memcpy/144/4/8/iterations:1\n"
- "BM_string_memcpy/144/4/16/iterations:1\n"
- "BM_string_memcpy/144/4/32/iterations:1\n"
- "BM_string_memcpy/144/8/1/iterations:1\n"
- "BM_string_memcpy/144/8/2/iterations:1\n"
- "BM_string_memcpy/144/8/4/iterations:1\n"
- "BM_string_memcpy/144/8/8/iterations:1\n"
- "BM_string_memcpy/144/8/16/iterations:1\n"
- "BM_string_memcpy/144/8/32/iterations:1\n"
- "BM_string_memcpy/144/16/1/iterations:1\n"
- "BM_string_memcpy/144/16/2/iterations:1\n"
- "BM_string_memcpy/144/16/4/iterations:1\n"
- "BM_string_memcpy/144/16/8/iterations:1\n"
- "BM_string_memcpy/144/16/16/iterations:1\n"
- "BM_string_memcpy/144/16/32/iterations:1\n"
- "BM_string_memcpy/144/32/1/iterations:1\n"
- "BM_string_memcpy/144/32/2/iterations:1\n"
- "BM_string_memcpy/144/32/4/iterations:1\n"
- "BM_string_memcpy/144/32/8/iterations:1\n"
- "BM_string_memcpy/144/32/16/iterations:1\n"
- "BM_string_memcpy/144/32/32/iterations:1\n"
- "BM_string_memcpy/160/0/0/iterations:1\n"
- "BM_string_memcpy/160/1/1/iterations:1\n"
- "BM_string_memcpy/160/1/2/iterations:1\n"
- "BM_string_memcpy/160/1/4/iterations:1\n"
- "BM_string_memcpy/160/1/8/iterations:1\n"
- "BM_string_memcpy/160/1/16/iterations:1\n"
- "BM_string_memcpy/160/1/32/iterations:1\n"
- "BM_string_memcpy/160/2/1/iterations:1\n"
- "BM_string_memcpy/160/2/2/iterations:1\n"
- "BM_string_memcpy/160/2/4/iterations:1\n"
- "BM_string_memcpy/160/2/8/iterations:1\n"
- "BM_string_memcpy/160/2/16/iterations:1\n"
- "BM_string_memcpy/160/2/32/iterations:1\n"
- "BM_string_memcpy/160/4/1/iterations:1\n"
- "BM_string_memcpy/160/4/2/iterations:1\n"
- "BM_string_memcpy/160/4/4/iterations:1\n"
- "BM_string_memcpy/160/4/8/iterations:1\n"
- "BM_string_memcpy/160/4/16/iterations:1\n"
- "BM_string_memcpy/160/4/32/iterations:1\n"
- "BM_string_memcpy/160/8/1/iterations:1\n"
- "BM_string_memcpy/160/8/2/iterations:1\n"
- "BM_string_memcpy/160/8/4/iterations:1\n"
- "BM_string_memcpy/160/8/8/iterations:1\n"
- "BM_string_memcpy/160/8/16/iterations:1\n"
- "BM_string_memcpy/160/8/32/iterations:1\n"
- "BM_string_memcpy/160/16/1/iterations:1\n"
- "BM_string_memcpy/160/16/2/iterations:1\n"
- "BM_string_memcpy/160/16/4/iterations:1\n"
- "BM_string_memcpy/160/16/8/iterations:1\n"
- "BM_string_memcpy/160/16/16/iterations:1\n"
- "BM_string_memcpy/160/16/32/iterations:1\n"
- "BM_string_memcpy/160/32/1/iterations:1\n"
- "BM_string_memcpy/160/32/2/iterations:1\n"
- "BM_string_memcpy/160/32/4/iterations:1\n"
- "BM_string_memcpy/160/32/8/iterations:1\n"
- "BM_string_memcpy/160/32/16/iterations:1\n"
- "BM_string_memcpy/160/32/32/iterations:1\n"
- "BM_string_memcpy/176/0/0/iterations:1\n"
- "BM_string_memcpy/176/1/1/iterations:1\n"
- "BM_string_memcpy/176/1/2/iterations:1\n"
- "BM_string_memcpy/176/1/4/iterations:1\n"
- "BM_string_memcpy/176/1/8/iterations:1\n"
- "BM_string_memcpy/176/1/16/iterations:1\n"
- "BM_string_memcpy/176/1/32/iterations:1\n"
- "BM_string_memcpy/176/2/1/iterations:1\n"
- "BM_string_memcpy/176/2/2/iterations:1\n"
- "BM_string_memcpy/176/2/4/iterations:1\n"
- "BM_string_memcpy/176/2/8/iterations:1\n"
- "BM_string_memcpy/176/2/16/iterations:1\n"
- "BM_string_memcpy/176/2/32/iterations:1\n"
- "BM_string_memcpy/176/4/1/iterations:1\n"
- "BM_string_memcpy/176/4/2/iterations:1\n"
- "BM_string_memcpy/176/4/4/iterations:1\n"
- "BM_string_memcpy/176/4/8/iterations:1\n"
- "BM_string_memcpy/176/4/16/iterations:1\n"
- "BM_string_memcpy/176/4/32/iterations:1\n"
- "BM_string_memcpy/176/8/1/iterations:1\n"
- "BM_string_memcpy/176/8/2/iterations:1\n"
- "BM_string_memcpy/176/8/4/iterations:1\n"
- "BM_string_memcpy/176/8/8/iterations:1\n"
- "BM_string_memcpy/176/8/16/iterations:1\n"
- "BM_string_memcpy/176/8/32/iterations:1\n"
- "BM_string_memcpy/176/16/1/iterations:1\n"
- "BM_string_memcpy/176/16/2/iterations:1\n"
- "BM_string_memcpy/176/16/4/iterations:1\n"
- "BM_string_memcpy/176/16/8/iterations:1\n"
- "BM_string_memcpy/176/16/16/iterations:1\n"
- "BM_string_memcpy/176/16/32/iterations:1\n"
- "BM_string_memcpy/176/32/1/iterations:1\n"
- "BM_string_memcpy/176/32/2/iterations:1\n"
- "BM_string_memcpy/176/32/4/iterations:1\n"
- "BM_string_memcpy/176/32/8/iterations:1\n"
- "BM_string_memcpy/176/32/16/iterations:1\n"
- "BM_string_memcpy/176/32/32/iterations:1\n"
- "BM_string_memcpy/192/0/0/iterations:1\n"
- "BM_string_memcpy/192/1/1/iterations:1\n"
- "BM_string_memcpy/192/1/2/iterations:1\n"
- "BM_string_memcpy/192/1/4/iterations:1\n"
- "BM_string_memcpy/192/1/8/iterations:1\n"
- "BM_string_memcpy/192/1/16/iterations:1\n"
- "BM_string_memcpy/192/1/32/iterations:1\n"
- "BM_string_memcpy/192/2/1/iterations:1\n"
- "BM_string_memcpy/192/2/2/iterations:1\n"
- "BM_string_memcpy/192/2/4/iterations:1\n"
- "BM_string_memcpy/192/2/8/iterations:1\n"
- "BM_string_memcpy/192/2/16/iterations:1\n"
- "BM_string_memcpy/192/2/32/iterations:1\n"
- "BM_string_memcpy/192/4/1/iterations:1\n"
- "BM_string_memcpy/192/4/2/iterations:1\n"
- "BM_string_memcpy/192/4/4/iterations:1\n"
- "BM_string_memcpy/192/4/8/iterations:1\n"
- "BM_string_memcpy/192/4/16/iterations:1\n"
- "BM_string_memcpy/192/4/32/iterations:1\n"
- "BM_string_memcpy/192/8/1/iterations:1\n"
- "BM_string_memcpy/192/8/2/iterations:1\n"
- "BM_string_memcpy/192/8/4/iterations:1\n"
- "BM_string_memcpy/192/8/8/iterations:1\n"
- "BM_string_memcpy/192/8/16/iterations:1\n"
- "BM_string_memcpy/192/8/32/iterations:1\n"
- "BM_string_memcpy/192/16/1/iterations:1\n"
- "BM_string_memcpy/192/16/2/iterations:1\n"
- "BM_string_memcpy/192/16/4/iterations:1\n"
- "BM_string_memcpy/192/16/8/iterations:1\n"
- "BM_string_memcpy/192/16/16/iterations:1\n"
- "BM_string_memcpy/192/16/32/iterations:1\n"
- "BM_string_memcpy/192/32/1/iterations:1\n"
- "BM_string_memcpy/192/32/2/iterations:1\n"
- "BM_string_memcpy/192/32/4/iterations:1\n"
- "BM_string_memcpy/192/32/8/iterations:1\n"
- "BM_string_memcpy/192/32/16/iterations:1\n"
- "BM_string_memcpy/192/32/32/iterations:1\n"
- "BM_string_memcpy/208/0/0/iterations:1\n"
- "BM_string_memcpy/208/1/1/iterations:1\n"
- "BM_string_memcpy/208/1/2/iterations:1\n"
- "BM_string_memcpy/208/1/4/iterations:1\n"
- "BM_string_memcpy/208/1/8/iterations:1\n"
- "BM_string_memcpy/208/1/16/iterations:1\n"
- "BM_string_memcpy/208/1/32/iterations:1\n"
- "BM_string_memcpy/208/2/1/iterations:1\n"
- "BM_string_memcpy/208/2/2/iterations:1\n"
- "BM_string_memcpy/208/2/4/iterations:1\n"
- "BM_string_memcpy/208/2/8/iterations:1\n"
- "BM_string_memcpy/208/2/16/iterations:1\n"
- "BM_string_memcpy/208/2/32/iterations:1\n"
- "BM_string_memcpy/208/4/1/iterations:1\n"
- "BM_string_memcpy/208/4/2/iterations:1\n"
- "BM_string_memcpy/208/4/4/iterations:1\n"
- "BM_string_memcpy/208/4/8/iterations:1\n"
- "BM_string_memcpy/208/4/16/iterations:1\n"
- "BM_string_memcpy/208/4/32/iterations:1\n"
- "BM_string_memcpy/208/8/1/iterations:1\n"
- "BM_string_memcpy/208/8/2/iterations:1\n"
- "BM_string_memcpy/208/8/4/iterations:1\n"
- "BM_string_memcpy/208/8/8/iterations:1\n"
- "BM_string_memcpy/208/8/16/iterations:1\n"
- "BM_string_memcpy/208/8/32/iterations:1\n"
- "BM_string_memcpy/208/16/1/iterations:1\n"
- "BM_string_memcpy/208/16/2/iterations:1\n"
- "BM_string_memcpy/208/16/4/iterations:1\n"
- "BM_string_memcpy/208/16/8/iterations:1\n"
- "BM_string_memcpy/208/16/16/iterations:1\n"
- "BM_string_memcpy/208/16/32/iterations:1\n"
- "BM_string_memcpy/208/32/1/iterations:1\n"
- "BM_string_memcpy/208/32/2/iterations:1\n"
- "BM_string_memcpy/208/32/4/iterations:1\n"
- "BM_string_memcpy/208/32/8/iterations:1\n"
- "BM_string_memcpy/208/32/16/iterations:1\n"
- "BM_string_memcpy/208/32/32/iterations:1\n"
- "BM_string_memcpy/224/0/0/iterations:1\n"
- "BM_string_memcpy/224/1/1/iterations:1\n"
- "BM_string_memcpy/224/1/2/iterations:1\n"
- "BM_string_memcpy/224/1/4/iterations:1\n"
- "BM_string_memcpy/224/1/8/iterations:1\n"
- "BM_string_memcpy/224/1/16/iterations:1\n"
- "BM_string_memcpy/224/1/32/iterations:1\n"
- "BM_string_memcpy/224/2/1/iterations:1\n"
- "BM_string_memcpy/224/2/2/iterations:1\n"
- "BM_string_memcpy/224/2/4/iterations:1\n"
- "BM_string_memcpy/224/2/8/iterations:1\n"
- "BM_string_memcpy/224/2/16/iterations:1\n"
- "BM_string_memcpy/224/2/32/iterations:1\n"
- "BM_string_memcpy/224/4/1/iterations:1\n"
- "BM_string_memcpy/224/4/2/iterations:1\n"
- "BM_string_memcpy/224/4/4/iterations:1\n"
- "BM_string_memcpy/224/4/8/iterations:1\n"
- "BM_string_memcpy/224/4/16/iterations:1\n"
- "BM_string_memcpy/224/4/32/iterations:1\n"
- "BM_string_memcpy/224/8/1/iterations:1\n"
- "BM_string_memcpy/224/8/2/iterations:1\n"
- "BM_string_memcpy/224/8/4/iterations:1\n"
- "BM_string_memcpy/224/8/8/iterations:1\n"
- "BM_string_memcpy/224/8/16/iterations:1\n"
- "BM_string_memcpy/224/8/32/iterations:1\n"
- "BM_string_memcpy/224/16/1/iterations:1\n"
- "BM_string_memcpy/224/16/2/iterations:1\n"
- "BM_string_memcpy/224/16/4/iterations:1\n"
- "BM_string_memcpy/224/16/8/iterations:1\n"
- "BM_string_memcpy/224/16/16/iterations:1\n"
- "BM_string_memcpy/224/16/32/iterations:1\n"
- "BM_string_memcpy/224/32/1/iterations:1\n"
- "BM_string_memcpy/224/32/2/iterations:1\n"
- "BM_string_memcpy/224/32/4/iterations:1\n"
- "BM_string_memcpy/224/32/8/iterations:1\n"
- "BM_string_memcpy/224/32/16/iterations:1\n"
- "BM_string_memcpy/224/32/32/iterations:1\n"
- "BM_string_memcpy/240/0/0/iterations:1\n"
- "BM_string_memcpy/240/1/1/iterations:1\n"
- "BM_string_memcpy/240/1/2/iterations:1\n"
- "BM_string_memcpy/240/1/4/iterations:1\n"
- "BM_string_memcpy/240/1/8/iterations:1\n"
- "BM_string_memcpy/240/1/16/iterations:1\n"
- "BM_string_memcpy/240/1/32/iterations:1\n"
- "BM_string_memcpy/240/2/1/iterations:1\n"
- "BM_string_memcpy/240/2/2/iterations:1\n"
- "BM_string_memcpy/240/2/4/iterations:1\n"
- "BM_string_memcpy/240/2/8/iterations:1\n"
- "BM_string_memcpy/240/2/16/iterations:1\n"
- "BM_string_memcpy/240/2/32/iterations:1\n"
- "BM_string_memcpy/240/4/1/iterations:1\n"
- "BM_string_memcpy/240/4/2/iterations:1\n"
- "BM_string_memcpy/240/4/4/iterations:1\n"
- "BM_string_memcpy/240/4/8/iterations:1\n"
- "BM_string_memcpy/240/4/16/iterations:1\n"
- "BM_string_memcpy/240/4/32/iterations:1\n"
- "BM_string_memcpy/240/8/1/iterations:1\n"
- "BM_string_memcpy/240/8/2/iterations:1\n"
- "BM_string_memcpy/240/8/4/iterations:1\n"
- "BM_string_memcpy/240/8/8/iterations:1\n"
- "BM_string_memcpy/240/8/16/iterations:1\n"
- "BM_string_memcpy/240/8/32/iterations:1\n"
- "BM_string_memcpy/240/16/1/iterations:1\n"
- "BM_string_memcpy/240/16/2/iterations:1\n"
- "BM_string_memcpy/240/16/4/iterations:1\n"
- "BM_string_memcpy/240/16/8/iterations:1\n"
- "BM_string_memcpy/240/16/16/iterations:1\n"
- "BM_string_memcpy/240/16/32/iterations:1\n"
- "BM_string_memcpy/240/32/1/iterations:1\n"
- "BM_string_memcpy/240/32/2/iterations:1\n"
- "BM_string_memcpy/240/32/4/iterations:1\n"
- "BM_string_memcpy/240/32/8/iterations:1\n"
- "BM_string_memcpy/240/32/16/iterations:1\n"
- "BM_string_memcpy/240/32/32/iterations:1\n"
- "BM_string_memcpy/256/0/0/iterations:1\n"
- "BM_string_memcpy/256/1/1/iterations:1\n"
- "BM_string_memcpy/256/1/2/iterations:1\n"
- "BM_string_memcpy/256/1/4/iterations:1\n"
- "BM_string_memcpy/256/1/8/iterations:1\n"
- "BM_string_memcpy/256/1/16/iterations:1\n"
- "BM_string_memcpy/256/1/32/iterations:1\n"
- "BM_string_memcpy/256/2/1/iterations:1\n"
- "BM_string_memcpy/256/2/2/iterations:1\n"
- "BM_string_memcpy/256/2/4/iterations:1\n"
- "BM_string_memcpy/256/2/8/iterations:1\n"
- "BM_string_memcpy/256/2/16/iterations:1\n"
- "BM_string_memcpy/256/2/32/iterations:1\n"
- "BM_string_memcpy/256/4/1/iterations:1\n"
- "BM_string_memcpy/256/4/2/iterations:1\n"
- "BM_string_memcpy/256/4/4/iterations:1\n"
- "BM_string_memcpy/256/4/8/iterations:1\n"
- "BM_string_memcpy/256/4/16/iterations:1\n"
- "BM_string_memcpy/256/4/32/iterations:1\n"
- "BM_string_memcpy/256/8/1/iterations:1\n"
- "BM_string_memcpy/256/8/2/iterations:1\n"
- "BM_string_memcpy/256/8/4/iterations:1\n"
- "BM_string_memcpy/256/8/8/iterations:1\n"
- "BM_string_memcpy/256/8/16/iterations:1\n"
- "BM_string_memcpy/256/8/32/iterations:1\n"
- "BM_string_memcpy/256/16/1/iterations:1\n"
- "BM_string_memcpy/256/16/2/iterations:1\n"
- "BM_string_memcpy/256/16/4/iterations:1\n"
- "BM_string_memcpy/256/16/8/iterations:1\n"
- "BM_string_memcpy/256/16/16/iterations:1\n"
- "BM_string_memcpy/256/16/32/iterations:1\n"
- "BM_string_memcpy/256/32/1/iterations:1\n"
- "BM_string_memcpy/256/32/2/iterations:1\n"
- "BM_string_memcpy/256/32/4/iterations:1\n"
- "BM_string_memcpy/256/32/8/iterations:1\n"
- "BM_string_memcpy/256/32/16/iterations:1\n"
- "BM_string_memcpy/256/32/32/iterations:1\n"
- "BM_string_memcpy/512/0/0/iterations:1\n"
- "BM_string_memcpy/512/1/1/iterations:1\n"
- "BM_string_memcpy/512/1/2/iterations:1\n"
- "BM_string_memcpy/512/1/4/iterations:1\n"
- "BM_string_memcpy/512/1/8/iterations:1\n"
- "BM_string_memcpy/512/1/16/iterations:1\n"
- "BM_string_memcpy/512/1/32/iterations:1\n"
- "BM_string_memcpy/512/2/1/iterations:1\n"
- "BM_string_memcpy/512/2/2/iterations:1\n"
- "BM_string_memcpy/512/2/4/iterations:1\n"
- "BM_string_memcpy/512/2/8/iterations:1\n"
- "BM_string_memcpy/512/2/16/iterations:1\n"
- "BM_string_memcpy/512/2/32/iterations:1\n"
- "BM_string_memcpy/512/4/1/iterations:1\n"
- "BM_string_memcpy/512/4/2/iterations:1\n"
- "BM_string_memcpy/512/4/4/iterations:1\n"
- "BM_string_memcpy/512/4/8/iterations:1\n"
- "BM_string_memcpy/512/4/16/iterations:1\n"
- "BM_string_memcpy/512/4/32/iterations:1\n"
- "BM_string_memcpy/512/8/1/iterations:1\n"
- "BM_string_memcpy/512/8/2/iterations:1\n"
- "BM_string_memcpy/512/8/4/iterations:1\n"
- "BM_string_memcpy/512/8/8/iterations:1\n"
- "BM_string_memcpy/512/8/16/iterations:1\n"
- "BM_string_memcpy/512/8/32/iterations:1\n"
- "BM_string_memcpy/512/16/1/iterations:1\n"
- "BM_string_memcpy/512/16/2/iterations:1\n"
- "BM_string_memcpy/512/16/4/iterations:1\n"
- "BM_string_memcpy/512/16/8/iterations:1\n"
- "BM_string_memcpy/512/16/16/iterations:1\n"
- "BM_string_memcpy/512/16/32/iterations:1\n"
- "BM_string_memcpy/512/32/1/iterations:1\n"
- "BM_string_memcpy/512/32/2/iterations:1\n"
- "BM_string_memcpy/512/32/4/iterations:1\n"
- "BM_string_memcpy/512/32/8/iterations:1\n"
- "BM_string_memcpy/512/32/16/iterations:1\n"
- "BM_string_memcpy/512/32/32/iterations:1\n"
- "BM_string_memcpy/1024/0/0/iterations:1\n"
- "BM_string_memcpy/1024/1/1/iterations:1\n"
- "BM_string_memcpy/1024/1/2/iterations:1\n"
- "BM_string_memcpy/1024/1/4/iterations:1\n"
- "BM_string_memcpy/1024/1/8/iterations:1\n"
- "BM_string_memcpy/1024/1/16/iterations:1\n"
- "BM_string_memcpy/1024/1/32/iterations:1\n"
- "BM_string_memcpy/1024/2/1/iterations:1\n"
- "BM_string_memcpy/1024/2/2/iterations:1\n"
- "BM_string_memcpy/1024/2/4/iterations:1\n"
- "BM_string_memcpy/1024/2/8/iterations:1\n"
- "BM_string_memcpy/1024/2/16/iterations:1\n"
- "BM_string_memcpy/1024/2/32/iterations:1\n"
- "BM_string_memcpy/1024/4/1/iterations:1\n"
- "BM_string_memcpy/1024/4/2/iterations:1\n"
- "BM_string_memcpy/1024/4/4/iterations:1\n"
- "BM_string_memcpy/1024/4/8/iterations:1\n"
- "BM_string_memcpy/1024/4/16/iterations:1\n"
- "BM_string_memcpy/1024/4/32/iterations:1\n"
- "BM_string_memcpy/1024/8/1/iterations:1\n"
- "BM_string_memcpy/1024/8/2/iterations:1\n"
- "BM_string_memcpy/1024/8/4/iterations:1\n"
- "BM_string_memcpy/1024/8/8/iterations:1\n"
- "BM_string_memcpy/1024/8/16/iterations:1\n"
- "BM_string_memcpy/1024/8/32/iterations:1\n"
- "BM_string_memcpy/1024/16/1/iterations:1\n"
- "BM_string_memcpy/1024/16/2/iterations:1\n"
- "BM_string_memcpy/1024/16/4/iterations:1\n"
- "BM_string_memcpy/1024/16/8/iterations:1\n"
- "BM_string_memcpy/1024/16/16/iterations:1\n"
- "BM_string_memcpy/1024/16/32/iterations:1\n"
- "BM_string_memcpy/1024/32/1/iterations:1\n"
- "BM_string_memcpy/1024/32/2/iterations:1\n"
- "BM_string_memcpy/1024/32/4/iterations:1\n"
- "BM_string_memcpy/1024/32/8/iterations:1\n"
- "BM_string_memcpy/1024/32/16/iterations:1\n"
- "BM_string_memcpy/1024/32/32/iterations:1\n"
- "BM_string_memcpy/8192/0/0/iterations:1\n"
- "BM_string_memcpy/8192/1/1/iterations:1\n"
- "BM_string_memcpy/8192/1/2/iterations:1\n"
- "BM_string_memcpy/8192/1/4/iterations:1\n"
- "BM_string_memcpy/8192/1/8/iterations:1\n"
- "BM_string_memcpy/8192/1/16/iterations:1\n"
- "BM_string_memcpy/8192/1/32/iterations:1\n"
- "BM_string_memcpy/8192/2/1/iterations:1\n"
- "BM_string_memcpy/8192/2/2/iterations:1\n"
- "BM_string_memcpy/8192/2/4/iterations:1\n"
- "BM_string_memcpy/8192/2/8/iterations:1\n"
- "BM_string_memcpy/8192/2/16/iterations:1\n"
- "BM_string_memcpy/8192/2/32/iterations:1\n"
- "BM_string_memcpy/8192/4/1/iterations:1\n"
- "BM_string_memcpy/8192/4/2/iterations:1\n"
- "BM_string_memcpy/8192/4/4/iterations:1\n"
- "BM_string_memcpy/8192/4/8/iterations:1\n"
- "BM_string_memcpy/8192/4/16/iterations:1\n"
- "BM_string_memcpy/8192/4/32/iterations:1\n"
- "BM_string_memcpy/8192/8/1/iterations:1\n"
- "BM_string_memcpy/8192/8/2/iterations:1\n"
- "BM_string_memcpy/8192/8/4/iterations:1\n"
- "BM_string_memcpy/8192/8/8/iterations:1\n"
- "BM_string_memcpy/8192/8/16/iterations:1\n"
- "BM_string_memcpy/8192/8/32/iterations:1\n"
- "BM_string_memcpy/8192/16/1/iterations:1\n"
- "BM_string_memcpy/8192/16/2/iterations:1\n"
- "BM_string_memcpy/8192/16/4/iterations:1\n"
- "BM_string_memcpy/8192/16/8/iterations:1\n"
- "BM_string_memcpy/8192/16/16/iterations:1\n"
- "BM_string_memcpy/8192/16/32/iterations:1\n"
- "BM_string_memcpy/8192/32/1/iterations:1\n"
- "BM_string_memcpy/8192/32/2/iterations:1\n"
- "BM_string_memcpy/8192/32/4/iterations:1\n"
- "BM_string_memcpy/8192/32/8/iterations:1\n"
- "BM_string_memcpy/8192/32/16/iterations:1\n"
- "BM_string_memcpy/8192/32/32/iterations:1\n"
- "BM_string_memcpy/16384/0/0/iterations:1\n"
- "BM_string_memcpy/16384/1/1/iterations:1\n"
- "BM_string_memcpy/16384/1/2/iterations:1\n"
- "BM_string_memcpy/16384/1/4/iterations:1\n"
- "BM_string_memcpy/16384/1/8/iterations:1\n"
- "BM_string_memcpy/16384/1/16/iterations:1\n"
- "BM_string_memcpy/16384/1/32/iterations:1\n"
- "BM_string_memcpy/16384/2/1/iterations:1\n"
- "BM_string_memcpy/16384/2/2/iterations:1\n"
- "BM_string_memcpy/16384/2/4/iterations:1\n"
- "BM_string_memcpy/16384/2/8/iterations:1\n"
- "BM_string_memcpy/16384/2/16/iterations:1\n"
- "BM_string_memcpy/16384/2/32/iterations:1\n"
- "BM_string_memcpy/16384/4/1/iterations:1\n"
- "BM_string_memcpy/16384/4/2/iterations:1\n"
- "BM_string_memcpy/16384/4/4/iterations:1\n"
- "BM_string_memcpy/16384/4/8/iterations:1\n"
- "BM_string_memcpy/16384/4/16/iterations:1\n"
- "BM_string_memcpy/16384/4/32/iterations:1\n"
- "BM_string_memcpy/16384/8/1/iterations:1\n"
- "BM_string_memcpy/16384/8/2/iterations:1\n"
- "BM_string_memcpy/16384/8/4/iterations:1\n"
- "BM_string_memcpy/16384/8/8/iterations:1\n"
- "BM_string_memcpy/16384/8/16/iterations:1\n"
- "BM_string_memcpy/16384/8/32/iterations:1\n"
- "BM_string_memcpy/16384/16/1/iterations:1\n"
- "BM_string_memcpy/16384/16/2/iterations:1\n"
- "BM_string_memcpy/16384/16/4/iterations:1\n"
- "BM_string_memcpy/16384/16/8/iterations:1\n"
- "BM_string_memcpy/16384/16/16/iterations:1\n"
- "BM_string_memcpy/16384/16/32/iterations:1\n"
- "BM_string_memcpy/16384/32/1/iterations:1\n"
- "BM_string_memcpy/16384/32/2/iterations:1\n"
- "BM_string_memcpy/16384/32/4/iterations:1\n"
- "BM_string_memcpy/16384/32/8/iterations:1\n"
- "BM_string_memcpy/16384/32/16/iterations:1\n"
- "BM_string_memcpy/16384/32/32/iterations:1\n"
- "BM_string_memcpy/32768/0/0/iterations:1\n"
- "BM_string_memcpy/32768/1/1/iterations:1\n"
- "BM_string_memcpy/32768/1/2/iterations:1\n"
- "BM_string_memcpy/32768/1/4/iterations:1\n"
- "BM_string_memcpy/32768/1/8/iterations:1\n"
- "BM_string_memcpy/32768/1/16/iterations:1\n"
- "BM_string_memcpy/32768/1/32/iterations:1\n"
- "BM_string_memcpy/32768/2/1/iterations:1\n"
- "BM_string_memcpy/32768/2/2/iterations:1\n"
- "BM_string_memcpy/32768/2/4/iterations:1\n"
- "BM_string_memcpy/32768/2/8/iterations:1\n"
- "BM_string_memcpy/32768/2/16/iterations:1\n"
- "BM_string_memcpy/32768/2/32/iterations:1\n"
- "BM_string_memcpy/32768/4/1/iterations:1\n"
- "BM_string_memcpy/32768/4/2/iterations:1\n"
- "BM_string_memcpy/32768/4/4/iterations:1\n"
- "BM_string_memcpy/32768/4/8/iterations:1\n"
- "BM_string_memcpy/32768/4/16/iterations:1\n"
- "BM_string_memcpy/32768/4/32/iterations:1\n"
- "BM_string_memcpy/32768/8/1/iterations:1\n"
- "BM_string_memcpy/32768/8/2/iterations:1\n"
- "BM_string_memcpy/32768/8/4/iterations:1\n"
- "BM_string_memcpy/32768/8/8/iterations:1\n"
- "BM_string_memcpy/32768/8/16/iterations:1\n"
- "BM_string_memcpy/32768/8/32/iterations:1\n"
- "BM_string_memcpy/32768/16/1/iterations:1\n"
- "BM_string_memcpy/32768/16/2/iterations:1\n"
- "BM_string_memcpy/32768/16/4/iterations:1\n"
- "BM_string_memcpy/32768/16/8/iterations:1\n"
- "BM_string_memcpy/32768/16/16/iterations:1\n"
- "BM_string_memcpy/32768/16/32/iterations:1\n"
- "BM_string_memcpy/32768/32/1/iterations:1\n"
- "BM_string_memcpy/32768/32/2/iterations:1\n"
- "BM_string_memcpy/32768/32/4/iterations:1\n"
- "BM_string_memcpy/32768/32/8/iterations:1\n"
- "BM_string_memcpy/32768/32/16/iterations:1\n"
- "BM_string_memcpy/32768/32/32/iterations:1\n"
- "BM_string_memcpy/65536/0/0/iterations:1\n"
- "BM_string_memcpy/65536/1/1/iterations:1\n"
- "BM_string_memcpy/65536/1/2/iterations:1\n"
- "BM_string_memcpy/65536/1/4/iterations:1\n"
- "BM_string_memcpy/65536/1/8/iterations:1\n"
- "BM_string_memcpy/65536/1/16/iterations:1\n"
- "BM_string_memcpy/65536/1/32/iterations:1\n"
- "BM_string_memcpy/65536/2/1/iterations:1\n"
- "BM_string_memcpy/65536/2/2/iterations:1\n"
- "BM_string_memcpy/65536/2/4/iterations:1\n"
- "BM_string_memcpy/65536/2/8/iterations:1\n"
- "BM_string_memcpy/65536/2/16/iterations:1\n"
- "BM_string_memcpy/65536/2/32/iterations:1\n"
- "BM_string_memcpy/65536/4/1/iterations:1\n"
- "BM_string_memcpy/65536/4/2/iterations:1\n"
- "BM_string_memcpy/65536/4/4/iterations:1\n"
- "BM_string_memcpy/65536/4/8/iterations:1\n"
- "BM_string_memcpy/65536/4/16/iterations:1\n"
- "BM_string_memcpy/65536/4/32/iterations:1\n"
- "BM_string_memcpy/65536/8/1/iterations:1\n"
- "BM_string_memcpy/65536/8/2/iterations:1\n"
- "BM_string_memcpy/65536/8/4/iterations:1\n"
- "BM_string_memcpy/65536/8/8/iterations:1\n"
- "BM_string_memcpy/65536/8/16/iterations:1\n"
- "BM_string_memcpy/65536/8/32/iterations:1\n"
- "BM_string_memcpy/65536/16/1/iterations:1\n"
- "BM_string_memcpy/65536/16/2/iterations:1\n"
- "BM_string_memcpy/65536/16/4/iterations:1\n"
- "BM_string_memcpy/65536/16/8/iterations:1\n"
- "BM_string_memcpy/65536/16/16/iterations:1\n"
- "BM_string_memcpy/65536/16/32/iterations:1\n"
- "BM_string_memcpy/65536/32/1/iterations:1\n"
- "BM_string_memcpy/65536/32/2/iterations:1\n"
- "BM_string_memcpy/65536/32/4/iterations:1\n"
- "BM_string_memcpy/65536/32/8/iterations:1\n"
- "BM_string_memcpy/65536/32/16/iterations:1\n"
- "BM_string_memcpy/65536/32/32/iterations:1\n"
- "BM_string_memcpy/131072/0/0/iterations:1\n"
- "BM_string_memcpy/131072/1/1/iterations:1\n"
- "BM_string_memcpy/131072/1/2/iterations:1\n"
- "BM_string_memcpy/131072/1/4/iterations:1\n"
- "BM_string_memcpy/131072/1/8/iterations:1\n"
- "BM_string_memcpy/131072/1/16/iterations:1\n"
- "BM_string_memcpy/131072/1/32/iterations:1\n"
- "BM_string_memcpy/131072/2/1/iterations:1\n"
- "BM_string_memcpy/131072/2/2/iterations:1\n"
- "BM_string_memcpy/131072/2/4/iterations:1\n"
- "BM_string_memcpy/131072/2/8/iterations:1\n"
- "BM_string_memcpy/131072/2/16/iterations:1\n"
- "BM_string_memcpy/131072/2/32/iterations:1\n"
- "BM_string_memcpy/131072/4/1/iterations:1\n"
- "BM_string_memcpy/131072/4/2/iterations:1\n"
- "BM_string_memcpy/131072/4/4/iterations:1\n"
- "BM_string_memcpy/131072/4/8/iterations:1\n"
- "BM_string_memcpy/131072/4/16/iterations:1\n"
- "BM_string_memcpy/131072/4/32/iterations:1\n"
- "BM_string_memcpy/131072/8/1/iterations:1\n"
- "BM_string_memcpy/131072/8/2/iterations:1\n"
- "BM_string_memcpy/131072/8/4/iterations:1\n"
- "BM_string_memcpy/131072/8/8/iterations:1\n"
- "BM_string_memcpy/131072/8/16/iterations:1\n"
- "BM_string_memcpy/131072/8/32/iterations:1\n"
- "BM_string_memcpy/131072/16/1/iterations:1\n"
- "BM_string_memcpy/131072/16/2/iterations:1\n"
- "BM_string_memcpy/131072/16/4/iterations:1\n"
- "BM_string_memcpy/131072/16/8/iterations:1\n"
- "BM_string_memcpy/131072/16/16/iterations:1\n"
- "BM_string_memcpy/131072/16/32/iterations:1\n"
- "BM_string_memcpy/131072/32/1/iterations:1\n"
- "BM_string_memcpy/131072/32/2/iterations:1\n"
- "BM_string_memcpy/131072/32/4/iterations:1\n"
- "BM_string_memcpy/131072/32/8/iterations:1\n"
- "BM_string_memcpy/131072/32/16/iterations:1\n"
- "BM_string_memcpy/131072/32/32/iterations:1\n"
- "BM_string_memcpy/262144/0/0/iterations:1\n"
- "BM_string_memcpy/262144/1/1/iterations:1\n"
- "BM_string_memcpy/262144/1/2/iterations:1\n"
- "BM_string_memcpy/262144/1/4/iterations:1\n"
- "BM_string_memcpy/262144/1/8/iterations:1\n"
- "BM_string_memcpy/262144/1/16/iterations:1\n"
- "BM_string_memcpy/262144/1/32/iterations:1\n"
- "BM_string_memcpy/262144/2/1/iterations:1\n"
- "BM_string_memcpy/262144/2/2/iterations:1\n"
- "BM_string_memcpy/262144/2/4/iterations:1\n"
- "BM_string_memcpy/262144/2/8/iterations:1\n"
- "BM_string_memcpy/262144/2/16/iterations:1\n"
- "BM_string_memcpy/262144/2/32/iterations:1\n"
- "BM_string_memcpy/262144/4/1/iterations:1\n"
- "BM_string_memcpy/262144/4/2/iterations:1\n"
- "BM_string_memcpy/262144/4/4/iterations:1\n"
- "BM_string_memcpy/262144/4/8/iterations:1\n"
- "BM_string_memcpy/262144/4/16/iterations:1\n"
- "BM_string_memcpy/262144/4/32/iterations:1\n"
- "BM_string_memcpy/262144/8/1/iterations:1\n"
- "BM_string_memcpy/262144/8/2/iterations:1\n"
- "BM_string_memcpy/262144/8/4/iterations:1\n"
- "BM_string_memcpy/262144/8/8/iterations:1\n"
- "BM_string_memcpy/262144/8/16/iterations:1\n"
- "BM_string_memcpy/262144/8/32/iterations:1\n"
- "BM_string_memcpy/262144/16/1/iterations:1\n"
- "BM_string_memcpy/262144/16/2/iterations:1\n"
- "BM_string_memcpy/262144/16/4/iterations:1\n"
- "BM_string_memcpy/262144/16/8/iterations:1\n"
- "BM_string_memcpy/262144/16/16/iterations:1\n"
- "BM_string_memcpy/262144/16/32/iterations:1\n"
- "BM_string_memcpy/262144/32/1/iterations:1\n"
- "BM_string_memcpy/262144/32/2/iterations:1\n"
- "BM_string_memcpy/262144/32/4/iterations:1\n"
- "BM_string_memcpy/262144/32/8/iterations:1\n"
- "BM_string_memcpy/262144/32/16/iterations:1\n"
- "BM_string_memcpy/262144/32/32/iterations:1\n"
- "BM_string_memcpy/524288/0/0/iterations:1\n"
- "BM_string_memcpy/524288/1/1/iterations:1\n"
- "BM_string_memcpy/524288/1/2/iterations:1\n"
- "BM_string_memcpy/524288/1/4/iterations:1\n"
- "BM_string_memcpy/524288/1/8/iterations:1\n"
- "BM_string_memcpy/524288/1/16/iterations:1\n"
- "BM_string_memcpy/524288/1/32/iterations:1\n"
- "BM_string_memcpy/524288/2/1/iterations:1\n"
- "BM_string_memcpy/524288/2/2/iterations:1\n"
- "BM_string_memcpy/524288/2/4/iterations:1\n"
- "BM_string_memcpy/524288/2/8/iterations:1\n"
- "BM_string_memcpy/524288/2/16/iterations:1\n"
- "BM_string_memcpy/524288/2/32/iterations:1\n"
- "BM_string_memcpy/524288/4/1/iterations:1\n"
- "BM_string_memcpy/524288/4/2/iterations:1\n"
- "BM_string_memcpy/524288/4/4/iterations:1\n"
- "BM_string_memcpy/524288/4/8/iterations:1\n"
- "BM_string_memcpy/524288/4/16/iterations:1\n"
- "BM_string_memcpy/524288/4/32/iterations:1\n"
- "BM_string_memcpy/524288/8/1/iterations:1\n"
- "BM_string_memcpy/524288/8/2/iterations:1\n"
- "BM_string_memcpy/524288/8/4/iterations:1\n"
- "BM_string_memcpy/524288/8/8/iterations:1\n"
- "BM_string_memcpy/524288/8/16/iterations:1\n"
- "BM_string_memcpy/524288/8/32/iterations:1\n"
- "BM_string_memcpy/524288/16/1/iterations:1\n"
- "BM_string_memcpy/524288/16/2/iterations:1\n"
- "BM_string_memcpy/524288/16/4/iterations:1\n"
- "BM_string_memcpy/524288/16/8/iterations:1\n"
- "BM_string_memcpy/524288/16/16/iterations:1\n"
- "BM_string_memcpy/524288/16/32/iterations:1\n"
- "BM_string_memcpy/524288/32/1/iterations:1\n"
- "BM_string_memcpy/524288/32/2/iterations:1\n"
- "BM_string_memcpy/524288/32/4/iterations:1\n"
- "BM_string_memcpy/524288/32/8/iterations:1\n"
- "BM_string_memcpy/524288/32/16/iterations:1\n"
- "BM_string_memcpy/524288/32/32/iterations:1\n"
- "BM_string_memcpy/1048576/0/0/iterations:1\n"
- "BM_string_memcpy/1048576/1/1/iterations:1\n"
- "BM_string_memcpy/1048576/1/2/iterations:1\n"
- "BM_string_memcpy/1048576/1/4/iterations:1\n"
- "BM_string_memcpy/1048576/1/8/iterations:1\n"
- "BM_string_memcpy/1048576/1/16/iterations:1\n"
- "BM_string_memcpy/1048576/1/32/iterations:1\n"
- "BM_string_memcpy/1048576/2/1/iterations:1\n"
- "BM_string_memcpy/1048576/2/2/iterations:1\n"
- "BM_string_memcpy/1048576/2/4/iterations:1\n"
- "BM_string_memcpy/1048576/2/8/iterations:1\n"
- "BM_string_memcpy/1048576/2/16/iterations:1\n"
- "BM_string_memcpy/1048576/2/32/iterations:1\n"
- "BM_string_memcpy/1048576/4/1/iterations:1\n"
- "BM_string_memcpy/1048576/4/2/iterations:1\n"
- "BM_string_memcpy/1048576/4/4/iterations:1\n"
- "BM_string_memcpy/1048576/4/8/iterations:1\n"
- "BM_string_memcpy/1048576/4/16/iterations:1\n"
- "BM_string_memcpy/1048576/4/32/iterations:1\n"
- "BM_string_memcpy/1048576/8/1/iterations:1\n"
- "BM_string_memcpy/1048576/8/2/iterations:1\n"
- "BM_string_memcpy/1048576/8/4/iterations:1\n"
- "BM_string_memcpy/1048576/8/8/iterations:1\n"
- "BM_string_memcpy/1048576/8/16/iterations:1\n"
- "BM_string_memcpy/1048576/8/32/iterations:1\n"
- "BM_string_memcpy/1048576/16/1/iterations:1\n"
- "BM_string_memcpy/1048576/16/2/iterations:1\n"
- "BM_string_memcpy/1048576/16/4/iterations:1\n"
- "BM_string_memcpy/1048576/16/8/iterations:1\n"
- "BM_string_memcpy/1048576/16/16/iterations:1\n"
- "BM_string_memcpy/1048576/16/32/iterations:1\n"
- "BM_string_memcpy/1048576/32/1/iterations:1\n"
- "BM_string_memcpy/1048576/32/2/iterations:1\n"
- "BM_string_memcpy/1048576/32/4/iterations:1\n"
- "BM_string_memcpy/1048576/32/8/iterations:1\n"
- "BM_string_memcpy/1048576/32/16/iterations:1\n"
- "BM_string_memcpy/1048576/32/32/iterations:1\n"
- "BM_string_memcpy/2097152/0/0/iterations:1\n"
- "BM_string_memcpy/2097152/1/1/iterations:1\n"
- "BM_string_memcpy/2097152/1/2/iterations:1\n"
- "BM_string_memcpy/2097152/1/4/iterations:1\n"
- "BM_string_memcpy/2097152/1/8/iterations:1\n"
- "BM_string_memcpy/2097152/1/16/iterations:1\n"
- "BM_string_memcpy/2097152/1/32/iterations:1\n"
- "BM_string_memcpy/2097152/2/1/iterations:1\n"
- "BM_string_memcpy/2097152/2/2/iterations:1\n"
- "BM_string_memcpy/2097152/2/4/iterations:1\n"
- "BM_string_memcpy/2097152/2/8/iterations:1\n"
- "BM_string_memcpy/2097152/2/16/iterations:1\n"
- "BM_string_memcpy/2097152/2/32/iterations:1\n"
- "BM_string_memcpy/2097152/4/1/iterations:1\n"
- "BM_string_memcpy/2097152/4/2/iterations:1\n"
- "BM_string_memcpy/2097152/4/4/iterations:1\n"
- "BM_string_memcpy/2097152/4/8/iterations:1\n"
- "BM_string_memcpy/2097152/4/16/iterations:1\n"
- "BM_string_memcpy/2097152/4/32/iterations:1\n"
- "BM_string_memcpy/2097152/8/1/iterations:1\n"
- "BM_string_memcpy/2097152/8/2/iterations:1\n"
- "BM_string_memcpy/2097152/8/4/iterations:1\n"
- "BM_string_memcpy/2097152/8/8/iterations:1\n"
- "BM_string_memcpy/2097152/8/16/iterations:1\n"
- "BM_string_memcpy/2097152/8/32/iterations:1\n"
- "BM_string_memcpy/2097152/16/1/iterations:1\n"
- "BM_string_memcpy/2097152/16/2/iterations:1\n"
- "BM_string_memcpy/2097152/16/4/iterations:1\n"
- "BM_string_memcpy/2097152/16/8/iterations:1\n"
- "BM_string_memcpy/2097152/16/16/iterations:1\n"
- "BM_string_memcpy/2097152/16/32/iterations:1\n"
- "BM_string_memcpy/2097152/32/1/iterations:1\n"
- "BM_string_memcpy/2097152/32/2/iterations:1\n"
- "BM_string_memcpy/2097152/32/4/iterations:1\n"
- "BM_string_memcpy/2097152/32/8/iterations:1\n"
- "BM_string_memcpy/2097152/32/16/iterations:1\n"
- "BM_string_memcpy/2097152/32/32/iterations:1\n";
+ "BM_string_strcpy/8/0/0/iterations:1\n"
+ "BM_string_strcpy/16/0/0/iterations:1\n"
+ "BM_string_strcpy/32/0/0/iterations:1\n"
+ "BM_string_strcpy/64/0/0/iterations:1\n"
+ "BM_string_strcpy/512/0/0/iterations:1\n"
+ "BM_string_strcpy/1024/0/0/iterations:1\n"
+ "BM_string_strcpy/8192/0/0/iterations:1\n"
+ "BM_string_strcpy/16384/0/0/iterations:1\n"
+ "BM_string_strcpy/32768/0/0/iterations:1\n"
+ "BM_string_strcpy/65536/0/0/iterations:1\n"
+ "BM_string_strcpy/131072/0/0/iterations:1\n"
+ "BM_string_memcpy/1/0/0/iterations:1\n"
+ "BM_string_memcpy/2/0/0/iterations:1\n"
+ "BM_string_memcpy/3/0/0/iterations:1\n"
+ "BM_string_memcpy/4/0/0/iterations:1\n"
+ "BM_string_memcpy/5/0/0/iterations:1\n"
+ "BM_string_memcpy/6/0/0/iterations:1\n"
+ "BM_string_memcpy/7/0/0/iterations:1\n"
+ "BM_string_memcpy/8/0/0/iterations:1\n"
+ "BM_string_memcpy/9/0/0/iterations:1\n"
+ "BM_string_memcpy/10/0/0/iterations:1\n"
+ "BM_string_memcpy/11/0/0/iterations:1\n"
+ "BM_string_memcpy/12/0/0/iterations:1\n"
+ "BM_string_memcpy/13/0/0/iterations:1\n"
+ "BM_string_memcpy/14/0/0/iterations:1\n"
+ "BM_string_memcpy/15/0/0/iterations:1\n"
+ "BM_string_memcpy/16/0/0/iterations:1\n"
+ "BM_string_memcpy/24/0/0/iterations:1\n"
+ "BM_string_memcpy/32/0/0/iterations:1\n"
+ "BM_string_memcpy/40/0/0/iterations:1\n"
+ "BM_string_memcpy/48/0/0/iterations:1\n"
+ "BM_string_memcpy/56/0/0/iterations:1\n"
+ "BM_string_memcpy/64/0/0/iterations:1\n"
+ "BM_string_memcpy/72/0/0/iterations:1\n"
+ "BM_string_memcpy/80/0/0/iterations:1\n"
+ "BM_string_memcpy/88/0/0/iterations:1\n"
+ "BM_string_memcpy/96/0/0/iterations:1\n"
+ "BM_string_memcpy/104/0/0/iterations:1\n"
+ "BM_string_memcpy/112/0/0/iterations:1\n"
+ "BM_string_memcpy/120/0/0/iterations:1\n"
+ "BM_string_memcpy/128/0/0/iterations:1\n"
+ "BM_string_memcpy/136/0/0/iterations:1\n"
+ "BM_string_memcpy/144/0/0/iterations:1\n"
+ "BM_string_memcpy/160/0/0/iterations:1\n"
+ "BM_string_memcpy/176/0/0/iterations:1\n"
+ "BM_string_memcpy/192/0/0/iterations:1\n"
+ "BM_string_memcpy/208/0/0/iterations:1\n"
+ "BM_string_memcpy/224/0/0/iterations:1\n"
+ "BM_string_memcpy/240/0/0/iterations:1\n"
+ "BM_string_memcpy/256/0/0/iterations:1\n"
+ "BM_string_strcpy/512/0/0/iterations:1\n"
+ "BM_string_strcpy/1024/0/0/iterations:1\n"
+ "BM_string_strcpy/8192/0/0/iterations:1\n"
+ "BM_string_strcpy/16384/0/0/iterations:1\n"
+ "BM_string_strcpy/32768/0/0/iterations:1\n"
+ "BM_string_strcpy/65536/0/0/iterations:1\n"
+ "BM_string_strcpy/131072/0/0/iterations:1\n"
+ "BM_string_memcpy/262144/0/0/iterations:1\n"
+ "BM_string_memcpy/524288/0/0/iterations:1\n"
+ "BM_string_memcpy/1048576/0/0/iterations:1\n"
+ "BM_string_memcpy/2097152/0/0/iterations:1\n"
+ "BM_string_strcpy/1/0/0/iterations:1\n"
+ "BM_string_strcpy/2/0/0/iterations:1\n"
+ "BM_string_strcpy/3/0/0/iterations:1\n"
+ "BM_string_strcpy/4/0/0/iterations:1\n"
+ "BM_string_strcpy/5/0/0/iterations:1\n"
+ "BM_string_strcpy/6/0/0/iterations:1\n"
+ "BM_string_strcpy/7/0/0/iterations:1\n"
+ "BM_string_strcpy/8/0/0/iterations:1\n"
+ "BM_string_strcpy/9/0/0/iterations:1\n"
+ "BM_string_strcpy/10/0/0/iterations:1\n"
+ "BM_string_strcpy/11/0/0/iterations:1\n"
+ "BM_string_strcpy/12/0/0/iterations:1\n"
+ "BM_string_strcpy/13/0/0/iterations:1\n"
+ "BM_string_strcpy/14/0/0/iterations:1\n"
+ "BM_string_strcpy/15/0/0/iterations:1\n"
+ "BM_string_strcpy/16/0/0/iterations:1\n"
+ "BM_string_strcpy/24/0/0/iterations:1\n"
+ "BM_string_strcpy/32/0/0/iterations:1\n"
+ "BM_string_strcpy/40/0/0/iterations:1\n"
+ "BM_string_strcpy/48/0/0/iterations:1\n"
+ "BM_string_strcpy/56/0/0/iterations:1\n"
+ "BM_string_strcpy/64/0/0/iterations:1\n"
+ "BM_string_strcpy/72/0/0/iterations:1\n"
+ "BM_string_strcpy/80/0/0/iterations:1\n"
+ "BM_string_strcpy/88/0/0/iterations:1\n"
+ "BM_string_strcpy/96/0/0/iterations:1\n"
+ "BM_string_strcpy/104/0/0/iterations:1\n"
+ "BM_string_strcpy/112/0/0/iterations:1\n"
+ "BM_string_strcpy/120/0/0/iterations:1\n"
+ "BM_string_strcpy/128/0/0/iterations:1\n"
+ "BM_string_strcpy/136/0/0/iterations:1\n"
+ "BM_string_strcpy/144/0/0/iterations:1\n"
+ "BM_string_strcpy/160/0/0/iterations:1\n"
+ "BM_string_strcpy/176/0/0/iterations:1\n"
+ "BM_string_strcpy/192/0/0/iterations:1\n"
+ "BM_string_strcpy/208/0/0/iterations:1\n"
+ "BM_string_strcpy/224/0/0/iterations:1\n"
+ "BM_string_strcpy/240/0/0/iterations:1\n"
+ "BM_string_strcpy/256/0/0/iterations:1\n"
+ "BM_string_strcpy/512/0/0/iterations:1\n"
+ "BM_string_strcpy/1024/0/0/iterations:1\n"
+ "BM_string_strcpy/8192/0/0/iterations:1\n"
+ "BM_string_strcpy/16384/0/0/iterations:1\n"
+ "BM_string_strcpy/32768/0/0/iterations:1\n"
+ "BM_string_strcpy/65536/0/0/iterations:1\n"
+ "BM_string_strcpy/131072/0/0/iterations:1\n"
+ "BM_string_strcpy/262144/0/0/iterations:1\n"
+ "BM_string_strcpy/524288/0/0/iterations:1\n"
+ "BM_string_strcpy/1048576/0/0/iterations:1\n"
+ "BM_string_strcpy/2097152/0/0/iterations:1\n"
+ "BM_string_memcpy/1/0/0/iterations:1\n"
+ "BM_string_memcpy/1/1/1/iterations:1\n"
+ "BM_string_memcpy/1/1/2/iterations:1\n"
+ "BM_string_memcpy/1/1/4/iterations:1\n"
+ "BM_string_memcpy/1/1/8/iterations:1\n"
+ "BM_string_memcpy/1/1/16/iterations:1\n"
+ "BM_string_memcpy/1/1/32/iterations:1\n"
+ "BM_string_memcpy/1/2/1/iterations:1\n"
+ "BM_string_memcpy/1/2/2/iterations:1\n"
+ "BM_string_memcpy/1/2/4/iterations:1\n"
+ "BM_string_memcpy/1/2/8/iterations:1\n"
+ "BM_string_memcpy/1/2/16/iterations:1\n"
+ "BM_string_memcpy/1/2/32/iterations:1\n"
+ "BM_string_memcpy/1/4/1/iterations:1\n"
+ "BM_string_memcpy/1/4/2/iterations:1\n"
+ "BM_string_memcpy/1/4/4/iterations:1\n"
+ "BM_string_memcpy/1/4/8/iterations:1\n"
+ "BM_string_memcpy/1/4/16/iterations:1\n"
+ "BM_string_memcpy/1/4/32/iterations:1\n"
+ "BM_string_memcpy/1/8/1/iterations:1\n"
+ "BM_string_memcpy/1/8/2/iterations:1\n"
+ "BM_string_memcpy/1/8/4/iterations:1\n"
+ "BM_string_memcpy/1/8/8/iterations:1\n"
+ "BM_string_memcpy/1/8/16/iterations:1\n"
+ "BM_string_memcpy/1/8/32/iterations:1\n"
+ "BM_string_memcpy/1/16/1/iterations:1\n"
+ "BM_string_memcpy/1/16/2/iterations:1\n"
+ "BM_string_memcpy/1/16/4/iterations:1\n"
+ "BM_string_memcpy/1/16/8/iterations:1\n"
+ "BM_string_memcpy/1/16/16/iterations:1\n"
+ "BM_string_memcpy/1/16/32/iterations:1\n"
+ "BM_string_memcpy/1/32/1/iterations:1\n"
+ "BM_string_memcpy/1/32/2/iterations:1\n"
+ "BM_string_memcpy/1/32/4/iterations:1\n"
+ "BM_string_memcpy/1/32/8/iterations:1\n"
+ "BM_string_memcpy/1/32/16/iterations:1\n"
+ "BM_string_memcpy/1/32/32/iterations:1\n"
+ "BM_string_memcpy/2/0/0/iterations:1\n"
+ "BM_string_memcpy/2/1/1/iterations:1\n"
+ "BM_string_memcpy/2/1/2/iterations:1\n"
+ "BM_string_memcpy/2/1/4/iterations:1\n"
+ "BM_string_memcpy/2/1/8/iterations:1\n"
+ "BM_string_memcpy/2/1/16/iterations:1\n"
+ "BM_string_memcpy/2/1/32/iterations:1\n"
+ "BM_string_memcpy/2/2/1/iterations:1\n"
+ "BM_string_memcpy/2/2/2/iterations:1\n"
+ "BM_string_memcpy/2/2/4/iterations:1\n"
+ "BM_string_memcpy/2/2/8/iterations:1\n"
+ "BM_string_memcpy/2/2/16/iterations:1\n"
+ "BM_string_memcpy/2/2/32/iterations:1\n"
+ "BM_string_memcpy/2/4/1/iterations:1\n"
+ "BM_string_memcpy/2/4/2/iterations:1\n"
+ "BM_string_memcpy/2/4/4/iterations:1\n"
+ "BM_string_memcpy/2/4/8/iterations:1\n"
+ "BM_string_memcpy/2/4/16/iterations:1\n"
+ "BM_string_memcpy/2/4/32/iterations:1\n"
+ "BM_string_memcpy/2/8/1/iterations:1\n"
+ "BM_string_memcpy/2/8/2/iterations:1\n"
+ "BM_string_memcpy/2/8/4/iterations:1\n"
+ "BM_string_memcpy/2/8/8/iterations:1\n"
+ "BM_string_memcpy/2/8/16/iterations:1\n"
+ "BM_string_memcpy/2/8/32/iterations:1\n"
+ "BM_string_memcpy/2/16/1/iterations:1\n"
+ "BM_string_memcpy/2/16/2/iterations:1\n"
+ "BM_string_memcpy/2/16/4/iterations:1\n"
+ "BM_string_memcpy/2/16/8/iterations:1\n"
+ "BM_string_memcpy/2/16/16/iterations:1\n"
+ "BM_string_memcpy/2/16/32/iterations:1\n"
+ "BM_string_memcpy/2/32/1/iterations:1\n"
+ "BM_string_memcpy/2/32/2/iterations:1\n"
+ "BM_string_memcpy/2/32/4/iterations:1\n"
+ "BM_string_memcpy/2/32/8/iterations:1\n"
+ "BM_string_memcpy/2/32/16/iterations:1\n"
+ "BM_string_memcpy/2/32/32/iterations:1\n"
+ "BM_string_memcpy/3/0/0/iterations:1\n"
+ "BM_string_memcpy/3/1/1/iterations:1\n"
+ "BM_string_memcpy/3/1/2/iterations:1\n"
+ "BM_string_memcpy/3/1/4/iterations:1\n"
+ "BM_string_memcpy/3/1/8/iterations:1\n"
+ "BM_string_memcpy/3/1/16/iterations:1\n"
+ "BM_string_memcpy/3/1/32/iterations:1\n"
+ "BM_string_memcpy/3/2/1/iterations:1\n"
+ "BM_string_memcpy/3/2/2/iterations:1\n"
+ "BM_string_memcpy/3/2/4/iterations:1\n"
+ "BM_string_memcpy/3/2/8/iterations:1\n"
+ "BM_string_memcpy/3/2/16/iterations:1\n"
+ "BM_string_memcpy/3/2/32/iterations:1\n"
+ "BM_string_memcpy/3/4/1/iterations:1\n"
+ "BM_string_memcpy/3/4/2/iterations:1\n"
+ "BM_string_memcpy/3/4/4/iterations:1\n"
+ "BM_string_memcpy/3/4/8/iterations:1\n"
+ "BM_string_memcpy/3/4/16/iterations:1\n"
+ "BM_string_memcpy/3/4/32/iterations:1\n"
+ "BM_string_memcpy/3/8/1/iterations:1\n"
+ "BM_string_memcpy/3/8/2/iterations:1\n"
+ "BM_string_memcpy/3/8/4/iterations:1\n"
+ "BM_string_memcpy/3/8/8/iterations:1\n"
+ "BM_string_memcpy/3/8/16/iterations:1\n"
+ "BM_string_memcpy/3/8/32/iterations:1\n"
+ "BM_string_memcpy/3/16/1/iterations:1\n"
+ "BM_string_memcpy/3/16/2/iterations:1\n"
+ "BM_string_memcpy/3/16/4/iterations:1\n"
+ "BM_string_memcpy/3/16/8/iterations:1\n"
+ "BM_string_memcpy/3/16/16/iterations:1\n"
+ "BM_string_memcpy/3/16/32/iterations:1\n"
+ "BM_string_memcpy/3/32/1/iterations:1\n"
+ "BM_string_memcpy/3/32/2/iterations:1\n"
+ "BM_string_memcpy/3/32/4/iterations:1\n"
+ "BM_string_memcpy/3/32/8/iterations:1\n"
+ "BM_string_memcpy/3/32/16/iterations:1\n"
+ "BM_string_memcpy/3/32/32/iterations:1\n"
+ "BM_string_memcpy/4/0/0/iterations:1\n"
+ "BM_string_memcpy/4/1/1/iterations:1\n"
+ "BM_string_memcpy/4/1/2/iterations:1\n"
+ "BM_string_memcpy/4/1/4/iterations:1\n"
+ "BM_string_memcpy/4/1/8/iterations:1\n"
+ "BM_string_memcpy/4/1/16/iterations:1\n"
+ "BM_string_memcpy/4/1/32/iterations:1\n"
+ "BM_string_memcpy/4/2/1/iterations:1\n"
+ "BM_string_memcpy/4/2/2/iterations:1\n"
+ "BM_string_memcpy/4/2/4/iterations:1\n"
+ "BM_string_memcpy/4/2/8/iterations:1\n"
+ "BM_string_memcpy/4/2/16/iterations:1\n"
+ "BM_string_memcpy/4/2/32/iterations:1\n"
+ "BM_string_memcpy/4/4/1/iterations:1\n"
+ "BM_string_memcpy/4/4/2/iterations:1\n"
+ "BM_string_memcpy/4/4/4/iterations:1\n"
+ "BM_string_memcpy/4/4/8/iterations:1\n"
+ "BM_string_memcpy/4/4/16/iterations:1\n"
+ "BM_string_memcpy/4/4/32/iterations:1\n"
+ "BM_string_memcpy/4/8/1/iterations:1\n"
+ "BM_string_memcpy/4/8/2/iterations:1\n"
+ "BM_string_memcpy/4/8/4/iterations:1\n"
+ "BM_string_memcpy/4/8/8/iterations:1\n"
+ "BM_string_memcpy/4/8/16/iterations:1\n"
+ "BM_string_memcpy/4/8/32/iterations:1\n"
+ "BM_string_memcpy/4/16/1/iterations:1\n"
+ "BM_string_memcpy/4/16/2/iterations:1\n"
+ "BM_string_memcpy/4/16/4/iterations:1\n"
+ "BM_string_memcpy/4/16/8/iterations:1\n"
+ "BM_string_memcpy/4/16/16/iterations:1\n"
+ "BM_string_memcpy/4/16/32/iterations:1\n"
+ "BM_string_memcpy/4/32/1/iterations:1\n"
+ "BM_string_memcpy/4/32/2/iterations:1\n"
+ "BM_string_memcpy/4/32/4/iterations:1\n"
+ "BM_string_memcpy/4/32/8/iterations:1\n"
+ "BM_string_memcpy/4/32/16/iterations:1\n"
+ "BM_string_memcpy/4/32/32/iterations:1\n"
+ "BM_string_memcpy/5/0/0/iterations:1\n"
+ "BM_string_memcpy/5/1/1/iterations:1\n"
+ "BM_string_memcpy/5/1/2/iterations:1\n"
+ "BM_string_memcpy/5/1/4/iterations:1\n"
+ "BM_string_memcpy/5/1/8/iterations:1\n"
+ "BM_string_memcpy/5/1/16/iterations:1\n"
+ "BM_string_memcpy/5/1/32/iterations:1\n"
+ "BM_string_memcpy/5/2/1/iterations:1\n"
+ "BM_string_memcpy/5/2/2/iterations:1\n"
+ "BM_string_memcpy/5/2/4/iterations:1\n"
+ "BM_string_memcpy/5/2/8/iterations:1\n"
+ "BM_string_memcpy/5/2/16/iterations:1\n"
+ "BM_string_memcpy/5/2/32/iterations:1\n"
+ "BM_string_memcpy/5/4/1/iterations:1\n"
+ "BM_string_memcpy/5/4/2/iterations:1\n"
+ "BM_string_memcpy/5/4/4/iterations:1\n"
+ "BM_string_memcpy/5/4/8/iterations:1\n"
+ "BM_string_memcpy/5/4/16/iterations:1\n"
+ "BM_string_memcpy/5/4/32/iterations:1\n"
+ "BM_string_memcpy/5/8/1/iterations:1\n"
+ "BM_string_memcpy/5/8/2/iterations:1\n"
+ "BM_string_memcpy/5/8/4/iterations:1\n"
+ "BM_string_memcpy/5/8/8/iterations:1\n"
+ "BM_string_memcpy/5/8/16/iterations:1\n"
+ "BM_string_memcpy/5/8/32/iterations:1\n"
+ "BM_string_memcpy/5/16/1/iterations:1\n"
+ "BM_string_memcpy/5/16/2/iterations:1\n"
+ "BM_string_memcpy/5/16/4/iterations:1\n"
+ "BM_string_memcpy/5/16/8/iterations:1\n"
+ "BM_string_memcpy/5/16/16/iterations:1\n"
+ "BM_string_memcpy/5/16/32/iterations:1\n"
+ "BM_string_memcpy/5/32/1/iterations:1\n"
+ "BM_string_memcpy/5/32/2/iterations:1\n"
+ "BM_string_memcpy/5/32/4/iterations:1\n"
+ "BM_string_memcpy/5/32/8/iterations:1\n"
+ "BM_string_memcpy/5/32/16/iterations:1\n"
+ "BM_string_memcpy/5/32/32/iterations:1\n"
+ "BM_string_memcpy/6/0/0/iterations:1\n"
+ "BM_string_memcpy/6/1/1/iterations:1\n"
+ "BM_string_memcpy/6/1/2/iterations:1\n"
+ "BM_string_memcpy/6/1/4/iterations:1\n"
+ "BM_string_memcpy/6/1/8/iterations:1\n"
+ "BM_string_memcpy/6/1/16/iterations:1\n"
+ "BM_string_memcpy/6/1/32/iterations:1\n"
+ "BM_string_memcpy/6/2/1/iterations:1\n"
+ "BM_string_memcpy/6/2/2/iterations:1\n"
+ "BM_string_memcpy/6/2/4/iterations:1\n"
+ "BM_string_memcpy/6/2/8/iterations:1\n"
+ "BM_string_memcpy/6/2/16/iterations:1\n"
+ "BM_string_memcpy/6/2/32/iterations:1\n"
+ "BM_string_memcpy/6/4/1/iterations:1\n"
+ "BM_string_memcpy/6/4/2/iterations:1\n"
+ "BM_string_memcpy/6/4/4/iterations:1\n"
+ "BM_string_memcpy/6/4/8/iterations:1\n"
+ "BM_string_memcpy/6/4/16/iterations:1\n"
+ "BM_string_memcpy/6/4/32/iterations:1\n"
+ "BM_string_memcpy/6/8/1/iterations:1\n"
+ "BM_string_memcpy/6/8/2/iterations:1\n"
+ "BM_string_memcpy/6/8/4/iterations:1\n"
+ "BM_string_memcpy/6/8/8/iterations:1\n"
+ "BM_string_memcpy/6/8/16/iterations:1\n"
+ "BM_string_memcpy/6/8/32/iterations:1\n"
+ "BM_string_memcpy/6/16/1/iterations:1\n"
+ "BM_string_memcpy/6/16/2/iterations:1\n"
+ "BM_string_memcpy/6/16/4/iterations:1\n"
+ "BM_string_memcpy/6/16/8/iterations:1\n"
+ "BM_string_memcpy/6/16/16/iterations:1\n"
+ "BM_string_memcpy/6/16/32/iterations:1\n"
+ "BM_string_memcpy/6/32/1/iterations:1\n"
+ "BM_string_memcpy/6/32/2/iterations:1\n"
+ "BM_string_memcpy/6/32/4/iterations:1\n"
+ "BM_string_memcpy/6/32/8/iterations:1\n"
+ "BM_string_memcpy/6/32/16/iterations:1\n"
+ "BM_string_memcpy/6/32/32/iterations:1\n"
+ "BM_string_memcpy/7/0/0/iterations:1\n"
+ "BM_string_memcpy/7/1/1/iterations:1\n"
+ "BM_string_memcpy/7/1/2/iterations:1\n"
+ "BM_string_memcpy/7/1/4/iterations:1\n"
+ "BM_string_memcpy/7/1/8/iterations:1\n"
+ "BM_string_memcpy/7/1/16/iterations:1\n"
+ "BM_string_memcpy/7/1/32/iterations:1\n"
+ "BM_string_memcpy/7/2/1/iterations:1\n"
+ "BM_string_memcpy/7/2/2/iterations:1\n"
+ "BM_string_memcpy/7/2/4/iterations:1\n"
+ "BM_string_memcpy/7/2/8/iterations:1\n"
+ "BM_string_memcpy/7/2/16/iterations:1\n"
+ "BM_string_memcpy/7/2/32/iterations:1\n"
+ "BM_string_memcpy/7/4/1/iterations:1\n"
+ "BM_string_memcpy/7/4/2/iterations:1\n"
+ "BM_string_memcpy/7/4/4/iterations:1\n"
+ "BM_string_memcpy/7/4/8/iterations:1\n"
+ "BM_string_memcpy/7/4/16/iterations:1\n"
+ "BM_string_memcpy/7/4/32/iterations:1\n"
+ "BM_string_memcpy/7/8/1/iterations:1\n"
+ "BM_string_memcpy/7/8/2/iterations:1\n"
+ "BM_string_memcpy/7/8/4/iterations:1\n"
+ "BM_string_memcpy/7/8/8/iterations:1\n"
+ "BM_string_memcpy/7/8/16/iterations:1\n"
+ "BM_string_memcpy/7/8/32/iterations:1\n"
+ "BM_string_memcpy/7/16/1/iterations:1\n"
+ "BM_string_memcpy/7/16/2/iterations:1\n"
+ "BM_string_memcpy/7/16/4/iterations:1\n"
+ "BM_string_memcpy/7/16/8/iterations:1\n"
+ "BM_string_memcpy/7/16/16/iterations:1\n"
+ "BM_string_memcpy/7/16/32/iterations:1\n"
+ "BM_string_memcpy/7/32/1/iterations:1\n"
+ "BM_string_memcpy/7/32/2/iterations:1\n"
+ "BM_string_memcpy/7/32/4/iterations:1\n"
+ "BM_string_memcpy/7/32/8/iterations:1\n"
+ "BM_string_memcpy/7/32/16/iterations:1\n"
+ "BM_string_memcpy/7/32/32/iterations:1\n"
+ "BM_string_memcpy/8/0/0/iterations:1\n"
+ "BM_string_memcpy/8/1/1/iterations:1\n"
+ "BM_string_memcpy/8/1/2/iterations:1\n"
+ "BM_string_memcpy/8/1/4/iterations:1\n"
+ "BM_string_memcpy/8/1/8/iterations:1\n"
+ "BM_string_memcpy/8/1/16/iterations:1\n"
+ "BM_string_memcpy/8/1/32/iterations:1\n"
+ "BM_string_memcpy/8/2/1/iterations:1\n"
+ "BM_string_memcpy/8/2/2/iterations:1\n"
+ "BM_string_memcpy/8/2/4/iterations:1\n"
+ "BM_string_memcpy/8/2/8/iterations:1\n"
+ "BM_string_memcpy/8/2/16/iterations:1\n"
+ "BM_string_memcpy/8/2/32/iterations:1\n"
+ "BM_string_memcpy/8/4/1/iterations:1\n"
+ "BM_string_memcpy/8/4/2/iterations:1\n"
+ "BM_string_memcpy/8/4/4/iterations:1\n"
+ "BM_string_memcpy/8/4/8/iterations:1\n"
+ "BM_string_memcpy/8/4/16/iterations:1\n"
+ "BM_string_memcpy/8/4/32/iterations:1\n"
+ "BM_string_memcpy/8/8/1/iterations:1\n"
+ "BM_string_memcpy/8/8/2/iterations:1\n"
+ "BM_string_memcpy/8/8/4/iterations:1\n"
+ "BM_string_memcpy/8/8/8/iterations:1\n"
+ "BM_string_memcpy/8/8/16/iterations:1\n"
+ "BM_string_memcpy/8/8/32/iterations:1\n"
+ "BM_string_memcpy/8/16/1/iterations:1\n"
+ "BM_string_memcpy/8/16/2/iterations:1\n"
+ "BM_string_memcpy/8/16/4/iterations:1\n"
+ "BM_string_memcpy/8/16/8/iterations:1\n"
+ "BM_string_memcpy/8/16/16/iterations:1\n"
+ "BM_string_memcpy/8/16/32/iterations:1\n"
+ "BM_string_memcpy/8/32/1/iterations:1\n"
+ "BM_string_memcpy/8/32/2/iterations:1\n"
+ "BM_string_memcpy/8/32/4/iterations:1\n"
+ "BM_string_memcpy/8/32/8/iterations:1\n"
+ "BM_string_memcpy/8/32/16/iterations:1\n"
+ "BM_string_memcpy/8/32/32/iterations:1\n"
+ "BM_string_memcpy/9/0/0/iterations:1\n"
+ "BM_string_memcpy/9/1/1/iterations:1\n"
+ "BM_string_memcpy/9/1/2/iterations:1\n"
+ "BM_string_memcpy/9/1/4/iterations:1\n"
+ "BM_string_memcpy/9/1/8/iterations:1\n"
+ "BM_string_memcpy/9/1/16/iterations:1\n"
+ "BM_string_memcpy/9/1/32/iterations:1\n"
+ "BM_string_memcpy/9/2/1/iterations:1\n"
+ "BM_string_memcpy/9/2/2/iterations:1\n"
+ "BM_string_memcpy/9/2/4/iterations:1\n"
+ "BM_string_memcpy/9/2/8/iterations:1\n"
+ "BM_string_memcpy/9/2/16/iterations:1\n"
+ "BM_string_memcpy/9/2/32/iterations:1\n"
+ "BM_string_memcpy/9/4/1/iterations:1\n"
+ "BM_string_memcpy/9/4/2/iterations:1\n"
+ "BM_string_memcpy/9/4/4/iterations:1\n"
+ "BM_string_memcpy/9/4/8/iterations:1\n"
+ "BM_string_memcpy/9/4/16/iterations:1\n"
+ "BM_string_memcpy/9/4/32/iterations:1\n"
+ "BM_string_memcpy/9/8/1/iterations:1\n"
+ "BM_string_memcpy/9/8/2/iterations:1\n"
+ "BM_string_memcpy/9/8/4/iterations:1\n"
+ "BM_string_memcpy/9/8/8/iterations:1\n"
+ "BM_string_memcpy/9/8/16/iterations:1\n"
+ "BM_string_memcpy/9/8/32/iterations:1\n"
+ "BM_string_memcpy/9/16/1/iterations:1\n"
+ "BM_string_memcpy/9/16/2/iterations:1\n"
+ "BM_string_memcpy/9/16/4/iterations:1\n"
+ "BM_string_memcpy/9/16/8/iterations:1\n"
+ "BM_string_memcpy/9/16/16/iterations:1\n"
+ "BM_string_memcpy/9/16/32/iterations:1\n"
+ "BM_string_memcpy/9/32/1/iterations:1\n"
+ "BM_string_memcpy/9/32/2/iterations:1\n"
+ "BM_string_memcpy/9/32/4/iterations:1\n"
+ "BM_string_memcpy/9/32/8/iterations:1\n"
+ "BM_string_memcpy/9/32/16/iterations:1\n"
+ "BM_string_memcpy/9/32/32/iterations:1\n"
+ "BM_string_memcpy/10/0/0/iterations:1\n"
+ "BM_string_memcpy/10/1/1/iterations:1\n"
+ "BM_string_memcpy/10/1/2/iterations:1\n"
+ "BM_string_memcpy/10/1/4/iterations:1\n"
+ "BM_string_memcpy/10/1/8/iterations:1\n"
+ "BM_string_memcpy/10/1/16/iterations:1\n"
+ "BM_string_memcpy/10/1/32/iterations:1\n"
+ "BM_string_memcpy/10/2/1/iterations:1\n"
+ "BM_string_memcpy/10/2/2/iterations:1\n"
+ "BM_string_memcpy/10/2/4/iterations:1\n"
+ "BM_string_memcpy/10/2/8/iterations:1\n"
+ "BM_string_memcpy/10/2/16/iterations:1\n"
+ "BM_string_memcpy/10/2/32/iterations:1\n"
+ "BM_string_memcpy/10/4/1/iterations:1\n"
+ "BM_string_memcpy/10/4/2/iterations:1\n"
+ "BM_string_memcpy/10/4/4/iterations:1\n"
+ "BM_string_memcpy/10/4/8/iterations:1\n"
+ "BM_string_memcpy/10/4/16/iterations:1\n"
+ "BM_string_memcpy/10/4/32/iterations:1\n"
+ "BM_string_memcpy/10/8/1/iterations:1\n"
+ "BM_string_memcpy/10/8/2/iterations:1\n"
+ "BM_string_memcpy/10/8/4/iterations:1\n"
+ "BM_string_memcpy/10/8/8/iterations:1\n"
+ "BM_string_memcpy/10/8/16/iterations:1\n"
+ "BM_string_memcpy/10/8/32/iterations:1\n"
+ "BM_string_memcpy/10/16/1/iterations:1\n"
+ "BM_string_memcpy/10/16/2/iterations:1\n"
+ "BM_string_memcpy/10/16/4/iterations:1\n"
+ "BM_string_memcpy/10/16/8/iterations:1\n"
+ "BM_string_memcpy/10/16/16/iterations:1\n"
+ "BM_string_memcpy/10/16/32/iterations:1\n"
+ "BM_string_memcpy/10/32/1/iterations:1\n"
+ "BM_string_memcpy/10/32/2/iterations:1\n"
+ "BM_string_memcpy/10/32/4/iterations:1\n"
+ "BM_string_memcpy/10/32/8/iterations:1\n"
+ "BM_string_memcpy/10/32/16/iterations:1\n"
+ "BM_string_memcpy/10/32/32/iterations:1\n"
+ "BM_string_memcpy/11/0/0/iterations:1\n"
+ "BM_string_memcpy/11/1/1/iterations:1\n"
+ "BM_string_memcpy/11/1/2/iterations:1\n"
+ "BM_string_memcpy/11/1/4/iterations:1\n"
+ "BM_string_memcpy/11/1/8/iterations:1\n"
+ "BM_string_memcpy/11/1/16/iterations:1\n"
+ "BM_string_memcpy/11/1/32/iterations:1\n"
+ "BM_string_memcpy/11/2/1/iterations:1\n"
+ "BM_string_memcpy/11/2/2/iterations:1\n"
+ "BM_string_memcpy/11/2/4/iterations:1\n"
+ "BM_string_memcpy/11/2/8/iterations:1\n"
+ "BM_string_memcpy/11/2/16/iterations:1\n"
+ "BM_string_memcpy/11/2/32/iterations:1\n"
+ "BM_string_memcpy/11/4/1/iterations:1\n"
+ "BM_string_memcpy/11/4/2/iterations:1\n"
+ "BM_string_memcpy/11/4/4/iterations:1\n"
+ "BM_string_memcpy/11/4/8/iterations:1\n"
+ "BM_string_memcpy/11/4/16/iterations:1\n"
+ "BM_string_memcpy/11/4/32/iterations:1\n"
+ "BM_string_memcpy/11/8/1/iterations:1\n"
+ "BM_string_memcpy/11/8/2/iterations:1\n"
+ "BM_string_memcpy/11/8/4/iterations:1\n"
+ "BM_string_memcpy/11/8/8/iterations:1\n"
+ "BM_string_memcpy/11/8/16/iterations:1\n"
+ "BM_string_memcpy/11/8/32/iterations:1\n"
+ "BM_string_memcpy/11/16/1/iterations:1\n"
+ "BM_string_memcpy/11/16/2/iterations:1\n"
+ "BM_string_memcpy/11/16/4/iterations:1\n"
+ "BM_string_memcpy/11/16/8/iterations:1\n"
+ "BM_string_memcpy/11/16/16/iterations:1\n"
+ "BM_string_memcpy/11/16/32/iterations:1\n"
+ "BM_string_memcpy/11/32/1/iterations:1\n"
+ "BM_string_memcpy/11/32/2/iterations:1\n"
+ "BM_string_memcpy/11/32/4/iterations:1\n"
+ "BM_string_memcpy/11/32/8/iterations:1\n"
+ "BM_string_memcpy/11/32/16/iterations:1\n"
+ "BM_string_memcpy/11/32/32/iterations:1\n"
+ "BM_string_memcpy/12/0/0/iterations:1\n"
+ "BM_string_memcpy/12/1/1/iterations:1\n"
+ "BM_string_memcpy/12/1/2/iterations:1\n"
+ "BM_string_memcpy/12/1/4/iterations:1\n"
+ "BM_string_memcpy/12/1/8/iterations:1\n"
+ "BM_string_memcpy/12/1/16/iterations:1\n"
+ "BM_string_memcpy/12/1/32/iterations:1\n"
+ "BM_string_memcpy/12/2/1/iterations:1\n"
+ "BM_string_memcpy/12/2/2/iterations:1\n"
+ "BM_string_memcpy/12/2/4/iterations:1\n"
+ "BM_string_memcpy/12/2/8/iterations:1\n"
+ "BM_string_memcpy/12/2/16/iterations:1\n"
+ "BM_string_memcpy/12/2/32/iterations:1\n"
+ "BM_string_memcpy/12/4/1/iterations:1\n"
+ "BM_string_memcpy/12/4/2/iterations:1\n"
+ "BM_string_memcpy/12/4/4/iterations:1\n"
+ "BM_string_memcpy/12/4/8/iterations:1\n"
+ "BM_string_memcpy/12/4/16/iterations:1\n"
+ "BM_string_memcpy/12/4/32/iterations:1\n"
+ "BM_string_memcpy/12/8/1/iterations:1\n"
+ "BM_string_memcpy/12/8/2/iterations:1\n"
+ "BM_string_memcpy/12/8/4/iterations:1\n"
+ "BM_string_memcpy/12/8/8/iterations:1\n"
+ "BM_string_memcpy/12/8/16/iterations:1\n"
+ "BM_string_memcpy/12/8/32/iterations:1\n"
+ "BM_string_memcpy/12/16/1/iterations:1\n"
+ "BM_string_memcpy/12/16/2/iterations:1\n"
+ "BM_string_memcpy/12/16/4/iterations:1\n"
+ "BM_string_memcpy/12/16/8/iterations:1\n"
+ "BM_string_memcpy/12/16/16/iterations:1\n"
+ "BM_string_memcpy/12/16/32/iterations:1\n"
+ "BM_string_memcpy/12/32/1/iterations:1\n"
+ "BM_string_memcpy/12/32/2/iterations:1\n"
+ "BM_string_memcpy/12/32/4/iterations:1\n"
+ "BM_string_memcpy/12/32/8/iterations:1\n"
+ "BM_string_memcpy/12/32/16/iterations:1\n"
+ "BM_string_memcpy/12/32/32/iterations:1\n"
+ "BM_string_memcpy/13/0/0/iterations:1\n"
+ "BM_string_memcpy/13/1/1/iterations:1\n"
+ "BM_string_memcpy/13/1/2/iterations:1\n"
+ "BM_string_memcpy/13/1/4/iterations:1\n"
+ "BM_string_memcpy/13/1/8/iterations:1\n"
+ "BM_string_memcpy/13/1/16/iterations:1\n"
+ "BM_string_memcpy/13/1/32/iterations:1\n"
+ "BM_string_memcpy/13/2/1/iterations:1\n"
+ "BM_string_memcpy/13/2/2/iterations:1\n"
+ "BM_string_memcpy/13/2/4/iterations:1\n"
+ "BM_string_memcpy/13/2/8/iterations:1\n"
+ "BM_string_memcpy/13/2/16/iterations:1\n"
+ "BM_string_memcpy/13/2/32/iterations:1\n"
+ "BM_string_memcpy/13/4/1/iterations:1\n"
+ "BM_string_memcpy/13/4/2/iterations:1\n"
+ "BM_string_memcpy/13/4/4/iterations:1\n"
+ "BM_string_memcpy/13/4/8/iterations:1\n"
+ "BM_string_memcpy/13/4/16/iterations:1\n"
+ "BM_string_memcpy/13/4/32/iterations:1\n"
+ "BM_string_memcpy/13/8/1/iterations:1\n"
+ "BM_string_memcpy/13/8/2/iterations:1\n"
+ "BM_string_memcpy/13/8/4/iterations:1\n"
+ "BM_string_memcpy/13/8/8/iterations:1\n"
+ "BM_string_memcpy/13/8/16/iterations:1\n"
+ "BM_string_memcpy/13/8/32/iterations:1\n"
+ "BM_string_memcpy/13/16/1/iterations:1\n"
+ "BM_string_memcpy/13/16/2/iterations:1\n"
+ "BM_string_memcpy/13/16/4/iterations:1\n"
+ "BM_string_memcpy/13/16/8/iterations:1\n"
+ "BM_string_memcpy/13/16/16/iterations:1\n"
+ "BM_string_memcpy/13/16/32/iterations:1\n"
+ "BM_string_memcpy/13/32/1/iterations:1\n"
+ "BM_string_memcpy/13/32/2/iterations:1\n"
+ "BM_string_memcpy/13/32/4/iterations:1\n"
+ "BM_string_memcpy/13/32/8/iterations:1\n"
+ "BM_string_memcpy/13/32/16/iterations:1\n"
+ "BM_string_memcpy/13/32/32/iterations:1\n"
+ "BM_string_memcpy/14/0/0/iterations:1\n"
+ "BM_string_memcpy/14/1/1/iterations:1\n"
+ "BM_string_memcpy/14/1/2/iterations:1\n"
+ "BM_string_memcpy/14/1/4/iterations:1\n"
+ "BM_string_memcpy/14/1/8/iterations:1\n"
+ "BM_string_memcpy/14/1/16/iterations:1\n"
+ "BM_string_memcpy/14/1/32/iterations:1\n"
+ "BM_string_memcpy/14/2/1/iterations:1\n"
+ "BM_string_memcpy/14/2/2/iterations:1\n"
+ "BM_string_memcpy/14/2/4/iterations:1\n"
+ "BM_string_memcpy/14/2/8/iterations:1\n"
+ "BM_string_memcpy/14/2/16/iterations:1\n"
+ "BM_string_memcpy/14/2/32/iterations:1\n"
+ "BM_string_memcpy/14/4/1/iterations:1\n"
+ "BM_string_memcpy/14/4/2/iterations:1\n"
+ "BM_string_memcpy/14/4/4/iterations:1\n"
+ "BM_string_memcpy/14/4/8/iterations:1\n"
+ "BM_string_memcpy/14/4/16/iterations:1\n"
+ "BM_string_memcpy/14/4/32/iterations:1\n"
+ "BM_string_memcpy/14/8/1/iterations:1\n"
+ "BM_string_memcpy/14/8/2/iterations:1\n"
+ "BM_string_memcpy/14/8/4/iterations:1\n"
+ "BM_string_memcpy/14/8/8/iterations:1\n"
+ "BM_string_memcpy/14/8/16/iterations:1\n"
+ "BM_string_memcpy/14/8/32/iterations:1\n"
+ "BM_string_memcpy/14/16/1/iterations:1\n"
+ "BM_string_memcpy/14/16/2/iterations:1\n"
+ "BM_string_memcpy/14/16/4/iterations:1\n"
+ "BM_string_memcpy/14/16/8/iterations:1\n"
+ "BM_string_memcpy/14/16/16/iterations:1\n"
+ "BM_string_memcpy/14/16/32/iterations:1\n"
+ "BM_string_memcpy/14/32/1/iterations:1\n"
+ "BM_string_memcpy/14/32/2/iterations:1\n"
+ "BM_string_memcpy/14/32/4/iterations:1\n"
+ "BM_string_memcpy/14/32/8/iterations:1\n"
+ "BM_string_memcpy/14/32/16/iterations:1\n"
+ "BM_string_memcpy/14/32/32/iterations:1\n"
+ "BM_string_memcpy/15/0/0/iterations:1\n"
+ "BM_string_memcpy/15/1/1/iterations:1\n"
+ "BM_string_memcpy/15/1/2/iterations:1\n"
+ "BM_string_memcpy/15/1/4/iterations:1\n"
+ "BM_string_memcpy/15/1/8/iterations:1\n"
+ "BM_string_memcpy/15/1/16/iterations:1\n"
+ "BM_string_memcpy/15/1/32/iterations:1\n"
+ "BM_string_memcpy/15/2/1/iterations:1\n"
+ "BM_string_memcpy/15/2/2/iterations:1\n"
+ "BM_string_memcpy/15/2/4/iterations:1\n"
+ "BM_string_memcpy/15/2/8/iterations:1\n"
+ "BM_string_memcpy/15/2/16/iterations:1\n"
+ "BM_string_memcpy/15/2/32/iterations:1\n"
+ "BM_string_memcpy/15/4/1/iterations:1\n"
+ "BM_string_memcpy/15/4/2/iterations:1\n"
+ "BM_string_memcpy/15/4/4/iterations:1\n"
+ "BM_string_memcpy/15/4/8/iterations:1\n"
+ "BM_string_memcpy/15/4/16/iterations:1\n"
+ "BM_string_memcpy/15/4/32/iterations:1\n"
+ "BM_string_memcpy/15/8/1/iterations:1\n"
+ "BM_string_memcpy/15/8/2/iterations:1\n"
+ "BM_string_memcpy/15/8/4/iterations:1\n"
+ "BM_string_memcpy/15/8/8/iterations:1\n"
+ "BM_string_memcpy/15/8/16/iterations:1\n"
+ "BM_string_memcpy/15/8/32/iterations:1\n"
+ "BM_string_memcpy/15/16/1/iterations:1\n"
+ "BM_string_memcpy/15/16/2/iterations:1\n"
+ "BM_string_memcpy/15/16/4/iterations:1\n"
+ "BM_string_memcpy/15/16/8/iterations:1\n"
+ "BM_string_memcpy/15/16/16/iterations:1\n"
+ "BM_string_memcpy/15/16/32/iterations:1\n"
+ "BM_string_memcpy/15/32/1/iterations:1\n"
+ "BM_string_memcpy/15/32/2/iterations:1\n"
+ "BM_string_memcpy/15/32/4/iterations:1\n"
+ "BM_string_memcpy/15/32/8/iterations:1\n"
+ "BM_string_memcpy/15/32/16/iterations:1\n"
+ "BM_string_memcpy/15/32/32/iterations:1\n"
+ "BM_string_memcpy/16/0/0/iterations:1\n"
+ "BM_string_memcpy/16/1/1/iterations:1\n"
+ "BM_string_memcpy/16/1/2/iterations:1\n"
+ "BM_string_memcpy/16/1/4/iterations:1\n"
+ "BM_string_memcpy/16/1/8/iterations:1\n"
+ "BM_string_memcpy/16/1/16/iterations:1\n"
+ "BM_string_memcpy/16/1/32/iterations:1\n"
+ "BM_string_memcpy/16/2/1/iterations:1\n"
+ "BM_string_memcpy/16/2/2/iterations:1\n"
+ "BM_string_memcpy/16/2/4/iterations:1\n"
+ "BM_string_memcpy/16/2/8/iterations:1\n"
+ "BM_string_memcpy/16/2/16/iterations:1\n"
+ "BM_string_memcpy/16/2/32/iterations:1\n"
+ "BM_string_memcpy/16/4/1/iterations:1\n"
+ "BM_string_memcpy/16/4/2/iterations:1\n"
+ "BM_string_memcpy/16/4/4/iterations:1\n"
+ "BM_string_memcpy/16/4/8/iterations:1\n"
+ "BM_string_memcpy/16/4/16/iterations:1\n"
+ "BM_string_memcpy/16/4/32/iterations:1\n"
+ "BM_string_memcpy/16/8/1/iterations:1\n"
+ "BM_string_memcpy/16/8/2/iterations:1\n"
+ "BM_string_memcpy/16/8/4/iterations:1\n"
+ "BM_string_memcpy/16/8/8/iterations:1\n"
+ "BM_string_memcpy/16/8/16/iterations:1\n"
+ "BM_string_memcpy/16/8/32/iterations:1\n"
+ "BM_string_memcpy/16/16/1/iterations:1\n"
+ "BM_string_memcpy/16/16/2/iterations:1\n"
+ "BM_string_memcpy/16/16/4/iterations:1\n"
+ "BM_string_memcpy/16/16/8/iterations:1\n"
+ "BM_string_memcpy/16/16/16/iterations:1\n"
+ "BM_string_memcpy/16/16/32/iterations:1\n"
+ "BM_string_memcpy/16/32/1/iterations:1\n"
+ "BM_string_memcpy/16/32/2/iterations:1\n"
+ "BM_string_memcpy/16/32/4/iterations:1\n"
+ "BM_string_memcpy/16/32/8/iterations:1\n"
+ "BM_string_memcpy/16/32/16/iterations:1\n"
+ "BM_string_memcpy/16/32/32/iterations:1\n"
+ "BM_string_memcpy/24/0/0/iterations:1\n"
+ "BM_string_memcpy/24/1/1/iterations:1\n"
+ "BM_string_memcpy/24/1/2/iterations:1\n"
+ "BM_string_memcpy/24/1/4/iterations:1\n"
+ "BM_string_memcpy/24/1/8/iterations:1\n"
+ "BM_string_memcpy/24/1/16/iterations:1\n"
+ "BM_string_memcpy/24/1/32/iterations:1\n"
+ "BM_string_memcpy/24/2/1/iterations:1\n"
+ "BM_string_memcpy/24/2/2/iterations:1\n"
+ "BM_string_memcpy/24/2/4/iterations:1\n"
+ "BM_string_memcpy/24/2/8/iterations:1\n"
+ "BM_string_memcpy/24/2/16/iterations:1\n"
+ "BM_string_memcpy/24/2/32/iterations:1\n"
+ "BM_string_memcpy/24/4/1/iterations:1\n"
+ "BM_string_memcpy/24/4/2/iterations:1\n"
+ "BM_string_memcpy/24/4/4/iterations:1\n"
+ "BM_string_memcpy/24/4/8/iterations:1\n"
+ "BM_string_memcpy/24/4/16/iterations:1\n"
+ "BM_string_memcpy/24/4/32/iterations:1\n"
+ "BM_string_memcpy/24/8/1/iterations:1\n"
+ "BM_string_memcpy/24/8/2/iterations:1\n"
+ "BM_string_memcpy/24/8/4/iterations:1\n"
+ "BM_string_memcpy/24/8/8/iterations:1\n"
+ "BM_string_memcpy/24/8/16/iterations:1\n"
+ "BM_string_memcpy/24/8/32/iterations:1\n"
+ "BM_string_memcpy/24/16/1/iterations:1\n"
+ "BM_string_memcpy/24/16/2/iterations:1\n"
+ "BM_string_memcpy/24/16/4/iterations:1\n"
+ "BM_string_memcpy/24/16/8/iterations:1\n"
+ "BM_string_memcpy/24/16/16/iterations:1\n"
+ "BM_string_memcpy/24/16/32/iterations:1\n"
+ "BM_string_memcpy/24/32/1/iterations:1\n"
+ "BM_string_memcpy/24/32/2/iterations:1\n"
+ "BM_string_memcpy/24/32/4/iterations:1\n"
+ "BM_string_memcpy/24/32/8/iterations:1\n"
+ "BM_string_memcpy/24/32/16/iterations:1\n"
+ "BM_string_memcpy/24/32/32/iterations:1\n"
+ "BM_string_memcpy/32/0/0/iterations:1\n"
+ "BM_string_memcpy/32/1/1/iterations:1\n"
+ "BM_string_memcpy/32/1/2/iterations:1\n"
+ "BM_string_memcpy/32/1/4/iterations:1\n"
+ "BM_string_memcpy/32/1/8/iterations:1\n"
+ "BM_string_memcpy/32/1/16/iterations:1\n"
+ "BM_string_memcpy/32/1/32/iterations:1\n"
+ "BM_string_memcpy/32/2/1/iterations:1\n"
+ "BM_string_memcpy/32/2/2/iterations:1\n"
+ "BM_string_memcpy/32/2/4/iterations:1\n"
+ "BM_string_memcpy/32/2/8/iterations:1\n"
+ "BM_string_memcpy/32/2/16/iterations:1\n"
+ "BM_string_memcpy/32/2/32/iterations:1\n"
+ "BM_string_memcpy/32/4/1/iterations:1\n"
+ "BM_string_memcpy/32/4/2/iterations:1\n"
+ "BM_string_memcpy/32/4/4/iterations:1\n"
+ "BM_string_memcpy/32/4/8/iterations:1\n"
+ "BM_string_memcpy/32/4/16/iterations:1\n"
+ "BM_string_memcpy/32/4/32/iterations:1\n"
+ "BM_string_memcpy/32/8/1/iterations:1\n"
+ "BM_string_memcpy/32/8/2/iterations:1\n"
+ "BM_string_memcpy/32/8/4/iterations:1\n"
+ "BM_string_memcpy/32/8/8/iterations:1\n"
+ "BM_string_memcpy/32/8/16/iterations:1\n"
+ "BM_string_memcpy/32/8/32/iterations:1\n"
+ "BM_string_memcpy/32/16/1/iterations:1\n"
+ "BM_string_memcpy/32/16/2/iterations:1\n"
+ "BM_string_memcpy/32/16/4/iterations:1\n"
+ "BM_string_memcpy/32/16/8/iterations:1\n"
+ "BM_string_memcpy/32/16/16/iterations:1\n"
+ "BM_string_memcpy/32/16/32/iterations:1\n"
+ "BM_string_memcpy/32/32/1/iterations:1\n"
+ "BM_string_memcpy/32/32/2/iterations:1\n"
+ "BM_string_memcpy/32/32/4/iterations:1\n"
+ "BM_string_memcpy/32/32/8/iterations:1\n"
+ "BM_string_memcpy/32/32/16/iterations:1\n"
+ "BM_string_memcpy/32/32/32/iterations:1\n"
+ "BM_string_memcpy/40/0/0/iterations:1\n"
+ "BM_string_memcpy/40/1/1/iterations:1\n"
+ "BM_string_memcpy/40/1/2/iterations:1\n"
+ "BM_string_memcpy/40/1/4/iterations:1\n"
+ "BM_string_memcpy/40/1/8/iterations:1\n"
+ "BM_string_memcpy/40/1/16/iterations:1\n"
+ "BM_string_memcpy/40/1/32/iterations:1\n"
+ "BM_string_memcpy/40/2/1/iterations:1\n"
+ "BM_string_memcpy/40/2/2/iterations:1\n"
+ "BM_string_memcpy/40/2/4/iterations:1\n"
+ "BM_string_memcpy/40/2/8/iterations:1\n"
+ "BM_string_memcpy/40/2/16/iterations:1\n"
+ "BM_string_memcpy/40/2/32/iterations:1\n"
+ "BM_string_memcpy/40/4/1/iterations:1\n"
+ "BM_string_memcpy/40/4/2/iterations:1\n"
+ "BM_string_memcpy/40/4/4/iterations:1\n"
+ "BM_string_memcpy/40/4/8/iterations:1\n"
+ "BM_string_memcpy/40/4/16/iterations:1\n"
+ "BM_string_memcpy/40/4/32/iterations:1\n"
+ "BM_string_memcpy/40/8/1/iterations:1\n"
+ "BM_string_memcpy/40/8/2/iterations:1\n"
+ "BM_string_memcpy/40/8/4/iterations:1\n"
+ "BM_string_memcpy/40/8/8/iterations:1\n"
+ "BM_string_memcpy/40/8/16/iterations:1\n"
+ "BM_string_memcpy/40/8/32/iterations:1\n"
+ "BM_string_memcpy/40/16/1/iterations:1\n"
+ "BM_string_memcpy/40/16/2/iterations:1\n"
+ "BM_string_memcpy/40/16/4/iterations:1\n"
+ "BM_string_memcpy/40/16/8/iterations:1\n"
+ "BM_string_memcpy/40/16/16/iterations:1\n"
+ "BM_string_memcpy/40/16/32/iterations:1\n"
+ "BM_string_memcpy/40/32/1/iterations:1\n"
+ "BM_string_memcpy/40/32/2/iterations:1\n"
+ "BM_string_memcpy/40/32/4/iterations:1\n"
+ "BM_string_memcpy/40/32/8/iterations:1\n"
+ "BM_string_memcpy/40/32/16/iterations:1\n"
+ "BM_string_memcpy/40/32/32/iterations:1\n"
+ "BM_string_memcpy/48/0/0/iterations:1\n"
+ "BM_string_memcpy/48/1/1/iterations:1\n"
+ "BM_string_memcpy/48/1/2/iterations:1\n"
+ "BM_string_memcpy/48/1/4/iterations:1\n"
+ "BM_string_memcpy/48/1/8/iterations:1\n"
+ "BM_string_memcpy/48/1/16/iterations:1\n"
+ "BM_string_memcpy/48/1/32/iterations:1\n"
+ "BM_string_memcpy/48/2/1/iterations:1\n"
+ "BM_string_memcpy/48/2/2/iterations:1\n"
+ "BM_string_memcpy/48/2/4/iterations:1\n"
+ "BM_string_memcpy/48/2/8/iterations:1\n"
+ "BM_string_memcpy/48/2/16/iterations:1\n"
+ "BM_string_memcpy/48/2/32/iterations:1\n"
+ "BM_string_memcpy/48/4/1/iterations:1\n"
+ "BM_string_memcpy/48/4/2/iterations:1\n"
+ "BM_string_memcpy/48/4/4/iterations:1\n"
+ "BM_string_memcpy/48/4/8/iterations:1\n"
+ "BM_string_memcpy/48/4/16/iterations:1\n"
+ "BM_string_memcpy/48/4/32/iterations:1\n"
+ "BM_string_memcpy/48/8/1/iterations:1\n"
+ "BM_string_memcpy/48/8/2/iterations:1\n"
+ "BM_string_memcpy/48/8/4/iterations:1\n"
+ "BM_string_memcpy/48/8/8/iterations:1\n"
+ "BM_string_memcpy/48/8/16/iterations:1\n"
+ "BM_string_memcpy/48/8/32/iterations:1\n"
+ "BM_string_memcpy/48/16/1/iterations:1\n"
+ "BM_string_memcpy/48/16/2/iterations:1\n"
+ "BM_string_memcpy/48/16/4/iterations:1\n"
+ "BM_string_memcpy/48/16/8/iterations:1\n"
+ "BM_string_memcpy/48/16/16/iterations:1\n"
+ "BM_string_memcpy/48/16/32/iterations:1\n"
+ "BM_string_memcpy/48/32/1/iterations:1\n"
+ "BM_string_memcpy/48/32/2/iterations:1\n"
+ "BM_string_memcpy/48/32/4/iterations:1\n"
+ "BM_string_memcpy/48/32/8/iterations:1\n"
+ "BM_string_memcpy/48/32/16/iterations:1\n"
+ "BM_string_memcpy/48/32/32/iterations:1\n"
+ "BM_string_memcpy/56/0/0/iterations:1\n"
+ "BM_string_memcpy/56/1/1/iterations:1\n"
+ "BM_string_memcpy/56/1/2/iterations:1\n"
+ "BM_string_memcpy/56/1/4/iterations:1\n"
+ "BM_string_memcpy/56/1/8/iterations:1\n"
+ "BM_string_memcpy/56/1/16/iterations:1\n"
+ "BM_string_memcpy/56/1/32/iterations:1\n"
+ "BM_string_memcpy/56/2/1/iterations:1\n"
+ "BM_string_memcpy/56/2/2/iterations:1\n"
+ "BM_string_memcpy/56/2/4/iterations:1\n"
+ "BM_string_memcpy/56/2/8/iterations:1\n"
+ "BM_string_memcpy/56/2/16/iterations:1\n"
+ "BM_string_memcpy/56/2/32/iterations:1\n"
+ "BM_string_memcpy/56/4/1/iterations:1\n"
+ "BM_string_memcpy/56/4/2/iterations:1\n"
+ "BM_string_memcpy/56/4/4/iterations:1\n"
+ "BM_string_memcpy/56/4/8/iterations:1\n"
+ "BM_string_memcpy/56/4/16/iterations:1\n"
+ "BM_string_memcpy/56/4/32/iterations:1\n"
+ "BM_string_memcpy/56/8/1/iterations:1\n"
+ "BM_string_memcpy/56/8/2/iterations:1\n"
+ "BM_string_memcpy/56/8/4/iterations:1\n"
+ "BM_string_memcpy/56/8/8/iterations:1\n"
+ "BM_string_memcpy/56/8/16/iterations:1\n"
+ "BM_string_memcpy/56/8/32/iterations:1\n"
+ "BM_string_memcpy/56/16/1/iterations:1\n"
+ "BM_string_memcpy/56/16/2/iterations:1\n"
+ "BM_string_memcpy/56/16/4/iterations:1\n"
+ "BM_string_memcpy/56/16/8/iterations:1\n"
+ "BM_string_memcpy/56/16/16/iterations:1\n"
+ "BM_string_memcpy/56/16/32/iterations:1\n"
+ "BM_string_memcpy/56/32/1/iterations:1\n"
+ "BM_string_memcpy/56/32/2/iterations:1\n"
+ "BM_string_memcpy/56/32/4/iterations:1\n"
+ "BM_string_memcpy/56/32/8/iterations:1\n"
+ "BM_string_memcpy/56/32/16/iterations:1\n"
+ "BM_string_memcpy/56/32/32/iterations:1\n"
+ "BM_string_memcpy/64/0/0/iterations:1\n"
+ "BM_string_memcpy/64/1/1/iterations:1\n"
+ "BM_string_memcpy/64/1/2/iterations:1\n"
+ "BM_string_memcpy/64/1/4/iterations:1\n"
+ "BM_string_memcpy/64/1/8/iterations:1\n"
+ "BM_string_memcpy/64/1/16/iterations:1\n"
+ "BM_string_memcpy/64/1/32/iterations:1\n"
+ "BM_string_memcpy/64/2/1/iterations:1\n"
+ "BM_string_memcpy/64/2/2/iterations:1\n"
+ "BM_string_memcpy/64/2/4/iterations:1\n"
+ "BM_string_memcpy/64/2/8/iterations:1\n"
+ "BM_string_memcpy/64/2/16/iterations:1\n"
+ "BM_string_memcpy/64/2/32/iterations:1\n"
+ "BM_string_memcpy/64/4/1/iterations:1\n"
+ "BM_string_memcpy/64/4/2/iterations:1\n"
+ "BM_string_memcpy/64/4/4/iterations:1\n"
+ "BM_string_memcpy/64/4/8/iterations:1\n"
+ "BM_string_memcpy/64/4/16/iterations:1\n"
+ "BM_string_memcpy/64/4/32/iterations:1\n"
+ "BM_string_memcpy/64/8/1/iterations:1\n"
+ "BM_string_memcpy/64/8/2/iterations:1\n"
+ "BM_string_memcpy/64/8/4/iterations:1\n"
+ "BM_string_memcpy/64/8/8/iterations:1\n"
+ "BM_string_memcpy/64/8/16/iterations:1\n"
+ "BM_string_memcpy/64/8/32/iterations:1\n"
+ "BM_string_memcpy/64/16/1/iterations:1\n"
+ "BM_string_memcpy/64/16/2/iterations:1\n"
+ "BM_string_memcpy/64/16/4/iterations:1\n"
+ "BM_string_memcpy/64/16/8/iterations:1\n"
+ "BM_string_memcpy/64/16/16/iterations:1\n"
+ "BM_string_memcpy/64/16/32/iterations:1\n"
+ "BM_string_memcpy/64/32/1/iterations:1\n"
+ "BM_string_memcpy/64/32/2/iterations:1\n"
+ "BM_string_memcpy/64/32/4/iterations:1\n"
+ "BM_string_memcpy/64/32/8/iterations:1\n"
+ "BM_string_memcpy/64/32/16/iterations:1\n"
+ "BM_string_memcpy/64/32/32/iterations:1\n"
+ "BM_string_memcpy/72/0/0/iterations:1\n"
+ "BM_string_memcpy/72/1/1/iterations:1\n"
+ "BM_string_memcpy/72/1/2/iterations:1\n"
+ "BM_string_memcpy/72/1/4/iterations:1\n"
+ "BM_string_memcpy/72/1/8/iterations:1\n"
+ "BM_string_memcpy/72/1/16/iterations:1\n"
+ "BM_string_memcpy/72/1/32/iterations:1\n"
+ "BM_string_memcpy/72/2/1/iterations:1\n"
+ "BM_string_memcpy/72/2/2/iterations:1\n"
+ "BM_string_memcpy/72/2/4/iterations:1\n"
+ "BM_string_memcpy/72/2/8/iterations:1\n"
+ "BM_string_memcpy/72/2/16/iterations:1\n"
+ "BM_string_memcpy/72/2/32/iterations:1\n"
+ "BM_string_memcpy/72/4/1/iterations:1\n"
+ "BM_string_memcpy/72/4/2/iterations:1\n"
+ "BM_string_memcpy/72/4/4/iterations:1\n"
+ "BM_string_memcpy/72/4/8/iterations:1\n"
+ "BM_string_memcpy/72/4/16/iterations:1\n"
+ "BM_string_memcpy/72/4/32/iterations:1\n"
+ "BM_string_memcpy/72/8/1/iterations:1\n"
+ "BM_string_memcpy/72/8/2/iterations:1\n"
+ "BM_string_memcpy/72/8/4/iterations:1\n"
+ "BM_string_memcpy/72/8/8/iterations:1\n"
+ "BM_string_memcpy/72/8/16/iterations:1\n"
+ "BM_string_memcpy/72/8/32/iterations:1\n"
+ "BM_string_memcpy/72/16/1/iterations:1\n"
+ "BM_string_memcpy/72/16/2/iterations:1\n"
+ "BM_string_memcpy/72/16/4/iterations:1\n"
+ "BM_string_memcpy/72/16/8/iterations:1\n"
+ "BM_string_memcpy/72/16/16/iterations:1\n"
+ "BM_string_memcpy/72/16/32/iterations:1\n"
+ "BM_string_memcpy/72/32/1/iterations:1\n"
+ "BM_string_memcpy/72/32/2/iterations:1\n"
+ "BM_string_memcpy/72/32/4/iterations:1\n"
+ "BM_string_memcpy/72/32/8/iterations:1\n"
+ "BM_string_memcpy/72/32/16/iterations:1\n"
+ "BM_string_memcpy/72/32/32/iterations:1\n"
+ "BM_string_memcpy/80/0/0/iterations:1\n"
+ "BM_string_memcpy/80/1/1/iterations:1\n"
+ "BM_string_memcpy/80/1/2/iterations:1\n"
+ "BM_string_memcpy/80/1/4/iterations:1\n"
+ "BM_string_memcpy/80/1/8/iterations:1\n"
+ "BM_string_memcpy/80/1/16/iterations:1\n"
+ "BM_string_memcpy/80/1/32/iterations:1\n"
+ "BM_string_memcpy/80/2/1/iterations:1\n"
+ "BM_string_memcpy/80/2/2/iterations:1\n"
+ "BM_string_memcpy/80/2/4/iterations:1\n"
+ "BM_string_memcpy/80/2/8/iterations:1\n"
+ "BM_string_memcpy/80/2/16/iterations:1\n"
+ "BM_string_memcpy/80/2/32/iterations:1\n"
+ "BM_string_memcpy/80/4/1/iterations:1\n"
+ "BM_string_memcpy/80/4/2/iterations:1\n"
+ "BM_string_memcpy/80/4/4/iterations:1\n"
+ "BM_string_memcpy/80/4/8/iterations:1\n"
+ "BM_string_memcpy/80/4/16/iterations:1\n"
+ "BM_string_memcpy/80/4/32/iterations:1\n"
+ "BM_string_memcpy/80/8/1/iterations:1\n"
+ "BM_string_memcpy/80/8/2/iterations:1\n"
+ "BM_string_memcpy/80/8/4/iterations:1\n"
+ "BM_string_memcpy/80/8/8/iterations:1\n"
+ "BM_string_memcpy/80/8/16/iterations:1\n"
+ "BM_string_memcpy/80/8/32/iterations:1\n"
+ "BM_string_memcpy/80/16/1/iterations:1\n"
+ "BM_string_memcpy/80/16/2/iterations:1\n"
+ "BM_string_memcpy/80/16/4/iterations:1\n"
+ "BM_string_memcpy/80/16/8/iterations:1\n"
+ "BM_string_memcpy/80/16/16/iterations:1\n"
+ "BM_string_memcpy/80/16/32/iterations:1\n"
+ "BM_string_memcpy/80/32/1/iterations:1\n"
+ "BM_string_memcpy/80/32/2/iterations:1\n"
+ "BM_string_memcpy/80/32/4/iterations:1\n"
+ "BM_string_memcpy/80/32/8/iterations:1\n"
+ "BM_string_memcpy/80/32/16/iterations:1\n"
+ "BM_string_memcpy/80/32/32/iterations:1\n"
+ "BM_string_memcpy/88/0/0/iterations:1\n"
+ "BM_string_memcpy/88/1/1/iterations:1\n"
+ "BM_string_memcpy/88/1/2/iterations:1\n"
+ "BM_string_memcpy/88/1/4/iterations:1\n"
+ "BM_string_memcpy/88/1/8/iterations:1\n"
+ "BM_string_memcpy/88/1/16/iterations:1\n"
+ "BM_string_memcpy/88/1/32/iterations:1\n"
+ "BM_string_memcpy/88/2/1/iterations:1\n"
+ "BM_string_memcpy/88/2/2/iterations:1\n"
+ "BM_string_memcpy/88/2/4/iterations:1\n"
+ "BM_string_memcpy/88/2/8/iterations:1\n"
+ "BM_string_memcpy/88/2/16/iterations:1\n"
+ "BM_string_memcpy/88/2/32/iterations:1\n"
+ "BM_string_memcpy/88/4/1/iterations:1\n"
+ "BM_string_memcpy/88/4/2/iterations:1\n"
+ "BM_string_memcpy/88/4/4/iterations:1\n"
+ "BM_string_memcpy/88/4/8/iterations:1\n"
+ "BM_string_memcpy/88/4/16/iterations:1\n"
+ "BM_string_memcpy/88/4/32/iterations:1\n"
+ "BM_string_memcpy/88/8/1/iterations:1\n"
+ "BM_string_memcpy/88/8/2/iterations:1\n"
+ "BM_string_memcpy/88/8/4/iterations:1\n"
+ "BM_string_memcpy/88/8/8/iterations:1\n"
+ "BM_string_memcpy/88/8/16/iterations:1\n"
+ "BM_string_memcpy/88/8/32/iterations:1\n"
+ "BM_string_memcpy/88/16/1/iterations:1\n"
+ "BM_string_memcpy/88/16/2/iterations:1\n"
+ "BM_string_memcpy/88/16/4/iterations:1\n"
+ "BM_string_memcpy/88/16/8/iterations:1\n"
+ "BM_string_memcpy/88/16/16/iterations:1\n"
+ "BM_string_memcpy/88/16/32/iterations:1\n"
+ "BM_string_memcpy/88/32/1/iterations:1\n"
+ "BM_string_memcpy/88/32/2/iterations:1\n"
+ "BM_string_memcpy/88/32/4/iterations:1\n"
+ "BM_string_memcpy/88/32/8/iterations:1\n"
+ "BM_string_memcpy/88/32/16/iterations:1\n"
+ "BM_string_memcpy/88/32/32/iterations:1\n"
+ "BM_string_memcpy/96/0/0/iterations:1\n"
+ "BM_string_memcpy/96/1/1/iterations:1\n"
+ "BM_string_memcpy/96/1/2/iterations:1\n"
+ "BM_string_memcpy/96/1/4/iterations:1\n"
+ "BM_string_memcpy/96/1/8/iterations:1\n"
+ "BM_string_memcpy/96/1/16/iterations:1\n"
+ "BM_string_memcpy/96/1/32/iterations:1\n"
+ "BM_string_memcpy/96/2/1/iterations:1\n"
+ "BM_string_memcpy/96/2/2/iterations:1\n"
+ "BM_string_memcpy/96/2/4/iterations:1\n"
+ "BM_string_memcpy/96/2/8/iterations:1\n"
+ "BM_string_memcpy/96/2/16/iterations:1\n"
+ "BM_string_memcpy/96/2/32/iterations:1\n"
+ "BM_string_memcpy/96/4/1/iterations:1\n"
+ "BM_string_memcpy/96/4/2/iterations:1\n"
+ "BM_string_memcpy/96/4/4/iterations:1\n"
+ "BM_string_memcpy/96/4/8/iterations:1\n"
+ "BM_string_memcpy/96/4/16/iterations:1\n"
+ "BM_string_memcpy/96/4/32/iterations:1\n"
+ "BM_string_memcpy/96/8/1/iterations:1\n"
+ "BM_string_memcpy/96/8/2/iterations:1\n"
+ "BM_string_memcpy/96/8/4/iterations:1\n"
+ "BM_string_memcpy/96/8/8/iterations:1\n"
+ "BM_string_memcpy/96/8/16/iterations:1\n"
+ "BM_string_memcpy/96/8/32/iterations:1\n"
+ "BM_string_memcpy/96/16/1/iterations:1\n"
+ "BM_string_memcpy/96/16/2/iterations:1\n"
+ "BM_string_memcpy/96/16/4/iterations:1\n"
+ "BM_string_memcpy/96/16/8/iterations:1\n"
+ "BM_string_memcpy/96/16/16/iterations:1\n"
+ "BM_string_memcpy/96/16/32/iterations:1\n"
+ "BM_string_memcpy/96/32/1/iterations:1\n"
+ "BM_string_memcpy/96/32/2/iterations:1\n"
+ "BM_string_memcpy/96/32/4/iterations:1\n"
+ "BM_string_memcpy/96/32/8/iterations:1\n"
+ "BM_string_memcpy/96/32/16/iterations:1\n"
+ "BM_string_memcpy/96/32/32/iterations:1\n"
+ "BM_string_memcpy/104/0/0/iterations:1\n"
+ "BM_string_memcpy/104/1/1/iterations:1\n"
+ "BM_string_memcpy/104/1/2/iterations:1\n"
+ "BM_string_memcpy/104/1/4/iterations:1\n"
+ "BM_string_memcpy/104/1/8/iterations:1\n"
+ "BM_string_memcpy/104/1/16/iterations:1\n"
+ "BM_string_memcpy/104/1/32/iterations:1\n"
+ "BM_string_memcpy/104/2/1/iterations:1\n"
+ "BM_string_memcpy/104/2/2/iterations:1\n"
+ "BM_string_memcpy/104/2/4/iterations:1\n"
+ "BM_string_memcpy/104/2/8/iterations:1\n"
+ "BM_string_memcpy/104/2/16/iterations:1\n"
+ "BM_string_memcpy/104/2/32/iterations:1\n"
+ "BM_string_memcpy/104/4/1/iterations:1\n"
+ "BM_string_memcpy/104/4/2/iterations:1\n"
+ "BM_string_memcpy/104/4/4/iterations:1\n"
+ "BM_string_memcpy/104/4/8/iterations:1\n"
+ "BM_string_memcpy/104/4/16/iterations:1\n"
+ "BM_string_memcpy/104/4/32/iterations:1\n"
+ "BM_string_memcpy/104/8/1/iterations:1\n"
+ "BM_string_memcpy/104/8/2/iterations:1\n"
+ "BM_string_memcpy/104/8/4/iterations:1\n"
+ "BM_string_memcpy/104/8/8/iterations:1\n"
+ "BM_string_memcpy/104/8/16/iterations:1\n"
+ "BM_string_memcpy/104/8/32/iterations:1\n"
+ "BM_string_memcpy/104/16/1/iterations:1\n"
+ "BM_string_memcpy/104/16/2/iterations:1\n"
+ "BM_string_memcpy/104/16/4/iterations:1\n"
+ "BM_string_memcpy/104/16/8/iterations:1\n"
+ "BM_string_memcpy/104/16/16/iterations:1\n"
+ "BM_string_memcpy/104/16/32/iterations:1\n"
+ "BM_string_memcpy/104/32/1/iterations:1\n"
+ "BM_string_memcpy/104/32/2/iterations:1\n"
+ "BM_string_memcpy/104/32/4/iterations:1\n"
+ "BM_string_memcpy/104/32/8/iterations:1\n"
+ "BM_string_memcpy/104/32/16/iterations:1\n"
+ "BM_string_memcpy/104/32/32/iterations:1\n"
+ "BM_string_memcpy/112/0/0/iterations:1\n"
+ "BM_string_memcpy/112/1/1/iterations:1\n"
+ "BM_string_memcpy/112/1/2/iterations:1\n"
+ "BM_string_memcpy/112/1/4/iterations:1\n"
+ "BM_string_memcpy/112/1/8/iterations:1\n"
+ "BM_string_memcpy/112/1/16/iterations:1\n"
+ "BM_string_memcpy/112/1/32/iterations:1\n"
+ "BM_string_memcpy/112/2/1/iterations:1\n"
+ "BM_string_memcpy/112/2/2/iterations:1\n"
+ "BM_string_memcpy/112/2/4/iterations:1\n"
+ "BM_string_memcpy/112/2/8/iterations:1\n"
+ "BM_string_memcpy/112/2/16/iterations:1\n"
+ "BM_string_memcpy/112/2/32/iterations:1\n"
+ "BM_string_memcpy/112/4/1/iterations:1\n"
+ "BM_string_memcpy/112/4/2/iterations:1\n"
+ "BM_string_memcpy/112/4/4/iterations:1\n"
+ "BM_string_memcpy/112/4/8/iterations:1\n"
+ "BM_string_memcpy/112/4/16/iterations:1\n"
+ "BM_string_memcpy/112/4/32/iterations:1\n"
+ "BM_string_memcpy/112/8/1/iterations:1\n"
+ "BM_string_memcpy/112/8/2/iterations:1\n"
+ "BM_string_memcpy/112/8/4/iterations:1\n"
+ "BM_string_memcpy/112/8/8/iterations:1\n"
+ "BM_string_memcpy/112/8/16/iterations:1\n"
+ "BM_string_memcpy/112/8/32/iterations:1\n"
+ "BM_string_memcpy/112/16/1/iterations:1\n"
+ "BM_string_memcpy/112/16/2/iterations:1\n"
+ "BM_string_memcpy/112/16/4/iterations:1\n"
+ "BM_string_memcpy/112/16/8/iterations:1\n"
+ "BM_string_memcpy/112/16/16/iterations:1\n"
+ "BM_string_memcpy/112/16/32/iterations:1\n"
+ "BM_string_memcpy/112/32/1/iterations:1\n"
+ "BM_string_memcpy/112/32/2/iterations:1\n"
+ "BM_string_memcpy/112/32/4/iterations:1\n"
+ "BM_string_memcpy/112/32/8/iterations:1\n"
+ "BM_string_memcpy/112/32/16/iterations:1\n"
+ "BM_string_memcpy/112/32/32/iterations:1\n"
+ "BM_string_memcpy/120/0/0/iterations:1\n"
+ "BM_string_memcpy/120/1/1/iterations:1\n"
+ "BM_string_memcpy/120/1/2/iterations:1\n"
+ "BM_string_memcpy/120/1/4/iterations:1\n"
+ "BM_string_memcpy/120/1/8/iterations:1\n"
+ "BM_string_memcpy/120/1/16/iterations:1\n"
+ "BM_string_memcpy/120/1/32/iterations:1\n"
+ "BM_string_memcpy/120/2/1/iterations:1\n"
+ "BM_string_memcpy/120/2/2/iterations:1\n"
+ "BM_string_memcpy/120/2/4/iterations:1\n"
+ "BM_string_memcpy/120/2/8/iterations:1\n"
+ "BM_string_memcpy/120/2/16/iterations:1\n"
+ "BM_string_memcpy/120/2/32/iterations:1\n"
+ "BM_string_memcpy/120/4/1/iterations:1\n"
+ "BM_string_memcpy/120/4/2/iterations:1\n"
+ "BM_string_memcpy/120/4/4/iterations:1\n"
+ "BM_string_memcpy/120/4/8/iterations:1\n"
+ "BM_string_memcpy/120/4/16/iterations:1\n"
+ "BM_string_memcpy/120/4/32/iterations:1\n"
+ "BM_string_memcpy/120/8/1/iterations:1\n"
+ "BM_string_memcpy/120/8/2/iterations:1\n"
+ "BM_string_memcpy/120/8/4/iterations:1\n"
+ "BM_string_memcpy/120/8/8/iterations:1\n"
+ "BM_string_memcpy/120/8/16/iterations:1\n"
+ "BM_string_memcpy/120/8/32/iterations:1\n"
+ "BM_string_memcpy/120/16/1/iterations:1\n"
+ "BM_string_memcpy/120/16/2/iterations:1\n"
+ "BM_string_memcpy/120/16/4/iterations:1\n"
+ "BM_string_memcpy/120/16/8/iterations:1\n"
+ "BM_string_memcpy/120/16/16/iterations:1\n"
+ "BM_string_memcpy/120/16/32/iterations:1\n"
+ "BM_string_memcpy/120/32/1/iterations:1\n"
+ "BM_string_memcpy/120/32/2/iterations:1\n"
+ "BM_string_memcpy/120/32/4/iterations:1\n"
+ "BM_string_memcpy/120/32/8/iterations:1\n"
+ "BM_string_memcpy/120/32/16/iterations:1\n"
+ "BM_string_memcpy/120/32/32/iterations:1\n"
+ "BM_string_memcpy/128/0/0/iterations:1\n"
+ "BM_string_memcpy/128/1/1/iterations:1\n"
+ "BM_string_memcpy/128/1/2/iterations:1\n"
+ "BM_string_memcpy/128/1/4/iterations:1\n"
+ "BM_string_memcpy/128/1/8/iterations:1\n"
+ "BM_string_memcpy/128/1/16/iterations:1\n"
+ "BM_string_memcpy/128/1/32/iterations:1\n"
+ "BM_string_memcpy/128/2/1/iterations:1\n"
+ "BM_string_memcpy/128/2/2/iterations:1\n"
+ "BM_string_memcpy/128/2/4/iterations:1\n"
+ "BM_string_memcpy/128/2/8/iterations:1\n"
+ "BM_string_memcpy/128/2/16/iterations:1\n"
+ "BM_string_memcpy/128/2/32/iterations:1\n"
+ "BM_string_memcpy/128/4/1/iterations:1\n"
+ "BM_string_memcpy/128/4/2/iterations:1\n"
+ "BM_string_memcpy/128/4/4/iterations:1\n"
+ "BM_string_memcpy/128/4/8/iterations:1\n"
+ "BM_string_memcpy/128/4/16/iterations:1\n"
+ "BM_string_memcpy/128/4/32/iterations:1\n"
+ "BM_string_memcpy/128/8/1/iterations:1\n"
+ "BM_string_memcpy/128/8/2/iterations:1\n"
+ "BM_string_memcpy/128/8/4/iterations:1\n"
+ "BM_string_memcpy/128/8/8/iterations:1\n"
+ "BM_string_memcpy/128/8/16/iterations:1\n"
+ "BM_string_memcpy/128/8/32/iterations:1\n"
+ "BM_string_memcpy/128/16/1/iterations:1\n"
+ "BM_string_memcpy/128/16/2/iterations:1\n"
+ "BM_string_memcpy/128/16/4/iterations:1\n"
+ "BM_string_memcpy/128/16/8/iterations:1\n"
+ "BM_string_memcpy/128/16/16/iterations:1\n"
+ "BM_string_memcpy/128/16/32/iterations:1\n"
+ "BM_string_memcpy/128/32/1/iterations:1\n"
+ "BM_string_memcpy/128/32/2/iterations:1\n"
+ "BM_string_memcpy/128/32/4/iterations:1\n"
+ "BM_string_memcpy/128/32/8/iterations:1\n"
+ "BM_string_memcpy/128/32/16/iterations:1\n"
+ "BM_string_memcpy/128/32/32/iterations:1\n"
+ "BM_string_memcpy/136/0/0/iterations:1\n"
+ "BM_string_memcpy/136/1/1/iterations:1\n"
+ "BM_string_memcpy/136/1/2/iterations:1\n"
+ "BM_string_memcpy/136/1/4/iterations:1\n"
+ "BM_string_memcpy/136/1/8/iterations:1\n"
+ "BM_string_memcpy/136/1/16/iterations:1\n"
+ "BM_string_memcpy/136/1/32/iterations:1\n"
+ "BM_string_memcpy/136/2/1/iterations:1\n"
+ "BM_string_memcpy/136/2/2/iterations:1\n"
+ "BM_string_memcpy/136/2/4/iterations:1\n"
+ "BM_string_memcpy/136/2/8/iterations:1\n"
+ "BM_string_memcpy/136/2/16/iterations:1\n"
+ "BM_string_memcpy/136/2/32/iterations:1\n"
+ "BM_string_memcpy/136/4/1/iterations:1\n"
+ "BM_string_memcpy/136/4/2/iterations:1\n"
+ "BM_string_memcpy/136/4/4/iterations:1\n"
+ "BM_string_memcpy/136/4/8/iterations:1\n"
+ "BM_string_memcpy/136/4/16/iterations:1\n"
+ "BM_string_memcpy/136/4/32/iterations:1\n"
+ "BM_string_memcpy/136/8/1/iterations:1\n"
+ "BM_string_memcpy/136/8/2/iterations:1\n"
+ "BM_string_memcpy/136/8/4/iterations:1\n"
+ "BM_string_memcpy/136/8/8/iterations:1\n"
+ "BM_string_memcpy/136/8/16/iterations:1\n"
+ "BM_string_memcpy/136/8/32/iterations:1\n"
+ "BM_string_memcpy/136/16/1/iterations:1\n"
+ "BM_string_memcpy/136/16/2/iterations:1\n"
+ "BM_string_memcpy/136/16/4/iterations:1\n"
+ "BM_string_memcpy/136/16/8/iterations:1\n"
+ "BM_string_memcpy/136/16/16/iterations:1\n"
+ "BM_string_memcpy/136/16/32/iterations:1\n"
+ "BM_string_memcpy/136/32/1/iterations:1\n"
+ "BM_string_memcpy/136/32/2/iterations:1\n"
+ "BM_string_memcpy/136/32/4/iterations:1\n"
+ "BM_string_memcpy/136/32/8/iterations:1\n"
+ "BM_string_memcpy/136/32/16/iterations:1\n"
+ "BM_string_memcpy/136/32/32/iterations:1\n"
+ "BM_string_memcpy/144/0/0/iterations:1\n"
+ "BM_string_memcpy/144/1/1/iterations:1\n"
+ "BM_string_memcpy/144/1/2/iterations:1\n"
+ "BM_string_memcpy/144/1/4/iterations:1\n"
+ "BM_string_memcpy/144/1/8/iterations:1\n"
+ "BM_string_memcpy/144/1/16/iterations:1\n"
+ "BM_string_memcpy/144/1/32/iterations:1\n"
+ "BM_string_memcpy/144/2/1/iterations:1\n"
+ "BM_string_memcpy/144/2/2/iterations:1\n"
+ "BM_string_memcpy/144/2/4/iterations:1\n"
+ "BM_string_memcpy/144/2/8/iterations:1\n"
+ "BM_string_memcpy/144/2/16/iterations:1\n"
+ "BM_string_memcpy/144/2/32/iterations:1\n"
+ "BM_string_memcpy/144/4/1/iterations:1\n"
+ "BM_string_memcpy/144/4/2/iterations:1\n"
+ "BM_string_memcpy/144/4/4/iterations:1\n"
+ "BM_string_memcpy/144/4/8/iterations:1\n"
+ "BM_string_memcpy/144/4/16/iterations:1\n"
+ "BM_string_memcpy/144/4/32/iterations:1\n"
+ "BM_string_memcpy/144/8/1/iterations:1\n"
+ "BM_string_memcpy/144/8/2/iterations:1\n"
+ "BM_string_memcpy/144/8/4/iterations:1\n"
+ "BM_string_memcpy/144/8/8/iterations:1\n"
+ "BM_string_memcpy/144/8/16/iterations:1\n"
+ "BM_string_memcpy/144/8/32/iterations:1\n"
+ "BM_string_memcpy/144/16/1/iterations:1\n"
+ "BM_string_memcpy/144/16/2/iterations:1\n"
+ "BM_string_memcpy/144/16/4/iterations:1\n"
+ "BM_string_memcpy/144/16/8/iterations:1\n"
+ "BM_string_memcpy/144/16/16/iterations:1\n"
+ "BM_string_memcpy/144/16/32/iterations:1\n"
+ "BM_string_memcpy/144/32/1/iterations:1\n"
+ "BM_string_memcpy/144/32/2/iterations:1\n"
+ "BM_string_memcpy/144/32/4/iterations:1\n"
+ "BM_string_memcpy/144/32/8/iterations:1\n"
+ "BM_string_memcpy/144/32/16/iterations:1\n"
+ "BM_string_memcpy/144/32/32/iterations:1\n"
+ "BM_string_memcpy/160/0/0/iterations:1\n"
+ "BM_string_memcpy/160/1/1/iterations:1\n"
+ "BM_string_memcpy/160/1/2/iterations:1\n"
+ "BM_string_memcpy/160/1/4/iterations:1\n"
+ "BM_string_memcpy/160/1/8/iterations:1\n"
+ "BM_string_memcpy/160/1/16/iterations:1\n"
+ "BM_string_memcpy/160/1/32/iterations:1\n"
+ "BM_string_memcpy/160/2/1/iterations:1\n"
+ "BM_string_memcpy/160/2/2/iterations:1\n"
+ "BM_string_memcpy/160/2/4/iterations:1\n"
+ "BM_string_memcpy/160/2/8/iterations:1\n"
+ "BM_string_memcpy/160/2/16/iterations:1\n"
+ "BM_string_memcpy/160/2/32/iterations:1\n"
+ "BM_string_memcpy/160/4/1/iterations:1\n"
+ "BM_string_memcpy/160/4/2/iterations:1\n"
+ "BM_string_memcpy/160/4/4/iterations:1\n"
+ "BM_string_memcpy/160/4/8/iterations:1\n"
+ "BM_string_memcpy/160/4/16/iterations:1\n"
+ "BM_string_memcpy/160/4/32/iterations:1\n"
+ "BM_string_memcpy/160/8/1/iterations:1\n"
+ "BM_string_memcpy/160/8/2/iterations:1\n"
+ "BM_string_memcpy/160/8/4/iterations:1\n"
+ "BM_string_memcpy/160/8/8/iterations:1\n"
+ "BM_string_memcpy/160/8/16/iterations:1\n"
+ "BM_string_memcpy/160/8/32/iterations:1\n"
+ "BM_string_memcpy/160/16/1/iterations:1\n"
+ "BM_string_memcpy/160/16/2/iterations:1\n"
+ "BM_string_memcpy/160/16/4/iterations:1\n"
+ "BM_string_memcpy/160/16/8/iterations:1\n"
+ "BM_string_memcpy/160/16/16/iterations:1\n"
+ "BM_string_memcpy/160/16/32/iterations:1\n"
+ "BM_string_memcpy/160/32/1/iterations:1\n"
+ "BM_string_memcpy/160/32/2/iterations:1\n"
+ "BM_string_memcpy/160/32/4/iterations:1\n"
+ "BM_string_memcpy/160/32/8/iterations:1\n"
+ "BM_string_memcpy/160/32/16/iterations:1\n"
+ "BM_string_memcpy/160/32/32/iterations:1\n"
+ "BM_string_memcpy/176/0/0/iterations:1\n"
+ "BM_string_memcpy/176/1/1/iterations:1\n"
+ "BM_string_memcpy/176/1/2/iterations:1\n"
+ "BM_string_memcpy/176/1/4/iterations:1\n"
+ "BM_string_memcpy/176/1/8/iterations:1\n"
+ "BM_string_memcpy/176/1/16/iterations:1\n"
+ "BM_string_memcpy/176/1/32/iterations:1\n"
+ "BM_string_memcpy/176/2/1/iterations:1\n"
+ "BM_string_memcpy/176/2/2/iterations:1\n"
+ "BM_string_memcpy/176/2/4/iterations:1\n"
+ "BM_string_memcpy/176/2/8/iterations:1\n"
+ "BM_string_memcpy/176/2/16/iterations:1\n"
+ "BM_string_memcpy/176/2/32/iterations:1\n"
+ "BM_string_memcpy/176/4/1/iterations:1\n"
+ "BM_string_memcpy/176/4/2/iterations:1\n"
+ "BM_string_memcpy/176/4/4/iterations:1\n"
+ "BM_string_memcpy/176/4/8/iterations:1\n"
+ "BM_string_memcpy/176/4/16/iterations:1\n"
+ "BM_string_memcpy/176/4/32/iterations:1\n"
+ "BM_string_memcpy/176/8/1/iterations:1\n"
+ "BM_string_memcpy/176/8/2/iterations:1\n"
+ "BM_string_memcpy/176/8/4/iterations:1\n"
+ "BM_string_memcpy/176/8/8/iterations:1\n"
+ "BM_string_memcpy/176/8/16/iterations:1\n"
+ "BM_string_memcpy/176/8/32/iterations:1\n"
+ "BM_string_memcpy/176/16/1/iterations:1\n"
+ "BM_string_memcpy/176/16/2/iterations:1\n"
+ "BM_string_memcpy/176/16/4/iterations:1\n"
+ "BM_string_memcpy/176/16/8/iterations:1\n"
+ "BM_string_memcpy/176/16/16/iterations:1\n"
+ "BM_string_memcpy/176/16/32/iterations:1\n"
+ "BM_string_memcpy/176/32/1/iterations:1\n"
+ "BM_string_memcpy/176/32/2/iterations:1\n"
+ "BM_string_memcpy/176/32/4/iterations:1\n"
+ "BM_string_memcpy/176/32/8/iterations:1\n"
+ "BM_string_memcpy/176/32/16/iterations:1\n"
+ "BM_string_memcpy/176/32/32/iterations:1\n"
+ "BM_string_memcpy/192/0/0/iterations:1\n"
+ "BM_string_memcpy/192/1/1/iterations:1\n"
+ "BM_string_memcpy/192/1/2/iterations:1\n"
+ "BM_string_memcpy/192/1/4/iterations:1\n"
+ "BM_string_memcpy/192/1/8/iterations:1\n"
+ "BM_string_memcpy/192/1/16/iterations:1\n"
+ "BM_string_memcpy/192/1/32/iterations:1\n"
+ "BM_string_memcpy/192/2/1/iterations:1\n"
+ "BM_string_memcpy/192/2/2/iterations:1\n"
+ "BM_string_memcpy/192/2/4/iterations:1\n"
+ "BM_string_memcpy/192/2/8/iterations:1\n"
+ "BM_string_memcpy/192/2/16/iterations:1\n"
+ "BM_string_memcpy/192/2/32/iterations:1\n"
+ "BM_string_memcpy/192/4/1/iterations:1\n"
+ "BM_string_memcpy/192/4/2/iterations:1\n"
+ "BM_string_memcpy/192/4/4/iterations:1\n"
+ "BM_string_memcpy/192/4/8/iterations:1\n"
+ "BM_string_memcpy/192/4/16/iterations:1\n"
+ "BM_string_memcpy/192/4/32/iterations:1\n"
+ "BM_string_memcpy/192/8/1/iterations:1\n"
+ "BM_string_memcpy/192/8/2/iterations:1\n"
+ "BM_string_memcpy/192/8/4/iterations:1\n"
+ "BM_string_memcpy/192/8/8/iterations:1\n"
+ "BM_string_memcpy/192/8/16/iterations:1\n"
+ "BM_string_memcpy/192/8/32/iterations:1\n"
+ "BM_string_memcpy/192/16/1/iterations:1\n"
+ "BM_string_memcpy/192/16/2/iterations:1\n"
+ "BM_string_memcpy/192/16/4/iterations:1\n"
+ "BM_string_memcpy/192/16/8/iterations:1\n"
+ "BM_string_memcpy/192/16/16/iterations:1\n"
+ "BM_string_memcpy/192/16/32/iterations:1\n"
+ "BM_string_memcpy/192/32/1/iterations:1\n"
+ "BM_string_memcpy/192/32/2/iterations:1\n"
+ "BM_string_memcpy/192/32/4/iterations:1\n"
+ "BM_string_memcpy/192/32/8/iterations:1\n"
+ "BM_string_memcpy/192/32/16/iterations:1\n"
+ "BM_string_memcpy/192/32/32/iterations:1\n"
+ "BM_string_memcpy/208/0/0/iterations:1\n"
+ "BM_string_memcpy/208/1/1/iterations:1\n"
+ "BM_string_memcpy/208/1/2/iterations:1\n"
+ "BM_string_memcpy/208/1/4/iterations:1\n"
+ "BM_string_memcpy/208/1/8/iterations:1\n"
+ "BM_string_memcpy/208/1/16/iterations:1\n"
+ "BM_string_memcpy/208/1/32/iterations:1\n"
+ "BM_string_memcpy/208/2/1/iterations:1\n"
+ "BM_string_memcpy/208/2/2/iterations:1\n"
+ "BM_string_memcpy/208/2/4/iterations:1\n"
+ "BM_string_memcpy/208/2/8/iterations:1\n"
+ "BM_string_memcpy/208/2/16/iterations:1\n"
+ "BM_string_memcpy/208/2/32/iterations:1\n"
+ "BM_string_memcpy/208/4/1/iterations:1\n"
+ "BM_string_memcpy/208/4/2/iterations:1\n"
+ "BM_string_memcpy/208/4/4/iterations:1\n"
+ "BM_string_memcpy/208/4/8/iterations:1\n"
+ "BM_string_memcpy/208/4/16/iterations:1\n"
+ "BM_string_memcpy/208/4/32/iterations:1\n"
+ "BM_string_memcpy/208/8/1/iterations:1\n"
+ "BM_string_memcpy/208/8/2/iterations:1\n"
+ "BM_string_memcpy/208/8/4/iterations:1\n"
+ "BM_string_memcpy/208/8/8/iterations:1\n"
+ "BM_string_memcpy/208/8/16/iterations:1\n"
+ "BM_string_memcpy/208/8/32/iterations:1\n"
+ "BM_string_memcpy/208/16/1/iterations:1\n"
+ "BM_string_memcpy/208/16/2/iterations:1\n"
+ "BM_string_memcpy/208/16/4/iterations:1\n"
+ "BM_string_memcpy/208/16/8/iterations:1\n"
+ "BM_string_memcpy/208/16/16/iterations:1\n"
+ "BM_string_memcpy/208/16/32/iterations:1\n"
+ "BM_string_memcpy/208/32/1/iterations:1\n"
+ "BM_string_memcpy/208/32/2/iterations:1\n"
+ "BM_string_memcpy/208/32/4/iterations:1\n"
+ "BM_string_memcpy/208/32/8/iterations:1\n"
+ "BM_string_memcpy/208/32/16/iterations:1\n"
+ "BM_string_memcpy/208/32/32/iterations:1\n"
+ "BM_string_memcpy/224/0/0/iterations:1\n"
+ "BM_string_memcpy/224/1/1/iterations:1\n"
+ "BM_string_memcpy/224/1/2/iterations:1\n"
+ "BM_string_memcpy/224/1/4/iterations:1\n"
+ "BM_string_memcpy/224/1/8/iterations:1\n"
+ "BM_string_memcpy/224/1/16/iterations:1\n"
+ "BM_string_memcpy/224/1/32/iterations:1\n"
+ "BM_string_memcpy/224/2/1/iterations:1\n"
+ "BM_string_memcpy/224/2/2/iterations:1\n"
+ "BM_string_memcpy/224/2/4/iterations:1\n"
+ "BM_string_memcpy/224/2/8/iterations:1\n"
+ "BM_string_memcpy/224/2/16/iterations:1\n"
+ "BM_string_memcpy/224/2/32/iterations:1\n"
+ "BM_string_memcpy/224/4/1/iterations:1\n"
+ "BM_string_memcpy/224/4/2/iterations:1\n"
+ "BM_string_memcpy/224/4/4/iterations:1\n"
+ "BM_string_memcpy/224/4/8/iterations:1\n"
+ "BM_string_memcpy/224/4/16/iterations:1\n"
+ "BM_string_memcpy/224/4/32/iterations:1\n"
+ "BM_string_memcpy/224/8/1/iterations:1\n"
+ "BM_string_memcpy/224/8/2/iterations:1\n"
+ "BM_string_memcpy/224/8/4/iterations:1\n"
+ "BM_string_memcpy/224/8/8/iterations:1\n"
+ "BM_string_memcpy/224/8/16/iterations:1\n"
+ "BM_string_memcpy/224/8/32/iterations:1\n"
+ "BM_string_memcpy/224/16/1/iterations:1\n"
+ "BM_string_memcpy/224/16/2/iterations:1\n"
+ "BM_string_memcpy/224/16/4/iterations:1\n"
+ "BM_string_memcpy/224/16/8/iterations:1\n"
+ "BM_string_memcpy/224/16/16/iterations:1\n"
+ "BM_string_memcpy/224/16/32/iterations:1\n"
+ "BM_string_memcpy/224/32/1/iterations:1\n"
+ "BM_string_memcpy/224/32/2/iterations:1\n"
+ "BM_string_memcpy/224/32/4/iterations:1\n"
+ "BM_string_memcpy/224/32/8/iterations:1\n"
+ "BM_string_memcpy/224/32/16/iterations:1\n"
+ "BM_string_memcpy/224/32/32/iterations:1\n"
+ "BM_string_memcpy/240/0/0/iterations:1\n"
+ "BM_string_memcpy/240/1/1/iterations:1\n"
+ "BM_string_memcpy/240/1/2/iterations:1\n"
+ "BM_string_memcpy/240/1/4/iterations:1\n"
+ "BM_string_memcpy/240/1/8/iterations:1\n"
+ "BM_string_memcpy/240/1/16/iterations:1\n"
+ "BM_string_memcpy/240/1/32/iterations:1\n"
+ "BM_string_memcpy/240/2/1/iterations:1\n"
+ "BM_string_memcpy/240/2/2/iterations:1\n"
+ "BM_string_memcpy/240/2/4/iterations:1\n"
+ "BM_string_memcpy/240/2/8/iterations:1\n"
+ "BM_string_memcpy/240/2/16/iterations:1\n"
+ "BM_string_memcpy/240/2/32/iterations:1\n"
+ "BM_string_memcpy/240/4/1/iterations:1\n"
+ "BM_string_memcpy/240/4/2/iterations:1\n"
+ "BM_string_memcpy/240/4/4/iterations:1\n"
+ "BM_string_memcpy/240/4/8/iterations:1\n"
+ "BM_string_memcpy/240/4/16/iterations:1\n"
+ "BM_string_memcpy/240/4/32/iterations:1\n"
+ "BM_string_memcpy/240/8/1/iterations:1\n"
+ "BM_string_memcpy/240/8/2/iterations:1\n"
+ "BM_string_memcpy/240/8/4/iterations:1\n"
+ "BM_string_memcpy/240/8/8/iterations:1\n"
+ "BM_string_memcpy/240/8/16/iterations:1\n"
+ "BM_string_memcpy/240/8/32/iterations:1\n"
+ "BM_string_memcpy/240/16/1/iterations:1\n"
+ "BM_string_memcpy/240/16/2/iterations:1\n"
+ "BM_string_memcpy/240/16/4/iterations:1\n"
+ "BM_string_memcpy/240/16/8/iterations:1\n"
+ "BM_string_memcpy/240/16/16/iterations:1\n"
+ "BM_string_memcpy/240/16/32/iterations:1\n"
+ "BM_string_memcpy/240/32/1/iterations:1\n"
+ "BM_string_memcpy/240/32/2/iterations:1\n"
+ "BM_string_memcpy/240/32/4/iterations:1\n"
+ "BM_string_memcpy/240/32/8/iterations:1\n"
+ "BM_string_memcpy/240/32/16/iterations:1\n"
+ "BM_string_memcpy/240/32/32/iterations:1\n"
+ "BM_string_memcpy/256/0/0/iterations:1\n"
+ "BM_string_memcpy/256/1/1/iterations:1\n"
+ "BM_string_memcpy/256/1/2/iterations:1\n"
+ "BM_string_memcpy/256/1/4/iterations:1\n"
+ "BM_string_memcpy/256/1/8/iterations:1\n"
+ "BM_string_memcpy/256/1/16/iterations:1\n"
+ "BM_string_memcpy/256/1/32/iterations:1\n"
+ "BM_string_memcpy/256/2/1/iterations:1\n"
+ "BM_string_memcpy/256/2/2/iterations:1\n"
+ "BM_string_memcpy/256/2/4/iterations:1\n"
+ "BM_string_memcpy/256/2/8/iterations:1\n"
+ "BM_string_memcpy/256/2/16/iterations:1\n"
+ "BM_string_memcpy/256/2/32/iterations:1\n"
+ "BM_string_memcpy/256/4/1/iterations:1\n"
+ "BM_string_memcpy/256/4/2/iterations:1\n"
+ "BM_string_memcpy/256/4/4/iterations:1\n"
+ "BM_string_memcpy/256/4/8/iterations:1\n"
+ "BM_string_memcpy/256/4/16/iterations:1\n"
+ "BM_string_memcpy/256/4/32/iterations:1\n"
+ "BM_string_memcpy/256/8/1/iterations:1\n"
+ "BM_string_memcpy/256/8/2/iterations:1\n"
+ "BM_string_memcpy/256/8/4/iterations:1\n"
+ "BM_string_memcpy/256/8/8/iterations:1\n"
+ "BM_string_memcpy/256/8/16/iterations:1\n"
+ "BM_string_memcpy/256/8/32/iterations:1\n"
+ "BM_string_memcpy/256/16/1/iterations:1\n"
+ "BM_string_memcpy/256/16/2/iterations:1\n"
+ "BM_string_memcpy/256/16/4/iterations:1\n"
+ "BM_string_memcpy/256/16/8/iterations:1\n"
+ "BM_string_memcpy/256/16/16/iterations:1\n"
+ "BM_string_memcpy/256/16/32/iterations:1\n"
+ "BM_string_memcpy/256/32/1/iterations:1\n"
+ "BM_string_memcpy/256/32/2/iterations:1\n"
+ "BM_string_memcpy/256/32/4/iterations:1\n"
+ "BM_string_memcpy/256/32/8/iterations:1\n"
+ "BM_string_memcpy/256/32/16/iterations:1\n"
+ "BM_string_memcpy/256/32/32/iterations:1\n"
+ "BM_string_memcpy/512/0/0/iterations:1\n"
+ "BM_string_memcpy/512/1/1/iterations:1\n"
+ "BM_string_memcpy/512/1/2/iterations:1\n"
+ "BM_string_memcpy/512/1/4/iterations:1\n"
+ "BM_string_memcpy/512/1/8/iterations:1\n"
+ "BM_string_memcpy/512/1/16/iterations:1\n"
+ "BM_string_memcpy/512/1/32/iterations:1\n"
+ "BM_string_memcpy/512/2/1/iterations:1\n"
+ "BM_string_memcpy/512/2/2/iterations:1\n"
+ "BM_string_memcpy/512/2/4/iterations:1\n"
+ "BM_string_memcpy/512/2/8/iterations:1\n"
+ "BM_string_memcpy/512/2/16/iterations:1\n"
+ "BM_string_memcpy/512/2/32/iterations:1\n"
+ "BM_string_memcpy/512/4/1/iterations:1\n"
+ "BM_string_memcpy/512/4/2/iterations:1\n"
+ "BM_string_memcpy/512/4/4/iterations:1\n"
+ "BM_string_memcpy/512/4/8/iterations:1\n"
+ "BM_string_memcpy/512/4/16/iterations:1\n"
+ "BM_string_memcpy/512/4/32/iterations:1\n"
+ "BM_string_memcpy/512/8/1/iterations:1\n"
+ "BM_string_memcpy/512/8/2/iterations:1\n"
+ "BM_string_memcpy/512/8/4/iterations:1\n"
+ "BM_string_memcpy/512/8/8/iterations:1\n"
+ "BM_string_memcpy/512/8/16/iterations:1\n"
+ "BM_string_memcpy/512/8/32/iterations:1\n"
+ "BM_string_memcpy/512/16/1/iterations:1\n"
+ "BM_string_memcpy/512/16/2/iterations:1\n"
+ "BM_string_memcpy/512/16/4/iterations:1\n"
+ "BM_string_memcpy/512/16/8/iterations:1\n"
+ "BM_string_memcpy/512/16/16/iterations:1\n"
+ "BM_string_memcpy/512/16/32/iterations:1\n"
+ "BM_string_memcpy/512/32/1/iterations:1\n"
+ "BM_string_memcpy/512/32/2/iterations:1\n"
+ "BM_string_memcpy/512/32/4/iterations:1\n"
+ "BM_string_memcpy/512/32/8/iterations:1\n"
+ "BM_string_memcpy/512/32/16/iterations:1\n"
+ "BM_string_memcpy/512/32/32/iterations:1\n"
+ "BM_string_memcpy/1024/0/0/iterations:1\n"
+ "BM_string_memcpy/1024/1/1/iterations:1\n"
+ "BM_string_memcpy/1024/1/2/iterations:1\n"
+ "BM_string_memcpy/1024/1/4/iterations:1\n"
+ "BM_string_memcpy/1024/1/8/iterations:1\n"
+ "BM_string_memcpy/1024/1/16/iterations:1\n"
+ "BM_string_memcpy/1024/1/32/iterations:1\n"
+ "BM_string_memcpy/1024/2/1/iterations:1\n"
+ "BM_string_memcpy/1024/2/2/iterations:1\n"
+ "BM_string_memcpy/1024/2/4/iterations:1\n"
+ "BM_string_memcpy/1024/2/8/iterations:1\n"
+ "BM_string_memcpy/1024/2/16/iterations:1\n"
+ "BM_string_memcpy/1024/2/32/iterations:1\n"
+ "BM_string_memcpy/1024/4/1/iterations:1\n"
+ "BM_string_memcpy/1024/4/2/iterations:1\n"
+ "BM_string_memcpy/1024/4/4/iterations:1\n"
+ "BM_string_memcpy/1024/4/8/iterations:1\n"
+ "BM_string_memcpy/1024/4/16/iterations:1\n"
+ "BM_string_memcpy/1024/4/32/iterations:1\n"
+ "BM_string_memcpy/1024/8/1/iterations:1\n"
+ "BM_string_memcpy/1024/8/2/iterations:1\n"
+ "BM_string_memcpy/1024/8/4/iterations:1\n"
+ "BM_string_memcpy/1024/8/8/iterations:1\n"
+ "BM_string_memcpy/1024/8/16/iterations:1\n"
+ "BM_string_memcpy/1024/8/32/iterations:1\n"
+ "BM_string_memcpy/1024/16/1/iterations:1\n"
+ "BM_string_memcpy/1024/16/2/iterations:1\n"
+ "BM_string_memcpy/1024/16/4/iterations:1\n"
+ "BM_string_memcpy/1024/16/8/iterations:1\n"
+ "BM_string_memcpy/1024/16/16/iterations:1\n"
+ "BM_string_memcpy/1024/16/32/iterations:1\n"
+ "BM_string_memcpy/1024/32/1/iterations:1\n"
+ "BM_string_memcpy/1024/32/2/iterations:1\n"
+ "BM_string_memcpy/1024/32/4/iterations:1\n"
+ "BM_string_memcpy/1024/32/8/iterations:1\n"
+ "BM_string_memcpy/1024/32/16/iterations:1\n"
+ "BM_string_memcpy/1024/32/32/iterations:1\n"
+ "BM_string_memcpy/8192/0/0/iterations:1\n"
+ "BM_string_memcpy/8192/1/1/iterations:1\n"
+ "BM_string_memcpy/8192/1/2/iterations:1\n"
+ "BM_string_memcpy/8192/1/4/iterations:1\n"
+ "BM_string_memcpy/8192/1/8/iterations:1\n"
+ "BM_string_memcpy/8192/1/16/iterations:1\n"
+ "BM_string_memcpy/8192/1/32/iterations:1\n"
+ "BM_string_memcpy/8192/2/1/iterations:1\n"
+ "BM_string_memcpy/8192/2/2/iterations:1\n"
+ "BM_string_memcpy/8192/2/4/iterations:1\n"
+ "BM_string_memcpy/8192/2/8/iterations:1\n"
+ "BM_string_memcpy/8192/2/16/iterations:1\n"
+ "BM_string_memcpy/8192/2/32/iterations:1\n"
+ "BM_string_memcpy/8192/4/1/iterations:1\n"
+ "BM_string_memcpy/8192/4/2/iterations:1\n"
+ "BM_string_memcpy/8192/4/4/iterations:1\n"
+ "BM_string_memcpy/8192/4/8/iterations:1\n"
+ "BM_string_memcpy/8192/4/16/iterations:1\n"
+ "BM_string_memcpy/8192/4/32/iterations:1\n"
+ "BM_string_memcpy/8192/8/1/iterations:1\n"
+ "BM_string_memcpy/8192/8/2/iterations:1\n"
+ "BM_string_memcpy/8192/8/4/iterations:1\n"
+ "BM_string_memcpy/8192/8/8/iterations:1\n"
+ "BM_string_memcpy/8192/8/16/iterations:1\n"
+ "BM_string_memcpy/8192/8/32/iterations:1\n"
+ "BM_string_memcpy/8192/16/1/iterations:1\n"
+ "BM_string_memcpy/8192/16/2/iterations:1\n"
+ "BM_string_memcpy/8192/16/4/iterations:1\n"
+ "BM_string_memcpy/8192/16/8/iterations:1\n"
+ "BM_string_memcpy/8192/16/16/iterations:1\n"
+ "BM_string_memcpy/8192/16/32/iterations:1\n"
+ "BM_string_memcpy/8192/32/1/iterations:1\n"
+ "BM_string_memcpy/8192/32/2/iterations:1\n"
+ "BM_string_memcpy/8192/32/4/iterations:1\n"
+ "BM_string_memcpy/8192/32/8/iterations:1\n"
+ "BM_string_memcpy/8192/32/16/iterations:1\n"
+ "BM_string_memcpy/8192/32/32/iterations:1\n"
+ "BM_string_memcpy/16384/0/0/iterations:1\n"
+ "BM_string_memcpy/16384/1/1/iterations:1\n"
+ "BM_string_memcpy/16384/1/2/iterations:1\n"
+ "BM_string_memcpy/16384/1/4/iterations:1\n"
+ "BM_string_memcpy/16384/1/8/iterations:1\n"
+ "BM_string_memcpy/16384/1/16/iterations:1\n"
+ "BM_string_memcpy/16384/1/32/iterations:1\n"
+ "BM_string_memcpy/16384/2/1/iterations:1\n"
+ "BM_string_memcpy/16384/2/2/iterations:1\n"
+ "BM_string_memcpy/16384/2/4/iterations:1\n"
+ "BM_string_memcpy/16384/2/8/iterations:1\n"
+ "BM_string_memcpy/16384/2/16/iterations:1\n"
+ "BM_string_memcpy/16384/2/32/iterations:1\n"
+ "BM_string_memcpy/16384/4/1/iterations:1\n"
+ "BM_string_memcpy/16384/4/2/iterations:1\n"
+ "BM_string_memcpy/16384/4/4/iterations:1\n"
+ "BM_string_memcpy/16384/4/8/iterations:1\n"
+ "BM_string_memcpy/16384/4/16/iterations:1\n"
+ "BM_string_memcpy/16384/4/32/iterations:1\n"
+ "BM_string_memcpy/16384/8/1/iterations:1\n"
+ "BM_string_memcpy/16384/8/2/iterations:1\n"
+ "BM_string_memcpy/16384/8/4/iterations:1\n"
+ "BM_string_memcpy/16384/8/8/iterations:1\n"
+ "BM_string_memcpy/16384/8/16/iterations:1\n"
+ "BM_string_memcpy/16384/8/32/iterations:1\n"
+ "BM_string_memcpy/16384/16/1/iterations:1\n"
+ "BM_string_memcpy/16384/16/2/iterations:1\n"
+ "BM_string_memcpy/16384/16/4/iterations:1\n"
+ "BM_string_memcpy/16384/16/8/iterations:1\n"
+ "BM_string_memcpy/16384/16/16/iterations:1\n"
+ "BM_string_memcpy/16384/16/32/iterations:1\n"
+ "BM_string_memcpy/16384/32/1/iterations:1\n"
+ "BM_string_memcpy/16384/32/2/iterations:1\n"
+ "BM_string_memcpy/16384/32/4/iterations:1\n"
+ "BM_string_memcpy/16384/32/8/iterations:1\n"
+ "BM_string_memcpy/16384/32/16/iterations:1\n"
+ "BM_string_memcpy/16384/32/32/iterations:1\n"
+ "BM_string_memcpy/32768/0/0/iterations:1\n"
+ "BM_string_memcpy/32768/1/1/iterations:1\n"
+ "BM_string_memcpy/32768/1/2/iterations:1\n"
+ "BM_string_memcpy/32768/1/4/iterations:1\n"
+ "BM_string_memcpy/32768/1/8/iterations:1\n"
+ "BM_string_memcpy/32768/1/16/iterations:1\n"
+ "BM_string_memcpy/32768/1/32/iterations:1\n"
+ "BM_string_memcpy/32768/2/1/iterations:1\n"
+ "BM_string_memcpy/32768/2/2/iterations:1\n"
+ "BM_string_memcpy/32768/2/4/iterations:1\n"
+ "BM_string_memcpy/32768/2/8/iterations:1\n"
+ "BM_string_memcpy/32768/2/16/iterations:1\n"
+ "BM_string_memcpy/32768/2/32/iterations:1\n"
+ "BM_string_memcpy/32768/4/1/iterations:1\n"
+ "BM_string_memcpy/32768/4/2/iterations:1\n"
+ "BM_string_memcpy/32768/4/4/iterations:1\n"
+ "BM_string_memcpy/32768/4/8/iterations:1\n"
+ "BM_string_memcpy/32768/4/16/iterations:1\n"
+ "BM_string_memcpy/32768/4/32/iterations:1\n"
+ "BM_string_memcpy/32768/8/1/iterations:1\n"
+ "BM_string_memcpy/32768/8/2/iterations:1\n"
+ "BM_string_memcpy/32768/8/4/iterations:1\n"
+ "BM_string_memcpy/32768/8/8/iterations:1\n"
+ "BM_string_memcpy/32768/8/16/iterations:1\n"
+ "BM_string_memcpy/32768/8/32/iterations:1\n"
+ "BM_string_memcpy/32768/16/1/iterations:1\n"
+ "BM_string_memcpy/32768/16/2/iterations:1\n"
+ "BM_string_memcpy/32768/16/4/iterations:1\n"
+ "BM_string_memcpy/32768/16/8/iterations:1\n"
+ "BM_string_memcpy/32768/16/16/iterations:1\n"
+ "BM_string_memcpy/32768/16/32/iterations:1\n"
+ "BM_string_memcpy/32768/32/1/iterations:1\n"
+ "BM_string_memcpy/32768/32/2/iterations:1\n"
+ "BM_string_memcpy/32768/32/4/iterations:1\n"
+ "BM_string_memcpy/32768/32/8/iterations:1\n"
+ "BM_string_memcpy/32768/32/16/iterations:1\n"
+ "BM_string_memcpy/32768/32/32/iterations:1\n"
+ "BM_string_memcpy/65536/0/0/iterations:1\n"
+ "BM_string_memcpy/65536/1/1/iterations:1\n"
+ "BM_string_memcpy/65536/1/2/iterations:1\n"
+ "BM_string_memcpy/65536/1/4/iterations:1\n"
+ "BM_string_memcpy/65536/1/8/iterations:1\n"
+ "BM_string_memcpy/65536/1/16/iterations:1\n"
+ "BM_string_memcpy/65536/1/32/iterations:1\n"
+ "BM_string_memcpy/65536/2/1/iterations:1\n"
+ "BM_string_memcpy/65536/2/2/iterations:1\n"
+ "BM_string_memcpy/65536/2/4/iterations:1\n"
+ "BM_string_memcpy/65536/2/8/iterations:1\n"
+ "BM_string_memcpy/65536/2/16/iterations:1\n"
+ "BM_string_memcpy/65536/2/32/iterations:1\n"
+ "BM_string_memcpy/65536/4/1/iterations:1\n"
+ "BM_string_memcpy/65536/4/2/iterations:1\n"
+ "BM_string_memcpy/65536/4/4/iterations:1\n"
+ "BM_string_memcpy/65536/4/8/iterations:1\n"
+ "BM_string_memcpy/65536/4/16/iterations:1\n"
+ "BM_string_memcpy/65536/4/32/iterations:1\n"
+ "BM_string_memcpy/65536/8/1/iterations:1\n"
+ "BM_string_memcpy/65536/8/2/iterations:1\n"
+ "BM_string_memcpy/65536/8/4/iterations:1\n"
+ "BM_string_memcpy/65536/8/8/iterations:1\n"
+ "BM_string_memcpy/65536/8/16/iterations:1\n"
+ "BM_string_memcpy/65536/8/32/iterations:1\n"
+ "BM_string_memcpy/65536/16/1/iterations:1\n"
+ "BM_string_memcpy/65536/16/2/iterations:1\n"
+ "BM_string_memcpy/65536/16/4/iterations:1\n"
+ "BM_string_memcpy/65536/16/8/iterations:1\n"
+ "BM_string_memcpy/65536/16/16/iterations:1\n"
+ "BM_string_memcpy/65536/16/32/iterations:1\n"
+ "BM_string_memcpy/65536/32/1/iterations:1\n"
+ "BM_string_memcpy/65536/32/2/iterations:1\n"
+ "BM_string_memcpy/65536/32/4/iterations:1\n"
+ "BM_string_memcpy/65536/32/8/iterations:1\n"
+ "BM_string_memcpy/65536/32/16/iterations:1\n"
+ "BM_string_memcpy/65536/32/32/iterations:1\n"
+ "BM_string_memcpy/131072/0/0/iterations:1\n"
+ "BM_string_memcpy/131072/1/1/iterations:1\n"
+ "BM_string_memcpy/131072/1/2/iterations:1\n"
+ "BM_string_memcpy/131072/1/4/iterations:1\n"
+ "BM_string_memcpy/131072/1/8/iterations:1\n"
+ "BM_string_memcpy/131072/1/16/iterations:1\n"
+ "BM_string_memcpy/131072/1/32/iterations:1\n"
+ "BM_string_memcpy/131072/2/1/iterations:1\n"
+ "BM_string_memcpy/131072/2/2/iterations:1\n"
+ "BM_string_memcpy/131072/2/4/iterations:1\n"
+ "BM_string_memcpy/131072/2/8/iterations:1\n"
+ "BM_string_memcpy/131072/2/16/iterations:1\n"
+ "BM_string_memcpy/131072/2/32/iterations:1\n"
+ "BM_string_memcpy/131072/4/1/iterations:1\n"
+ "BM_string_memcpy/131072/4/2/iterations:1\n"
+ "BM_string_memcpy/131072/4/4/iterations:1\n"
+ "BM_string_memcpy/131072/4/8/iterations:1\n"
+ "BM_string_memcpy/131072/4/16/iterations:1\n"
+ "BM_string_memcpy/131072/4/32/iterations:1\n"
+ "BM_string_memcpy/131072/8/1/iterations:1\n"
+ "BM_string_memcpy/131072/8/2/iterations:1\n"
+ "BM_string_memcpy/131072/8/4/iterations:1\n"
+ "BM_string_memcpy/131072/8/8/iterations:1\n"
+ "BM_string_memcpy/131072/8/16/iterations:1\n"
+ "BM_string_memcpy/131072/8/32/iterations:1\n"
+ "BM_string_memcpy/131072/16/1/iterations:1\n"
+ "BM_string_memcpy/131072/16/2/iterations:1\n"
+ "BM_string_memcpy/131072/16/4/iterations:1\n"
+ "BM_string_memcpy/131072/16/8/iterations:1\n"
+ "BM_string_memcpy/131072/16/16/iterations:1\n"
+ "BM_string_memcpy/131072/16/32/iterations:1\n"
+ "BM_string_memcpy/131072/32/1/iterations:1\n"
+ "BM_string_memcpy/131072/32/2/iterations:1\n"
+ "BM_string_memcpy/131072/32/4/iterations:1\n"
+ "BM_string_memcpy/131072/32/8/iterations:1\n"
+ "BM_string_memcpy/131072/32/16/iterations:1\n"
+ "BM_string_memcpy/131072/32/32/iterations:1\n"
+ "BM_string_memcpy/262144/0/0/iterations:1\n"
+ "BM_string_memcpy/262144/1/1/iterations:1\n"
+ "BM_string_memcpy/262144/1/2/iterations:1\n"
+ "BM_string_memcpy/262144/1/4/iterations:1\n"
+ "BM_string_memcpy/262144/1/8/iterations:1\n"
+ "BM_string_memcpy/262144/1/16/iterations:1\n"
+ "BM_string_memcpy/262144/1/32/iterations:1\n"
+ "BM_string_memcpy/262144/2/1/iterations:1\n"
+ "BM_string_memcpy/262144/2/2/iterations:1\n"
+ "BM_string_memcpy/262144/2/4/iterations:1\n"
+ "BM_string_memcpy/262144/2/8/iterations:1\n"
+ "BM_string_memcpy/262144/2/16/iterations:1\n"
+ "BM_string_memcpy/262144/2/32/iterations:1\n"
+ "BM_string_memcpy/262144/4/1/iterations:1\n"
+ "BM_string_memcpy/262144/4/2/iterations:1\n"
+ "BM_string_memcpy/262144/4/4/iterations:1\n"
+ "BM_string_memcpy/262144/4/8/iterations:1\n"
+ "BM_string_memcpy/262144/4/16/iterations:1\n"
+ "BM_string_memcpy/262144/4/32/iterations:1\n"
+ "BM_string_memcpy/262144/8/1/iterations:1\n"
+ "BM_string_memcpy/262144/8/2/iterations:1\n"
+ "BM_string_memcpy/262144/8/4/iterations:1\n"
+ "BM_string_memcpy/262144/8/8/iterations:1\n"
+ "BM_string_memcpy/262144/8/16/iterations:1\n"
+ "BM_string_memcpy/262144/8/32/iterations:1\n"
+ "BM_string_memcpy/262144/16/1/iterations:1\n"
+ "BM_string_memcpy/262144/16/2/iterations:1\n"
+ "BM_string_memcpy/262144/16/4/iterations:1\n"
+ "BM_string_memcpy/262144/16/8/iterations:1\n"
+ "BM_string_memcpy/262144/16/16/iterations:1\n"
+ "BM_string_memcpy/262144/16/32/iterations:1\n"
+ "BM_string_memcpy/262144/32/1/iterations:1\n"
+ "BM_string_memcpy/262144/32/2/iterations:1\n"
+ "BM_string_memcpy/262144/32/4/iterations:1\n"
+ "BM_string_memcpy/262144/32/8/iterations:1\n"
+ "BM_string_memcpy/262144/32/16/iterations:1\n"
+ "BM_string_memcpy/262144/32/32/iterations:1\n"
+ "BM_string_memcpy/524288/0/0/iterations:1\n"
+ "BM_string_memcpy/524288/1/1/iterations:1\n"
+ "BM_string_memcpy/524288/1/2/iterations:1\n"
+ "BM_string_memcpy/524288/1/4/iterations:1\n"
+ "BM_string_memcpy/524288/1/8/iterations:1\n"
+ "BM_string_memcpy/524288/1/16/iterations:1\n"
+ "BM_string_memcpy/524288/1/32/iterations:1\n"
+ "BM_string_memcpy/524288/2/1/iterations:1\n"
+ "BM_string_memcpy/524288/2/2/iterations:1\n"
+ "BM_string_memcpy/524288/2/4/iterations:1\n"
+ "BM_string_memcpy/524288/2/8/iterations:1\n"
+ "BM_string_memcpy/524288/2/16/iterations:1\n"
+ "BM_string_memcpy/524288/2/32/iterations:1\n"
+ "BM_string_memcpy/524288/4/1/iterations:1\n"
+ "BM_string_memcpy/524288/4/2/iterations:1\n"
+ "BM_string_memcpy/524288/4/4/iterations:1\n"
+ "BM_string_memcpy/524288/4/8/iterations:1\n"
+ "BM_string_memcpy/524288/4/16/iterations:1\n"
+ "BM_string_memcpy/524288/4/32/iterations:1\n"
+ "BM_string_memcpy/524288/8/1/iterations:1\n"
+ "BM_string_memcpy/524288/8/2/iterations:1\n"
+ "BM_string_memcpy/524288/8/4/iterations:1\n"
+ "BM_string_memcpy/524288/8/8/iterations:1\n"
+ "BM_string_memcpy/524288/8/16/iterations:1\n"
+ "BM_string_memcpy/524288/8/32/iterations:1\n"
+ "BM_string_memcpy/524288/16/1/iterations:1\n"
+ "BM_string_memcpy/524288/16/2/iterations:1\n"
+ "BM_string_memcpy/524288/16/4/iterations:1\n"
+ "BM_string_memcpy/524288/16/8/iterations:1\n"
+ "BM_string_memcpy/524288/16/16/iterations:1\n"
+ "BM_string_memcpy/524288/16/32/iterations:1\n"
+ "BM_string_memcpy/524288/32/1/iterations:1\n"
+ "BM_string_memcpy/524288/32/2/iterations:1\n"
+ "BM_string_memcpy/524288/32/4/iterations:1\n"
+ "BM_string_memcpy/524288/32/8/iterations:1\n"
+ "BM_string_memcpy/524288/32/16/iterations:1\n"
+ "BM_string_memcpy/524288/32/32/iterations:1\n"
+ "BM_string_memcpy/1048576/0/0/iterations:1\n"
+ "BM_string_memcpy/1048576/1/1/iterations:1\n"
+ "BM_string_memcpy/1048576/1/2/iterations:1\n"
+ "BM_string_memcpy/1048576/1/4/iterations:1\n"
+ "BM_string_memcpy/1048576/1/8/iterations:1\n"
+ "BM_string_memcpy/1048576/1/16/iterations:1\n"
+ "BM_string_memcpy/1048576/1/32/iterations:1\n"
+ "BM_string_memcpy/1048576/2/1/iterations:1\n"
+ "BM_string_memcpy/1048576/2/2/iterations:1\n"
+ "BM_string_memcpy/1048576/2/4/iterations:1\n"
+ "BM_string_memcpy/1048576/2/8/iterations:1\n"
+ "BM_string_memcpy/1048576/2/16/iterations:1\n"
+ "BM_string_memcpy/1048576/2/32/iterations:1\n"
+ "BM_string_memcpy/1048576/4/1/iterations:1\n"
+ "BM_string_memcpy/1048576/4/2/iterations:1\n"
+ "BM_string_memcpy/1048576/4/4/iterations:1\n"
+ "BM_string_memcpy/1048576/4/8/iterations:1\n"
+ "BM_string_memcpy/1048576/4/16/iterations:1\n"
+ "BM_string_memcpy/1048576/4/32/iterations:1\n"
+ "BM_string_memcpy/1048576/8/1/iterations:1\n"
+ "BM_string_memcpy/1048576/8/2/iterations:1\n"
+ "BM_string_memcpy/1048576/8/4/iterations:1\n"
+ "BM_string_memcpy/1048576/8/8/iterations:1\n"
+ "BM_string_memcpy/1048576/8/16/iterations:1\n"
+ "BM_string_memcpy/1048576/8/32/iterations:1\n"
+ "BM_string_memcpy/1048576/16/1/iterations:1\n"
+ "BM_string_memcpy/1048576/16/2/iterations:1\n"
+ "BM_string_memcpy/1048576/16/4/iterations:1\n"
+ "BM_string_memcpy/1048576/16/8/iterations:1\n"
+ "BM_string_memcpy/1048576/16/16/iterations:1\n"
+ "BM_string_memcpy/1048576/16/32/iterations:1\n"
+ "BM_string_memcpy/1048576/32/1/iterations:1\n"
+ "BM_string_memcpy/1048576/32/2/iterations:1\n"
+ "BM_string_memcpy/1048576/32/4/iterations:1\n"
+ "BM_string_memcpy/1048576/32/8/iterations:1\n"
+ "BM_string_memcpy/1048576/32/16/iterations:1\n"
+ "BM_string_memcpy/1048576/32/32/iterations:1\n"
+ "BM_string_memcpy/2097152/0/0/iterations:1\n"
+ "BM_string_memcpy/2097152/1/1/iterations:1\n"
+ "BM_string_memcpy/2097152/1/2/iterations:1\n"
+ "BM_string_memcpy/2097152/1/4/iterations:1\n"
+ "BM_string_memcpy/2097152/1/8/iterations:1\n"
+ "BM_string_memcpy/2097152/1/16/iterations:1\n"
+ "BM_string_memcpy/2097152/1/32/iterations:1\n"
+ "BM_string_memcpy/2097152/2/1/iterations:1\n"
+ "BM_string_memcpy/2097152/2/2/iterations:1\n"
+ "BM_string_memcpy/2097152/2/4/iterations:1\n"
+ "BM_string_memcpy/2097152/2/8/iterations:1\n"
+ "BM_string_memcpy/2097152/2/16/iterations:1\n"
+ "BM_string_memcpy/2097152/2/32/iterations:1\n"
+ "BM_string_memcpy/2097152/4/1/iterations:1\n"
+ "BM_string_memcpy/2097152/4/2/iterations:1\n"
+ "BM_string_memcpy/2097152/4/4/iterations:1\n"
+ "BM_string_memcpy/2097152/4/8/iterations:1\n"
+ "BM_string_memcpy/2097152/4/16/iterations:1\n"
+ "BM_string_memcpy/2097152/4/32/iterations:1\n"
+ "BM_string_memcpy/2097152/8/1/iterations:1\n"
+ "BM_string_memcpy/2097152/8/2/iterations:1\n"
+ "BM_string_memcpy/2097152/8/4/iterations:1\n"
+ "BM_string_memcpy/2097152/8/8/iterations:1\n"
+ "BM_string_memcpy/2097152/8/16/iterations:1\n"
+ "BM_string_memcpy/2097152/8/32/iterations:1\n"
+ "BM_string_memcpy/2097152/16/1/iterations:1\n"
+ "BM_string_memcpy/2097152/16/2/iterations:1\n"
+ "BM_string_memcpy/2097152/16/4/iterations:1\n"
+ "BM_string_memcpy/2097152/16/8/iterations:1\n"
+ "BM_string_memcpy/2097152/16/16/iterations:1\n"
+ "BM_string_memcpy/2097152/16/32/iterations:1\n"
+ "BM_string_memcpy/2097152/32/1/iterations:1\n"
+ "BM_string_memcpy/2097152/32/2/iterations:1\n"
+ "BM_string_memcpy/2097152/32/4/iterations:1\n"
+ "BM_string_memcpy/2097152/32/8/iterations:1\n"
+ "BM_string_memcpy/2097152/32/16/iterations:1\n"
+ "BM_string_memcpy/2097152/32/32/iterations:1\n";
Verify(expected, 0,
std::vector<const char*>{GetBionicXmlArg("test_alignment_twobuf.xml").c_str()});
diff --git a/docs/defines.md b/docs/defines.md
index 4775cd2..65cc873 100644
--- a/docs/defines.md
+++ b/docs/defines.md
@@ -54,13 +54,19 @@
work around issues with some of them, use these macros to detect the versinon of
the NDK you're being built with. Usually only `__NDK_MAJOR__` will be necessary.
-## `__arm__`, `__aarch64__`, `__i386__`, `__x86_64__`
+## `__arm__`/`__aarch64__`, `__i386__`/`__x86_64__`, `__riscv`
-If your code is specific to a particular processor architecture, use these
-macros to conditionally compile. Note that the ABI usually called `arm64` uses
-the macro `__aarch64__` and the ABI usually called `x86` uses `__i386__`.
+If your code is specific to a particular processor architecture, use
+these macros to conditionally compile. Note that the ABI usually called
+`arm64` uses the macro `__aarch64__` and the ABI usually called `x86` uses
+`__i386__`. Android only supports riscv64, so `__riscv` is a sufficient
+check for Android-only code. If you need to write code portable to other
+operating systems that do support riscv32, you'll also need to check
+whether `__riscv_xlen` is 32 or 64.
-## `__LP32__` and `__LP64__`
+## `__ILP32__` and `__LP64__`
-If your code depends on "bitness" -- whether `long` and pointers are 32- or
-64-bit -- use these macros to conditionally compile.
+If your code depends on "bitness" -- whether `long` and pointers are 32-
+or 64-bit -- use these macros to conditionally compile. Note the extra
+"I" in the 32-bit macro (since `int`, `long`, and pointers are all 32-bit
+on such systems, with `long long` being needed for a 64-bit type).
diff --git a/docs/status.md b/docs/status.md
index 411b140..3c5d1ba 100644
--- a/docs/status.md
+++ b/docs/status.md
@@ -56,7 +56,19 @@
Current libc symbols: https://android.googlesource.com/platform/bionic/+/master/libc/libc.map.txt
New libc functions in V (API level 35):
+ * `tcgetwinsize`, `tcsetwinsize` (POSIX Issue 8 additions).
* `timespec_getres` (C23 addition).
+ * `localtime_rz`, `mktime_z`, `tzalloc`, and `tzfree` (NetBSD
+ extensions implemented in tzcode, and the "least non-standard"
+ functions for avoiding $TZ if you need to use multiple timezones in
+ multi-threaded C).
+ * `mbsrtowcs_l` and `wcsrtombs_l` aliases for `mbsrtowcs` and `wcsrtombs`.
+ * New system call wrappers: `__riscv_flush_icache` (`<sys/cachectl.h>`),
+ `__riscv_hwprobe` (`<sys/hwprobe.h>`), `epoll_pwait2`/`epoll_pwait2_64` (`<sys/epoll.h>`).
+
+New libc behavior in V (API level 35):
+ * Added `LD_SHOW_AUXV` to the dynamic linker to dump the ELF auxiliary
+ vector if the environment variable is set.
New libc functions in U (API level 34):
* `close_range` and `copy_file_range` (Linux-specific GNU extensions).
diff --git a/libc/Android.bp b/libc/Android.bp
index ecabb06..68a0838 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -55,6 +55,7 @@
"-Wno-deprecated-declarations",
"-Wno-gcc-compat",
"-Wframe-larger-than=2048",
+ "-Wno-reorder-init-list",
// Try to catch typical 32-bit assumptions that break with 64-bit pointers.
"-Werror=pointer-to-int-cast",
@@ -133,6 +134,8 @@
lto: {
never: true,
},
+
+ apex_available: ["com.android.runtime"],
}
libc_scudo_product_variables = {
@@ -252,10 +255,11 @@
srcs: [
"tzcode/**/*.c",
"tzcode/bionic.cpp",
- // tzcode doesn't include strptime or wcsftime, so we use the OpenBSD
- // code (with some local changes in the strptime case).
+ // tzcode doesn't include strptime, so we use a fork of the
+ // OpenBSD code which needs this global data.
"upstream-openbsd/lib/libc/locale/_def_time.c",
- "upstream-openbsd/lib/libc/time/wcsftime.c",
+ // tzcode doesn't include wcsftime, so we use the FreeBSD code.
+ "upstream-freebsd/lib/libc/locale/wcsftime.c",
],
cflags: [
@@ -268,7 +272,7 @@
"-DTHREAD_SAFE=1",
// The name of the tm_gmtoff field in our struct tm.
"-DTM_GMTOFF=tm_gmtoff",
- // TZDEFAULT is not applicable to Android as there is no one file per time zone mapping
+ // Android uses a system property instead of /etc/localtime, so make callers crash.
"-DTZDEFAULT=NULL",
// Where we store our tzdata.
"-DTZDIR=\"/system/usr/share/zoneinfo\"",
@@ -284,7 +288,10 @@
"-Dlint",
],
- local_include_dirs: ["tzcode/"],
+ local_include_dirs: [
+ "tzcode/",
+ "upstream-freebsd/android/include",
+ ],
name: "libc_tzcode",
}
@@ -330,10 +337,16 @@
// automatically included.
cc_library_static {
+ name: "libc_freebsd_ldexp",
+ defaults: ["libc_defaults"],
+ cflags: ["-Dscalbn=ldexp"],
+ srcs: [":libc_ldexp_srcs"],
+}
+
+cc_library_static {
defaults: ["libc_defaults"],
tidy_disabled_srcs: ["upstream-*/**/*.c"],
srcs: [
- "upstream-freebsd/lib/libc/gen/ldexp.c",
"upstream-freebsd/lib/libc/stdlib/getopt_long.c",
"upstream-freebsd/lib/libc/stdlib/hcreate.c",
"upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
@@ -932,6 +945,21 @@
"arch-riscv64/bionic/setjmp.S",
"arch-riscv64/bionic/syscall.S",
"arch-riscv64/bionic/vfork.S",
+
+ "arch-riscv64/string/memchr_vext.S",
+ "arch-riscv64/string/memcmp_vext.S",
+ "arch-riscv64/string/memcpy_vext.S",
+ "arch-riscv64/string/memmove_vext.S",
+ "arch-riscv64/string/memset_vext.S",
+ "arch-riscv64/string/strcat_vext.S",
+ "arch-riscv64/string/strchr_vext.S",
+ "arch-riscv64/string/strcmp_vext.S",
+ "arch-riscv64/string/strcpy_vext.S",
+ "arch-riscv64/string/strlen_vext.S",
+ "arch-riscv64/string/strncat_vext.S",
+ "arch-riscv64/string/strncmp_vext.S",
+ "arch-riscv64/string/strncpy_vext.S",
+ "arch-riscv64/string/strnlen_vext.S",
],
},
@@ -1257,9 +1285,6 @@
srcs: [
"bionic/bionic_systrace.cpp",
],
- apex_available: [
- "com.android.runtime",
- ],
}
// ========================================================
@@ -1456,6 +1481,7 @@
"libc_fortify",
"libc_freebsd",
"libc_freebsd_large_stack",
+ "libc_freebsd_ldexp",
"libc_gdtoa",
"libc_netbsd",
"libc_openbsd_large_stack",
@@ -1490,6 +1516,7 @@
"libc_fortify",
"libc_freebsd",
"libc_freebsd_large_stack",
+ "libc_freebsd_ldexp",
"libc_gdtoa",
"libc_netbsd",
"libc_openbsd",
@@ -1541,6 +1568,9 @@
arm64: {
srcs: ["arch-arm64/static_function_dispatch.S"],
},
+ riscv64: {
+ srcs: ["arch-riscv64/static_function_dispatch.S"]
+ },
},
}
@@ -1569,6 +1599,9 @@
arm64: {
srcs: ["arch-arm64/dynamic_function_dispatch.cpp"],
},
+ riscv64: {
+ srcs: ["arch-riscv64/dynamic_function_dispatch.cpp"]
+ },
},
}
@@ -1806,7 +1839,6 @@
},
},
-
apex_available: [
"//apex_available:platform",
"com.android.runtime",
@@ -2070,6 +2102,9 @@
name: "libstdc++",
static_ndk_lib: true,
static_libs: ["libasync_safe"],
+ apex_available: [
+ "//apex_available:platform",
+ ],
static: {
system_shared_libs: [],
@@ -2248,6 +2283,8 @@
"bionic", // crtbegin.c includes bionic/libc_init_common.h
],
+ cflags: [ "-DCRTBEGIN_STATIC", ],
+
srcs: ["arch-common/bionic/crtbegin.c"],
objs: [
"crtbrand",
@@ -2453,8 +2490,6 @@
name: "libc",
symbol_file: "libc.map.txt",
first_version: "9",
- // APIs implemented in asm don't have debug info: http://b/190554910.
- allow_untyped_symbols: true,
export_header_libs: [
"common_libc",
"libc_uapi",
diff --git a/libc/NOTICE b/libc/NOTICE
index 4d3a108..daea7bc 100644
--- a/libc/NOTICE
+++ b/libc/NOTICE
@@ -63,38 +63,6 @@
-------------------------------------------------------------------
-Based on the UCB version with the ID appearing below.
-This is ANSIish only when "multibyte character == plain character".
-
-Copyright (c) 1989, 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) 1995, 1996, 1997, and 1998 WIDE Project.
All rights reserved.
@@ -3242,6 +3210,37 @@
Copyright (c) 2002 Tim J. Robbins
All rights reserved.
+Copyright (c) 2011 The FreeBSD Foundation
+
+Portions of this software were developed by David Chisnall
+under sponsorship from the FreeBSD Foundation.
+
+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.
+
+-------------------------------------------------------------------
+
+Copyright (c) 2002 Tim J. Robbins
+All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@@ -4540,6 +4539,34 @@
-------------------------------------------------------------------
+Copyright (c) 2023 SiFive, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the company may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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)1999 Citrus Project,
All rights reserved.
diff --git a/libc/SECCOMP_ALLOWLIST_COMMON.TXT b/libc/SECCOMP_ALLOWLIST_COMMON.TXT
index efbf28b..1d58475 100644
--- a/libc/SECCOMP_ALLOWLIST_COMMON.TXT
+++ b/libc/SECCOMP_ALLOWLIST_COMMON.TXT
@@ -11,12 +11,15 @@
# Syscalls used internally by bionic, but not exposed directly.
pid_t gettid() all
int futex(int*, int, int, const timespec*, int*, int) all
-int clone(int (*)(void*), void*, int, void*, ...) all
+pid_t clone(int (*)(void*), void*, int, void*, ...) all
int sigreturn(unsigned long) lp32
int rt_sigreturn(unsigned long) all
int rt_tgsigqueueinfo(pid_t, pid_t, int, siginfo_t*) all
int restart_syscall() all
+# The public API doesn't set errno, so we call this via inline assembler.
+int riscv_hwprobe(riscv_hwprobe*, size_t, size_t, unsigned long*, unsigned) riscv64
+
# vfork is used by bionic (and java.lang.ProcessBuilder) on some
# architectures. (The others use clone(2) directly instead.)
pid_t vfork() arm,x86,x86_64
@@ -53,6 +56,7 @@
int execveat(int, const char*, char* const*, char* const*, int) all
# Since Linux 4.3, not in glibc. Probed for and conditionally used by ART.
int membarrier(int, int) all
+int userfaultfd(int) all
# Since Linux 5.1, not in glibc. Not used by bionic, and not likely ever
# to be (because the last thing anyone needs is a new 32-bit ABI in the
# 2020s!) but http://b/138781460 showed cuttlefish needed at least the
@@ -73,5 +77,8 @@
int rt_sigtimedwait_time64(const sigset64_t*, siginfo_t*, const timespec64*, size_t) lp32
int futex_time64(int*, int, int, const timespec64*, int*, int) lp32
int sched_rr_get_interval_time64(pid_t, timespec64*) lp32
-# Since Linux 5.4, not in glibc. Probed for and conditionally used by ART.
-int userfaultfd(int) all
+# Since Linux 5.3, not in glibc. Not used by bionic, but increasingly
+# likely to be useful as new features are added. In particular, cgroups
+# support seems potentially useful for Android (though the struct that
+# changes size over time is obviously problematic).
+pid_t clone3(clone_args*, size_t) all
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 08017f1..0db5d79 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -161,7 +161,7 @@
int linkat(int, const char*, int, const char*, int) all
int mkdirat(int, const char*, mode_t) all
int mknodat(int, const char*, mode_t, dev_t) all
-int readlinkat(int, const char*, char*, size_t) all
+ssize_t readlinkat(int, const char*, char*, size_t) all
int renameat2(int, const char*, int, const char*, unsigned) all
int symlinkat(const char*, int, const char*) all
int unlinkat(int, const char*, int) all
@@ -322,6 +322,7 @@
int __epoll_create1:epoll_create1(int) all
int epoll_ctl(int, int op, int, struct epoll_event*) all
int __epoll_pwait:epoll_pwait(int, struct epoll_event*, int, int, const sigset64_t*, size_t) all
+int __epoll_pwait2:epoll_pwait2(int, struct epoll_event*, int, const timespec64*, const sigset64_t*, size_t) all
int __eventfd:eventfd2(unsigned int, int) all
@@ -356,7 +357,7 @@
int cacheflush:__ARM_NR_cacheflush(long start, long end, long flags) arm
# riscv64-specific
-int _flush_icache:riscv_flush_icache(void*, void*, unsigned long) riscv64
+int __riscv_flush_icache:riscv_flush_icache(void*, void*, unsigned long) riscv64
# x86-specific
int __set_thread_area:set_thread_area(void*) x86
diff --git a/libc/arch-arm64/bionic/vfork.S b/libc/arch-arm64/bionic/vfork.S
index 9eb82d8..9b19232 100644
--- a/libc/arch-arm64/bionic/vfork.S
+++ b/libc/arch-arm64/bionic/vfork.S
@@ -28,6 +28,7 @@
#include <platform/bionic/tls_defines.h>
#include <private/bionic_asm.h>
+#include <private/bionic_asm_offsets.h>
#include <asm/signal.h>
#include <linux/sched.h>
@@ -42,10 +43,29 @@
ldr w10, [x9, #20]
str w0, [x9, #20]
- // Clear vfork_child_stack_bottom_.
- str xzr, [x9, #776]
+ mov x0, #SIGCHLD
- mov x0, #(CLONE_VM | CLONE_VFORK | SIGCHLD)
+ // If either HWASan or stack MTE is enabled, set up the clone() flags to
+ // make vfork() act like fork(). We don't call the atfork handlers, so we
+ // may deadlock if the child allocates, but we have seen badly written
+ // atfork handlers themselves cause deadlocks [1]. ndk_translation already
+ // implements vfork() as fork() without calling handlers, so we have some
+ // evidence that it isn't necessary to call them.
+ //
+ // POSIX.1 defines vfork() to have the same effect as fork() except that
+ // most behavior, including heap allocation, becomes undefined in the child,
+ // so we aren't violating POSIX by doing this.
+ //
+ // [1] https://cs.android.com/android/platform/superproject/+/master:system/extras/simpleperf/app_api/cpp/simpleperf.cpp;drc=788fa4183441f4977ddbd5a055e42a7fe7691d21;l=308
+#if !__has_feature(hwaddress_sanitizer)
+ // if (!__libc_globals->memtag_stack) x0 |= CLONE_VM | CLONE_VFORK;
+ adrp x1, __libc_globals + OFFSETOF_libc_globals_memtag_stack
+ ldrb w1, [x1, :lo12:__libc_globals + OFFSETOF_libc_globals_memtag_stack]
+ cbnz w1, 1f
+ orr x0, x0, #CLONE_VM
+ orr x0, x0, #CLONE_VFORK
+1:
+#endif
mov x1, xzr
mov x2, xzr
mov x3, xzr
@@ -62,25 +82,6 @@
cneg x0, x0, hi
b.hi __set_errno_internal
- // Clean up stack shadow in the parent process.
- // https://github.com/google/sanitizers/issues/925
- paciasp
- .cfi_negate_ra_state
- stp x0, x30, [sp, #-16]!
- .cfi_adjust_cfa_offset 16
- .cfi_rel_offset x0, 0
- .cfi_rel_offset x30, 8
-
- add x0, sp, #16
- bl memtag_handle_vfork
-
- ldp x0, x30, [sp], #16
- .cfi_adjust_cfa_offset -16
- .cfi_restore x0
- .cfi_restore x30
- autiasp
- .cfi_negate_ra_state
-
.L_exit:
ret
END(vfork)
diff --git a/libc/arch-arm64/dynamic_function_dispatch.cpp b/libc/arch-arm64/dynamic_function_dispatch.cpp
index cd55311..b9f657b 100644
--- a/libc/arch-arm64/dynamic_function_dispatch.cpp
+++ b/libc/arch-arm64/dynamic_function_dispatch.cpp
@@ -41,7 +41,7 @@
}
}
-typedef void* memcmp_func(void*, const void*, size_t);
+typedef int memcmp_func(const void*, const void*, size_t);
DEFINE_IFUNC_FOR(memcmp) {
// TODO: enable the SVE version.
RETURN_FUNC(memcmp_func, __memcmp_aarch64);
@@ -65,7 +65,7 @@
}
}
-typedef int stpcpy_func(char*, const char*);
+typedef char* stpcpy_func(char*, const char*, size_t);
DEFINE_IFUNC_FOR(stpcpy) {
// TODO: enable the SVE version.
RETURN_FUNC(stpcpy_func, __stpcpy_aarch64);
@@ -95,7 +95,7 @@
RETURN_FUNC(strcmp_func, __strcmp_aarch64);
}
-typedef int strcpy_func(char*, const char*);
+typedef char* strcpy_func(char*, const char*);
DEFINE_IFUNC_FOR(strcpy) {
// TODO: enable the SVE version.
RETURN_FUNC(strcpy_func, __strcpy_aarch64);
@@ -110,13 +110,13 @@
}
}
-typedef int strncmp_func(const char*, const char*, int);
+typedef int strncmp_func(const char*, const char*, size_t);
DEFINE_IFUNC_FOR(strncmp) {
// TODO: enable the SVE version.
RETURN_FUNC(strncmp_func, __strncmp_aarch64);
}
-typedef size_t strnlen_func(const char*);
+typedef size_t strnlen_func(const char*, size_t);
DEFINE_IFUNC_FOR(strnlen) {
// TODO: enable the SVE version.
RETURN_FUNC(strnlen_func, __strnlen_aarch64);
diff --git a/libc/arch-common/bionic/crtbegin.c b/libc/arch-common/bionic/crtbegin.c
index b87db64..127896a 100644
--- a/libc/arch-common/bionic/crtbegin.c
+++ b/libc/arch-common/bionic/crtbegin.c
@@ -30,17 +30,53 @@
#include <stddef.h>
#include <stdint.h>
-#define SECTION(name) __attribute__((__section__(name)))
-SECTION(".preinit_array") init_func_t* __PREINIT_ARRAY__ = (init_func_t*)-1;
-SECTION(".init_array.0") init_func_t* __INIT_ARRAY__ = (init_func_t*)-1;
-SECTION(".fini_array.0") fini_func_t* __FINI_ARRAY__ = (fini_func_t*)-1;
-#undef SECTION
+extern init_func_t* __preinit_array_start[];
+extern init_func_t* __preinit_array_end[];
+extern init_func_t* __init_array_start[];
+extern init_func_t* __init_array_end[];
+extern fini_func_t* __fini_array_start[];
+extern fini_func_t* __fini_array_end[];
+
+#if !defined(CRTBEGIN_STATIC)
+/* This function will be called during normal program termination
+ * to run the destructors that are listed in the .fini_array section
+ * of the executable, if any.
+ *
+ * 'fini_array' points to a list of function addresses.
+ */
+static void call_fini_array() {
+ fini_func_t** array = __fini_array_start;
+ size_t count = __fini_array_end - __fini_array_start;
+ // Call fini functions in reverse order.
+ while (count-- > 0) {
+ fini_func_t* function = array[count];
+ (*function)();
+ }
+}
+
+// libc.so needs fini_array with sentinels. So create a fake fini_array with sentinels.
+// It contains a function to call functions in real fini_array.
+static fini_func_t* fini_array_with_sentinels[] = {
+ (fini_func_t*)-1,
+ &call_fini_array,
+ (fini_func_t*)0,
+};
+#endif // !defined(CRTBEGIN_STATIC)
__used static void _start_main(void* raw_args) {
- structors_array_t array;
- array.preinit_array = &__PREINIT_ARRAY__;
- array.init_array = &__INIT_ARRAY__;
- array.fini_array = &__FINI_ARRAY__;
+ structors_array_t array = {};
+#if defined(CRTBEGIN_STATIC)
+ array.preinit_array = __preinit_array_start;
+ array.preinit_array_count = __preinit_array_end - __preinit_array_start;
+ array.init_array = __init_array_start;
+ array.init_array_count = __init_array_end - __init_array_start;
+ array.fini_array = __fini_array_start;
+ array.fini_array_count = __fini_array_end - __fini_array_start;
+#else
+ if (__fini_array_end - __fini_array_start > 0) {
+ array.fini_array = fini_array_with_sentinels;
+ }
+#endif // !defined(CRTBEGIN_STATIC)
__libc_init(raw_args, NULL, &main, &array);
}
diff --git a/libc/arch-common/bionic/crtend.S b/libc/arch-common/bionic/crtend.S
index 49c729f..74b3aa9 100644
--- a/libc/arch-common/bionic/crtend.S
+++ b/libc/arch-common/bionic/crtend.S
@@ -34,18 +34,6 @@
__bionic_asm_custom_note_gnu_section()
#endif
- .section .preinit_array, "aw"
- ASM_ALIGN_TO_PTR_SIZE
- ASM_PTR_SIZE(0)
-
- .section .init_array, "aw"
- ASM_ALIGN_TO_PTR_SIZE
- ASM_PTR_SIZE(0)
-
- .section .fini_array, "aw"
- ASM_ALIGN_TO_PTR_SIZE
- ASM_PTR_SIZE(0)
-
.section .note.GNU-stack, "", %progbits
#if !defined(__arm__)
diff --git a/libc/arch-riscv64/dynamic_function_dispatch.cpp b/libc/arch-riscv64/dynamic_function_dispatch.cpp
new file mode 100644
index 0000000..0925c5f
--- /dev/null
+++ b/libc/arch-riscv64/dynamic_function_dispatch.cpp
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2023 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 <private/bionic_ifuncs.h>
+#include <stddef.h>
+#include <sys/auxv.h>
+
+#if defined(__riscv_v)
+extern "C" {
+
+typedef void* memchr_func(const void*, int, size_t);
+DEFINE_IFUNC_FOR(memchr) {
+ RETURN_FUNC(memchr_func, memchr_vext);
+}
+
+typedef int memcmp_func(const void*, const void*, size_t);
+DEFINE_IFUNC_FOR(memcmp) {
+ RETURN_FUNC(memcmp_func, memcmp_vext);
+}
+
+typedef void* memcpy_func(void*, const void*, size_t);
+DEFINE_IFUNC_FOR(memcpy) {
+ RETURN_FUNC(memcpy_func, memcpy_vext);
+}
+
+typedef void* memmove_func(void*, const void*, size_t);
+DEFINE_IFUNC_FOR(memmove) {
+ RETURN_FUNC(memmove_func, memmove_vext);
+}
+
+typedef void* memset_func(void*, int, size_t);
+DEFINE_IFUNC_FOR(memset) {
+ RETURN_FUNC(memset_func, memset_vext);
+}
+
+typedef char* strcat_func(char*, const char*);
+DEFINE_IFUNC_FOR(strcat) {
+ RETURN_FUNC(strcat_func, strcat_vext);
+}
+
+typedef char* strchr_func(const char*, int);
+DEFINE_IFUNC_FOR(strchr) {
+ RETURN_FUNC(strchr_func, strchr_vext);
+}
+
+typedef int strcmp_func(const char*, const char*);
+DEFINE_IFUNC_FOR(strcmp) {
+ RETURN_FUNC(strcmp_func, strcmp_vext);
+}
+
+typedef char* strcpy_func(char*, const char*);
+DEFINE_IFUNC_FOR(strcpy) {
+ RETURN_FUNC(strcpy_func, strcpy_vext);
+}
+
+typedef size_t strlen_func(const char*);
+DEFINE_IFUNC_FOR(strlen) {
+ RETURN_FUNC(strlen_func, strlen_vext);
+}
+
+typedef char* strncat_func(char*, const char*, size_t);
+DEFINE_IFUNC_FOR(strncat) {
+ RETURN_FUNC(strncat_func, strncat_vext);
+}
+
+typedef int strncmp_func(const char*, const char*, size_t);
+DEFINE_IFUNC_FOR(strncmp) {
+ RETURN_FUNC(strncmp_func, strncmp_vext);
+}
+
+typedef char* strncpy_func(char*, const char*, size_t);
+DEFINE_IFUNC_FOR(strncpy) {
+ RETURN_FUNC(strncpy_func, strncpy_vext);
+}
+
+typedef size_t strnlen_func(const char*, size_t);
+DEFINE_IFUNC_FOR(strnlen) {
+ RETURN_FUNC(strnlen_func, strnlen_vext);
+}
+
+} // extern "C"
+#endif
diff --git a/libc/arch-riscv64/static_function_dispatch.S b/libc/arch-riscv64/static_function_dispatch.S
new file mode 100644
index 0000000..3bf0275
--- /dev/null
+++ b/libc/arch-riscv64/static_function_dispatch.S
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2023 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 <private/bionic_asm.h>
+
+#define FUNCTION_DELEGATE(name, impl) \
+ENTRY(name); \
+ j impl; \
+END(name)
+
+#if defined(__riscv_v)
+
+FUNCTION_DELEGATE(memchr, memchr_vext)
+FUNCTION_DELEGATE(memcmp, memcmp_vext)
+FUNCTION_DELEGATE(memcpy, memcpy_vext)
+FUNCTION_DELEGATE(memmove, memmove_vext)
+FUNCTION_DELEGATE(memset, memset_vext)
+FUNCTION_DELEGATE(strcat, strcat_vext)
+FUNCTION_DELEGATE(strchr, strchr_vext)
+FUNCTION_DELEGATE(strcmp, strcmp_vext)
+FUNCTION_DELEGATE(strcpy, strcpy_vext)
+FUNCTION_DELEGATE(strlen, strlen_vext)
+FUNCTION_DELEGATE(strncat, strncat_vext)
+FUNCTION_DELEGATE(strncmp, strncmp_vext)
+FUNCTION_DELEGATE(strncpy, strncpy_vext)
+FUNCTION_DELEGATE(strnlen, strnlen_vext)
+
+#endif
+
+NOTE_GNU_PROPERTY()
diff --git a/libc/arch-riscv64/string/memchr_vext.S b/libc/arch-riscv64/string/memchr_vext.S
new file mode 100644
index 0000000..ed76a05
--- /dev/null
+++ b/libc/arch-riscv64/string/memchr_vext.S
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define iResult a0
+
+#define pSrc a0
+#define iValue a1
+#define iNum a2
+
+#define iVL a3
+#define iTemp a4
+
+#define ELEM_LMUL_SETTING m8
+#define vData v0
+#define vMask v8
+
+ENTRY(memchr_vext)
+
+L(loop):
+ vsetvli iVL, iNum, e8, ELEM_LMUL_SETTING, ta, ma
+
+ vle8ff.v vData, (pSrc)
+ vmseq.vx vMask, vData, iValue
+ vfirst.m iTemp, vMask
+
+ # skip the loop if we find the matched value.
+ bgez iTemp, L(found)
+
+ csrr iVL, vl
+ sub iNum, iNum, iVL
+ add pSrc, pSrc, iVL
+
+ bnez iNum, L(loop)
+
+ li iResult, 0
+ ret
+
+L(found):
+ add iResult, pSrc, iTemp
+ ret
+
+END(memchr_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/memcmp_vext.S b/libc/arch-riscv64/string/memcmp_vext.S
new file mode 100644
index 0000000..1bb381c
--- /dev/null
+++ b/libc/arch-riscv64/string/memcmp_vext.S
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define iResult a0
+
+#define pSrc1 a0
+#define pSrc2 a1
+#define iNum a2
+
+#define iVL a3
+#define iTemp a4
+#define iTemp1 a5
+#define iTemp2 a6
+
+#define ELEM_LMUL_SETTING m8
+#define vData1 v0
+#define vData2 v8
+#define vMask v16
+
+ENTRY(memcmp_vext)
+
+L(loop):
+ vsetvli iVL, iNum, e8, ELEM_LMUL_SETTING, ta, ma
+
+ vle8.v vData1, (pSrc1)
+ vle8.v vData2, (pSrc2)
+
+ vmsne.vv vMask, vData1, vData2
+ sub iNum, iNum, iVL
+ vfirst.m iTemp, vMask
+
+ /* skip the loop if we find the different
+ value between pSrc1 and pSrc2. */
+ bgez iTemp, L(found)
+
+ add pSrc1, pSrc1, iVL
+ add pSrc2, pSrc2, iVL
+
+ bnez iNum, L(loop)
+
+ li iResult, 0
+ ret
+
+L(found):
+ add pSrc1, pSrc1, iTemp
+ add pSrc2, pSrc2, iTemp
+ lbu iTemp1, 0(pSrc1)
+ lbu iTemp2, 0(pSrc2)
+ sub iResult, iTemp1, iTemp2
+ ret
+
+END(memcmp_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/memcpy_vext.S b/libc/arch-riscv64/string/memcpy_vext.S
new file mode 100644
index 0000000..668973f
--- /dev/null
+++ b/libc/arch-riscv64/string/memcpy_vext.S
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define pDst a0
+#define pSrc a1
+#define iNum a2
+
+#define iVL a3
+#define pDstPtr a4
+
+#define ELEM_LMUL_SETTING m8
+#define vData v0
+
+ENTRY(memcpy_vext)
+
+ mv pDstPtr, pDst
+
+L(loop):
+ vsetvli iVL, iNum, e8, ELEM_LMUL_SETTING, ta, ma
+
+ vle8.v vData, (pSrc)
+ sub iNum, iNum, iVL
+ add pSrc, pSrc, iVL
+ vse8.v vData, (pDstPtr)
+ add pDstPtr, pDstPtr, iVL
+
+ bnez iNum, L(loop)
+
+ ret
+
+END(memcpy_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/memmove_vext.S b/libc/arch-riscv64/string/memmove_vext.S
new file mode 100644
index 0000000..03f10c5
--- /dev/null
+++ b/libc/arch-riscv64/string/memmove_vext.S
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define pDst a0
+#define pSrc a1
+#define iNum a2
+
+#define iVL a3
+#define pDstPtr a4
+#define pSrcBackwardPtr a5
+#define pDstBackwardPtr a6
+
+#define ELEM_LMUL_SETTING m8
+#define vData v0
+
+ENTRY(memmove_vext)
+
+ mv pDstPtr, pDst
+
+ bgeu pSrc, pDst, L(forward_copy_loop)
+ add pSrcBackwardPtr, pSrc, iNum
+ add pDstBackwardPtr, pDst, iNum
+ bltu pDst, pSrcBackwardPtr, L(backward_copy_loop)
+
+L(forward_copy_loop):
+ vsetvli iVL, iNum, e8, ELEM_LMUL_SETTING, ta, ma
+
+ vle8.v vData, (pSrc)
+ sub iNum, iNum, iVL
+ add pSrc, pSrc, iVL
+ vse8.v vData, (pDstPtr)
+ add pDstPtr, pDstPtr, iVL
+
+ bnez iNum, L(forward_copy_loop)
+ ret
+
+L(backward_copy_loop):
+ vsetvli iVL, iNum, e8, ELEM_LMUL_SETTING, ta, ma
+
+ sub pSrcBackwardPtr, pSrcBackwardPtr, iVL
+ vle8.v vData, (pSrcBackwardPtr)
+ sub iNum, iNum, iVL
+ sub pDstBackwardPtr, pDstBackwardPtr, iVL
+ vse8.v vData, (pDstBackwardPtr)
+ bnez iNum, L(backward_copy_loop)
+ ret
+
+END(memmove_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/memset_vext.S b/libc/arch-riscv64/string/memset_vext.S
new file mode 100644
index 0000000..554d6bd
--- /dev/null
+++ b/libc/arch-riscv64/string/memset_vext.S
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define pDst a0
+#define iValue a1
+#define iNum a2
+
+#define iVL a3
+#define iTemp a4
+#define pDstPtr a5
+
+#define ELEM_LMUL_SETTING m8
+#define vData v0
+
+ENTRY(memset_vext)
+
+ mv pDstPtr, pDst
+
+ vsetvli iVL, iNum, e8, ELEM_LMUL_SETTING, ta, ma
+ vmv.v.x vData, iValue
+
+L(loop):
+ vse8.v vData, (pDstPtr)
+ sub iNum, iNum, iVL
+ add pDstPtr, pDstPtr, iVL
+ vsetvli iVL, iNum, e8, ELEM_LMUL_SETTING, ta, ma
+ bnez iNum, L(loop)
+
+ ret
+
+END(memset_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/strcat_vext.S b/libc/arch-riscv64/string/strcat_vext.S
new file mode 100644
index 0000000..05e0dfc
--- /dev/null
+++ b/libc/arch-riscv64/string/strcat_vext.S
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define pDst a0
+#define pSrc a1
+#define pDstPtr a2
+
+#define iVL a3
+#define iCurrentVL a4
+#define iActiveElemPos a5
+
+#define ELEM_LMUL_SETTING m1
+#define vMask1 v0
+#define vMask2 v1
+#define vStr1 v8
+#define vStr2 v16
+
+ENTRY(strcat_vext)
+
+ mv pDstPtr, pDst
+
+ // the strlen of dst
+L(strlen_loop):
+ vsetvli iVL, zero, e8, ELEM_LMUL_SETTING, ta, ma
+
+ vle8ff.v vStr1, (pDstPtr)
+ // find the '\0'
+ vmseq.vx vMask1, vStr1, zero
+ csrr iCurrentVL, vl
+ vfirst.m iActiveElemPos, vMask1
+ add pDstPtr, pDstPtr, iCurrentVL
+ bltz iActiveElemPos, L(strlen_loop)
+
+ sub pDstPtr, pDstPtr, iCurrentVL
+ add pDstPtr, pDstPtr, iActiveElemPos
+
+ // copy pSrc to pDstPtr
+L(strcpy_loop):
+ vsetvli iVL, zero, e8, ELEM_LMUL_SETTING, ta, ma
+
+ vle8ff.v vStr1, (pSrc)
+ vmseq.vx vMask2, vStr1, zero
+ csrr iCurrentVL, vl
+ vfirst.m iActiveElemPos, vMask2
+ vmsif.m vMask1, vMask2
+ add pSrc, pSrc, iCurrentVL
+ vse8.v vStr1, (pDstPtr), vMask1.t
+ add pDstPtr, pDstPtr, iCurrentVL
+ bltz iActiveElemPos, L(strcpy_loop)
+
+ ret
+
+END(strcat_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/strchr_vext.S b/libc/arch-riscv64/string/strchr_vext.S
new file mode 100644
index 0000000..4c7bac1
--- /dev/null
+++ b/libc/arch-riscv64/string/strchr_vext.S
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define pStr a0
+#define iCh a1
+#define iEndOffset a2
+#define iChOffset a3
+#define iTemp1 a4
+#define iTemp2 a5
+#define iCurrentVL a6
+#define iVL t0
+
+#define ELEM_LMUL_SETTING m1
+#define vStr v0
+#define vMaskEnd v8
+#define vMaskCh v9
+
+ENTRY(strchr_vext)
+
+L(strchr_loop):
+ vsetvli iVL, zero, e8, ELEM_LMUL_SETTING, ta, ma
+ vle8ff.v vStr, (pStr)
+ vmseq.vi vMaskEnd, vStr, 0
+ vmseq.vx vMaskCh, vStr, iCh
+ vfirst.m iEndOffset, vMaskEnd /* first occurrence of \0 */
+ vfirst.m iChOffset, vMaskCh /* first occurrence of ch */
+ sltz iTemp1, iChOffset
+ sltu iTemp2, iEndOffset, iChOffset
+ or iTemp1, iTemp1, iTemp2
+ beqz iTemp1, L(found_ch) /* Found ch, not preceded by \0? */
+ csrr iCurrentVL, vl
+ add pStr, pStr, iCurrentVL
+ bltz iEndOffset, L(strchr_loop) /* Didn't find \0? */
+ li pStr, 0
+ ret
+L(found_ch):
+ add pStr, pStr, iChOffset
+ ret
+
+END(strchr_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/strcmp_vext.S b/libc/arch-riscv64/string/strcmp_vext.S
new file mode 100644
index 0000000..b793c9a
--- /dev/null
+++ b/libc/arch-riscv64/string/strcmp_vext.S
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define iResult a0
+
+#define pStr1 a0
+#define pStr2 a1
+
+#define iVL a2
+#define iTemp1 a3
+#define iTemp2 a4
+#define iLMUL1 a5
+#define iLMUL2 a6
+#define iLMUL4 a7
+
+#define iLMUL t0
+
+#define vStr1 v0
+#define vStr2 v8
+#define vMask1 v16
+#define vMask2 v17
+
+ENTRY(strcmp_vext)
+
+ # increase the lmul using the following sequences:
+ # 1/2, 1/2, 1, 2, 4, 4, 4, ...
+
+ # lmul=1/2
+ vsetvli iVL, zero, e8, mf2, ta, ma
+
+ vle8ff.v vStr1, (pStr1)
+ # check if vStr1[i] == 0
+ vmseq.vx vMask1, vStr1, zero
+
+ vle8ff.v vStr2, (pStr2)
+ # check if vStr1[i] != vStr2[i]
+ vmsne.vv vMask2, vStr1, vStr2
+
+ # find the index x for vStr1[x]==0
+ vfirst.m iTemp1, vMask1
+ # find the index x for vStr1[x]!=vStr2[x]
+ vfirst.m iTemp2, vMask2
+
+ bgez iTemp1, L(check1)
+ bgez iTemp2, L(check2)
+
+ # get the current vl updated by vle8ff.
+ csrr iVL, vl
+ add pStr1, pStr1, iVL
+ add pStr2, pStr2, iVL
+
+ vsetvli iVL, zero, e8, mf2, ta, ma
+ addi iLMUL1, zero, 1
+ addi iLMUL, zero, 1
+ j L(loop)
+L(m1):
+ vsetvli iVL, zero, e8, m1, ta, ma
+ addi iLMUL2, zero, 2
+ addi iLMUL, zero, 2
+ j L(loop)
+L(m2):
+ vsetvli iVL, zero, e8, m2, ta, ma
+ addi iLMUL4, zero, 4
+ addi iLMUL, zero, 4
+ j L(loop)
+L(m4):
+ vsetvli iVL, zero, e8, m4, ta, ma
+
+L(loop):
+ vle8ff.v vStr1, (pStr1)
+ vmseq.vx vMask1, vStr1, zero
+
+ vle8ff.v vStr2, (pStr2)
+ vmsne.vv vMask2, vStr1, vStr2
+
+ vfirst.m iTemp1, vMask1
+ vfirst.m iTemp2, vMask2
+
+ bgez iTemp1, L(check1)
+ bgez iTemp2, L(check2)
+
+ csrr iVL, vl
+ add pStr1, pStr1, iVL
+ add pStr2, pStr2, iVL
+
+ beq iLMUL, iLMUL1, L(m1)
+ beq iLMUL, iLMUL2, L(m2)
+ beq iLMUL, iLMUL4, L(m4)
+ j L(loop)
+
+ // iTemp1>=0
+L(check1):
+ bltz iTemp2, 1f
+ blt iTemp2, iTemp1, L(check2)
+1:
+ // iTemp2<0
+ // iTemp2>=0 && iTemp1<iTemp2
+ add pStr1, pStr1, iTemp1
+ add pStr2, pStr2, iTemp1
+ lbu iTemp1, 0(pStr1)
+ lbu iTemp2, 0(pStr2)
+ sub iResult, iTemp1, iTemp2
+ ret
+
+ // iTemp1<0
+ // iTemp2>=0
+L(check2):
+ add pStr1, pStr1, iTemp2
+ add pStr2, pStr2, iTemp2
+ lbu iTemp1, 0(pStr1)
+ lbu iTemp2, 0(pStr2)
+ sub iResult, iTemp1, iTemp2
+ ret
+
+END(strcmp_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/strcpy_vext.S b/libc/arch-riscv64/string/strcpy_vext.S
new file mode 100644
index 0000000..ab8da48
--- /dev/null
+++ b/libc/arch-riscv64/string/strcpy_vext.S
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define pDst a0
+#define pSrc a1
+#define pDstPtr a2
+
+#define iVL a3
+#define iCurrentVL a4
+#define iActiveElemPos a5
+
+#define ELEM_LMUL_SETTING m1
+#define vMask1 v0
+#define vMask2 v1
+#define vStr1 v8
+#define vStr2 v16
+
+ENTRY(strcpy_vext)
+
+ mv pDstPtr, pDst
+
+ // copy pSrc to pDstPtr
+L(strcpy_loop):
+ vsetvli iVL, zero, e8, ELEM_LMUL_SETTING, ta, ma
+ vle8ff.v vStr1, (pSrc)
+ vmseq.vx vMask2, vStr1, zero
+ csrr iCurrentVL, vl
+ vfirst.m iActiveElemPos, vMask2
+ vmsif.m vMask1, vMask2
+ add pSrc, pSrc, iCurrentVL
+ vse8.v vStr1, (pDstPtr), vMask1.t
+ add pDstPtr, pDstPtr, iCurrentVL
+ bltz iActiveElemPos, L(strcpy_loop)
+
+ ret
+
+END(strcpy_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/strlen_vext.S b/libc/arch-riscv64/string/strlen_vext.S
new file mode 100644
index 0000000..694f95c
--- /dev/null
+++ b/libc/arch-riscv64/string/strlen_vext.S
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define iResult a0
+#define pStr a0
+#define pCopyStr a1
+#define iVL a2
+#define iCurrentVL a2
+#define iEndOffset a3
+
+#define ELEM_LMUL_SETTING m2
+#define vStr v0
+#define vMaskEnd v2
+
+ENTRY(strlen_vext)
+
+ mv pCopyStr, pStr
+L(loop):
+ vsetvli iVL, zero, e8, ELEM_LMUL_SETTING, ta, ma
+ vle8ff.v vStr, (pCopyStr)
+ csrr iCurrentVL, vl
+ vmseq.vi vMaskEnd, vStr, 0
+ vfirst.m iEndOffset, vMaskEnd
+ add pCopyStr, pCopyStr, iCurrentVL
+ bltz iEndOffset, L(loop)
+
+ add pStr, pStr, iCurrentVL
+ add pCopyStr, pCopyStr, iEndOffset
+ sub iResult, pCopyStr, iResult
+
+ ret
+
+END(strlen)
+
+#endif
diff --git a/libc/arch-riscv64/string/strncat_vext.S b/libc/arch-riscv64/string/strncat_vext.S
new file mode 100644
index 0000000..9fcd37d
--- /dev/null
+++ b/libc/arch-riscv64/string/strncat_vext.S
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define pDst a0
+#define pSrc a1
+#define iLength a2
+#define pDstPtr a3
+
+#define iVL a4
+#define iCurrentVL a5
+#define iActiveElemPos a6
+
+#define ELEM_LMUL_SETTING m1
+#define vMask1 v0
+#define vMask2 v1
+#define vStr1 v8
+#define vStr2 v16
+
+ENTRY(strncat_vext)
+
+ mv pDstPtr, pDst
+
+ // the strlen of dst
+L(strlen_loop):
+ vsetvli iVL, zero, e8, ELEM_LMUL_SETTING, ta, ma
+
+ vle8ff.v vStr1, (pDstPtr)
+ // find the '\0'
+ vmseq.vx vMask1, vStr1, zero
+ csrr iCurrentVL, vl
+ vfirst.m iActiveElemPos, vMask1
+ add pDstPtr, pDstPtr, iCurrentVL
+ bltz iActiveElemPos, L(strlen_loop)
+
+ sub pDstPtr, pDstPtr, iCurrentVL
+ add pDstPtr, pDstPtr, iActiveElemPos
+
+ // copy pSrc to pDstPtr
+L(strcpy_loop):
+ vsetvli iVL, iLength, e8, ELEM_LMUL_SETTING, ta, ma
+
+ vle8ff.v vStr1, (pSrc)
+ vmseq.vx vMask2, vStr1, zero
+ csrr iCurrentVL, vl
+ vfirst.m iActiveElemPos, vMask2
+ vmsif.m vMask1, vMask2
+ add pSrc, pSrc, iCurrentVL
+ sub iLength, iLength, iCurrentVL
+ vse8.v vStr1, (pDstPtr), vMask1.t
+ add pDstPtr, pDstPtr, iCurrentVL
+ beqz iLength, L(fill_zero)
+ bltz iActiveElemPos, L(strcpy_loop)
+
+ ret
+
+L(fill_zero):
+ bgez iActiveElemPos, L(fill_zero_end)
+ sb zero, (pDstPtr)
+
+L(fill_zero_end):
+ ret
+
+END(strncat_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/strncmp_vext.S b/libc/arch-riscv64/string/strncmp_vext.S
new file mode 100644
index 0000000..ec3ec50
--- /dev/null
+++ b/libc/arch-riscv64/string/strncmp_vext.S
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define iResult a0
+
+#define pStr1 a0
+#define pStr2 a1
+#define iLength a2
+
+#define iVL a3
+#define iTemp1 a4
+#define iTemp2 a5
+
+#define ELEM_LMUL_SETTING m1
+#define vStr1 v0
+#define vStr2 v4
+#define vMask1 v8
+#define vMask2 v9
+
+ENTRY(strncmp_vext)
+
+ beqz iLength, L(zero_length)
+
+L(loop):
+ vsetvli iVL, iLength, e8, ELEM_LMUL_SETTING, ta, ma
+
+ vle8ff.v vStr1, (pStr1)
+ # vStr1[i] == 0
+ vmseq.vx vMask1, vStr1, zero
+
+ vle8ff.v vStr2, (pStr2)
+ # vStr1[i] != vStr2[i]
+ vmsne.vv vMask2, vStr1, vStr2
+
+ csrr iVL, vl
+
+ # r = mask1 | mask2
+ # We could use vfirst.m to get the first zero char or the
+ # first different char between str1 and str2.
+ vmor.mm vMask1, vMask1, vMask2
+
+ sub iLength, iLength, iVL
+
+ vfirst.m iTemp1, vMask1
+
+ bgez iTemp1, L(end_loop)
+
+ add pStr1, pStr1, iVL
+ add pStr2, pStr2, iVL
+ bnez iLength, L(loop)
+L(end_loop):
+
+ add pStr1, pStr1, iTemp1
+ add pStr2, pStr2, iTemp1
+ lbu iTemp1, 0(pStr1)
+ lbu iTemp2, 0(pStr2)
+
+ sub iResult, iTemp1, iTemp2
+ ret
+
+L(zero_length):
+ li iResult, 0
+ ret
+
+END(strncmp_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/strncpy_vext.S b/libc/arch-riscv64/string/strncpy_vext.S
new file mode 100644
index 0000000..eff6293
--- /dev/null
+++ b/libc/arch-riscv64/string/strncpy_vext.S
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define pDst a0
+#define pSrc a1
+#define iLength a2
+#define pDstPtr a3
+
+#define iVL a4
+#define iCurrentVL a5
+#define iActiveElemPos a6
+
+#define ELEM_LMUL_SETTING m1
+#define vMask1 v0
+#define vMask2 v1
+#define ZERO_FILL_ELEM_LMUL_SETTING m8
+#define vStr1 v8
+#define vStr2 v16
+
+ENTRY(strncpy_vext)
+
+ mv pDstPtr, pDst
+
+ // copy pSrc to pDstPtr
+L(strcpy_loop):
+ vsetvli iVL, iLength, e8, ELEM_LMUL_SETTING, ta, ma
+ vle8ff.v vStr1, (pSrc)
+ vmseq.vx vMask2, vStr1, zero
+ csrr iCurrentVL, vl
+ vfirst.m iActiveElemPos, vMask2
+ vmsif.m vMask1, vMask2
+ add pSrc, pSrc, iCurrentVL
+ sub iLength, iLength, iCurrentVL
+ vse8.v vStr1, (pDstPtr), vMask1.t
+ add pDstPtr, pDstPtr, iCurrentVL
+ bgez iActiveElemPos, L(fill_zero)
+ bnez iLength, L(strcpy_loop)
+ ret
+
+ # fill the tail zero.
+L(fill_zero):
+ sub iVL, iCurrentVL, iActiveElemPos
+ add iLength, iLength, iVL
+ bnez iLength, 1f
+ ret
+1:
+ sub pDstPtr, pDstPtr, iVL
+ vsetvli zero, iLength, e8, ZERO_FILL_ELEM_LMUL_SETTING, ta, ma
+ vmv.v.x vStr2, zero
+
+L(fill_zero_loop):
+ vsetvli iVL, iLength, e8, ZERO_FILL_ELEM_LMUL_SETTING, ta, ma
+ vse8.v vStr2, (pDstPtr)
+ sub iLength, iLength, iVL
+ add pDstPtr, pDstPtr, iVL
+ bnez iLength, L(fill_zero_loop)
+
+ ret
+
+END(strncpy_vext)
+
+#endif
diff --git a/libc/arch-riscv64/string/strnlen_vext.S b/libc/arch-riscv64/string/strnlen_vext.S
new file mode 100644
index 0000000..ca07231
--- /dev/null
+++ b/libc/arch-riscv64/string/strnlen_vext.S
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+/*
+ * Copyright (c) 2023 SiFive, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SIFIVE INC ``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 SIFIVE INC 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.
+ */
+
+#if defined(__riscv_v)
+
+#include <private/bionic_asm.h>
+
+#define pStr a0
+#define pCopyStr a2
+#define iRetValue a0
+#define iMaxlen a1
+#define iCurrentVL a3
+#define iEndOffset a4
+
+#define ELEM_LMUL_SETTING m1
+#define vStr v0
+#define vMaskEnd v8
+
+ENTRY(strnlen_vext)
+
+ mv pCopyStr, pStr
+ mv iRetValue, iMaxlen
+L(strnlen_loop):
+ beqz iMaxlen, L(end_strnlen_loop)
+ vsetvli zero, iMaxlen, e8, ELEM_LMUL_SETTING, ta, ma
+ vle8ff.v vStr, (pCopyStr)
+ vmseq.vi vMaskEnd, vStr, 0
+ vfirst.m iEndOffset, vMaskEnd /* first occurrence of \0 */
+ csrr iCurrentVL, vl
+ add pCopyStr, pCopyStr, iCurrentVL
+ sub iMaxlen, iMaxlen, iCurrentVL
+ bltz iEndOffset, L(strnlen_loop)
+ add iMaxlen, iMaxlen, iCurrentVL
+ sub iRetValue, iRetValue, iMaxlen
+ add iRetValue, iRetValue, iEndOffset
+L(end_strnlen_loop):
+ ret
+
+END(strnlen_vext)
+
+#endif
diff --git a/libc/arch-x86_64/bionic/__bionic_clone.S b/libc/arch-x86_64/bionic/__bionic_clone.S
index a4245b8..c293020 100644
--- a/libc/arch-x86_64/bionic/__bionic_clone.S
+++ b/libc/arch-x86_64/bionic/__bionic_clone.S
@@ -48,8 +48,8 @@
# Check result.
testq %rax, %rax
- jz .L_bc_child
- jg .L_bc_parent
+ jz L(bc_child)
+ jg L(bc_parent)
# An error occurred, set errno and return -1.
negl %eax
@@ -57,7 +57,7 @@
call __set_errno_internal
ret
-.L_bc_child:
+L(bc_child):
# We don't want anyone to unwind past this point.
.cfi_undefined %rip
.cfi_undefined %rbp
@@ -70,7 +70,7 @@
call __start_thread
hlt
-.L_bc_parent:
+L(bc_parent):
# We're the parent; nothing to do.
ret
END(__bionic_clone)
diff --git a/libc/arch-x86_64/string/avx2-memset-kbl.S b/libc/arch-x86_64/string/avx2-memset-kbl.S
index 09dd07d..ca62a9f 100644
--- a/libc/arch-x86_64/string/avx2-memset-kbl.S
+++ b/libc/arch-x86_64/string/avx2-memset-kbl.S
@@ -63,10 +63,9 @@
testb $2, %dl
jnz L(2_3bytes)
testb $1, %dl
- jz L(return)
+ jz 1f
movb %cl, (%rdi)
-L(return):
- ret
+1: ret
L(8_15bytes):
movq %rcx, (%rdi)
@@ -90,59 +89,54 @@
movdqu %xmm0, (%rdi)
movdqu %xmm0, -16(%rdi, %rdx)
cmpq $32, %rdx
- jbe L(32bytesless)
+ jbe L(done)
movdqu %xmm0, 16(%rdi)
movdqu %xmm0, -32(%rdi, %rdx)
cmpq $64, %rdx
- jbe L(64bytesless)
+ jbe L(done)
movdqu %xmm0, 32(%rdi)
movdqu %xmm0, 48(%rdi)
movdqu %xmm0, -64(%rdi, %rdx)
movdqu %xmm0, -48(%rdi, %rdx)
cmpq $128, %rdx
- jbe L(128bytesless)
- vpbroadcastb %xmm0, %ymm0
+ jbe L(done)
+ vpbroadcastb %xmm0, %ymm0
vmovdqu %ymm0, 64(%rdi)
vmovdqu %ymm0, 96(%rdi)
vmovdqu %ymm0, -128(%rdi, %rdx)
vmovdqu %ymm0, -96(%rdi, %rdx)
cmpq $256, %rdx
- ja L(256bytesmore)
-L(32bytesless):
-L(64bytesless):
-L(128bytesless):
- ret
+ jbe L(done)
ALIGN (4)
-L(256bytesmore):
leaq 128(%rdi), %rcx
andq $-128, %rcx
movq %rdx, %r8
addq %rdi, %rdx
andq $-128, %rdx
cmpq %rcx, %rdx
- je L(return)
+ je L(done)
#ifdef SHARED_CACHE_SIZE
cmp $SHARED_CACHE_SIZE, %r8
#else
cmp __x86_64_shared_cache_size(%rip), %r8
#endif
- ja L(256bytesmore_nt)
+ ja L(non_temporal_loop)
ALIGN (4)
-L(256bytesmore_normal):
+L(normal_loop):
vmovdqa %ymm0, (%rcx)
vmovdqa %ymm0, 32(%rcx)
vmovdqa %ymm0, 64(%rcx)
vmovdqa %ymm0, 96(%rcx)
addq $128, %rcx
cmpq %rcx, %rdx
- jne L(256bytesmore_normal)
- ret
+ jne L(normal_loop)
+ jmp L(done)
ALIGN (4)
-L(256bytesmore_nt):
+L(non_temporal_loop):
movntdq %xmm0, (%rcx)
movntdq %xmm0, 16(%rcx)
movntdq %xmm0, 32(%rcx)
@@ -153,8 +147,14 @@
movntdq %xmm0, 112(%rcx)
leaq 128(%rcx), %rcx
cmpq %rcx, %rdx
- jne L(256bytesmore_nt)
+ jne L(non_temporal_loop)
+ # We used non-temporal stores, so we need a fence here.
sfence
+
+L(done):
+ # We used the ymm registers, and that can break SSE2 performance
+ # unless you do this.
+ vzeroupper
ret
END(memset_avx2)
diff --git a/libc/async_safe/async_safe_log.cpp b/libc/async_safe/async_safe_log.cpp
index 420560f..2bff616 100644
--- a/libc/async_safe/async_safe_log.cpp
+++ b/libc/async_safe/async_safe_log.cpp
@@ -207,10 +207,12 @@
// Decode the conversion specifier.
int is_signed = (conversion == 'd' || conversion == 'i' || conversion == 'o');
int base = 10;
- if (conversion == 'x' || conversion == 'X') {
+ if (tolower(conversion) == 'x') {
base = 16;
} else if (conversion == 'o') {
base = 8;
+ } else if (tolower(conversion) == 'b') {
+ base = 2;
}
bool caps = (conversion == 'X');
@@ -360,7 +362,8 @@
format_integer(buffer + 2, sizeof(buffer) - 2, value, 'x');
} else if (c == 'm') {
strerror_r(errno, buffer, sizeof(buffer));
- } else if (c == 'd' || c == 'i' || c == 'o' || c == 'u' || c == 'x' || c == 'X') {
+ } else if (tolower(c) == 'b' || c == 'd' || c == 'i' || c == 'o' || c == 'u' ||
+ tolower(c) == 'x') {
/* integers - first read value from stack */
uint64_t value;
int is_signed = (c == 'd' || c == 'i' || c == 'o');
@@ -391,10 +394,10 @@
value = static_cast<uint64_t>((static_cast<int64_t>(value << shift)) >> shift);
}
- if (alternate && value != 0 && (c == 'x' || c == 'o')) {
- if (c == 'x') {
+ if (alternate && value != 0 && (tolower(c) == 'x' || c == 'o' || tolower(c) == 'b')) {
+ if (tolower(c) == 'x' || tolower(c) == 'b') {
buffer[0] = '0';
- buffer[1] = 'x';
+ buffer[1] = c;
format_integer(buffer + 2, sizeof(buffer) - 2, value, c);
} else {
buffer[0] = '0';
diff --git a/libc/bionic/__libc_init_main_thread.cpp b/libc/bionic/__libc_init_main_thread.cpp
index 95f46e9..1b539f2 100644
--- a/libc/bionic/__libc_init_main_thread.cpp
+++ b/libc/bionic/__libc_init_main_thread.cpp
@@ -150,7 +150,7 @@
// stack.)
ThreadMapping mapping = __allocate_thread_mapping(0, PTHREAD_GUARD_SIZE);
if (mapping.mmap_base == nullptr) {
- async_safe_fatal("failed to mmap main thread static TLS: %s", strerror(errno));
+ async_safe_fatal("failed to mmap main thread static TLS: %m");
}
const StaticTlsLayout& layout = __libc_shared_globals()->static_tls_layout;
diff --git a/libc/bionic/android_profiling_dynamic.cpp b/libc/bionic/android_profiling_dynamic.cpp
index 8c9127e..849d04b 100644
--- a/libc/bionic/android_profiling_dynamic.cpp
+++ b/libc/bionic/android_profiling_dynamic.cpp
@@ -126,15 +126,14 @@
static void HandleTracedPerfSignal() {
ScopedFd sock_fd{ socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0 /*protocol*/) };
if (sock_fd.get() == -1) {
- async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to create socket: %s", strerror(errno));
+ async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to create socket: %m");
return;
}
sockaddr_un saddr{ AF_UNIX, "/dev/socket/traced_perf" };
size_t addrlen = sizeof(sockaddr_un);
if (connect(sock_fd.get(), reinterpret_cast<const struct sockaddr*>(&saddr), addrlen) == -1) {
- async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to connect to traced_perf socket: %s",
- strerror(errno));
+ async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to connect to traced_perf socket: %m");
return;
}
@@ -153,13 +152,11 @@
}
if (maps_fd.get() == -1) {
- async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to open /proc/self/maps: %s",
- strerror(errno));
+ async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to open /proc/self/maps: %m");
return;
}
if (mem_fd.get() == -1) {
- async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to open /proc/self/mem: %s",
- strerror(errno));
+ async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to open /proc/self/mem: %m");
return;
}
@@ -183,7 +180,7 @@
memcpy(CMSG_DATA(cmsg), send_fds, num_fds * sizeof(int));
if (sendmsg(sock_fd.get(), &msg_hdr, 0) == -1) {
- async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to sendmsg: %s", strerror(errno));
+ async_safe_format_log(ANDROID_LOG_ERROR, "libc", "failed to sendmsg: %m");
}
}
diff --git a/libc/bionic/android_unsafe_frame_pointer_chase.cpp b/libc/bionic/android_unsafe_frame_pointer_chase.cpp
index 1a59718..58b7cd8 100644
--- a/libc/bionic/android_unsafe_frame_pointer_chase.cpp
+++ b/libc/bionic/android_unsafe_frame_pointer_chase.cpp
@@ -74,7 +74,9 @@
while (1) {
#if defined(__riscv)
// Frame addresses seem to have been implemented incorrectly for RISC-V.
- // See https://reviews.llvm.org/D87579.
+ // See https://reviews.llvm.org/D87579. We did at least manage to get this
+ // documented in the RISC-V psABI though:
+ // https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#frame-pointer-convention
auto* frame = reinterpret_cast<frame_record*>(begin - 16);
#else
auto* frame = reinterpret_cast<frame_record*>(begin);
diff --git a/libc/bionic/atexit.cpp b/libc/bionic/atexit.cpp
index 5dbf322..29f9c7b 100644
--- a/libc/bionic/atexit.cpp
+++ b/libc/bionic/atexit.cpp
@@ -73,8 +73,8 @@
// restart concurrent __cxa_finalize passes.
uint64_t total_appends_;
- static size_t page_start_of_index(size_t idx) { return PAGE_START(idx * sizeof(AtexitEntry)); }
- static size_t page_end_of_index(size_t idx) { return PAGE_END(idx * sizeof(AtexitEntry)); }
+ static size_t page_start_of_index(size_t idx) { return page_start(idx * sizeof(AtexitEntry)); }
+ static size_t page_end_of_index(size_t idx) { return page_end(idx * sizeof(AtexitEntry)); }
// Recompact the array if it will save at least one page of memory at the end.
bool needs_recompaction() const {
@@ -158,7 +158,7 @@
const int prot = PROT_READ | (writable ? PROT_WRITE : 0);
if (mprotect(reinterpret_cast<char*>(array_) + start_byte, byte_len, prot) != 0) {
- async_safe_fatal("mprotect failed on atexit array: %s", strerror(errno));
+ async_safe_fatal("mprotect failed on atexit array: %m");
}
}
@@ -167,7 +167,7 @@
// than one.
bool AtexitArray::next_capacity(size_t capacity, size_t* result) {
if (capacity == 0) {
- *result = PAGE_END(sizeof(AtexitEntry)) / sizeof(AtexitEntry);
+ *result = page_end(sizeof(AtexitEntry)) / sizeof(AtexitEntry);
return true;
}
size_t num_bytes;
@@ -198,8 +198,8 @@
}
if (new_pages == MAP_FAILED) {
async_safe_format_log(ANDROID_LOG_WARN, "libc",
- "__cxa_atexit: mmap/mremap failed to allocate %zu bytes: %s",
- new_capacity_bytes, strerror(errno));
+ "__cxa_atexit: mmap/mremap failed to allocate %zu bytes: %m",
+ new_capacity_bytes);
} else {
result = true;
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, new_pages, new_capacity_bytes, "atexit handlers");
diff --git a/libc/bionic/bionic_allocator.cpp b/libc/bionic/bionic_allocator.cpp
index 98183d4..80e8b08 100644
--- a/libc/bionic/bionic_allocator.cpp
+++ b/libc/bionic/bionic_allocator.cpp
@@ -95,12 +95,10 @@
return result;
}
-BionicSmallObjectAllocator::BionicSmallObjectAllocator(uint32_t type,
- size_t block_size)
+BionicSmallObjectAllocator::BionicSmallObjectAllocator(uint32_t type, size_t block_size)
: type_(type),
block_size_(block_size),
- blocks_per_page_((PAGE_SIZE - sizeof(small_object_page_info)) /
- block_size),
+ blocks_per_page_((page_size() - sizeof(small_object_page_info)) / block_size),
free_pages_cnt_(0),
page_list_(nullptr) {}
@@ -157,14 +155,13 @@
if (page_list_ == page) {
page_list_ = page->next_page;
}
- munmap(page, PAGE_SIZE);
+ munmap(page, page_size());
free_pages_cnt_--;
}
void BionicSmallObjectAllocator::free(void* ptr) {
small_object_page_info* const page =
- reinterpret_cast<small_object_page_info*>(
- PAGE_START(reinterpret_cast<uintptr_t>(ptr)));
+ reinterpret_cast<small_object_page_info*>(page_start(reinterpret_cast<uintptr_t>(ptr)));
if (reinterpret_cast<uintptr_t>(ptr) % block_size_ != 0) {
async_safe_fatal("invalid pointer: %p (block_size=%zd)", ptr, block_size_);
@@ -192,14 +189,13 @@
}
void BionicSmallObjectAllocator::alloc_page() {
- void* const map_ptr = mmap(nullptr, PAGE_SIZE, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ void* const map_ptr =
+ mmap(nullptr, page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (map_ptr == MAP_FAILED) {
- async_safe_fatal("mmap failed: %s", strerror(errno));
+ async_safe_fatal("mmap failed: %m");
}
- prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map_ptr, PAGE_SIZE,
- "bionic_alloc_small_objects");
+ prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map_ptr, page_size(), "bionic_alloc_small_objects");
small_object_page_info* const page =
reinterpret_cast<small_object_page_info*>(map_ptr);
@@ -269,15 +265,15 @@
size_t header_size = __BIONIC_ALIGN(kPageInfoSize, align);
size_t allocated_size;
if (__builtin_add_overflow(header_size, size, &allocated_size) ||
- PAGE_END(allocated_size) < allocated_size) {
+ page_end(allocated_size) < allocated_size) {
async_safe_fatal("overflow trying to alloc %zu bytes", size);
}
- allocated_size = PAGE_END(allocated_size);
+ allocated_size = page_end(allocated_size);
void* map_ptr = mmap(nullptr, allocated_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0);
if (map_ptr == MAP_FAILED) {
- async_safe_fatal("mmap failed: %s", strerror(errno));
+ async_safe_fatal("mmap failed: %m");
}
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map_ptr, allocated_size, "bionic_alloc_lob");
@@ -317,7 +313,7 @@
void* BionicAllocator::memalign(size_t align, size_t size) {
// The Bionic allocator only supports alignment up to one page, which is good
// enough for ELF TLS.
- align = MIN(align, PAGE_SIZE);
+ align = MIN(align, page_size());
align = MAX(align, 16);
if (!powerof2(align)) {
align = BIONIC_ROUND_UP_POWER_OF_2(align);
@@ -327,7 +323,7 @@
}
inline page_info* BionicAllocator::get_page_info_unchecked(void* ptr) {
- uintptr_t header_page = PAGE_START(reinterpret_cast<size_t>(ptr) - kPageInfoSize);
+ uintptr_t header_page = page_start(reinterpret_cast<size_t>(ptr) - kPageInfoSize);
return reinterpret_cast<page_info*>(header_page);
}
diff --git a/libc/bionic/bionic_call_ifunc_resolver.cpp b/libc/bionic/bionic_call_ifunc_resolver.cpp
index 437de78..3cfb8b5 100644
--- a/libc/bionic/bionic_call_ifunc_resolver.cpp
+++ b/libc/bionic/bionic_call_ifunc_resolver.cpp
@@ -57,6 +57,13 @@
hwcap = getauxval(AT_HWCAP);
}
return reinterpret_cast<ifunc_resolver_t>(resolver_addr)(hwcap);
+#elif defined(__riscv)
+ // The pointer argument is currently unused, but reserved for future
+ // expansion. If we pass nullptr from the beginning, it'll be easier
+ // to recognize if/when we pass actual data (and matches glibc).
+ typedef ElfW(Addr) (*ifunc_resolver_t)(uint64_t, void*);
+ static uint64_t hwcap = getauxval(AT_HWCAP);
+ return reinterpret_cast<ifunc_resolver_t>(resolver_addr)(hwcap, nullptr);
#else
typedef ElfW(Addr) (*ifunc_resolver_t)(void);
return reinterpret_cast<ifunc_resolver_t>(resolver_addr)();
diff --git a/libc/bionic/bionic_elf_tls.cpp b/libc/bionic/bionic_elf_tls.cpp
index 79893e3..077f310 100644
--- a/libc/bionic/bionic_elf_tls.cpp
+++ b/libc/bionic/bionic_elf_tls.cpp
@@ -34,10 +34,11 @@
#include <sys/param.h>
#include <unistd.h>
+#include "platform/bionic/macros.h"
+#include "platform/bionic/page.h"
#include "private/ScopedRWLock.h"
#include "private/ScopedSignalBlocker.h"
#include "private/bionic_globals.h"
-#include "platform/bionic/macros.h"
#include "private/bionic_tls.h"
#include "pthread_internal.h"
@@ -81,7 +82,7 @@
return false;
}
// Bionic only respects TLS alignment up to one page.
- *alignment = MIN(*alignment, PAGE_SIZE);
+ *alignment = MIN(*alignment, page_size());
return true;
}
diff --git a/libc/bionic/c32rtomb.cpp b/libc/bionic/c32rtomb.cpp
index 4fa76ff..a7cd207 100644
--- a/libc/bionic/c32rtomb.cpp
+++ b/libc/bionic/c32rtomb.cpp
@@ -78,7 +78,7 @@
length = 4;
} else {
errno = EILSEQ;
- return __MB_ERR_ILLEGAL_SEQUENCE;
+ return BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE;
}
// Output the octets representing the character in chunks
diff --git a/libc/bionic/exec.cpp b/libc/bionic/exec.cpp
index 40612e7..863aa97 100644
--- a/libc/bionic/exec.cpp
+++ b/libc/bionic/exec.cpp
@@ -186,6 +186,5 @@
__attribute__((no_sanitize("memtag"))) int execve(const char* pathname, char* const* argv,
char* const* envp) {
- __get_thread()->vfork_child_stack_bottom = __builtin_frame_address(0);
return __execve(pathname, argv, envp);
}
diff --git a/libc/bionic/exit.cpp b/libc/bionic/exit.cpp
index 52fd193..04baac2 100644
--- a/libc/bionic/exit.cpp
+++ b/libc/bionic/exit.cpp
@@ -37,7 +37,6 @@
extern "C" __noreturn void __exit_group(int status);
__attribute__((no_sanitize("memtag"))) void _exit(int status) {
- __get_thread()->vfork_child_stack_bottom = __builtin_frame_address(0);
__exit_group(status);
}
diff --git a/libc/bionic/fdsan.cpp b/libc/bionic/fdsan.cpp
index 6433b59..84d2c94 100644
--- a/libc/bionic/fdsan.cpp
+++ b/libc/bionic/fdsan.cpp
@@ -40,6 +40,7 @@
#include <unistd.h>
#include <async_safe/log.h>
+#include <platform/bionic/page.h>
#include <platform/bionic/reserved_signals.h>
#include <sys/system_properties.h>
@@ -80,13 +81,13 @@
size_t required_count = max - inline_fds;
size_t required_size = sizeof(FdTableOverflow) + required_count * sizeof(FdEntry);
- size_t aligned_size = __BIONIC_ALIGN(required_size, PAGE_SIZE);
+ size_t aligned_size = __BIONIC_ALIGN(required_size, page_size());
size_t aligned_count = (aligned_size - sizeof(FdTableOverflow)) / sizeof(FdEntry);
void* allocation =
mmap(nullptr, aligned_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (allocation == MAP_FAILED) {
- async_safe_fatal("fdsan: mmap failed: %s", strerror(errno));
+ async_safe_fatal("fdsan: mmap failed: %m");
}
FdTableOverflow* new_overflow = reinterpret_cast<FdTableOverflow*>(allocation);
diff --git a/libc/bionic/getpagesize.cpp b/libc/bionic/getpagesize.cpp
index 3a59900..da97633 100644
--- a/libc/bionic/getpagesize.cpp
+++ b/libc/bionic/getpagesize.cpp
@@ -27,9 +27,10 @@
*/
#include <unistd.h>
+#include "platform/bionic/page.h"
// Portable code should use sysconf(_SC_PAGE_SIZE) directly instead.
int getpagesize() {
// We dont use sysconf(3) here because that drags in stdio, which makes static binaries fat.
- return PAGE_SIZE;
+ return page_size();
}
diff --git a/libc/bionic/gwp_asan_wrappers.cpp b/libc/bionic/gwp_asan_wrappers.cpp
index fab29ef..251633d 100644
--- a/libc/bionic/gwp_asan_wrappers.cpp
+++ b/libc/bionic/gwp_asan_wrappers.cpp
@@ -307,10 +307,8 @@
sysprop_names[3] = persist_default_sysprop;
}
- // TODO(mitchp): Log overrides using this.
- const char* source;
return get_config_from_env_or_sysprops(env_var, sysprop_names, arraysize(sysprop_names),
- value_out, PROP_VALUE_MAX, &source);
+ value_out, PROP_VALUE_MAX);
}
bool GetGwpAsanIntegerOption(unsigned long long* result,
diff --git a/libc/bionic/heap_tagging.cpp b/libc/bionic/heap_tagging.cpp
index 78d21b0..230899a 100644
--- a/libc/bionic/heap_tagging.cpp
+++ b/libc/bionic/heap_tagging.cpp
@@ -208,33 +208,10 @@
}
#endif // __aarch64__
+ // We can use __has_feature here rather than __hwasan_handle_longjmp as a
+ // weak symbol because this is part of libc which is always sanitized for a
+ // hwasan enabled process.
#if __has_feature(hwaddress_sanitizer)
__hwasan_handle_longjmp(sp_dst);
#endif // __has_feature(hwaddress_sanitizer)
}
-
-extern "C" __LIBC_HIDDEN__ __attribute__((no_sanitize("memtag"), no_sanitize("hwaddress"))) void
-memtag_handle_vfork(void* sp __unused) {
-#ifdef __aarch64__
- if (__libc_globals->memtag_stack) {
- void* child_sp = __get_thread()->vfork_child_stack_bottom;
- __get_thread()->vfork_child_stack_bottom = nullptr;
- if (child_sp) {
- size_t distance = reinterpret_cast<uintptr_t>(sp) - reinterpret_cast<uintptr_t>(child_sp);
- if (distance > kUntagLimit) {
- async_safe_fatal(
- "memtag_handle_vfork: stack adjustment too large! %p -> %p, distance %zx > %zx\n",
- child_sp, sp, distance, kUntagLimit);
- } else {
- untag_memory(child_sp, sp);
- }
- } else {
- async_safe_fatal("memtag_handle_vfork: child SP unknown\n");
- }
- }
-#endif // __aarch64__
-
-#if __has_feature(hwaddress_sanitizer)
- __hwasan_handle_vfork(sp);
-#endif // __has_feature(hwaddress_sanitizer)
-}
diff --git a/libc/bionic/iconv.cpp b/libc/bionic/iconv.cpp
index 79a429c..5bff50a 100644
--- a/libc/bionic/iconv.cpp
+++ b/libc/bionic/iconv.cpp
@@ -160,9 +160,9 @@
case UTF_8:
src_bytes_used = mbrtoc32(&wc, *src_buf, *src_bytes_left, &ps);
- if (src_bytes_used == __MB_ERR_ILLEGAL_SEQUENCE) {
+ if (src_bytes_used == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE) {
break; // EILSEQ already set.
- } else if (src_bytes_used == __MB_ERR_INCOMPLETE_SEQUENCE) {
+ } else if (src_bytes_used == BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE) {
errno = EINVAL;
return false;
}
@@ -235,9 +235,9 @@
case UTF_8:
dst_bytes_used = c32rtomb(buf, wc, &ps);
- if (dst_bytes_used == __MB_ERR_ILLEGAL_SEQUENCE) {
+ if (dst_bytes_used == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE) {
break; // EILSEQ already set.
- } else if (dst_bytes_used == __MB_ERR_INCOMPLETE_SEQUENCE) {
+ } else if (dst_bytes_used == BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE) {
errno = EINVAL;
return false;
}
diff --git a/libc/bionic/ifaddrs.cpp b/libc/bionic/ifaddrs.cpp
index 0c80f4e..cb36cc6 100644
--- a/libc/bionic/ifaddrs.cpp
+++ b/libc/bionic/ifaddrs.cpp
@@ -281,8 +281,7 @@
ScopedFd s(socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0));
if (s.get() == -1) {
async_safe_format_log(ANDROID_LOG_ERROR, "libc",
- "socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC) failed in ifaddrs: %s",
- strerror(errno));
+ "socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC) failed in ifaddrs: %m");
return;
}
@@ -294,8 +293,8 @@
addr->ifa.ifa_flags = ifr.ifr_flags;
} else {
async_safe_format_log(ANDROID_LOG_ERROR, "libc",
- "ioctl(SIOCGIFFLAGS) for \"%s\" failed in ifaddrs: %s",
- addr->ifa.ifa_name, strerror(errno));
+ "ioctl(SIOCGIFFLAGS) for \"%s\" failed in ifaddrs: %m",
+ addr->ifa.ifa_name);
}
}
}
diff --git a/libc/bionic/jemalloc_wrapper.cpp b/libc/bionic/jemalloc_wrapper.cpp
index ce3f314..a2bb1db 100644
--- a/libc/bionic/jemalloc_wrapper.cpp
+++ b/libc/bionic/jemalloc_wrapper.cpp
@@ -19,10 +19,20 @@
#include <sys/param.h>
#include <unistd.h>
+#include <async_safe/log.h>
#include <private/MallocXmlElem.h>
#include "jemalloc.h"
+__BEGIN_DECLS
+
+size_t je_mallinfo_narenas();
+size_t je_mallinfo_nbins();
+struct mallinfo je_mallinfo_arena_info(size_t);
+struct mallinfo je_mallinfo_bin_info(size_t, size_t);
+
+__END_DECLS
+
void* je_pvalloc(size_t bytes) {
size_t pagesize = getpagesize();
size_t size = __BIONIC_ALIGN(bytes, pagesize);
@@ -121,19 +131,36 @@
return 0;
}
return 1;
+ } else if (param == M_LOG_STATS) {
+ for (size_t i = 0; i < je_mallinfo_narenas(); i++) {
+ struct mallinfo mi = je_mallinfo_arena_info(i);
+ if (mi.hblkhd != 0) {
+ async_safe_format_log(ANDROID_LOG_INFO, "jemalloc",
+ "Arena %zu: large bytes %zu huge bytes %zu bin bytes %zu", i,
+ mi.ordblks, mi.uordblks, mi.fsmblks);
+
+ for (size_t j = 0; j < je_mallinfo_nbins(); j++) {
+ struct mallinfo mi = je_mallinfo_bin_info(i, j);
+ if (mi.ordblks != 0) {
+ size_t total_allocs = 1;
+ if (mi.uordblks > mi.fordblks) {
+ total_allocs = mi.uordblks - mi.fordblks;
+ }
+ size_t bin_size = mi.ordblks / total_allocs;
+ async_safe_format_log(
+ ANDROID_LOG_INFO, "jemalloc",
+ " Bin %zu (%zu bytes): allocated bytes %zu nmalloc %zu ndalloc %zu", j, bin_size,
+ mi.ordblks, mi.uordblks, mi.fordblks);
+ }
+ }
+ }
+ }
+ return 1;
}
+
return 0;
}
-__BEGIN_DECLS
-
-size_t je_mallinfo_narenas();
-size_t je_mallinfo_nbins();
-struct mallinfo je_mallinfo_arena_info(size_t);
-struct mallinfo je_mallinfo_bin_info(size_t, size_t);
-
-__END_DECLS
-
int je_malloc_info(int options, FILE* fp) {
if (options != 0) {
errno = EINVAL;
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index 59b2ddb..7ef79b6 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -186,7 +186,7 @@
#endif
}
-__noreturn static void __early_abort(int line) {
+__noreturn static void __early_abort(size_t line) {
// We can't write to stdout or stderr because we're aborting before we've checked that
// it's safe for us to use those file descriptors. We probably can't strace either, so
// we rely on the fact that if we dereference a low address, either debuggerd or the
@@ -340,11 +340,11 @@
#if !defined(__LP64__)
int old_value = personality(0xffffffff);
if (old_value == -1) {
- async_safe_fatal("error getting old personality value: %s", strerror(errno));
+ async_safe_fatal("error getting old personality value: %m");
}
if (personality((static_cast<unsigned int>(old_value) & ~PER_MASK) | PER_LINUX32) == -1) {
- async_safe_fatal("error setting PER_LINUX32 personality: %s", strerror(errno));
+ async_safe_fatal("error setting PER_LINUX32 personality: %m");
}
#endif
}
diff --git a/libc/bionic/libc_init_common.h b/libc/bionic/libc_init_common.h
index 6b39d6d..126f002 100644
--- a/libc/bionic/libc_init_common.h
+++ b/libc/bionic/libc_init_common.h
@@ -38,6 +38,10 @@
init_func_t** preinit_array;
init_func_t** init_array;
fini_func_t** fini_array;
+ // Below fields are only available in static executables.
+ size_t preinit_array_count;
+ size_t init_array_count;
+ size_t fini_array_count;
} structors_array_t;
__BEGIN_DECLS
diff --git a/libc/bionic/libc_init_static.cpp b/libc/bionic/libc_init_static.cpp
index 0935cd6..1591785 100644
--- a/libc/bionic/libc_init_static.cpp
+++ b/libc/bionic/libc_init_static.cpp
@@ -69,10 +69,21 @@
extern "C" int __cxa_atexit(void (*)(void *), void *, void *);
extern "C" const char* __gnu_basename(const char* path);
-static void call_array(init_func_t** list, int argc, char* argv[], char* envp[]) {
- // First element is -1, list is null-terminated
- while (*++list) {
- (*list)(argc, argv, envp);
+static void call_array(init_func_t** list, size_t count, int argc, char* argv[], char* envp[]) {
+ while (count-- > 0) {
+ init_func_t* function = *list++;
+ (*function)(argc, argv, envp);
+ }
+}
+
+static void call_fini_array(void* arg) {
+ structors_array_t* structors = reinterpret_cast<structors_array_t*>(arg);
+ fini_func_t** array = structors->fini_array;
+ size_t count = structors->fini_array_count;
+ // Now call each destructor in reverse order.
+ while (count-- > 0) {
+ fini_func_t* function = array[count];
+ (*function)();
}
}
@@ -129,8 +140,8 @@
continue;
}
- ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr);
- ElfW(Addr) seg_page_end = PAGE_END(phdr->p_vaddr + phdr->p_memsz);
+ ElfW(Addr) seg_page_start = page_start(phdr->p_vaddr);
+ ElfW(Addr) seg_page_end = page_end(phdr->p_vaddr + phdr->p_memsz);
// Check return value here? What do we do if we fail?
mprotect(reinterpret_cast<void*>(seg_page_start), seg_page_end - seg_page_start, PROT_READ);
@@ -217,13 +228,16 @@
// Returns true if there's an environment setting (either sysprop or env var)
// that should overwrite the ELF note, and places the equivalent heap tagging
// level into *level.
-static bool get_environment_memtag_setting(const char* basename, HeapTaggingLevel* level) {
+static bool get_environment_memtag_setting(HeapTaggingLevel* level) {
static const char kMemtagPrognameSyspropPrefix[] = "arm64.memtag.process.";
static const char kMemtagGlobalSysprop[] = "persist.arm64.memtag.default";
static const char kMemtagOverrideSyspropPrefix[] =
"persist.device_config.memory_safety_native.mode_override.process.";
- if (basename == nullptr) return false;
+ const char* progname = __libc_shared_globals()->init_progname;
+ if (progname == nullptr) return false;
+
+ const char* basename = __gnu_basename(progname);
char options_str[PROP_VALUE_MAX];
char sysprop_name[512];
@@ -234,9 +248,8 @@
kMemtagOverrideSyspropPrefix, basename);
const char* sys_prop_names[] = {sysprop_name, remote_sysprop_name, kMemtagGlobalSysprop};
- const char* source = nullptr;
if (!get_config_from_env_or_sysprops("MEMTAG_OPTIONS", sys_prop_names, arraysize(sys_prop_names),
- options_str, sizeof(options_str), &source)) {
+ options_str, sizeof(options_str))) {
return false;
}
@@ -247,20 +260,14 @@
} else if (strcmp("off", options_str) == 0) {
*level = M_HEAP_TAGGING_LEVEL_TBI;
} else {
- async_safe_format_log(ANDROID_LOG_ERROR, "libc",
- "%s: unrecognized memtag level in %s: \"%s\" (options are \"sync\", "
- "\"async\", or \"off\").",
- basename, source, options_str);
+ async_safe_format_log(
+ ANDROID_LOG_ERROR, "libc",
+ "unrecognized memtag level: \"%s\" (options are \"sync\", \"async\", or \"off\").",
+ options_str);
return false;
}
- async_safe_format_log(ANDROID_LOG_DEBUG, "libc", "%s: chose memtag level \"%s\" from %s.",
- basename, options_str, source);
- return true;
-}
-static void log_elf_memtag_level(const char* basename, const char* level) {
- async_safe_format_log(ANDROID_LOG_DEBUG, "libc", "%s: chose memtag level \"%s\" from ELF note",
- basename ?: "<unknown>", level);
+ return true;
}
// Returns the initial heap tagging level. Note: This function will never return
@@ -268,14 +275,12 @@
// M_HEAP_TAGGING_LEVEL_TBI.
static HeapTaggingLevel __get_heap_tagging_level(const void* phdr_start, size_t phdr_ct,
uintptr_t load_bias, bool* stack) {
- const char* progname = __libc_shared_globals()->init_progname;
- const char* basename = progname ? __gnu_basename(progname) : nullptr;
unsigned note_val =
__get_memtag_note(reinterpret_cast<const ElfW(Phdr)*>(phdr_start), phdr_ct, load_bias);
*stack = note_val & NT_MEMTAG_STACK;
HeapTaggingLevel level;
- if (get_environment_memtag_setting(basename, &level)) return level;
+ if (get_environment_memtag_setting(&level)) return level;
// Note, previously (in Android 12), any value outside of bits [0..3] resulted
// in a check-fail. In order to be permissive of further extensions, we
@@ -290,17 +295,14 @@
// by anyone, but we note it (heh) here for posterity, in case the zero
// level becomes meaningful, and binaries with this note can be executed
// on Android 12 devices.
- log_elf_memtag_level(basename, "off");
return M_HEAP_TAGGING_LEVEL_TBI;
case NT_MEMTAG_LEVEL_ASYNC:
- log_elf_memtag_level(basename, "async");
return M_HEAP_TAGGING_LEVEL_ASYNC;
case NT_MEMTAG_LEVEL_SYNC:
default:
// We allow future extensions to specify mode 3 (currently unused), with
// the idea that it might be used for ASYMM mode or something else. On
// this version of Android, it falls back to SYNC mode.
- log_elf_memtag_level(basename, "sync");
return M_HEAP_TAGGING_LEVEL_SYNC;
}
}
@@ -363,11 +365,10 @@
__libc_shared_globals()->initial_memtag_stack = memtag_stack;
if (memtag_stack) {
- void* page_start =
- reinterpret_cast<void*>(PAGE_START(reinterpret_cast<uintptr_t>(stack_top)));
- if (mprotect(page_start, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_MTE | PROT_GROWSDOWN)) {
- async_safe_fatal("error: failed to set PROT_MTE on main thread stack: %s\n",
- strerror(errno));
+ void* pg_start =
+ reinterpret_cast<void*>(page_start(reinterpret_cast<uintptr_t>(stack_top)));
+ if (mprotect(pg_start, page_size(), PROT_READ | PROT_WRITE | PROT_MTE | PROT_GROWSDOWN)) {
+ async_safe_fatal("error: failed to set PROT_MTE on main thread stack: %m");
}
}
@@ -423,14 +424,15 @@
// Several Linux ABIs don't pass the onexit pointer, and the ones that
// do never use it. Therefore, we ignore it.
- call_array(structors->preinit_array, args.argc, args.argv, args.envp);
- call_array(structors->init_array, args.argc, args.argv, args.envp);
+ call_array(structors->preinit_array, structors->preinit_array_count, args.argc, args.argv,
+ args.envp);
+ call_array(structors->init_array, structors->init_array_count, args.argc, args.argv, args.envp);
// The executable may have its own destructors listed in its .fini_array
// so we need to ensure that these are called when the program exits
// normally.
- if (structors->fini_array != nullptr) {
- __cxa_atexit(__libc_fini,structors->fini_array,nullptr);
+ if (structors->fini_array_count > 0) {
+ __cxa_atexit(call_fini_array, const_cast<structors_array_t*>(structors), nullptr);
}
__libc_init_mte_late();
diff --git a/libc/bionic/malloc_limit.cpp b/libc/bionic/malloc_limit.cpp
index 1405a39..deb63f4 100644
--- a/libc/bionic/malloc_limit.cpp
+++ b/libc/bionic/malloc_limit.cpp
@@ -278,7 +278,7 @@
// being called, allow a short period for the signal handler to complete
// before failing.
bool enabled = false;
- size_t num_tries = 20;
+ size_t num_tries = 200;
while (true) {
if (!atomic_exchange(&gGlobalsMutating, true)) {
__libc_globals.mutate([](libc_globals* globals) {
@@ -328,9 +328,16 @@
current_allocated = Malloc(mallinfo)().uordblks;
}
#endif
+ // This has to be set before the enable occurs since "gAllocated" is used
+ // to compute the limit. If the enable fails, "gAllocated" is never used.
atomic_store(&gAllocated, current_allocated);
- return EnableLimitDispatchTable();
+ if (!EnableLimitDispatchTable()) {
+ // Failed to enable, reset so a future enable will pass.
+ atomic_store(&limit_enabled, false);
+ return false;
+ }
+ return true;
}
static size_t LimitUsableSize(const void* mem) {
diff --git a/libc/bionic/mbrtoc16.cpp b/libc/bionic/mbrtoc16.cpp
index 154b8a3..e87991a 100644
--- a/libc/bionic/mbrtoc16.cpp
+++ b/libc/bionic/mbrtoc16.cpp
@@ -47,15 +47,36 @@
mbstate_set_byte(state, 3, nconv & 0xff);
*pc16 = ((c32 & 0xffc00) >> 10) | 0xd800;
- // Defined by POSIX as return value for first surrogate character.
- return static_cast<size_t>(-3);
+ // https://issuetracker.google.com/289419882
+ //
+ // We misread the spec when implementing this. The first call should return
+ // the length of the decoded character, and the second call should return -3
+ // to indicate that the output is a continuation of the character decoded by
+ // the first call.
+ //
+ // C23 7.30.1.3.4:
+ //
+ // between 1 and n inclusive if the next n or fewer bytes complete a valid
+ // multibyte character (which is the value stored); the value returned is
+ // the number of bytes that complete the multibyte character.
+ //
+ // (size_t)(-3) if the next character resulting from a previous call has
+ // been stored (no bytes from the input have been consumed by this call).
+ //
+ // The first call returns the number of bytes consumed, and the second call
+ // returns -3.
+ //
+ // All UTF-8 sequences that encode a surrogate pair are 4 bytes, but we may
+ // not have seen the full sequence yet.
+ return nconv;
}
static size_t finish_surrogate(char16_t* pc16, mbstate_t* state) {
char16_t trail = mbstate_get_byte(state, 1) << 8 |
mbstate_get_byte(state, 0);
*pc16 = trail;
- return mbstate_reset_and_return(mbstate_get_byte(state, 3), state);
+ mbstate_reset(state);
+ return static_cast<size_t>(-3);
}
size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps) {
diff --git a/libc/bionic/mbrtoc32.cpp b/libc/bionic/mbrtoc32.cpp
index d37ca66..74deb40 100644
--- a/libc/bionic/mbrtoc32.cpp
+++ b/libc/bionic/mbrtoc32.cpp
@@ -51,7 +51,21 @@
}
if (n == 0) {
- return 0;
+ // C23 7.30.1 (for each `mbrtoc*` function) says:
+ //
+ // Returns:
+ //
+ // 0 if the next n or fewer bytes complete the multibyte character that
+ // corresponds to the null wide character (which is the value stored).
+ //
+ // (size_t)(-2) if the next n bytes contribute to an incomplete (but
+ // potentially valid) multibyte character, and all n bytes have been
+ // processed (no value is stored).
+ //
+ // Bionic historically interpreted the behavior when n is 0 to be the next 0
+ // bytes decoding to the null. That's a pretty bad interpretation, and both
+ // glibc and musl return -2 for that case.
+ return BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE;
}
uint8_t ch;
@@ -109,7 +123,7 @@
mbstate_set_byte(state, bytes_so_far + i, *s++);
}
if (i < bytes_wanted) {
- return __MB_ERR_INCOMPLETE_SEQUENCE;
+ return BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE;
}
// Decode the octet sequence representing the character in chunks
diff --git a/libc/bionic/mmap.cpp b/libc/bionic/mmap.cpp
index ed6b9c6..f05dcb8 100644
--- a/libc/bionic/mmap.cpp
+++ b/libc/bionic/mmap.cpp
@@ -32,6 +32,7 @@
#include <unistd.h>
#include "platform/bionic/macros.h"
+#include "platform/bionic/page.h"
#include "private/ErrnoRestorer.h"
// mmap2(2) is like mmap(2), but the offset is in 4096-byte blocks, not bytes.
@@ -46,7 +47,7 @@
}
// Prevent allocations large enough for `end - start` to overflow.
- size_t rounded = __BIONIC_ALIGN(size, PAGE_SIZE);
+ size_t rounded = __BIONIC_ALIGN(size, page_size());
if (rounded < size || rounded > PTRDIFF_MAX) {
errno = ENOMEM;
return MAP_FAILED;
diff --git a/libc/bionic/mremap.cpp b/libc/bionic/mremap.cpp
index d7c9353..88ec829 100644
--- a/libc/bionic/mremap.cpp
+++ b/libc/bionic/mremap.cpp
@@ -33,12 +33,13 @@
#include <unistd.h>
#include "platform/bionic/macros.h"
+#include "platform/bionic/page.h"
extern "C" void* __mremap(void*, size_t, size_t, int, void*);
void* mremap(void* old_address, size_t old_size, size_t new_size, int flags, ...) {
// prevent allocations large enough for `end - start` to overflow
- size_t rounded = __BIONIC_ALIGN(new_size, PAGE_SIZE);
+ size_t rounded = __BIONIC_ALIGN(new_size, page_size());
if (rounded < new_size || rounded > PTRDIFF_MAX) {
errno = ENOMEM;
return MAP_FAILED;
diff --git a/libc/bionic/poll.cpp b/libc/bionic/poll.cpp
index 3290315..7d80b4c 100644
--- a/libc/bionic/poll.cpp
+++ b/libc/bionic/poll.cpp
@@ -50,14 +50,8 @@
int ppoll(pollfd* fds, nfds_t fd_count, const timespec* ts, const sigset_t* ss) {
// The underlying `__ppoll` system call only takes `sigset64_t`.
- SigSetConverter set;
- sigset64_t* ss_ptr = nullptr;
- if (ss != nullptr) {
- set = {};
- set.sigset = *ss;
- ss_ptr = &set.sigset64;
- }
- return ppoll64(fds, fd_count, ts, ss_ptr);
+ SigSetConverter set{ss};
+ return ppoll64(fds, fd_count, ts, set.ptr);
}
int ppoll64(pollfd* fds, nfds_t fd_count, const timespec* ts, const sigset64_t* ss) {
@@ -99,14 +93,8 @@
int pselect(int fd_count, fd_set* read_fds, fd_set* write_fds, fd_set* error_fds,
const timespec* ts, const sigset_t* ss) {
// The underlying `__pselect6` system call only takes `sigset64_t`.
- SigSetConverter set;
- sigset64_t* ss_ptr = nullptr;
- if (ss != nullptr) {
- set = {};
- set.sigset = *ss;
- ss_ptr = &set.sigset64;
- }
- return pselect64(fd_count, read_fds, write_fds, error_fds, ts, ss_ptr);
+ SigSetConverter set{ss};
+ return pselect64(fd_count, read_fds, write_fds, error_fds, ts, set.ptr);
}
int pselect64(int fd_count, fd_set* read_fds, fd_set* write_fds, fd_set* error_fds,
diff --git a/libc/bionic/pthread_attr.cpp b/libc/bionic/pthread_attr.cpp
index 89aa289..de4cc9e 100644
--- a/libc/bionic/pthread_attr.cpp
+++ b/libc/bionic/pthread_attr.cpp
@@ -36,8 +36,9 @@
#include <async_safe/log.h>
-#include "private/bionic_defs.h"
+#include "platform/bionic/page.h"
#include "private/ErrnoRestorer.h"
+#include "private/bionic_defs.h"
#include "pthread_internal.h"
__BIONIC_WEAK_FOR_NATIVE_BRIDGE
@@ -143,10 +144,10 @@
__BIONIC_WEAK_FOR_NATIVE_BRIDGE
int pthread_attr_setstack(pthread_attr_t* attr, void* stack_base, size_t stack_size) {
- if ((stack_size & (PAGE_SIZE - 1) || stack_size < PTHREAD_STACK_MIN)) {
+ if ((stack_size & (page_size() - 1) || stack_size < PTHREAD_STACK_MIN)) {
return EINVAL;
}
- if (reinterpret_cast<uintptr_t>(stack_base) & (PAGE_SIZE - 1)) {
+ if (reinterpret_cast<uintptr_t>(stack_base) & (page_size() - 1)) {
return EINVAL;
}
attr->stack_base = stack_base;
@@ -157,12 +158,12 @@
static uintptr_t __get_main_stack_startstack() {
FILE* fp = fopen("/proc/self/stat", "re");
if (fp == nullptr) {
- async_safe_fatal("couldn't open /proc/self/stat: %s", strerror(errno));
+ async_safe_fatal("couldn't open /proc/self/stat: %m");
}
char line[BUFSIZ];
if (fgets(line, sizeof(line), fp) == nullptr) {
- async_safe_fatal("couldn't read /proc/self/stat: %s", strerror(errno));
+ async_safe_fatal("couldn't read /proc/self/stat: %m");
}
fclose(fp);
@@ -204,7 +205,7 @@
// Hunt for the region that contains that address.
FILE* fp = fopen("/proc/self/maps", "re");
if (fp == nullptr) {
- async_safe_fatal("couldn't open /proc/self/maps: %s", strerror(errno));
+ async_safe_fatal("couldn't open /proc/self/maps: %m");
}
char line[BUFSIZ];
while (fgets(line, sizeof(line), fp) != nullptr) {
@@ -218,7 +219,7 @@
}
}
}
- async_safe_fatal("Stack not found in /proc/self/maps");
+ async_safe_fatal("stack not found in /proc/self/maps");
}
__BIONIC_WEAK_FOR_NATIVE_BRIDGE
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp
index 7bf9b40..194db18 100644
--- a/libc/bionic/pthread_create.cpp
+++ b/libc/bionic/pthread_create.cpp
@@ -42,6 +42,7 @@
#include "platform/bionic/macros.h"
#include "platform/bionic/mte.h"
+#include "platform/bionic/page.h"
#include "private/ErrnoRestorer.h"
#include "private/ScopedRWLock.h"
#include "private/bionic_constants.h"
@@ -71,20 +72,19 @@
// Allocate a temporary bionic_tls that the dynamic linker's main thread can
// use while it's loading the initial set of ELF modules.
bionic_tls* __allocate_temp_bionic_tls() {
- size_t allocation_size = __BIONIC_ALIGN(sizeof(bionic_tls), PAGE_SIZE);
+ size_t allocation_size = __BIONIC_ALIGN(sizeof(bionic_tls), page_size());
void* allocation = mmap(nullptr, allocation_size,
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS,
-1, 0);
if (allocation == MAP_FAILED) {
- // Avoid strerror because it might need bionic_tls.
- async_safe_fatal("failed to allocate bionic_tls: error %d", errno);
+ async_safe_fatal("failed to allocate bionic_tls: %m");
}
return static_cast<bionic_tls*>(allocation);
}
void __free_temp_bionic_tls(bionic_tls* tls) {
- munmap(tls, __BIONIC_ALIGN(sizeof(bionic_tls), PAGE_SIZE));
+ munmap(tls, __BIONIC_ALIGN(sizeof(bionic_tls), page_size()));
}
static void __init_alternate_signal_stack(pthread_internal_t* thread) {
@@ -136,11 +136,13 @@
// Make the stack read-write, and store its address in the register we're using as the shadow
// stack pointer. This is deliberately the only place where the address is stored.
char* scs = scs_aligned_guard_region + scs_offset;
- mprotect(scs, SCS_SIZE, PROT_READ | PROT_WRITE);
+ if (mprotect(scs, SCS_SIZE, PROT_READ | PROT_WRITE) == -1) {
+ async_safe_fatal("shadow stack read-write mprotect(%p, %d) failed: %m", scs, SCS_SIZE);
+ }
#if defined(__aarch64__)
__asm__ __volatile__("mov x18, %0" ::"r"(scs));
#elif defined(__riscv)
- __asm__ __volatile__("mv gp, %0" ::"r"(scs));
+ __asm__ __volatile__("mv x3, %0" ::"r"(scs));
#endif
#endif
}
@@ -170,12 +172,11 @@
if (need_set) {
if (policy == -1) {
async_safe_format_log(ANDROID_LOG_WARN, "libc",
- "pthread_create sched_getscheduler failed: %s", strerror(errno));
+ "pthread_create sched_getscheduler failed: %m");
return errno;
}
if (sched_getparam(0, ¶m) == -1) {
- async_safe_format_log(ANDROID_LOG_WARN, "libc",
- "pthread_create sched_getparam failed: %s", strerror(errno));
+ async_safe_format_log(ANDROID_LOG_WARN, "libc", "pthread_create sched_getparam failed: %m");
return errno;
}
}
@@ -191,8 +192,8 @@
if (need_set) {
if (sched_setscheduler(thread->tid, policy, ¶m) == -1) {
async_safe_format_log(ANDROID_LOG_WARN, "libc",
- "pthread_create sched_setscheduler(%d, {%d}) call failed: %s", policy,
- param.sched_priority, strerror(errno));
+ "pthread_create sched_setscheduler(%d, {%d}) call failed: %m", policy,
+ param.sched_priority);
#if defined(__LP64__)
// For backwards compatibility reasons, we only report failures on 64-bit devices.
return errno;
@@ -203,12 +204,11 @@
return 0;
}
-
// Allocate a thread's primary mapping. This mapping includes static TLS and
// optionally a stack. Static TLS includes ELF TLS segments and the bionic_tls
// struct.
//
-// The stack_guard_size must be a multiple of the PAGE_SIZE.
+// The stack_guard_size must be a multiple of the page_size().
ThreadMapping __allocate_thread_mapping(size_t stack_size, size_t stack_guard_size) {
const StaticTlsLayout& layout = __libc_shared_globals()->static_tls_layout;
@@ -220,7 +220,7 @@
// Align the result to a page size.
const size_t unaligned_size = mmap_size;
- mmap_size = __BIONIC_ALIGN(mmap_size, PAGE_SIZE);
+ mmap_size = __BIONIC_ALIGN(mmap_size, page_size());
if (mmap_size < unaligned_size) return {};
// Create a new private anonymous map. Make the entire mapping PROT_NONE, then carve out a
@@ -228,10 +228,9 @@
const int flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE;
char* const space = static_cast<char*>(mmap(nullptr, mmap_size, PROT_NONE, flags, -1, 0));
if (space == MAP_FAILED) {
- async_safe_format_log(ANDROID_LOG_WARN,
- "libc",
- "pthread_create failed: couldn't allocate %zu-bytes mapped space: %s",
- mmap_size, strerror(errno));
+ async_safe_format_log(ANDROID_LOG_WARN, "libc",
+ "pthread_create failed: couldn't allocate %zu-bytes mapped space: %m",
+ mmap_size);
return {};
}
const size_t writable_size = mmap_size - stack_guard_size - PTHREAD_GUARD_SIZE;
@@ -246,8 +245,8 @@
if (mprotect(space + stack_guard_size, writable_size, prot) != 0) {
async_safe_format_log(
ANDROID_LOG_WARN, "libc",
- "pthread_create failed: couldn't mprotect %s %zu-byte thread mapping region: %s", prot_str,
- writable_size, strerror(errno));
+ "pthread_create failed: couldn't mprotect %s %zu-byte thread mapping region: %m", prot_str,
+ writable_size);
munmap(space, mmap_size);
return {};
}
@@ -271,9 +270,9 @@
if (attr->stack_base == nullptr) {
// The caller didn't provide a stack, so allocate one.
- // Make sure the guard size is a multiple of PAGE_SIZE.
+ // Make sure the guard size is a multiple of page_size().
const size_t unaligned_guard_size = attr->guard_size;
- attr->guard_size = __BIONIC_ALIGN(attr->guard_size, PAGE_SIZE);
+ attr->guard_size = __BIONIC_ALIGN(attr->guard_size, page_size());
if (attr->guard_size < unaligned_guard_size) return EAGAIN;
mapping = __allocate_thread_mapping(attr->stack_size, attr->guard_size);
@@ -458,8 +457,7 @@
if (thread->mmap_size != 0) {
munmap(thread->mmap_base, thread->mmap_size);
}
- async_safe_format_log(ANDROID_LOG_WARN, "libc", "pthread_create failed: clone failed: %s",
- strerror(clone_errno));
+ async_safe_format_log(ANDROID_LOG_WARN, "libc", "pthread_create failed: clone failed: %m");
return clone_errno;
}
diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h
index 106f3ed..3b9e6a4 100644
--- a/libc/bionic/pthread_internal.h
+++ b/libc/bionic/pthread_internal.h
@@ -38,6 +38,8 @@
#define __hwasan_thread_exit()
#endif
+#include "platform/bionic/page.h"
+
#include "private/bionic_elf_tls.h"
#include "private/bionic_lock.h"
#include "private/bionic_tls.h"
@@ -176,13 +178,6 @@
bionic_tls* bionic_tls;
int errno_value;
-
- // The last observed value of SP in a vfork child process.
- // The part of the stack between this address and the value of SP when the vfork parent process
- // regains control may have stale MTE tags and needs cleanup. This field is only meaningful while
- // the parent is waiting for the vfork child to return control by calling either exec*() or
- // exit().
- void* vfork_child_stack_bottom;
};
struct ThreadMapping {
@@ -243,7 +238,7 @@
// On LP64, we could use more but there's no obvious advantage to doing
// so, and the various media processes use RLIMIT_AS as a way to limit
// the amount of allocation they'll do.
-#define PTHREAD_GUARD_SIZE PAGE_SIZE
+#define PTHREAD_GUARD_SIZE max_page_size()
// SIGSTKSZ (8KiB) is not big enough.
// An snprintf to a stack buffer of size PATH_MAX consumes ~7KiB of stack.
diff --git a/libc/bionic/signal.cpp b/libc/bionic/signal.cpp
index b581b5a..2cf9940 100644
--- a/libc/bionic/signal.cpp
+++ b/libc/bionic/signal.cpp
@@ -76,13 +76,23 @@
return SigAddSet(set, sig);
}
-// This isn't in our header files, but is exposed on all architectures.
+union BsdSigSet {
+ int mask;
+ sigset64_t set;
+};
+
+// This isn't in our header files, but is exposed on all architectures except riscv64.
extern "C" int sigblock(int mask) {
- SigSetConverter in, out;
- sigemptyset(&in.sigset);
- in.bsd = mask;
- if (sigprocmask(SIG_BLOCK, &in.sigset, &out.sigset) == -1) return -1;
- return out.bsd;
+ BsdSigSet in{.mask = mask}, out;
+ if (sigprocmask64(SIG_BLOCK, &in.set, &out.set) == -1) return -1;
+ return out.mask;
+}
+
+// This isn't in our header files, but is exposed on all architectures except riscv64.
+extern "C" int sigsetmask(int mask) {
+ BsdSigSet in{.mask = mask}, out;
+ if (sigprocmask64(SIG_SETMASK, &in.set, &out.set) == -1) return -1;
+ return out.mask;
}
template <typename SigSetT>
@@ -198,10 +208,9 @@
}
int sigpending(sigset_t* bionic_set) {
- SigSetConverter set = {};
- set.sigset = *bionic_set;
- if (__rt_sigpending(&set.sigset64, sizeof(set.sigset64)) == -1) return -1;
- *bionic_set = set.sigset;
+ SigSetConverter set{bionic_set};
+ if (__rt_sigpending(set.ptr, sizeof(sigset64_t)) == -1) return -1;
+ set.copy_out();
return 0;
}
@@ -245,19 +254,9 @@
return sigismember64(&old_mask, sig) ? SIG_HOLD : old_sa.sa_handler;
}
-// This isn't in our header files, but is exposed on all architectures.
-extern "C" int sigsetmask(int mask) {
- SigSetConverter in, out;
- sigemptyset(&in.sigset);
- in.bsd = mask;
- if (sigprocmask(SIG_SETMASK, &in.sigset, &out.sigset) == -1) return -1;
- return out.bsd;
-}
-
int sigsuspend(const sigset_t* bionic_set) {
- SigSetConverter set = {};
- set.sigset = *bionic_set;
- return sigsuspend64(&set.sigset64);
+ SigSetConverter set{bionic_set};
+ return sigsuspend64(set.ptr);
}
int sigsuspend64(const sigset64_t* set) {
@@ -271,9 +270,8 @@
}
int sigtimedwait(const sigset_t* bionic_set, siginfo_t* info, const timespec* timeout) {
- SigSetConverter set = {};
- set.sigset = *bionic_set;
- return sigtimedwait64(&set.sigset64, info, timeout);
+ SigSetConverter set{bionic_set};
+ return sigtimedwait64(set.ptr, info, timeout);
}
int sigtimedwait64(const sigset64_t* set, siginfo_t* info, const timespec* timeout) {
@@ -287,9 +285,8 @@
}
int sigwait(const sigset_t* bionic_set, int* sig) {
- SigSetConverter set = {};
- set.sigset = *bionic_set;
- return sigwait64(&set.sigset64, sig);
+ SigSetConverter set{bionic_set};
+ return sigwait64(set.ptr, sig);
}
int sigwait64(const sigset64_t* set, int* sig) {
diff --git a/libc/bionic/sigprocmask.cpp b/libc/bionic/sigprocmask.cpp
index 8781c9b..6d436a6 100644
--- a/libc/bionic/sigprocmask.cpp
+++ b/libc/bionic/sigprocmask.cpp
@@ -44,24 +44,13 @@
int sigprocmask(int how,
const sigset_t* bionic_new_set,
sigset_t* bionic_old_set) __attribute__((__noinline__)) {
- SigSetConverter new_set;
- sigset64_t* new_set_ptr = nullptr;
- if (bionic_new_set != nullptr) {
- sigemptyset64(&new_set.sigset64);
- new_set.sigset = *bionic_new_set;
- new_set_ptr = &new_set.sigset64;
+ SigSetConverter new_set{bionic_new_set};
+ SigSetConverter old_set{bionic_old_set};
+ int rc = sigprocmask64(how, new_set.ptr, old_set.ptr);
+ if (rc == 0 && bionic_old_set != nullptr) {
+ old_set.copy_out();
}
-
- SigSetConverter old_set;
- if (sigprocmask64(how, new_set_ptr, &old_set.sigset64) == -1) {
- return -1;
- }
-
- if (bionic_old_set != nullptr) {
- *bionic_old_set = old_set.sigset;
- }
-
- return 0;
+ return rc;
}
int sigprocmask64(int how,
diff --git a/libc/bionic/spawn.cpp b/libc/bionic/spawn.cpp
index 5d76f77..38f99ad 100644
--- a/libc/bionic/spawn.cpp
+++ b/libc/bionic/spawn.cpp
@@ -41,7 +41,6 @@
#include <android/fdsan.h>
#include "private/ScopedSignalBlocker.h"
-#include "private/SigSetConverter.h"
static int set_cloexec(int i) {
int v = fcntl(i, F_GETFD);
@@ -131,8 +130,10 @@
pid_t pgroup;
sched_param schedparam;
int schedpolicy;
- SigSetConverter sigmask;
- SigSetConverter sigdefault;
+ union {
+ sigset_t sigset;
+ sigset64_t sigset64;
+ } sigmask, sigdefault;
};
static void ApplyAttrs(short flags, const posix_spawnattr_t* attr) {
diff --git a/libc/bionic/strtold.cpp b/libc/bionic/strtold.cpp
index 6b673e6..c55dd61 100644
--- a/libc/bionic/strtold.cpp
+++ b/libc/bionic/strtold.cpp
@@ -26,8 +26,6 @@
* SUCH DAMAGE.
*/
-#define __BIONIC_LP32_USE_LONG_DOUBLE
-
#include <float.h>
#include <stdlib.h>
diff --git a/libc/bionic/sys_epoll.cpp b/libc/bionic/sys_epoll.cpp
index 22d0a98..be97818 100644
--- a/libc/bionic/sys_epoll.cpp
+++ b/libc/bionic/sys_epoll.cpp
@@ -34,6 +34,8 @@
extern "C" int __epoll_create1(int flags);
extern "C" int __epoll_pwait(int, epoll_event*, int, int, const sigset64_t*, size_t);
+extern "C" int __epoll_pwait2(int, epoll_event*, int, const __kernel_timespec*, const sigset64_t*,
+ size_t);
int epoll_create(int size) {
if (size <= 0) {
@@ -48,20 +50,39 @@
}
int epoll_pwait(int fd, epoll_event* events, int max_events, int timeout, const sigset_t* ss) {
- SigSetConverter set;
- sigset64_t* ss_ptr = nullptr;
- if (ss != nullptr) {
- set = {};
- set.sigset = *ss;
- ss_ptr = &set.sigset64;
- }
- return epoll_pwait64(fd, events, max_events, timeout, ss_ptr);
+ SigSetConverter set{ss};
+ return epoll_pwait64(fd, events, max_events, timeout, set.ptr);
}
int epoll_pwait64(int fd, epoll_event* events, int max_events, int timeout, const sigset64_t* ss) {
return __epoll_pwait(fd, events, max_events, timeout, ss, sizeof(*ss));
}
+int epoll_pwait2(int fd, epoll_event* events, int max_events, const timespec* timeout,
+ const sigset_t* ss) {
+ SigSetConverter set{ss};
+ return epoll_pwait2_64(fd, events, max_events, timeout, set.ptr);
+}
+
+int epoll_pwait2_64(int fd, epoll_event* events, int max_events, const timespec* timeout,
+ const sigset64_t* ss) {
+ // epoll_pwait2() is our first syscall that assumes a 64-bit time_t even for
+ // 32-bit processes, so for ILP32 we need to convert.
+ // TODO: factor this out into a TimeSpecConverter as/when we get more syscalls like this.
+#if __LP64__
+ const __kernel_timespec* kts_ptr = reinterpret_cast<const __kernel_timespec*>(timeout);
+#else
+ __kernel_timespec kts;
+ const __kernel_timespec* kts_ptr = nullptr;
+ if (timeout) {
+ kts.tv_sec = timeout->tv_sec;
+ kts.tv_nsec = timeout->tv_nsec;
+ kts_ptr = &kts;
+ }
+#endif
+ return __epoll_pwait2(fd, events, max_events, kts_ptr, ss, sizeof(*ss));
+}
+
int epoll_wait(int fd, struct epoll_event* events, int max_events, int timeout) {
return epoll_pwait64(fd, events, max_events, timeout, nullptr);
}
diff --git a/libc/bionic/sys_signalfd.cpp b/libc/bionic/sys_signalfd.cpp
index 53d1f25..1e62cf4 100644
--- a/libc/bionic/sys_signalfd.cpp
+++ b/libc/bionic/sys_signalfd.cpp
@@ -32,12 +32,12 @@
extern "C" int __signalfd4(int, const sigset64_t*, size_t, int);
-int signalfd(int fd, const sigset_t* mask, int flags) {
- SigSetConverter set = {};
- set.sigset = *mask;
- return signalfd64(fd, &set.sigset64, flags);
-}
-
int signalfd64(int fd, const sigset64_t* mask, int flags) {
return __signalfd4(fd, mask, sizeof(*mask), flags);
}
+
+int signalfd(int fd, const sigset_t* mask, int flags) {
+ // The underlying `__signalfd4` system call only takes `sigset64_t`.
+ SigSetConverter set{mask};
+ return signalfd64(fd, set.ptr, flags);
+}
diff --git a/libc/bionic/sysconf.cpp b/libc/bionic/sysconf.cpp
index 1c06c9e..edbdef1 100644
--- a/libc/bionic/sysconf.cpp
+++ b/libc/bionic/sysconf.cpp
@@ -38,8 +38,110 @@
#include <time.h>
#include <unistd.h>
+#include "platform/bionic/page.h"
#include "private/bionic_tls.h"
+struct sysconf_cache {
+ long size, assoc, linesize;
+
+ static sysconf_cache from_size_and_geometry(int size_id, int geometry_id) {
+ sysconf_cache result;
+ result.size = getauxval(size_id);
+ unsigned long geometry = getauxval(geometry_id);
+ result.assoc = geometry >> 16;
+ result.linesize = geometry & 0xffff;
+ return result;
+ }
+};
+
+struct sysconf_caches {
+ sysconf_cache l1_i, l1_d, l2, l3, l4;
+};
+
+#if defined(__riscv)
+
+static sysconf_caches* __sysconf_caches() {
+ static sysconf_caches cached = []{
+ sysconf_caches info = {};
+ // riscv64 kernels conveniently hand us all this information.
+ info.l1_i = sysconf_cache::from_size_and_geometry(AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY);
+ info.l1_d = sysconf_cache::from_size_and_geometry(AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY);
+ info.l2 = sysconf_cache::from_size_and_geometry(AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY);
+ info.l3 = sysconf_cache::from_size_and_geometry(AT_L3_CACHESIZE, AT_L3_CACHEGEOMETRY);
+ return info;
+ }();
+ return &cached;
+}
+
+#elif defined(__aarch64__)
+
+static sysconf_caches* __sysconf_caches() {
+ static sysconf_caches cached = []{
+ sysconf_caches info = {};
+ // arm64 is especially limited. We can infer the L1 line sizes, but that's it.
+ uint64_t ctr_el0;
+ __asm__ __volatile__("mrs %0, ctr_el0" : "=r"(ctr_el0));
+ info.l1_i.linesize = 4 << (ctr_el0 & 0xf);
+ info.l1_d.linesize = 4 << ((ctr_el0 >> 16) & 0xf);
+ return info;
+ }();
+ return &cached;
+}
+
+#else
+
+long __sysconf_fread_long(const char* path) {
+ long result = 0;
+ FILE* fp = fopen(path, "re");
+ if (fp != nullptr) {
+ fscanf(fp, "%ld", &result);
+ fclose(fp);
+ }
+ return result;
+}
+
+static sysconf_caches* __sysconf_caches() {
+ static sysconf_caches cached = []{
+ sysconf_caches info = {};
+ char path[64];
+ for (int i = 0; i < 4; i++) {
+ sysconf_cache c;
+
+ snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu0/cache/index%d/size", i);
+ c.size = __sysconf_fread_long(path) * 1024;
+ if (c.size == 0) break;
+
+ snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu0/cache/index%d/ways_of_associativity", i);
+ c.assoc = __sysconf_fread_long(path);
+
+ snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu0/cache/index%d/coherency_line_size", i);
+ c.linesize = __sysconf_fread_long(path);
+
+ snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu0/cache/index%d/level", i);
+ int level = __sysconf_fread_long(path);
+ if (level == 1) {
+ snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu0/cache/index%d/type", i);
+ FILE* fp = fopen(path, "re");
+ char type = fgetc(fp);
+ fclose(fp);
+ if (type == 'D') {
+ info.l1_d = c;
+ } else if (type == 'I') {
+ info.l1_i = c;
+ }
+ } else if (level == 2) {
+ info.l2 = c;
+ } else if (level == 3) {
+ info.l3 = c;
+ }
+ }
+ return info;
+ }();
+ return &cached;
+}
+
+#endif
+
static long __sysconf_rlimit(int resource) {
rlimit rl;
getrlimit(resource, &rl);
@@ -217,23 +319,21 @@
case _SC_XOPEN_STREAMS: return -1; // Obsolescent in POSIX.1-2008.
case _SC_XOPEN_UUCP: return -1;
- // We do not have actual implementations for cache queries.
- // It's valid to return 0 as the result is unknown.
- case _SC_LEVEL1_ICACHE_SIZE: return 0;
- case _SC_LEVEL1_ICACHE_ASSOC: return 0;
- case _SC_LEVEL1_ICACHE_LINESIZE: return 0;
- case _SC_LEVEL1_DCACHE_SIZE: return 0;
- case _SC_LEVEL1_DCACHE_ASSOC: return 0;
- case _SC_LEVEL1_DCACHE_LINESIZE: return 0;
- case _SC_LEVEL2_CACHE_SIZE: return 0;
- case _SC_LEVEL2_CACHE_ASSOC: return 0;
- case _SC_LEVEL2_CACHE_LINESIZE: return 0;
- case _SC_LEVEL3_CACHE_SIZE: return 0;
- case _SC_LEVEL3_CACHE_ASSOC: return 0;
- case _SC_LEVEL3_CACHE_LINESIZE: return 0;
- case _SC_LEVEL4_CACHE_SIZE: return 0;
- case _SC_LEVEL4_CACHE_ASSOC: return 0;
- case _SC_LEVEL4_CACHE_LINESIZE: return 0;
+ case _SC_LEVEL1_ICACHE_SIZE: return __sysconf_caches()->l1_i.size;
+ case _SC_LEVEL1_ICACHE_ASSOC: return __sysconf_caches()->l1_i.assoc;
+ case _SC_LEVEL1_ICACHE_LINESIZE: return __sysconf_caches()->l1_i.linesize;
+ case _SC_LEVEL1_DCACHE_SIZE: return __sysconf_caches()->l1_d.size;
+ case _SC_LEVEL1_DCACHE_ASSOC: return __sysconf_caches()->l1_d.assoc;
+ case _SC_LEVEL1_DCACHE_LINESIZE: return __sysconf_caches()->l1_d.linesize;
+ case _SC_LEVEL2_CACHE_SIZE: return __sysconf_caches()->l2.size;
+ case _SC_LEVEL2_CACHE_ASSOC: return __sysconf_caches()->l2.assoc;
+ case _SC_LEVEL2_CACHE_LINESIZE: return __sysconf_caches()->l2.linesize;
+ case _SC_LEVEL3_CACHE_SIZE: return __sysconf_caches()->l3.size;
+ case _SC_LEVEL3_CACHE_ASSOC: return __sysconf_caches()->l3.assoc;
+ case _SC_LEVEL3_CACHE_LINESIZE: return __sysconf_caches()->l3.linesize;
+ case _SC_LEVEL4_CACHE_SIZE: return __sysconf_caches()->l4.size;
+ case _SC_LEVEL4_CACHE_ASSOC: return __sysconf_caches()->l4.assoc;
+ case _SC_LEVEL4_CACHE_LINESIZE: return __sysconf_caches()->l4.linesize;
default:
errno = EINVAL;
diff --git a/libc/bionic/sysinfo.cpp b/libc/bionic/sysinfo.cpp
index 1e4a0e8..79fd55e 100644
--- a/libc/bionic/sysinfo.cpp
+++ b/libc/bionic/sysinfo.cpp
@@ -33,8 +33,9 @@
#include <string.h>
#include <unistd.h>
-#include "private/get_cpu_count_from_string.h"
+#include "platform/bionic/page.h"
#include "private/ScopedReaddir.h"
+#include "private/get_cpu_count_from_string.h"
int __get_cpu_count(const char* sys_file) {
int cpu_count = 1;
@@ -64,11 +65,11 @@
long get_phys_pages() {
struct sysinfo si;
sysinfo(&si);
- return (static_cast<int64_t>(si.totalram) * si.mem_unit) / PAGE_SIZE;
+ return (static_cast<int64_t>(si.totalram) * si.mem_unit) / page_size();
}
long get_avphys_pages() {
struct sysinfo si;
sysinfo(&si);
- return ((static_cast<int64_t>(si.freeram) + si.bufferram) * si.mem_unit) / PAGE_SIZE;
+ return ((static_cast<int64_t>(si.freeram) + si.bufferram) * si.mem_unit) / page_size();
}
diff --git a/libc/bionic/sysprop_helpers.cpp b/libc/bionic/sysprop_helpers.cpp
index 2051330..5627034 100644
--- a/libc/bionic/sysprop_helpers.cpp
+++ b/libc/bionic/sysprop_helpers.cpp
@@ -57,22 +57,18 @@
}
bool get_config_from_env_or_sysprops(const char* env_var_name, const char* const* sys_prop_names,
- size_t sys_prop_names_size, char* options, size_t options_size,
- const char** chosen_source) {
+ size_t sys_prop_names_size, char* options,
+ size_t options_size) {
const char* env = getenv(env_var_name);
if (env && *env != '\0') {
strncpy(options, env, options_size);
options[options_size - 1] = '\0'; // Ensure null-termination.
- *chosen_source = env_var_name;
return true;
}
for (size_t i = 0; i < sys_prop_names_size; ++i) {
if (sys_prop_names[i] == nullptr) continue;
- if (get_property_value(sys_prop_names[i], options, options_size)) {
- *chosen_source = sys_prop_names[i];
- return true;
- }
+ if (get_property_value(sys_prop_names[i], options, options_size)) return true;
}
return false;
}
diff --git a/libc/bionic/sysprop_helpers.h b/libc/bionic/sysprop_helpers.h
index 84e7af1..a02c2dc 100644
--- a/libc/bionic/sysprop_helpers.h
+++ b/libc/bionic/sysprop_helpers.h
@@ -36,13 +36,10 @@
// 2. System properties, in the order they're specified in sys_prop_names.
// If neither of these options are specified (or they're both an empty string),
// this function returns false. Otherwise, it returns true, and the presiding
-// options string is written to the `options` buffer of size `size`. It will
-// store a pointer to either env_var_name, or into the relevant entry of
-// sys_prop_names into choicen_source, indiciating which value was used. If
-// this function returns true, `options` is guaranteed to be null-terminated.
+// options string is written to the `options` buffer of size `size`. If this
+// function returns true, `options` is guaranteed to be null-terminated.
// `options_size` should be at least PROP_VALUE_MAX.
__LIBC_HIDDEN__ bool get_config_from_env_or_sysprops(const char* env_var_name,
const char* const* sys_prop_names,
size_t sys_prop_names_size, char* options,
- size_t options_size,
- const char** chosen_source);
+ size_t options_size);
diff --git a/libc/bionic/system_property_set.cpp b/libc/bionic/system_property_set.cpp
index 212aafc..f7999db 100644
--- a/libc/bionic/system_property_set.cpp
+++ b/libc/bionic/system_property_set.cpp
@@ -272,10 +272,9 @@
PropertyServiceConnection connection;
if (!connection.IsValid()) {
errno = connection.GetLastError();
- async_safe_format_log(
- ANDROID_LOG_WARN, "libc",
- "Unable to set property \"%s\" to \"%s\": connection failed; errno=%d (%s)", key, value,
- errno, strerror(errno));
+ async_safe_format_log(ANDROID_LOG_WARN, "libc",
+ "Unable to set property \"%s\" to \"%s\": connection failed: %m", key,
+ value);
return -1;
}
@@ -283,8 +282,8 @@
if (!writer.WriteUint32(PROP_MSG_SETPROP2).WriteString(key).WriteString(value).Send()) {
errno = connection.GetLastError();
async_safe_format_log(ANDROID_LOG_WARN, "libc",
- "Unable to set property \"%s\" to \"%s\": write failed; errno=%d (%s)",
- key, value, errno, strerror(errno));
+ "Unable to set property \"%s\" to \"%s\": write failed: %m", key,
+ value);
return -1;
}
@@ -292,8 +291,7 @@
if (!connection.RecvInt32(&result)) {
errno = connection.GetLastError();
async_safe_format_log(ANDROID_LOG_WARN, "libc",
- "Unable to set property \"%s\" to \"%s\": recv failed; errno=%d (%s)",
- key, value, errno, strerror(errno));
+ "Unable to set property \"%s\" to \"%s\": recv failed: %m", key, value);
return -1;
}
diff --git a/libc/bionic/termios.cpp b/libc/bionic/termios.cpp
index 5fe8eb0..57b34b7 100644
--- a/libc/bionic/termios.cpp
+++ b/libc/bionic/termios.cpp
@@ -34,6 +34,10 @@
#define __BIONIC_TERMIOS_INLINE /* Out of line. */
#include <bits/termios_inlines.h>
+// POSIX added a couple more functions much later, so do the same for them.
+#define __BIONIC_TERMIOS_WINSIZE_INLINE /* Out of line. */
+#include <bits/termios_winsize_inlines.h>
+
// Actually declared in <unistd.h>, present on all API levels.
pid_t tcgetpgrp(int fd) {
pid_t pid;
diff --git a/libc/bionic/vdso.cpp b/libc/bionic/vdso.cpp
index dbca9c0..d0f01d0 100644
--- a/libc/bionic/vdso.cpp
+++ b/libc/bionic/vdso.cpp
@@ -22,10 +22,16 @@
#include <string.h>
#include <sys/auxv.h>
#include <sys/cdefs.h>
+#include <sys/hwprobe.h>
#include <sys/time.h>
+#include <syscall.h>
#include <time.h>
#include <unistd.h>
+extern "C" int __clock_gettime(int, struct timespec*);
+extern "C" int __clock_getres(int, struct timespec*);
+extern "C" int __gettimeofday(struct timeval*, struct timezone*);
+
static inline int vdso_return(int result) {
if (__predict_true(result == 0)) return 0;
@@ -61,10 +67,13 @@
}
time_t time(time_t* t) {
+ // Only x86/x86-64 actually have time() in the vdso.
+#if defined(VDSO_TIME_SYMBOL)
auto vdso_time = reinterpret_cast<decltype(&time)>(__libc_globals->vdso[VDSO_TIME].fn);
if (__predict_true(vdso_time)) {
return vdso_time(t);
}
+#endif
// We can't fallback to the time(2) system call because it doesn't exist for most architectures.
timeval tv;
@@ -73,12 +82,41 @@
return tv.tv_sec;
}
+#if defined(__riscv)
+int __riscv_hwprobe(struct riscv_hwprobe* _Nonnull pairs, size_t pair_count, size_t cpu_count,
+ unsigned long* _Nullable cpus, unsigned flags) {
+ auto vdso_riscv_hwprobe =
+ reinterpret_cast<decltype(&__riscv_hwprobe)>(__libc_globals->vdso[VDSO_RISCV_HWPROBE].fn);
+ if (__predict_true(vdso_riscv_hwprobe)) {
+ return -vdso_riscv_hwprobe(pairs, pair_count, cpu_count, cpus, flags);
+ }
+ // Inline the syscall directly in case someone's calling it from an
+ // ifunc resolver where we won't be able to set errno on failure.
+ // (Rather than our usual trick of letting the python-generated
+ // wrapper set errno but saving/restoring errno in cases where the API
+ // is to return an error value rather than setting errno.)
+ register long a0 __asm__("a0") = reinterpret_cast<long>(pairs);
+ register long a1 __asm__("a1") = pair_count;
+ register long a2 __asm__("a2") = cpu_count;
+ register long a3 __asm__("a3") = reinterpret_cast<long>(cpus);
+ register long a4 __asm__("a4") = flags;
+ register long a7 __asm__("a7") = __NR_riscv_hwprobe;
+ __asm__ volatile("ecall" : "=r"(a0) : "r"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4), "r"(a7));
+ return -a0;
+}
+#endif
+
void __libc_init_vdso(libc_globals* globals) {
auto&& vdso = globals->vdso;
- vdso[VDSO_CLOCK_GETTIME] = { VDSO_CLOCK_GETTIME_SYMBOL, nullptr };
- vdso[VDSO_CLOCK_GETRES] = { VDSO_CLOCK_GETRES_SYMBOL, nullptr };
- vdso[VDSO_GETTIMEOFDAY] = { VDSO_GETTIMEOFDAY_SYMBOL, nullptr };
- vdso[VDSO_TIME] = { VDSO_TIME_SYMBOL, nullptr };
+ vdso[VDSO_CLOCK_GETTIME] = {VDSO_CLOCK_GETTIME_SYMBOL, nullptr};
+ vdso[VDSO_CLOCK_GETRES] = {VDSO_CLOCK_GETRES_SYMBOL, nullptr};
+ vdso[VDSO_GETTIMEOFDAY] = {VDSO_GETTIMEOFDAY_SYMBOL, nullptr};
+#if defined(VDSO_TIME_SYMBOL)
+ vdso[VDSO_TIME] = {VDSO_TIME_SYMBOL, nullptr};
+#endif
+#if defined(VDSO_RISCV_HWPROBE_SYMBOL)
+ vdso[VDSO_RISCV_HWPROBE] = {VDSO_RISCV_HWPROBE_SYMBOL, nullptr};
+#endif
// Do we have a vdso?
uintptr_t vdso_ehdr_addr = getauxval(AT_SYSINFO_EHDR);
diff --git a/libc/bionic/wchar.cpp b/libc/bionic/wchar.cpp
index bd9a45e..b8c4432 100644
--- a/libc/bionic/wchar.cpp
+++ b/libc/bionic/wchar.cpp
@@ -27,10 +27,10 @@
*/
#include <errno.h>
-#include <sys/param.h>
#include <string.h>
-#include <wchar.h>
+#include <sys/param.h>
#include <uchar.h>
+#include <wchar.h>
#include "private/bionic_mbstate.h"
@@ -88,10 +88,10 @@
r = 1;
} else {
r = mbrtowc(nullptr, *src + i, nmc - i, state);
- if (r == __MB_ERR_ILLEGAL_SEQUENCE) {
+ if (r == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE) {
return mbstate_reset_and_return_illegal(EILSEQ, state);
}
- if (r == __MB_ERR_INCOMPLETE_SEQUENCE) {
+ if (r == BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE) {
return mbstate_reset_and_return_illegal(EILSEQ, state);
}
if (r == 0) {
@@ -114,11 +114,11 @@
}
} else {
r = mbrtowc(dst + o, *src + i, nmc - i, state);
- if (r == __MB_ERR_ILLEGAL_SEQUENCE) {
+ if (r == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE) {
*src += i;
return mbstate_reset_and_return_illegal(EILSEQ, state);
}
- if (r == __MB_ERR_INCOMPLETE_SEQUENCE) {
+ if (r == BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE) {
*src += nmc;
return mbstate_reset_and_return_illegal(EILSEQ, state);
}
@@ -135,6 +135,7 @@
size_t mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps) {
return mbsnrtowcs(dst, src, SIZE_MAX, len, ps);
}
+__strong_alias(mbsrtowcs_l, mbsrtowcs);
size_t wcrtomb(char* s, wchar_t wc, mbstate_t* ps) {
static mbstate_t __private_state;
@@ -165,7 +166,7 @@
r = 1;
} else {
r = wcrtomb(buf, wc, state);
- if (r == __MB_ERR_ILLEGAL_SEQUENCE) {
+ if (r == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE) {
return r;
}
}
@@ -186,14 +187,14 @@
} else if (len - o >= sizeof(buf)) {
// Enough space to translate in-place.
r = wcrtomb(dst + o, wc, state);
- if (r == __MB_ERR_ILLEGAL_SEQUENCE) {
+ if (r == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE) {
*src += i;
return r;
}
} else {
// May not be enough space; use temp buffer.
r = wcrtomb(buf, wc, state);
- if (r == __MB_ERR_ILLEGAL_SEQUENCE) {
+ if (r == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE) {
*src += i;
return r;
}
@@ -210,3 +211,4 @@
size_t wcsrtombs(char* dst, const wchar_t** src, size_t len, mbstate_t* ps) {
return wcsnrtombs(dst, src, SIZE_MAX, len, ps);
}
+__strong_alias(wcsrtombs_l, wcsrtombs);
diff --git a/libc/bionic/wchar_l.cpp b/libc/bionic/wchar_l.cpp
index a86961f..1e7a231 100644
--- a/libc/bionic/wchar_l.cpp
+++ b/libc/bionic/wchar_l.cpp
@@ -41,14 +41,6 @@
return wcscoll(ws1, ws2);
}
-size_t wcsftime_l(wchar_t* buf, size_t n, const wchar_t* fmt, const struct tm* tm, locale_t) {
- return wcsftime(buf, n, fmt, tm);
-}
-
-size_t wcsxfrm_l(wchar_t* dst, const wchar_t* src, size_t n, locale_t) {
- return wcsxfrm(dst, src, n);
-}
-
double wcstod_l(const wchar_t* s, wchar_t** end_ptr, locale_t) {
return wcstod(s, end_ptr);
}
@@ -76,3 +68,7 @@
long double wcstold_l(const wchar_t* s, wchar_t** end_ptr, locale_t) {
return wcstold(s, end_ptr);
}
+
+size_t wcsxfrm_l(wchar_t* dst, const wchar_t* src, size_t n, locale_t) {
+ return wcsxfrm(dst, src, n);
+}
diff --git a/libc/bionic/wcstod.cpp b/libc/bionic/wcstod.cpp
index 75a59f5..c82d788 100644
--- a/libc/bionic/wcstod.cpp
+++ b/libc/bionic/wcstod.cpp
@@ -26,8 +26,6 @@
* SUCH DAMAGE.
*/
-#define __BIONIC_LP32_USE_LONG_DOUBLE
-
#include <wchar.h>
#include <stdlib.h>
diff --git a/libc/include/android/dlext.h b/libc/include/android/dlext.h
index f216aab..a5061c7 100644
--- a/libc/include/android/dlext.h
+++ b/libc/include/android/dlext.h
@@ -177,11 +177,8 @@
* Opens the given library. The `__filename` and `__flags` arguments are
* the same as for [dlopen(3)](http://man7.org/linux/man-pages/man3/dlopen.3.html),
* with the Android-specific flags supplied via the `flags` member of `__info`.
- *
- * Available since API level 21.
*/
-void* _Nullable android_dlopen_ext(const char* _Nullable __filename, int __flags, const android_dlextinfo* _Nullable __info)
- __INTRODUCED_IN(21);
+void* _Nullable android_dlopen_ext(const char* _Nullable __filename, int __flags, const android_dlextinfo* _Nullable __info);
__END_DECLS
diff --git a/libc/include/android/legacy_termios_inlines.h b/libc/include/android/legacy_termios_inlines.h
index 6222786..a816b40 100644
--- a/libc/include/android/legacy_termios_inlines.h
+++ b/libc/include/android/legacy_termios_inlines.h
@@ -43,3 +43,10 @@
#include <bits/termios_inlines.h>
#endif
+
+#if __ANDROID_API__ < 35
+
+#define __BIONIC_TERMIOS_WINSIZE_INLINE static __inline
+#include <bits/termios_winsize_inlines.h>
+
+#endif
diff --git a/libc/include/android/set_abort_message.h b/libc/include/android/set_abort_message.h
index 2be01a9..35867ac 100644
--- a/libc/include/android/set_abort_message.h
+++ b/libc/include/android/set_abort_message.h
@@ -43,9 +43,7 @@
* This is meant for use by libraries that deliberately abort so that they can
* provide an explanation. It is used within bionic to implement assert() and
* all FORTIFY/fdsan aborts.
- *
- * Available since API level 21.
*/
-void android_set_abort_message(const char* _Nullable __msg) __INTRODUCED_IN(21);
+void android_set_abort_message(const char* _Nullable __msg);
__END_DECLS
diff --git a/libc/include/android/versioning.h b/libc/include/android/versioning.h
index efe4354..08fe45d 100644
--- a/libc/include/android/versioning.h
+++ b/libc/include/android/versioning.h
@@ -26,9 +26,6 @@
#define __REMOVED_IN(api_level) __attribute__((annotate("obsoleted_in=" #api_level)))
#define __INTRODUCED_IN_32(api_level) __attribute__((annotate("introduced_in_32=" #api_level)))
#define __INTRODUCED_IN_64(api_level) __attribute__((annotate("introduced_in_64=" #api_level)))
-#define __INTRODUCED_IN_ARM(api_level) __attribute__((annotate("introduced_in_arm=" #api_level)))
-#define __INTRODUCED_IN_X86(api_level) __attribute__((annotate("introduced_in_x86=" #api_level)))
-#define __INTRODUCED_IN_X86_NO_GUARD_FOR_NDK(api_level) __attribute__((annotate("introduced_in_x86=" #api_level))) __VERSIONER_NO_GUARD
#define __VERSIONER_NO_GUARD __attribute__((annotate("versioner_no_guard")))
#define __VERSIONER_FORTIFY_INLINE __attribute__((annotate("versioner_fortify_inline")))
@@ -52,11 +49,9 @@
#if defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__)
#define __BIONIC_AVAILABILITY(__what) __attribute__((__availability__(android,__what)))
#define __INTRODUCED_IN_NO_GUARD_FOR_NDK(api_level) __INTRODUCED_IN(api_level)
-#define __INTRODUCED_IN_X86_NO_GUARD_FOR_NDK(api_level) __INTRODUCED_IN_X86(api_level)
#else
#define __BIONIC_AVAILABILITY(__what) __attribute__((__availability__(android,strict,__what)))
#define __INTRODUCED_IN_NO_GUARD_FOR_NDK(api_level)
-#define __INTRODUCED_IN_X86_NO_GUARD_FOR_NDK(api_level)
#endif
#define __INTRODUCED_IN(api_level) __BIONIC_AVAILABILITY(introduced=api_level)
@@ -69,12 +64,6 @@
//
// void foo() __INTRODUCED_IN_32(30) __INTRODUCED_IN_64(31);
//
-// This also takes the advantage of the fact that we never use bitness-specific macro with
-// arch-specific macro. In other words,
-//
-// void foo() __INTRODUCED_IN_ARM(30) __INTRODUCED_IN_64(31);
-//
-// hasn't been supported and won't be.
#if !defined(__LP64__)
#define __INTRODUCED_IN_32(api_level) __BIONIC_AVAILABILITY(introduced=api_level)
#define __INTRODUCED_IN_64(api_level)
@@ -83,17 +72,6 @@
#define __INTRODUCED_IN_64(api_level) __BIONIC_AVAILABILITY(introduced=api_level)
#endif
-#if defined(__arm__) || defined(__aarch64__)
-#define __INTRODUCED_IN_ARM(api_level) __BIONIC_AVAILABILITY(introduced=api_level)
-#define __INTRODUCED_IN_X86(api_level)
-#elif defined(__i386__) || defined(__x86_64__)
-#define __INTRODUCED_IN_ARM(api_level)
-#define __INTRODUCED_IN_X86(api_level) __BIONIC_AVAILABILITY(introduced=api_level)
-#else
-#define __INTRODUCED_IN_ARM(api_level)
-#define __INTRODUCED_IN_X86(api_level)
-#endif
-
#define __VERSIONER_NO_GUARD
#define __VERSIONER_FORTIFY_INLINE
diff --git a/libc/include/arpa/inet.h b/libc/include/arpa/inet.h
index db054c9..f00f2c1 100644
--- a/libc/include/arpa/inet.h
+++ b/libc/include/arpa/inet.h
@@ -36,17 +36,17 @@
__BEGIN_DECLS
-in_addr_t inet_addr(const char* __s);
-int inet_aton(const char* __s, struct in_addr* __addr);
-in_addr_t inet_lnaof(struct in_addr __addr) __INTRODUCED_IN(21);
-struct in_addr inet_makeaddr(in_addr_t __net, in_addr_t __host) __INTRODUCED_IN(21);
-in_addr_t inet_netof(struct in_addr __addr) __INTRODUCED_IN(21);
-in_addr_t inet_network(const char* __s) __INTRODUCED_IN(21);
-char* inet_ntoa(struct in_addr __addr);
-const char* inet_ntop(int __af, const void* __src, char* __dst, socklen_t __size);
-unsigned int inet_nsap_addr(const char* __ascii, unsigned char* __binary, int __n);
-char* inet_nsap_ntoa(int __binary_length, const unsigned char* __binary, char* __ascii);
-int inet_pton(int __af, const char* __src, void* __dst);
+in_addr_t inet_addr(const char* _Nonnull __s);
+int inet_aton(const char* _Nonnull __s, struct in_addr* _Nullable __addr);
+in_addr_t inet_lnaof(struct in_addr __addr);
+struct in_addr inet_makeaddr(in_addr_t __net, in_addr_t __host);
+in_addr_t inet_netof(struct in_addr __addr);
+in_addr_t inet_network(const char* _Nonnull __s);
+char* _Nonnull inet_ntoa(struct in_addr __addr);
+const char* _Nullable inet_ntop(int __af, const void* _Nonnull __src, char* _Nonnull __dst, socklen_t __size);
+unsigned int inet_nsap_addr(const char* _Nonnull __ascii, unsigned char* _Nonnull __binary, int __n);
+char* _Nonnull inet_nsap_ntoa(int __binary_length, const unsigned char* _Nonnull __binary, char* _Nullable __ascii);
+int inet_pton(int __af, const char* _Nonnull __src, void* _Nonnull __dst);
__END_DECLS
diff --git a/libc/include/arpa/nameser.h b/libc/include/arpa/nameser.h
index 89ece1c..97109ee 100644
--- a/libc/include/arpa/nameser.h
+++ b/libc/include/arpa/nameser.h
@@ -113,6 +113,8 @@
typedef const u_char *ns_nname_ct;
typedef u_char *ns_nname_t;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnullability-completeness"
struct ns_namemap { ns_nname_ct base; int len; };
typedef struct ns_namemap *ns_namemap_t;
typedef const struct ns_namemap *ns_namemap_ct;
@@ -269,6 +271,8 @@
};
typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
+#pragma clang diagnostic pop
+
#define NS_TSIG_FUDGE 300
#define NS_TSIG_TCP_COUNT 100
#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
@@ -519,102 +523,53 @@
#if !defined(__LP64__)
/* Annoyingly, LP32 shipped with __ names. */
-#define ns_msg_getflag __ns_msg_getflag
-#define ns_get16 __ns_get16
-#define ns_get32 __ns_get32
-#define ns_put16 __ns_put16
-#define ns_put32 __ns_put32
-#define ns_initparse __ns_initparse
-#define ns_skiprr __ns_skiprr
-#define ns_parserr __ns_parserr
-#define ns_parserr2 __ns_parserr2
-#define ns_sprintrr __ns_sprintrr
-#define ns_sprintrrf __ns_sprintrrf
-#define ns_format_ttl __ns_format_ttl
-#define ns_parse_ttl __ns_parse_ttl
-#define ns_datetosecs __ns_datetosecs
-#define ns_name_ntol __ns_name_ntol
-#define ns_name_ntop __ns_name_ntop
-#define ns_name_pton __ns_name_pton
-#define ns_name_pton2 __ns_name_pton2
-#define ns_name_unpack __ns_name_unpack
-#define ns_name_unpack2 __ns_name_unpack2
-#define ns_name_pack __ns_name_pack
-#define ns_name_compress __ns_name_compress
-#define ns_name_uncompress __ns_name_uncompress
-#define ns_name_skip __ns_name_skip
-#define ns_name_rollback __ns_name_rollback
-#define ns_name_length __ns_name_length
-#define ns_name_eq __ns_name_eq
-#define ns_name_owned __ns_name_owned
-#define ns_name_map __ns_name_map
-#define ns_name_labels __ns_name_labels
-#define ns_sign __ns_sign
-#define ns_sign2 __ns_sign2
-#define ns_sign_tcp __ns_sign_tcp
-#define ns_sign_tcp2 __ns_sign_tcp2
-#define ns_sign_tcp_init __ns_sign_tcp_init
-#define ns_find_tsig __ns_find_tsig
-#define ns_verify __ns_verify
-#define ns_verify_tcp __ns_verify_tcp
-#define ns_verify_tcp_init __ns_verify_tcp_init
-#define ns_samedomain __ns_samedomain
-#define ns_subdomain __ns_subdomain
-#define ns_makecanon __ns_makecanon
-#define ns_samename __ns_samename
+#define ns_format_ttl __ns_format_ttl
+#define ns_get16 __ns_get16
+#define ns_get32 __ns_get32
+#define ns_initparse __ns_initparse
+#define ns_makecanon __ns_makecanon
+#define ns_msg_getflag __ns_msg_getflag
+#define ns_name_compress __ns_name_compress
+#define ns_name_ntol __ns_name_ntol
+#define ns_name_ntop __ns_name_ntop
+#define ns_name_pack __ns_name_pack
+#define ns_name_pton __ns_name_pton
+#define ns_name_rollback __ns_name_rollback
+#define ns_name_skip __ns_name_skip
+#define ns_name_uncompress __ns_name_uncompress
+#define ns_name_unpack __ns_name_unpack
+#define ns_parserr __ns_parserr
+#define ns_put16 __ns_put16
+#define ns_put32 __ns_put32
+#define ns_samename __ns_samename
+#define ns_skiprr __ns_skiprr
+#define ns_sprintrr __ns_sprintrr
+#define ns_sprintrrf __ns_sprintrrf
+#endif
-int ns_msg_getflag(ns_msg __handle, int __flag);
-uint16_t ns_get16(const u_char* __src);
-uint32_t ns_get32(const u_char* __src);
-void ns_put16(uint16_t __src, u_char* __dst);
-void ns_put32(uint32_t __src, u_char* __dst);
-int ns_initparse(const u_char* __msg, int __msg_size, ns_msg* __handle);
-int ns_skiprr(const u_char* __ptr, const u_char* __eom, ns_sect __section, int __count);
-int ns_parserr(ns_msg* __handle, ns_sect __section, int __rr_number, ns_rr* __rr);
-int ns_sprintrr(const ns_msg* __handle, const ns_rr* __rr, const char* __name_ctx, const char* __origin, char* __buf, size_t __buf_size);
-int ns_sprintrrf(const u_char* __msg, size_t __msg_size, const char* __name, ns_class __class, ns_type __type, u_long __ttl, const u_char* __rdata, size_t __rdata_size, const char* __name_ctx, const char* __origin, char* __buf, size_t __buf_size);
-int ns_format_ttl(u_long __ttl, char* __dst, size_t __dst_size);
-int ns_name_ntol(const u_char* __src, u_char* __dst, size_t __dst_size);
-int ns_name_ntop(const u_char* __src, char* __dst, size_t __dst_size);
-int ns_name_pton(const char* __src, u_char* __dst, size_t __dst_size);
-int ns_name_unpack(const u_char* __msg, const u_char* __eom, const u_char* __src, u_char* __dst, size_t __dst_size);
-int ns_name_pack(const u_char* __src, u_char* __dst, int __dst_size, const u_char** __dn_ptrs, const u_char** __last_dn_ptr);
-int ns_name_uncompress(const u_char* __msg, const u_char* __eom, const u_char* __src, char* __dst, size_t __dst_size);
-int ns_name_compress(const char* __src, u_char* __dst, size_t __dst_size, const u_char** __dn_ptrs, const u_char** __last_dn_ptr);
-int ns_name_skip(const u_char** __ptr_ptr, const u_char* __eom);
-void ns_name_rollback(const u_char* __src, const u_char** __dn_ptrs, const u_char** __last_dn_ptr);
+int ns_msg_getflag(ns_msg __handle, int __flag) __INTRODUCED_IN(22);
+uint16_t ns_get16(const u_char* _Nonnull __src) __INTRODUCED_IN(22);
+uint32_t ns_get32(const u_char* _Nonnull __src) __INTRODUCED_IN(22);
+void ns_put16(uint16_t __src, u_char* _Nonnull __dst) __INTRODUCED_IN(22);
+void ns_put32(uint32_t __src, u_char* _Nonnull __dst) __INTRODUCED_IN(22);
+int ns_initparse(const u_char* _Nonnull __msg, int __msg_size, ns_msg* _Nonnull __handle) __INTRODUCED_IN(22);
+int ns_skiprr(const u_char* _Nonnull __ptr, const u_char* _Nonnull __eom, ns_sect __section, int __count) __INTRODUCED_IN(22);
+int ns_parserr(ns_msg* _Nonnull __handle, ns_sect __section, int __rr_number, ns_rr* _Nonnull __rr) __INTRODUCED_IN(22);
+int ns_sprintrr(const ns_msg* _Nonnull __handle, const ns_rr* _Nonnull __rr, const char* _Nullable __name_ctx, const char* _Nullable __origin, char* _Nonnull __buf, size_t __buf_size) __INTRODUCED_IN(22);
+int ns_sprintrrf(const u_char* _Nonnull __msg, size_t __msg_size, const char* _Nonnull __name, ns_class __class, ns_type __type, u_long __ttl, const u_char* _Nonnull __rdata, size_t __rdata_size, const char* _Nullable __name_ctx, const char* _Nullable __origin, char* _Nonnull __buf, size_t __buf_size) __INTRODUCED_IN(22);
+int ns_format_ttl(u_long __ttl, char* _Nonnull __dst, size_t __dst_size) __INTRODUCED_IN(22);
+int ns_name_ntol(const u_char* _Nonnull __src, u_char* _Nonnull __dst, size_t __dst_size) __INTRODUCED_IN(22);
+int ns_name_ntop(const u_char* _Nonnull __src, char* _Nonnull __dst, size_t __dst_size) __INTRODUCED_IN(22);
+int ns_name_pton(const char* _Nonnull __src, u_char* _Nonnull __dst, size_t __dst_size) __INTRODUCED_IN(22);
+int ns_name_unpack(const u_char* _Nonnull __msg, const u_char* _Nonnull __eom, const u_char* _Nonnull __src, u_char* _Nonnull __dst, size_t __dst_size) __INTRODUCED_IN(22);
+int ns_name_pack(const u_char* _Nonnull __src, u_char* _Nonnull __dst, int __dst_size, const u_char* _Nullable * _Nullable __dn_ptrs, const u_char* _Nullable * _Nullable __last_dn_ptr) __INTRODUCED_IN(22);
+int ns_name_uncompress(const u_char* _Nonnull __msg, const u_char* _Nonnull __eom, const u_char* _Nonnull __src, char* _Nonnull __dst, size_t __dst_size) __INTRODUCED_IN(22);
+int ns_name_compress(const char* _Nonnull __src, u_char* _Nonnull __dst, size_t __dst_size, const u_char* _Nullable * _Nullable __dn_ptrs, const u_char* _Nullable * _Nullable __last_dn_ptr) __INTRODUCED_IN(22);
+int ns_name_skip(const u_char* _Nullable * _Nonnull __ptr_ptr, const u_char* _Nonnull __eom) __INTRODUCED_IN(22);
+void ns_name_rollback(const u_char* _Nonnull __src, const u_char* _Nullable * _Nonnull __dn_ptrs, const u_char* _Nullable * _Nonnull __last_dn_ptr) __INTRODUCED_IN(22);
-int ns_makecanon(const char* __src, char* __dst, size_t __dst_size);
-int ns_samename(const char* __lhs, const char* __rhs);
-
-#else
-/* The names of these symbols were accidentally prefixed with __ in L. */
-/* The duplication here is intentional to avoid declaring different symbols with the same
- * declaration. */
-int ns_msg_getflag(ns_msg __handle, int __flag) __INTRODUCED_IN_64(22);
-uint16_t ns_get16(const u_char* __src) __INTRODUCED_IN_64(22);
-uint32_t ns_get32(const u_char* __src) __INTRODUCED_IN_64(22);
-void ns_put16(uint16_t __src, u_char* __dst) __INTRODUCED_IN_64(22);
-void ns_put32(uint32_t __src, u_char* __dst) __INTRODUCED_IN_64(22);
-int ns_initparse(const u_char* __msg, int __msg_size, ns_msg* __handle) __INTRODUCED_IN_64(22);
-int ns_skiprr(const u_char* __ptr, const u_char* __eom, ns_sect __section, int __count) __INTRODUCED_IN_64(22);
-int ns_parserr(ns_msg* __handle, ns_sect __section, int __rr_number, ns_rr* __rr) __INTRODUCED_IN_64(22);
-int ns_sprintrr(const ns_msg* __handle, const ns_rr* __rr, const char* __name_ctx, const char* __origin, char* __buf, size_t __buf_size) __INTRODUCED_IN_64(22);
-int ns_sprintrrf(const u_char* __msg, size_t __msg_size, const char* __name, ns_class __class, ns_type __type, u_long __ttl, const u_char* __rdata, size_t __rdata_size, const char* __name_ctx, const char* __origin, char* __buf, size_t __buf_size) __INTRODUCED_IN_64(22);
-int ns_format_ttl(u_long __ttl, char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
-int ns_name_ntol(const u_char* __src, u_char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
-int ns_name_ntop(const u_char* __src, char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
-int ns_name_pton(const char* __src, u_char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
-int ns_name_unpack(const u_char* __msg, const u_char* __eom, const u_char* __src, u_char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
-int ns_name_pack(const u_char* __src, u_char* __dst, int __dst_size, const u_char** __dn_ptrs, const u_char** __last_dn_ptr) __INTRODUCED_IN_64(22);
-int ns_name_uncompress(const u_char* __msg, const u_char* __eom, const u_char* __src, char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
-int ns_name_compress(const char* __src, u_char* __dst, size_t __dst_size, const u_char** __dn_ptrs, const u_char** __last_dn_ptr) __INTRODUCED_IN_64(22);
-int ns_name_skip(const u_char** __ptr_ptr, const u_char* __eom) __INTRODUCED_IN_64(22);
-void ns_name_rollback(const u_char* __src, const u_char** __dn_ptrs, const u_char** __last_dn_ptr) __INTRODUCED_IN_64(22);
-
-int ns_makecanon(const char* __src, char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
-int ns_samename(const char* __lhs, const char* __rhs) __INTRODUCED_IN_64(22);
-#endif /* !defined(__LP64__) */
+int ns_makecanon(const char* _Nonnull __src, char* _Nonnull __dst, size_t __dst_size) __INTRODUCED_IN(22);
+int ns_samename(const char* _Nonnull __lhs, const char* _Nonnull __rhs) __INTRODUCED_IN(22);
__END_DECLS
diff --git a/libc/include/assert.h b/libc/include/assert.h
index 8db970b..750d12e 100644
--- a/libc/include/assert.h
+++ b/libc/include/assert.h
@@ -64,7 +64,8 @@
# endif
#endif
-#if !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
+/* `static_assert` is a keyword in C++11 and C23; C11 had `_Static_assert` instead. */
+#if !defined(__cplusplus) && (__STDC_VERSION__ >= 201112L && __STDC_VERSION__ < 202311L)
# undef static_assert
# define static_assert _Static_assert
#endif
diff --git a/libc/include/bits/bionic_multibyte_result.h b/libc/include/bits/bionic_multibyte_result.h
new file mode 100644
index 0000000..0d5cf21
--- /dev/null
+++ b/libc/include/bits/bionic_multibyte_result.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+/**
+ * @file bits/bionic_multibyte_result.h
+ * @brief Named values for the magic number return values of multibyte
+ * conversion APIs defined by C.
+ */
+
+#include <stddef.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/**
+ * @brief The error values defined by C for multibyte conversion APIs.
+ *
+ * Refer to C23 7.30.1 Restartable multibyte/wide character conversion functions
+ * for more details.
+ */
+enum : size_t {
+ /// @brief An encoding error occurred. The bytes read are not a valid unicode
+ /// character, nor are they a partially valid character.
+ BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE = -1UL,
+#define BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE
+
+ /// @brief The bytes read may produce a valid unicode character, but the
+ /// sequence is incomplete. Future calls may complete the character.
+ BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE = -2UL,
+#define BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE
+
+ /// @brief The output of the call was the result of a previous successful
+ /// decoding. No new bytes were consumed.
+ ///
+ /// The common case for this return value is when mbrtoc16 returns the low
+ /// surrogate of a pair.
+ BIONIC_MULTIBYTE_RESULT_NO_BYTES_CONSUMED = -3UL,
+#define BIONIC_MULTIBYTE_RESULT_NO_BYTES_CONSUMED BIONIC_MULTIBYTE_RESULT_NO_BYTES_CONSUMED
+};
+
+__END_DECLS
diff --git a/libc/include/bits/elf_common.h b/libc/include/bits/elf_common.h
index b3c57a2..0856f45 100644
--- a/libc/include/bits/elf_common.h
+++ b/libc/include/bits/elf_common.h
@@ -1248,6 +1248,7 @@
/*
* RISC-V relocation types.
+ * https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#relocations
*/
/* Relocation types used by the dynamic linker. */
@@ -1263,6 +1264,7 @@
#define R_RISCV_TLS_DTPREL64 9
#define R_RISCV_TLS_TPREL32 10
#define R_RISCV_TLS_TPREL64 11
+#define R_RISCV_TLSDESC 12
/* Relocation types not used by the dynamic linker. */
#define R_RISCV_BRANCH 16
@@ -1304,6 +1306,13 @@
#define R_RISCV_SET32 56
#define R_RISCV_32_PCREL 57
#define R_RISCV_IRELATIVE 58
+#define R_RISCV_PLT32 59
+#define R_RISCV_SET_ULEB128 60
+#define R_RISCV_SUB_ULEB128 61
+#define R_RISCV_TLSDESC_HI20 62
+#define R_RISCV_TLSDESC_LOAD_LO12 63
+#define R_RISCV_TLSDESC_ADD_LO12 64
+#define R_RISCV_TLSDESC_CALL 65
#define R_SPARC_NONE 0
#define R_SPARC_8 1
diff --git a/libc/include/bits/fortify/fcntl.h b/libc/include/bits/fortify/fcntl.h
index 1f6ebad..05c62eb 100644
--- a/libc/include/bits/fortify/fcntl.h
+++ b/libc/include/bits/fortify/fcntl.h
@@ -30,13 +30,13 @@
#error "Never include this file directly; instead, include <fcntl.h>"
#endif
-int __open_2(const char*, int) __INTRODUCED_IN(17);
-int __openat_2(int, const char*, int) __INTRODUCED_IN(17);
+int __open_2(const char* _Nonnull, int);
+int __openat_2(int, const char* _Nonnull, int);
/*
* These are the easiest way to call the real open even in clang FORTIFY.
*/
-int __open_real(const char*, int, ...) __RENAME(open);
-int __openat_real(int, const char*, int, ...) __RENAME(openat);
+int __open_real(const char* _Nonnull, int, ...) __RENAME(open);
+int __openat_real(int, const char* _Nonnull, int, ...) __RENAME(openat);
#if defined(__BIONIC_FORTIFY)
#define __open_too_many_args_error "too many arguments"
@@ -46,7 +46,7 @@
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
__BIONIC_ERROR_FUNCTION_VISIBILITY
-int open(const char* pathname, int flags, mode_t modes, ...) __overloadable
+int open(const char* _Nonnull pathname, int flags, mode_t modes, ...) __overloadable
__errorattr(__open_too_many_args_error);
/*
@@ -56,7 +56,7 @@
* open(const char *, int, ...).
*/
__BIONIC_FORTIFY_INLINE
-int open(const char* const __pass_object_size pathname, int flags)
+int open(const char* _Nonnull const __pass_object_size pathname, int flags)
__overloadable
__clang_error_if(__open_modes_useful(flags), "'open' " __open_too_few_args_error) {
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
@@ -67,7 +67,7 @@
}
__BIONIC_FORTIFY_INLINE
-int open(const char* const __pass_object_size pathname, int flags, mode_t modes)
+int open(const char* _Nonnull const __pass_object_size pathname, int flags, mode_t modes)
__overloadable
__clang_warning_if(!__open_modes_useful(flags) && modes,
"'open' " __open_useless_modes_warning) {
@@ -75,12 +75,12 @@
}
__BIONIC_ERROR_FUNCTION_VISIBILITY
-int openat(int dirfd, const char* pathname, int flags, mode_t modes, ...)
+int openat(int dirfd, const char* _Nonnull pathname, int flags, mode_t modes, ...)
__overloadable
__errorattr(__open_too_many_args_error);
__BIONIC_FORTIFY_INLINE
-int openat(int dirfd, const char* const __pass_object_size pathname, int flags)
+int openat(int dirfd, const char* _Nonnull const __pass_object_size pathname, int flags)
__overloadable
__clang_error_if(__open_modes_useful(flags), "'openat' " __open_too_few_args_error) {
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
@@ -91,7 +91,7 @@
}
__BIONIC_FORTIFY_INLINE
-int openat(int dirfd, const char* const __pass_object_size pathname, int flags, mode_t modes)
+int openat(int dirfd, const char* _Nonnull const __pass_object_size pathname, int flags, mode_t modes)
__overloadable
__clang_warning_if(!__open_modes_useful(flags) && modes,
"'openat' " __open_useless_modes_warning) {
@@ -101,18 +101,18 @@
/* Note that open == open64, so we reuse those bits in the open64 variants below. */
__BIONIC_ERROR_FUNCTION_VISIBILITY
-int open64(const char* pathname, int flags, mode_t modes, ...) __overloadable
+int open64(const char* _Nonnull pathname, int flags, mode_t modes, ...) __overloadable
__errorattr(__open_too_many_args_error);
__BIONIC_FORTIFY_INLINE
-int open64(const char* const __pass_object_size pathname, int flags)
+int open64(const char* _Nonnull const __pass_object_size pathname, int flags)
__overloadable
__clang_error_if(__open_modes_useful(flags), "'open64' " __open_too_few_args_error) {
return open(pathname, flags);
}
__BIONIC_FORTIFY_INLINE
-int open64(const char* const __pass_object_size pathname, int flags, mode_t modes)
+int open64(const char* _Nonnull const __pass_object_size pathname, int flags, mode_t modes)
__overloadable
__clang_warning_if(!__open_modes_useful(flags) && modes,
"'open64' " __open_useless_modes_warning) {
@@ -120,19 +120,19 @@
}
__BIONIC_ERROR_FUNCTION_VISIBILITY
-int openat64(int dirfd, const char* pathname, int flags, mode_t modes, ...)
+int openat64(int dirfd, const char* _Nonnull pathname, int flags, mode_t modes, ...)
__overloadable
__errorattr(__open_too_many_args_error);
__BIONIC_FORTIFY_INLINE
-int openat64(int dirfd, const char* const __pass_object_size pathname, int flags)
+int openat64(int dirfd, const char* _Nonnull const __pass_object_size pathname, int flags)
__overloadable
__clang_error_if(__open_modes_useful(flags), "'openat64' " __open_too_few_args_error) {
return openat(dirfd, pathname, flags);
}
__BIONIC_FORTIFY_INLINE
-int openat64(int dirfd, const char* const __pass_object_size pathname, int flags, mode_t modes)
+int openat64(int dirfd, const char* _Nonnull const __pass_object_size pathname, int flags, mode_t modes)
__overloadable
__clang_warning_if(!__open_modes_useful(flags) && modes,
"'openat64' " __open_useless_modes_warning) {
diff --git a/libc/include/bits/fortify/poll.h b/libc/include/bits/fortify/poll.h
index 0b5cd4b..f2e27d7 100644
--- a/libc/include/bits/fortify/poll.h
+++ b/libc/include/bits/fortify/poll.h
@@ -30,9 +30,9 @@
#error "Never include this file directly; instead, include <poll.h>"
#endif
-int __poll_chk(struct pollfd*, nfds_t, int, size_t) __INTRODUCED_IN(23);
-int __ppoll_chk(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*, size_t) __INTRODUCED_IN(23);
-int __ppoll64_chk(struct pollfd*, nfds_t, const struct timespec*, const sigset64_t*, size_t) __INTRODUCED_IN(28);
+int __poll_chk(struct pollfd* _Nullable, nfds_t, int, size_t) __INTRODUCED_IN(23);
+int __ppoll_chk(struct pollfd* _Nullable, nfds_t, const struct timespec* _Nullable, const sigset_t* _Nullable, size_t) __INTRODUCED_IN(23);
+int __ppoll64_chk(struct pollfd* _Nullable, nfds_t, const struct timespec* _Nullable, const sigset64_t* _Nullable, size_t) __INTRODUCED_IN(28);
#if defined(__BIONIC_FORTIFY)
#define __bos_fd_count_trivially_safe(bos_val, fds, fd_count) \
@@ -40,7 +40,7 @@
(fd_count) <= __BIONIC_CAST(static_cast, nfds_t, -1) / sizeof(*fds))
__BIONIC_FORTIFY_INLINE
-int poll(struct pollfd* const fds __pass_object_size, nfds_t fd_count, int timeout)
+int poll(struct pollfd* _Nullable const fds __pass_object_size, nfds_t fd_count, int timeout)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count),
"in call to 'poll', fd_count is larger than the given buffer") {
@@ -55,7 +55,7 @@
}
__BIONIC_FORTIFY_INLINE
-int ppoll(struct pollfd* const fds __pass_object_size, nfds_t fd_count, const struct timespec* timeout, const sigset_t* mask)
+int ppoll(struct pollfd* _Nullable const fds __pass_object_size, nfds_t fd_count, const struct timespec* _Nullable timeout, const sigset_t* _Nullable mask)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count),
"in call to 'ppoll', fd_count is larger than the given buffer") {
@@ -71,7 +71,7 @@
#if __ANDROID_API__ >= 28
__BIONIC_FORTIFY_INLINE
-int ppoll64(struct pollfd* const fds __pass_object_size, nfds_t fd_count, const struct timespec* timeout, const sigset64_t* mask)
+int ppoll64(struct pollfd* _Nullable const fds __pass_object_size, nfds_t fd_count, const struct timespec* _Nullable timeout, const sigset64_t* _Nullable mask)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count),
"in call to 'ppoll64', fd_count is larger than the given buffer") {
diff --git a/libc/include/bits/fortify/socket.h b/libc/include/bits/fortify/socket.h
index 9e7df6d..02f94cc 100644
--- a/libc/include/bits/fortify/socket.h
+++ b/libc/include/bits/fortify/socket.h
@@ -30,15 +30,14 @@
#error "Never include this file directly; instead, include <sys/socket.h>"
#endif
-extern ssize_t __sendto_chk(int, const void*, size_t, size_t, int, const struct sockaddr*,
+extern ssize_t __sendto_chk(int, const void* _Nonnull, size_t, size_t, int, const struct sockaddr* _Nullable,
socklen_t) __INTRODUCED_IN(26);
-ssize_t __recvfrom_chk(int, void*, size_t, size_t, int, struct sockaddr*,
- socklen_t*) __INTRODUCED_IN(21);
+ssize_t __recvfrom_chk(int, void* _Nullable, size_t, size_t, int, struct sockaddr* _Nullable, socklen_t* _Nullable);
#if defined(__BIONIC_FORTIFY)
__BIONIC_FORTIFY_INLINE
-ssize_t recvfrom(int fd, void* const buf __pass_object_size0, size_t len, int flags, struct sockaddr* src_addr, socklen_t* addr_len)
+ssize_t recvfrom(int fd, void* _Nullable const buf __pass_object_size0, size_t len, int flags, struct sockaddr* _Nullable src_addr, socklen_t* _Nullable addr_len)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
"'recvfrom' called with size bigger than buffer") {
@@ -53,7 +52,7 @@
}
__BIONIC_FORTIFY_INLINE
-ssize_t sendto(int fd, const void* const buf __pass_object_size0, size_t len, int flags, const struct sockaddr* dest_addr, socklen_t addr_len)
+ssize_t sendto(int fd, const void* _Nonnull const buf __pass_object_size0, size_t len, int flags, const struct sockaddr* _Nullable dest_addr, socklen_t addr_len)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
"'sendto' called with size bigger than buffer") {
@@ -68,7 +67,7 @@
}
__BIONIC_FORTIFY_INLINE
-ssize_t recv(int socket, void* const buf __pass_object_size0, size_t len, int flags)
+ssize_t recv(int socket, void* _Nullable const buf __pass_object_size0, size_t len, int flags)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
"'recv' called with size bigger than buffer") {
@@ -76,7 +75,7 @@
}
__BIONIC_FORTIFY_INLINE
-ssize_t send(int socket, const void* const buf __pass_object_size0, size_t len, int flags)
+ssize_t send(int socket, const void* _Nonnull const buf __pass_object_size0, size_t len, int flags)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
"'send' called with size bigger than buffer") {
diff --git a/libc/include/bits/fortify/stat.h b/libc/include/bits/fortify/stat.h
index 9b4ade2..378072c 100644
--- a/libc/include/bits/fortify/stat.h
+++ b/libc/include/bits/fortify/stat.h
@@ -28,7 +28,7 @@
#pragma once
-mode_t __umask_chk(mode_t) __INTRODUCED_IN(18);
+mode_t __umask_chk(mode_t);
mode_t __umask_real(mode_t mode) __RENAME(umask);
#if defined(__BIONIC_FORTIFY)
diff --git a/libc/include/bits/fortify/stdio.h b/libc/include/bits/fortify/stdio.h
index 95db017..e4607e0 100644
--- a/libc/include/bits/fortify/stdio.h
+++ b/libc/include/bits/fortify/stdio.h
@@ -30,29 +30,29 @@
#error "Never include this file directly; instead, include <stdio.h>"
#endif
-char* __fgets_chk(char*, int, FILE*, size_t) __INTRODUCED_IN(17);
-size_t __fread_chk(void*, size_t, size_t, FILE*, size_t) __INTRODUCED_IN(24);
-size_t __fwrite_chk(const void*, size_t, size_t, FILE*, size_t) __INTRODUCED_IN(24);
+char* _Nullable __fgets_chk(char* _Nonnull, int, FILE* _Nonnull, size_t);
+size_t __fread_chk(void* _Nonnull, size_t, size_t, FILE* _Nonnull, size_t) __INTRODUCED_IN(24);
+size_t __fwrite_chk(const void* _Nonnull, size_t, size_t, FILE* _Nonnull, size_t) __INTRODUCED_IN(24);
#if defined(__BIONIC_FORTIFY) && !defined(__BIONIC_NO_STDIO_FORTIFY)
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
/* No diag -- clang diagnoses misuses of this on its own. */
__BIONIC_FORTIFY_INLINE __printflike(3, 0)
-int vsnprintf(char* const __pass_object_size dest, size_t size, const char* format, va_list ap)
+int vsnprintf(char* const __BIONIC_COMPLICATED_NULLNESS __pass_object_size dest, size_t size, const char* _Nonnull format, va_list ap)
__diagnose_as_builtin(__builtin_vsnprintf, 1, 2, 3, 4)
__overloadable {
return __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, ap);
}
__BIONIC_FORTIFY_INLINE __printflike(2, 0)
-int vsprintf(char* const __pass_object_size dest, const char* format, va_list ap) __overloadable {
+int vsprintf(char* const __BIONIC_COMPLICATED_NULLNESS __pass_object_size dest, const char* _Nonnull format, va_list ap) __overloadable {
return __builtin___vsprintf_chk(dest, 0, __bos(dest), format, ap);
}
#endif
__BIONIC_ERROR_FUNCTION_VISIBILITY
-int sprintf(char* dest, const char* format)
+int sprintf(char* __BIONIC_COMPLICATED_NULLNESS dest, const char* _Nonnull format)
__overloadable
__enable_if(__bos_unevaluated_lt(__bos(dest), __builtin_strlen(format)),
"format string will always overflow destination buffer")
@@ -60,7 +60,7 @@
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
__BIONIC_FORTIFY_VARIADIC __printflike(2, 3)
-int sprintf(char* const __pass_object_size dest, const char* format, ...) __overloadable {
+int sprintf(char* const __BIONIC_COMPLICATED_NULLNESS __pass_object_size dest, const char* _Nonnull format, ...) __overloadable {
va_list va;
va_start(va, format);
int result = __builtin___vsprintf_chk(dest, 0, __bos(dest), format, va);
@@ -70,7 +70,7 @@
/* No diag -- clang diagnoses misuses of this on its own. */
__BIONIC_FORTIFY_VARIADIC __printflike(3, 4)
-int snprintf(char* const __pass_object_size dest, size_t size, const char* format, ...)
+int snprintf(char* const __BIONIC_COMPLICATED_NULLNESS __pass_object_size dest, size_t size, const char* _Nonnull format, ...)
__diagnose_as_builtin(__builtin_snprintf, 1, 2, 3)
__overloadable {
va_list va;
@@ -86,7 +86,7 @@
!__unsafe_check_mul_overflow(size, count))
__BIONIC_FORTIFY_INLINE
-size_t fread(void* const __pass_object_size0 buf, size_t size, size_t count, FILE* stream)
+size_t fread(void* const _Nonnull __pass_object_size0 buf, size_t size, size_t count, FILE* _Nonnull stream)
__overloadable
__clang_error_if(__unsafe_check_mul_overflow(size, count),
"in call to 'fread', size * count overflows")
@@ -103,7 +103,7 @@
}
__BIONIC_FORTIFY_INLINE
-size_t fwrite(const void* const __pass_object_size0 buf, size_t size, size_t count, FILE* stream)
+size_t fwrite(const void* const _Nonnull __pass_object_size0 buf, size_t size, size_t count, FILE* _Nonnull stream)
__overloadable
__clang_error_if(__unsafe_check_mul_overflow(size, count),
"in call to 'fwrite', size * count overflows")
@@ -121,7 +121,7 @@
#undef __bos_trivially_ge_mul
__BIONIC_FORTIFY_INLINE
-char* fgets(char* const __pass_object_size dest, int size, FILE* stream)
+char* _Nullable fgets(char* const _Nonnull __pass_object_size dest, int size, FILE* _Nonnull stream)
__overloadable
__clang_error_if(size < 0, "in call to 'fgets', size should not be negative")
__clang_error_if(__bos_unevaluated_lt(__bos(dest), size),
diff --git a/libc/include/bits/fortify/stdlib.h b/libc/include/bits/fortify/stdlib.h
index 623be58..b84dae4 100644
--- a/libc/include/bits/fortify/stdlib.h
+++ b/libc/include/bits/fortify/stdlib.h
@@ -35,7 +35,7 @@
/* PATH_MAX is unavailable without polluting the namespace, but it's always 4096 on Linux */
#define __PATH_MAX 4096
-char* realpath(const char* path, char* resolved)
+char* _Nullable realpath(const char* _Nonnull path, char* _Nullable resolved)
__clang_error_if(!path, "'realpath': NULL path is never correct; flipped arguments?")
__clang_error_if(__bos_unevaluated_lt(__bos(resolved), __PATH_MAX),
"'realpath' output parameter must be NULL or a pointer to a buffer "
diff --git a/libc/include/bits/fortify/string.h b/libc/include/bits/fortify/string.h
index f668b9f..7df0b05 100644
--- a/libc/include/bits/fortify/string.h
+++ b/libc/include/bits/fortify/string.h
@@ -30,20 +30,20 @@
#error "Never include this file directly; instead, include <string.h>"
#endif
-void* __memchr_chk(const void*, int, size_t, size_t) __INTRODUCED_IN(23);
-void* __memrchr_chk(const void*, int, size_t, size_t) __INTRODUCED_IN(23);
-char* __stpncpy_chk2(char*, const char*, size_t, size_t, size_t) __INTRODUCED_IN(21);
-char* __strncpy_chk2(char*, const char*, size_t, size_t, size_t) __INTRODUCED_IN(21);
-size_t __strlcpy_chk(char*, const char*, size_t, size_t) __INTRODUCED_IN(17);
-size_t __strlcat_chk(char*, const char*, size_t, size_t) __INTRODUCED_IN(17);
+void* _Nullable __memchr_chk(const void* _Nonnull, int, size_t, size_t) __INTRODUCED_IN(23);
+void* _Nullable __memrchr_chk(const void* _Nonnull, int, size_t, size_t) __INTRODUCED_IN(23);
+char* _Nonnull __stpncpy_chk2(char* _Nonnull, const char* _Nonnull, size_t, size_t, size_t);
+char* _Nonnull __strncpy_chk2(char* _Nonnull, const char* _Nonnull, size_t, size_t, size_t);
+size_t __strlcpy_chk(char* _Nonnull, const char* _Nonnull, size_t, size_t);
+size_t __strlcat_chk(char* _Nonnull, const char* _Nonnull, size_t, size_t);
#if defined(__BIONIC_FORTIFY)
-extern void* __memrchr_real(const void*, int, size_t) __RENAME(memrchr);
+extern void* _Nullable __memrchr_real(const void* _Nonnull, int, size_t) __RENAME(memrchr);
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
/* No diag -- clang diagnoses misuses of this on its own. */
__BIONIC_FORTIFY_INLINE
-void* memcpy(void* const dst __pass_object_size0, const void* src, size_t copy_amount)
+void* _Nonnull memcpy(void* _Nonnull const dst __pass_object_size0, const void* _Nonnull src, size_t copy_amount)
__diagnose_as_builtin(__builtin_memcpy, 1, 2, 3)
__overloadable {
return __builtin___memcpy_chk(dst, src, copy_amount, __bos0(dst));
@@ -51,7 +51,7 @@
/* No diag -- clang diagnoses misuses of this on its own. */
__BIONIC_FORTIFY_INLINE
-void* memmove(void* const dst __pass_object_size0, const void* src, size_t len)
+void* _Nonnull memmove(void* _Nonnull const dst __pass_object_size0, const void* _Nonnull src, size_t len)
__diagnose_as_builtin(__builtin_memmove, 1, 2, 3)
__overloadable {
return __builtin___memmove_chk(dst, src, len, __bos0(dst));
@@ -61,7 +61,7 @@
#if defined(__USE_GNU)
#if __ANDROID_API__ >= 30
__BIONIC_FORTIFY_INLINE
-void* mempcpy(void* const dst __pass_object_size0, const void* src, size_t copy_amount)
+void* _Nonnull mempcpy(void* _Nonnull const dst __pass_object_size0, const void* _Nonnull src, size_t copy_amount)
__diagnose_as_builtin(__builtin_mempcpy, 1, 2, 3)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(dst), copy_amount),
@@ -78,7 +78,7 @@
#endif /* __USE_GNU */
__BIONIC_FORTIFY_INLINE
-char* stpcpy(char* const dst __pass_object_size, const char* src)
+char* _Nonnull stpcpy(char* _Nonnull const dst __pass_object_size, const char* _Nonnull src)
__overloadable
__clang_error_if(__bos_unevaluated_le(__bos(dst), __builtin_strlen(src)),
"'stpcpy' called with string bigger than buffer") {
@@ -90,7 +90,7 @@
}
__BIONIC_FORTIFY_INLINE
-char* strcpy(char* const dst __pass_object_size, const char* src)
+char* _Nonnull strcpy(char* _Nonnull const dst __pass_object_size, const char* _Nonnull src)
__diagnose_as_builtin(__builtin_strcpy, 1, 2)
__overloadable
__clang_error_if(__bos_unevaluated_le(__bos(dst), __builtin_strlen(src)),
@@ -103,7 +103,7 @@
}
__BIONIC_FORTIFY_INLINE
-char* strcat(char* const dst __pass_object_size, const char* src)
+char* _Nonnull strcat(char* _Nonnull const dst __pass_object_size, const char* _Nonnull src)
__overloadable
__clang_error_if(__bos_unevaluated_le(__bos(dst), __builtin_strlen(src)),
"'strcat' called with string bigger than buffer") {
@@ -117,7 +117,7 @@
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
/* No diag -- clang diagnoses misuses of this on its own. */
__BIONIC_FORTIFY_INLINE
-char* strncat(char* const dst __pass_object_size, const char* src, size_t n)
+char* _Nonnull strncat(char* _Nonnull const dst __pass_object_size, const char* _Nonnull src, size_t n)
__diagnose_as_builtin(__builtin_strncat, 1, 2, 3)
__overloadable {
return __builtin___strncat_chk(dst, src, n, __bos(dst));
@@ -126,7 +126,7 @@
/* No diag -- clang diagnoses misuses of this on its own. */
__BIONIC_FORTIFY_INLINE
-void* memset(void* const s __pass_object_size0, int c, size_t n) __overloadable
+void* _Nonnull memset(void* _Nonnull const s __pass_object_size0, int c, size_t n) __overloadable
__diagnose_as_builtin(__builtin_memset, 1, 2, 3)
/* If you're a user who wants this warning to go away: use `(&memset)(foo, bar, baz)`. */
__clang_warning_if(c && !n, "'memset' will set 0 bytes; maybe the arguments got flipped?") {
@@ -139,7 +139,7 @@
#if __ANDROID_API__ >= 23 && __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
__BIONIC_FORTIFY_INLINE
-void* memchr(const void* const s __pass_object_size, int c, size_t n) __overloadable {
+void* _Nullable memchr(const void* _Nonnull const s __pass_object_size, int c, size_t n) __overloadable {
size_t bos = __bos(s);
if (__bos_trivially_ge(bos, n)) {
@@ -150,7 +150,7 @@
}
__BIONIC_FORTIFY_INLINE
-void* __memrchr_fortify(const void* const __pass_object_size s, int c, size_t n) __overloadable {
+void* _Nullable __memrchr_fortify(const void* _Nonnull const __pass_object_size s, int c, size_t n) __overloadable {
size_t bos = __bos(s);
if (__bos_trivially_ge(bos, n)) {
@@ -164,7 +164,7 @@
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
/* No diag -- clang diagnoses misuses of this on its own. */
__BIONIC_FORTIFY_INLINE
-char* stpncpy(char* const dst __pass_object_size, const char* const src __pass_object_size, size_t n)
+char* _Nonnull stpncpy(char* _Nonnull const dst __pass_object_size, const char* _Nonnull const src __pass_object_size, size_t n)
__diagnose_as_builtin(__builtin_stpncpy, 1, 2, 3)
__overloadable {
size_t bos_dst = __bos(dst);
@@ -180,7 +180,7 @@
/* No diag -- clang diagnoses misuses of this on its own. */
__BIONIC_FORTIFY_INLINE
-char* strncpy(char* const dst __pass_object_size, const char* const src __pass_object_size, size_t n)
+char* _Nonnull strncpy(char* _Nonnull const dst __pass_object_size, const char* _Nonnull const src __pass_object_size, size_t n)
__diagnose_as_builtin(__builtin_strncpy, 1, 2, 3)
__overloadable {
size_t bos_dst = __bos(dst);
@@ -196,7 +196,7 @@
#endif
__BIONIC_FORTIFY_INLINE
-size_t strlcpy(char* const dst __pass_object_size, const char* src, size_t size)
+size_t strlcpy(char* _Nonnull const dst __pass_object_size, const char* _Nonnull src, size_t size)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos(dst), size),
"'strlcpy' called with size bigger than buffer") {
@@ -208,7 +208,7 @@
}
__BIONIC_FORTIFY_INLINE
-size_t strlcat(char* const dst __pass_object_size, const char* src, size_t size)
+size_t strlcat(char* _Nonnull const dst __pass_object_size, const char* _Nonnull src, size_t size)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos(dst), size),
"'strlcat' called with size bigger than buffer") {
@@ -221,13 +221,13 @@
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
__BIONIC_FORTIFY_INLINE
-size_t strlen(const char* const s __pass_object_size0) __overloadable {
+size_t strlen(const char* _Nonnull const s __pass_object_size0) __overloadable {
return __strlen_chk(s, __bos0(s));
}
#endif
__BIONIC_FORTIFY_INLINE
-char* strchr(const char* const s __pass_object_size, int c) __overloadable {
+char* _Nullable strchr(const char* _Nonnull const s __pass_object_size, int c) __overloadable {
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
size_t bos = __bos(s);
@@ -239,7 +239,7 @@
}
__BIONIC_FORTIFY_INLINE
-char* strrchr(const char* const s __pass_object_size, int c) __overloadable {
+char* _Nullable strrchr(const char* _Nonnull const s __pass_object_size, int c) __overloadable {
#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
size_t bos = __bos(s);
@@ -254,18 +254,18 @@
#if defined(__cplusplus)
extern "C++" {
__BIONIC_FORTIFY_INLINE
-void* memrchr(void* const __pass_object_size s, int c, size_t n) {
+void* _Nullable memrchr(void* _Nonnull const __pass_object_size s, int c, size_t n) {
return __memrchr_fortify(s, c, n);
}
__BIONIC_FORTIFY_INLINE
-const void* memrchr(const void* const __pass_object_size s, int c, size_t n) {
+const void* _Nullable memrchr(const void* _Nonnull const __pass_object_size s, int c, size_t n) {
return __memrchr_fortify(s, c, n);
}
}
#else
__BIONIC_FORTIFY_INLINE
-void* memrchr(const void* const __pass_object_size s, int c, size_t n) __overloadable {
+void* _Nullable memrchr(const void* _Nonnull const __pass_object_size s, int c, size_t n) __overloadable {
return __memrchr_fortify(s, c, n);
}
#endif
diff --git a/libc/include/bits/fortify/strings.h b/libc/include/bits/fortify/strings.h
index 5515ef9..a36f02c 100644
--- a/libc/include/bits/fortify/strings.h
+++ b/libc/include/bits/fortify/strings.h
@@ -29,7 +29,7 @@
#if defined(__BIONIC_FORTIFY)
__BIONIC_FORTIFY_INLINE
-void __bionic_bcopy(const void *src, void* const dst __pass_object_size0, size_t len)
+void __bionic_bcopy(const void * _Nonnull src, void* _Nonnull const dst __pass_object_size0, size_t len)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(dst), len),
"'bcopy' called with size bigger than buffer") {
@@ -44,7 +44,7 @@
}
__BIONIC_FORTIFY_INLINE
-void __bionic_bzero(void* const b __pass_object_size0, size_t len)
+void __bionic_bzero(void* _Nonnull const b __pass_object_size0, size_t len)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(b), len),
"'bzero' called with size bigger than buffer") {
diff --git a/libc/include/bits/fortify/unistd.h b/libc/include/bits/fortify/unistd.h
index 335d0b5..7eda1a6 100644
--- a/libc/include/bits/fortify/unistd.h
+++ b/libc/include/bits/fortify/unistd.h
@@ -29,24 +29,24 @@
#error "Never include this file directly; instead, include <unistd.h>"
#endif
-char* __getcwd_chk(char*, size_t, size_t) __INTRODUCED_IN(24);
+char* _Nullable __getcwd_chk(char* _Nullable, size_t, size_t) __INTRODUCED_IN(24);
-ssize_t __pread_chk(int, void*, size_t, off_t, size_t) __INTRODUCED_IN(23);
-ssize_t __pread_real(int, void*, size_t, off_t) __RENAME(pread);
+ssize_t __pread_chk(int, void* _Nonnull, size_t, off_t, size_t) __INTRODUCED_IN(23);
+ssize_t __pread_real(int, void* _Nonnull, size_t, off_t) __RENAME(pread);
-ssize_t __pread64_chk(int, void*, size_t, off64_t, size_t) __INTRODUCED_IN(23);
-ssize_t __pread64_real(int, void*, size_t, off64_t) __RENAME(pread64);
+ssize_t __pread64_chk(int, void* _Nonnull, size_t, off64_t, size_t) __INTRODUCED_IN(23);
+ssize_t __pread64_real(int, void* _Nonnull, size_t, off64_t) __RENAME(pread64);
-ssize_t __pwrite_chk(int, const void*, size_t, off_t, size_t) __INTRODUCED_IN(24);
-ssize_t __pwrite_real(int, const void*, size_t, off_t) __RENAME(pwrite);
+ssize_t __pwrite_chk(int, const void* _Nonnull, size_t, off_t, size_t) __INTRODUCED_IN(24);
+ssize_t __pwrite_real(int, const void* _Nonnull, size_t, off_t) __RENAME(pwrite);
-ssize_t __pwrite64_chk(int, const void*, size_t, off64_t, size_t) __INTRODUCED_IN(24);
-ssize_t __pwrite64_real(int, const void*, size_t, off64_t) __RENAME(pwrite64);
+ssize_t __pwrite64_chk(int, const void* _Nonnull, size_t, off64_t, size_t) __INTRODUCED_IN(24);
+ssize_t __pwrite64_real(int, const void* _Nonnull, size_t, off64_t) __RENAME(pwrite64);
-ssize_t __read_chk(int, void*, size_t, size_t) __INTRODUCED_IN(21);
-ssize_t __write_chk(int, const void*, size_t, size_t) __INTRODUCED_IN(24);
-ssize_t __readlink_chk(const char*, char*, size_t, size_t) __INTRODUCED_IN(23);
-ssize_t __readlinkat_chk(int dirfd, const char*, char*, size_t, size_t) __INTRODUCED_IN(23);
+ssize_t __read_chk(int, void* __BIONIC_COMPLICATED_NULLNESS, size_t, size_t);
+ssize_t __write_chk(int, const void* __BIONIC_COMPLICATED_NULLNESS, size_t, size_t) __INTRODUCED_IN(24);
+ssize_t __readlink_chk(const char* _Nonnull, char* _Nonnull, size_t, size_t) __INTRODUCED_IN(23);
+ssize_t __readlinkat_chk(int dirfd, const char* _Nonnull, char* _Nonnull, size_t, size_t) __INTRODUCED_IN(23);
#if defined(__BIONIC_FORTIFY)
@@ -70,7 +70,7 @@
__builtin_constant_p(index) && (index) <= SSIZE_MAX))
__BIONIC_FORTIFY_INLINE
-char* getcwd(char* const __pass_object_size buf, size_t size)
+char* _Nullable getcwd(char* const _Nullable __pass_object_size buf, size_t size)
__overloadable
__error_if_overflows_objectsize(size, __bos(buf), getcwd) {
#if __ANDROID_API__ >= 24 && __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
@@ -85,7 +85,7 @@
#if !defined(__USE_FILE_OFFSET64)
__BIONIC_FORTIFY_INLINE
-ssize_t pread(int fd, void* const __pass_object_size0 buf, size_t count, off_t offset)
+ssize_t pread(int fd, void* const _Nonnull __pass_object_size0 buf, size_t count, off_t offset)
__overloadable
__error_if_overflows_ssizet(count, pread)
__error_if_overflows_objectsize(count, __bos0(buf), pread) {
@@ -101,7 +101,7 @@
#endif /* !defined(__USE_FILE_OFFSET64) */
__BIONIC_FORTIFY_INLINE
-ssize_t pread64(int fd, void* const __pass_object_size0 buf, size_t count, off64_t offset)
+ssize_t pread64(int fd, void* const _Nonnull __pass_object_size0 buf, size_t count, off64_t offset)
__overloadable
__error_if_overflows_ssizet(count, pread64)
__error_if_overflows_objectsize(count, __bos0(buf), pread64) {
@@ -117,7 +117,7 @@
#if !defined(__USE_FILE_OFFSET64)
__BIONIC_FORTIFY_INLINE
-ssize_t pwrite(int fd, const void* const __pass_object_size0 buf, size_t count, off_t offset)
+ssize_t pwrite(int fd, const void* const _Nonnull __pass_object_size0 buf, size_t count, off_t offset)
__overloadable
__error_if_overflows_ssizet(count, pwrite)
__error_if_overflows_objectsize(count, __bos0(buf), pwrite) {
@@ -133,7 +133,7 @@
#endif /* !defined(__USE_FILE_OFFSET64) */
__BIONIC_FORTIFY_INLINE
-ssize_t pwrite64(int fd, const void* const __pass_object_size0 buf, size_t count, off64_t offset)
+ssize_t pwrite64(int fd, const void* const _Nonnull __pass_object_size0 buf, size_t count, off64_t offset)
__overloadable
__error_if_overflows_ssizet(count, pwrite64)
__error_if_overflows_objectsize(count, __bos0(buf), pwrite64) {
@@ -148,7 +148,7 @@
}
__BIONIC_FORTIFY_INLINE
-ssize_t read(int fd, void* const __pass_object_size0 buf, size_t count)
+ssize_t read(int fd, void* const __BIONIC_COMPLICATED_NULLNESS __pass_object_size0 buf, size_t count)
__overloadable
__error_if_overflows_ssizet(count, read)
__error_if_overflows_objectsize(count, __bos0(buf), read) {
@@ -163,7 +163,7 @@
}
__BIONIC_FORTIFY_INLINE
-ssize_t write(int fd, const void* const __pass_object_size0 buf, size_t count)
+ssize_t write(int fd, const void* const __BIONIC_COMPLICATED_NULLNESS __pass_object_size0 buf, size_t count)
__overloadable
__error_if_overflows_ssizet(count, write)
__error_if_overflows_objectsize(count, __bos0(buf), write) {
@@ -178,7 +178,7 @@
}
__BIONIC_FORTIFY_INLINE
-ssize_t readlink(const char* path, char* const __pass_object_size buf, size_t size)
+ssize_t readlink(const char* _Nonnull path, char* _Nonnull const __pass_object_size buf, size_t size)
__overloadable
__error_if_overflows_ssizet(size, readlink)
__error_if_overflows_objectsize(size, __bos(buf), readlink) {
@@ -193,7 +193,7 @@
}
__BIONIC_FORTIFY_INLINE
-ssize_t readlinkat(int dirfd, const char* path, char* const __pass_object_size buf, size_t size)
+ssize_t readlinkat(int dirfd, const char* _Nonnull path, char* const _Nonnull __pass_object_size buf, size_t size)
__overloadable
__error_if_overflows_ssizet(size, readlinkat)
__error_if_overflows_objectsize(size, __bos(buf), readlinkat) {
diff --git a/libc/include/bits/getentropy.h b/libc/include/bits/getentropy.h
new file mode 100644
index 0000000..a5a14f7
--- /dev/null
+++ b/libc/include/bits/getentropy.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+/**
+ * @file bits/getentropy.h
+ * @brief The getentropy() function.
+ */
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/**
+ * [getentropy(3)](http://man7.org/linux/man-pages/man3/getentropy.3.html) fills the given buffer
+ * with random bytes.
+ *
+ * Returns 0 on success, and returns -1 and sets `errno` on failure.
+ *
+ * Available since API level 28.
+ *
+ * See also arc4random_buf() which is available in all API levels.
+ */
+int getentropy(void* _Nonnull __buffer, size_t __buffer_size) __wur __INTRODUCED_IN(28);
+
+__END_DECLS
diff --git a/libc/include/bits/glibc-syscalls.h b/libc/include/bits/glibc-syscalls.h
index 79f7da0..50817af 100644
--- a/libc/include/bits/glibc-syscalls.h
+++ b/libc/include/bits/glibc-syscalls.h
@@ -60,6 +60,9 @@
#if defined(__NR_brk)
#define SYS_brk __NR_brk
#endif
+#if defined(__NR_cachestat)
+ #define SYS_cachestat __NR_cachestat
+#endif
#if defined(__NR_capget)
#define SYS_capget __NR_capget
#endif
@@ -909,6 +912,9 @@
#if defined(__NR_riscv_flush_icache)
#define SYS_riscv_flush_icache __NR_riscv_flush_icache
#endif
+#if defined(__NR_riscv_hwprobe)
+ #define SYS_riscv_hwprobe __NR_riscv_hwprobe
+#endif
#if defined(__NR_rmdir)
#define SYS_rmdir __NR_rmdir
#endif
diff --git a/libc/include/bits/lockf.h b/libc/include/bits/lockf.h
index 58ab031..ec6e53c 100644
--- a/libc/include/bits/lockf.h
+++ b/libc/include/bits/lockf.h
@@ -60,7 +60,7 @@
/**
* Like lockf() but allows using a 64-bit length
- * even from a 32-bit process without `__FILE_OFFSET_BITS=64`.
+ * even from a 32-bit process without `_FILE_OFFSET_BITS=64`.
*/
int lockf64(int __fd, int __cmd, off64_t __length) __INTRODUCED_IN(24);
diff --git a/libc/include/bits/page_size.h b/libc/include/bits/page_size.h
new file mode 100644
index 0000000..ca434e5
--- /dev/null
+++ b/libc/include/bits/page_size.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#if !defined(__BIONIC_NO_PAGE_SIZE_MACRO)
+#define PAGE_SIZE 4096
+#define PAGE_MASK (~(PAGE_SIZE - 1))
+#endif
+
+__END_DECLS
diff --git a/libc/include/bits/stdatomic.h b/libc/include/bits/stdatomic.h
index 2ce6ee6..fe3d68d 100644
--- a/libc/include/bits/stdatomic.h
+++ b/libc/include/bits/stdatomic.h
@@ -269,18 +269,18 @@
#define ATOMIC_FLAG_INIT { ATOMIC_VAR_INIT(false) }
-static __inline bool atomic_flag_test_and_set_explicit(volatile atomic_flag *__object, memory_order __order) {
+static __inline bool atomic_flag_test_and_set_explicit(volatile atomic_flag * _Nonnull __object, memory_order __order) {
return (atomic_exchange_explicit(&__object->__flag, 1, __order));
}
-static __inline void atomic_flag_clear_explicit(volatile atomic_flag *__object, memory_order __order) {
+static __inline void atomic_flag_clear_explicit(volatile atomic_flag * _Nonnull __object, memory_order __order) {
atomic_store_explicit(&__object->__flag, 0, __order);
}
-static __inline bool atomic_flag_test_and_set(volatile atomic_flag *__object) {
+static __inline bool atomic_flag_test_and_set(volatile atomic_flag * _Nonnull __object) {
return (atomic_flag_test_and_set_explicit(__object, memory_order_seq_cst));
}
-static __inline void atomic_flag_clear(volatile atomic_flag *__object) {
+static __inline void atomic_flag_clear(volatile atomic_flag * _Nonnull __object) {
atomic_flag_clear_explicit(__object, memory_order_seq_cst);
}
diff --git a/libc/include/bits/termios_inlines.h b/libc/include/bits/termios_inlines.h
index 5f7cc42..a884b59 100644
--- a/libc/include/bits/termios_inlines.h
+++ b/libc/include/bits/termios_inlines.h
@@ -45,19 +45,19 @@
// Supporting separate input and output speeds would require an ABI
// change for `struct termios`.
-static __inline speed_t cfgetspeed(const struct termios* s) {
+static __inline speed_t cfgetspeed(const struct termios* _Nonnull s) {
return __BIONIC_CAST(static_cast, speed_t, s->c_cflag & CBAUD);
}
-__BIONIC_TERMIOS_INLINE speed_t cfgetispeed(const struct termios* s) {
+__BIONIC_TERMIOS_INLINE speed_t cfgetispeed(const struct termios* _Nonnull s) {
return cfgetspeed(s);
}
-__BIONIC_TERMIOS_INLINE speed_t cfgetospeed(const struct termios* s) {
+__BIONIC_TERMIOS_INLINE speed_t cfgetospeed(const struct termios* _Nonnull s) {
return cfgetspeed(s);
}
-__BIONIC_TERMIOS_INLINE void cfmakeraw(struct termios* s) {
+__BIONIC_TERMIOS_INLINE void cfmakeraw(struct termios* _Nonnull s) {
s->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
s->c_oflag &= ~OPOST;
s->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
@@ -67,7 +67,7 @@
s->c_cc[VTIME] = 0;
}
-__BIONIC_TERMIOS_INLINE int cfsetspeed(struct termios* s, speed_t speed) {
+__BIONIC_TERMIOS_INLINE int cfsetspeed(struct termios* _Nonnull s, speed_t speed) {
// CBAUD is 0x100f, and every matching bit pattern has a Bxxx constant.
if ((speed & ~CBAUD) != 0) {
errno = EINVAL;
@@ -77,11 +77,11 @@
return 0;
}
-__BIONIC_TERMIOS_INLINE int cfsetispeed(struct termios* s, speed_t speed) {
+__BIONIC_TERMIOS_INLINE int cfsetispeed(struct termios* _Nonnull s, speed_t speed) {
return cfsetspeed(s, speed);
}
-__BIONIC_TERMIOS_INLINE int cfsetospeed(struct termios* s, speed_t speed) {
+__BIONIC_TERMIOS_INLINE int cfsetospeed(struct termios* _Nonnull s, speed_t speed) {
return cfsetspeed(s, speed);
}
@@ -99,7 +99,7 @@
return ioctl(fd, TCFLSH, __BIONIC_CAST(static_cast, unsigned long, queue));
}
-__BIONIC_TERMIOS_INLINE int tcgetattr(int fd, struct termios* s) {
+__BIONIC_TERMIOS_INLINE int tcgetattr(int fd, struct termios* _Nonnull s) {
return ioctl(fd, TCGETS, s);
}
@@ -112,7 +112,7 @@
return ioctl(fd, TCSBRKP, __BIONIC_CAST(static_cast, unsigned long, duration));
}
-__BIONIC_TERMIOS_INLINE int tcsetattr(int fd, int optional_actions, const struct termios* s) {
+__BIONIC_TERMIOS_INLINE int tcsetattr(int fd, int optional_actions, const struct termios* _Nonnull s) {
int cmd;
switch (optional_actions) {
case TCSANOW: cmd = TCSETS; break;
diff --git a/libc/include/bits/termios_winsize_inlines.h b/libc/include/bits/termios_winsize_inlines.h
new file mode 100644
index 0000000..ae246e4
--- /dev/null
+++ b/libc/include/bits/termios_winsize_inlines.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+
+#include <linux/termios.h>
+
+#if !defined(__BIONIC_TERMIOS_WINSIZE_INLINE)
+#define __BIONIC_TERMIOS_WINSIZE_INLINE static __inline
+#endif
+
+__BEGIN_DECLS
+
+__BIONIC_TERMIOS_WINSIZE_INLINE int tcgetwinsize(int __fd, struct winsize* _Nonnull __size) {
+ return ioctl(__fd, TIOCGWINSZ, __size);
+}
+
+__BIONIC_TERMIOS_WINSIZE_INLINE int tcsetwinsize(int __fd, const struct winsize* _Nonnull __size) {
+ return ioctl(__fd, TIOCSWINSZ, __size);
+}
+
+__END_DECLS
diff --git a/libc/include/bits/threads_inlines.h b/libc/include/bits/threads_inlines.h
index 17de4a1..5878e0a 100644
--- a/libc/include/bits/threads_inlines.h
+++ b/libc/include/bits/threads_inlines.h
@@ -48,46 +48,46 @@
}
}
-__BIONIC_THREADS_INLINE void call_once(once_flag* __flag,
- void (*__function)(void)) {
+__BIONIC_THREADS_INLINE void call_once(once_flag* _Nonnull __flag,
+ void (* _Nonnull __function)(void)) {
pthread_once(__flag, __function);
}
-__BIONIC_THREADS_INLINE int cnd_broadcast(cnd_t* __cnd) {
+__BIONIC_THREADS_INLINE int cnd_broadcast(cnd_t* _Nonnull __cnd) {
return __bionic_thrd_error(pthread_cond_broadcast(__cnd));
}
-__BIONIC_THREADS_INLINE void cnd_destroy(cnd_t* __cnd) {
+__BIONIC_THREADS_INLINE void cnd_destroy(cnd_t* _Nonnull __cnd) {
pthread_cond_destroy(__cnd);
}
-__BIONIC_THREADS_INLINE int cnd_init(cnd_t* __cnd) {
+__BIONIC_THREADS_INLINE int cnd_init(cnd_t* _Nonnull __cnd) {
return __bionic_thrd_error(pthread_cond_init(__cnd, NULL));
}
-__BIONIC_THREADS_INLINE int cnd_signal(cnd_t* __cnd) {
+__BIONIC_THREADS_INLINE int cnd_signal(cnd_t* _Nonnull __cnd) {
return __bionic_thrd_error(pthread_cond_signal(__cnd));
}
-__BIONIC_THREADS_INLINE int cnd_timedwait(cnd_t* __cnd,
- mtx_t* __mtx,
- const struct timespec* __timeout) {
+__BIONIC_THREADS_INLINE int cnd_timedwait(cnd_t* _Nonnull __cnd,
+ mtx_t* _Nonnull __mtx,
+ const struct timespec* _Nullable __timeout) {
return __bionic_thrd_error(pthread_cond_timedwait(__cnd, __mtx, __timeout));
}
-__BIONIC_THREADS_INLINE int cnd_wait(cnd_t* __cnd, mtx_t* __mtx) {
+__BIONIC_THREADS_INLINE int cnd_wait(cnd_t* _Nonnull __cnd, mtx_t* _Nonnull __mtx) {
return __bionic_thrd_error(pthread_cond_wait(__cnd, __mtx));
}
-__BIONIC_THREADS_INLINE void mtx_destroy(mtx_t* __mtx) {
+__BIONIC_THREADS_INLINE void mtx_destroy(mtx_t* _Nonnull __mtx) {
pthread_mutex_destroy(__mtx);
}
-__BIONIC_THREADS_INLINE int mtx_init(mtx_t* __mtx, int __type) {
+__BIONIC_THREADS_INLINE int mtx_init(mtx_t* _Nonnull __mtx, int __type) {
int __pthread_type = (__type & mtx_recursive) ? PTHREAD_MUTEX_RECURSIVE
: PTHREAD_MUTEX_NORMAL;
__type &= ~mtx_recursive;
@@ -99,31 +99,32 @@
return __bionic_thrd_error(pthread_mutex_init(__mtx, &__attr));
}
-__BIONIC_THREADS_INLINE int mtx_lock(mtx_t* __mtx) {
+__BIONIC_THREADS_INLINE int mtx_lock(mtx_t* _Nonnull __mtx) {
return __bionic_thrd_error(pthread_mutex_lock(__mtx));
}
-__BIONIC_THREADS_INLINE int mtx_timedlock(mtx_t* __mtx,
- const struct timespec* __timeout) {
+__BIONIC_THREADS_INLINE int mtx_timedlock(mtx_t* _Nonnull __mtx,
+ const struct timespec* _Nullable __timeout) {
return __bionic_thrd_error(pthread_mutex_timedlock(__mtx, __timeout));
}
-__BIONIC_THREADS_INLINE int mtx_trylock(mtx_t* __mtx) {
+__BIONIC_THREADS_INLINE int mtx_trylock(mtx_t* _Nonnull __mtx) {
return __bionic_thrd_error(pthread_mutex_trylock(__mtx));
}
-__BIONIC_THREADS_INLINE int mtx_unlock(mtx_t* __mtx) {
+__BIONIC_THREADS_INLINE int mtx_unlock(mtx_t* _Nonnull __mtx) {
return __bionic_thrd_error(pthread_mutex_unlock(__mtx));
}
-
-
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnullability-completeness"
struct __bionic_thrd_data {
thrd_start_t __func;
void* __arg;
};
+#pragma clang diagnostic pop
-static inline void* __bionic_thrd_trampoline(void* __arg) {
+static inline void* _Nonnull __bionic_thrd_trampoline(void* _Nonnull __arg) {
struct __bionic_thrd_data __data =
*__BIONIC_CAST(static_cast, struct __bionic_thrd_data*, __arg);
free(__arg);
@@ -132,9 +133,9 @@
__BIONIC_CAST(static_cast, uintptr_t, __result));
}
-__BIONIC_THREADS_INLINE int thrd_create(thrd_t* __thrd,
- thrd_start_t __func,
- void* __arg) {
+__BIONIC_THREADS_INLINE int thrd_create(thrd_t* _Nonnull __thrd,
+ thrd_start_t _Nonnull __func,
+ void* _Nullable __arg) {
struct __bionic_thrd_data* __pthread_arg =
__BIONIC_CAST(static_cast, struct __bionic_thrd_data*,
malloc(sizeof(struct __bionic_thrd_data)));
@@ -164,7 +165,7 @@
__BIONIC_CAST(static_cast, uintptr_t, __result)));
}
-__BIONIC_THREADS_INLINE int thrd_join(thrd_t __thrd, int* __result) {
+__BIONIC_THREADS_INLINE int thrd_join(thrd_t __thrd, int* _Nullable __result) {
void* __pthread_result;
if (pthread_join(__thrd, &__pthread_result) != 0) return thrd_error;
if (__result) {
@@ -173,8 +174,8 @@
return thrd_success;
}
-__BIONIC_THREADS_INLINE int thrd_sleep(const struct timespec* __duration,
- struct timespec* __remaining) {
+__BIONIC_THREADS_INLINE int thrd_sleep(const struct timespec* _Nonnull __duration,
+ struct timespec* _Nullable __remaining) {
int __rc = nanosleep(__duration, __remaining);
if (__rc == 0) return 0;
return (errno == EINTR) ? -1 : -2;
@@ -186,7 +187,7 @@
-__BIONIC_THREADS_INLINE int tss_create(tss_t* __key, tss_dtor_t __dtor) {
+__BIONIC_THREADS_INLINE int tss_create(tss_t* _Nonnull __key, tss_dtor_t _Nullable __dtor) {
return __bionic_thrd_error(pthread_key_create(__key, __dtor));
}
@@ -194,11 +195,11 @@
pthread_key_delete(__key);
}
-__BIONIC_THREADS_INLINE void* tss_get(tss_t __key) {
+__BIONIC_THREADS_INLINE void* _Nullable tss_get(tss_t __key) {
return pthread_getspecific(__key);
}
-__BIONIC_THREADS_INLINE int tss_set(tss_t __key, void* __value) {
+__BIONIC_THREADS_INLINE int tss_set(tss_t __key, void* _Nonnull __value) {
return __bionic_thrd_error(pthread_setspecific(__key, __value));
}
diff --git a/libc/include/bits/wctype.h b/libc/include/bits/wctype.h
index 0015261..11d5fde 100644
--- a/libc/include/bits/wctype.h
+++ b/libc/include/bits/wctype.h
@@ -39,7 +39,7 @@
int iswalnum(wint_t __wc);
int iswalpha(wint_t __wc);
-int iswblank(wint_t __wc) __INTRODUCED_IN(21);
+int iswblank(wint_t __wc);
int iswcntrl(wint_t __wc);
int iswdigit(wint_t __wc);
int iswgraph(wint_t __wc);
@@ -54,12 +54,12 @@
wint_t towupper(wint_t __wc);
typedef long wctype_t;
-wctype_t wctype(const char* __name);
+wctype_t wctype(const char* _Nonnull __name);
int iswctype(wint_t __wc, wctype_t __type);
typedef const void* wctrans_t;
-wint_t towctrans(wint_t __wc, wctrans_t __transform) __INTRODUCED_IN_NO_GUARD_FOR_NDK(26);
-wctrans_t wctrans(const char* __name) __INTRODUCED_IN_NO_GUARD_FOR_NDK(26);
+wint_t towctrans(wint_t __wc, wctrans_t _Nonnull __transform) __INTRODUCED_IN_NO_GUARD_FOR_NDK(26);
+wctrans_t _Nullable wctrans(const char* _Nonnull __name) __INTRODUCED_IN_NO_GUARD_FOR_NDK(26);
__END_DECLS
diff --git a/libc/include/complex.h b/libc/include/complex.h
index 50da330..f205abd 100644
--- a/libc/include/complex.h
+++ b/libc/include/complex.h
@@ -55,99 +55,99 @@
/* 7.3.5.1 The cacos functions */
double complex cacos(double complex __z) __INTRODUCED_IN(23);
float complex cacosf(float complex __z) __INTRODUCED_IN(23);
-long double complex cacosl(long double complex __z) __RENAME_LDBL(cacos, 23, 26);
+long double complex cacosl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.5.2 The casin functions */
double complex casin(double complex __z) __INTRODUCED_IN(23);
float complex casinf(float complex __z) __INTRODUCED_IN(23);
-long double complex casinl(long double complex __z) __RENAME_LDBL(casin, 23, 26);
+long double complex casinl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.5.1 The catan functions */
double complex catan(double complex __z) __INTRODUCED_IN(23);
float complex catanf(float complex __z) __INTRODUCED_IN(23);
-long double complex catanl(long double complex __z) __RENAME_LDBL(catan, 23, 26);
+long double complex catanl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.5.1 The ccos functions */
double complex ccos(double complex __z) __INTRODUCED_IN(23);
float complex ccosf(float complex __z) __INTRODUCED_IN(23);
-long double complex ccosl(long double complex __z) __RENAME_LDBL(ccos, 23, 26);
+long double complex ccosl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.5.1 The csin functions */
double complex csin(double complex __z) __INTRODUCED_IN(23);
float complex csinf(float complex __z) __INTRODUCED_IN(23);
-long double complex csinl(long double complex __z) __RENAME_LDBL(csin, 23, 26);
+long double complex csinl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.5.1 The ctan functions */
double complex ctan(double complex __z) __INTRODUCED_IN(23);
float complex ctanf(float complex __z) __INTRODUCED_IN(23);
-long double complex ctanl(long double complex __z) __RENAME_LDBL(ctan, 23, 26);
+long double complex ctanl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.6 Hyperbolic functions */
/* 7.3.6.1 The cacosh functions */
double complex cacosh(double complex __z) __INTRODUCED_IN(23);
float complex cacoshf(float complex __z) __INTRODUCED_IN(23);
-long double complex cacoshl(long double complex __z) __RENAME_LDBL(cacosh, 23, 26);
+long double complex cacoshl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.6.2 The casinh functions */
double complex casinh(double complex __z) __INTRODUCED_IN(23);
float complex casinhf(float complex __z) __INTRODUCED_IN(23);
-long double complex casinhl(long double complex __z) __RENAME_LDBL(casinh, 23, 26);
+long double complex casinhl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.6.3 The catanh functions */
double complex catanh(double complex __z) __INTRODUCED_IN(23);
float complex catanhf(float complex __z) __INTRODUCED_IN(23);
-long double complex catanhl(long double complex __z) __RENAME_LDBL(catanh, 23, 26);
+long double complex catanhl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.6.4 The ccosh functions */
double complex ccosh(double complex __z) __INTRODUCED_IN(23);
float complex ccoshf(float complex __z) __INTRODUCED_IN(23);
-long double complex ccoshl(long double complex __z) __RENAME_LDBL(ccosh, 23, 26);
+long double complex ccoshl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.6.5 The csinh functions */
double complex csinh(double complex __z) __INTRODUCED_IN(23);
float complex csinhf(float complex __z) __INTRODUCED_IN(23);
-long double complex csinhl(long double complex __z) __RENAME_LDBL(csinh, 23, 26);
+long double complex csinhl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.6.6 The ctanh functions */
double complex ctanh(double complex __z) __INTRODUCED_IN(23);
float complex ctanhf(float complex __z) __INTRODUCED_IN(23);
-long double complex ctanhl(long double complex __z) __RENAME_LDBL(ctanh, 23, 26);
+long double complex ctanhl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.7 Exponential and logarithmic functions */
/* 7.3.7.1 The cexp functions */
double complex cexp(double complex __z) __INTRODUCED_IN(23);
float complex cexpf(float complex __z) __INTRODUCED_IN(23);
-long double complex cexpl(long double complex __z) __RENAME_LDBL(cexp, 23, 26);
+long double complex cexpl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.7.2 The clog functions */
double complex clog(double complex __z) __INTRODUCED_IN(26);
float complex clogf(float complex __z) __INTRODUCED_IN(26);
-long double complex clogl(long double complex __z) __RENAME_LDBL(clog, 26, 26);
+long double complex clogl(long double complex __z) __INTRODUCED_IN(26);
/* 7.3.8 Power and absolute-value functions */
/* 7.3.8.1 The cabs functions */
double cabs(double complex __z) __INTRODUCED_IN(23);
float cabsf(float complex __z) __INTRODUCED_IN(23);
-long double cabsl(long double complex __z) __INTRODUCED_IN_32(21) __INTRODUCED_IN_64(23) /*__RENAME_LDBL(cabs)*/;
+long double cabsl(long double complex __z) __INTRODUCED_IN(23);
/* 7.3.8.2 The cpow functions */
double complex cpow(double complex __x, double complex __z) __INTRODUCED_IN(26);
float complex cpowf(float complex __x, float complex __z) __INTRODUCED_IN(26);
-long double complex cpowl(long double complex __x, long double complex __z) __RENAME_LDBL(cpow, 26, 26);
+long double complex cpowl(long double complex __x, long double complex __z) __INTRODUCED_IN(26);
/* 7.3.8.3 The csqrt functions */
double complex csqrt(double complex __z) __INTRODUCED_IN(23);
float complex csqrtf(float complex __z) __INTRODUCED_IN(23);
-long double complex csqrtl(long double complex __z) __INTRODUCED_IN_32(21) __INTRODUCED_IN_64(23) /*__RENAME_LDBL(csqrt)*/;
+long double complex csqrtl(long double complex __z) __INTRODUCED_IN(23);
/* 7.3.9 Manipulation functions */
/* 7.3.9.1 The carg functions */
double carg(double complex __z) __INTRODUCED_IN(23);
float cargf(float complex __z) __INTRODUCED_IN(23);
-long double cargl(long double complex __z) __RENAME_LDBL(carg, 23, 23);
+long double cargl(long double complex __z) __INTRODUCED_IN(23);
/* 7.3.9.2 The cimag functions */
double cimag(double complex __z) __INTRODUCED_IN(23);
float cimagf(float complex __z) __INTRODUCED_IN(23);
-long double cimagl(long double complex __z) __RENAME_LDBL(cimag, 23, 23);
+long double cimagl(long double complex __z) __INTRODUCED_IN(23);
/* 7.3.9.3 The conj functions */
double complex conj(double complex __z) __INTRODUCED_IN(23);
float complex conjf(float complex __z) __INTRODUCED_IN(23);
-long double complex conjl(long double complex __z) __RENAME_LDBL(conj, 23, 23);
+long double complex conjl(long double complex __z) __INTRODUCED_IN(23);
/* 7.3.9.4 The cproj functions */
double complex cproj(double complex __z) __INTRODUCED_IN(23);
float complex cprojf(float complex __z) __INTRODUCED_IN(23);
-long double complex cprojl(long double complex __z) __INTRODUCED_IN_32(21) __INTRODUCED_IN_64(23) /*__RENAME_LDBL(cproj)*/;
+long double complex cprojl(long double complex __z) __INTRODUCED_IN(23);
/* 7.3.9.5 The creal functions */
double creal(double complex __z) __INTRODUCED_IN(23);
float crealf(float complex __z) __INTRODUCED_IN(23);
-long double creall(long double complex __z) __RENAME_LDBL(creal, 23, 23);
+long double creall(long double complex __z) __INTRODUCED_IN(23);
__END_DECLS
diff --git a/libc/include/dirent.h b/libc/include/dirent.h
index 2751b9e..4f5d0fb 100644
--- a/libc/include/dirent.h
+++ b/libc/include/dirent.h
@@ -123,10 +123,10 @@
* or returns null and leaves `errno` unchanged at the end of the directory,
* or returns null and sets `errno` on failure.
*/
-struct dirent64* _Nullable readdir64(DIR* _Nonnull __dir) __INTRODUCED_IN(21);
+struct dirent64* _Nullable readdir64(DIR* _Nonnull __dir);
int readdir_r(DIR* _Nonnull __dir, struct dirent* _Nonnull __entry, struct dirent* _Nullable * _Nonnull __buffer) __attribute__((__deprecated__("readdir_r is deprecated; use readdir instead")));
-int readdir64_r(DIR* _Nonnull __dir, struct dirent64* _Nonnull __entry, struct dirent64* _Nullable * _Nonnull __buffer) __INTRODUCED_IN(21) __attribute__((__deprecated__("readdir64_r is deprecated; use readdir64 instead")));
+int readdir64_r(DIR* _Nonnull __dir, struct dirent64* _Nonnull __entry, struct dirent64* _Nullable * _Nonnull __buffer) __attribute__((__deprecated__("readdir64_r is deprecated; use readdir64 instead")));
/**
* [closedir(3)](http://man7.org/linux/man-pages/man3/closedir.3.html)
@@ -179,10 +179,8 @@
/**
* [alphasort64](http://man7.org/linux/man-pages/man3/alphasort.3.html) is a
* comparator for use with scandir64() that uses strcmp().
- *
- * Available since API level 21.
*/
-int alphasort64(const struct dirent64* _Nonnull * _Nonnull __lhs, const struct dirent64* _Nonnull * _Nonnull __rhs) __INTRODUCED_IN(21);
+int alphasort64(const struct dirent64* _Nonnull * _Nonnull __lhs, const struct dirent64* _Nonnull * _Nonnull __rhs);
/**
* [scandir(3)](http://man7.org/linux/man-pages/man3/scandir.3.html)
@@ -205,10 +203,8 @@
*
* Returns the number of entries returned in the list on success,
* and returns -1 and sets `errno` on failure.
- *
- * Available since API level 21.
*/
-int scandir64(const char* _Nonnull __path, struct dirent64* _Nonnull * _Nonnull * _Nonnull __name_list, int (* _Nullable __filter)(const struct dirent64* _Nonnull), int (* _Nullable __comparator)(const struct dirent64* _Nonnull * _Nonnull, const struct dirent64* _Nonnull * _Nonnull)) __INTRODUCED_IN(21);
+int scandir64(const char* _Nonnull __path, struct dirent64* _Nonnull * _Nonnull * _Nonnull __name_list, int (* _Nullable __filter)(const struct dirent64* _Nonnull), int (* _Nullable __comparator)(const struct dirent64* _Nonnull * _Nonnull, const struct dirent64* _Nonnull * _Nonnull));
#if defined(__USE_GNU)
diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h
index a8db387..16ce6fa 100644
--- a/libc/include/fcntl.h
+++ b/libc/include/fcntl.h
@@ -111,7 +111,7 @@
*/
int creat(const char* _Nonnull __path, mode_t __mode);
/** See creat(). */
-int creat64(const char* _Nonnull __path, mode_t __mode) __INTRODUCED_IN(21);
+int creat64(const char* _Nonnull __path, mode_t __mode);
/**
* [openat(2)](http://man7.org/linux/man-pages/man2/openat.2.html)
@@ -122,7 +122,7 @@
*/
int openat(int __dir_fd, const char* _Nonnull __path, int __flags, ...);
/** See openat(). */
-int openat64(int __dir_fd, const char* _Nonnull __path, int __flags, ...) __INTRODUCED_IN(21);
+int openat64(int __dir_fd, const char* _Nonnull __path, int __flags, ...);
/**
* [open(2)](http://man7.org/linux/man-pages/man2/open.2.html)
@@ -133,7 +133,7 @@
*/
int open(const char* _Nonnull __path, int __flags, ...);
/** See open(). */
-int open64(const char* _Nonnull __path, int __flags, ...) __INTRODUCED_IN(21);
+int open64(const char* _Nonnull __path, int __flags, ...);
/**
* [splice(2)](http://man7.org/linux/man-pages/man2/splice.2.html)
@@ -144,10 +144,8 @@
*
* Returns the number of bytes spliced on success and returns -1 and sets
* `errno` on failure.
- *
- * Available since API level 21.
*/
-ssize_t splice(int __in_fd, off64_t* __BIONIC_COMPLICATED_NULLNESS __in_offset, int __out_fd, off64_t* __BIONIC_COMPLICATED_NULLNESS __out_offset, size_t __length, unsigned int __flags) __INTRODUCED_IN(21);
+ssize_t splice(int __in_fd, off64_t* __BIONIC_COMPLICATED_NULLNESS __in_offset, int __out_fd, off64_t* __BIONIC_COMPLICATED_NULLNESS __out_offset, size_t __length, unsigned int __flags);
/**
* [tee(2)](http://man7.org/linux/man-pages/man2/tee.2.html)
@@ -158,10 +156,8 @@
*
* Returns the number of bytes duplicated on success and returns -1 and sets
* `errno` on failure.
- *
- * Available since API level 21.
*/
-ssize_t tee(int __in_fd, int __out_fd, size_t __length, unsigned int __flags) __INTRODUCED_IN(21);
+ssize_t tee(int __in_fd, int __out_fd, size_t __length, unsigned int __flags);
/**
* [vmsplice(2)](http://man7.org/linux/man-pages/man2/vmsplice.2.html)
@@ -172,10 +168,8 @@
*
* Returns the number of bytes spliced on success and returns -1 and sets
* `errno` on failure.
- *
- * Available since API level 21.
*/
-ssize_t vmsplice(int __fd, const struct iovec* _Nonnull __iov, size_t __count, unsigned int __flags) __INTRODUCED_IN(21);
+ssize_t vmsplice(int __fd, const struct iovec* _Nonnull __iov, size_t __count, unsigned int __flags);
/**
* [fallocate(2)](http://man7.org/linux/man-pages/man2/fallocate.2.html)
@@ -187,12 +181,10 @@
* `FALLOC_FL_UNSHARE_RANGE`.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
- *
- * Available since API level 21.
*/
-int fallocate(int __fd, int __mode, off_t __offset, off_t __length) __RENAME_IF_FILE_OFFSET64(fallocate64) __INTRODUCED_IN(21);
+int fallocate(int __fd, int __mode, off_t __offset, off_t __length) __RENAME_IF_FILE_OFFSET64(fallocate64);
/** See fallocate(). */
-int fallocate64(int __fd, int __mode, off64_t __offset, off64_t __length) __INTRODUCED_IN(21);
+int fallocate64(int __fd, int __mode, off64_t __offset, off64_t __length);
/**
* [posix_fadvise(2)](http://man7.org/linux/man-pages/man2/posix_fadvise.2.html)
@@ -203,24 +195,20 @@
* and `POSIX_FADV_NOREUSE`.
*
* Returns 0 on success and returns an error number on failure.
- *
- * Available since API level 21.
*/
-int posix_fadvise(int __fd, off_t __offset, off_t __length, int __advice) __RENAME_IF_FILE_OFFSET64(posix_fadvise64) __INTRODUCED_IN(21);
+int posix_fadvise(int __fd, off_t __offset, off_t __length, int __advice) __RENAME_IF_FILE_OFFSET64(posix_fadvise64);
/** See posix_fadvise(). */
-int posix_fadvise64(int __fd, off64_t __offset, off64_t __length, int __advice) __INTRODUCED_IN(21);
+int posix_fadvise64(int __fd, off64_t __offset, off64_t __length, int __advice);
/**
* [posix_fallocate(2)](http://man7.org/linux/man-pages/man2/posix_fallocate.2.html)
* allocates file space.
*
* Returns 0 on success and returns an error number on failure.
- *
- * Available since API level 21.
*/
-int posix_fallocate(int __fd, off_t __offset, off_t __length) __RENAME_IF_FILE_OFFSET64(posix_fallocate64) __INTRODUCED_IN(21);
+int posix_fallocate(int __fd, off_t __offset, off_t __length) __RENAME_IF_FILE_OFFSET64(posix_fallocate64);
/** See posix_fallocate(). */
-int posix_fallocate64(int __fd, off64_t __offset, off64_t __length) __INTRODUCED_IN(21);
+int posix_fallocate64(int __fd, off64_t __offset, off64_t __length);
#if defined(__USE_GNU)
diff --git a/libc/include/fenv.h b/libc/include/fenv.h
index 6e8ea57..f7dcc8e 100644
--- a/libc/include/fenv.h
+++ b/libc/include/fenv.h
@@ -29,6 +29,11 @@
#pragma once
+/**
+ * @file fenv.h
+ * @brief Floating-point environment.
+ */
+
#include <sys/cdefs.h>
#if defined(__aarch64__) || defined(__arm__)
@@ -43,33 +48,135 @@
__BEGIN_DECLS
-int feclearexcept(int __exceptions) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int fegetexceptflag(fexcept_t* _Nonnull __flag_ptr, int __exceptions) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int feraiseexcept(int __exceptions) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int fesetexceptflag(const fexcept_t* _Nonnull __flag_ptr, int __exceptions) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int fetestexcept(int __exceptions) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
+/**
+ * [feclearexcept(3)](http://man7.org/linux/man-pages/man3/feclearexcept.3.html)
+ * clears the given `exceptions` in hardware.
+ *
+ * Returns 0 on success, and returns non-zero on failure.
+ */
+int feclearexcept(int __exceptions);
-int fegetround(void) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int fesetround(int __rounding_mode) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
+/**
+ * [fegetexceptflag(3)](http://man7.org/linux/man-pages/man3/fegetexceptflag.3.html)
+ * copies the state of the given `exceptions` from hardware into `*flag_ptr`.
+ * See fesetexceptflag().
+ *
+ * Returns 0 on success, and returns non-zero on failure.
+ */
+int fegetexceptflag(fexcept_t* _Nonnull __flag_ptr, int __exceptions);
-int fegetenv(fenv_t* _Nonnull __env) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int feholdexcept(fenv_t* _Nonnull __env) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int fesetenv(const fenv_t* _Nonnull __env) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int feupdateenv(const fenv_t* _Nonnull __env) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
+/**
+ * [feraiseexcept(3)](http://man7.org/linux/man-pages/man3/feraiseexcept.3.html)
+ * raises the given `exceptions` in hardware.
+ *
+ * Returns 0 on success, and returns non-zero on failure.
+ */
+int feraiseexcept(int __exceptions);
-int feenableexcept(int __exceptions) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int fedisableexcept(int __exceptions) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
-int fegetexcept(void) __INTRODUCED_IN_ARM(21) __INTRODUCED_IN_X86(9);
+/**
+ * [fesetexceptflag(3)](http://man7.org/linux/man-pages/man3/fesetexceptflag.3.html)
+ * copies the state of the given `exceptions` from `*flag_ptr` into hardware.
+ * See fesetexceptflag().
+ *
+ * Returns 0 on success, and returns non-zero on failure.
+ */
+int fesetexceptflag(const fexcept_t* _Nonnull __flag_ptr, int __exceptions);
-/*
- * The following constant represents the default floating-point environment
- * (that is, the one installed at program startup) and has type pointer to
- * const-qualified fenv_t.
+/**
+ * [fetestexcept(3)](http://man7.org/linux/man-pages/man3/fetestexcept.3.html)
+ * tests whether the given `exceptions` are set in hardware.
+ *
+ * Returns the currently-set subset of `exceptions`.
+ */
+int fetestexcept(int __exceptions);
+
+/**
+ * [fegetround(3)](http://man7.org/linux/man-pages/man3/fegetround.3.html)
+ * returns the current rounding mode.
+ *
+ * Returns the rounding mode on success, and returns a negative value on failure.
+ */
+int fegetround(void);
+
+/**
+ * [fesetround(3)](http://man7.org/linux/man-pages/man3/fesetround.3.html)
+ * sets the current rounding mode.
+ *
+ * Returns 0 on success, and returns non-zero on failure.
+ */
+int fesetround(int __rounding_mode);
+
+/**
+ * [fegetenv(3)](http://man7.org/linux/man-pages/man3/fegetenv.3.html)
+ * gets the current floating-point environment. See fesetenv().
+ *
+ * Returns 0 on success, and returns non-zero on failure.
+ */
+int fegetenv(fenv_t* _Nonnull __env);
+
+/**
+ * [feholdexcept(3)](http://man7.org/linux/man-pages/man3/feholdexcept.3.html)
+ * gets the current floating-point environment, clears the status flags, and
+ * ignores floating point exceptions. See fesetenv()/feupdateenv().
+ *
+ * Returns 0 on success, and returns non-zero on failure.
+ */
+int feholdexcept(fenv_t* _Nonnull __env);
+
+/**
+ * [fesetenv(3)](http://man7.org/linux/man-pages/man3/fesetenv.3.html)
+ * sets the current floating-point environment. See fegetenv().
+ *
+ * Returns 0 on success, and returns non-zero on failure.
+ */
+int fesetenv(const fenv_t* _Nonnull __env);
+
+/**
+ * [feupdateenv(3)](http://man7.org/linux/man-pages/man3/feupdateenv.3.html)
+ * sets the current floating-point environment to `*env` but with currently-raised
+ * exceptions still raised. See fesetenv().
+ *
+ * Returns 0 on success, and returns non-zero on failure.
+ */
+int feupdateenv(const fenv_t* _Nonnull __env);
+
+/**
+ * [feenableexcept(3)](http://man7.org/linux/man-pages/man3/feenableexcept.3.html)
+ * sets the given `exceptions` to trap, if the hardware supports it. This is not
+ * generally useful on Android, because only x86/x86-64 can trap.
+ *
+ * Returns the previous set of enabled exceptions on success, and returns -1 on failure.
+ */
+int feenableexcept(int __exceptions);
+
+/**
+ * [fedisableexcept(3)](http://man7.org/linux/man-pages/man3/fedisableexcept.3.html)
+ * sets the given `exceptions` to not trap, if the hardware supports it. This is not
+ * generally useful on Android, because only x86/x86-64 can trap.
+ *
+ * Returns the previous set of enabled exceptions on success, and returns -1 on failure.
+ */
+int fedisableexcept(int __exceptions);
+
+/**
+ * [fegetexcept(3)](http://man7.org/linux/man-pages/man3/fegetexcept.3.html)
+ * returns the exceptions that currently trap. This is not generally useful on
+ * Android, because only x86/x86-64 can trap.
+ *
+ * Returns the exceptions that currently trap.
+ */
+int fegetexcept(void);
+
+/** See FE_DFL_ENV. */
+extern const fenv_t __fe_dfl_env;
+
+/**
+ * Constant representing the default floating-point environment
+ * (that is, the one installed at program startup).
*
* It can be used as an argument to the functions that manage the floating-point
* environment, namely fesetenv() and feupdateenv().
*/
-extern const fenv_t __fe_dfl_env;
#define FE_DFL_ENV (&__fe_dfl_env)
__END_DECLS
diff --git a/libc/include/fts.h b/libc/include/fts.h
index bae2615..8dfd213 100644
--- a/libc/include/fts.h
+++ b/libc/include/fts.h
@@ -117,16 +117,11 @@
__BEGIN_DECLS
-/*
- * Strictly these functions were available before Lollipop/21, but there was an accidental ABI
- * breakage in 21 that means you can't write code that runs on current devices and pre-21 devices,
- * so we break the tie in favor of current and future devices.
- */
-FTSENT* _Nullable fts_children(FTS* _Nonnull __fts, int __options) __INTRODUCED_IN(21);
-int fts_close(FTS* _Nonnull __fts) __INTRODUCED_IN(21);
-FTS* _Nullable fts_open(char* _Nonnull const* _Nonnull __path, int __options, int (* _Nullable __comparator)(const FTSENT* _Nonnull * _Nonnull __lhs, const FTSENT* _Nonnull * _Nonnull __rhs)) __INTRODUCED_IN(21);
-FTSENT* _Nullable fts_read(FTS* _Nonnull __fts) __INTRODUCED_IN(21);
-int fts_set(FTS* _Nonnull __fts, FTSENT* _Nonnull __entry, int __options) __INTRODUCED_IN(21);
+FTSENT* _Nullable fts_children(FTS* _Nonnull __fts, int __options);
+int fts_close(FTS* _Nonnull __fts);
+FTS* _Nullable fts_open(char* _Nonnull const* _Nonnull __path, int __options, int (* _Nullable __comparator)(const FTSENT* _Nonnull * _Nonnull __lhs, const FTSENT* _Nonnull * _Nonnull __rhs));
+FTSENT* _Nullable fts_read(FTS* _Nonnull __fts);
+int fts_set(FTS* _Nonnull __fts, FTSENT* _Nonnull __entry, int __options);
__END_DECLS
diff --git a/libc/include/ftw.h b/libc/include/ftw.h
index c5fa4de..ac2473a 100644
--- a/libc/include/ftw.h
+++ b/libc/include/ftw.h
@@ -55,10 +55,10 @@
};
__BEGIN_DECLS
-int ftw(const char* _Nonnull __dir_path, int (* _Nonnull __callback)(const char* _Nonnull, const struct stat* _Nonnull, int), int __max_fd_count) __INTRODUCED_IN(17);
-int nftw(const char* _Nonnull __dir_path, int (* _Nonnull __callback)(const char* _Nonnull, const struct stat* _Nonnull, int, struct FTW* _Nonnull), int __max_fd_count, int __flags) __INTRODUCED_IN(17);
-int ftw64(const char* _Nonnull __dir_path, int (* _Nonnull __callback)(const char* _Nonnull, const struct stat64* _Nonnull, int), int __max_fd_count) __RENAME_STAT64(ftw, 17, 21);
-int nftw64(const char* _Nonnull __dir_path, int (* _Nonnull __callback)(const char* _Nonnull, const struct stat64* _Nonnull, int, struct FTW* _Nonnull), int __max_fd_count, int __flags) __RENAME_STAT64(nftw, 17, 21);
+int ftw(const char* _Nonnull __dir_path, int (* _Nonnull __callback)(const char* _Nonnull, const struct stat* _Nonnull, int), int __max_fd_count);
+int nftw(const char* _Nonnull __dir_path, int (* _Nonnull __callback)(const char* _Nonnull, const struct stat* _Nonnull, int, struct FTW* _Nonnull), int __max_fd_count, int __flags);
+int ftw64(const char* _Nonnull __dir_path, int (* _Nonnull __callback)(const char* _Nonnull, const struct stat64* _Nonnull, int), int __max_fd_count);
+int nftw64(const char* _Nonnull __dir_path, int (* _Nonnull __callback)(const char* _Nonnull, const struct stat64* _Nonnull, int, struct FTW* _Nonnull), int __max_fd_count, int __flags);
__END_DECLS
#endif
diff --git a/libc/include/iconv.h b/libc/include/iconv.h
index 7cf36dc..27e04bb 100644
--- a/libc/include/iconv.h
+++ b/libc/include/iconv.h
@@ -50,19 +50,22 @@
* [iconv_open(3)](http://man7.org/linux/man-pages/man3/iconv_open.3.html) allocates a new converter
* from `__src_encoding` to `__dst_encoding`.
*
+ * Android supports the `utf8`, `ascii`, `usascii`, `utf16be`, `utf16le`, `utf32be`, `utf32le`,
+ * and `wchart` encodings for both source and destination.
+ *
+ * Android supports the GNU `//IGNORE` and `//TRANSLIT` extensions for the
+ * destination encoding.
+ *
* Returns a new `iconv_t` on success and returns `((iconv_t) -1)` and sets `errno` on failure.
*
* Available since API level 28.
*/
-iconv_t _Nonnull iconv_open(const char* _Nonnull __src_encoding, const char* _Nonnull __dst_encoding) __INTRODUCED_IN(28);
+iconv_t _Nonnull iconv_open(const char* _Nonnull __dst_encoding, const char* _Nonnull __src_encoding) __INTRODUCED_IN(28);
/**
* [iconv(3)](http://man7.org/linux/man-pages/man3/iconv.3.html) converts characters from one
* encoding to another.
*
- * Android supports the `utf8`, `ascii`, `usascii`, `utf16be`, `utf16le`, `utf32be`, `utf32le`,
- * and `wchart` encodings. Android also supports the GNU `//IGNORE` and `//TRANSLIT` extensions.
- *
* Returns the number of characters converted on success and returns `((size_t) -1)` and
* sets `errno` on failure.
*
diff --git a/libc/include/inttypes.h b/libc/include/inttypes.h
index 76aee38..9fcd9f3 100644
--- a/libc/include/inttypes.h
+++ b/libc/include/inttypes.h
@@ -327,12 +327,12 @@
} imaxdiv_t;
__BEGIN_DECLS
-intmax_t imaxabs(intmax_t __i) __attribute_const__ __INTRODUCED_IN(19);
-imaxdiv_t imaxdiv(intmax_t __numerator, intmax_t __denominator) __attribute_const__ __INTRODUCED_IN(19);
+intmax_t imaxabs(intmax_t __i) __attribute_const__;
+imaxdiv_t imaxdiv(intmax_t __numerator, intmax_t __denominator) __attribute_const__;
intmax_t strtoimax(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base);
uintmax_t strtoumax(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base);
-intmax_t wcstoimax(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, int __base) __INTRODUCED_IN(21);
-uintmax_t wcstoumax(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, int __base) __INTRODUCED_IN(21);
+intmax_t wcstoimax(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, int __base);
+uintmax_t wcstoumax(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, int __base);
__END_DECLS
#endif
diff --git a/libc/include/link.h b/libc/include/link.h
index a0a3d60..33fea49 100644
--- a/libc/include/link.h
+++ b/libc/include/link.h
@@ -55,11 +55,7 @@
void* _Nullable dlpi_tls_data;
};
-#if defined(__arm__)
-int dl_iterate_phdr(int (* _Nonnull __callback)(struct dl_phdr_info* _Nonnull, size_t, void* _Nullable), void* _Nullable __data) __INTRODUCED_IN(21);
-#else
-int dl_iterate_phdr(int (* _Nonnull __callback)(struct dl_phdr_info* _Nonnull, size_t, void*_Nullable ), void* _Nullable __data);
-#endif
+int dl_iterate_phdr(int (* _Nonnull __callback)(struct dl_phdr_info* _Nonnull, size_t, void* _Nullable), void* _Nullable __data);
#ifdef __arm__
typedef uintptr_t _Unwind_Ptr;
diff --git a/libc/include/locale.h b/libc/include/locale.h
index 27f2a3f..f5c79cb 100644
--- a/libc/include/locale.h
+++ b/libc/include/locale.h
@@ -96,13 +96,13 @@
char int_n_sign_posn;
};
-struct lconv* _Nonnull localeconv(void) __INTRODUCED_IN_NO_GUARD_FOR_NDK(21);
+struct lconv* _Nonnull localeconv(void);
-locale_t _Nullable duplocale(locale_t _Nonnull __l) __INTRODUCED_IN(21);
-void freelocale(locale_t _Nonnull __l) __INTRODUCED_IN(21);
-locale_t _Nullable newlocale(int __category_mask, const char* _Nonnull __locale_name, locale_t _Nullable __base) __INTRODUCED_IN(21);
+locale_t _Nullable duplocale(locale_t _Nonnull __l);
+void freelocale(locale_t _Nonnull __l);
+locale_t _Nullable newlocale(int __category_mask, const char* _Nonnull __locale_name, locale_t _Nullable __base);
char* _Nullable setlocale(int __category, const char* _Nullable __locale_name);
-locale_t _Nullable uselocale(locale_t _Nullable __l) __INTRODUCED_IN(21);
+locale_t _Nullable uselocale(locale_t _Nullable __l);
#define LC_GLOBAL_LOCALE __BIONIC_CAST(reinterpret_cast, locale_t, -1L)
diff --git a/libc/include/malloc.h b/libc/include/malloc.h
index 91d63b3..6f992d9 100644
--- a/libc/include/malloc.h
+++ b/libc/include/malloc.h
@@ -39,6 +39,21 @@
*
* Returns a pointer to the allocated memory on success and returns a null
* pointer and sets `errno` on failure.
+ *
+ * Note that Android (like most Unix systems) allows "overcommit". This
+ * allows processes to allocate more memory than the system has, provided
+ * they don't use it all. This works because only "dirty" pages that have
+ * been written to actually require physical memory. In practice, this
+ * means that it's rare to see memory allocation functions return a null
+ * pointer, and that a non-null pointer does not mean that you actually
+ * have all of the memory you asked for.
+ *
+ * Note also that the Linux Out Of Memory (OOM) killer behaves differently
+ * for code run via `adb shell`. The assumption is that if you ran
+ * something via `adb shell` you're a developer who actually wants the
+ * device to do what you're asking it to do _even if_ that means killing
+ * other processes. Obviously this is not the case for apps, which will
+ * be killed in preference to killing other processes.
*/
void* _Nullable malloc(size_t __byte_count) __mallocfunc __BIONIC_ALLOC_SIZE(1) __wur;
@@ -47,7 +62,7 @@
* and clears memory on the heap.
*
* Returns a pointer to the allocated memory on success and returns a null
- * pointer and sets `errno` on failure.
+ * pointer and sets `errno` on failure (but see the notes for malloc()).
*/
void* _Nullable calloc(size_t __item_count, size_t __item_size) __mallocfunc __BIONIC_ALLOC_SIZE(1,2) __wur;
@@ -56,7 +71,8 @@
* allocated memory on the heap.
*
* Returns a pointer (which may be different from `__ptr`) to the resized
- * memory on success and returns a null pointer and sets `errno` on failure.
+ * memory on success and returns a null pointer and sets `errno` on failure
+ * (but see the notes for malloc()).
*/
void* _Nullable realloc(void* _Nullable __ptr, size_t __byte_count) __BIONIC_ALLOC_SIZE(2) __wur;
@@ -68,7 +84,8 @@
* multiplication overflows.
*
* Returns a pointer (which may be different from `__ptr`) to the resized
- * memory on success and returns a null pointer and sets `errno` on failure.
+ * memory on success and returns a null pointer and sets `errno` on failure
+ * (but see the notes for malloc()).
*/
void* _Nullable reallocarray(void* _Nullable __ptr, size_t __item_count, size_t __item_size) __BIONIC_ALLOC_SIZE(2, 3) __wur __INTRODUCED_IN(29);
@@ -83,7 +100,7 @@
* memory on the heap with the required alignment.
*
* Returns a pointer to the allocated memory on success and returns a null
- * pointer and sets `errno` on failure.
+ * pointer and sets `errno` on failure (but see the notes for malloc()).
*
* See also posix_memalign().
*/
@@ -92,10 +109,8 @@
/**
* [malloc_usable_size(3)](http://man7.org/linux/man-pages/man3/malloc_usable_size.3.html)
* returns the actual size of the given heap block.
- *
- * Available since API level 17.
*/
-size_t malloc_usable_size(const void* _Nullable __ptr) __INTRODUCED_IN(17);
+size_t malloc_usable_size(const void* _Nullable __ptr);
#define __MALLINFO_BODY \
/** Total number of non-mmapped bytes currently allocated from OS. */ \
@@ -320,6 +335,16 @@
};
/**
+ * mallopt() option to print human readable statistics about the memory
+ * allocator to the log. There is no format for this data, each allocator
+ * can use a different format, and the data that is printed can
+ * change at any time. This is expected to be used as a debugging aid.
+ *
+ * Available since API level 35.
+ */
+#define M_LOG_STATS (-205)
+
+/**
* [mallopt(3)](http://man7.org/linux/man-pages/man3/mallopt.3.html) modifies
* heap behavior. Values of `__option` are the `M_` constants from this header.
*
diff --git a/libc/include/math.h b/libc/include/math.h
index a5fa7c3..fc6c228 100644
--- a/libc/include/math.h
+++ b/libc/include/math.h
@@ -75,232 +75,231 @@
double acos(double __x);
float acosf(float __x);
-long double acosl(long double __x) __RENAME_LDBL(acos, 3, 21);
+long double acosl(long double __x);
double asin(double __x);
float asinf(float __x);
-long double asinl(long double __x) __RENAME_LDBL(asin, 3, 21);
+long double asinl(long double __x);
double atan(double __x);
float atanf(float __x);
-long double atanl(long double __x) __RENAME_LDBL(atan, 3, 21);
+long double atanl(long double __x);
double atan2(double __y, double __x);
float atan2f(float __y, float __x);
-long double atan2l(long double __y, long double __x) __RENAME_LDBL(atan2, 3, 21);
+long double atan2l(long double __y, long double __x);
double cos(double __x);
float cosf(float __x);
-long double cosl(long double __x) __RENAME_LDBL(cos, 3, 21);
+long double cosl(long double __x);
double sin(double __x);
float sinf(float __x);
-long double sinl(long double __x) __RENAME_LDBL(sin, 3, 21);
+long double sinl(long double __x);
double tan(double __x);
float tanf(float __x);
-long double tanl(long double __x) __RENAME_LDBL(tan, 3, 21);
+long double tanl(long double __x);
double acosh(double __x);
float acoshf(float __x);
-long double acoshl(long double __x) __RENAME_LDBL(acosh, 3, 21);
+long double acoshl(long double __x);
double asinh(double __x);
float asinhf(float __x);
-long double asinhl(long double __x) __RENAME_LDBL(asinh, 3, 21);
+long double asinhl(long double __x);
double atanh(double __x);
float atanhf(float __x);
-long double atanhl(long double __x) __RENAME_LDBL(atanh, 3, 21);
+long double atanhl(long double __x);
double cosh(double __x);
float coshf(float __x);
-long double coshl(long double __x) __RENAME_LDBL(cosh, 3, 21);
+long double coshl(long double __x);
double sinh(double __x);
float sinhf(float __x);
-long double sinhl(long double __x) __RENAME_LDBL(sinh, 3, 21);
+long double sinhl(long double __x);
double tanh(double __x);
float tanhf(float __x);
-long double tanhl(long double __x) __RENAME_LDBL(tanh, 3, 21);
+long double tanhl(long double __x);
double exp(double __x);
float expf(float __x);
-long double expl(long double __x) __RENAME_LDBL(exp, 3, 21);
+long double expl(long double __x);
double exp2(double __x);
float exp2f(float __x);
-long double exp2l(long double __x) __RENAME_LDBL(exp2, 3, 21);
+long double exp2l(long double __x);
double expm1(double __x);
float expm1f(float __x);
-long double expm1l(long double __x) __RENAME_LDBL(expm1, 3, 21);
+long double expm1l(long double __x);
double frexp(double __x, int* _Nonnull __exponent);
float frexpf(float __x, int* _Nonnull __exponent);
-long double frexpl(long double __x, int* _Nonnull __exponent) __RENAME_LDBL(frexp, 3, 21);
+long double frexpl(long double __x, int* _Nonnull __exponent);
int ilogb(double __x) __attribute_const__;
int ilogbf(float __x) __attribute_const__;
-int ilogbl(long double __x) __RENAME_LDBL(ilogb, 3, 3) __attribute_const__;
+int ilogbl(long double __x) __attribute_const__;
double ldexp(double __x, int __exponent);
float ldexpf(float __x, int __exponent);
-long double ldexpl(long double __x, int __exponent) __RENAME_LDBL(ldexp, 3, 3);
+long double ldexpl(long double __x, int __exponent);
double log(double __x);
float logf(float __x);
-long double logl(long double __x) __RENAME_LDBL(log, 3, 21);
+long double logl(long double __x);
double log10(double __x);
float log10f(float __x);
-long double log10l(long double __x) __RENAME_LDBL(log10, 3, 21);
+long double log10l(long double __x);
double log1p(double __x);
float log1pf(float __x);
-long double log1pl(long double __x) __RENAME_LDBL(log1p, 3, 21);
+long double log1pl(long double __x);
-double log2(double __x) __INTRODUCED_IN(18);
-float log2f(float __x) __INTRODUCED_IN(18);
-long double log2l(long double __x) __RENAME_LDBL(log2, 18, 18);
+double log2(double __x);
+float log2f(float __x);
+long double log2l(long double __x);
double logb(double __x);
float logbf(float __x);
-long double logbl(long double __x) __RENAME_LDBL(logb, 3, 18);
+long double logbl(long double __x);
double modf(double __x, double* _Nonnull __integral_part);
float modff(float __x, float* _Nonnull __integral_part);
-long double modfl(long double __x, long double* _Nonnull __integral_part) __RENAME_LDBL(modf, 3, 21);
+long double modfl(long double __x, long double* _Nonnull __integral_part);
double scalbn(double __x, int __exponent);
float scalbnf(float __x, int __exponent);
-long double scalbnl(long double __x, int __exponent) __RENAME_LDBL(scalbn, 3, 3);
+long double scalbnl(long double __x, int __exponent);
-/* TODO: once the NDK only supports >= 18, use __RENAME_LDBL here too. */
-double scalbln(double __x, long __exponent) __INTRODUCED_IN_X86_NO_GUARD_FOR_NDK(18);
-float scalblnf(float __x, long __exponent) __INTRODUCED_IN_X86_NO_GUARD_FOR_NDK(18);
-long double scalblnl(long double __x, long __exponent) __INTRODUCED_IN_X86_NO_GUARD_FOR_NDK(18);
+double scalbln(double __x, long __exponent);
+float scalblnf(float __x, long __exponent);
+long double scalblnl(long double __x, long __exponent);
double cbrt(double __x);
float cbrtf(float __x);
-long double cbrtl(long double __x) __RENAME_LDBL(cbrt, 3, 21);
+long double cbrtl(long double __x);
double fabs(double __x) __attribute_const__;
float fabsf(float __x) __attribute_const__;
-long double fabsl(long double __x) __RENAME_LDBL(fabs, 3, 3) __attribute_const__;
+long double fabsl(long double __x) __attribute_const__;
double hypot(double __x, double __y);
float hypotf(float __x, float __y);
-long double hypotl(long double __x, long double __y) __RENAME_LDBL(hypot, 3, 21);
+long double hypotl(long double __x, long double __y);
double pow(double __x, double __y);
float powf(float __x, float __y);
-long double powl(long double __x, long double __y) __RENAME_LDBL(pow, 3, 21);
+long double powl(long double __x, long double __y);
double sqrt(double __x);
float sqrtf(float __x);
-long double sqrtl(long double __x) __RENAME_LDBL(sqrt, 3, 21);
+long double sqrtl(long double __x);
double erf(double __x);
float erff(float __x);
-long double erfl(long double __x) __RENAME_LDBL(erf, 3, 21);
+long double erfl(long double __x);
double erfc(double __x);
float erfcf(float __x);
-long double erfcl(long double __x) __RENAME_LDBL(erfc, 3, 21);
+long double erfcl(long double __x);
double lgamma(double __x);
float lgammaf(float __x);
-long double lgammal(long double __x) __RENAME_LDBL(lgamma, 3, 21);
+long double lgammal(long double __x);
double tgamma(double __x);
float tgammaf(float __x);
-long double tgammal(long double __x) __RENAME_LDBL(tgamma, 3, 21);
+long double tgammal(long double __x);
double ceil(double __x);
float ceilf(float __x);
-long double ceill(long double __x) __RENAME_LDBL(ceil, 3, 3);
+long double ceill(long double __x);
double floor(double __x);
float floorf(float __x);
-long double floorl(long double __x) __RENAME_LDBL(floor, 3, 3);
+long double floorl(long double __x);
double nearbyint(double __x);
float nearbyintf(float __x);
-long double nearbyintl(long double __x) __RENAME_LDBL(nearbyint, 3, 21);
+long double nearbyintl(long double __x);
double rint(double __x);
float rintf(float __x);
-long double rintl(long double __x) __RENAME_LDBL(rint, 3, 21);
+long double rintl(long double __x);
long lrint(double __x);
long lrintf(float __x);
-long lrintl(long double __x) __RENAME_LDBL(lrint, 3, 21);
+long lrintl(long double __x);
long long llrint(double __x);
long long llrintf(float __x);
-long long llrintl(long double __x) __RENAME_LDBL(llrint, 3, 21);
+long long llrintl(long double __x);
double round(double __x);
float roundf(float __x);
-long double roundl(long double __x) __RENAME_LDBL(roundl, 3, 3);
+long double roundl(long double __x);
long lround(double __x);
long lroundf(float __x);
-long lroundl(long double __x) __RENAME_LDBL(lround, 3, 3);
+long lroundl(long double __x);
long long llround(double __x);
long long llroundf(float __x);
-long long llroundl(long double __x) __RENAME_LDBL(llround, 3, 3);
+long long llroundl(long double __x);
double trunc(double __x);
float truncf(float __x);
-long double truncl(long double __x) __RENAME_LDBL(trunc, 3, 3);
+long double truncl(long double __x);
double fmod(double __x, double __y);
float fmodf(float __x, float __y);
-long double fmodl(long double __x, long double __y) __RENAME_LDBL(fmod, 3, 21);
+long double fmodl(long double __x, long double __y);
double remainder(double __x, double __y);
float remainderf(float __x, float __y);
-long double remainderl(long double __x, long double __y) __RENAME_LDBL(remainder, 3, 21);
+long double remainderl(long double __x, long double __y);
double remquo(double __x, double __y, int* _Nonnull __quotient_bits);
float remquof(float __x, float __y, int* _Nonnull __quotient_bits);
-long double remquol(long double __x, long double __y, int* _Nonnull __quotient_bits) __RENAME_LDBL(remquo, 3, 21);
+long double remquol(long double __x, long double __y, int* _Nonnull __quotient_bits);
double copysign(double __value, double __sign) __attribute_const__;
float copysignf(float __value, float __sign) __attribute_const__;
-long double copysignl(long double __value, long double __sign) __RENAME_LDBL(copysign, 3, 3) __attribute_const__;
+long double copysignl(long double __value, long double __sign) __attribute_const__;
double nan(const char* _Nonnull __kind) __attribute_const__;
float nanf(const char* _Nonnull __kind) __attribute_const__;
-long double nanl(const char* _Nonnull __kind) __RENAME_LDBL(nan, 13, 13) __attribute_const__;
+long double nanl(const char* _Nonnull __kind) __attribute_const__;
double nextafter(double __x, double __y);
float nextafterf(float __x, float __y);
-long double nextafterl(long double __x, long double __y) __RENAME_LDBL_NO_GUARD_FOR_NDK(nextafter, 3, 21);
+long double nextafterl(long double __x, long double __y);
-double nexttoward(double __x, long double __y) __INTRODUCED_IN_NO_GUARD_FOR_NDK(18);
+double nexttoward(double __x, long double __y);
float nexttowardf(float __x, long double __y);
-long double nexttowardl(long double __x, long double __y) __RENAME_LDBL_NO_GUARD_FOR_NDK(nexttoward, 18, 18);
+long double nexttowardl(long double __x, long double __y);
double fdim(double __x, double __y);
float fdimf(float __x, float __y);
-long double fdiml(long double __x, long double __y) __RENAME_LDBL(fdim, 3, 3);
+long double fdiml(long double __x, long double __y);
double fmax(double __x, double __y) __attribute_const__;
float fmaxf(float __x, float __y) __attribute_const__;
-long double fmaxl(long double __x, long double __y) __RENAME_LDBL(fmax, 3, 3) __attribute_const__;
+long double fmaxl(long double __x, long double __y) __attribute_const__;
double fmin(double __x, double __y) __attribute_const__;
float fminf(float __x, float __y) __attribute_const__;
-long double fminl(long double __x, long double __y) __RENAME_LDBL(fmin, 3, 3) __attribute_const__;
+long double fminl(long double __x, long double __y) __attribute_const__;
double fma(double __x, double __y, double __z);
float fmaf(float __x, float __y, float __z);
-long double fmal(long double __x, long double __y, long double __z) __RENAME_LDBL_NO_GUARD_FOR_NDK(fma, 3, 21);
+long double fmal(long double __x, long double __y, long double __z);
#define isgreater(x, y) __builtin_isgreater((x), (y))
#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y))
@@ -320,7 +319,7 @@
* to the std namespace, making it impossible to use both <cmath> (which gets
* included by a lot of other standard headers) and ::isnan.
*/
-int (isinf)(double __x) __attribute_const__ __INTRODUCED_IN(21);
+int (isinf)(double __x) __attribute_const__;
int (isnan)(double __x) __attribute_const__;
/* POSIX extensions. */
@@ -368,7 +367,7 @@
double lgamma_r(double __x, int* _Nonnull __sign);
double significand(double __x);
long double lgammal_r(long double __x, int* _Nonnull __sign) __INTRODUCED_IN(23);
-long double significandl(long double __x) __INTRODUCED_IN(21);
+long double significandl(long double __x);
float dremf(float __x, float __y);
int finitef(float __x) __attribute_const__;
float gammaf(float __x);
diff --git a/libc/include/mntent.h b/libc/include/mntent.h
index 43cab1f..9a31838 100644
--- a/libc/include/mntent.h
+++ b/libc/include/mntent.h
@@ -57,10 +57,10 @@
__BEGIN_DECLS
-int endmntent(FILE* _Nullable __fp) __INTRODUCED_IN(21);
+int endmntent(FILE* _Nullable __fp);
struct mntent* _Nullable getmntent(FILE* _Nonnull __fp);
-struct mntent* _Nullable getmntent_r(FILE* _Nonnull __fp, struct mntent* _Nonnull __entry, char* _Nonnull __buf, int __size) __INTRODUCED_IN(21);
-FILE* _Nullable setmntent(const char* _Nonnull __filename, const char* _Nonnull __type) __INTRODUCED_IN(21);
+struct mntent* _Nullable getmntent_r(FILE* _Nonnull __fp, struct mntent* _Nonnull __entry, char* _Nonnull __buf, int __size);
+FILE* _Nullable setmntent(const char* _Nonnull __filename, const char* _Nonnull __type);
char* _Nullable hasmntopt(const struct mntent* _Nonnull __entry, const char* _Nonnull __option) __INTRODUCED_IN(26);
__END_DECLS
diff --git a/libc/include/net/if.h b/libc/include/net/if.h
index f261f71..79b4195 100644
--- a/libc/include/net/if.h
+++ b/libc/include/net/if.h
@@ -41,13 +41,13 @@
struct if_nameindex {
unsigned if_index;
- char* if_name;
+ char* _Nullable if_name;
};
-char* if_indextoname(unsigned __index, char* __buf);
-unsigned if_nametoindex(const char* __name);
-struct if_nameindex* if_nameindex(void) __INTRODUCED_IN(24);
-void if_freenameindex(struct if_nameindex* __ptr) __INTRODUCED_IN(24);
+char* _Nullable if_indextoname(unsigned __index, char* _Nonnull __buf);
+unsigned if_nametoindex(const char* _Nonnull __name);
+struct if_nameindex* _Nullable if_nameindex(void) __INTRODUCED_IN(24);
+void if_freenameindex(struct if_nameindex* _Nullable __ptr) __INTRODUCED_IN(24);
__END_DECLS
diff --git a/libc/include/netdb.h b/libc/include/netdb.h
index 7a1987e..88214d5 100644
--- a/libc/include/netdb.h
+++ b/libc/include/netdb.h
@@ -78,6 +78,8 @@
* supplied in host order, and returned in network order (suitable for
* use in system calls).
*/
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnullability-completeness"
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
@@ -98,7 +100,7 @@
char *s_name; /* official service name */
char **s_aliases; /* alias list */
int s_port; /* port # */
- char *s_proto; /* protocol to use */
+ char * _Nullable s_proto; /* protocol to use */
};
struct protoent {
@@ -117,6 +119,7 @@
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
+#pragma clang diagnostic pop
/*
* Error return codes from gethostbyname() and gethostbyaddr()
@@ -196,47 +199,47 @@
__BEGIN_DECLS
-int getaddrinfo(const char* __node, const char* __service, const struct addrinfo* __hints, struct addrinfo** __result);
-void freeaddrinfo(struct addrinfo* __ptr);
+int getaddrinfo(const char* _Nullable __node, const char* _Nullable __service, const struct addrinfo* _Nullable __hints, struct addrinfo* _Nullable * _Nonnull __result);
+void freeaddrinfo(struct addrinfo* _Nullable __ptr);
/* Android ABI error: POSIX getnameinfo(3) uses socklen_t rather than size_t. */
-int getnameinfo(const struct sockaddr* __sa, socklen_t __sa_length, char* __host, size_t __host_length, char* __service, size_t __service_length, int __flags);
-const char* gai_strerror(int __error);
+int getnameinfo(const struct sockaddr* _Nonnull __sa, socklen_t __sa_length, char* _Nullable __host, size_t __host_length, char* _Nullable __service, size_t __service_length, int __flags);
+const char* _Nonnull gai_strerror(int __error);
/* These functions are obsolete. Use getaddrinfo/getnameinfo instead. */
#define h_errno (*__get_h_errno())
-int* __get_h_errno(void);
-void herror(const char* __s);
-const char* hstrerror(int __error);
-struct hostent* gethostbyaddr(const void* __addr, socklen_t __length, int __type);
-int gethostbyaddr_r(const void* __addr, socklen_t __length, int __type, struct hostent* __ret, char* __buf, size_t __buf_size, struct hostent** __result, int* __h_errno_ptr) __INTRODUCED_IN(23);
-struct hostent* gethostbyname(const char* __name);
-int gethostbyname_r(const char* __name, struct hostent* __ret, char* __buf, size_t __buf_size, struct hostent** __result, int* __h_errno_ptr);
-struct hostent* gethostbyname2(const char* __name, int __af);
-int gethostbyname2_r(const char* __name, int __af, struct hostent* __ret, char* __buf, size_t __buf_size, struct hostent** __result, int* __h_errno_ptr) __INTRODUCED_IN(23);
+int* _Nonnull __get_h_errno(void);
+void herror(const char* _Nonnull __s);
+const char* _Nonnull hstrerror(int __error);
+struct hostent* _Nullable gethostbyaddr(const void* _Nonnull __addr, socklen_t __length, int __type);
+int gethostbyaddr_r(const void* _Nonnull __addr, socklen_t __length, int __type, struct hostent* _Nonnull __ret, char* _Nonnull __buf, size_t __buf_size, struct hostent* _Nullable * _Nonnull __result, int* _Nonnull __h_errno_ptr) __INTRODUCED_IN(23);
+struct hostent* _Nullable gethostbyname(const char* _Nonnull __name);
+int gethostbyname_r(const char* _Nonnull __name, struct hostent* _Nonnull __ret, char* _Nonnull __buf, size_t __buf_size, struct hostent* _Nullable * _Nonnull __result, int* _Nonnull __h_errno_ptr);
+struct hostent* _Nullable gethostbyname2(const char* _Nonnull __name, int __af);
+int gethostbyname2_r(const char* _Nonnull __name, int __af, struct hostent* _Nonnull __ret, char* _Nonnull __buf, size_t __buf_size, struct hostent* _Nullable * _Nonnull __result, int* _Nonnull __h_errno_ptr) __INTRODUCED_IN(23);
void endhostent(void) __INTRODUCED_IN(28);
-struct hostent* gethostent(void);
+struct hostent* _Nullable gethostent(void);
void sethostent(int __stay_open) __INTRODUCED_IN(28);
/* These functions are obsolete. None of these functions return anything but nullptr. */
void endnetent(void) __INTRODUCED_IN(28);
-struct netent* getnetbyaddr(uint32_t __net, int __type);
-struct netent* getnetbyname(const char* __name);
-struct netent* getnetent(void) __INTRODUCED_IN(28);
+struct netent* _Nullable getnetbyaddr(uint32_t __net, int __type);
+struct netent* _Nullable getnetbyname(const char* _Nonnull __name);
+struct netent* _Nullable getnetent(void) __INTRODUCED_IN(28);
void setnetent(int __stay_open) __INTRODUCED_IN(28);
/* None of these functions return anything but nullptr. */
void endprotoent(void) __INTRODUCED_IN(28);
-struct protoent* getprotobyname(const char* __name);
-struct protoent* getprotobynumber(int __proto);
-struct protoent* getprotoent(void) __INTRODUCED_IN(28);
+struct protoent* _Nullable getprotobyname(const char* _Nonnull __name);
+struct protoent* _Nullable getprotobynumber(int __proto);
+struct protoent* _Nullable getprotoent(void) __INTRODUCED_IN(28);
void setprotoent(int __stay_open) __INTRODUCED_IN(28);
/* These functions return entries from a built-in database. */
void endservent(void);
-struct servent* getservbyname(const char* __name, const char* __proto);
-struct servent* getservbyport(int __port_in_network_order, const char* __proto);
-struct servent* getservent(void);
+struct servent* _Nullable getservbyname(const char* _Nonnull __name, const char* _Nullable __proto);
+struct servent* _Nullable getservbyport(int __port_in_network_order, const char* _Nullable __proto);
+struct servent* _Nullable getservent(void);
void setservent(int __stay_open);
__END_DECLS
diff --git a/libc/include/poll.h b/libc/include/poll.h
index e3a9039..6bdc886 100644
--- a/libc/include/poll.h
+++ b/libc/include/poll.h
@@ -58,10 +58,8 @@
*
* Returns the number of ready file descriptors on success, 0 for timeout,
* and returns -1 and sets `errno` on failure.
- *
- * Available since API level 28.
*/
-int ppoll(struct pollfd* _Nullable __fds, nfds_t __count, const struct timespec* _Nullable __timeout, const sigset_t* _Nullable __mask) __INTRODUCED_IN(21);
+int ppoll(struct pollfd* _Nullable __fds, nfds_t __count, const struct timespec* _Nullable __timeout, const sigset_t* _Nullable __mask);
/**
* Like ppoll() but allows setting a signal mask with RT signals even from a 32-bit process.
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index 98695eb..4feade5 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -34,6 +34,7 @@
*/
#include <limits.h>
+#include <bits/page_size.h>
#include <bits/pthread_types.h>
#include <sched.h>
#include <sys/cdefs.h>
@@ -73,9 +74,14 @@
#define PTHREAD_BARRIER_SERIAL_THREAD (-1)
#endif
+
#if defined(__LP64__)
+#if defined(PAGE_SIZE)
#define PTHREAD_STACK_MIN (4 * PAGE_SIZE)
#else
+#define PTHREAD_STACK_MIN 65536
+#endif
+#else
#define PTHREAD_STACK_MIN (2 * PAGE_SIZE)
#endif
@@ -116,10 +122,10 @@
int pthread_attr_setstacksize(pthread_attr_t* _Nonnull __addr, size_t __size);
int pthread_condattr_destroy(pthread_condattr_t* _Nonnull __attr);
-int pthread_condattr_getclock(const pthread_condattr_t* _Nonnull __attr, clockid_t* _Nonnull __clock) __INTRODUCED_IN(21);
+int pthread_condattr_getclock(const pthread_condattr_t* _Nonnull __attr, clockid_t* _Nonnull __clock);
int pthread_condattr_getpshared(const pthread_condattr_t* _Nonnull __attr, int* _Nonnull __shared);
int pthread_condattr_init(pthread_condattr_t* _Nonnull __attr);
-int pthread_condattr_setclock(pthread_condattr_t* _Nonnull __attr, clockid_t __clock) __INTRODUCED_IN(21);
+int pthread_condattr_setclock(pthread_condattr_t* _Nonnull __attr, clockid_t __clock);
int pthread_condattr_setpshared(pthread_condattr_t* _Nonnull __attr, int __shared);
int pthread_cond_broadcast(pthread_cond_t* _Nonnull __cond);
@@ -169,7 +175,7 @@
void* _Nullable pthread_getspecific(pthread_key_t __key);
-pid_t pthread_gettid_np(pthread_t __pthread) __INTRODUCED_IN(21);
+pid_t pthread_gettid_np(pthread_t __pthread);
int pthread_join(pthread_t __pthread, void* _Nullable * _Nullable __return_value_ptr);
@@ -190,8 +196,7 @@
int pthread_mutex_destroy(pthread_mutex_t* _Nonnull __mutex);
int pthread_mutex_init(pthread_mutex_t* _Nonnull __mutex, const pthread_mutexattr_t* _Nullable __attr);
int pthread_mutex_lock(pthread_mutex_t* _Nonnull __mutex);
-int pthread_mutex_timedlock(pthread_mutex_t* _Nonnull __mutex, const struct timespec* _Nullable __timeout)
- __INTRODUCED_IN(21);
+int pthread_mutex_timedlock(pthread_mutex_t* _Nonnull __mutex, const struct timespec* _Nullable __timeout);
/*
* POSIX historically only supported using pthread_mutex_timedlock() with CLOCK_REALTIME, however
diff --git a/libc/include/sched.h b/libc/include/sched.h
index 26bc742..b1f1842 100644
--- a/libc/include/sched.h
+++ b/libc/include/sched.h
@@ -172,27 +172,23 @@
* Returns the pid of the child to the caller on success and
* returns -1 and sets `errno` on failure.
*/
-int clone(int (* __BIONIC_COMPLICATED_NULLNESS __fn)(void* __BIONIC_COMPLICATED_NULLNESS ), void* __BIONIC_COMPLICATED_NULLNESS __child_stack, int __flags, void* _Nullable __arg, ...) __INTRODUCED_IN_ARM(9) __INTRODUCED_IN_X86(17);
+int clone(int (* __BIONIC_COMPLICATED_NULLNESS __fn)(void* __BIONIC_COMPLICATED_NULLNESS ), void* __BIONIC_COMPLICATED_NULLNESS __child_stack, int __flags, void* _Nullable __arg, ...);
/**
* [unshare(2)](http://man7.org/linux/man-pages/man2/unshare.2.html)
* disassociates part of the caller's execution context.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
- *
- * Available since API level 17.
*/
-int unshare(int __flags) __INTRODUCED_IN(17);
+int unshare(int __flags);
/**
* [setns(2)](http://man7.org/linux/man-pages/man2/setns.2.html)
* reassociates a thread with a different namespace.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
- *
- * Available since API level 21.
*/
-int setns(int __fd, int __ns_type) __INTRODUCED_IN(21);
+int setns(int __fd, int __ns_type);
/**
* [sched_getcpu(3)](http://man7.org/linux/man-pages/man3/sched_getcpu.3.html)
diff --git a/libc/include/search.h b/libc/include/search.h
index 00deef1..fe897d1 100644
--- a/libc/include/search.h
+++ b/libc/include/search.h
@@ -66,18 +66,14 @@
/**
* [insque(3)](http://man7.org/linux/man-pages/man3/insque.3.html) inserts
* an item in a queue (an intrusive doubly-linked list).
- *
- * Available since API level 21.
*/
-void insque(void* _Nonnull __element, void* _Nullable __previous) __INTRODUCED_IN(21);
+void insque(void* _Nonnull __element, void* _Nullable __previous);
/**
* [remque(3)](http://man7.org/linux/man-pages/man3/remque.3.html) removes
* an item from a queue (an intrusive doubly-linked list).
- *
- * Available since API level 21.
*/
-void remque(void* _Nonnull __element) __INTRODUCED_IN(21);
+void remque(void* _Nonnull __element);
/**
* [hcreate(3)](http://man7.org/linux/man-pages/man3/hcreate.3.html)
@@ -155,10 +151,8 @@
* See bsearch() if you have a sorted array.
*
* Returns a pointer to the matching element on success, or NULL on failure.
- *
- * Available since API level 21.
*/
-void* _Nullable lfind(const void* _Nonnull __key, const void* _Nonnull __array, size_t* _Nonnull __count, size_t __size, int (* _Nonnull __comparator)(const void* _Nonnull, const void* _Nonnull)) __INTRODUCED_IN(21);
+void* _Nullable lfind(const void* _Nonnull __key, const void* _Nonnull __array, size_t* _Nonnull __count, size_t __size, int (* _Nonnull __comparator)(const void* _Nonnull, const void* _Nonnull));
/**
* [lsearch(3)](http://man7.org/linux/man-pages/man3/lsearch.3.html) brute-force
@@ -170,10 +164,8 @@
*
* Returns a pointer to the matching element on success, or to the newly-added
* element on failure.
- *
- * Available since API level 21.
*/
-void* _Nonnull lsearch(const void* _Nonnull __key, void* _Nonnull __array, size_t* _Nonnull __count, size_t __size, int (* _Nonnull __comparator)(const void* _Nonnull, const void* _Nonnull)) __INTRODUCED_IN(21);
+void* _Nonnull lsearch(const void* _Nonnull __key, void* _Nonnull __array, size_t* _Nonnull __count, size_t __size, int (* _Nonnull __comparator)(const void* _Nonnull, const void* _Nonnull));
/**
* [tdelete(3)](http://man7.org/linux/man-pages/man3/tdelete.3.html) searches
@@ -214,6 +206,6 @@
* [twalk(3)](http://man7.org/linux/man-pages/man3/twalk.3.html) calls
* `__visitor` on every node in the tree.
*/
-void twalk(const void* _Nullable __root, void (* _Nullable __visitor)(const void* _Nullable, VISIT, int)) __INTRODUCED_IN(21);
+void twalk(const void* _Nullable __root, void (* _Nullable __visitor)(const void* _Nullable, VISIT, int));
__END_DECLS
diff --git a/libc/include/setjmp.h b/libc/include/setjmp.h
index 6d047ae..0aaaac5 100644
--- a/libc/include/setjmp.h
+++ b/libc/include/setjmp.h
@@ -66,12 +66,14 @@
/**
* The size in words of a riscv64 jmp_buf. Room for callee-saved registers,
* including floating point, stack pointer and program counter, various
- * internal implementation details, and leaving some free space.
+ * internal implementation details, and leaving lots of free space.
*
- * Coincidentally matches OpenBSD, though they also save/restore the
- * floating point status register too.
+ * Deliberately very large given the uncertainty around the final form of
+ * hardware shadow stack, and the fact that x86-64 glibc needed to steal
+ * space from their enormous sigset_t (which we don't have) to be able to
+ * implement the CET shadow stack.
*/
-#define _JBLEN 32
+#define _JBLEN 64
#elif defined(__x86_64__)
/** The size in words of an x86-64 jmp_buf. Inherited from OpenBSD. */
#define _JBLEN 11
diff --git a/libc/include/signal.h b/libc/include/signal.h
index b9aeaab..cf83db8 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -51,8 +51,8 @@
/* We take a few real-time signals for ourselves. May as well use the same names as glibc. */
#define SIGRTMIN (__libc_current_sigrtmin())
#define SIGRTMAX (__libc_current_sigrtmax())
-int __libc_current_sigrtmin(void) __INTRODUCED_IN(21);
-int __libc_current_sigrtmax(void) __INTRODUCED_IN(21);
+int __libc_current_sigrtmin(void);
+int __libc_current_sigrtmax(void);
extern const char* _Nonnull const sys_siglist[_NSIG];
extern const char* _Nonnull const sys_signame[_NSIG]; /* BSD compatibility. */
@@ -64,16 +64,16 @@
int siginterrupt(int __signal, int __flag);
-sighandler_t _Nonnull signal(int __signal, sighandler_t _Nullable __handler) __INTRODUCED_IN(21);
-int sigaddset(sigset_t* _Nonnull __set, int __signal) __INTRODUCED_IN(21);
+sighandler_t _Nonnull signal(int __signal, sighandler_t _Nullable __handler);
+int sigaddset(sigset_t* _Nonnull __set, int __signal);
int sigaddset64(sigset64_t* _Nonnull __set, int __signal) __INTRODUCED_IN(28);
-int sigdelset(sigset_t* _Nonnull __set, int __signal) __INTRODUCED_IN(21);
+int sigdelset(sigset_t* _Nonnull __set, int __signal);
int sigdelset64(sigset64_t* _Nonnull __set, int __signal) __INTRODUCED_IN(28);
-int sigemptyset(sigset_t* _Nonnull __set) __INTRODUCED_IN(21);
+int sigemptyset(sigset_t* _Nonnull __set);
int sigemptyset64(sigset64_t* _Nonnull __set) __INTRODUCED_IN(28);
-int sigfillset(sigset_t* _Nonnull __set) __INTRODUCED_IN(21);
+int sigfillset(sigset_t* _Nonnull __set);
int sigfillset64(sigset64_t* _Nonnull __set) __INTRODUCED_IN(28);
-int sigismember(const sigset_t* _Nonnull __set, int __signal) __INTRODUCED_IN(21);
+int sigismember(const sigset_t* _Nonnull __set, int __signal);
int sigismember64(const sigset64_t* _Nonnull __set, int __signal) __INTRODUCED_IN(28);
int sigpending(sigset_t* _Nonnull __set);
@@ -105,8 +105,8 @@
int sigaltstack(const stack_t* _Nullable __new_signal_stack, stack_t* _Nullable __old_signal_stack);
-void psiginfo(const siginfo_t* _Nonnull __info, const char* _Nullable __msg) __INTRODUCED_IN(17);
-void psignal(int __signal, const char* _Nullable __msg) __INTRODUCED_IN(17);
+void psiginfo(const siginfo_t* _Nonnull __info, const char* _Nullable __msg);
+void psignal(int __signal, const char* _Nullable __msg);
int pthread_kill(pthread_t __pthread, int __signal);
#if defined(__USE_GNU)
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index d7b65e4..2fc5b21 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -118,8 +118,8 @@
size_t fwrite(const void* _Nonnull __buf, size_t __size, size_t __count, FILE* _Nonnull __fp);
int getc(FILE* _Nonnull __fp);
int getchar(void);
-ssize_t getdelim(char* _Nullable * _Nonnull __line_ptr, size_t* _Nonnull __line_length_ptr, int __delimiter, FILE* _Nonnull __fp) __INTRODUCED_IN(18);
-ssize_t getline(char* _Nullable * _Nonnull __line_ptr, size_t* _Nonnull __line_length_ptr, FILE* _Nonnull __fp) __INTRODUCED_IN(18);
+ssize_t getdelim(char* _Nullable * _Nonnull __line_ptr, size_t* _Nonnull __line_length_ptr, int __delimiter, FILE* _Nonnull __fp);
+ssize_t getline(char* _Nullable * _Nonnull __line_ptr, size_t* _Nonnull __line_length_ptr, FILE* _Nonnull __fp);
void perror(const char* _Nullable __msg);
int printf(const char* _Nonnull __fmt, ...) __printflike(1, 2);
@@ -136,8 +136,8 @@
int vfprintf(FILE* _Nonnull __fp, const char* _Nonnull __fmt, va_list __args) __printflike(2, 0);
int vprintf(const char* _Nonnull __fp, va_list __args) __printflike(1, 0);
-int dprintf(int __fd, const char* _Nonnull __fmt, ...) __printflike(2, 3) __INTRODUCED_IN(21);
-int vdprintf(int __fd, const char* _Nonnull __fmt, va_list __args) __printflike(2, 0) __INTRODUCED_IN(21);
+int dprintf(int __fd, const char* _Nonnull __fmt, ...) __printflike(2, 3);
+int vdprintf(int __fd, const char* _Nonnull __fmt, va_list __args) __printflike(2, 0);
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ < 201112L) || \
(defined(__cplusplus) && __cplusplus <= 201103L)
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index 2bcb870..ef81c83 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -43,12 +43,12 @@
__noreturn void abort(void) __attribute__((__nomerge__));
__noreturn void exit(int __status);
-__noreturn void _Exit(int __status) __INTRODUCED_IN(21);
+__noreturn void _Exit(int __status);
int atexit(void (* _Nonnull __fn)(void));
-int at_quick_exit(void (* _Nonnull __fn)(void)) __INTRODUCED_IN(21);
-void quick_exit(int __status) __noreturn __INTRODUCED_IN(21);
+int at_quick_exit(void (* _Nonnull __fn)(void));
+void quick_exit(int __status) __noreturn;
char* _Nullable getenv(const char* _Nonnull __name);
int putenv(char* _Nonnull __assignment);
@@ -63,7 +63,7 @@
int mkostemp(char* _Nonnull __template, int __flags) __INTRODUCED_IN(23);
int mkostemps64(char* _Nonnull __template, int __suffix_length, int __flags) __INTRODUCED_IN(23);
int mkostemps(char* _Nonnull __template, int __suffix_length, int __flags) __INTRODUCED_IN(23);
-int mkstemp64(char* _Nonnull __template) __INTRODUCED_IN(21);
+int mkstemp64(char* _Nonnull __template);
int mkstemp(char* _Nonnull __template);
int mkstemps64(char* _Nonnull __template, int __flags) __INTRODUCED_IN(23);
int mkstemps(char* _Nonnull __template, int __flags);
@@ -73,12 +73,12 @@
unsigned long strtoul(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base);
unsigned long long strtoull(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base);
-int posix_memalign(void* _Nullable * _Nullable __memptr, size_t __alignment, size_t __size) __INTRODUCED_IN(17);
+int posix_memalign(void* _Nullable * _Nullable __memptr, size_t __alignment, size_t __size);
void* _Nullable aligned_alloc(size_t __alignment, size_t __size) __INTRODUCED_IN(28);
double strtod(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr);
-long double strtold(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr) __RENAME_LDBL(strtod, 3, 21);
+long double strtold(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr);
unsigned long strtoul_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l) __INTRODUCED_IN(26);
@@ -99,7 +99,7 @@
#define RAND_MAX 0x7fffffff
-int rand_r(unsigned int* _Nonnull __seed_ptr) __INTRODUCED_IN(21);
+int rand_r(unsigned int* _Nonnull __seed_ptr);
double drand48(void);
double erand48(unsigned short __xsubi[_Nonnull 3]);
@@ -111,11 +111,11 @@
unsigned short* _Nonnull seed48(unsigned short __seed16v[_Nonnull 3]);
void srand48(long __seed);
-char* _Nullable initstate(unsigned int __seed, char* _Nonnull __state, size_t __n) __INTRODUCED_IN(21);
-char* _Nullable setstate(char* _Nonnull __state) __INTRODUCED_IN(21);
+char* _Nullable initstate(unsigned int __seed, char* _Nonnull __state, size_t __n);
+char* _Nullable setstate(char* _Nonnull __state);
int getpt(void);
-int posix_openpt(int __flags) __INTRODUCED_IN(21);
+int posix_openpt(int __flags);
char* _Nullable ptsname(int __fd);
int ptsname_r(int __fd, char* _Nonnull __buf, size_t __n);
int unlockpt(int __fd);
@@ -153,38 +153,38 @@
int getloadavg(double __averages[_Nonnull], int __n) __INTRODUCED_IN(29);
/* BSD compatibility. */
-const char* _Nullable getprogname(void) __INTRODUCED_IN(21);
-void setprogname(const char* _Nonnull __name) __INTRODUCED_IN(21);
+const char* _Nullable getprogname(void);
+void setprogname(const char* _Nonnull __name);
int mblen(const char* _Nullable __s, size_t __n) __INTRODUCED_IN_NO_GUARD_FOR_NDK(26);
-size_t mbstowcs(wchar_t* _Nullable __dst, const char* _Nullable __src, size_t __n) __INTRODUCED_IN_NO_GUARD_FOR_NDK(21);
-int mbtowc(wchar_t* _Nullable __wc_ptr, const char* _Nullable __s, size_t __n) __INTRODUCED_IN_NO_GUARD_FOR_NDK(21);
-int wctomb(char* _Nullable __dst, wchar_t __wc) __INTRODUCED_IN_NO_GUARD_FOR_NDK(21);
+size_t mbstowcs(wchar_t* _Nullable __dst, const char* _Nullable __src, size_t __n);
+int mbtowc(wchar_t* _Nullable __wc_ptr, const char* _Nullable __s, size_t __n);
+int wctomb(char* _Nullable __dst, wchar_t __wc);
-size_t wcstombs(char* _Nullable __dst, const wchar_t* _Nullable __src, size_t __n) __INTRODUCED_IN_NO_GUARD_FOR_NDK(21);
+size_t wcstombs(char* _Nullable __dst, const wchar_t* _Nullable __src, size_t __n);
-size_t __ctype_get_mb_cur_max(void) __INTRODUCED_IN(21);
+size_t __ctype_get_mb_cur_max(void);
#define MB_CUR_MAX __ctype_get_mb_cur_max()
#if defined(__BIONIC_INCLUDE_FORTIFY_HEADERS)
#include <bits/fortify/stdlib.h>
#endif
-int abs(int __x) __attribute_const__ __INTRODUCED_IN(19);
-long labs(long __x) __attribute_const__ __INTRODUCED_IN(19);
-long long llabs(long long __x) __attribute_const__ __INTRODUCED_IN(19);
+int abs(int __x) __attribute_const__;
+long labs(long __x) __attribute_const__;
+long long llabs(long long __x) __attribute_const__;
-float strtof(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr) __INTRODUCED_IN(21);
-double atof(const char* _Nonnull __s) __attribute_pure__ __INTRODUCED_IN(21);
-int rand(void) __INTRODUCED_IN(21);
-void srand(unsigned int __seed) __INTRODUCED_IN(21);
-long random(void) __INTRODUCED_IN(21);
-void srandom(unsigned int __seed) __INTRODUCED_IN(21);
-int grantpt(int __fd) __INTRODUCED_IN(21);
+float strtof(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr);
+double atof(const char* _Nonnull __s) __attribute_pure__;
+int rand(void);
+void srand(unsigned int __seed);
+long random(void);
+void srandom(unsigned int __seed);
+int grantpt(int __fd);
-long long strtoll_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-unsigned long long strtoull_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-long double strtold_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, locale_t _Nonnull __l) __INTRODUCED_IN(21);
+long long strtoll_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l);
+unsigned long long strtoull_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l);
+long double strtold_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, locale_t _Nonnull __l);
#if __ANDROID_API__ >= 26
double strtod_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, locale_t _Nonnull __l) __INTRODUCED_IN(26);
diff --git a/libc/include/string.h b/libc/include/string.h
index d6b2967..e7fd9a5 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -76,7 +76,7 @@
void* _Nullable memmem(const void* _Nonnull __haystack, size_t __haystack_size, const void* _Nonnull __needle, size_t __needle_size) __attribute_pure__;
char* _Nullable strchr(const char* _Nonnull __s, int __ch) __attribute_pure__;
-char* _Nullable __strchr_chk(const char* _Nonnull __s, int __ch, size_t __n) __INTRODUCED_IN(18);
+char* _Nullable __strchr_chk(const char* _Nonnull __s, int __ch, size_t __n);
#if defined(__USE_GNU)
#if defined(__cplusplus)
extern "C++" char* _Nonnull strchrnul(char* _Nonnull __s, int __ch) __RENAME(strchrnul) __attribute_pure__ __INTRODUCED_IN(24);
@@ -87,13 +87,13 @@
#endif
char* _Nullable strrchr(const char* _Nonnull __s, int __ch) __attribute_pure__;
-char* _Nullable __strrchr_chk(const char* _Nonnull __s, int __ch, size_t __n) __INTRODUCED_IN(18);
+char* _Nullable __strrchr_chk(const char* _Nonnull __s, int __ch, size_t __n);
size_t strlen(const char* _Nonnull __s) __attribute_pure__;
-size_t __strlen_chk(const char* _Nonnull __s, size_t __n) __INTRODUCED_IN(17);
+size_t __strlen_chk(const char* _Nonnull __s, size_t __n);
int strcmp(const char* _Nonnull __lhs, const char* _Nonnull __rhs) __attribute_pure__;
-char* _Nonnull stpcpy(char* _Nonnull __dst, const char* _Nonnull __src) __INTRODUCED_IN(21);
+char* _Nonnull stpcpy(char* _Nonnull __dst, const char* _Nonnull __src);
char* _Nonnull strcpy(char* _Nonnull __dst, const char* _Nonnull __src);
char* _Nonnull strcat(char* _Nonnull __dst, const char* _Nonnull __src);
char* _Nullable strdup(const char* _Nonnull __s);
@@ -120,7 +120,7 @@
char* _Nonnull strncat(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n);
char* _Nullable strndup(const char* _Nonnull __s, size_t __n);
int strncmp(const char* _Nonnull __lhs, const char* _Nonnull __rhs, size_t __n) __attribute_pure__;
-char* _Nonnull stpncpy(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n) __INTRODUCED_IN(21);
+char* _Nonnull stpncpy(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n);
char* _Nonnull strncpy(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n);
size_t strlcat(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n);
@@ -136,8 +136,8 @@
int strcoll(const char* _Nonnull __lhs, const char* _Nonnull __rhs) __attribute_pure__;
size_t strxfrm(char* __BIONIC_COMPLICATED_NULLNESS __dst, const char* _Nonnull __src, size_t __n);
-int strcoll_l(const char* _Nonnull __lhs, const char* _Nonnull __rhs, locale_t _Nonnull __l) __attribute_pure__ __INTRODUCED_IN(21);
-size_t strxfrm_l(char* __BIONIC_COMPLICATED_NULLNESS __dst, const char* _Nonnull __src, size_t __n, locale_t _Nonnull __l) __INTRODUCED_IN(21);
+int strcoll_l(const char* _Nonnull __lhs, const char* _Nonnull __rhs, locale_t _Nonnull __l) __attribute_pure__;
+size_t strxfrm_l(char* __BIONIC_COMPLICATED_NULLNESS __dst, const char* _Nonnull __src, size_t __n, locale_t _Nonnull __l);
#if defined(__USE_GNU) && !defined(basename)
/*
diff --git a/libc/include/sys/_system_properties.h b/libc/include/sys/_system_properties.h
index 744a45b..943d4c6 100644
--- a/libc/include/sys/_system_properties.h
+++ b/libc/include/sys/_system_properties.h
@@ -61,7 +61,7 @@
** This was previously for testing, but now that SystemProperties is its own testable class,
** there is never a reason to call this function and its implementation simply returns -1.
*/
-int __system_property_set_filename(const char* __filename);
+int __system_property_set_filename(const char* __unused __filename);
/*
** Initialize the area to be used to store properties. Can
@@ -102,7 +102,7 @@
**
** Returns 0 on success, -1 if the property area is full.
*/
-int __system_property_add(const char* __name, unsigned int __name_length, const char* __value, unsigned int __value_length);
+int __system_property_add(const char* _Nonnull __name, unsigned int __name_length, const char* _Nonnull __value, unsigned int __value_length);
/* Update the value of a system property returned by
** __system_property_find. Can only be done by a single process
@@ -112,14 +112,14 @@
**
** Returns 0 on success, -1 if the parameters are incorrect.
*/
-int __system_property_update(prop_info* __pi, const char* __value, unsigned int __value_length);
+int __system_property_update(prop_info* _Nonnull __pi, const char* _Nonnull __value, unsigned int __value_length);
/* Read the serial number of a system property returned by
** __system_property_find.
**
** Returns the serial number on success, -1 on error.
*/
-uint32_t __system_property_serial(const prop_info* __pi);
+uint32_t __system_property_serial(const prop_info* _Nonnull __pi);
/* Initialize the system properties area in read only mode.
* Should be done by all processes that need to read system
diff --git a/libc/include/sys/auxv.h b/libc/include/sys/auxv.h
index bf70dda..b664e2a 100644
--- a/libc/include/sys/auxv.h
+++ b/libc/include/sys/auxv.h
@@ -45,9 +45,7 @@
*
* Returns the corresponding value on success,
* and returns 0 and sets `errno` to `ENOENT` on failure.
- *
- * Available since API level 18.
*/
-unsigned long int getauxval(unsigned long int __type) __INTRODUCED_IN(18);
+unsigned long int getauxval(unsigned long int __type);
__END_DECLS
diff --git a/libc/include/sys/cachectl.h b/libc/include/sys/cachectl.h
index 5ec295d..b5fabe3 100644
--- a/libc/include/sys/cachectl.h
+++ b/libc/include/sys/cachectl.h
@@ -28,6 +28,32 @@
#pragma once
+/*
+ * @file sys/cachectl.h
+ * @brief Architecture-specific cache control.
+ */
+
#include <sys/cdefs.h>
-/* This header file is obsolete. */
+__BEGIN_DECLS
+
+#if defined(__riscv)
+
+/**
+ * Flag for __riscv_flush_icache() to indicate that only the current
+ * thread's instruction cache needs to be flushed (rather than the
+ * default of all threads).
+ */
+#define SYS_RISCV_FLUSH_ICACHE_LOCAL 1UL
+
+/**
+ * __riscv_flush_icache(2) flushes the instruction cache for the given range of addresses.
+ * The address range is currently (Linux 6.4) ignored, so both pointers may be null.
+ *
+ * Returns 0 on success, and returns -1 and sets `errno` on failure.
+ */
+int __riscv_flush_icache(void* _Nullable __start, void* _Nullable __end, unsigned long __flags);
+
+#endif
+
+__END_DECLS
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index 484757e..4154e62 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -201,39 +201,6 @@
# define __RENAME_IF_FILE_OFFSET64(func)
#endif
-/*
- * For LP32, `long double` == `double`. Historically many `long double` functions were incorrect
- * on x86, missing on most architectures, and even if they are present and correct, linking to
- * them just bloats your ELF file by adding extra relocations. The __BIONIC_LP32_USE_LONG_DOUBLE
- * macro lets us test the headers both ways (and adds an escape valve).
- *
- * Note that some functions have their __RENAME_LDBL commented out as a sign that although we could
- * use __RENAME_LDBL it would actually cause the function to be introduced later because the
- * `long double` variant appeared before the `double` variant.
- *
- * The _NO_GUARD_FOR_NDK variants keep the __VERSIONER_NO_GUARD behavior working for the NDK. This
- * allows libc++ to refer to these functions in inlines without needing to guard them, needed since
- * libc++ doesn't currently guard these calls. There's no risk to the apps though because using
- * those APIs will still cause a link error.
- */
-#if defined(__LP64__) || defined(__BIONIC_LP32_USE_LONG_DOUBLE)
-#define __RENAME_LDBL(rewrite,rewrite_api_level,regular_api_level) __INTRODUCED_IN(regular_api_level)
-#define __RENAME_LDBL_NO_GUARD_FOR_NDK(rewrite,rewrite_api_level,regular_api_level) __INTRODUCED_IN_NO_GUARD_FOR_NDK(regular_api_level)
-#else
-#define __RENAME_LDBL(rewrite,rewrite_api_level,regular_api_level) __RENAME(rewrite) __INTRODUCED_IN(rewrite_api_level)
-#define __RENAME_LDBL_NO_GUARD_FOR_NDK(rewrite,rewrite_api_level,regular_api_level) __RENAME(rewrite) __INTRODUCED_IN_NO_GUARD_FOR_NDK(rewrite_api_level)
-#endif
-
-/*
- * On all architectures, `struct stat` == `struct stat64`, but LP32 didn't gain the *64 functions
- * until API level 21.
- */
-#if defined(__LP64__) || defined(__BIONIC_LP32_USE_STAT64)
-#define __RENAME_STAT64(rewrite,rewrite_api_level,regular_api_level) __INTRODUCED_IN(regular_api_level)
-#else
-#define __RENAME_STAT64(rewrite,rewrite_api_level,regular_api_level) __RENAME(rewrite) __INTRODUCED_IN(rewrite_api_level)
-#endif
-
/* glibc compatibility. */
#if defined(__LP64__)
#define __WORDSIZE 64
diff --git a/libc/include/sys/endian.h b/libc/include/sys/endian.h
index 9155b4c..1c7448c 100644
--- a/libc/include/sys/endian.h
+++ b/libc/include/sys/endian.h
@@ -49,10 +49,10 @@
/* glibc compatibility. */
__BEGIN_DECLS
-uint32_t htonl(uint32_t __x) __attribute_const__ __INTRODUCED_IN(21);
-uint16_t htons(uint16_t __x) __attribute_const__ __INTRODUCED_IN(21);
-uint32_t ntohl(uint32_t __x) __attribute_const__ __INTRODUCED_IN(21);
-uint16_t ntohs(uint16_t __x) __attribute_const__ __INTRODUCED_IN(21);
+uint32_t htonl(uint32_t __x) __attribute_const__;
+uint16_t htons(uint16_t __x) __attribute_const__;
+uint32_t ntohl(uint32_t __x) __attribute_const__;
+uint16_t ntohs(uint16_t __x) __attribute_const__;
__END_DECLS
#define htonl(x) __swap32(x)
diff --git a/libc/include/sys/epoll.h b/libc/include/sys/epoll.h
index 9e09408..2bad655 100644
--- a/libc/include/sys/epoll.h
+++ b/libc/include/sys/epoll.h
@@ -26,8 +26,12 @@
* SUCH DAMAGE.
*/
-#ifndef _SYS_EPOLL_H_
-#define _SYS_EPOLL_H_
+#pragma once
+
+/**
+ * @file sys/epoll.h
+ * @brief I/O event file descriptors.
+ */
#include <sys/cdefs.h>
#include <sys/types.h>
@@ -37,14 +41,67 @@
__BEGIN_DECLS
+/**
+ * [epoll_create(2)](http://man7.org/linux/man-pages/man2/epoll_create.2.html)
+ * creates a new [epoll](http://man7.org/linux/man-pages/man7/epoll.7.html)
+ * file descriptor.
+ *
+ * Returns a new file descriptor on success and returns -1 and sets `errno` on
+ * failure.
+ */
int epoll_create(int __size);
-int epoll_create1(int __flags) __INTRODUCED_IN(21);
+/**
+ * [epoll_create1(2)](http://man7.org/linux/man-pages/man2/epoll_create1.2.html)
+ * creates a new [epoll](http://man7.org/linux/man-pages/man7/epoll.7.html)
+ * file descriptor with the given flags.
+ *
+ * Returns a new file descriptor on success and returns -1 and sets `errno` on
+ * failure.
+ */
+int epoll_create1(int __flags);
+
+/**
+ * [epoll_ctl(2)](http://man7.org/linux/man-pages/man2/epoll_ctl.2.html)
+ * adds/modifies/removes file descriptors from the given epoll file descriptor.
+ *
+ * Returns 0 on success and returns -1 and sets `errno` on failure.
+ */
int epoll_ctl(int __epoll_fd, int __op, int __fd, struct epoll_event* __BIONIC_COMPLICATED_NULLNESS __event);
+
+/**
+ * [epoll_wait(2)](http://man7.org/linux/man-pages/man2/epoll_wait.2.html)
+ * waits for an event on the given epoll file descriptor.
+ *
+ * Returns the number of ready file descriptors on success, 0 on timeout,
+ * or -1 and sets `errno` on failure.
+ */
int epoll_wait(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, int __timeout_ms);
-int epoll_pwait(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, int __timeout_ms, const sigset_t* _Nullable __mask) __INTRODUCED_IN(21);
+
+/**
+ * Like epoll_wait() but atomically applying the given signal mask.
+ */
+int epoll_pwait(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, int __timeout_ms, const sigset_t* _Nullable __mask);
+
+/**
+ * Like epoll_pwait() but using a 64-bit signal mask even on 32-bit systems.
+ *
+ * Available since API level 28.
+ */
int epoll_pwait64(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, int __timeout_ms, const sigset64_t* _Nullable __mask) __INTRODUCED_IN(28);
-__END_DECLS
+/**
+ * Like epoll_pwait() but with a `struct timespec` timeout, for nanosecond resolution.
+ *
+ * Available since API level 35.
+ */
+int epoll_pwait2(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, const struct timespec* _Nullable __timeout, const sigset_t* _Nullable __mask) __INTRODUCED_IN(35);
-#endif
+/**
+ * Like epoll_pwait2() but using a 64-bit signal mask even on 32-bit systems.
+ *
+ * Available since API level 35.
+ */
+int epoll_pwait2_64(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, const struct timespec* _Nullable __timeout, const sigset64_t* _Nullable __mask) __INTRODUCED_IN(35);
+
+__END_DECLS
diff --git a/libc/include/sys/fsuid.h b/libc/include/sys/fsuid.h
index c1c8ebb..273749f 100644
--- a/libc/include/sys/fsuid.h
+++ b/libc/include/sys/fsuid.h
@@ -43,19 +43,15 @@
* filesystem checks.
*
* Returns the previous UID.
- *
- * Available since API level 21.
*/
-int setfsuid(uid_t __uid) __INTRODUCED_IN(21);
+int setfsuid(uid_t __uid);
/**
* [setfsgid(2)](http://man7.org/linux/man-pages/man2/setfsgid.2.html) sets the GID used for
* filesystem checks.
*
* Returns the previous GID.
- *
- * Available since API level 21.
*/
-int setfsgid(gid_t __gid) __INTRODUCED_IN(21);
+int setfsgid(gid_t __gid);
__END_DECLS
diff --git a/libc/include/sys/hwprobe.h b/libc/include/sys/hwprobe.h
new file mode 100644
index 0000000..b1a8400
--- /dev/null
+++ b/libc/include/sys/hwprobe.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+#if __riscv
+
+/**
+ * @file sys/hwprobe.h
+ * @brief RISC-V hardware probing.
+ */
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+/* Pull in struct riscv_hwprobe and corresponding constants. */
+#include <asm/hwprobe.h>
+
+__BEGIN_DECLS
+
+/**
+ * [__riscv_hwprobe(2)](https://docs.kernel.org/riscv/hwprobe.html)
+ * queries hardware characteristics.
+ *
+ * A `__cpu_count` of 0 and null `__cpus` means "all online cpus".
+ *
+ * Returns 0 on success and returns an error number on failure.
+ */
+int __riscv_hwprobe(struct riscv_hwprobe* _Nonnull __pairs, size_t __pair_count, size_t __cpu_count, unsigned long* _Nullable __cpus, unsigned __flags);
+
+__END_DECLS
+
+#endif
diff --git a/libc/include/sys/ifunc.h b/libc/include/sys/ifunc.h
index 7fbca4a..d35600e 100644
--- a/libc/include/sys/ifunc.h
+++ b/libc/include/sys/ifunc.h
@@ -40,13 +40,15 @@
#if defined(__aarch64__)
/**
- * Provides information about hardware capabilities to ifunc resolvers.
+ * Provides information about hardware capabilities to arm64 ifunc resolvers.
*
- * Starting with API level 30, ifunc resolvers on arm64 are passed two arguments. The first is a
- * uint64_t whose value is equal to getauxval(AT_HWCAP) | _IFUNC_ARG_HWCAP. The second is a pointer
- * to a data structure of this type. Prior to API level 30, no arguments are passed to ifunc
- * resolvers. Code that wishes to be compatible with prior API levels should not accept any
- * arguments in the resolver.
+ * Prior to API level 30, arm64 ifunc resolvers are passed no arguments.
+ *
+ * Starting with API level 30, arm64 ifunc resolvers are passed two arguments.
+ * The first is a uint64_t whose value is equal to getauxval(AT_HWCAP) | _IFUNC_ARG_HWCAP.
+ * The second is a pointer to a data structure of this type.
+ *
+ * Code that wishes to be compatible with API levels before 30 must call getauxval() itself.
*/
typedef struct __ifunc_arg_t {
/** Set to sizeof(__ifunc_arg_t). */
@@ -60,9 +62,14 @@
} __ifunc_arg_t;
/**
- * If this bit is set in the first argument to an ifunc resolver, indicates that the second argument
- * is a pointer to a data structure of type __ifunc_arg_t. This bit is always set on Android
- * starting with API level 30.
+ * If this bit is set in the first argument to an ifunc resolver, the second argument
+ * is a pointer to a data structure of type __ifunc_arg_t.
+ *
+ * This bit is always set on Android starting with API level 30.
+ * This bit is meaningless before API level 30 because ifunc resolvers are not passed any arguments.
+ * This bit has no real use on Android, but is included for glibc source compatibility;
+ * glibc used this bit to distinguish the case where the ifunc resolver received a single argument,
+ * which was an evolutionary stage Android never went through.
*/
#define _IFUNC_ARG_HWCAP (1ULL << 62)
diff --git a/libc/include/sys/inotify.h b/libc/include/sys/inotify.h
index e834d07..f070857 100644
--- a/libc/include/sys/inotify.h
+++ b/libc/include/sys/inotify.h
@@ -41,7 +41,7 @@
#define IN_NONBLOCK O_NONBLOCK
int inotify_init(void);
-int inotify_init1(int __flags) __INTRODUCED_IN(21);
+int inotify_init1(int __flags);
int inotify_add_watch(int __fd, const char* _Nonnull __path, uint32_t __mask);
int inotify_rm_watch(int __fd, uint32_t __watch_descriptor);
diff --git a/libc/include/sys/mman.h b/libc/include/sys/mman.h
index bcf856d..f32ae61 100644
--- a/libc/include/sys/mman.h
+++ b/libc/include/sys/mman.h
@@ -50,19 +50,17 @@
* and returns `MAP_FAILED` and sets `errno` on failure.
*/
#if defined(__USE_FILE_OFFSET64)
-void* mmap(void* __addr, size_t __size, int __prot, int __flags, int __fd, off_t __offset) __RENAME(mmap64);
+void* _Nonnull mmap(void* _Nullable __addr, size_t __size, int __prot, int __flags, int __fd, off_t __offset) __RENAME(mmap64);
#else
-void* mmap(void* __addr, size_t __size, int __prot, int __flags, int __fd, off_t __offset);
+void* _Nonnull mmap(void* _Nullable __addr, size_t __size, int __prot, int __flags, int __fd, off_t __offset);
#endif
/**
* mmap64() is a variant of mmap() that takes a 64-bit offset even on LP32.
*
* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md
- *
- * Available since API level 21.
*/
-void* mmap64(void* __addr, size_t __size, int __prot, int __flags, int __fd, off64_t __offset) __INTRODUCED_IN(21);
+void* _Nonnull mmap64(void* _Nullable __addr, size_t __size, int __prot, int __flags, int __fd, off64_t __offset);
/**
* [munmap(2)](http://man7.org/linux/man-pages/man2/munmap.2.html)
@@ -70,7 +68,7 @@
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int munmap(void* __addr, size_t __size);
+int munmap(void* _Nonnull __addr, size_t __size);
/**
* [msync(2)](http://man7.org/linux/man-pages/man2/msync.2.html)
@@ -78,7 +76,7 @@
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int msync(void* __addr, size_t __size, int __flags);
+int msync(void* _Nonnull __addr, size_t __size, int __flags);
/**
* [mprotect(2)](http://man7.org/linux/man-pages/man2/mprotect.2.html)
@@ -86,7 +84,7 @@
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int mprotect(void* __addr, size_t __size, int __prot);
+int mprotect(void* _Nonnull __addr, size_t __size, int __prot);
/** Flag for mremap(). */
#define MREMAP_MAYMOVE 1
@@ -101,27 +99,23 @@
* Returns the address of the mapping on success,
* and returns `MAP_FAILED` and sets `errno` on failure.
*/
-void* mremap(void* __old_addr, size_t __old_size, size_t __new_size, int __flags, ...);
+void* _Nonnull mremap(void* _Nonnull __old_addr, size_t __old_size, size_t __new_size, int __flags, ...);
/**
* [mlockall(2)](http://man7.org/linux/man-pages/man2/mlockall.2.html)
* locks pages (preventing swapping).
*
- * Available since API level 17.
- *
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int mlockall(int __flags) __INTRODUCED_IN(17);
+int mlockall(int __flags);
/**
* [munlockall(2)](http://man7.org/linux/man-pages/man2/munlockall.2.html)
* unlocks pages (allowing swapping).
*
- * Available since API level 17.
- *
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int munlockall(void) __INTRODUCED_IN(17);
+int munlockall(void);
/**
* [mlock(2)](http://man7.org/linux/man-pages/man2/mlock.2.html)
@@ -129,7 +123,7 @@
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int mlock(const void* __addr, size_t __size);
+int mlock(const void* _Nonnull __addr, size_t __size);
/**
* [mlock2(2)](http://man7.org/linux/man-pages/man2/mlock.2.html)
@@ -139,7 +133,7 @@
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int mlock2(const void* __addr, size_t __size, int __flags) __INTRODUCED_IN(30);
+int mlock2(const void* _Nonnull __addr, size_t __size, int __flags) __INTRODUCED_IN(30);
/**
* [munlock(2)](http://man7.org/linux/man-pages/man2/munlock.2.html)
@@ -147,7 +141,7 @@
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int munlock(const void* __addr, size_t __size);
+int munlock(const void* _Nonnull __addr, size_t __size);
/**
* [mincore(2)](http://man7.org/linux/man-pages/man2/mincore.2.html)
@@ -155,7 +149,7 @@
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int mincore(void* __addr, size_t __size, unsigned char* __vector);
+int mincore(void* _Nonnull __addr, size_t __size, unsigned char* _Nonnull __vector);
/**
* [madvise(2)](http://man7.org/linux/man-pages/man2/madvise.2.html)
@@ -163,7 +157,7 @@
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int madvise(void* __addr, size_t __size, int __advice);
+int madvise(void* _Nonnull __addr, size_t __size, int __advice);
/**
* [process_madvise(2)](http://man7.org/linux/man-pages/man2/process_madvise.2.html)
@@ -177,7 +171,7 @@
*
* Returns the number of bytes advised on success, and returns -1 and sets `errno` on failure.
*/
-ssize_t process_madvise(int __pid_fd, const struct iovec* __iov, size_t __count, int __advice, unsigned __flags) __INTRODUCED_IN(31);
+ssize_t process_madvise(int __pid_fd, const struct iovec* _Nonnull __iov, size_t __count, int __advice, unsigned __flags) __INTRODUCED_IN(31);
#if defined(__USE_GNU)
@@ -189,7 +183,7 @@
*
* Returns an fd on success, and returns -1 and sets `errno` on failure.
*/
-int memfd_create(const char* __name, unsigned __flags) __INTRODUCED_IN(30);
+int memfd_create(const char* _Nonnull __name, unsigned __flags) __INTRODUCED_IN(30);
#endif
@@ -226,6 +220,6 @@
*
* Returns 0 on success, and returns a positive error number on failure.
*/
-int posix_madvise(void* __addr, size_t __size, int __advice) __INTRODUCED_IN(23);
+int posix_madvise(void* _Nonnull __addr, size_t __size, int __advice) __INTRODUCED_IN(23);
__END_DECLS
diff --git a/libc/include/sys/random.h b/libc/include/sys/random.h
index 0251176..2ff5349 100644
--- a/libc/include/sys/random.h
+++ b/libc/include/sys/random.h
@@ -38,19 +38,9 @@
#include <linux/random.h>
-__BEGIN_DECLS
+#include <bits/getentropy.h>
-/**
- * [getentropy(3)](http://man7.org/linux/man-pages/man3/getentropy.3.html) fills the given buffer
- * with random bytes.
- *
- * Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 28.
- *
- * See also arc4random_buf() which is available in all API levels.
- */
-int getentropy(void* _Nonnull __buffer, size_t __buffer_size) __wur __INTRODUCED_IN(28);
+__BEGIN_DECLS
/**
* [getrandom(2)](http://man7.org/linux/man-pages/man2/getrandom.2.html) fills the given buffer
diff --git a/libc/include/sys/resource.h b/libc/include/sys/resource.h
index 0b540de..6743343 100644
--- a/libc/include/sys/resource.h
+++ b/libc/include/sys/resource.h
@@ -46,8 +46,8 @@
int getrlimit(int __resource, struct rlimit* _Nonnull __limit);
int setrlimit(int __resource, const struct rlimit* _Nonnull __limit);
-int getrlimit64(int __resource, struct rlimit64* _Nonnull __limit) __INTRODUCED_IN(21);
-int setrlimit64(int __resource, const struct rlimit64* _Nonnull __limit) __INTRODUCED_IN(21);
+int getrlimit64(int __resource, struct rlimit64* _Nonnull __limit);
+int setrlimit64(int __resource, const struct rlimit64* _Nonnull __limit);
int getpriority(int __which, id_t __who);
int setpriority(int __which, id_t __who, int __priority);
@@ -55,7 +55,7 @@
int getrusage(int __who, struct rusage* _Nonnull __usage);
int prlimit(pid_t __pid, int __resource, const struct rlimit* _Nullable __new_limit, struct rlimit* _Nullable __old_limit) __INTRODUCED_IN_32(24) __INTRODUCED_IN_64(21);
-int prlimit64(pid_t __pid, int __resource, const struct rlimit64* _Nullable __new_limit, struct rlimit64* _Nullable __old_limit) __INTRODUCED_IN(21);
+int prlimit64(pid_t __pid, int __resource, const struct rlimit64* _Nullable __new_limit, struct rlimit64* _Nullable __old_limit);
__END_DECLS
diff --git a/libc/include/sys/select.h b/libc/include/sys/select.h
index 8c6c2ff..84c2621 100644
--- a/libc/include/sys/select.h
+++ b/libc/include/sys/select.h
@@ -71,9 +71,9 @@
} \
} while (0)
-void __FD_CLR_chk(int, fd_set* _Nonnull , size_t) __INTRODUCED_IN(21);
-void __FD_SET_chk(int, fd_set* _Nonnull, size_t) __INTRODUCED_IN(21);
-int __FD_ISSET_chk(int, const fd_set* _Nonnull, size_t) __INTRODUCED_IN(21);
+void __FD_CLR_chk(int, fd_set* _Nonnull , size_t);
+void __FD_SET_chk(int, fd_set* _Nonnull, size_t);
+int __FD_ISSET_chk(int, const fd_set* _Nonnull, size_t);
#define __FD_CLR(fd, set) (__FDS_BITS(fd_set*,set)[__FDELT(fd)] &= ~__FDMASK(fd))
#define __FD_SET(fd, set) (__FDS_BITS(fd_set*,set)[__FDELT(fd)] |= __FDMASK(fd))
diff --git a/libc/include/sys/sendfile.h b/libc/include/sys/sendfile.h
index 4b00d5d..a72091d 100644
--- a/libc/include/sys/sendfile.h
+++ b/libc/include/sys/sendfile.h
@@ -40,23 +40,21 @@
/* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */
#if defined(__USE_FILE_OFFSET64)
-ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count) __RENAME(sendfile64) __INTRODUCED_IN(21);
+ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count) __RENAME(sendfile64);
#else
/**
* [sendfile(2)](http://man7.org/linux/man-pages/man2/sendfile.2.html) copies data directly
* between two file descriptors.
*
* Returns the number of bytes copied on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 21.
*/
ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count);
#endif
/**
* Like sendfile() but allows using a 64-bit offset
- * even from a 32-bit process without `__FILE_OFFSET_BITS=64`.
+ * even from a 32-bit process without `_FILE_OFFSET_BITS=64`.
*/
-ssize_t sendfile64(int __out_fd, int __in_fd, off64_t* _Nullable __offset, size_t __count) __INTRODUCED_IN(21);
+ssize_t sendfile64(int __out_fd, int __in_fd, off64_t* _Nullable __offset, size_t __count);
__END_DECLS
diff --git a/libc/include/sys/shm.h b/libc/include/sys/shm.h
index a3f84d3..9d58046 100644
--- a/libc/include/sys/shm.h
+++ b/libc/include/sys/shm.h
@@ -47,11 +47,11 @@
typedef unsigned long shmatt_t;
/** Not useful on Android; disallowed by SELinux. */
-void* shmat(int __shm_id, const void* __addr, int __flags) __INTRODUCED_IN(26);
+void* _Nonnull shmat(int __shm_id, const void* _Nullable __addr, int __flags) __INTRODUCED_IN(26);
/** Not useful on Android; disallowed by SELinux. */
-int shmctl(int __shm_id, int __cmd, struct shmid_ds* __buf) __INTRODUCED_IN(26);
+int shmctl(int __shm_id, int __cmd, struct shmid_ds* _Nullable __buf) __INTRODUCED_IN(26);
/** Not useful on Android; disallowed by SELinux. */
-int shmdt(const void* __addr) __INTRODUCED_IN(26);
+int shmdt(const void* _Nonnull __addr) __INTRODUCED_IN(26);
/** Not useful on Android; disallowed by SELinux. */
int shmget(key_t __key, size_t __size, int __flags) __INTRODUCED_IN(26);
diff --git a/libc/include/sys/signalfd.h b/libc/include/sys/signalfd.h
index f669cc8..2be9bdc 100644
--- a/libc/include/sys/signalfd.h
+++ b/libc/include/sys/signalfd.h
@@ -45,10 +45,8 @@
* file descriptor for reading signal events.
*
* Returns the file descriptor on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 18.
*/
-int signalfd(int __fd, const sigset_t* _Nonnull __mask, int __flags) __INTRODUCED_IN(18);
+int signalfd(int __fd, const sigset_t* _Nonnull __mask, int __flags);
/**
* Like signalfd() but allows setting a signal mask with RT signals even from a 32-bit process.
diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h
index 41c5a9a..22b88cb 100644
--- a/libc/include/sys/socket.h
+++ b/libc/include/sys/socket.h
@@ -70,6 +70,8 @@
char sa_data[14];
};
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnullability-completeness"
struct sockaddr_storage {
union {
struct {
@@ -106,6 +108,8 @@
int cmsg_type;
};
+#pragma clang diagnostic pop
+
#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr((mhdr), (cmsg))
#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
#define CMSG_DATA(cmsg) (((unsigned char*)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
@@ -116,7 +120,7 @@
? (struct cmsghdr*) (msg)->msg_control : (struct cmsghdr*) NULL)
#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && (cmsg)->cmsg_len <= (unsigned long) ((mhdr)->msg_controllen - ((char*)(cmsg) - (char*)(mhdr)->msg_control)))
-struct cmsghdr* __cmsg_nxthdr(struct msghdr* __msg, struct cmsghdr* __cmsg) __INTRODUCED_IN(21);
+struct cmsghdr* _Nullable __cmsg_nxthdr(struct msghdr* _Nonnull __msg, struct cmsghdr* _Nonnull __cmsg);
#define SCM_RIGHTS 0x01
#define SCM_CREDENTIALS 0x02
@@ -287,29 +291,28 @@
# define __socketcall extern
#endif
-__socketcall int accept(int __fd, struct sockaddr* __addr, socklen_t* __addr_length);
-__socketcall int accept4(int __fd, struct sockaddr* __addr, socklen_t* __addr_length, int __flags) __INTRODUCED_IN(21);
-__socketcall int bind(int __fd, const struct sockaddr* __addr, socklen_t __addr_length);
-__socketcall int connect(int __fd, const struct sockaddr* __addr, socklen_t __addr_length);
-__socketcall int getpeername(int __fd, struct sockaddr* __addr, socklen_t* __addr_length);
-__socketcall int getsockname(int __fd, struct sockaddr* __addr, socklen_t* __addr_length);
-__socketcall int getsockopt(int __fd, int __level, int __option, void* __value, socklen_t* __value_length);
+__socketcall int accept(int __fd, struct sockaddr* _Nullable __addr, socklen_t* _Nullable __addr_length);
+__socketcall int accept4(int __fd, struct sockaddr* _Nullable __addr, socklen_t* _Nullable __addr_length, int __flags);
+__socketcall int bind(int __fd, const struct sockaddr* _Nonnull __addr, socklen_t __addr_length);
+__socketcall int connect(int __fd, const struct sockaddr* _Nonnull __addr, socklen_t __addr_length);
+__socketcall int getpeername(int __fd, struct sockaddr* _Nonnull __addr, socklen_t* _Nonnull __addr_length);
+__socketcall int getsockname(int __fd, struct sockaddr* _Nonnull __addr, socklen_t* _Nonnull __addr_length);
+__socketcall int getsockopt(int __fd, int __level, int __option, void* _Nullable __value, socklen_t* _Nonnull __value_length);
__socketcall int listen(int __fd, int __backlog);
-__socketcall int recvmmsg(int __fd, struct mmsghdr* __msgs, unsigned int __msg_count, int __flags, const struct timespec* __timeout)
- __INTRODUCED_IN(21);
-__socketcall ssize_t recvmsg(int __fd, struct msghdr* __msg, int __flags);
-__socketcall int sendmmsg(int __fd, const struct mmsghdr* __msgs, unsigned int __msg_count, int __flags) __INTRODUCED_IN(21);
-__socketcall ssize_t sendmsg(int __fd, const struct msghdr* __msg, int __flags);
-__socketcall int setsockopt(int __fd, int __level, int __option, const void* __value, socklen_t __value_length);
+__socketcall int recvmmsg(int __fd, struct mmsghdr* _Nonnull __msgs, unsigned int __msg_count, int __flags, const struct timespec* _Nullable __timeout);
+__socketcall ssize_t recvmsg(int __fd, struct msghdr* _Nonnull __msg, int __flags);
+__socketcall int sendmmsg(int __fd, const struct mmsghdr* _Nonnull __msgs, unsigned int __msg_count, int __flags);
+__socketcall ssize_t sendmsg(int __fd, const struct msghdr* _Nonnull __msg, int __flags);
+__socketcall int setsockopt(int __fd, int __level, int __option, const void* _Nullable __value, socklen_t __value_length);
__socketcall int shutdown(int __fd, int __how);
__socketcall int socket(int __af, int __type, int __protocol);
-__socketcall int socketpair(int __af, int __type, int __protocol, int __fds[2]);
+__socketcall int socketpair(int __af, int __type, int __protocol, int __fds[_Nonnull 2]);
-ssize_t recv(int __fd, void* __buf, size_t __n, int __flags);
-ssize_t send(int __fd, const void* __buf, size_t __n, int __flags);
+ssize_t recv(int __fd, void* _Nullable __buf, size_t __n, int __flags);
+ssize_t send(int __fd, const void* _Nonnull __buf, size_t __n, int __flags);
-__socketcall ssize_t sendto(int __fd, const void* __buf, size_t __n, int __flags, const struct sockaddr* __dst_addr, socklen_t __dst_addr_length);
-__socketcall ssize_t recvfrom(int __fd, void* __buf, size_t __n, int __flags, struct sockaddr* __src_addr, socklen_t* __src_addr_length);
+__socketcall ssize_t sendto(int __fd, const void* _Nonnull __buf, size_t __n, int __flags, const struct sockaddr* _Nullable __dst_addr, socklen_t __dst_addr_length);
+__socketcall ssize_t recvfrom(int __fd, void* _Nullable __buf, size_t __n, int __flags, struct sockaddr* _Nullable __src_addr, socklen_t* _Nullable __src_addr_length);
#if defined(__BIONIC_INCLUDE_FORTIFY_HEADERS)
#include <bits/fortify/socket.h>
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index 54621b7..f916573 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -141,13 +141,13 @@
int mkdir(const char* _Nonnull __path, mode_t __mode);
int fstat(int __fd, struct stat* _Nonnull __buf);
-int fstat64(int __fd, struct stat64* _Nonnull __buf) __RENAME_STAT64(fstat, 3, 21);
+int fstat64(int __fd, struct stat64* _Nonnull __buf);
int fstatat(int __dir_fd, const char* _Nonnull __path, struct stat* _Nonnull __buf, int __flags);
-int fstatat64(int __dir_fd, const char* _Nonnull __path, struct stat64* _Nonnull __buf, int __flags) __RENAME_STAT64(fstatat, 3, 21);
+int fstatat64(int __dir_fd, const char* _Nonnull __path, struct stat64* _Nonnull __buf, int __flags);
int lstat(const char* _Nonnull __path, struct stat* _Nonnull __buf);
-int lstat64(const char* _Nonnull __path, struct stat64* _Nonnull __buf) __RENAME_STAT64(lstat, 3, 21);
+int lstat64(const char* _Nonnull __path, struct stat64* _Nonnull __buf);
int stat(const char* _Nonnull __path, struct stat* _Nonnull __buf);
-int stat64(const char* _Nonnull __path, struct stat64* _Nonnull __buf) __RENAME_STAT64(stat, 3, 21);
+int stat64(const char* _Nonnull __path, struct stat64* _Nonnull __buf);
int mknod(const char* _Nonnull __path, mode_t __mode, dev_t __dev);
mode_t umask(mode_t __mask);
@@ -156,12 +156,12 @@
#include <bits/fortify/stat.h>
#endif
-int mkfifo(const char* _Nonnull __path, mode_t __mode) __INTRODUCED_IN(21);
+int mkfifo(const char* _Nonnull __path, mode_t __mode);
int mkfifoat(int __dir_fd, const char* _Nonnull __path, mode_t __mode) __INTRODUCED_IN(23);
int fchmodat(int __dir_fd, const char* _Nonnull __path, mode_t __mode, int __flags);
int mkdirat(int __dir_fd, const char* _Nonnull __path, mode_t __mode);
-int mknodat(int __dir_fd, const char* _Nonnull __path, mode_t __mode, dev_t __dev) __INTRODUCED_IN(21);
+int mknodat(int __dir_fd, const char* _Nonnull __path, mode_t __mode, dev_t __dev);
/**
* Used in the tv_nsec field of an argument to utimensat()/futimens()
@@ -200,10 +200,8 @@
* See also UTIME_NOW and UTIME_OMIT.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int futimens(int __fd, const struct timespec __times[_Nullable 2]) __INTRODUCED_IN(19);
+int futimens(int __fd, const struct timespec __times[_Nullable 2]);
#if defined(__USE_GNU)
/**
diff --git a/libc/include/sys/statvfs.h b/libc/include/sys/statvfs.h
index d81f836..46fbea5 100644
--- a/libc/include/sys/statvfs.h
+++ b/libc/include/sys/statvfs.h
@@ -93,25 +93,21 @@
* queries filesystem statistics for the given path.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int statvfs(const char* _Nonnull __path, struct statvfs* _Nonnull __buf) __INTRODUCED_IN(19);
+int statvfs(const char* _Nonnull __path, struct statvfs* _Nonnull __buf);
/**
* [fstatvfs(3)](http://man7.org/linux/man-pages/man3/fstatvfs.3.html)
* queries filesystem statistics for the given file descriptor.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int fstatvfs(int __fd, struct statvfs* _Nonnull __buf) __INTRODUCED_IN(19);
+int fstatvfs(int __fd, struct statvfs* _Nonnull __buf);
/** Equivalent to statvfs() . */
-int statvfs64(const char* _Nonnull __path, struct statvfs64* _Nonnull __buf) __INTRODUCED_IN(21);
+int statvfs64(const char* _Nonnull __path, struct statvfs64* _Nonnull __buf);
/** Equivalent to fstatvfs(). */
-int fstatvfs64(int __fd, struct statvfs64* _Nonnull __buf) __INTRODUCED_IN(21);
+int fstatvfs64(int __fd, struct statvfs64* _Nonnull __buf);
__END_DECLS
diff --git a/libc/include/sys/swap.h b/libc/include/sys/swap.h
index 9d016d4..474aed7 100644
--- a/libc/include/sys/swap.h
+++ b/libc/include/sys/swap.h
@@ -55,18 +55,14 @@
* [swapon(2)](http://man7.org/linux/man-pages/man2/swapon.2.html) enables swapping.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int swapon(const char* _Nonnull __path, int __flags) __INTRODUCED_IN(19);
+int swapon(const char* _Nonnull __path, int __flags);
/**
* [swapoff(2)](http://man7.org/linux/man-pages/man2/swapoff.2.html) disables swapping.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int swapoff(const char* _Nonnull __path) __INTRODUCED_IN(19);
+int swapoff(const char* _Nonnull __path);
__END_DECLS
diff --git a/libc/include/sys/system_properties.h b/libc/include/sys/system_properties.h
index a2e1923..dc869da 100644
--- a/libc/include/sys/system_properties.h
+++ b/libc/include/sys/system_properties.h
@@ -43,7 +43,7 @@
/*
* Sets system property `name` to `value`, creating the system property if it doesn't already exist.
*/
-int __system_property_set(const char* __name, const char* __value);
+int __system_property_set(const char* _Nonnull __name, const char* _Nonnull __value);
/*
* Returns a `prop_info` corresponding system property `name`, or nullptr if it doesn't exist.
@@ -51,14 +51,14 @@
*
* Property lookup is expensive, so it can be useful to cache the result of this function.
*/
-const prop_info* __system_property_find(const char* __name);
+const prop_info* _Nullable __system_property_find(const char* _Nonnull __name);
/*
* Calls `callback` with a consistent trio of name, value, and serial number for property `pi`.
*/
-void __system_property_read_callback(const prop_info* __pi,
- void (*__callback)(void* __cookie, const char* __name, const char* __value, uint32_t __serial),
- void* __cookie) __INTRODUCED_IN(26);
+void __system_property_read_callback(const prop_info* _Nonnull __pi,
+ void (* _Nonnull __callback)(void* _Nullable __cookie, const char* _Nonnull __name, const char* _Nonnull __value, uint32_t __serial),
+ void* _Nullable __cookie) __INTRODUCED_IN(26);
/*
* Passes a `prop_info` for each system property to the provided
@@ -66,13 +66,12 @@
*
* This method is for inspecting and debugging the property system, and not generally useful.
*/
-int __system_property_foreach(void (*__callback)(const prop_info* __pi, void* __cookie), void* __cookie)
- __INTRODUCED_IN(19);
+int __system_property_foreach(void (* _Nonnull __callback)(const prop_info* _Nonnull __pi, void* _Nullable __cookie), void* _Nullable __cookie);
/*
* Waits for the specific system property identified by `pi` to be updated
* past `old_serial`. Waits no longer than `relative_timeout`, or forever
- * if `relaive_timeout` is null.
+ * if `relative_timeout` is null.
*
* If `pi` is null, waits for the global serial number instead.
*
@@ -82,17 +81,17 @@
* timed out.
*/
struct timespec;
-bool __system_property_wait(const prop_info* __pi, uint32_t __old_serial, uint32_t* __new_serial_ptr, const struct timespec* __relative_timeout)
+bool __system_property_wait(const prop_info* _Nullable __pi, uint32_t __old_serial, uint32_t* _Nonnull __new_serial_ptr, const struct timespec* _Nullable __relative_timeout)
__INTRODUCED_IN(26);
/* Deprecated. In Android O and above, there's no limit on property name length. */
#define PROP_NAME_MAX 32
/* Deprecated. Use __system_property_read_callback instead. */
-int __system_property_read(const prop_info* __pi, char* __name, char* __value);
+int __system_property_read(const prop_info* _Nonnull __pi, char* _Nullable __name, char* _Nonnull __value);
/* Deprecated. Use __system_property_read_callback instead. */
-int __system_property_get(const char* __name, char* __value);
+int __system_property_get(const char* _Nonnull __name, char* _Nonnull __value);
/* Deprecated. Use __system_property_foreach instead. */
-const prop_info* __system_property_find_nth(unsigned __n);
+const prop_info* _Nullable __system_property_find_nth(unsigned __n);
__END_DECLS
diff --git a/libc/include/sys/thread_properties.h b/libc/include/sys/thread_properties.h
index b5d30c7..efd212a 100644
--- a/libc/include/sys/thread_properties.h
+++ b/libc/include/sys/thread_properties.h
@@ -50,8 +50,8 @@
*
* Available since API level 31.
*/
-void __libc_get_static_tls_bounds(void** __static_tls_begin,
- void** __static_tls_end) __INTRODUCED_IN(31);
+void __libc_get_static_tls_bounds(void* _Nonnull * _Nonnull __static_tls_begin,
+ void* _Nonnull * _Nonnull __static_tls_end) __INTRODUCED_IN(31);
/**
@@ -66,7 +66,7 @@
*
* Available since API level 31.
*/
-void __libc_register_thread_exit_callback(void (*__cb)(void)) __INTRODUCED_IN(31);
+void __libc_register_thread_exit_callback(void (* _Nonnull __cb)(void)) __INTRODUCED_IN(31);
/**
* Iterates over all dynamic TLS chunks for the given thread.
@@ -76,11 +76,11 @@
* Available since API level 31.
*/
void __libc_iterate_dynamic_tls(pid_t __tid,
- void (*__cb)(void* __dynamic_tls_begin,
- void* __dynamic_tls_end,
+ void (* _Nonnull __cb)(void* _Nonnull __dynamic_tls_begin,
+ void* _Nonnull __dynamic_tls_end,
size_t __dso_id,
- void* __arg),
- void* __arg) __INTRODUCED_IN(31);
+ void* _Nullable __arg),
+ void* _Nullable __arg) __INTRODUCED_IN(31);
/**
* Register on_creation and on_destruction callbacks, which will be called after a dynamic
@@ -89,9 +89,9 @@
* Available since API level 31.
*/
void __libc_register_dynamic_tls_listeners(
- void (*__on_creation)(void* __dynamic_tls_begin,
- void* __dynamic_tls_end),
- void (*__on_destruction)(void* __dynamic_tls_begin,
- void* __dynamic_tls_end)) __INTRODUCED_IN(31);
+ void (* _Nonnull __on_creation)(void* _Nonnull __dynamic_tls_begin,
+ void* _Nonnull __dynamic_tls_end),
+ void (* _Nonnull __on_destruction)(void* _Nonnull __dynamic_tls_begin,
+ void* _Nonnull __dynamic_tls_end)) __INTRODUCED_IN(31);
__END_DECLS
diff --git a/libc/include/sys/time.h b/libc/include/sys/time.h
index 45190c3..6ba7a37 100644
--- a/libc/include/sys/time.h
+++ b/libc/include/sys/time.h
@@ -38,21 +38,34 @@
__BEGIN_DECLS
-int gettimeofday(struct timeval* __tv, struct timezone* __tz);
-int settimeofday(const struct timeval* __tv, const struct timezone* __tz);
+int gettimeofday(struct timeval* _Nullable __tv, struct timezone* _Nullable __tz);
+int settimeofday(const struct timeval* _Nullable __tv, const struct timezone* _Nullable __tz);
-int getitimer(int __which, struct itimerval* __current_value);
-int setitimer(int __which, const struct itimerval* __new_value, struct itimerval* __old_value);
+int getitimer(int __which, struct itimerval* _Nonnull __current_value);
+int setitimer(int __which, const struct itimerval* _Nonnull __new_value, struct itimerval* _Nullable __old_value);
-int utimes(const char* __path, const struct timeval __times[2]);
+int utimes(const char* _Nonnull __path, const struct timeval __times[_Nullable 2]);
#if defined(__USE_BSD)
-int futimes(int __fd, const struct timeval __times[2]) __INTRODUCED_IN(26);
-int lutimes(const char* __path, const struct timeval __times[2]) __INTRODUCED_IN(26);
+int futimes(int __fd, const struct timeval __times[_Nullable 2]) __INTRODUCED_IN(26);
+int lutimes(const char* _Nonnull __path, const struct timeval __times[_Nullable 2]) __INTRODUCED_IN(26);
#endif
#if defined(__USE_GNU)
-int futimesat(int __dir_fd, const char* __path, const struct timeval __times[2]) __INTRODUCED_IN(26);
+/**
+ * [futimesat(2)](https://man7.org/linux/man-pages/man2/futimesat.2.html) sets
+ * file timestamps.
+ *
+ * Note: Linux supports `__path` being NULL (in which case `__dir_fd` need not
+ * be a directory), allowing futimensat() to be implemented with utimensat().
+ * Most callers should just use utimensat() directly, especially on Android
+ * where utimensat() has been available for longer than futimesat().
+ *
+ * Returns 0 on success and -1 and sets `errno` on failure.
+ *
+ * Available since API level 26.
+ */
+int futimesat(int __dir_fd, const char* __BIONIC_COMPLICATED_NULLNESS __path, const struct timeval __times[_Nullable 2]) __INTRODUCED_IN(26);
#endif
#define timerclear(a) \
diff --git a/libc/include/sys/timerfd.h b/libc/include/sys/timerfd.h
index b89941b..de1f55b 100644
--- a/libc/include/sys/timerfd.h
+++ b/libc/include/sys/timerfd.h
@@ -50,10 +50,8 @@
* timer file descriptor.
*
* Returns the new file descriptor on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int timerfd_create(clockid_t __clock, int __flags) __INTRODUCED_IN(19);
+int timerfd_create(clockid_t __clock, int __flags);
/** The timerfd_settime() flag to use absolute rather than relative times. */
#define TFD_TIMER_ABSTIME (1 << 0)
@@ -65,19 +63,15 @@
* stops a timer.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int timerfd_settime(int __fd, int __flags, const struct itimerspec* __new_value, struct itimerspec* __old_value) __INTRODUCED_IN(19);
+int timerfd_settime(int __fd, int __flags, const struct itimerspec* _Nonnull __new_value, struct itimerspec* _Nullable __old_value);
/**
* [timerfd_gettime(2)](http://man7.org/linux/man-pages/man2/timerfd_gettime.2.html) queries the
* current timer settings.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int timerfd_gettime(int __fd, struct itimerspec* __current_value) __INTRODUCED_IN(19);
+int timerfd_gettime(int __fd, struct itimerspec* _Nonnull __current_value);
__END_DECLS
diff --git a/libc/include/sys/times.h b/libc/include/sys/times.h
index 25d03e3..8b6e91d 100644
--- a/libc/include/sys/times.h
+++ b/libc/include/sys/times.h
@@ -46,6 +46,6 @@
* Returns a (possibly overflowed) absolute time on success,
* and returns -1 and sets `errno` on failure.
*/
-clock_t times(struct tms* __buf);
+clock_t times(struct tms* _Nullable __buf);
__END_DECLS
diff --git a/libc/include/sys/timex.h b/libc/include/sys/timex.h
index 52db5dc..4823edf 100644
--- a/libc/include/sys/timex.h
+++ b/libc/include/sys/timex.h
@@ -46,7 +46,7 @@
*
* Available since API level 24.
*/
-int adjtimex(struct timex* __buf) __INTRODUCED_IN(24);
+int adjtimex(struct timex* _Nonnull __buf) __INTRODUCED_IN(24);
/**
* clock_adjtime adjusts a specific kernel clock.
@@ -55,6 +55,6 @@
*
* Available since API level 24.
*/
-int clock_adjtime(clockid_t __clock, struct timex* __tx) __INTRODUCED_IN(24);
+int clock_adjtime(clockid_t __clock, struct timex* _Nonnull __tx) __INTRODUCED_IN(24);
__END_DECLS
diff --git a/libc/include/sys/user.h b/libc/include/sys/user.h
index 432c7cb..1d20034 100644
--- a/libc/include/sys/user.h
+++ b/libc/include/sys/user.h
@@ -32,10 +32,9 @@
#include <stddef.h> /* For size_t. */
#include <stdint.h>
-__BEGIN_DECLS
+#include <bits/page_size.h>
-#define PAGE_SIZE 4096
-#define PAGE_MASK (~(PAGE_SIZE - 1))
+__BEGIN_DECLS
#if defined(__i386__)
diff --git a/libc/include/sys/vfs.h b/libc/include/sys/vfs.h
index 18ae428..3579799 100644
--- a/libc/include/sys/vfs.h
+++ b/libc/include/sys/vfs.h
@@ -105,9 +105,9 @@
#define XFS_SUPER_MAGIC 0x58465342
int statfs(const char* _Nonnull __path, struct statfs* _Nonnull __buf);
-int statfs64(const char* _Nonnull __path, struct statfs64* _Nonnull __buf) __INTRODUCED_IN(21);
+int statfs64(const char* _Nonnull __path, struct statfs64* _Nonnull __buf);
int fstatfs(int __fd, struct statfs* _Nonnull __buf);
-int fstatfs64(int __fd, struct statfs64* _Nonnull __buf) __INTRODUCED_IN(21);
+int fstatfs64(int __fd, struct statfs64* _Nonnull __buf);
__END_DECLS
diff --git a/libc/include/sys/wait.h b/libc/include/sys/wait.h
index e6fb855..5208366 100644
--- a/libc/include/sys/wait.h
+++ b/libc/include/sys/wait.h
@@ -39,7 +39,7 @@
pid_t wait(int* _Nullable __status);
pid_t waitpid(pid_t __pid, int* _Nullable __status, int __options);
-pid_t wait4(pid_t __pid, int* _Nullable __status, int __options, struct rusage* _Nullable __rusage) __INTRODUCED_IN(18);
+pid_t wait4(pid_t __pid, int* _Nullable __status, int __options, struct rusage* _Nullable __rusage);
/* Posix states that idtype_t should be an enumeration type, but
* the kernel headers define P_ALL, P_PID and P_PGID as constant macros
diff --git a/libc/include/sys/xattr.h b/libc/include/sys/xattr.h
index dc58026..745f50c 100644
--- a/libc/include/sys/xattr.h
+++ b/libc/include/sys/xattr.h
@@ -44,90 +44,114 @@
* sets an extended attribute on the file referred to by the given file
* descriptor.
*
+ * A `size` of 0 can be used to set an empty value, in which case `value` is
+ * ignored and may be null. Setting an xattr to an empty value is not the same
+ * as removing an xattr; see removexattr() for the latter operation.
+ *
* Valid flags are `XATTR_CREATE` and `XATTR_REPLACE`.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int fsetxattr(int __fd, const char* __name, const void* __value, size_t __size, int __flags);
+int fsetxattr(int __fd, const char* _Nonnull __name, const void* _Nullable __value, size_t __size, int __flags);
/**
* [setxattr(2)](http://man7.org/linux/man-pages/man2/setxattr.2.html)
* sets an extended attribute on the file referred to by the given path.
*
+ * A `size` of 0 can be used to set an empty value, in which case `value` is
+ * ignored and may be null. Setting an xattr to an empty value is not the same
+ * as removing an xattr; see removexattr() for the latter operation.
+ *
* Valid flags are `XATTR_CREATE` and `XATTR_REPLACE`.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int setxattr(const char* __path, const char* __name, const void* __value, size_t __size, int __flags);
+int setxattr(const char* _Nonnull __path, const char* _Nonnull __name, const void* _Nullable __value, size_t __size, int __flags);
/**
* [lsetxattr(2)](http://man7.org/linux/man-pages/man2/lsetxattr.2.html)
* sets an extended attribute on the file referred to by the given path, which
* is the link itself rather than its target in the case of a symbolic link.
*
+ * A `size` of 0 can be used to set an empty value, in which case `value` is
+ * ignored and may be null. Setting an xattr to an empty value is not the same
+ * as removing an xattr; see removexattr() for the latter operation.
+ *
* Valid flags are `XATTR_CREATE` and `XATTR_REPLACE`.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int lsetxattr(const char* __path, const char* __name, const void* __value, size_t __size, int __flags);
+int lsetxattr(const char* _Nonnull __path, const char* _Nonnull __name, const void* _Nullable __value, size_t __size, int __flags);
/**
* [fgetxattr(2)](http://man7.org/linux/man-pages/man2/fgetxattr.2.html)
* gets an extended attribute on the file referred to by the given file
* descriptor.
*
+ * A `size` of 0 can be used to query the current length, in which case `value` is ignored and may be null.
+ *
* Returns the non-negative length of the value on success, or
* returns -1 and sets `errno` on failure.
*/
-ssize_t fgetxattr(int __fd, const char* __name, void* __value, size_t __size);
+ssize_t fgetxattr(int __fd, const char* _Nonnull __name, void* _Nullable __value, size_t __size);
/**
* [getxattr(2)](http://man7.org/linux/man-pages/man2/getxattr.2.html)
* gets an extended attribute on the file referred to by the given path.
*
+ * A `size` of 0 can be used to query the current length, in which case `value` is ignored and may be null.
+ *
* Returns the non-negative length of the value on success, or
* returns -1 and sets `errno` on failure.
*/
-ssize_t getxattr(const char* __path, const char* __name, void* __value, size_t __size);
+ssize_t getxattr(const char* _Nonnull __path, const char* _Nonnull __name, void* _Nullable __value, size_t __size);
/**
* [lgetxattr(2)](http://man7.org/linux/man-pages/man2/lgetxattr.2.html)
* gets an extended attribute on the file referred to by the given path, which
* is the link itself rather than its target in the case of a symbolic link.
*
+ * A `size` of 0 can be used to query the current length, in which case `value` is ignored and may be null.
+ *
* Returns the non-negative length of the value on success, or
* returns -1 and sets `errno` on failure.
*/
-ssize_t lgetxattr(const char* __path, const char* __name, void* __value, size_t __size);
+ssize_t lgetxattr(const char* _Nonnull __path, const char* _Nonnull __name, void* _Nullable __value, size_t __size);
/**
* [flistxattr(2)](http://man7.org/linux/man-pages/man2/flistxattr.2.html)
* lists the extended attributes on the file referred to by the given file
* descriptor.
*
+ * A `size` of 0 can be used to query the current length, in which case `list` is ignored and may be null.
+ *
* Returns the non-negative length of the list on success, or
* returns -1 and sets `errno` on failure.
*/
-ssize_t flistxattr(int __fd, char* __list, size_t __size);
+ssize_t flistxattr(int __fd, char* _Nullable __list, size_t __size);
/**
* [listxattr(2)](http://man7.org/linux/man-pages/man2/listxattr.2.html)
* lists the extended attributes on the file referred to by the given path.
*
+ * A `size` of 0 can be used to query the current length, in which case `list` is ignored and may be null.
+ *
* Returns the non-negative length of the list on success, or
* returns -1 and sets `errno` on failure.
*/
-ssize_t listxattr(const char* __path, char* __list, size_t __size);
+ssize_t listxattr(const char* _Nonnull __path, char* _Nullable __list, size_t __size);
/**
* [llistxattr(2)](http://man7.org/linux/man-pages/man2/llistxattr.2.html)
* lists the extended attributes on the file referred to by the given path, which
* is the link itself rather than its target in the case of a symbolic link.
*
+ * A `size` of 0 can be used to query the current length, in which case `list` is ignored and may be null.
+ *
* Returns the non-negative length of the list on success, or
* returns -1 and sets `errno` on failure.
*/
-ssize_t llistxattr(const char* __path, char* __list, size_t __size);
+ssize_t llistxattr(const char* _Nonnull __path, char* _Nullable __list, size_t __size);
/**
* [fremovexattr(2)](http://man7.org/linux/man-pages/man2/fremovexattr.2.html)
@@ -136,7 +160,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int fremovexattr(int __fd, const char* __name);
+int fremovexattr(int __fd, const char* _Nonnull __name);
/**
* [lremovexattr(2)](http://man7.org/linux/man-pages/man2/lremovexattr.2.html)
@@ -145,7 +169,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int lremovexattr(const char* __path, const char* __name);
+int lremovexattr(const char* _Nonnull __path, const char* _Nonnull __name);
/**
* [removexattr(2)](http://man7.org/linux/man-pages/man2/removexattr.2.html)
@@ -153,6 +177,6 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int removexattr(const char* __path, const char* __name);
+int removexattr(const char* _Nonnull __path, const char* _Nonnull __name);
__END_DECLS
diff --git a/libc/include/termios.h b/libc/include/termios.h
index 92ac24b..7abff5d 100644
--- a/libc/include/termios.h
+++ b/libc/include/termios.h
@@ -49,19 +49,19 @@
* [cfgetispeed(3)](http://man7.org/linux/man-pages/man3/cfgetispeed.3.html)
* returns the terminal input baud rate.
*/
-speed_t cfgetispeed(const struct termios* _Nonnull __t) __INTRODUCED_IN(21);
+speed_t cfgetispeed(const struct termios* _Nonnull __t);
/**
* [cfgetospeed(3)](http://man7.org/linux/man-pages/man3/cfgetospeed.3.html)
* returns the terminal output baud rate.
*/
-speed_t cfgetospeed(const struct termios* _Nonnull __t) __INTRODUCED_IN(21);
+speed_t cfgetospeed(const struct termios* _Nonnull __t);
/**
* [cfmakeraw(3)](http://man7.org/linux/man-pages/man3/cfmakeraw.3.html)
* configures the terminal for "raw" mode.
*/
-void cfmakeraw(struct termios* _Nonnull __t) __INTRODUCED_IN(21);
+void cfmakeraw(struct termios* _Nonnull __t);
/**
* [cfsetspeed(3)](http://man7.org/linux/man-pages/man3/cfsetspeed.3.html)
@@ -69,7 +69,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int cfsetspeed(struct termios* _Nonnull __t, speed_t __speed) __INTRODUCED_IN(21);
+int cfsetspeed(struct termios* _Nonnull __t, speed_t __speed);
/**
* [cfsetispeed(3)](http://man7.org/linux/man-pages/man3/cfsetispeed.3.html)
@@ -77,7 +77,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int cfsetispeed(struct termios* _Nonnull _t, speed_t __speed) __INTRODUCED_IN(21);
+int cfsetispeed(struct termios* _Nonnull _t, speed_t __speed);
/**
* [cfsetospeed(3)](http://man7.org/linux/man-pages/man3/cfsetospeed.3.html)
@@ -85,7 +85,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int cfsetospeed(struct termios* _Nonnull __t, speed_t __speed) __INTRODUCED_IN(21);
+int cfsetospeed(struct termios* _Nonnull __t, speed_t __speed);
/**
* [tcdrain(3)](http://man7.org/linux/man-pages/man3/tcdrain.3.html)
@@ -93,7 +93,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int tcdrain(int __fd) __INTRODUCED_IN(21);
+int tcdrain(int __fd);
/**
* [tcflow(3)](http://man7.org/linux/man-pages/man3/tcflow.3.html)
@@ -102,7 +102,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int tcflow(int __fd, int __action) __INTRODUCED_IN(21);
+int tcflow(int __fd, int __action);
/**
* [tcflush(3)](http://man7.org/linux/man-pages/man3/tcflush.3.html)
@@ -112,7 +112,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int tcflush(int __fd, int __queue) __INTRODUCED_IN(21);
+int tcflush(int __fd, int __queue);
/**
* [tcgetattr(3)](http://man7.org/linux/man-pages/man3/tcgetattr.3.html)
@@ -120,7 +120,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int tcgetattr(int __fd, struct termios* _Nonnull __t) __INTRODUCED_IN(21);
+int tcgetattr(int __fd, struct termios* _Nonnull __t);
/**
* [tcgetsid(3)](http://man7.org/linux/man-pages/man3/tcgetsid.3.html)
@@ -129,7 +129,7 @@
* Returns a non-negative session id on success and
* returns -1 and sets `errno` on failure.
*/
-pid_t tcgetsid(int __fd) __INTRODUCED_IN(21);
+pid_t tcgetsid(int __fd);
/**
* [tcsendbreak(3)](http://man7.org/linux/man-pages/man3/tcsendbreak.3.html)
@@ -137,7 +137,7 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int tcsendbreak(int __fd, int __duration) __INTRODUCED_IN(21);
+int tcsendbreak(int __fd, int __duration);
/**
* [tcsetattr(3)](http://man7.org/linux/man-pages/man3/tcsetattr.3.html)
@@ -145,10 +145,29 @@
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
*/
-int tcsetattr(int __fd, int __optional_actions, const struct termios* _Nonnull __t) __INTRODUCED_IN(21);
+int tcsetattr(int __fd, int __optional_actions, const struct termios* _Nonnull __t);
#endif
+#if __ANDROID_API__ >= 35
+// These two functions were POSIX Issue 8 additions that we can also trivially
+// implement as inlines for older OS version.
+
+/**
+ * tcgetwinsize(3) gets the window size of the given terminal.
+ *
+ * Returns 0 on success and returns -1 and sets `errno` on failure.
+ */
+int tcgetwinsize(int __fd, struct winsize* _Nonnull __size);
+
+/**
+ * tcsetwinsize(3) sets the window size of the given terminal.
+ *
+ * Returns 0 on success and returns -1 and sets `errno` on failure.
+ */
+int tcsetwinsize(int __fd, const struct winsize* _Nonnull __size);
+#endif
+
__END_DECLS
#include <android/legacy_termios_inlines.h>
diff --git a/libc/include/time.h b/libc/include/time.h
index 1c3ae4b..31c2050 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -28,81 +28,399 @@
#pragma once
+/**
+ * @file time.h
+ * @brief Clock and timer functionality.
+ */
+
#include <sys/cdefs.h>
#include <sys/time.h>
#include <xlocale.h>
__BEGIN_DECLS
+/* If we just use void* in the typedef, the compiler exposes that in error messages. */
+struct __timezone_t;
+
+/**
+ * The `timezone_t` type that represents a timezone.
+ *
+ * To use this with std::unique_ptr you'll want something like
+ * `std::unique_ptr<std::remove_pointer_t<timezone_t>, decltype(&tzfree)> tz{tzalloc("Asia/Seoul"), tzfree};`
+ * to remove the pointer.
+ */
+typedef struct __timezone_t* timezone_t;
+
+/** Divisor to compute seconds from the result of a call to clock(). */
#define CLOCKS_PER_SEC 1000000
+/**
+ * The name of the current timezone's non-daylight savings (`tzname[0]`) and
+ * daylight savings (`tzname[1]`) variants. See tzset().
+ */
extern char* _Nonnull tzname[];
+
+/** Whether the current timezone ever uses daylight savings time. See tzset(). */
extern int daylight;
+
+/** The difference in seconds between UTC and the current timezone. See tzset(). */
extern long int timezone;
struct sigevent;
+/**
+ * A "broken-down" time, useful for parsing/formatting times for human consumption.
+ */
struct tm {
+ /** Seconds, 0-60. (60 is a leap second.) */
int tm_sec;
+ /** Minutes, 0-59. */
int tm_min;
+ /** Hours, 0-23. */
int tm_hour;
+ /** Day of month, 1-31. */
int tm_mday;
+ /** Month of year, 0-11. (Not 1-12!) */
int tm_mon;
+ /** Years since 1900. (So 2023 is 123, not 2023!) */
int tm_year;
+ /** Day of week, 0-6. (Sunday is 0, Saturday is 6.) */
int tm_wday;
+ /** Day of year, 0-365. */
int tm_yday;
+ /** Daylight savings flag, positive for DST in effect, 0 for DST not in effect, and -1 for unknown. */
int tm_isdst;
+ /** Offset from UTC (GMT) in seconds for this time. */
long int tm_gmtoff;
+ /** Name of the timezone for this time. */
const char* _Nullable tm_zone;
};
+/** Alternative name for `tm_zone` in `struct tm`. */
#define TM_ZONE tm_zone
+/**
+ * [time(2)](http://man7.org/linux/man-pages/man2/time.2.html) returns
+ * the number of seconds since the Unix epoch (1970-01-01 00:00:00 +0000).
+ *
+ * Returns the time in seconds on success, and returns -1 and sets `errno` on failure.
+ */
time_t time(time_t* _Nullable __t);
+
+/**
+ * [nanosleep(2)](http://man7.org/linux/man-pages/man2/nanosleep.2.html) sleeps
+ * for at least the given time (or until a signal arrives).
+ *
+ * Returns 0 on success, and returns -1 and sets `errno` on failure. If the sleep
+ * was interrupted by a signal, `errno` will be `EINTR` and `remainder` will be
+ * the amount of time remaining.
+ */
int nanosleep(const struct timespec* _Nonnull __request, struct timespec* _Nullable __remainder);
+/**
+ * [asctime(3)](http://man7.org/linux/man-pages/man3/asctime.3p.html) formats
+ * the time `tm` as a string.
+ *
+ * Returns a pointer to a string on success, and returns NULL on failure.
+ *
+ * That string will be overwritten by later calls to this function.
+ *
+ * New code should prefer strftime().
+ */
char* _Nullable asctime(const struct tm* _Nonnull __tm);
+
+/**
+ * [asctime_r(3)](http://man7.org/linux/man-pages/man3/asctime_r.3p.html) formats
+ * the time `tm` as a string in the given buffer `buf`.
+ *
+ * Returns a pointer to a string on success, and returns NULL on failure.
+ *
+ * New code should prefer strftime().
+ */
char* _Nullable asctime_r(const struct tm* _Nonnull __tm, char* _Nonnull __buf);
+/**
+ * [difftime(3)](http://man7.org/linux/man-pages/man3/difftime.3.html) returns
+ * the difference between two times.
+ *
+ * Returns the difference in seconds.
+ */
double difftime(time_t __lhs, time_t __rhs);
+
+/**
+ * [mktime(3)](http://man7.org/linux/man-pages/man3/mktime.3p.html) converts
+ * broken-down time `tm` into the number of seconds since the Unix epoch.
+ *
+ * See tzset() for details of how the timezone is set, and mktime_rz()
+ * for an alternative.
+ *
+ * Returns the time in seconds on success, and returns -1 and sets `errno` on failure.
+ */
time_t mktime(struct tm* _Nonnull __tm);
+/**
+ * mktime_z(3) converts broken-down time `tm` into the number of seconds
+ * since the Unix epoch, assuming the given timezone.
+ *
+ * Returns the time in seconds on success, and returns -1 and sets `errno` on failure.
+ *
+ * Available since API level 35.
+ */
+time_t mktime_z(timezone_t _Nonnull __tz, struct tm* _Nonnull __tm) __INTRODUCED_IN(35);
+
+/**
+ * [localtime(3)](http://man7.org/linux/man-pages/man3/localtime.3p.html) converts
+ * the number of seconds since the Unix epoch in `t` to a broken-down time, taking
+ * the device's timezone into account.
+ *
+ * That broken-down time will be overwritten by later calls to this function.
+ *
+ * Returns a pointer to a broken-down time on success, and returns null and sets `errno` on failure.
+ */
struct tm* _Nullable localtime(const time_t* _Nonnull __t);
+
+/**
+ * [localtime_r(3)](http://man7.org/linux/man-pages/man3/localtime_r.3p.html) converts
+ * the number of seconds since the Unix epoch in `t` to a broken-down time.
+ * That broken-down time will be written to the given struct `tm`.
+ *
+ * See tzset() for details of how the timezone is set, and localtime_rz()
+ * for an alternative.
+ *
+ * Returns a pointer to a broken-down time on success, and returns null and sets `errno` on failure.
+ */
struct tm* _Nullable localtime_r(const time_t* _Nonnull __t, struct tm* _Nonnull __tm);
+/**
+ * localtime_rz(3) converts the number of seconds since the Unix epoch in
+ * `t` to a broken-down time, assuming the given timezone. That broken-down
+ * time will be written to the given struct `tm`.
+ *
+ * Returns a pointer to a broken-down time on success, and returns null and sets `errno` on failure.
+ *
+ * Available since API level 35.
+ */
+struct tm* _Nullable localtime_rz(timezone_t _Nonnull __tz, const time_t* _Nonnull __t, struct tm* _Nonnull __tm) __INTRODUCED_IN(35);
+
+/**
+ * Inverse of localtime().
+ */
+time_t timelocal(struct tm* _Nonnull __tm);
+
+/**
+ * [gmtime(3)](http://man7.org/linux/man-pages/man3/gmtime.3p.html) converts
+ * the number of seconds since the Unix epoch in `t` to a broken-down time, using
+ * UTC (historically also known as GMT).
+ *
+ * That broken-down time will be overwritten by later calls to this function.
+ *
+ * Returns a pointer to a broken-down time on success, and returns null and sets `errno` on failure.
+ */
struct tm* _Nullable gmtime(const time_t* _Nonnull __t);
+
+/**
+ * [gmtime_r(3)](http://man7.org/linux/man-pages/man3/gmtime_r.3p.html) converts
+ * the number of seconds since the Unix epoch in `t` to a broken-down time, using
+ * UTC (historically also known as GMT).
+ *
+ * That broken-down time will be written to the provided struct `tm`.
+ *
+ * Returns a pointer to a broken-down time on success, and returns null and sets `errno` on failure.
+ */
struct tm* _Nullable gmtime_r(const time_t* _Nonnull __t, struct tm* _Nonnull __tm);
+/**
+ * Inverse of gmtime().
+ */
+time_t timegm(struct tm* _Nonnull __tm);
+
+/**
+ * [strptime(3)](http://man7.org/linux/man-pages/man3/strptime.3.html) parses
+ * a string `s` assuming format `fmt` into broken-down time `tm`.
+ *
+ * Returns a pointer to the first character _not_ parsed, or null if no characters were parsed.
+ */
char* _Nullable strptime(const char* _Nonnull __s, const char* _Nonnull __fmt, struct tm* _Nonnull __tm) __strftimelike(2);
+
+/**
+ * Equivalent to strptime() on Android where only C/POSIX locales are available.
+ */
char* _Nullable strptime_l(const char* _Nonnull __s, const char* _Nonnull __fmt, struct tm* _Nonnull __tm, locale_t _Nonnull __l) __strftimelike(2) __INTRODUCED_IN(28);
+/**
+ * [strftime(3)](http://man7.org/linux/man-pages/man3/strftime.3.html) formats
+ * a broken-down time `tm` into the buffer `buf` using format `fmt`.
+ *
+ * Returns a pointer to the first character _not_ parsed, or null if no characters were parsed.
+ */
size_t strftime(char* _Nonnull __buf, size_t __n, const char* _Nonnull __fmt, const struct tm* _Nullable __tm) __strftimelike(3);
-size_t strftime_l(char* _Nonnull __buf, size_t __n, const char* _Nonnull __fmt, const struct tm* _Nullable __tm, locale_t _Nonnull __l) __strftimelike(3) __INTRODUCED_IN(21);
+/**
+ * Equivalent to strftime() on Android where only C/POSIX locales are available.
+ */
+size_t strftime_l(char* _Nonnull __buf, size_t __n, const char* _Nonnull __fmt, const struct tm* _Nullable __tm, locale_t _Nonnull __l) __strftimelike(3);
+
+/**
+ * [ctime(3)](http://man7.org/linux/man-pages/man3/ctime.3p.html) formats
+ * the time `tm` as a string.
+ *
+ * Returns a pointer to a string on success, and returns NULL on failure.
+ *
+ * That string will be overwritten by later calls to this function.
+ *
+ * New code should prefer strftime().
+ */
char* _Nullable ctime(const time_t* _Nonnull __t);
+
+/**
+ * [ctime_r(3)](http://man7.org/linux/man-pages/man3/ctime.3p.html) formats
+ * the time `tm` as a string in the given buffer `buf`.
+ *
+ * Returns a pointer to a string on success, and returns NULL on failure.
+ *
+ * New code should prefer strftime().
+ */
char* _Nullable ctime_r(const time_t* _Nonnull __t, char* _Nonnull __buf);
+/**
+ * [tzset(3)](http://man7.org/linux/man-pages/man3/tzset.3.html) tells
+ * libc that the timezone has changed.
+ *
+ * tzset() on Android looks at both the system property
+ * `persist.sys.timezone` and the environment variable `TZ`. The former is
+ * the device's current timezone as shown in Settings, while the latter is
+ * usually unset but can be used to override the global setting. This is a
+ * bad idea outside of unit tests or single-threaded programs because it's
+ * inherently thread-unsafe. See tzalloc(), localtime_rz(), mktime_z(),
+ * and tzfree() for an alternative.
+ */
void tzset(void);
+/**
+ * tzalloc(3) allocates a timezone corresponding to the given Olson ID.
+ *
+ * A null `id` returns the system timezone (as seen in Settings) from
+ * the system property `persist.sys.timezone`, ignoring `$TZ`. Although
+ * tzset() honors `$TZ`, callers of tzalloc() can use `$TZ` themselves if
+ * that's the (thread-unsafe) behavior they want, but by ignoring `$TZ`
+ * tzalloc() is thread safe (though obviously the system timezone can
+ * change, especially if your mobile device is actually mobile!).
+ *
+ * To use this with std::unique_ptr you'll want something like
+ * `std::unique_ptr<std::remove_pointer_t<timezone_t>, decltype(&tzfree)> tz{tzalloc("Asia/Seoul"), tzfree};`
+ * to remove the pointer.
+ *
+ * Returns a timezone object on success, and returns NULL and sets `errno` on failure.
+ *
+ * Available since API level 35.
+ */
+timezone_t _Nullable tzalloc(const char* _Nullable __id) __INTRODUCED_IN(35);
+
+/**
+ * tzfree(3) frees a timezone object returned by tzalloc().
+ *
+ * To use this with std::unique_ptr you'll want something like
+ * `std::unique_ptr<std::remove_pointer_t<timezone_t>, decltype(&tzfree)> tz{tzalloc("Asia/Seoul"), tzfree};`
+ * to remove the pointer.
+ *
+ * Available since API level 35.
+ */
+void tzfree(timezone_t _Nullable __tz) __INTRODUCED_IN(35);
+
+/**
+ * [clock(3)](http://man7.org/linux/man-pages/man3/clock.3.html)
+ * returns an approximation of CPU time used, equivalent to
+ * `clock_gettime(CLOCK_PROCESS_CPUTIME_ID)` but with more confusing
+ * units. Use `CLOCKS_PER_SEC` to convert the result to seconds.
+ *
+ * Returns the time in seconds on success, and returns -1 and sets `errno` on failure.
+ *
+ * New code should prefer `clock_gettime(CLOCK_PROCESS_CPUTIME_ID)`.
+ */
clock_t clock(void);
+/**
+ * [clock_getcpuclockid(3)](http://man7.org/linux/man-pages/man3/clock_getcpuclockid.3.html)
+ * gets the clock ID of the cpu-time clock for the given `pid`.
+ *
+ * Returns 0 on success, and returns -1 and returns an error number on failure.
+ */
int clock_getcpuclockid(pid_t __pid, clockid_t* _Nonnull __clock) __INTRODUCED_IN(23);
-
+/**
+ * [clock_getres(2)](http://man7.org/linux/man-pages/man2/clock_getres.2.html)
+ * gets the resolution of the given clock.
+ *
+ * Returns 0 on success, and returns -1 and returns an error number on failure.
+ */
int clock_getres(clockid_t __clock, struct timespec* _Nullable __resolution);
+
+/**
+ * [clock_gettime(2)](http://man7.org/linux/man-pages/man2/clock_gettime.2.html)
+ * gets the time according to the given clock.
+ *
+ * Returns 0 on success, and returns -1 and returns an error number on failure.
+ */
int clock_gettime(clockid_t __clock, struct timespec* _Nonnull __ts);
+
+/**
+ * [clock_nanosleep(2)](http://man7.org/linux/man-pages/man2/clock_nanosleep.2.html)
+ * sleeps for the given time as measured by the given clock.
+ *
+ * Returns 0 on success, and returns -1 and returns an error number on failure.
+ * If the sleep was interrupted by a signal, the return value will be `EINTR`
+ * and `remainder` will be the amount of time remaining.
+ */
int clock_nanosleep(clockid_t __clock, int __flags, const struct timespec* _Nonnull __request, struct timespec* _Nullable __remainder);
+
+/**
+ * [clock_settime(2)](http://man7.org/linux/man-pages/man2/clock_settime.2.html)
+ * sets the time for the given clock.
+ *
+ * Returns 0 on success, and returns -1 and returns an error number on failure.
+ */
int clock_settime(clockid_t __clock, const struct timespec* _Nonnull __ts);
+/**
+ * [timer_create(2)](http://man7.org/linux/man-pages/man2/timer_create.2.html)
+ * creates a POSIX timer.
+ *
+ * Returns 0 on success, and returns -1 and sets `errno` on failure.
+ */
int timer_create(clockid_t __clock, struct sigevent* _Nullable __event, timer_t _Nonnull * _Nonnull __timer_ptr);
-int timer_delete(timer_t _Nonnull __timer);
-int timer_settime(timer_t _Nonnull __timer, int __flags, const struct itimerspec* _Nonnull __new_value, struct itimerspec* _Nullable __old_value);
-int timer_gettime(timer_t _Nonnull _timer, struct itimerspec* _Nonnull __ts);
-int timer_getoverrun(timer_t _Nonnull __timer);
-/* Non-standard extensions that are in the BSDs and glibc. */
-time_t timelocal(struct tm* _Nonnull __tm);
-time_t timegm(struct tm* _Nonnull __tm);
+/**
+ * [timer_delete(2)](http://man7.org/linux/man-pages/man2/timer_delete.2.html)
+ * destroys a POSIX timer.
+ *
+ * Returns 0 on success, and returns -1 and sets `errno` on failure.
+ */
+int timer_delete(timer_t _Nonnull __timer);
+
+/**
+ * [timer_settime(2)](http://man7.org/linux/man-pages/man2/timer_settime.2.html)
+ * starts or stops a POSIX timer.
+ *
+ * Returns 0 on success, and returns -1 and sets `errno` on failure.
+ */
+int timer_settime(timer_t _Nonnull __timer, int __flags, const struct itimerspec* _Nonnull __new_value, struct itimerspec* _Nullable __old_value);
+
+/**
+ * [timer_gettime(2)](http://man7.org/linux/man-pages/man2/timer_gettime.2.html)
+ * gets the time until the given timer next fires.
+ *
+ * Returns 0 on success, and returns -1 and sets `errno` on failure.
+ */
+int timer_gettime(timer_t _Nonnull _timer, struct itimerspec* _Nonnull __ts);
+
+/**
+ * [timer_getoverrun(2)](http://man7.org/linux/man-pages/man2/timer_getoverrun.2.html)
+ * gets the overrun count (the number of times the timer should have fired, but
+ * didn't) for the last time the timer fired.
+ *
+ * Returns the overrun count on success, and returns -1 and sets `errno` on failure.
+ */
+int timer_getoverrun(timer_t _Nonnull __timer);
/**
* The timebase for timespec_get() and timespec_getres() corresponding to CLOCK_REALTIME.
diff --git a/libc/include/uchar.h b/libc/include/uchar.h
index 90af651..626372a 100644
--- a/libc/include/uchar.h
+++ b/libc/include/uchar.h
@@ -35,6 +35,8 @@
#include <stddef.h>
#include <sys/cdefs.h>
+
+#include <bits/bionic_multibyte_result.h>
#include <bits/mbstate_t.h>
__BEGIN_DECLS
@@ -58,10 +60,8 @@
*
* Returns the number of bytes written to `__buf` on success, and returns -1 and sets `errno`
* on failure.
- *
- * Available since API level 21.
*/
-size_t c16rtomb(char* _Nullable __buf, char16_t __ch16, mbstate_t* _Nullable __ps) __INTRODUCED_IN(21);
+size_t c16rtomb(char* _Nullable __buf, char16_t __ch16, mbstate_t* _Nullable __ps);
/**
* [c32rtomb(3)](http://man7.org/linux/man-pages/man3/c32rtomb.3.html) converts a single UTF-32
@@ -69,25 +69,19 @@
*
* Returns the number of bytes written to `__buf` on success, and returns -1 and sets `errno`
* on failure.
- *
- * Available since API level 21.
*/
-size_t c32rtomb(char* _Nullable __buf, char32_t __ch32, mbstate_t* _Nullable __ps) __INTRODUCED_IN(21);
+size_t c32rtomb(char* _Nullable __buf, char32_t __ch32, mbstate_t* _Nullable __ps);
/**
* [mbrtoc16(3)](http://man7.org/linux/man-pages/man3/mbrtoc16.3.html) converts the next UTF-8
* sequence to a UTF-16 code point.
- *
- * Available since API level 21.
*/
-size_t mbrtoc16(char16_t* _Nullable __ch16, const char* _Nullable __s, size_t __n, mbstate_t* _Nullable __ps) __INTRODUCED_IN(21);
+size_t mbrtoc16(char16_t* _Nullable __ch16, const char* _Nullable __s, size_t __n, mbstate_t* _Nullable __ps);
/**
* [mbrtoc32(3)](http://man7.org/linux/man-pages/man3/mbrtoc32.3.html) converts the next UTF-8
* sequence to a UTF-32 code point.
- *
- * Available since API level 21.
*/
-size_t mbrtoc32(char32_t* _Nullable __ch32, const char* _Nullable __s, size_t __n, mbstate_t* _Nullable __ps) __INTRODUCED_IN(21);
+size_t mbrtoc32(char32_t* _Nullable __ch32, const char* _Nullable __s, size_t __n, mbstate_t* _Nullable __ps);
__END_DECLS
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index 7ad94e1..dcad630 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -34,6 +34,7 @@
#include <sys/select.h>
#include <bits/fcntl.h>
+#include <bits/getentropy.h>
#include <bits/getopt.h>
#include <bits/ioctl.h>
#include <bits/lockf.h>
@@ -86,12 +87,12 @@
pid_t getppid(void);
pid_t getpgrp(void);
int setpgrp(void);
-pid_t getsid(pid_t __pid) __INTRODUCED_IN(17);
+pid_t getsid(pid_t __pid);
pid_t setsid(void);
int execv(const char* _Nonnull __path, char* _Nullable const* _Nullable __argv);
int execvp(const char* _Nonnull __file, char* _Nullable const* _Nullable __argv);
-int execvpe(const char* _Nonnull __file, char* _Nullable const* _Nullable __argv, char* _Nullable const* _Nullable __envp) __INTRODUCED_IN(21);
+int execvpe(const char* _Nonnull __file, char* _Nullable const* _Nullable __argv, char* _Nullable const* _Nullable __envp);
int execve(const char* _Nonnull __file, char* _Nullable const* _Nullable __argv, char* _Nullable const* _Nullable __envp);
int execl(const char* _Nonnull __path, const char* _Nullable __arg0, ...) __attribute__((__sentinel__));
int execlp(const char* _Nonnull __file, const char* _Nullable __arg0, ...) __attribute__((__sentinel__));
@@ -206,7 +207,7 @@
int access(const char* _Nonnull __path, int __mode);
int faccessat(int __dirfd, const char* _Nonnull __path, int __mode, int __flags);
int link(const char* _Nonnull __old_path, const char* _Nonnull __new_path);
-int linkat(int __old_dir_fd, const char* _Nonnull __old_path, int __new_dir_fd, const char* _Nonnull __new_path, int __flags) __INTRODUCED_IN(21);
+int linkat(int __old_dir_fd, const char* _Nonnull __old_path, int __new_dir_fd, const char* _Nonnull __new_path, int __flags);
int unlink(const char* _Nonnull __path);
int unlinkat(int __dirfd, const char* _Nonnull __path, int __flags);
int chdir(const char* _Nonnull __path);
@@ -218,10 +219,9 @@
#endif
int chroot(const char* _Nonnull __path);
int symlink(const char* _Nonnull __old_path, const char* _Nonnull __new_path);
-int symlinkat(const char* _Nonnull __old_path, int __new_dir_fd, const char* _Nonnull __new_path) __INTRODUCED_IN(21);
+int symlinkat(const char* _Nonnull __old_path, int __new_dir_fd, const char* _Nonnull __new_path);
ssize_t readlink(const char* _Nonnull __path, char* _Nonnull __buf, size_t __buf_size);
-ssize_t readlinkat(int __dir_fd, const char* _Nonnull __path, char* _Nonnull __buf, size_t __buf_size)
- __INTRODUCED_IN(21);
+ssize_t readlinkat(int __dir_fd, const char* _Nonnull __path, char* _Nonnull __buf, size_t __buf_size);
int chown(const char* _Nonnull __path, uid_t __owner, gid_t __group);
int fchown(int __fd, uid_t __owner, gid_t __group);
int fchownat(int __dir_fd, const char* _Nonnull __path, uid_t __owner, gid_t __group, int __flags);
@@ -261,13 +261,13 @@
int dup(int __old_fd);
int dup2(int __old_fd, int __new_fd);
-int dup3(int __old_fd, int __new_fd, int __flags) __INTRODUCED_IN(21);
+int dup3(int __old_fd, int __new_fd, int __flags);
int fsync(int __fd);
int fdatasync(int __fd);
/* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */
#if defined(__USE_FILE_OFFSET64)
-int truncate(const char* _Nonnull __path, off_t __length) __RENAME(truncate64) __INTRODUCED_IN(21);
+int truncate(const char* _Nonnull __path, off_t __length) __RENAME(truncate64);
off_t lseek(int __fd, off_t __offset, int __whence) __RENAME(lseek64);
ssize_t pread(int __fd, void* _Nonnull __buf, size_t __count, off_t __offset) __RENAME(pread64);
ssize_t pwrite(int __fd, const void* _Nonnull __buf, size_t __count, off_t __offset) __RENAME(pwrite64);
@@ -280,7 +280,7 @@
int ftruncate(int __fd, off_t __length);
#endif
-int truncate64(const char* _Nonnull __path, off64_t __length) __INTRODUCED_IN(21);
+int truncate64(const char* _Nonnull __path, off64_t __length);
off64_t lseek64(int __fd, off64_t __offset, int __whence);
ssize_t pread64(int __fd, void* _Nonnull __buf, size_t __count, off64_t __offset);
ssize_t pwrite64(int __fd, const void* _Nonnull __buf, size_t __count, off64_t __offset);
@@ -303,7 +303,7 @@
int acct(const char* _Nullable __path);
-int getpagesize(void) __INTRODUCED_IN(21);
+int getpagesize(void) __attribute_const__;
long syscall(long __number, ...);
diff --git a/libc/include/wchar.h b/libc/include/wchar.h
index 39f9374..c4e9679 100644
--- a/libc/include/wchar.h
+++ b/libc/include/wchar.h
@@ -37,6 +37,7 @@
#include <time.h>
#include <xlocale.h>
+#include <bits/bionic_multibyte_result.h>
#include <bits/mbstate_t.h>
#include <bits/wchar_limits.h>
#include <bits/wctype.h>
@@ -57,18 +58,19 @@
size_t mbrlen(const char* _Nullable __s, size_t __n, mbstate_t* _Nullable __ps);
size_t mbrtowc(wchar_t* _Nullable __buf, const char* _Nullable __s, size_t __n, mbstate_t* _Nullable __ps);
size_t mbsrtowcs(wchar_t* _Nullable __dst, const char* _Nullable * _Nonnull __src, size_t __dst_n, mbstate_t* _Nullable __ps);
-size_t mbsnrtowcs(wchar_t* _Nullable __dst, const char* _Nullable * _Nullable __src, size_t __src_n, size_t __dst_n, mbstate_t* _Nullable __ps) __INTRODUCED_IN(21);
+size_t mbsrtowcs_l(wchar_t* _Nullable __dst, const char* _Nullable * _Nonnull __src, size_t __dst_n, mbstate_t* _Nullable __ps, locale_t _Nonnull __l) __INTRODUCED_IN(35);
+size_t mbsnrtowcs(wchar_t* _Nullable __dst, const char* _Nullable * _Nullable __src, size_t __src_n, size_t __dst_n, mbstate_t* _Nullable __ps);
wint_t putwc(wchar_t __wc, FILE* _Nonnull __fp);
wint_t putwchar(wchar_t __wc);
int swprintf(wchar_t* _Nonnull __buf, size_t __n, const wchar_t* _Nonnull __fmt, ...);
int swscanf(const wchar_t* _Nonnull __s, const wchar_t* _Nonnull __fmt, ...);
wint_t ungetwc(wint_t __wc, FILE* _Nonnull __fp);
int vfwprintf(FILE* _Nonnull __fp, const wchar_t* _Nonnull __fmt, va_list __args);
-int vfwscanf(FILE* _Nonnull __fp, const wchar_t* _Nonnull __fmt, va_list __args) __INTRODUCED_IN(21);
+int vfwscanf(FILE* _Nonnull __fp, const wchar_t* _Nonnull __fmt, va_list __args);
int vswprintf(wchar_t* _Nonnull __buf, size_t __n, const wchar_t* _Nonnull __fmt, va_list __args);
-int vswscanf(const wchar_t* _Nonnull __s, const wchar_t* _Nonnull __fmt, va_list __args) __INTRODUCED_IN(21);
+int vswscanf(const wchar_t* _Nonnull __s, const wchar_t* _Nonnull __fmt, va_list __args);
int vwprintf(const wchar_t* _Nonnull __fmt, va_list __args);
-int vwscanf(const wchar_t* _Nonnull __fmt, va_list __args) __INTRODUCED_IN(21);
+int vwscanf(const wchar_t* _Nonnull __fmt, va_list __args);
wchar_t* _Nonnull wcpcpy(wchar_t* _Nonnull __dst, const wchar_t* _Nonnull __src);
wchar_t* _Nonnull wcpncpy(wchar_t* _Nonnull __dst, const wchar_t* _Nonnull __src, size_t __n);
size_t wcrtomb(char* _Nullable __buf, wchar_t __wc, mbstate_t* _Nullable __ps);
@@ -88,24 +90,25 @@
wchar_t* _Nonnull wcsncat(wchar_t* _Nonnull __dst, const wchar_t* _Nonnull __src, size_t __n);
int wcsncmp(const wchar_t* _Nonnull __lhs, const wchar_t* _Nonnull __rhs, size_t __n);
wchar_t* _Nonnull wcsncpy(wchar_t* _Nonnull __dst, const wchar_t* _Nonnull __src, size_t __n);
-size_t wcsnrtombs(char* _Nullable __dst, const wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __src, size_t __src_n, size_t __dst_n, mbstate_t* _Nullable __ps) __INTRODUCED_IN(21);
+size_t wcsnrtombs(char* _Nullable __dst, const wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __src, size_t __src_n, size_t __dst_n, mbstate_t* _Nullable __ps);
wchar_t* _Nullable wcspbrk(const wchar_t* _Nonnull __s, const wchar_t* _Nonnull __accept);
wchar_t* _Nullable wcsrchr(const wchar_t* _Nonnull __s, wchar_t __wc);
size_t wcsrtombs(char* _Nullable __dst, const wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __src, size_t __dst_n, mbstate_t* _Nullable __ps);
+size_t wcsrtombs_l(char* _Nullable __dst, const wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __src, size_t __dst_n, mbstate_t* _Nullable __ps, locale_t _Nonnull __l) __INTRODUCED_IN(35);
size_t wcsspn(const wchar_t* _Nonnull __s, const wchar_t* _Nonnull __accept);
wchar_t* _Nullable wcsstr(const wchar_t* _Nonnull __haystack, const wchar_t* _Nonnull __needle);
double wcstod(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr);
double wcstod_l(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, locale_t _Nonnull __l) __INTRODUCED_IN(28);
-float wcstof(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr) __INTRODUCED_IN(21);
+float wcstof(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr);
float wcstof_l(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, locale_t _Nonnull __l) __INTRODUCED_IN(28);
wchar_t* _Nullable wcstok(wchar_t* _Nullable __s, const wchar_t* _Nonnull __delimiter, wchar_t* _Nonnull * _Nonnull __ptr);
long wcstol(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, int __base);
long wcstol_l(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, int __base, locale_t _Nonnull __l) __INTRODUCED_IN(28);
-long long wcstoll(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, int __base) __INTRODUCED_IN(21);
-long double wcstold(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr) __RENAME_LDBL(wcstod, 3, 21);
+long long wcstoll(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, int __base);
+long double wcstold(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr);
unsigned long wcstoul(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, int __base);
unsigned long wcstoul_l(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, int __base, locale_t _Nonnull __l) __INTRODUCED_IN(28);
-unsigned long long wcstoull(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, int __base) __INTRODUCED_IN(21);
+unsigned long long wcstoull(const wchar_t* _Nonnull __s, wchar_t* __BIONIC_COMPLICATED_NULLNESS * _Nullable __end_ptr, int __base);
int wcswidth(const wchar_t* _Nonnull __s, size_t __n);
size_t wcsxfrm(wchar_t* __BIONIC_COMPLICATED_NULLNESS __dst, const wchar_t* _Nonnull __src, size_t __n);
int wctob(wint_t __wc);
@@ -121,13 +124,12 @@
int wprintf(const wchar_t* _Nonnull __fmt, ...);
int wscanf(const wchar_t* _Nonnull __fmt, ...);
-long long wcstoll_l(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-unsigned long long wcstoull_l(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-long double wcstold_l(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, locale_t _Nonnull __l) __INTRODUCED_IN(21);
+long long wcstoll_l(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l);
+unsigned long long wcstoull_l(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l);
+long double wcstold_l(const wchar_t* _Nonnull __s, wchar_t* _Nullable * _Nullable __end_ptr, locale_t _Nonnull __l);
-int wcscoll_l(const wchar_t* _Nonnull __lhs, const wchar_t* _Nonnull __rhs, locale_t _Nonnull __l) __attribute_pure__
- __INTRODUCED_IN(21);
-size_t wcsxfrm_l(wchar_t* __BIONIC_COMPLICATED_NULLNESS __dst, const wchar_t* _Nonnull __src, size_t __n, locale_t _Nonnull __l) __INTRODUCED_IN(21);
+int wcscoll_l(const wchar_t* _Nonnull __lhs, const wchar_t* _Nonnull __rhs, locale_t _Nonnull __l) __attribute_pure__;
+size_t wcsxfrm_l(wchar_t* __BIONIC_COMPLICATED_NULLNESS __dst, const wchar_t* _Nonnull __src, size_t __n, locale_t _Nonnull __l);
size_t wcslcat(wchar_t* _Nonnull __dst, const wchar_t* _Nonnull __src, size_t __n);
size_t wcslcpy(wchar_t* _Nonnull __dst, const wchar_t* _Nonnull __src, size_t __n);
diff --git a/libc/include/wctype.h b/libc/include/wctype.h
index 344343f..4f6f81f 100644
--- a/libc/include/wctype.h
+++ b/libc/include/wctype.h
@@ -35,27 +35,27 @@
__BEGIN_DECLS
-int iswalnum_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswalpha_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswblank_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswcntrl_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswdigit_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswgraph_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswlower_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswprint_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswpunct_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswspace_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswupper_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswxdigit_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
+int iswalnum_l(wint_t __wc, locale_t _Nonnull __l);
+int iswalpha_l(wint_t __wc, locale_t _Nonnull __l);
+int iswblank_l(wint_t __wc, locale_t _Nonnull __l);
+int iswcntrl_l(wint_t __wc, locale_t _Nonnull __l);
+int iswdigit_l(wint_t __wc, locale_t _Nonnull __l);
+int iswgraph_l(wint_t __wc, locale_t _Nonnull __l);
+int iswlower_l(wint_t __wc, locale_t _Nonnull __l);
+int iswprint_l(wint_t __wc, locale_t _Nonnull __l);
+int iswpunct_l(wint_t __wc, locale_t _Nonnull __l);
+int iswspace_l(wint_t __wc, locale_t _Nonnull __l);
+int iswupper_l(wint_t __wc, locale_t _Nonnull __l);
+int iswxdigit_l(wint_t __wc, locale_t _Nonnull __l);
-wint_t towlower_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-wint_t towupper_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21);
+wint_t towlower_l(wint_t __wc, locale_t _Nonnull __l);
+wint_t towupper_l(wint_t __wc, locale_t _Nonnull __l);
wint_t towctrans_l(wint_t __wc, wctrans_t _Nonnull __transform, locale_t _Nonnull __l) __INTRODUCED_IN(26);
wctrans_t _Nonnull wctrans_l(const char* _Nonnull __name, locale_t _Nonnull __l) __INTRODUCED_IN(26);
-wctype_t wctype_l(const char* _Nonnull __name, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-int iswctype_l(wint_t __wc, wctype_t __transform, locale_t _Nonnull __l) __INTRODUCED_IN(21);
+wctype_t wctype_l(const char* _Nonnull __name, locale_t _Nonnull __l);
+int iswctype_l(wint_t __wc, wctype_t __transform, locale_t _Nonnull __l);
__END_DECLS
diff --git a/libc/kernel/uapi/asm-arm/asm/unistd-eabi.h b/libc/kernel/uapi/asm-arm/asm/unistd-eabi.h
index 71b25e7..b9ea9bc 100644
--- a/libc/kernel/uapi/asm-arm/asm/unistd-eabi.h
+++ b/libc/kernel/uapi/asm-arm/asm/unistd-eabi.h
@@ -421,4 +421,5 @@
#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
#define __NR_set_mempolicy_home_node (__NR_SYSCALL_BASE + 450)
+#define __NR_cachestat (__NR_SYSCALL_BASE + 451)
#endif
diff --git a/libc/kernel/uapi/asm-arm/asm/unistd-oabi.h b/libc/kernel/uapi/asm-arm/asm/unistd-oabi.h
index 08b3b9a..f7eb7ca 100644
--- a/libc/kernel/uapi/asm-arm/asm/unistd-oabi.h
+++ b/libc/kernel/uapi/asm-arm/asm/unistd-oabi.h
@@ -433,4 +433,5 @@
#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
#define __NR_set_mempolicy_home_node (__NR_SYSCALL_BASE + 450)
+#define __NR_cachestat (__NR_SYSCALL_BASE + 451)
#endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/hwcap.h b/libc/kernel/uapi/asm-arm64/asm/hwcap.h
index bb592e4..7852454 100644
--- a/libc/kernel/uapi/asm-arm64/asm/hwcap.h
+++ b/libc/kernel/uapi/asm-arm64/asm/hwcap.h
@@ -87,4 +87,11 @@
#define HWCAP2_CSSC (1UL << 34)
#define HWCAP2_RPRFM (1UL << 35)
#define HWCAP2_SVE2P1 (1UL << 36)
+#define HWCAP2_SME2 (1UL << 37)
+#define HWCAP2_SME2P1 (1UL << 38)
+#define HWCAP2_SME_I16I32 (1UL << 39)
+#define HWCAP2_SME_BI32I32 (1UL << 40)
+#define HWCAP2_SME_B16B16 (1UL << 41)
+#define HWCAP2_SME_F16F16 (1UL << 42)
+#define HWCAP2_MOPS (1UL << 43)
#endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/kvm.h b/libc/kernel/uapi/asm-arm64/asm/kvm.h
index ce0c318..ea690eb 100644
--- a/libc/kernel/uapi/asm-arm64/asm/kvm.h
+++ b/libc/kernel/uapi/asm-arm64/asm/kvm.h
@@ -74,6 +74,7 @@
#define KVM_ARM_VCPU_SVE 4
#define KVM_ARM_VCPU_PTRAUTH_ADDRESS 5
#define KVM_ARM_VCPU_PTRAUTH_GENERIC 6
+#define KVM_ARM_VCPU_HAS_EL2 7
struct kvm_vcpu_init {
__u32 target;
__u32 features[7];
@@ -125,6 +126,10 @@
__u64 flags;
__u64 reserved[2];
};
+struct kvm_arm_counter_offset {
+ __u64 counter_offset;
+ __u64 reserved;
+};
#define KVM_ARM_TAGS_TO_GUEST 0
#define KVM_ARM_TAGS_FROM_GUEST 1
#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
@@ -203,6 +208,8 @@
KVM_REG_ARM_VENDOR_HYP_BIT_FUNC_FEAT = 0,
KVM_REG_ARM_VENDOR_HYP_BIT_PTP = 1,
};
+#define KVM_ARM_VM_SMCCC_CTRL 0
+#define KVM_ARM_VM_SMCCC_FILTER 0
#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
@@ -236,6 +243,8 @@
#define KVM_ARM_VCPU_TIMER_CTRL 1
#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
+#define KVM_ARM_VCPU_TIMER_IRQ_HVTIMER 2
+#define KVM_ARM_VCPU_TIMER_IRQ_HPTIMER 3
#define KVM_ARM_VCPU_PVTIME_CTRL 2
#define KVM_ARM_VCPU_PVTIME_IPA 0
#define KVM_ARM_IRQ_VCPU2_SHIFT 28
@@ -265,5 +274,18 @@
#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED
#define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2 (1ULL << 0)
#define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0)
+enum kvm_smccc_filter_action {
+ KVM_SMCCC_FILTER_HANDLE = 0,
+ KVM_SMCCC_FILTER_DENY,
+ KVM_SMCCC_FILTER_FWD_TO_USER,
+};
+struct kvm_smccc_filter {
+ __u32 base;
+ __u32 nr_functions;
+ __u8 action;
+ __u8 pad[15];
+};
+#define KVM_HYPERCALL_EXIT_SMC (1U << 0)
+#define KVM_HYPERCALL_EXIT_16BIT (1U << 1)
#endif
#endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/sigcontext.h b/libc/kernel/uapi/asm-arm64/asm/sigcontext.h
index 04aa593..84cd16d 100644
--- a/libc/kernel/uapi/asm-arm64/asm/sigcontext.h
+++ b/libc/kernel/uapi/asm-arm64/asm/sigcontext.h
@@ -59,12 +59,23 @@
__u16 __reserved[2];
};
#define SVE_SIG_FLAG_SM 0x1
+#define TPIDR2_MAGIC 0x54504902
+struct tpidr2_context {
+ struct _aarch64_ctx head;
+ __u64 tpidr2;
+};
#define ZA_MAGIC 0x54366345
struct za_context {
struct _aarch64_ctx head;
__u16 vl;
__u16 __reserved[3];
};
+#define ZT_MAGIC 0x5a544e01
+struct zt_context {
+ struct _aarch64_ctx head;
+ __u16 nregs;
+ __u16 __reserved[3];
+};
#endif
#include <asm/sve_context.h>
#define SVE_VQ_BYTES __SVE_VQ_BYTES
@@ -94,4 +105,9 @@
#define ZA_SIG_REGS_SIZE(vq) ((vq * __SVE_VQ_BYTES) * (vq * __SVE_VQ_BYTES))
#define ZA_SIG_ZAV_OFFSET(vq,n) (ZA_SIG_REGS_OFFSET + (SVE_SIG_ZREG_SIZE(vq) * n))
#define ZA_SIG_CONTEXT_SIZE(vq) (ZA_SIG_REGS_OFFSET + ZA_SIG_REGS_SIZE(vq))
+#define ZT_SIG_REG_SIZE 512
+#define ZT_SIG_REG_BYTES (ZT_SIG_REG_SIZE / 8)
+#define ZT_SIG_REGS_OFFSET sizeof(struct zt_context)
+#define ZT_SIG_REGS_SIZE(n) (ZT_SIG_REG_BYTES * n)
+#define ZT_SIG_CONTEXT_SIZE(n) (sizeof(struct zt_context) + ZT_SIG_REGS_SIZE(n))
#endif
diff --git a/libc/kernel/uapi/asm-generic/bitsperlong.h b/libc/kernel/uapi/asm-generic/bitsperlong.h
index 8fb379f..e8945e3 100644
--- a/libc/kernel/uapi/asm-generic/bitsperlong.h
+++ b/libc/kernel/uapi/asm-generic/bitsperlong.h
@@ -19,6 +19,10 @@
#ifndef _UAPI__ASM_GENERIC_BITS_PER_LONG
#define _UAPI__ASM_GENERIC_BITS_PER_LONG
#ifndef __BITS_PER_LONG
+#if defined(__CHAR_BIT__) && defined(__SIZEOF_LONG__)
+#define __BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
+#else
#define __BITS_PER_LONG 32
#endif
#endif
+#endif
diff --git a/libc/kernel/uapi/asm-generic/fcntl.h b/libc/kernel/uapi/asm-generic/fcntl.h
index ea8c108..84c0481 100644
--- a/libc/kernel/uapi/asm-generic/fcntl.h
+++ b/libc/kernel/uapi/asm-generic/fcntl.h
@@ -78,7 +78,6 @@
#define __O_TMPFILE 020000000
#endif
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
-#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
#ifndef O_NDELAY
#define O_NDELAY O_NONBLOCK
#endif
diff --git a/libc/kernel/uapi/asm-generic/socket.h b/libc/kernel/uapi/asm-generic/socket.h
index 1a321bf..ec7e78a 100644
--- a/libc/kernel/uapi/asm-generic/socket.h
+++ b/libc/kernel/uapi/asm-generic/socket.h
@@ -102,6 +102,8 @@
#define SO_RESERVE_MEM 73
#define SO_TXREHASH 74
#define SO_RCVMARK 75
+#define SO_PASSPIDFD 76
+#define SO_PEERPIDFD 77
#if __BITS_PER_LONG == 64 || defined(__x86_64__) && defined(__ILP32__)
#define SO_TIMESTAMP SO_TIMESTAMP_OLD
#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
diff --git a/libc/kernel/uapi/asm-generic/unistd.h b/libc/kernel/uapi/asm-generic/unistd.h
index d23958b..24b3222 100644
--- a/libc/kernel/uapi/asm-generic/unistd.h
+++ b/libc/kernel/uapi/asm-generic/unistd.h
@@ -413,8 +413,9 @@
#define __NR_process_mrelease 448
#define __NR_futex_waitv 449
#define __NR_set_mempolicy_home_node 450
+#define __NR_cachestat 451
#undef __NR_syscalls
-#define __NR_syscalls 451
+#define __NR_syscalls 452
#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
#define __NR_fcntl __NR3264_fcntl
#define __NR_statfs __NR3264_statfs
diff --git a/libc/kernel/uapi/asm-riscv/asm/auxvec.h b/libc/kernel/uapi/asm-riscv/asm/auxvec.h
index c70be17..30c8bec 100644
--- a/libc/kernel/uapi/asm-riscv/asm/auxvec.h
+++ b/libc/kernel/uapi/asm-riscv/asm/auxvec.h
@@ -28,4 +28,5 @@
#define AT_L3_CACHESIZE 46
#define AT_L3_CACHEGEOMETRY 47
#define AT_VECTOR_SIZE_ARCH 9
+#define AT_MINSIGSTKSZ 51
#endif
diff --git a/libc/kernel/uapi/asm-riscv/asm/hwcap.h b/libc/kernel/uapi/asm-riscv/asm/hwcap.h
index d130cf7..e22e14a 100644
--- a/libc/kernel/uapi/asm-riscv/asm/hwcap.h
+++ b/libc/kernel/uapi/asm-riscv/asm/hwcap.h
@@ -24,4 +24,5 @@
#define COMPAT_HWCAP_ISA_F (1 << ('F' - 'A'))
#define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A'))
#define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A'))
+#define COMPAT_HWCAP_ISA_V (1 << ('V' - 'A'))
#endif
diff --git a/libc/kernel/uapi/asm-riscv/asm/hwprobe.h b/libc/kernel/uapi/asm-riscv/asm/hwprobe.h
new file mode 100644
index 0000000..04c9213
--- /dev/null
+++ b/libc/kernel/uapi/asm-riscv/asm/hwprobe.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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_HWPROBE_H
+#define _UAPI_ASM_HWPROBE_H
+#include <linux/types.h>
+struct riscv_hwprobe {
+ __s64 key;
+ __u64 value;
+};
+#define RISCV_HWPROBE_KEY_MVENDORID 0
+#define RISCV_HWPROBE_KEY_MARCHID 1
+#define RISCV_HWPROBE_KEY_MIMPID 2
+#define RISCV_HWPROBE_KEY_BASE_BEHAVIOR 3
+#define RISCV_HWPROBE_BASE_BEHAVIOR_IMA (1 << 0)
+#define RISCV_HWPROBE_KEY_IMA_EXT_0 4
+#define RISCV_HWPROBE_IMA_FD (1 << 0)
+#define RISCV_HWPROBE_IMA_C (1 << 1)
+#define RISCV_HWPROBE_IMA_V (1 << 2)
+#define RISCV_HWPROBE_EXT_ZBA (1 << 3)
+#define RISCV_HWPROBE_EXT_ZBB (1 << 4)
+#define RISCV_HWPROBE_EXT_ZBS (1 << 5)
+#define RISCV_HWPROBE_KEY_CPUPERF_0 5
+#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
+#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)
+#define RISCV_HWPROBE_MISALIGNED_SLOW (2 << 0)
+#define RISCV_HWPROBE_MISALIGNED_FAST (3 << 0)
+#define RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)
+#define RISCV_HWPROBE_MISALIGNED_MASK (7 << 0)
+#endif
diff --git a/libc/kernel/uapi/asm-riscv/asm/kvm.h b/libc/kernel/uapi/asm-riscv/asm/kvm.h
index b49e3a0..c595872 100644
--- a/libc/kernel/uapi/asm-riscv/asm/kvm.h
+++ b/libc/kernel/uapi/asm-riscv/asm/kvm.h
@@ -20,7 +20,9 @@
#define __LINUX_KVM_RISCV_H
#ifndef __ASSEMBLY__
#include <linux/types.h>
+#include <asm/bitsperlong.h>
#include <asm/ptrace.h>
+#define __KVM_HAVE_IRQ_LINE
#define __KVM_HAVE_READONLY_MEM
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
#define KVM_INTERRUPT_SET - 1U
@@ -43,6 +45,7 @@
unsigned long mvendorid;
unsigned long marchid;
unsigned long mimpid;
+ unsigned long zicboz_block_size;
};
struct kvm_riscv_core {
struct user_regs_struct regs;
@@ -62,6 +65,15 @@
unsigned long satp;
unsigned long scounteren;
};
+struct kvm_riscv_aia_csr {
+ unsigned long siselect;
+ unsigned long iprio1;
+ unsigned long iprio2;
+ unsigned long sieh;
+ unsigned long siph;
+ unsigned long iprio1h;
+ unsigned long iprio2h;
+};
struct kvm_riscv_timer {
__u64 frequency;
__u64 time;
@@ -81,19 +93,41 @@
KVM_RISCV_ISA_EXT_SVINVAL,
KVM_RISCV_ISA_EXT_ZIHINTPAUSE,
KVM_RISCV_ISA_EXT_ZICBOM,
+ KVM_RISCV_ISA_EXT_ZICBOZ,
+ KVM_RISCV_ISA_EXT_ZBB,
+ KVM_RISCV_ISA_EXT_SSAIA,
+ KVM_RISCV_ISA_EXT_V,
+ KVM_RISCV_ISA_EXT_SVNAPOT,
KVM_RISCV_ISA_EXT_MAX,
};
+enum KVM_RISCV_SBI_EXT_ID {
+ KVM_RISCV_SBI_EXT_V01 = 0,
+ KVM_RISCV_SBI_EXT_TIME,
+ KVM_RISCV_SBI_EXT_IPI,
+ KVM_RISCV_SBI_EXT_RFENCE,
+ KVM_RISCV_SBI_EXT_SRST,
+ KVM_RISCV_SBI_EXT_HSM,
+ KVM_RISCV_SBI_EXT_PMU,
+ KVM_RISCV_SBI_EXT_EXPERIMENTAL,
+ KVM_RISCV_SBI_EXT_VENDOR,
+ KVM_RISCV_SBI_EXT_MAX,
+};
#define KVM_RISCV_TIMER_STATE_OFF 0
#define KVM_RISCV_TIMER_STATE_ON 1
#define KVM_REG_SIZE(id) (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
#define KVM_REG_RISCV_TYPE_MASK 0x00000000FF000000
#define KVM_REG_RISCV_TYPE_SHIFT 24
+#define KVM_REG_RISCV_SUBTYPE_MASK 0x0000000000FF0000
+#define KVM_REG_RISCV_SUBTYPE_SHIFT 16
#define KVM_REG_RISCV_CONFIG (0x01 << KVM_REG_RISCV_TYPE_SHIFT)
#define KVM_REG_RISCV_CONFIG_REG(name) (offsetof(struct kvm_riscv_config, name) / sizeof(unsigned long))
#define KVM_REG_RISCV_CORE (0x02 << KVM_REG_RISCV_TYPE_SHIFT)
#define KVM_REG_RISCV_CORE_REG(name) (offsetof(struct kvm_riscv_core, name) / sizeof(unsigned long))
#define KVM_REG_RISCV_CSR (0x03 << KVM_REG_RISCV_TYPE_SHIFT)
+#define KVM_REG_RISCV_CSR_GENERAL (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
+#define KVM_REG_RISCV_CSR_AIA (0x1 << KVM_REG_RISCV_SUBTYPE_SHIFT)
#define KVM_REG_RISCV_CSR_REG(name) (offsetof(struct kvm_riscv_csr, name) / sizeof(unsigned long))
+#define KVM_REG_RISCV_CSR_AIA_REG(name) (offsetof(struct kvm_riscv_aia_csr, name) / sizeof(unsigned long))
#define KVM_REG_RISCV_TIMER (0x04 << KVM_REG_RISCV_TYPE_SHIFT)
#define KVM_REG_RISCV_TIMER_REG(name) (offsetof(struct kvm_riscv_timer, name) / sizeof(__u64))
#define KVM_REG_RISCV_FP_F (0x05 << KVM_REG_RISCV_TYPE_SHIFT)
@@ -101,5 +135,53 @@
#define KVM_REG_RISCV_FP_D (0x06 << KVM_REG_RISCV_TYPE_SHIFT)
#define KVM_REG_RISCV_FP_D_REG(name) (offsetof(struct __riscv_d_ext_state, name) / sizeof(__u64))
#define KVM_REG_RISCV_ISA_EXT (0x07 << KVM_REG_RISCV_TYPE_SHIFT)
+#define KVM_REG_RISCV_SBI_EXT (0x08 << KVM_REG_RISCV_TYPE_SHIFT)
+#define KVM_REG_RISCV_SBI_SINGLE (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
+#define KVM_REG_RISCV_SBI_MULTI_EN (0x1 << KVM_REG_RISCV_SUBTYPE_SHIFT)
+#define KVM_REG_RISCV_SBI_MULTI_DIS (0x2 << KVM_REG_RISCV_SUBTYPE_SHIFT)
+#define KVM_REG_RISCV_SBI_MULTI_REG(__ext_id) ((__ext_id) / __BITS_PER_LONG)
+#define KVM_REG_RISCV_SBI_MULTI_MASK(__ext_id) (1UL << ((__ext_id) % __BITS_PER_LONG))
+#define KVM_REG_RISCV_SBI_MULTI_REG_LAST KVM_REG_RISCV_SBI_MULTI_REG(KVM_RISCV_SBI_EXT_MAX - 1)
+#define KVM_REG_RISCV_VECTOR (0x09 << KVM_REG_RISCV_TYPE_SHIFT)
+#define KVM_REG_RISCV_VECTOR_CSR_REG(name) (offsetof(struct __riscv_v_ext_state, name) / sizeof(unsigned long))
+#define KVM_REG_RISCV_VECTOR_REG(n) ((n) + sizeof(struct __riscv_v_ext_state) / sizeof(unsigned long))
+#define KVM_DEV_RISCV_APLIC_ALIGN 0x1000
+#define KVM_DEV_RISCV_APLIC_SIZE 0x4000
+#define KVM_DEV_RISCV_APLIC_MAX_HARTS 0x4000
+#define KVM_DEV_RISCV_IMSIC_ALIGN 0x1000
+#define KVM_DEV_RISCV_IMSIC_SIZE 0x1000
+#define KVM_DEV_RISCV_AIA_GRP_CONFIG 0
+#define KVM_DEV_RISCV_AIA_CONFIG_MODE 0
+#define KVM_DEV_RISCV_AIA_CONFIG_IDS 1
+#define KVM_DEV_RISCV_AIA_CONFIG_SRCS 2
+#define KVM_DEV_RISCV_AIA_CONFIG_GROUP_BITS 3
+#define KVM_DEV_RISCV_AIA_CONFIG_GROUP_SHIFT 4
+#define KVM_DEV_RISCV_AIA_CONFIG_HART_BITS 5
+#define KVM_DEV_RISCV_AIA_CONFIG_GUEST_BITS 6
+#define KVM_DEV_RISCV_AIA_MODE_EMUL 0
+#define KVM_DEV_RISCV_AIA_MODE_HWACCEL 1
+#define KVM_DEV_RISCV_AIA_MODE_AUTO 2
+#define KVM_DEV_RISCV_AIA_IDS_MIN 63
+#define KVM_DEV_RISCV_AIA_IDS_MAX 2048
+#define KVM_DEV_RISCV_AIA_SRCS_MAX 1024
+#define KVM_DEV_RISCV_AIA_GROUP_BITS_MAX 8
+#define KVM_DEV_RISCV_AIA_GROUP_SHIFT_MIN 24
+#define KVM_DEV_RISCV_AIA_GROUP_SHIFT_MAX 56
+#define KVM_DEV_RISCV_AIA_HART_BITS_MAX 16
+#define KVM_DEV_RISCV_AIA_GUEST_BITS_MAX 8
+#define KVM_DEV_RISCV_AIA_GRP_ADDR 1
+#define KVM_DEV_RISCV_AIA_ADDR_APLIC 0
+#define KVM_DEV_RISCV_AIA_ADDR_IMSIC(__vcpu) (1 + (__vcpu))
+#define KVM_DEV_RISCV_AIA_ADDR_MAX (1 + KVM_DEV_RISCV_APLIC_MAX_HARTS)
+#define KVM_DEV_RISCV_AIA_GRP_CTRL 2
+#define KVM_DEV_RISCV_AIA_CTRL_INIT 0
+#define KVM_DEV_RISCV_AIA_GRP_APLIC 3
+#define KVM_DEV_RISCV_AIA_GRP_IMSIC 4
+#define KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS 12
+#define KVM_DEV_RISCV_AIA_IMSIC_ISEL_MASK ((1U << KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS) - 1)
+#define KVM_DEV_RISCV_AIA_IMSIC_MKATTR(__vcpu,__isel) (((__vcpu) << KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS) | ((__isel) & KVM_DEV_RISCV_AIA_IMSIC_ISEL_MASK))
+#define KVM_DEV_RISCV_AIA_IMSIC_GET_ISEL(__attr) ((__attr) & KVM_DEV_RISCV_AIA_IMSIC_ISEL_MASK)
+#define KVM_DEV_RISCV_AIA_IMSIC_GET_VCPU(__attr) ((__attr) >> KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS)
+#define KVM_NR_IRQCHIPS 1
#endif
#endif
diff --git a/libc/kernel/uapi/asm-riscv/asm/ptrace.h b/libc/kernel/uapi/asm-riscv/asm/ptrace.h
index 94e4ac9..f491908 100644
--- a/libc/kernel/uapi/asm-riscv/asm/ptrace.h
+++ b/libc/kernel/uapi/asm-riscv/asm/ptrace.h
@@ -67,10 +67,28 @@
__u32 fcsr;
__u32 reserved[3];
};
+struct __riscv_ctx_hdr {
+ __u32 magic;
+ __u32 size;
+};
+struct __riscv_extra_ext_header {
+ __u32 __padding[129] __attribute__((aligned(16)));
+ __u32 reserved;
+ struct __riscv_ctx_hdr hdr;
+};
union __riscv_fp_state {
struct __riscv_f_ext_state f;
struct __riscv_d_ext_state d;
struct __riscv_q_ext_state q;
};
+struct __riscv_v_ext_state {
+ unsigned long vstart;
+ unsigned long vl;
+ unsigned long vtype;
+ unsigned long vcsr;
+ unsigned long vlenb;
+ void * datap;
+};
+#define RISCV_MAX_VLENB (8192)
#endif
#endif
diff --git a/libc/kernel/uapi/asm-riscv/asm/setup.h b/libc/kernel/uapi/asm-riscv/asm/setup.h
index 940c4db..faac9a6 100644
--- a/libc/kernel/uapi/asm-riscv/asm/setup.h
+++ b/libc/kernel/uapi/asm-riscv/asm/setup.h
@@ -16,4 +16,7 @@
***
****************************************************************************
****************************************************************************/
-#include <asm-generic/setup.h>
+#ifndef _UAPI_ASM_RISCV_SETUP_H
+#define _UAPI_ASM_RISCV_SETUP_H
+#define COMMAND_LINE_SIZE 1024
+#endif
diff --git a/libc/kernel/uapi/asm-riscv/asm/sigcontext.h b/libc/kernel/uapi/asm-riscv/asm/sigcontext.h
index 0553b94..bf00435 100644
--- a/libc/kernel/uapi/asm-riscv/asm/sigcontext.h
+++ b/libc/kernel/uapi/asm-riscv/asm/sigcontext.h
@@ -19,8 +19,19 @@
#ifndef _UAPI_ASM_RISCV_SIGCONTEXT_H
#define _UAPI_ASM_RISCV_SIGCONTEXT_H
#include <asm/ptrace.h>
+#define RISCV_V_MAGIC 0x53465457
+#define END_MAGIC 0x0
+#define END_HDR_SIZE 0x0
+#ifndef __ASSEMBLY__
+struct __sc_riscv_v_state {
+ struct __riscv_v_ext_state v_state;
+} __attribute__((aligned(16)));
struct sigcontext {
struct user_regs_struct sc_regs;
- union __riscv_fp_state sc_fpregs;
+ union {
+ union __riscv_fp_state sc_fpregs;
+ struct __riscv_extra_ext_header sc_extdesc;
+ };
};
#endif
+#endif
diff --git a/libc/kernel/uapi/asm-riscv/asm/unistd.h b/libc/kernel/uapi/asm-riscv/asm/unistd.h
index 665b820..b321ead 100644
--- a/libc/kernel/uapi/asm-riscv/asm/unistd.h
+++ b/libc/kernel/uapi/asm-riscv/asm/unistd.h
@@ -27,3 +27,7 @@
#define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15)
#endif
__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache)
+#ifndef __NR_riscv_hwprobe
+#define __NR_riscv_hwprobe (__NR_arch_specific_syscall + 14)
+#endif
+__SYSCALL(__NR_riscv_hwprobe, sys_riscv_hwprobe)
diff --git a/libc/kernel/uapi/asm-x86/asm/kvm.h b/libc/kernel/uapi/asm-x86/asm/kvm.h
index 77d35fc..105a8e1 100644
--- a/libc/kernel/uapi/asm-x86/asm/kvm.h
+++ b/libc/kernel/uapi/asm-x86/asm/kvm.h
@@ -20,6 +20,7 @@
#define _ASM_X86_KVM_H
#include <linux/types.h>
#include <linux/ioctl.h>
+#include <linux/stddef.h>
#define KVM_PIO_PAGE_OFFSET 1
#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
#define KVM_DIRTY_LOG_PAGE_OFFSET 64
@@ -395,8 +396,8 @@
__u8 pad[120];
} hdr;
union {
- struct kvm_vmx_nested_state_data vmx[0];
- struct kvm_svm_nested_state_data svm[0];
+ __DECLARE_FLEX_ARRAY(struct kvm_vmx_nested_state_data, vmx);
+ __DECLARE_FLEX_ARRAY(struct kvm_svm_nested_state_data, svm);
} data;
};
struct kvm_pmu_event_filter {
@@ -409,6 +410,15 @@
};
#define KVM_PMU_EVENT_ALLOW 0
#define KVM_PMU_EVENT_DENY 1
+#define KVM_PMU_EVENT_FLAG_MASKED_EVENTS BIT(0)
+#define KVM_PMU_EVENT_FLAGS_VALID_MASK (KVM_PMU_EVENT_FLAG_MASKED_EVENTS)
+#define KVM_PMU_ENCODE_MASKED_ENTRY(event_select,mask,match,exclude) (((event_select) & 0xFFULL) | (((event_select) & 0XF00ULL) << 24) | (((mask) & 0xFFULL) << 56) | (((match) & 0xFFULL) << 8) | ((__u64) (! ! (exclude)) << 55))
+#define KVM_PMU_MASKED_ENTRY_EVENT_SELECT (GENMASK_ULL(7, 0) | GENMASK_ULL(35, 32))
+#define KVM_PMU_MASKED_ENTRY_UMASK_MASK (GENMASK_ULL(63, 56))
+#define KVM_PMU_MASKED_ENTRY_UMASK_MATCH (GENMASK_ULL(15, 8))
+#define KVM_PMU_MASKED_ENTRY_EXCLUDE (BIT_ULL(55))
+#define KVM_PMU_MASKED_ENTRY_UMASK_MASK_SHIFT (56)
#define KVM_VCPU_TSC_CTRL 0
#define KVM_VCPU_TSC_OFFSET 0
+#define KVM_EXIT_HYPERCALL_LONG_MODE BIT(0)
#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/mtrr.h b/libc/kernel/uapi/asm-x86/asm/mtrr.h
index c709a70..9d596ba 100644
--- a/libc/kernel/uapi/asm-x86/asm/mtrr.h
+++ b/libc/kernel/uapi/asm-x86/asm/mtrr.h
@@ -57,13 +57,6 @@
typedef __u8 mtrr_type;
#define MTRR_NUM_FIXED_RANGES 88
#define MTRR_MAX_VAR_RANGES 256
-struct mtrr_state_type {
- struct mtrr_var_range var_ranges[MTRR_MAX_VAR_RANGES];
- mtrr_type fixed_ranges[MTRR_NUM_FIXED_RANGES];
- unsigned char enabled;
- unsigned char have_fixed;
- mtrr_type def_type;
-};
#define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
#define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
#define MTRRIOC_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry)
diff --git a/libc/kernel/uapi/asm-x86/asm/prctl.h b/libc/kernel/uapi/asm-x86/asm/prctl.h
index c5ba2d6..e2fe9df 100644
--- a/libc/kernel/uapi/asm-x86/asm/prctl.h
+++ b/libc/kernel/uapi/asm-x86/asm/prctl.h
@@ -29,7 +29,13 @@
#define ARCH_REQ_XCOMP_PERM 0x1023
#define ARCH_GET_XCOMP_GUEST_PERM 0x1024
#define ARCH_REQ_XCOMP_GUEST_PERM 0x1025
+#define ARCH_XCOMP_TILECFG 17
+#define ARCH_XCOMP_TILEDATA 18
#define ARCH_MAP_VDSO_X32 0x2001
#define ARCH_MAP_VDSO_32 0x2002
#define ARCH_MAP_VDSO_64 0x2003
+#define ARCH_GET_UNTAG_MASK 0x4001
+#define ARCH_ENABLE_TAGGED_ADDR 0x4002
+#define ARCH_GET_MAX_TAG_BITS 0x4003
+#define ARCH_FORCE_TAGGED_SVA 0x4004
#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/processor-flags.h b/libc/kernel/uapi/asm-x86/asm/processor-flags.h
index 0a95afd..759b9e3 100644
--- a/libc/kernel/uapi/asm-x86/asm/processor-flags.h
+++ b/libc/kernel/uapi/asm-x86/asm/processor-flags.h
@@ -83,6 +83,10 @@
#define X86_CR3_PCD _BITUL(X86_CR3_PCD_BIT)
#define X86_CR3_PCID_BITS 12
#define X86_CR3_PCID_MASK (_AC((1UL << X86_CR3_PCID_BITS) - 1, UL))
+#define X86_CR3_LAM_U57_BIT 61
+#define X86_CR3_LAM_U57 _BITULL(X86_CR3_LAM_U57_BIT)
+#define X86_CR3_LAM_U48_BIT 62
+#define X86_CR3_LAM_U48 _BITULL(X86_CR3_LAM_U48_BIT)
#define X86_CR3_PCID_NOFLUSH_BIT 63
#define X86_CR3_PCID_NOFLUSH _BITULL(X86_CR3_PCID_NOFLUSH_BIT)
#define X86_CR4_VME_BIT 0
@@ -129,6 +133,8 @@
#define X86_CR4_PKE _BITUL(X86_CR4_PKE_BIT)
#define X86_CR4_CET_BIT 23
#define X86_CR4_CET _BITUL(X86_CR4_CET_BIT)
+#define X86_CR4_LAM_SUP_BIT 28
+#define X86_CR4_LAM_SUP _BITUL(X86_CR4_LAM_SUP_BIT)
#define X86_CR8_TPR _AC(0x0000000f, UL)
#define CX86_PCR0 0x20
#define CX86_GCR 0xb8
diff --git a/libc/kernel/uapi/asm-x86/asm/unistd_32.h b/libc/kernel/uapi/asm-x86/asm/unistd_32.h
index 8e57516..f9d8dbd 100644
--- a/libc/kernel/uapi/asm-x86/asm/unistd_32.h
+++ b/libc/kernel/uapi/asm-x86/asm/unistd_32.h
@@ -458,4 +458,5 @@
#define __NR_process_mrelease 448
#define __NR_futex_waitv 449
#define __NR_set_mempolicy_home_node 450
+#define __NR_cachestat 451
#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/unistd_64.h b/libc/kernel/uapi/asm-x86/asm/unistd_64.h
index 54ff16f..34a9ecc 100644
--- a/libc/kernel/uapi/asm-x86/asm/unistd_64.h
+++ b/libc/kernel/uapi/asm-x86/asm/unistd_64.h
@@ -380,4 +380,5 @@
#define __NR_process_mrelease 448
#define __NR_futex_waitv 449
#define __NR_set_mempolicy_home_node 450
+#define __NR_cachestat 451
#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/unistd_x32.h b/libc/kernel/uapi/asm-x86/asm/unistd_x32.h
index 1e05d75..de6c857 100644
--- a/libc/kernel/uapi/asm-x86/asm/unistd_x32.h
+++ b/libc/kernel/uapi/asm-x86/asm/unistd_x32.h
@@ -333,6 +333,7 @@
#define __NR_process_mrelease (__X32_SYSCALL_BIT + 448)
#define __NR_futex_waitv (__X32_SYSCALL_BIT + 449)
#define __NR_set_mempolicy_home_node (__X32_SYSCALL_BIT + 450)
+#define __NR_cachestat (__X32_SYSCALL_BIT + 451)
#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
diff --git a/libc/kernel/uapi/drm/amdgpu_drm.h b/libc/kernel/uapi/drm/amdgpu_drm.h
index fcd5ab8..d4ae7d4 100644
--- a/libc/kernel/uapi/drm/amdgpu_drm.h
+++ b/libc/kernel/uapi/drm/amdgpu_drm.h
@@ -126,6 +126,7 @@
#define AMDGPU_CTX_QUERY2_FLAGS_GUILTY (1 << 2)
#define AMDGPU_CTX_QUERY2_FLAGS_RAS_CE (1 << 3)
#define AMDGPU_CTX_QUERY2_FLAGS_RAS_UE (1 << 4)
+#define AMDGPU_CTX_QUERY2_FLAGS_RESET_IN_PROGRESS (1 << 5)
#define AMDGPU_CTX_PRIORITY_UNSET - 2048
#define AMDGPU_CTX_PRIORITY_VERY_LOW - 1023
#define AMDGPU_CTX_PRIORITY_LOW - 512
@@ -352,6 +353,7 @@
#define AMDGPU_CHUNK_ID_SCHEDULED_DEPENDENCIES 0x07
#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_WAIT 0x08
#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_SIGNAL 0x09
+#define AMDGPU_CHUNK_ID_CP_GFX_SHADOW 0x0a
struct drm_amdgpu_cs_chunk {
__u32 chunk_id;
__u32 length_dw;
@@ -425,9 +427,17 @@
struct drm_amdgpu_cs_chunk_fence fence_data;
};
};
+#define AMDGPU_CS_CHUNK_CP_GFX_SHADOW_FLAGS_INIT_SHADOW 0x1
+struct drm_amdgpu_cs_chunk_cp_gfx_shadow {
+ __u64 shadow_va;
+ __u64 csa_va;
+ __u64 gds_va;
+ __u64 flags;
+};
#define AMDGPU_IDS_FLAGS_FUSION 0x1
#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2
#define AMDGPU_IDS_FLAGS_TMZ 0x4
+#define AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD 0x8
#define AMDGPU_INFO_ACCEL_WORKING 0x00
#define AMDGPU_INFO_CRTC_FROM_ID 0x01
#define AMDGPU_INFO_HW_IP_INFO 0x02
@@ -486,6 +496,8 @@
#define AMDGPU_INFO_SENSOR_VDDGFX 0x7
#define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8
#define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9
+#define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_SCLK 0xa
+#define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_MCLK 0xb
#define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E
#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F
#define AMDGPU_INFO_RAS_ENABLED_FEATURES 0x20
@@ -506,6 +518,7 @@
#define AMDGPU_INFO_VIDEO_CAPS 0x21
#define AMDGPU_INFO_VIDEO_CAPS_DECODE 0
#define AMDGPU_INFO_VIDEO_CAPS_ENCODE 1
+#define AMDGPU_INFO_MAX_IBS 0x22
#define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0
#define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff
#define AMDGPU_INFO_MMR_SH_INDEX_SHIFT 8
@@ -616,7 +629,7 @@
__u32 enabled_rb_pipes_mask;
__u32 num_rb_pipes;
__u32 num_hw_gfx_contexts;
- __u32 _pad;
+ __u32 pcie_gen;
__u64 ids_flags;
__u64 virtual_address_offset;
__u64 virtual_address_max;
@@ -643,12 +656,26 @@
__u32 gs_vgt_table_depth;
__u32 gs_prim_buffer_depth;
__u32 max_gs_waves_per_vgt;
- __u32 _pad1;
+ __u32 pcie_num_lanes;
__u32 cu_ao_bitmap[4][4];
__u64 high_va_offset;
__u64 high_va_max;
__u32 pa_sc_tile_steering_override;
__u64 tcc_disabled_mask;
+ __u64 min_engine_clock;
+ __u64 min_memory_clock;
+ __u32 tcp_cache_size;
+ __u32 num_sqc_per_wgp;
+ __u32 sqc_data_cache_size;
+ __u32 sqc_inst_cache_size;
+ __u32 gl1c_cache_size;
+ __u32 gl2c_cache_size;
+ __u64 mall_size;
+ __u32 enabled_rb_pipes_mask_hi;
+ __u32 shadow_size;
+ __u32 shadow_alignment;
+ __u32 csa_size;
+ __u32 csa_alignment;
};
struct drm_amdgpu_info_hw_ip {
__u32 hw_ip_version_major;
diff --git a/libc/kernel/uapi/drm/drm_fourcc.h b/libc/kernel/uapi/drm/drm_fourcc.h
index ea9525d..006373a 100644
--- a/libc/kernel/uapi/drm/drm_fourcc.h
+++ b/libc/kernel/uapi/drm/drm_fourcc.h
@@ -179,6 +179,9 @@
#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS fourcc_mod_code(INTEL, 10)
#define I915_FORMAT_MOD_4_TILED_DG2_MC_CCS fourcc_mod_code(INTEL, 11)
#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC fourcc_mod_code(INTEL, 12)
+#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS fourcc_mod_code(INTEL, 13)
+#define I915_FORMAT_MOD_4_TILED_MTL_MC_CCS fourcc_mod_code(INTEL, 14)
+#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15)
#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
#define DRM_FORMAT_MOD_SAMSUNG_16_16_TILE fourcc_mod_code(SAMSUNG, 2)
#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
diff --git a/libc/kernel/uapi/misc/habanalabs.h b/libc/kernel/uapi/drm/habanalabs_accel.h
similarity index 95%
rename from libc/kernel/uapi/misc/habanalabs.h
rename to libc/kernel/uapi/drm/habanalabs_accel.h
index b25c833..75ec293 100644
--- a/libc/kernel/uapi/misc/habanalabs.h
+++ b/libc/kernel/uapi/drm/habanalabs_accel.h
@@ -619,7 +619,8 @@
HL_SERVER_GAUDI_HLS1H = 2,
HL_SERVER_GAUDI_TYPE1 = 3,
HL_SERVER_GAUDI_TYPE2 = 4,
- HL_SERVER_GAUDI2_HLS2 = 5
+ HL_SERVER_GAUDI2_HLS2 = 5,
+ HL_SERVER_GAUDI2_TYPE1 = 7
};
#define HL_NOTIFIER_EVENT_TPC_ASSERT (1ULL << 0)
#define HL_NOTIFIER_EVENT_UNDEFINED_OPCODE (1ULL << 1)
@@ -630,6 +631,8 @@
#define HL_NOTIFIER_EVENT_GENERAL_HW_ERR (1ULL << 6)
#define HL_NOTIFIER_EVENT_RAZWI (1ULL << 7)
#define HL_NOTIFIER_EVENT_PAGE_FAULT (1ULL << 8)
+#define HL_NOTIFIER_EVENT_CRITICL_HW_ERR (1ULL << 9)
+#define HL_NOTIFIER_EVENT_CRITICL_FW_ERR (1ULL << 10)
#define HL_INFO_HW_IP_INFO 0
#define HL_INFO_HW_EVENTS 1
#define HL_INFO_DRAM_USAGE 2
@@ -662,6 +665,9 @@
#define HL_INFO_ENGINE_STATUS 32
#define HL_INFO_PAGE_FAULT_EVENT 33
#define HL_INFO_USER_MAPPINGS 34
+#define HL_INFO_FW_GENERIC_REQ 35
+#define HL_INFO_HW_ERR_EVENT 36
+#define HL_INFO_FW_ERR_EVENT 37
#define HL_INFO_VERSION_MAX_LEN 128
#define HL_INFO_CARD_NAME_MAX_LEN 16
#define HL_ENGINES_DATA_MAX_SIZE SZ_1M
@@ -691,15 +697,20 @@
__u64 dram_page_size;
__u32 edma_enabled_mask;
__u16 number_of_user_interrupts;
- __u16 pad2;
- __u64 reserved4;
+ __u8 reserved1;
+ __u8 reserved2;
+ __u64 reserved3;
__u64 device_mem_alloc_default_page_size;
+ __u64 reserved4;
__u64 reserved5;
- __u64 reserved6;
- __u32 reserved7;
- __u8 reserved8;
+ __u32 reserved6;
+ __u8 reserved7;
__u8 revision_id;
- __u8 pad[2];
+ __u16 tpc_interrupt_id;
+ __u32 rotator_enabled_mask;
+ __u32 reserved9;
+ __u64 engine_core_interrupt_reg_addr;
+ __u64 reserved_dram_size;
};
struct hl_info_dram_usage {
__u64 dram_free_mem;
@@ -820,6 +831,21 @@
__u32 engine_id;
__u32 stream_id;
};
+struct hl_info_hw_err_event {
+ __s64 timestamp;
+ __u16 event_id;
+ __u16 pad[3];
+};
+enum hl_info_fw_err_type {
+ HL_INFO_FW_HEARTBEAT_ERR,
+ HL_INFO_FW_REPORTED_ERR,
+};
+struct hl_info_fw_err_event {
+ __s64 timestamp;
+ __u16 err_type;
+ __u16 event_id;
+ __u32 pad;
+};
struct hl_info_dev_memalloc_page_sizes {
__u64 page_order_bitmask;
};
@@ -872,6 +898,7 @@
__u32 user_buffer_actual_size;
__u32 sec_attest_nonce;
__u32 array_size;
+ __u32 fw_sub_opcode;
};
__u32 pad;
};
@@ -935,10 +962,17 @@
#define HL_CS_FLAGS_RESERVE_SIGNALS_ONLY 0x1000
#define HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY 0x2000
#define HL_CS_FLAGS_ENGINE_CORE_COMMAND 0x4000
+#define HL_CS_FLAGS_FLUSH_PCI_HBW_WRITES 0x8000
+#define HL_CS_FLAGS_ENGINES_COMMAND 0x10000
#define HL_CS_STATUS_SUCCESS 0
#define HL_MAX_JOBS_PER_CS 512
-#define HL_ENGINE_CORE_HALT (1 << 0)
-#define HL_ENGINE_CORE_RUN (1 << 1)
+enum hl_engine_command {
+ HL_ENGINE_CORE_HALT = 1,
+ HL_ENGINE_CORE_RUN = 2,
+ HL_ENGINE_STALL = 3,
+ HL_ENGINE_RESUME = 4,
+ HL_ENGINE_COMMAND_MAX
+};
struct hl_cs_in {
union {
struct {
@@ -950,6 +984,11 @@
__u32 num_engine_cores;
__u32 core_command;
};
+ struct {
+ __u64 engines;
+ __u32 num_engines;
+ __u32 engine_command;
+ };
};
union {
__u64 seq;
@@ -1072,8 +1111,9 @@
__u64 device_virt_addr;
} unmap;
struct {
- __u64 handle;
+ __u64 addr;
__u64 mem_size;
+ __u64 offset;
} export_dmabuf_fd;
};
__u32 op;
diff --git a/libc/kernel/uapi/drm/i810_drm.h b/libc/kernel/uapi/drm/i810_drm.h
deleted file mode 100644
index e33387d..0000000
--- a/libc/kernel/uapi/drm/i810_drm.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** 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 _I810_DRM_H_
-#define _I810_DRM_H_
-#include "drm.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef _I810_DEFINES_
-#define _I810_DEFINES_
-#define I810_DMA_BUF_ORDER 12
-#define I810_DMA_BUF_SZ (1 << I810_DMA_BUF_ORDER)
-#define I810_DMA_BUF_NR 256
-#define I810_NR_SAREA_CLIPRECTS 8
-#define I810_NR_TEX_REGIONS 64
-#define I810_LOG_MIN_TEX_REGION_SIZE 16
-#endif
-#define I810_UPLOAD_TEX0IMAGE 0x1
-#define I810_UPLOAD_TEX1IMAGE 0x2
-#define I810_UPLOAD_CTX 0x4
-#define I810_UPLOAD_BUFFERS 0x8
-#define I810_UPLOAD_TEX0 0x10
-#define I810_UPLOAD_TEX1 0x20
-#define I810_UPLOAD_CLIPRECTS 0x40
-#define I810_DESTREG_DI0 0
-#define I810_DESTREG_DI1 1
-#define I810_DESTREG_DV0 2
-#define I810_DESTREG_DV1 3
-#define I810_DESTREG_DR0 4
-#define I810_DESTREG_DR1 5
-#define I810_DESTREG_DR2 6
-#define I810_DESTREG_DR3 7
-#define I810_DESTREG_DR4 8
-#define I810_DEST_SETUP_SIZE 10
-#define I810_CTXREG_CF0 0
-#define I810_CTXREG_CF1 1
-#define I810_CTXREG_ST0 2
-#define I810_CTXREG_ST1 3
-#define I810_CTXREG_VF 4
-#define I810_CTXREG_MT 5
-#define I810_CTXREG_MC0 6
-#define I810_CTXREG_MC1 7
-#define I810_CTXREG_MC2 8
-#define I810_CTXREG_MA0 9
-#define I810_CTXREG_MA1 10
-#define I810_CTXREG_MA2 11
-#define I810_CTXREG_SDM 12
-#define I810_CTXREG_FOG 13
-#define I810_CTXREG_B1 14
-#define I810_CTXREG_B2 15
-#define I810_CTXREG_LCS 16
-#define I810_CTXREG_PV 17
-#define I810_CTXREG_ZA 18
-#define I810_CTXREG_AA 19
-#define I810_CTX_SETUP_SIZE 20
-#define I810_TEXREG_MI0 0
-#define I810_TEXREG_MI1 1
-#define I810_TEXREG_MI2 2
-#define I810_TEXREG_MI3 3
-#define I810_TEXREG_MF 4
-#define I810_TEXREG_MLC 5
-#define I810_TEXREG_MLL 6
-#define I810_TEXREG_MCS 7
-#define I810_TEX_SETUP_SIZE 8
-#define I810_FRONT 0x1
-#define I810_BACK 0x2
-#define I810_DEPTH 0x4
-typedef enum _drm_i810_init_func {
- I810_INIT_DMA = 0x01,
- I810_CLEANUP_DMA = 0x02,
- I810_INIT_DMA_1_4 = 0x03
-} drm_i810_init_func_t;
-typedef struct _drm_i810_init {
- drm_i810_init_func_t func;
- unsigned int mmio_offset;
- unsigned int buffers_offset;
- int sarea_priv_offset;
- unsigned int ring_start;
- unsigned int ring_end;
- unsigned int ring_size;
- unsigned int front_offset;
- unsigned int back_offset;
- unsigned int depth_offset;
- unsigned int overlay_offset;
- unsigned int overlay_physical;
- unsigned int w;
- unsigned int h;
- unsigned int pitch;
- unsigned int pitch_bits;
-} drm_i810_init_t;
-typedef struct _drm_i810_pre12_init {
- drm_i810_init_func_t func;
- unsigned int mmio_offset;
- unsigned int buffers_offset;
- int sarea_priv_offset;
- unsigned int ring_start;
- unsigned int ring_end;
- unsigned int ring_size;
- unsigned int front_offset;
- unsigned int back_offset;
- unsigned int depth_offset;
- unsigned int w;
- unsigned int h;
- unsigned int pitch;
- unsigned int pitch_bits;
-} drm_i810_pre12_init_t;
-typedef struct _drm_i810_tex_region {
- unsigned char next, prev;
- unsigned char in_use;
- int age;
-} drm_i810_tex_region_t;
-typedef struct _drm_i810_sarea {
- unsigned int ContextState[I810_CTX_SETUP_SIZE];
- unsigned int BufferState[I810_DEST_SETUP_SIZE];
- unsigned int TexState[2][I810_TEX_SETUP_SIZE];
- unsigned int dirty;
- unsigned int nbox;
- struct drm_clip_rect boxes[I810_NR_SAREA_CLIPRECTS];
- drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS + 1];
- int texAge;
- int last_enqueue;
- int last_dispatch;
- int last_quiescent;
- int ctxOwner;
- int vertex_prim;
- int pf_enabled;
- int pf_active;
- int pf_current_page;
-} drm_i810_sarea_t;
-#define DRM_I810_INIT 0x00
-#define DRM_I810_VERTEX 0x01
-#define DRM_I810_CLEAR 0x02
-#define DRM_I810_FLUSH 0x03
-#define DRM_I810_GETAGE 0x04
-#define DRM_I810_GETBUF 0x05
-#define DRM_I810_SWAP 0x06
-#define DRM_I810_COPY 0x07
-#define DRM_I810_DOCOPY 0x08
-#define DRM_I810_OV0INFO 0x09
-#define DRM_I810_FSTATUS 0x0a
-#define DRM_I810_OV0FLIP 0x0b
-#define DRM_I810_MC 0x0c
-#define DRM_I810_RSTATUS 0x0d
-#define DRM_I810_FLIP 0x0e
-#define DRM_IOCTL_I810_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I810_INIT, drm_i810_init_t)
-#define DRM_IOCTL_I810_VERTEX DRM_IOW(DRM_COMMAND_BASE + DRM_I810_VERTEX, drm_i810_vertex_t)
-#define DRM_IOCTL_I810_CLEAR DRM_IOW(DRM_COMMAND_BASE + DRM_I810_CLEAR, drm_i810_clear_t)
-#define DRM_IOCTL_I810_FLUSH DRM_IO(DRM_COMMAND_BASE + DRM_I810_FLUSH)
-#define DRM_IOCTL_I810_GETAGE DRM_IO(DRM_COMMAND_BASE + DRM_I810_GETAGE)
-#define DRM_IOCTL_I810_GETBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_I810_GETBUF, drm_i810_dma_t)
-#define DRM_IOCTL_I810_SWAP DRM_IO(DRM_COMMAND_BASE + DRM_I810_SWAP)
-#define DRM_IOCTL_I810_COPY DRM_IOW(DRM_COMMAND_BASE + DRM_I810_COPY, drm_i810_copy_t)
-#define DRM_IOCTL_I810_DOCOPY DRM_IO(DRM_COMMAND_BASE + DRM_I810_DOCOPY)
-#define DRM_IOCTL_I810_OV0INFO DRM_IOR(DRM_COMMAND_BASE + DRM_I810_OV0INFO, drm_i810_overlay_t)
-#define DRM_IOCTL_I810_FSTATUS DRM_IO(DRM_COMMAND_BASE + DRM_I810_FSTATUS)
-#define DRM_IOCTL_I810_OV0FLIP DRM_IO(DRM_COMMAND_BASE + DRM_I810_OV0FLIP)
-#define DRM_IOCTL_I810_MC DRM_IOW(DRM_COMMAND_BASE + DRM_I810_MC, drm_i810_mc_t)
-#define DRM_IOCTL_I810_RSTATUS DRM_IO(DRM_COMMAND_BASE + DRM_I810_RSTATUS)
-#define DRM_IOCTL_I810_FLIP DRM_IO(DRM_COMMAND_BASE + DRM_I810_FLIP)
-typedef struct _drm_i810_clear {
- int clear_color;
- int clear_depth;
- int flags;
-} drm_i810_clear_t;
-typedef struct _drm_i810_vertex {
- int idx;
- int used;
- int discard;
-} drm_i810_vertex_t;
-typedef struct _drm_i810_copy_t {
- int idx;
- int used;
- void * address;
-} drm_i810_copy_t;
-#define PR_TRIANGLES (0x0 << 18)
-#define PR_TRISTRIP_0 (0x1 << 18)
-#define PR_TRISTRIP_1 (0x2 << 18)
-#define PR_TRIFAN (0x3 << 18)
-#define PR_POLYGON (0x4 << 18)
-#define PR_LINES (0x5 << 18)
-#define PR_LINESTRIP (0x6 << 18)
-#define PR_RECTS (0x7 << 18)
-#define PR_MASK (0x7 << 18)
-typedef struct drm_i810_dma {
- void * __linux_virtual;
- int request_idx;
- int request_size;
- int granted;
-} drm_i810_dma_t;
-typedef struct _drm_i810_overlay_t {
- unsigned int offset;
- unsigned int physical;
-} drm_i810_overlay_t;
-typedef struct _drm_i810_mc {
- int idx;
- int used;
- int num_blocks;
- int * length;
- unsigned int last_render;
-} drm_i810_mc_t;
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/libc/kernel/uapi/drm/i915_drm.h b/libc/kernel/uapi/drm/i915_drm.h
index 794e784..ae79ab3 100644
--- a/libc/kernel/uapi/drm/i915_drm.h
+++ b/libc/kernel/uapi/drm/i915_drm.h
@@ -63,13 +63,20 @@
#define I915_PMU_ENGINE_BUSY(class,instance) __I915_PMU_ENGINE(class, instance, I915_SAMPLE_BUSY)
#define I915_PMU_ENGINE_WAIT(class,instance) __I915_PMU_ENGINE(class, instance, I915_SAMPLE_WAIT)
#define I915_PMU_ENGINE_SEMA(class,instance) __I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA)
-#define __I915_PMU_OTHER(x) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x))
+#define __I915_PMU_GT_SHIFT (60)
+#define ___I915_PMU_OTHER(gt,x) (((__u64) __I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x)) | ((__u64) (gt) << __I915_PMU_GT_SHIFT))
+#define __I915_PMU_OTHER(x) ___I915_PMU_OTHER(0, x)
#define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0)
#define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1)
#define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2)
#define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3)
#define I915_PMU_SOFTWARE_GT_AWAKE_TIME __I915_PMU_OTHER(4)
#define I915_PMU_LAST I915_PMU_RC6_RESIDENCY
+#define __I915_PMU_ACTUAL_FREQUENCY(gt) ___I915_PMU_OTHER(gt, 0)
+#define __I915_PMU_REQUESTED_FREQUENCY(gt) ___I915_PMU_OTHER(gt, 1)
+#define __I915_PMU_INTERRUPTS(gt) ___I915_PMU_OTHER(gt, 2)
+#define __I915_PMU_RC6_RESIDENCY(gt) ___I915_PMU_OTHER(gt, 3)
+#define __I915_PMU_SOFTWARE_GT_AWAKE_TIME(gt) ___I915_PMU_OTHER(gt, 4)
#define I915_NR_TEX_REGIONS 255
#define I915_LOG_MIN_TEX_REGION_SIZE 14
typedef struct _drm_i915_init {
@@ -369,6 +376,7 @@
#define I915_PARAM_HAS_EXEC_TIMELINE_FENCES 55
#define I915_PARAM_HAS_USERPTR_PROBE 56
#define I915_PARAM_OA_TIMESTAMP_FREQUENCY 57
+#define I915_PARAM_PXP_STATUS 58
struct drm_i915_getparam {
__s32 param;
int * value;
@@ -797,7 +805,7 @@
#define I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE 0
#define I915_CONTEXT_ENGINES_EXT_BOND 1
#define I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT 2
- struct i915_engine_class_instance engines[0];
+ struct i915_engine_class_instance engines[];
} __attribute__((packed));
#define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__,N__) struct { __u64 extensions; struct i915_engine_class_instance engines[N__]; \
} __attribute__((packed)) name__
@@ -849,6 +857,8 @@
I915_OA_FORMAT_A32u40_A4u32_B8_C8,
I915_OAR_FORMAT_A32u40_A4u32_B8_C8,
I915_OA_FORMAT_A24u40_A14u32_B8_C8,
+ I915_OAM_FORMAT_MPEC8u64_B8_C8,
+ I915_OAM_FORMAT_MPEC8u32_B8_C8,
I915_OA_FORMAT_MAX
};
enum drm_i915_perf_property_id {
@@ -860,6 +870,8 @@
DRM_I915_PERF_PROP_HOLD_PREEMPTION,
DRM_I915_PERF_PROP_GLOBAL_SSEU,
DRM_I915_PERF_PROP_POLL_OA_PERIOD,
+ DRM_I915_PERF_PROP_OA_ENGINE_CLASS,
+ DRM_I915_PERF_PROP_OA_ENGINE_INSTANCE,
DRM_I915_PERF_PROP_MAX
};
struct drm_i915_perf_open_param {
@@ -983,6 +995,7 @@
__u32 flags;
#define I915_GEM_CREATE_EXT_MEMORY_REGIONS 0
#define I915_GEM_CREATE_EXT_PROTECTED_CONTENT 1
+#define I915_GEM_CREATE_EXT_SET_PAT 2
__u64 extensions;
};
struct drm_i915_gem_create_ext_memory_regions {
@@ -995,6 +1008,11 @@
struct i915_user_extension base;
__u32 flags;
};
+struct drm_i915_gem_create_ext_set_pat {
+ struct i915_user_extension base;
+ __u32 pat_index;
+ __u32 rsvd;
+};
#define I915_PROTECTED_CONTENT_DEFAULT_SESSION 0xf
#ifdef __cplusplus
}
diff --git a/libc/kernel/uapi/drm/ivpu_accel.h b/libc/kernel/uapi/drm/ivpu_accel.h
new file mode 100644
index 0000000..e148a5b
--- /dev/null
+++ b/libc/kernel/uapi/drm/ivpu_accel.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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_IVPU_DRM_H__
+#define __UAPI_IVPU_DRM_H__
+#include "drm.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define DRM_IVPU_DRIVER_MAJOR 1
+#define DRM_IVPU_DRIVER_MINOR 0
+#define DRM_IVPU_GET_PARAM 0x00
+#define DRM_IVPU_SET_PARAM 0x01
+#define DRM_IVPU_BO_CREATE 0x02
+#define DRM_IVPU_BO_INFO 0x03
+#define DRM_IVPU_SUBMIT 0x05
+#define DRM_IVPU_BO_WAIT 0x06
+#define DRM_IOCTL_IVPU_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_GET_PARAM, struct drm_ivpu_param)
+#define DRM_IOCTL_IVPU_SET_PARAM DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_SET_PARAM, struct drm_ivpu_param)
+#define DRM_IOCTL_IVPU_BO_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_CREATE, struct drm_ivpu_bo_create)
+#define DRM_IOCTL_IVPU_BO_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_INFO, struct drm_ivpu_bo_info)
+#define DRM_IOCTL_IVPU_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_SUBMIT, struct drm_ivpu_submit)
+#define DRM_IOCTL_IVPU_BO_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_WAIT, struct drm_ivpu_bo_wait)
+#define DRM_IVPU_PARAM_DEVICE_ID 0
+#define DRM_IVPU_PARAM_DEVICE_REVISION 1
+#define DRM_IVPU_PARAM_PLATFORM_TYPE 2
+#define DRM_IVPU_PARAM_CORE_CLOCK_RATE 3
+#define DRM_IVPU_PARAM_NUM_CONTEXTS 4
+#define DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS 5
+#define DRM_IVPU_PARAM_CONTEXT_PRIORITY 6
+#define DRM_IVPU_PARAM_CONTEXT_ID 7
+#define DRM_IVPU_PARAM_FW_API_VERSION 8
+#define DRM_IVPU_PARAM_ENGINE_HEARTBEAT 9
+#define DRM_IVPU_PARAM_UNIQUE_INFERENCE_ID 10
+#define DRM_IVPU_PARAM_TILE_CONFIG 11
+#define DRM_IVPU_PARAM_SKU 12
+#define DRM_IVPU_PLATFORM_TYPE_SILICON 0
+#define DRM_IVPU_CONTEXT_PRIORITY_IDLE 0
+#define DRM_IVPU_CONTEXT_PRIORITY_NORMAL 1
+#define DRM_IVPU_CONTEXT_PRIORITY_FOCUS 2
+#define DRM_IVPU_CONTEXT_PRIORITY_REALTIME 3
+struct drm_ivpu_param {
+ __u32 param;
+ __u32 index;
+ __u64 value;
+};
+#define DRM_IVPU_BO_HIGH_MEM 0x00000001
+#define DRM_IVPU_BO_MAPPABLE 0x00000002
+#define DRM_IVPU_BO_CACHED 0x00000000
+#define DRM_IVPU_BO_UNCACHED 0x00010000
+#define DRM_IVPU_BO_WC 0x00020000
+#define DRM_IVPU_BO_CACHE_MASK 0x00030000
+#define DRM_IVPU_BO_FLAGS (DRM_IVPU_BO_HIGH_MEM | DRM_IVPU_BO_MAPPABLE | DRM_IVPU_BO_CACHE_MASK)
+struct drm_ivpu_bo_create {
+ __u64 size;
+ __u32 flags;
+ __u32 handle;
+ __u64 vpu_addr;
+};
+struct drm_ivpu_bo_info {
+ __u32 handle;
+ __u32 flags;
+ __u64 vpu_addr;
+ __u64 mmap_offset;
+ __u64 size;
+};
+#define DRM_IVPU_ENGINE_COMPUTE 0
+#define DRM_IVPU_ENGINE_COPY 1
+struct drm_ivpu_submit {
+ __u64 buffers_ptr;
+ __u32 buffer_count;
+ __u32 engine;
+ __u32 flags;
+ __u32 commands_offset;
+};
+#define DRM_IVPU_JOB_STATUS_SUCCESS 0
+struct drm_ivpu_bo_wait {
+ __u32 handle;
+ __u32 flags;
+ __s64 timeout_ns;
+ __u32 job_status;
+ __u32 pad;
+};
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libc/kernel/uapi/drm/mga_drm.h b/libc/kernel/uapi/drm/mga_drm.h
deleted file mode 100644
index eb55fa7..0000000
--- a/libc/kernel/uapi/drm/mga_drm.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** 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 __MGA_DRM_H__
-#define __MGA_DRM_H__
-#include "drm.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef __MGA_SAREA_DEFINES__
-#define __MGA_SAREA_DEFINES__
-#define MGA_F 0x1
-#define MGA_A 0x2
-#define MGA_S 0x4
-#define MGA_T2 0x8
-#define MGA_WARP_TGZ 0
-#define MGA_WARP_TGZF (MGA_F)
-#define MGA_WARP_TGZA (MGA_A)
-#define MGA_WARP_TGZAF (MGA_F | MGA_A)
-#define MGA_WARP_TGZS (MGA_S)
-#define MGA_WARP_TGZSF (MGA_S | MGA_F)
-#define MGA_WARP_TGZSA (MGA_S | MGA_A)
-#define MGA_WARP_TGZSAF (MGA_S | MGA_F | MGA_A)
-#define MGA_WARP_T2GZ (MGA_T2)
-#define MGA_WARP_T2GZF (MGA_T2 | MGA_F)
-#define MGA_WARP_T2GZA (MGA_T2 | MGA_A)
-#define MGA_WARP_T2GZAF (MGA_T2 | MGA_A | MGA_F)
-#define MGA_WARP_T2GZS (MGA_T2 | MGA_S)
-#define MGA_WARP_T2GZSF (MGA_T2 | MGA_S | MGA_F)
-#define MGA_WARP_T2GZSA (MGA_T2 | MGA_S | MGA_A)
-#define MGA_WARP_T2GZSAF (MGA_T2 | MGA_S | MGA_F | MGA_A)
-#define MGA_MAX_G200_PIPES 8
-#define MGA_MAX_G400_PIPES 16
-#define MGA_MAX_WARP_PIPES MGA_MAX_G400_PIPES
-#define MGA_WARP_UCODE_SIZE 32768
-#define MGA_CARD_TYPE_G200 1
-#define MGA_CARD_TYPE_G400 2
-#define MGA_CARD_TYPE_G450 3
-#define MGA_CARD_TYPE_G550 4
-#define MGA_FRONT 0x1
-#define MGA_BACK 0x2
-#define MGA_DEPTH 0x4
-#define MGA_UPLOAD_CONTEXT 0x1
-#define MGA_UPLOAD_TEX0 0x2
-#define MGA_UPLOAD_TEX1 0x4
-#define MGA_UPLOAD_PIPE 0x8
-#define MGA_UPLOAD_TEX0IMAGE 0x10
-#define MGA_UPLOAD_TEX1IMAGE 0x20
-#define MGA_UPLOAD_2D 0x40
-#define MGA_WAIT_AGE 0x80
-#define MGA_UPLOAD_CLIPRECTS 0x100
-#define MGA_BUFFER_SIZE (1 << 16)
-#define MGA_NUM_BUFFERS 128
-#define MGA_NR_SAREA_CLIPRECTS 8
-#define MGA_CARD_HEAP 0
-#define MGA_AGP_HEAP 1
-#define MGA_NR_TEX_HEAPS 2
-#define MGA_NR_TEX_REGIONS 16
-#define MGA_LOG_MIN_TEX_REGION_SIZE 16
-#define DRM_MGA_IDLE_RETRY 2048
-#endif
-typedef struct {
- unsigned int dstorg;
- unsigned int maccess;
- unsigned int plnwt;
- unsigned int dwgctl;
- unsigned int alphactrl;
- unsigned int fogcolor;
- unsigned int wflag;
- unsigned int tdualstage0;
- unsigned int tdualstage1;
- unsigned int fcol;
- unsigned int stencil;
- unsigned int stencilctl;
-} drm_mga_context_regs_t;
-typedef struct {
- unsigned int pitch;
-} drm_mga_server_regs_t;
-typedef struct {
- unsigned int texctl;
- unsigned int texctl2;
- unsigned int texfilter;
- unsigned int texbordercol;
- unsigned int texorg;
- unsigned int texwidth;
- unsigned int texheight;
- unsigned int texorg1;
- unsigned int texorg2;
- unsigned int texorg3;
- unsigned int texorg4;
-} drm_mga_texture_regs_t;
-typedef struct {
- unsigned int head;
- unsigned int wrap;
-} drm_mga_age_t;
-typedef struct _drm_mga_sarea {
- drm_mga_context_regs_t context_state;
- drm_mga_server_regs_t server_state;
- drm_mga_texture_regs_t tex_state[2];
- unsigned int warp_pipe;
- unsigned int dirty;
- unsigned int vertsize;
- struct drm_clip_rect boxes[MGA_NR_SAREA_CLIPRECTS];
- unsigned int nbox;
- unsigned int req_drawable;
- unsigned int req_draw_buffer;
- unsigned int exported_drawable;
- unsigned int exported_index;
- unsigned int exported_stamp;
- unsigned int exported_buffers;
- unsigned int exported_nfront;
- unsigned int exported_nback;
- int exported_back_x, exported_front_x, exported_w;
- int exported_back_y, exported_front_y, exported_h;
- struct drm_clip_rect exported_boxes[MGA_NR_SAREA_CLIPRECTS];
- unsigned int status[4];
- unsigned int last_wrap;
- drm_mga_age_t last_frame;
- unsigned int last_enqueue;
- unsigned int last_dispatch;
- unsigned int last_quiescent;
- struct drm_tex_region texList[MGA_NR_TEX_HEAPS][MGA_NR_TEX_REGIONS + 1];
- unsigned int texAge[MGA_NR_TEX_HEAPS];
- int ctxOwner;
-} drm_mga_sarea_t;
-#define DRM_MGA_INIT 0x00
-#define DRM_MGA_FLUSH 0x01
-#define DRM_MGA_RESET 0x02
-#define DRM_MGA_SWAP 0x03
-#define DRM_MGA_CLEAR 0x04
-#define DRM_MGA_VERTEX 0x05
-#define DRM_MGA_INDICES 0x06
-#define DRM_MGA_ILOAD 0x07
-#define DRM_MGA_BLIT 0x08
-#define DRM_MGA_GETPARAM 0x09
-#define DRM_MGA_SET_FENCE 0x0a
-#define DRM_MGA_WAIT_FENCE 0x0b
-#define DRM_MGA_DMA_BOOTSTRAP 0x0c
-#define DRM_IOCTL_MGA_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_MGA_INIT, drm_mga_init_t)
-#define DRM_IOCTL_MGA_FLUSH DRM_IOW(DRM_COMMAND_BASE + DRM_MGA_FLUSH, struct drm_lock)
-#define DRM_IOCTL_MGA_RESET DRM_IO(DRM_COMMAND_BASE + DRM_MGA_RESET)
-#define DRM_IOCTL_MGA_SWAP DRM_IO(DRM_COMMAND_BASE + DRM_MGA_SWAP)
-#define DRM_IOCTL_MGA_CLEAR DRM_IOW(DRM_COMMAND_BASE + DRM_MGA_CLEAR, drm_mga_clear_t)
-#define DRM_IOCTL_MGA_VERTEX DRM_IOW(DRM_COMMAND_BASE + DRM_MGA_VERTEX, drm_mga_vertex_t)
-#define DRM_IOCTL_MGA_INDICES DRM_IOW(DRM_COMMAND_BASE + DRM_MGA_INDICES, drm_mga_indices_t)
-#define DRM_IOCTL_MGA_ILOAD DRM_IOW(DRM_COMMAND_BASE + DRM_MGA_ILOAD, drm_mga_iload_t)
-#define DRM_IOCTL_MGA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_MGA_BLIT, drm_mga_blit_t)
-#define DRM_IOCTL_MGA_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_GETPARAM, drm_mga_getparam_t)
-#define DRM_IOCTL_MGA_SET_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, __u32)
-#define DRM_IOCTL_MGA_WAIT_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, __u32)
-#define DRM_IOCTL_MGA_DMA_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_DMA_BOOTSTRAP, drm_mga_dma_bootstrap_t)
-typedef struct _drm_mga_warp_index {
- int installed;
- unsigned long phys_addr;
- int size;
-} drm_mga_warp_index_t;
-typedef struct drm_mga_init {
- enum {
- MGA_INIT_DMA = 0x01,
- MGA_CLEANUP_DMA = 0x02
- } func;
- unsigned long sarea_priv_offset;
- __struct_group(, always32bit,, int chipset;
- int sgram;
- unsigned int maccess;
- unsigned int fb_cpp;
- unsigned int front_offset, front_pitch;
- unsigned int back_offset, back_pitch;
- unsigned int depth_cpp;
- unsigned int depth_offset, depth_pitch;
- unsigned int texture_offset[MGA_NR_TEX_HEAPS];
- unsigned int texture_size[MGA_NR_TEX_HEAPS];
- );
- unsigned long fb_offset;
- unsigned long mmio_offset;
- unsigned long status_offset;
- unsigned long warp_offset;
- unsigned long primary_offset;
- unsigned long buffers_offset;
-} drm_mga_init_t;
-typedef struct drm_mga_dma_bootstrap {
- unsigned long texture_handle;
- __u32 texture_size;
- __u32 primary_size;
- __u32 secondary_bin_count;
- __u32 secondary_bin_size;
- __u32 agp_mode;
- __u8 agp_size;
-} drm_mga_dma_bootstrap_t;
-typedef struct drm_mga_clear {
- unsigned int flags;
- unsigned int clear_color;
- unsigned int clear_depth;
- unsigned int color_mask;
- unsigned int depth_mask;
-} drm_mga_clear_t;
-typedef struct drm_mga_vertex {
- int idx;
- int used;
- int discard;
-} drm_mga_vertex_t;
-typedef struct drm_mga_indices {
- int idx;
- unsigned int start;
- unsigned int end;
- int discard;
-} drm_mga_indices_t;
-typedef struct drm_mga_iload {
- int idx;
- unsigned int dstorg;
- unsigned int length;
-} drm_mga_iload_t;
-typedef struct _drm_mga_blit {
- unsigned int planemask;
- unsigned int srcorg;
- unsigned int dstorg;
- int src_pitch, dst_pitch;
- int delta_sx, delta_sy;
- int delta_dx, delta_dy;
- int height, ydir;
- int source_pitch, dest_pitch;
-} drm_mga_blit_t;
-#define MGA_PARAM_IRQ_NR 1
-#define MGA_PARAM_CARD_TYPE 2
-typedef struct drm_mga_getparam {
- int param;
- void * value;
-} drm_mga_getparam_t;
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/libc/kernel/uapi/drm/msm_drm.h b/libc/kernel/uapi/drm/msm_drm.h
index ad3a971..317796d 100644
--- a/libc/kernel/uapi/drm/msm_drm.h
+++ b/libc/kernel/uapi/drm/msm_drm.h
@@ -85,7 +85,8 @@
#define MSM_PREP_READ 0x01
#define MSM_PREP_WRITE 0x02
#define MSM_PREP_NOSYNC 0x04
-#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
+#define MSM_PREP_BOOST 0x08
+#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC | MSM_PREP_BOOST | 0)
struct drm_msm_gem_cpu_prep {
__u32 handle;
__u32 op;
@@ -96,7 +97,11 @@
};
struct drm_msm_gem_submit_reloc {
__u32 submit_offset;
+#ifdef __cplusplus
+ __u32 _or;
+#else
__u32 or;
+#endif
__s32 shift;
__u32 reloc_idx;
__u64 reloc_offset;
@@ -116,7 +121,8 @@
#define MSM_SUBMIT_BO_READ 0x0001
#define MSM_SUBMIT_BO_WRITE 0x0002
#define MSM_SUBMIT_BO_DUMP 0x0004
-#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE | MSM_SUBMIT_BO_DUMP)
+#define MSM_SUBMIT_BO_NO_IMPLICIT 0x0008
+#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE | MSM_SUBMIT_BO_DUMP | MSM_SUBMIT_BO_NO_IMPLICIT)
struct drm_msm_gem_submit_bo {
__u32 flags;
__u32 handle;
@@ -153,9 +159,11 @@
__u32 syncobj_stride;
__u32 pad;
};
+#define MSM_WAIT_FENCE_BOOST 0x00000001
+#define MSM_WAIT_FENCE_FLAGS (MSM_WAIT_FENCE_BOOST | 0)
struct drm_msm_wait_fence {
__u32 fence;
- __u32 pad;
+ __u32 flags;
struct drm_msm_timespec timeout;
__u32 queueid;
};
diff --git a/libc/kernel/uapi/drm/qaic_accel.h b/libc/kernel/uapi/drm/qaic_accel.h
new file mode 100644
index 0000000..d2a43cf
--- /dev/null
+++ b/libc/kernel/uapi/drm/qaic_accel.h
@@ -0,0 +1,204 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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 QAIC_ACCEL_H_
+#define QAIC_ACCEL_H_
+#include "drm.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define QAIC_MANAGE_MAX_MSG_LENGTH SZ_4K
+#define QAIC_SEM_INSYNCFENCE 2
+#define QAIC_SEM_OUTSYNCFENCE 1
+#define QAIC_SEM_NOP 0
+#define QAIC_SEM_INIT 1
+#define QAIC_SEM_INC 2
+#define QAIC_SEM_DEC 3
+#define QAIC_SEM_WAIT_EQUAL 4
+#define QAIC_SEM_WAIT_GT_EQ 5
+#define QAIC_SEM_WAIT_GT_0 6
+#define QAIC_TRANS_UNDEFINED 0
+#define QAIC_TRANS_PASSTHROUGH_FROM_USR 1
+#define QAIC_TRANS_PASSTHROUGH_TO_USR 2
+#define QAIC_TRANS_PASSTHROUGH_FROM_DEV 3
+#define QAIC_TRANS_PASSTHROUGH_TO_DEV 4
+#define QAIC_TRANS_DMA_XFER_FROM_USR 5
+#define QAIC_TRANS_DMA_XFER_TO_DEV 6
+#define QAIC_TRANS_ACTIVATE_FROM_USR 7
+#define QAIC_TRANS_ACTIVATE_FROM_DEV 8
+#define QAIC_TRANS_ACTIVATE_TO_DEV 9
+#define QAIC_TRANS_DEACTIVATE_FROM_USR 10
+#define QAIC_TRANS_DEACTIVATE_FROM_DEV 11
+#define QAIC_TRANS_STATUS_FROM_USR 12
+#define QAIC_TRANS_STATUS_TO_USR 13
+#define QAIC_TRANS_STATUS_FROM_DEV 14
+#define QAIC_TRANS_STATUS_TO_DEV 15
+#define QAIC_TRANS_TERMINATE_FROM_DEV 16
+#define QAIC_TRANS_TERMINATE_TO_DEV 17
+#define QAIC_TRANS_DMA_XFER_CONT 18
+#define QAIC_TRANS_VALIDATE_PARTITION_FROM_DEV 19
+#define QAIC_TRANS_VALIDATE_PARTITION_TO_DEV 20
+struct qaic_manage_trans_hdr {
+ __u32 type;
+ __u32 len;
+};
+struct qaic_manage_trans_passthrough {
+ struct qaic_manage_trans_hdr hdr;
+ __u8 data[];
+};
+struct qaic_manage_trans_dma_xfer {
+ struct qaic_manage_trans_hdr hdr;
+ __u32 tag;
+ __u32 pad;
+ __u64 addr;
+ __u64 size;
+};
+struct qaic_manage_trans_activate_to_dev {
+ struct qaic_manage_trans_hdr hdr;
+ __u32 queue_size;
+ __u32 eventfd;
+ __u32 options;
+ __u32 pad;
+};
+struct qaic_manage_trans_activate_from_dev {
+ struct qaic_manage_trans_hdr hdr;
+ __u32 status;
+ __u32 dbc_id;
+ __u64 options;
+};
+struct qaic_manage_trans_deactivate {
+ struct qaic_manage_trans_hdr hdr;
+ __u32 dbc_id;
+ __u32 pad;
+};
+struct qaic_manage_trans_status_to_dev {
+ struct qaic_manage_trans_hdr hdr;
+};
+struct qaic_manage_trans_status_from_dev {
+ struct qaic_manage_trans_hdr hdr;
+ __u16 major;
+ __u16 minor;
+ __u32 status;
+ __u64 status_flags;
+};
+struct qaic_manage_msg {
+ __u32 len;
+ __u32 count;
+ __u64 data;
+};
+struct qaic_create_bo {
+ __u64 size;
+ __u32 handle;
+ __u32 pad;
+};
+struct qaic_mmap_bo {
+ __u32 handle;
+ __u32 pad;
+ __u64 offset;
+};
+struct qaic_sem {
+ __u16 val;
+ __u8 index;
+ __u8 presync;
+ __u8 cmd;
+ __u8 flags;
+ __u16 pad;
+};
+struct qaic_attach_slice_entry {
+ __u64 size;
+ struct qaic_sem sem0;
+ struct qaic_sem sem1;
+ struct qaic_sem sem2;
+ struct qaic_sem sem3;
+ __u64 dev_addr;
+ __u64 db_addr;
+ __u32 db_data;
+ __u32 db_len;
+ __u64 offset;
+};
+struct qaic_attach_slice_hdr {
+ __u32 count;
+ __u32 dbc_id;
+ __u32 handle;
+ __u32 dir;
+ __u64 size;
+};
+struct qaic_attach_slice {
+ struct qaic_attach_slice_hdr hdr;
+ __u64 data;
+};
+struct qaic_execute_entry {
+ __u32 handle;
+ __u32 dir;
+};
+struct qaic_partial_execute_entry {
+ __u32 handle;
+ __u32 dir;
+ __u64 resize;
+};
+struct qaic_execute_hdr {
+ __u32 count;
+ __u32 dbc_id;
+};
+struct qaic_execute {
+ struct qaic_execute_hdr hdr;
+ __u64 data;
+};
+struct qaic_wait {
+ __u32 handle;
+ __u32 timeout;
+ __u32 dbc_id;
+ __u32 pad;
+};
+struct qaic_perf_stats_hdr {
+ __u16 count;
+ __u16 pad;
+ __u32 dbc_id;
+};
+struct qaic_perf_stats {
+ struct qaic_perf_stats_hdr hdr;
+ __u64 data;
+};
+struct qaic_perf_stats_entry {
+ __u32 handle;
+ __u32 queue_level_before;
+ __u32 num_queue_element;
+ __u32 submit_latency_us;
+ __u32 device_latency_us;
+ __u32 pad;
+};
+#define DRM_QAIC_MANAGE 0x00
+#define DRM_QAIC_CREATE_BO 0x01
+#define DRM_QAIC_MMAP_BO 0x02
+#define DRM_QAIC_ATTACH_SLICE_BO 0x03
+#define DRM_QAIC_EXECUTE_BO 0x04
+#define DRM_QAIC_PARTIAL_EXECUTE_BO 0x05
+#define DRM_QAIC_WAIT_BO 0x06
+#define DRM_QAIC_PERF_STATS_BO 0x07
+#define DRM_IOCTL_QAIC_MANAGE DRM_IOWR(DRM_COMMAND_BASE + DRM_QAIC_MANAGE, struct qaic_manage_msg)
+#define DRM_IOCTL_QAIC_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_QAIC_CREATE_BO, struct qaic_create_bo)
+#define DRM_IOCTL_QAIC_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_QAIC_MMAP_BO, struct qaic_mmap_bo)
+#define DRM_IOCTL_QAIC_ATTACH_SLICE_BO DRM_IOW(DRM_COMMAND_BASE + DRM_QAIC_ATTACH_SLICE_BO, struct qaic_attach_slice)
+#define DRM_IOCTL_QAIC_EXECUTE_BO DRM_IOW(DRM_COMMAND_BASE + DRM_QAIC_EXECUTE_BO, struct qaic_execute)
+#define DRM_IOCTL_QAIC_PARTIAL_EXECUTE_BO DRM_IOW(DRM_COMMAND_BASE + DRM_QAIC_PARTIAL_EXECUTE_BO, struct qaic_execute)
+#define DRM_IOCTL_QAIC_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_QAIC_WAIT_BO, struct qaic_wait)
+#define DRM_IOCTL_QAIC_PERF_STATS_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_QAIC_PERF_STATS_BO, struct qaic_perf_stats)
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libc/kernel/uapi/drm/r128_drm.h b/libc/kernel/uapi/drm/r128_drm.h
deleted file mode 100644
index 3e013b1..0000000
--- a/libc/kernel/uapi/drm/r128_drm.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** 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 __R128_DRM_H__
-#define __R128_DRM_H__
-#include "drm.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef __R128_SAREA_DEFINES__
-#define __R128_SAREA_DEFINES__
-#define R128_UPLOAD_CONTEXT 0x001
-#define R128_UPLOAD_SETUP 0x002
-#define R128_UPLOAD_TEX0 0x004
-#define R128_UPLOAD_TEX1 0x008
-#define R128_UPLOAD_TEX0IMAGES 0x010
-#define R128_UPLOAD_TEX1IMAGES 0x020
-#define R128_UPLOAD_CORE 0x040
-#define R128_UPLOAD_MASKS 0x080
-#define R128_UPLOAD_WINDOW 0x100
-#define R128_UPLOAD_CLIPRECTS 0x200
-#define R128_REQUIRE_QUIESCENCE 0x400
-#define R128_UPLOAD_ALL 0x7ff
-#define R128_FRONT 0x1
-#define R128_BACK 0x2
-#define R128_DEPTH 0x4
-#define R128_POINTS 0x1
-#define R128_LINES 0x2
-#define R128_LINE_STRIP 0x3
-#define R128_TRIANGLES 0x4
-#define R128_TRIANGLE_FAN 0x5
-#define R128_TRIANGLE_STRIP 0x6
-#define R128_BUFFER_SIZE 16384
-#define R128_INDEX_PRIM_OFFSET 20
-#define R128_HOSTDATA_BLIT_OFFSET 32
-#define R128_NR_SAREA_CLIPRECTS 12
-#define R128_LOCAL_TEX_HEAP 0
-#define R128_AGP_TEX_HEAP 1
-#define R128_NR_TEX_HEAPS 2
-#define R128_NR_TEX_REGIONS 64
-#define R128_LOG_TEX_GRANULARITY 16
-#define R128_NR_CONTEXT_REGS 12
-#define R128_MAX_TEXTURE_LEVELS 11
-#define R128_MAX_TEXTURE_UNITS 2
-#endif
-typedef struct {
- unsigned int dst_pitch_offset_c;
- unsigned int dp_gui_master_cntl_c;
- unsigned int sc_top_left_c;
- unsigned int sc_bottom_right_c;
- unsigned int z_offset_c;
- unsigned int z_pitch_c;
- unsigned int z_sten_cntl_c;
- unsigned int tex_cntl_c;
- unsigned int misc_3d_state_cntl_reg;
- unsigned int texture_clr_cmp_clr_c;
- unsigned int texture_clr_cmp_msk_c;
- unsigned int fog_color_c;
- unsigned int tex_size_pitch_c;
- unsigned int constant_color_c;
- unsigned int pm4_vc_fpu_setup;
- unsigned int setup_cntl;
- unsigned int dp_write_mask;
- unsigned int sten_ref_mask_c;
- unsigned int plane_3d_mask_c;
- unsigned int window_xy_offset;
- unsigned int scale_3d_cntl;
-} drm_r128_context_regs_t;
-typedef struct {
- unsigned int tex_cntl;
- unsigned int tex_combine_cntl;
- unsigned int tex_size_pitch;
- unsigned int tex_offset[R128_MAX_TEXTURE_LEVELS];
- unsigned int tex_border_color;
-} drm_r128_texture_regs_t;
-typedef struct drm_r128_sarea {
- drm_r128_context_regs_t context_state;
- drm_r128_texture_regs_t tex_state[R128_MAX_TEXTURE_UNITS];
- unsigned int dirty;
- unsigned int vertsize;
- unsigned int vc_format;
- struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];
- unsigned int nbox;
- unsigned int last_frame;
- unsigned int last_dispatch;
- struct drm_tex_region tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS + 1];
- unsigned int tex_age[R128_NR_TEX_HEAPS];
- int ctx_owner;
- int pfAllowPageFlip;
- int pfCurrentPage;
-} drm_r128_sarea_t;
-#define DRM_R128_INIT 0x00
-#define DRM_R128_CCE_START 0x01
-#define DRM_R128_CCE_STOP 0x02
-#define DRM_R128_CCE_RESET 0x03
-#define DRM_R128_CCE_IDLE 0x04
-#define DRM_R128_RESET 0x06
-#define DRM_R128_SWAP 0x07
-#define DRM_R128_CLEAR 0x08
-#define DRM_R128_VERTEX 0x09
-#define DRM_R128_INDICES 0x0a
-#define DRM_R128_BLIT 0x0b
-#define DRM_R128_DEPTH 0x0c
-#define DRM_R128_STIPPLE 0x0d
-#define DRM_R128_INDIRECT 0x0f
-#define DRM_R128_FULLSCREEN 0x10
-#define DRM_R128_CLEAR2 0x11
-#define DRM_R128_GETPARAM 0x12
-#define DRM_R128_FLIP 0x13
-#define DRM_IOCTL_R128_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_R128_INIT, drm_r128_init_t)
-#define DRM_IOCTL_R128_CCE_START DRM_IO(DRM_COMMAND_BASE + DRM_R128_CCE_START)
-#define DRM_IOCTL_R128_CCE_STOP DRM_IOW(DRM_COMMAND_BASE + DRM_R128_CCE_STOP, drm_r128_cce_stop_t)
-#define DRM_IOCTL_R128_CCE_RESET DRM_IO(DRM_COMMAND_BASE + DRM_R128_CCE_RESET)
-#define DRM_IOCTL_R128_CCE_IDLE DRM_IO(DRM_COMMAND_BASE + DRM_R128_CCE_IDLE)
-#define DRM_IOCTL_R128_RESET DRM_IO(DRM_COMMAND_BASE + DRM_R128_RESET)
-#define DRM_IOCTL_R128_SWAP DRM_IO(DRM_COMMAND_BASE + DRM_R128_SWAP)
-#define DRM_IOCTL_R128_CLEAR DRM_IOW(DRM_COMMAND_BASE + DRM_R128_CLEAR, drm_r128_clear_t)
-#define DRM_IOCTL_R128_VERTEX DRM_IOW(DRM_COMMAND_BASE + DRM_R128_VERTEX, drm_r128_vertex_t)
-#define DRM_IOCTL_R128_INDICES DRM_IOW(DRM_COMMAND_BASE + DRM_R128_INDICES, drm_r128_indices_t)
-#define DRM_IOCTL_R128_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_R128_BLIT, drm_r128_blit_t)
-#define DRM_IOCTL_R128_DEPTH DRM_IOW(DRM_COMMAND_BASE + DRM_R128_DEPTH, drm_r128_depth_t)
-#define DRM_IOCTL_R128_STIPPLE DRM_IOW(DRM_COMMAND_BASE + DRM_R128_STIPPLE, drm_r128_stipple_t)
-#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_INDIRECT, drm_r128_indirect_t)
-#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW(DRM_COMMAND_BASE + DRM_R128_FULLSCREEN, drm_r128_fullscreen_t)
-#define DRM_IOCTL_R128_CLEAR2 DRM_IOW(DRM_COMMAND_BASE + DRM_R128_CLEAR2, drm_r128_clear2_t)
-#define DRM_IOCTL_R128_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_GETPARAM, drm_r128_getparam_t)
-#define DRM_IOCTL_R128_FLIP DRM_IO(DRM_COMMAND_BASE + DRM_R128_FLIP)
-typedef struct drm_r128_init {
- enum {
- R128_INIT_CCE = 0x01,
- R128_CLEANUP_CCE = 0x02
- } func;
- unsigned long sarea_priv_offset;
- int is_pci;
- int cce_mode;
- int cce_secure;
- int ring_size;
- int usec_timeout;
- unsigned int fb_bpp;
- unsigned int front_offset, front_pitch;
- unsigned int back_offset, back_pitch;
- unsigned int depth_bpp;
- unsigned int depth_offset, depth_pitch;
- unsigned int span_offset;
- unsigned long fb_offset;
- unsigned long mmio_offset;
- unsigned long ring_offset;
- unsigned long ring_rptr_offset;
- unsigned long buffers_offset;
- unsigned long agp_textures_offset;
-} drm_r128_init_t;
-typedef struct drm_r128_cce_stop {
- int flush;
- int idle;
-} drm_r128_cce_stop_t;
-typedef struct drm_r128_clear {
- unsigned int flags;
- unsigned int clear_color;
- unsigned int clear_depth;
- unsigned int color_mask;
- unsigned int depth_mask;
-} drm_r128_clear_t;
-typedef struct drm_r128_vertex {
- int prim;
- int idx;
- int count;
- int discard;
-} drm_r128_vertex_t;
-typedef struct drm_r128_indices {
- int prim;
- int idx;
- int start;
- int end;
- int discard;
-} drm_r128_indices_t;
-typedef struct drm_r128_blit {
- int idx;
- int pitch;
- int offset;
- int format;
- unsigned short x, y;
- unsigned short width, height;
-} drm_r128_blit_t;
-typedef struct drm_r128_depth {
- enum {
- R128_WRITE_SPAN = 0x01,
- R128_WRITE_PIXELS = 0x02,
- R128_READ_SPAN = 0x03,
- R128_READ_PIXELS = 0x04
- } func;
- int n;
- int * x;
- int * y;
- unsigned int * buffer;
- unsigned char * mask;
-} drm_r128_depth_t;
-typedef struct drm_r128_stipple {
- unsigned int * mask;
-} drm_r128_stipple_t;
-typedef struct drm_r128_indirect {
- int idx;
- int start;
- int end;
- int discard;
-} drm_r128_indirect_t;
-typedef struct drm_r128_fullscreen {
- enum {
- R128_INIT_FULLSCREEN = 0x01,
- R128_CLEANUP_FULLSCREEN = 0x02
- } func;
-} drm_r128_fullscreen_t;
-#define R128_PARAM_IRQ_NR 1
-typedef struct drm_r128_getparam {
- int param;
- void * value;
-} drm_r128_getparam_t;
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/libc/kernel/uapi/drm/savage_drm.h b/libc/kernel/uapi/drm/savage_drm.h
deleted file mode 100644
index efc0ae6..0000000
--- a/libc/kernel/uapi/drm/savage_drm.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** 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 __SAVAGE_DRM_H__
-#define __SAVAGE_DRM_H__
-#include "drm.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef __SAVAGE_SAREA_DEFINES__
-#define __SAVAGE_SAREA_DEFINES__
-#define SAVAGE_CARD_HEAP 0
-#define SAVAGE_AGP_HEAP 1
-#define SAVAGE_NR_TEX_HEAPS 2
-#define SAVAGE_NR_TEX_REGIONS 16
-#define SAVAGE_LOG_MIN_TEX_REGION_SIZE 16
-#endif
-typedef struct _drm_savage_sarea {
- struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS + 1];
- unsigned int texAge[SAVAGE_NR_TEX_HEAPS];
- int ctxOwner;
-} drm_savage_sarea_t, * drm_savage_sarea_ptr;
-#define DRM_SAVAGE_BCI_INIT 0x00
-#define DRM_SAVAGE_BCI_CMDBUF 0x01
-#define DRM_SAVAGE_BCI_EVENT_EMIT 0x02
-#define DRM_SAVAGE_BCI_EVENT_WAIT 0x03
-#define DRM_IOCTL_SAVAGE_BCI_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_INIT, drm_savage_init_t)
-#define DRM_IOCTL_SAVAGE_BCI_CMDBUF DRM_IOW(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_CMDBUF, drm_savage_cmdbuf_t)
-#define DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_EMIT, drm_savage_event_emit_t)
-#define DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_WAIT, drm_savage_event_wait_t)
-#define SAVAGE_DMA_PCI 1
-#define SAVAGE_DMA_AGP 3
-typedef struct drm_savage_init {
- enum {
- SAVAGE_INIT_BCI = 1,
- SAVAGE_CLEANUP_BCI = 2
- } func;
- unsigned int sarea_priv_offset;
- unsigned int cob_size;
- unsigned int bci_threshold_lo, bci_threshold_hi;
- unsigned int dma_type;
- unsigned int fb_bpp;
- unsigned int front_offset, front_pitch;
- unsigned int back_offset, back_pitch;
- unsigned int depth_bpp;
- unsigned int depth_offset, depth_pitch;
- unsigned int texture_offset;
- unsigned int texture_size;
- unsigned long status_offset;
- unsigned long buffers_offset;
- unsigned long agp_textures_offset;
- unsigned long cmd_dma_offset;
-} drm_savage_init_t;
-typedef union drm_savage_cmd_header drm_savage_cmd_header_t;
-typedef struct drm_savage_cmdbuf {
- drm_savage_cmd_header_t * cmd_addr;
- unsigned int size;
- unsigned int dma_idx;
- int discard;
- unsigned int * vb_addr;
- unsigned int vb_size;
- unsigned int vb_stride;
- struct drm_clip_rect * box_addr;
- unsigned int nbox;
-} drm_savage_cmdbuf_t;
-#define SAVAGE_WAIT_2D 0x1
-#define SAVAGE_WAIT_3D 0x2
-#define SAVAGE_WAIT_IRQ 0x4
-typedef struct drm_savage_event {
- unsigned int count;
- unsigned int flags;
-} drm_savage_event_emit_t, drm_savage_event_wait_t;
-#define SAVAGE_CMD_STATE 0
-#define SAVAGE_CMD_DMA_PRIM 1
-#define SAVAGE_CMD_VB_PRIM 2
-#define SAVAGE_CMD_DMA_IDX 3
-#define SAVAGE_CMD_VB_IDX 4
-#define SAVAGE_CMD_CLEAR 5
-#define SAVAGE_CMD_SWAP 6
-#define SAVAGE_PRIM_TRILIST 0
-#define SAVAGE_PRIM_TRISTRIP 1
-#define SAVAGE_PRIM_TRIFAN 2
-#define SAVAGE_PRIM_TRILIST_201 3
-#define SAVAGE_SKIP_Z 0x01
-#define SAVAGE_SKIP_W 0x02
-#define SAVAGE_SKIP_C0 0x04
-#define SAVAGE_SKIP_C1 0x08
-#define SAVAGE_SKIP_S0 0x10
-#define SAVAGE_SKIP_T0 0x20
-#define SAVAGE_SKIP_ST0 0x30
-#define SAVAGE_SKIP_S1 0x40
-#define SAVAGE_SKIP_T1 0x80
-#define SAVAGE_SKIP_ST1 0xc0
-#define SAVAGE_SKIP_ALL_S3D 0x3f
-#define SAVAGE_SKIP_ALL_S4 0xff
-#define SAVAGE_FRONT 0x1
-#define SAVAGE_BACK 0x2
-#define SAVAGE_DEPTH 0x4
-union drm_savage_cmd_header {
- struct {
- unsigned char cmd;
- unsigned char pad0;
- unsigned short pad1;
- unsigned short pad2;
- unsigned short pad3;
- } cmd;
- struct {
- unsigned char cmd;
- unsigned char global;
- unsigned short count;
- unsigned short start;
- unsigned short pad3;
- } state;
- struct {
- unsigned char cmd;
- unsigned char prim;
- unsigned short skip;
- unsigned short count;
- unsigned short start;
- } prim;
- struct {
- unsigned char cmd;
- unsigned char prim;
- unsigned short skip;
- unsigned short count;
- unsigned short pad3;
- } idx;
- struct {
- unsigned char cmd;
- unsigned char pad0;
- unsigned short pad1;
- unsigned int flags;
- } clear0;
- struct {
- unsigned int mask;
- unsigned int value;
- } clear1;
-};
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/libc/kernel/uapi/drm/sis_drm.h b/libc/kernel/uapi/drm/sis_drm.h
deleted file mode 100644
index 1606a85..0000000
--- a/libc/kernel/uapi/drm/sis_drm.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** 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 __SIS_DRM_H__
-#define __SIS_DRM_H__
-#include "drm.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-#define NOT_USED_0_3
-#define DRM_SIS_FB_ALLOC 0x04
-#define DRM_SIS_FB_FREE 0x05
-#define NOT_USED_6_12
-#define DRM_SIS_AGP_INIT 0x13
-#define DRM_SIS_AGP_ALLOC 0x14
-#define DRM_SIS_AGP_FREE 0x15
-#define DRM_SIS_FB_INIT 0x16
-#define DRM_IOCTL_SIS_FB_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_FB_ALLOC, drm_sis_mem_t)
-#define DRM_IOCTL_SIS_FB_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_SIS_FB_FREE, drm_sis_mem_t)
-#define DRM_IOCTL_SIS_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_INIT, drm_sis_agp_t)
-#define DRM_IOCTL_SIS_AGP_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_ALLOC, drm_sis_mem_t)
-#define DRM_IOCTL_SIS_AGP_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_SIS_AGP_FREE, drm_sis_mem_t)
-#define DRM_IOCTL_SIS_FB_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_SIS_FB_INIT, drm_sis_fb_t)
-typedef struct {
- int context;
- unsigned long offset;
- unsigned long size;
- unsigned long free;
-} drm_sis_mem_t;
-typedef struct {
- unsigned long offset, size;
-} drm_sis_agp_t;
-typedef struct {
- unsigned long offset, size;
-} drm_sis_fb_t;
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/libc/kernel/uapi/drm/via_drm.h b/libc/kernel/uapi/drm/via_drm.h
deleted file mode 100644
index 95a149b..0000000
--- a/libc/kernel/uapi/drm/via_drm.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** 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 _VIA_DRM_H_
-#define _VIA_DRM_H_
-#include "drm.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef _VIA_DEFINES_
-#define _VIA_DEFINES_
-#define VIA_NR_SAREA_CLIPRECTS 8
-#define VIA_NR_XVMC_PORTS 10
-#define VIA_NR_XVMC_LOCKS 5
-#define VIA_MAX_CACHELINE_SIZE 64
-#define XVMCLOCKPTR(saPriv,lockNo) ((volatile struct drm_hw_lock *) (((((unsigned long) (saPriv)->XvMCLockArea) + (VIA_MAX_CACHELINE_SIZE - 1)) & ~(VIA_MAX_CACHELINE_SIZE - 1)) + VIA_MAX_CACHELINE_SIZE * (lockNo)))
-#define VIA_NR_TEX_REGIONS 64
-#define VIA_LOG_MIN_TEX_REGION_SIZE 16
-#endif
-#define VIA_UPLOAD_TEX0IMAGE 0x1
-#define VIA_UPLOAD_TEX1IMAGE 0x2
-#define VIA_UPLOAD_CTX 0x4
-#define VIA_UPLOAD_BUFFERS 0x8
-#define VIA_UPLOAD_TEX0 0x10
-#define VIA_UPLOAD_TEX1 0x20
-#define VIA_UPLOAD_CLIPRECTS 0x40
-#define VIA_UPLOAD_ALL 0xff
-#define DRM_VIA_ALLOCMEM 0x00
-#define DRM_VIA_FREEMEM 0x01
-#define DRM_VIA_AGP_INIT 0x02
-#define DRM_VIA_FB_INIT 0x03
-#define DRM_VIA_MAP_INIT 0x04
-#define DRM_VIA_DEC_FUTEX 0x05
-#define NOT_USED
-#define DRM_VIA_DMA_INIT 0x07
-#define DRM_VIA_CMDBUFFER 0x08
-#define DRM_VIA_FLUSH 0x09
-#define DRM_VIA_PCICMD 0x0a
-#define DRM_VIA_CMDBUF_SIZE 0x0b
-#define NOT_USED
-#define DRM_VIA_WAIT_IRQ 0x0d
-#define DRM_VIA_DMA_BLIT 0x0e
-#define DRM_VIA_BLIT_SYNC 0x0f
-#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
-#define DRM_IOCTL_VIA_FREEMEM DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
-#define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
-#define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
-#define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
-#define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
-#define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
-#define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
-#define DRM_IOCTL_VIA_FLUSH DRM_IO(DRM_COMMAND_BASE + DRM_VIA_FLUSH)
-#define DRM_IOCTL_VIA_PCICMD DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
-#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, drm_via_cmdbuf_size_t)
-#define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
-#define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
-#define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
-#define VIA_TEX_SETUP_SIZE 8
-#define VIA_FRONT 0x1
-#define VIA_BACK 0x2
-#define VIA_DEPTH 0x4
-#define VIA_STENCIL 0x8
-#define VIA_MEM_VIDEO 0
-#define VIA_MEM_AGP 1
-#define VIA_MEM_SYSTEM 2
-#define VIA_MEM_MIXED 3
-#define VIA_MEM_UNKNOWN 4
-typedef struct {
- __u32 offset;
- __u32 size;
-} drm_via_agp_t;
-typedef struct {
- __u32 offset;
- __u32 size;
-} drm_via_fb_t;
-typedef struct {
- __u32 context;
- __u32 type;
- __u32 size;
- unsigned long index;
- unsigned long offset;
-} drm_via_mem_t;
-typedef struct _drm_via_init {
- enum {
- VIA_INIT_MAP = 0x01,
- VIA_CLEANUP_MAP = 0x02
- } func;
- unsigned long sarea_priv_offset;
- unsigned long fb_offset;
- unsigned long mmio_offset;
- unsigned long agpAddr;
-} drm_via_init_t;
-typedef struct _drm_via_futex {
- enum {
- VIA_FUTEX_WAIT = 0x00,
- VIA_FUTEX_WAKE = 0X01
- } func;
- __u32 ms;
- __u32 lock;
- __u32 val;
-} drm_via_futex_t;
-typedef struct _drm_via_dma_init {
- enum {
- VIA_INIT_DMA = 0x01,
- VIA_CLEANUP_DMA = 0x02,
- VIA_DMA_INITIALIZED = 0x03
- } func;
- unsigned long offset;
- unsigned long size;
- unsigned long reg_pause_addr;
-} drm_via_dma_init_t;
-typedef struct _drm_via_cmdbuffer {
- char * buf;
- unsigned long size;
-} drm_via_cmdbuffer_t;
-typedef struct _drm_via_tex_region {
- unsigned char next, prev;
- unsigned char inUse;
- int age;
-} drm_via_tex_region_t;
-typedef struct _drm_via_sarea {
- unsigned int dirty;
- unsigned int nbox;
- struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
- drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
- int texAge;
- int ctxOwner;
- int vertexPrim;
- char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)];
- unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
- unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
- unsigned int XvMCCtxNoGrabbed;
- unsigned int pfCurrentOffset;
-} drm_via_sarea_t;
-typedef struct _drm_via_cmdbuf_size {
- enum {
- VIA_CMDBUF_SPACE = 0x01,
- VIA_CMDBUF_LAG = 0x02
- } func;
- int wait;
- __u32 size;
-} drm_via_cmdbuf_size_t;
-typedef enum {
- VIA_IRQ_ABSOLUTE = 0x0,
- VIA_IRQ_RELATIVE = 0x1,
- VIA_IRQ_SIGNAL = 0x10000000,
- VIA_IRQ_FORCE_SEQUENCE = 0x20000000
-} via_irq_seq_type_t;
-#define VIA_IRQ_FLAGS_MASK 0xF0000000
-enum drm_via_irqs {
- drm_via_irq_hqv0 = 0,
- drm_via_irq_hqv1,
- drm_via_irq_dma0_dd,
- drm_via_irq_dma0_td,
- drm_via_irq_dma1_dd,
- drm_via_irq_dma1_td,
- drm_via_irq_num
-};
-struct drm_via_wait_irq_request {
- unsigned irq;
- via_irq_seq_type_t type;
- __u32 sequence;
- __u32 signal;
-};
-typedef union drm_via_irqwait {
- struct drm_via_wait_irq_request request;
- struct drm_wait_vblank_reply reply;
-} drm_via_irqwait_t;
-typedef struct drm_via_blitsync {
- __u32 sync_handle;
- unsigned engine;
-} drm_via_blitsync_t;
-typedef struct drm_via_dmablit {
- __u32 num_lines;
- __u32 line_length;
- __u32 fb_addr;
- __u32 fb_stride;
- unsigned char * mem_addr;
- __u32 mem_stride;
- __u32 flags;
- int to_fb;
- drm_via_blitsync_t sync;
-} drm_via_dmablit_t;
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/libc/kernel/uapi/linux/affs_hardblocks.h b/libc/kernel/uapi/linux/affs_hardblocks.h
index f46bdf1..168f7dc 100644
--- a/libc/kernel/uapi/linux/affs_hardblocks.h
+++ b/libc/kernel/uapi/linux/affs_hardblocks.h
@@ -20,57 +20,57 @@
#define AFFS_HARDBLOCKS_H
#include <linux/types.h>
struct RigidDiskBlock {
- __u32 rdb_ID;
+ __be32 rdb_ID;
__be32 rdb_SummedLongs;
- __s32 rdb_ChkSum;
- __u32 rdb_HostID;
+ __be32 rdb_ChkSum;
+ __be32 rdb_HostID;
__be32 rdb_BlockBytes;
- __u32 rdb_Flags;
- __u32 rdb_BadBlockList;
+ __be32 rdb_Flags;
+ __be32 rdb_BadBlockList;
__be32 rdb_PartitionList;
- __u32 rdb_FileSysHeaderList;
- __u32 rdb_DriveInit;
- __u32 rdb_Reserved1[6];
- __u32 rdb_Cylinders;
- __u32 rdb_Sectors;
- __u32 rdb_Heads;
- __u32 rdb_Interleave;
- __u32 rdb_Park;
- __u32 rdb_Reserved2[3];
- __u32 rdb_WritePreComp;
- __u32 rdb_ReducedWrite;
- __u32 rdb_StepRate;
- __u32 rdb_Reserved3[5];
- __u32 rdb_RDBBlocksLo;
- __u32 rdb_RDBBlocksHi;
- __u32 rdb_LoCylinder;
- __u32 rdb_HiCylinder;
- __u32 rdb_CylBlocks;
- __u32 rdb_AutoParkSeconds;
- __u32 rdb_HighRDSKBlock;
- __u32 rdb_Reserved4;
+ __be32 rdb_FileSysHeaderList;
+ __be32 rdb_DriveInit;
+ __be32 rdb_Reserved1[6];
+ __be32 rdb_Cylinders;
+ __be32 rdb_Sectors;
+ __be32 rdb_Heads;
+ __be32 rdb_Interleave;
+ __be32 rdb_Park;
+ __be32 rdb_Reserved2[3];
+ __be32 rdb_WritePreComp;
+ __be32 rdb_ReducedWrite;
+ __be32 rdb_StepRate;
+ __be32 rdb_Reserved3[5];
+ __be32 rdb_RDBBlocksLo;
+ __be32 rdb_RDBBlocksHi;
+ __be32 rdb_LoCylinder;
+ __be32 rdb_HiCylinder;
+ __be32 rdb_CylBlocks;
+ __be32 rdb_AutoParkSeconds;
+ __be32 rdb_HighRDSKBlock;
+ __be32 rdb_Reserved4;
char rdb_DiskVendor[8];
char rdb_DiskProduct[16];
char rdb_DiskRevision[4];
char rdb_ControllerVendor[8];
char rdb_ControllerProduct[16];
char rdb_ControllerRevision[4];
- __u32 rdb_Reserved5[10];
+ __be32 rdb_Reserved5[10];
};
#define IDNAME_RIGIDDISK 0x5244534B
struct PartitionBlock {
__be32 pb_ID;
__be32 pb_SummedLongs;
- __s32 pb_ChkSum;
- __u32 pb_HostID;
+ __be32 pb_ChkSum;
+ __be32 pb_HostID;
__be32 pb_Next;
- __u32 pb_Flags;
- __u32 pb_Reserved1[2];
- __u32 pb_DevFlags;
+ __be32 pb_Flags;
+ __be32 pb_Reserved1[2];
+ __be32 pb_DevFlags;
__u8 pb_DriveName[32];
- __u32 pb_Reserved2[15];
+ __be32 pb_Reserved2[15];
__be32 pb_Environment[17];
- __u32 pb_EReserved[15];
+ __be32 pb_EReserved[15];
};
#define IDNAME_PARTITION 0x50415254
#define RDB_ALLOCATION_LIMIT 16
diff --git a/libc/kernel/uapi/linux/android/binder.h b/libc/kernel/uapi/linux/android/binder.h
index 52f4c6b..0d1f83d 100644
--- a/libc/kernel/uapi/linux/android/binder.h
+++ b/libc/kernel/uapi/linux/android/binder.h
@@ -221,6 +221,7 @@
BR_FAILED_REPLY = _IO('r', 17),
BR_FROZEN_REPLY = _IO('r', 18),
BR_ONEWAY_SPAM_SUSPECT = _IO('r', 19),
+ BR_TRANSACTION_PENDING_FROZEN = _IO('r', 20),
};
enum binder_driver_command_protocol {
BC_TRANSACTION = _IOW('c', 0, struct binder_transaction_data),
diff --git a/libc/kernel/uapi/linux/auto_dev-ioctl.h b/libc/kernel/uapi/linux/auto_dev-ioctl.h
index 23c8096..196bb86 100644
--- a/libc/kernel/uapi/linux/auto_dev-ioctl.h
+++ b/libc/kernel/uapi/linux/auto_dev-ioctl.h
@@ -85,7 +85,7 @@
struct args_askumount askumount;
struct args_ismountpoint ismountpoint;
};
- char path[0];
+ char path[];
};
enum {
AUTOFS_DEV_IOCTL_VERSION_CMD = 0x71,
diff --git a/libc/kernel/uapi/linux/auxvec.h b/libc/kernel/uapi/linux/auxvec.h
index c80c170..3ca56fc 100644
--- a/libc/kernel/uapi/linux/auxvec.h
+++ b/libc/kernel/uapi/linux/auxvec.h
@@ -41,6 +41,8 @@
#define AT_BASE_PLATFORM 24
#define AT_RANDOM 25
#define AT_HWCAP2 26
+#define AT_RSEQ_FEATURE_SIZE 27
+#define AT_RSEQ_ALIGN 28
#define AT_EXECFN 31
#ifndef AT_MINSIGSTKSZ
#define AT_MINSIGSTKSZ 51
diff --git a/libc/kernel/uapi/linux/batadv_packet.h b/libc/kernel/uapi/linux/batadv_packet.h
index ede53cf..9daed82 100644
--- a/libc/kernel/uapi/linux/batadv_packet.h
+++ b/libc/kernel/uapi/linux/batadv_packet.h
@@ -28,6 +28,7 @@
BATADV_CODED = 0x02,
BATADV_ELP = 0x03,
BATADV_OGM2 = 0x04,
+ BATADV_MCAST = 0x05,
#define BATADV_UNICAST_MIN 0x40
BATADV_UNICAST = 0x40,
BATADV_UNICAST_FRAG = 0x41,
diff --git a/libc/kernel/uapi/linux/bpf.h b/libc/kernel/uapi/linux/bpf.h
index 163dd1e..48ec710 100644
--- a/libc/kernel/uapi/linux/bpf.h
+++ b/libc/kernel/uapi/linux/bpf.h
@@ -204,6 +204,7 @@
BPF_PROG_TYPE_LSM,
BPF_PROG_TYPE_SK_LOOKUP,
BPF_PROG_TYPE_SYSCALL,
+ BPF_PROG_TYPE_NETFILTER,
};
enum bpf_attach_type {
BPF_CGROUP_INET_INGRESS,
@@ -250,6 +251,8 @@
BPF_PERF_EVENT,
BPF_TRACE_KPROBE_MULTI,
BPF_LSM_CGROUP,
+ BPF_STRUCT_OPS,
+ BPF_NETFILTER,
__MAX_BPF_ATTACH_TYPE
};
#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
@@ -264,6 +267,7 @@
BPF_LINK_TYPE_PERF_EVENT = 7,
BPF_LINK_TYPE_KPROBE_MULTI = 8,
BPF_LINK_TYPE_STRUCT_OPS = 9,
+ BPF_LINK_TYPE_NETFILTER = 10,
MAX_BPF_LINK_TYPE,
};
#define BPF_F_ALLOW_OVERRIDE (1U << 0)
@@ -275,6 +279,7 @@
#define BPF_F_TEST_STATE_FREQ (1U << 3)
#define BPF_F_SLEEPABLE (1U << 4)
#define BPF_F_XDP_HAS_FRAGS (1U << 5)
+#define BPF_F_XDP_DEV_BOUND_ONLY (1U << 6)
#define BPF_F_KPROBE_MULTI_RETURN (1U << 0)
#define BPF_PSEUDO_MAP_FD 1
#define BPF_PSEUDO_MAP_IDX 5
@@ -304,6 +309,8 @@
BPF_F_MMAPABLE = (1U << 10),
BPF_F_PRESERVE_ELEMS = (1U << 11),
BPF_F_INNER_MAP = (1U << 12),
+ BPF_F_LINK = (1U << 13),
+ BPF_F_PATH_FD = (1U << 14),
};
#define BPF_F_QUERY_EFFECTIVE (1U << 0)
#define BPF_F_TEST_RUN_ON_CPU (1U << 0)
@@ -391,11 +398,13 @@
__aligned_u64 fd_array;
__aligned_u64 core_relos;
__u32 core_relo_rec_size;
+ __u32 log_true_size;
};
struct {
__aligned_u64 pathname;
__u32 bpf_fd;
__u32 file_flags;
+ __s32 path_fd;
};
struct {
__u32 target_fd;
@@ -456,6 +465,7 @@
__u32 btf_size;
__u32 btf_log_size;
__u32 btf_log_level;
+ __u32 btf_log_true_size;
};
struct {
__u32 pid;
@@ -469,7 +479,10 @@
__u64 probe_addr;
} task_fd_query;
struct {
- __u32 prog_fd;
+ union {
+ __u32 prog_fd;
+ __u32 map_fd;
+ };
union {
__u32 target_fd;
__u32 target_ifindex;
@@ -496,13 +509,25 @@
__u32 target_btf_id;
__u64 cookie;
} tracing;
+ struct {
+ __u32 pf;
+ __u32 hooknum;
+ __s32 priority;
+ __u32 flags;
+ } netfilter;
};
} link_create;
struct {
__u32 link_fd;
- __u32 new_prog_fd;
+ union {
+ __u32 new_prog_fd;
+ __u32 new_map_fd;
+ };
__u32 flags;
- __u32 old_prog_fd;
+ union {
+ __u32 old_prog_fd;
+ __u32 old_map_fd;
+ };
} link_update;
struct {
__u32 link_fd;
@@ -557,6 +582,7 @@
BPF_F_ZERO_CSUM_TX = (1ULL << 1),
BPF_F_DONT_FRAGMENT = (1ULL << 2),
BPF_F_SEQ_NUMBER = (1ULL << 3),
+ BPF_F_NO_TUNNEL_KEY = (1ULL << 4),
};
enum {
BPF_F_TUNINFO_FLAGS = (1ULL << 4),
@@ -583,6 +609,8 @@
BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4),
BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5),
BPF_F_ADJ_ROOM_ENCAP_L2_ETH = (1ULL << 6),
+ BPF_F_ADJ_ROOM_DECAP_L3_IPV4 = (1ULL << 7),
+ BPF_F_ADJ_ROOM_DECAP_L3_IPV6 = (1ULL << 8),
};
enum {
BPF_ADJ_ROOM_ENCAP_L2_MASK = 0xff,
@@ -950,6 +978,15 @@
struct {
__u32 ifindex;
} xdp;
+ struct {
+ __u32 map_id;
+ } struct_ops;
+ struct {
+ __u32 pf;
+ __u32 hooknum;
+ __s32 priority;
+ __u32 flags;
+ } netfilter;
};
} __attribute__((aligned(8)));
struct bpf_sock_addr {
@@ -1095,6 +1132,8 @@
enum {
BPF_FIB_LOOKUP_DIRECT = (1U << 0),
BPF_FIB_LOOKUP_OUTPUT = (1U << 1),
+ BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2),
+ BPF_FIB_LOOKUP_TBID = (1U << 3),
};
enum {
BPF_FIB_LKUP_RET_SUCCESS,
@@ -1130,8 +1169,13 @@
__be32 ipv4_dst;
__u32 ipv6_dst[4];
};
- __be16 h_vlan_proto;
- __be16 h_vlan_TCI;
+ union {
+ struct {
+ __be16 h_vlan_proto;
+ __be16 h_vlan_TCI;
+ };
+ __u32 tbid;
+ };
__u8 smac[6];
__u8 dmac[6];
};
@@ -1218,6 +1262,18 @@
__u64 : 64;
__u64 : 64;
} __attribute__((aligned(8)));
+struct bpf_rb_root {
+ __u64 : 64;
+ __u64 : 64;
+} __attribute__((aligned(8)));
+struct bpf_rb_node {
+ __u64 : 64;
+ __u64 : 64;
+ __u64 : 64;
+} __attribute__((aligned(8)));
+struct bpf_refcount {
+ __u32 : 32;
+} __attribute__((aligned(4)));
struct bpf_sysctl {
__u32 write;
__u32 file_pos;
@@ -1283,4 +1339,10 @@
__u32 access_str_off;
enum bpf_core_relo_kind kind;
};
+enum {
+ BPF_F_TIMER_ABS = (1ULL << 0),
+};
+struct bpf_iter_num {
+ __u64 __opaque[1];
+} __attribute__((aligned(8)));
#endif
diff --git a/libc/kernel/uapi/linux/btrfs.h b/libc/kernel/uapi/linux/btrfs.h
index 0fdac66..9a7a6fa 100644
--- a/libc/kernel/uapi/linux/btrfs.h
+++ b/libc/kernel/uapi/linux/btrfs.h
@@ -107,6 +107,7 @@
__u64 unverified_errors;
};
#define BTRFS_SCRUB_READONLY 1
+#define BTRFS_SCRUB_SUPPORTED_FLAGS (BTRFS_SCRUB_READONLY)
struct btrfs_ioctl_scrub_args {
__u64 devid;
__u64 start;
@@ -157,7 +158,8 @@
__u8 uuid[BTRFS_UUID_SIZE];
__u64 bytes_used;
__u64 total_bytes;
- __u64 unused[379];
+ __u8 fsid[BTRFS_UUID_SIZE];
+ __u64 unused[377];
__u8 path[BTRFS_DEVICE_PATH_NAME_MAX];
};
#define BTRFS_FS_INFO_FLAG_CSUM_INFO (1 << 0)
diff --git a/libc/kernel/uapi/linux/can.h b/libc/kernel/uapi/linux/can.h
index 1365dba..5103f32 100644
--- a/libc/kernel/uapi/linux/can.h
+++ b/libc/kernel/uapi/linux/can.h
@@ -109,5 +109,4 @@
canid_t can_mask;
};
#define CAN_INV_FILTER 0x20000000U
-#define CAN_RAW_FILTER_MAX 512
#endif
diff --git a/libc/kernel/uapi/linux/can/raw.h b/libc/kernel/uapi/linux/can/raw.h
index f8de179..e461c82 100644
--- a/libc/kernel/uapi/linux/can/raw.h
+++ b/libc/kernel/uapi/linux/can/raw.h
@@ -20,6 +20,7 @@
#define _UAPI_CAN_RAW_H
#include <linux/can.h>
#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
+#define CAN_RAW_FILTER_MAX 512
enum {
SCM_CAN_RAW_ERRQUEUE = 1,
};
diff --git a/libc/kernel/uapi/linux/capability.h b/libc/kernel/uapi/linux/capability.h
index 8f3281e..78cba92 100644
--- a/libc/kernel/uapi/linux/capability.h
+++ b/libc/kernel/uapi/linux/capability.h
@@ -29,11 +29,12 @@
__u32 version;
int pid;
} * cap_user_header_t;
-typedef struct __user_cap_data_struct {
+struct __user_cap_data_struct {
__u32 effective;
__u32 permitted;
__u32 inheritable;
-} * cap_user_data_t;
+};
+typedef struct __user_cap_data_struct * cap_user_data_t;
#define VFS_CAP_REVISION_MASK 0xFF000000
#define VFS_CAP_REVISION_SHIFT 24
#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
diff --git a/libc/kernel/uapi/linux/cm4000_cs.h b/libc/kernel/uapi/linux/cm4000_cs.h
deleted file mode 100644
index 41b7aa7..0000000
--- a/libc/kernel/uapi/linux/cm4000_cs.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** 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_CM4000_H_
-#define _UAPI_CM4000_H_
-#include <linux/types.h>
-#include <linux/ioctl.h>
-#define MAX_ATR 33
-#define CM4000_MAX_DEV 4
-typedef struct atreq {
- __s32 atr_len;
- unsigned char atr[64];
- __s32 power_act;
- unsigned char bIFSD;
- unsigned char bIFSC;
-} atreq_t;
-typedef struct ptsreq {
- __u32 protocol;
- unsigned char flags;
- unsigned char pts1;
- unsigned char pts2;
- unsigned char pts3;
-} ptsreq_t;
-#define CM_IOC_MAGIC 'c'
-#define CM_IOC_MAXNR 255
-#define CM_IOCGSTATUS _IOR(CM_IOC_MAGIC, 0, unsigned char *)
-#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
-#define CM_IOCSPTS _IOW(CM_IOC_MAGIC, 2, ptsreq_t *)
-#define CM_IOCSRDR _IO(CM_IOC_MAGIC, 3)
-#define CM_IOCARDOFF _IO(CM_IOC_MAGIC, 4)
-#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int *)
-#define CM_CARD_INSERTED 0x01
-#define CM_CARD_POWERED 0x02
-#define CM_ATR_PRESENT 0x04
-#define CM_ATR_VALID 0x08
-#define CM_STATE_VALID 0x0f
-#define CM_NO_READER 0x10
-#define CM_BAD_CARD 0x20
-#endif
diff --git a/libc/kernel/uapi/linux/const.h b/libc/kernel/uapi/linux/const.h
index c62a702..d83caad 100644
--- a/libc/kernel/uapi/linux/const.h
+++ b/libc/kernel/uapi/linux/const.h
@@ -30,7 +30,7 @@
#define _ULL(x) (_AC(x, ULL))
#define _BITUL(x) (_UL(1) << (x))
#define _BITULL(x) (_ULL(1) << (x))
-#define __ALIGN_KERNEL(x,a) __ALIGN_KERNEL_MASK(x, (typeof(x)) (a) - 1)
+#define __ALIGN_KERNEL(x,a) __ALIGN_KERNEL_MASK(x, (__typeof__(x)) (a) - 1)
#define __ALIGN_KERNEL_MASK(x,mask) (((x) + (mask)) & ~(mask))
#define __KERNEL_DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#endif
diff --git a/libc/kernel/uapi/linux/counter.h b/libc/kernel/uapi/linux/counter.h
index f986365..e986601 100644
--- a/libc/kernel/uapi/linux/counter.h
+++ b/libc/kernel/uapi/linux/counter.h
@@ -71,6 +71,12 @@
COUNTER_COUNT_MODE_RANGE_LIMIT,
COUNTER_COUNT_MODE_NON_RECYCLE,
COUNTER_COUNT_MODE_MODULO_N,
+ COUNTER_COUNT_MODE_INTERRUPT_ON_TERMINAL_COUNT,
+ COUNTER_COUNT_MODE_HARDWARE_RETRIGGERABLE_ONESHOT,
+ COUNTER_COUNT_MODE_RATE_GENERATOR,
+ COUNTER_COUNT_MODE_SQUARE_WAVE_MODE,
+ COUNTER_COUNT_MODE_SOFTWARE_TRIGGERED_STROBE,
+ COUNTER_COUNT_MODE_HARDWARE_TRIGGERED_STROBE,
};
enum counter_function {
COUNTER_FUNCTION_INCREASE,
diff --git a/libc/kernel/uapi/linux/cxl_mem.h b/libc/kernel/uapi/linux/cxl_mem.h
index c94af87..a45ab14 100644
--- a/libc/kernel/uapi/linux/cxl_mem.h
+++ b/libc/kernel/uapi/linux/cxl_mem.h
@@ -21,23 +21,33 @@
#include <linux/types.h>
#define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)
#define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command)
-#define CXL_CMDS ___C(INVALID, "Invalid Command"), ___C(IDENTIFY, "Identify Command"), ___C(RAW, "Raw device command"), ___C(GET_SUPPORTED_LOGS, "Get Supported Logs"), ___C(GET_FW_INFO, "Get FW Info"), ___C(GET_PARTITION_INFO, "Get Partition Information"), ___C(GET_LSA, "Get Label Storage Area"), ___C(GET_HEALTH_INFO, "Get Health Info"), ___C(GET_LOG, "Get Log"), ___C(SET_PARTITION_INFO, "Set Partition Information"), ___C(SET_LSA, "Set Label Storage Area"), ___C(GET_ALERT_CONFIG, "Get Alert Configuration"), ___C(SET_ALERT_CONFIG, "Set Alert Configuration"), ___C(GET_SHUTDOWN_STATE, "Get Shutdown State"), ___C(SET_SHUTDOWN_STATE, "Set Shutdown State"), ___C(GET_POISON, "Get Poison List"), ___C(INJECT_POISON, "Inject Poison"), ___C(CLEAR_POISON, "Clear Poison"), ___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"), ___C(SCAN_MEDIA, "Scan Media"), ___C(GET_SCAN_MEDIA, "Get Scan Media Results"), ___C(MAX, "invalid / last command")
+#define CXL_CMDS ___C(INVALID, "Invalid Command"), ___C(IDENTIFY, "Identify Command"), ___C(RAW, "Raw device command"), ___C(GET_SUPPORTED_LOGS, "Get Supported Logs"), ___C(GET_FW_INFO, "Get FW Info"), ___C(GET_PARTITION_INFO, "Get Partition Information"), ___C(GET_LSA, "Get Label Storage Area"), ___C(GET_HEALTH_INFO, "Get Health Info"), ___C(GET_LOG, "Get Log"), ___C(SET_PARTITION_INFO, "Set Partition Information"), ___C(SET_LSA, "Set Label Storage Area"), ___C(GET_ALERT_CONFIG, "Get Alert Configuration"), ___C(SET_ALERT_CONFIG, "Set Alert Configuration"), ___C(GET_SHUTDOWN_STATE, "Get Shutdown State"), ___C(SET_SHUTDOWN_STATE, "Set Shutdown State"), ___DEPRECATED(GET_POISON, "Get Poison List"), ___DEPRECATED(INJECT_POISON, "Inject Poison"), ___DEPRECATED(CLEAR_POISON, "Clear Poison"), ___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"), ___DEPRECATED(SCAN_MEDIA, "Scan Media"), ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"), ___C(MAX, "invalid / last command")
#define ___C(a,b) CXL_MEM_COMMAND_ID_ ##a
+#define ___DEPRECATED(a,b) CXL_MEM_DEPRECATED_ID_ ##a
enum {
CXL_CMDS
};
#undef ___C
+#undef ___DEPRECATED
#define ___C(a,b) { b }
+#define ___DEPRECATED(a,b) { "Deprecated " b }
static const struct {
const char * name;
} cxl_command_names[] __attribute__((__unused__)) = {
CXL_CMDS
};
#undef ___C
+#undef ___DEPRECATED
+#define ___C(a,b) (0)
+#define ___DEPRECATED(a,b) (1)
+#undef ___C
+#undef ___DEPRECATED
struct cxl_command_info {
__u32 id;
__u32 flags;
-#define CXL_MEM_COMMAND_FLAG_MASK GENMASK(0, 0)
+#define CXL_MEM_COMMAND_FLAG_MASK GENMASK(1, 0)
+#define CXL_MEM_COMMAND_FLAG_ENABLED BIT(0)
+#define CXL_MEM_COMMAND_FLAG_EXCLUSIVE BIT(1)
__u32 size_in;
__u32 size_out;
};
diff --git a/libc/kernel/uapi/linux/dcbnl.h b/libc/kernel/uapi/linux/dcbnl.h
index bc88387..b2fec7b 100644
--- a/libc/kernel/uapi/linux/dcbnl.h
+++ b/libc/kernel/uapi/linux/dcbnl.h
@@ -181,6 +181,7 @@
DCB_ATTR_IEEE_QCN_STATS,
DCB_ATTR_DCB_BUFFER,
DCB_ATTR_DCB_APP_TRUST_TABLE,
+ DCB_ATTR_DCB_REWR_TABLE,
__DCB_ATTR_IEEE_MAX
};
#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
diff --git a/libc/kernel/uapi/linux/dlm_netlink.h b/libc/kernel/uapi/linux/dlm_netlink.h
deleted file mode 100644
index 0c655fa..0000000
--- a/libc/kernel/uapi/linux/dlm_netlink.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** 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 _DLM_NETLINK_H
-#define _DLM_NETLINK_H
-#include <linux/types.h>
-#include <linux/dlmconstants.h>
-enum {
- DLM_STATUS_WAITING = 1,
- DLM_STATUS_GRANTED = 2,
- DLM_STATUS_CONVERT = 3,
-};
-#define DLM_LOCK_DATA_VERSION 1
-struct dlm_lock_data {
- __u16 version;
- __u32 lockspace_id;
- int nodeid;
- int ownpid;
- __u32 id;
- __u32 remid;
- __u64 xid;
- __s8 status;
- __s8 grmode;
- __s8 rqmode;
- unsigned long timestamp;
- int resource_namelen;
- char resource_name[DLM_RESNAME_MAXLEN];
-};
-enum {
- DLM_CMD_UNSPEC = 0,
- DLM_CMD_HELLO,
- DLM_CMD_TIMEOUT,
- __DLM_CMD_MAX,
-};
-#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
-enum {
- DLM_TYPE_UNSPEC = 0,
- DLM_TYPE_LOCK,
- __DLM_TYPE_MAX,
-};
-#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
-#define DLM_GENL_VERSION 0x1
-#define DLM_GENL_NAME "DLM"
-#endif
diff --git a/libc/kernel/uapi/linux/dm-ioctl.h b/libc/kernel/uapi/linux/dm-ioctl.h
index f0ff78c..76e331f 100644
--- a/libc/kernel/uapi/linux/dm-ioctl.h
+++ b/libc/kernel/uapi/linux/dm-ioctl.h
@@ -106,9 +106,9 @@
#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
#define DM_VERSION_MAJOR 4
-#define DM_VERSION_MINOR 47
+#define DM_VERSION_MINOR 48
#define DM_VERSION_PATCHLEVEL 0
-#define DM_VERSION_EXTRA "-ioctl(2022-07-28)"
+#define DM_VERSION_EXTRA "-ioctl(2023-03-01)"
#define DM_READONLY_FLAG (1 << 0)
#define DM_SUSPEND_FLAG (1 << 1)
#define DM_PERSISTENT_DEV_FLAG (1 << 3)
diff --git a/libc/kernel/uapi/linux/dvb/frontend.h b/libc/kernel/uapi/linux/dvb/frontend.h
index 2ea7d9d..8bd90c4 100644
--- a/libc/kernel/uapi/linux/dvb/frontend.h
+++ b/libc/kernel/uapi/linux/dvb/frontend.h
@@ -138,6 +138,10 @@
FEC_28_45,
FEC_32_45,
FEC_77_90,
+ FEC_11_45,
+ FEC_4_15,
+ FEC_14_45,
+ FEC_7_15,
};
enum fe_modulation {
QPSK,
diff --git a/libc/kernel/uapi/linux/dvb/version.h b/libc/kernel/uapi/linux/dvb/version.h
index 47c8c74..8a32239 100644
--- a/libc/kernel/uapi/linux/dvb/version.h
+++ b/libc/kernel/uapi/linux/dvb/version.h
@@ -19,5 +19,5 @@
#ifndef _DVBVERSION_H_
#define _DVBVERSION_H_
#define DVB_API_VERSION 5
-#define DVB_API_VERSION_MINOR 11
+#define DVB_API_VERSION_MINOR 12
#endif
diff --git a/libc/kernel/uapi/linux/elf.h b/libc/kernel/uapi/linux/elf.h
index 28c8426..7eb29df 100644
--- a/libc/kernel/uapi/linux/elf.h
+++ b/libc/kernel/uapi/linux/elf.h
@@ -335,6 +335,8 @@
#define NT_PPC_TM_CPPR 0x10e
#define NT_PPC_TM_CDSCR 0x10f
#define NT_PPC_PKEY 0x110
+#define NT_PPC_DEXCR 0x111
+#define NT_PPC_HASHKEYR 0x112
#define NT_386_TLS 0x200
#define NT_386_IOPERM 0x201
#define NT_X86_XSTATE 0x202
@@ -366,6 +368,7 @@
#define NT_ARM_PAC_ENABLED_KEYS 0x40a
#define NT_ARM_SSVE 0x40b
#define NT_ARM_ZA 0x40c
+#define NT_ARM_ZT 0x40d
#define NT_ARC_V2 0x600
#define NT_VMCOREDD 0x700
#define NT_MIPS_DSP 0x800
@@ -376,6 +379,8 @@
#define NT_LOONGARCH_LSX 0xa02
#define NT_LOONGARCH_LASX 0xa03
#define NT_LOONGARCH_LBT 0xa04
+#define NT_LOONGARCH_HW_BREAK 0xa05
+#define NT_LOONGARCH_HW_WATCH 0xa06
#define NT_GNU_PROPERTY_TYPE_0 5
typedef struct elf32_note {
Elf32_Word n_namesz;
diff --git a/libc/kernel/uapi/linux/ethtool.h b/libc/kernel/uapi/linux/ethtool.h
index a58be6f..eec750d 100644
--- a/libc/kernel/uapi/linux/ethtool.h
+++ b/libc/kernel/uapi/linux/ethtool.h
@@ -269,6 +269,11 @@
ETH_SS_STATS_RMON,
ETH_SS_COUNT
};
+enum ethtool_mac_stats_src {
+ ETHTOOL_MAC_STATS_SRC_AGGREGATE,
+ ETHTOOL_MAC_STATS_SRC_EMAC,
+ ETHTOOL_MAC_STATS_SRC_PMAC,
+};
enum ethtool_module_power_mode_policy {
ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH = 1,
ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO,
@@ -291,6 +296,14 @@
ETHTOOL_PODL_PSE_PW_D_STATUS_IDLE,
ETHTOOL_PODL_PSE_PW_D_STATUS_ERROR,
};
+enum ethtool_mm_verify_status {
+ ETHTOOL_MM_VERIFY_STATUS_UNKNOWN,
+ ETHTOOL_MM_VERIFY_STATUS_INITIAL,
+ ETHTOOL_MM_VERIFY_STATUS_VERIFYING,
+ ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED,
+ ETHTOOL_MM_VERIFY_STATUS_FAILED,
+ ETHTOOL_MM_VERIFY_STATUS_DISABLED,
+};
struct ethtool_gstrings {
__u32 cmd;
__u32 string_set;
@@ -419,7 +432,7 @@
__u32 rule_cnt;
__u32 rss_context;
};
- __u32 rule_locs[0];
+ __u32 rule_locs[];
};
struct ethtool_rxfh_indir {
__u32 cmd;
@@ -725,6 +738,9 @@
ETHTOOL_LINK_MODE_800000baseDR8_2_Full_BIT = 96,
ETHTOOL_LINK_MODE_800000baseSR8_Full_BIT = 97,
ETHTOOL_LINK_MODE_800000baseVR8_Full_BIT = 98,
+ ETHTOOL_LINK_MODE_10baseT1S_Full_BIT = 99,
+ ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100,
+ ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101,
__ETHTOOL_LINK_MODE_MASK_NBITS
};
#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) (1UL << (ETHTOOL_LINK_MODE_ ##base_name ##_BIT))
diff --git a/libc/kernel/uapi/linux/ethtool_netlink.h b/libc/kernel/uapi/linux/ethtool_netlink.h
index cc9c53c..246ab8a 100644
--- a/libc/kernel/uapi/linux/ethtool_netlink.h
+++ b/libc/kernel/uapi/linux/ethtool_netlink.h
@@ -59,6 +59,11 @@
ETHTOOL_MSG_PSE_GET,
ETHTOOL_MSG_PSE_SET,
ETHTOOL_MSG_RSS_GET,
+ ETHTOOL_MSG_PLCA_GET_CFG,
+ ETHTOOL_MSG_PLCA_SET_CFG,
+ ETHTOOL_MSG_PLCA_GET_STATUS,
+ ETHTOOL_MSG_MM_GET,
+ ETHTOOL_MSG_MM_SET,
__ETHTOOL_MSG_USER_CNT,
ETHTOOL_MSG_USER_MAX = __ETHTOOL_MSG_USER_CNT - 1
};
@@ -102,6 +107,11 @@
ETHTOOL_MSG_MODULE_NTF,
ETHTOOL_MSG_PSE_GET_REPLY,
ETHTOOL_MSG_RSS_GET_REPLY,
+ ETHTOOL_MSG_PLCA_GET_CFG_REPLY,
+ ETHTOOL_MSG_PLCA_GET_STATUS_REPLY,
+ ETHTOOL_MSG_PLCA_NTF,
+ ETHTOOL_MSG_MM_GET_REPLY,
+ ETHTOOL_MSG_MM_NTF,
__ETHTOOL_MSG_KERNEL_CNT,
ETHTOOL_MSG_KERNEL_MAX = __ETHTOOL_MSG_KERNEL_CNT - 1
};
@@ -266,6 +276,9 @@
ETHTOOL_A_RINGS_TCP_DATA_SPLIT,
ETHTOOL_A_RINGS_CQE_SIZE,
ETHTOOL_A_RINGS_TX_PUSH,
+ ETHTOOL_A_RINGS_RX_PUSH,
+ ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN,
+ ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX,
__ETHTOOL_A_RINGS_CNT,
ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT - 1)
};
@@ -310,6 +323,9 @@
ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL,
ETHTOOL_A_COALESCE_USE_CQE_MODE_TX,
ETHTOOL_A_COALESCE_USE_CQE_MODE_RX,
+ ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES,
+ ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES,
+ ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS,
__ETHTOOL_A_COALESCE_CNT,
ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)
};
@@ -320,6 +336,7 @@
ETHTOOL_A_PAUSE_RX,
ETHTOOL_A_PAUSE_TX,
ETHTOOL_A_PAUSE_STATS,
+ ETHTOOL_A_PAUSE_STATS_SRC,
__ETHTOOL_A_PAUSE_CNT,
ETHTOOL_A_PAUSE_MAX = (__ETHTOOL_A_PAUSE_CNT - 1)
};
@@ -538,6 +555,7 @@
ETHTOOL_A_STATS_HEADER,
ETHTOOL_A_STATS_GROUPS,
ETHTOOL_A_STATS_GRP,
+ ETHTOOL_A_STATS_SRC,
__ETHTOOL_A_STATS_CNT,
ETHTOOL_A_STATS_MAX = (__ETHTOOL_A_STATS_CNT - 1)
};
@@ -560,7 +578,7 @@
ETHTOOL_A_STATS_GRP_HIST_BKT_HI,
ETHTOOL_A_STATS_GRP_HIST_VAL,
__ETHTOOL_A_STATS_GRP_CNT,
- ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_CNT - 1)
+ ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_GRP_CNT - 1)
};
enum {
ETHTOOL_A_STATS_ETH_PHY_5_SYM_ERR,
@@ -635,6 +653,48 @@
__ETHTOOL_A_RSS_CNT,
ETHTOOL_A_RSS_MAX = (__ETHTOOL_A_RSS_CNT - 1),
};
+enum {
+ ETHTOOL_A_PLCA_UNSPEC,
+ ETHTOOL_A_PLCA_HEADER,
+ ETHTOOL_A_PLCA_VERSION,
+ ETHTOOL_A_PLCA_ENABLED,
+ ETHTOOL_A_PLCA_STATUS,
+ ETHTOOL_A_PLCA_NODE_CNT,
+ ETHTOOL_A_PLCA_NODE_ID,
+ ETHTOOL_A_PLCA_TO_TMR,
+ ETHTOOL_A_PLCA_BURST_CNT,
+ ETHTOOL_A_PLCA_BURST_TMR,
+ __ETHTOOL_A_PLCA_CNT,
+ ETHTOOL_A_PLCA_MAX = (__ETHTOOL_A_PLCA_CNT - 1)
+};
+enum {
+ ETHTOOL_A_MM_STAT_UNSPEC,
+ ETHTOOL_A_MM_STAT_PAD,
+ ETHTOOL_A_MM_STAT_REASSEMBLY_ERRORS,
+ ETHTOOL_A_MM_STAT_SMD_ERRORS,
+ ETHTOOL_A_MM_STAT_REASSEMBLY_OK,
+ ETHTOOL_A_MM_STAT_RX_FRAG_COUNT,
+ ETHTOOL_A_MM_STAT_TX_FRAG_COUNT,
+ ETHTOOL_A_MM_STAT_HOLD_COUNT,
+ __ETHTOOL_A_MM_STAT_CNT,
+ ETHTOOL_A_MM_STAT_MAX = (__ETHTOOL_A_MM_STAT_CNT - 1)
+};
+enum {
+ ETHTOOL_A_MM_UNSPEC,
+ ETHTOOL_A_MM_HEADER,
+ ETHTOOL_A_MM_PMAC_ENABLED,
+ ETHTOOL_A_MM_TX_ENABLED,
+ ETHTOOL_A_MM_TX_ACTIVE,
+ ETHTOOL_A_MM_TX_MIN_FRAG_SIZE,
+ ETHTOOL_A_MM_RX_MIN_FRAG_SIZE,
+ ETHTOOL_A_MM_VERIFY_ENABLED,
+ ETHTOOL_A_MM_VERIFY_STATUS,
+ ETHTOOL_A_MM_VERIFY_TIME,
+ ETHTOOL_A_MM_MAX_VERIFY_TIME,
+ ETHTOOL_A_MM_STATS,
+ __ETHTOOL_A_MM_CNT,
+ ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1)
+};
#define ETHTOOL_GENL_NAME "ethtool"
#define ETHTOOL_GENL_VERSION 1
#define ETHTOOL_MCGRP_MONITOR_NAME "monitor"
diff --git a/libc/kernel/uapi/linux/eventfd.h b/libc/kernel/uapi/linux/eventfd.h
new file mode 100644
index 0000000..e4b41d8
--- /dev/null
+++ b/libc/kernel/uapi/linux/eventfd.h
@@ -0,0 +1,25 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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_EVENTFD_H
+#define _UAPI_LINUX_EVENTFD_H
+#include <linux/fcntl.h>
+#define EFD_SEMAPHORE (1 << 0)
+#define EFD_CLOEXEC O_CLOEXEC
+#define EFD_NONBLOCK O_NONBLOCK
+#endif
diff --git a/libc/kernel/uapi/linux/ext4.h b/libc/kernel/uapi/linux/ext4.h
new file mode 100644
index 0000000..70a3b1a
--- /dev/null
+++ b/libc/kernel/uapi/linux/ext4.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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_EXT4_H
+#define _UAPI_LINUX_EXT4_H
+#include <linux/fiemap.h>
+#include <linux/fs.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#define EXT4_IOC_GETVERSION _IOR('f', 3, long)
+#define EXT4_IOC_SETVERSION _IOW('f', 4, long)
+#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
+#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
+#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
+#define EXT4_IOC_SETRSVSZ _IOW('f', 6, long)
+#define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
+#define EXT4_IOC_GROUP_ADD _IOW('f', 8, struct ext4_new_group_input)
+#define EXT4_IOC_MIGRATE _IO('f', 9)
+#define EXT4_IOC_ALLOC_DA_BLKS _IO('f', 12)
+#define EXT4_IOC_MOVE_EXT _IOWR('f', 15, struct move_extent)
+#define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
+#define EXT4_IOC_SWAP_BOOT _IO('f', 17)
+#define EXT4_IOC_PRECACHE_EXTENTS _IO('f', 18)
+#define EXT4_IOC_CLEAR_ES_CACHE _IO('f', 40)
+#define EXT4_IOC_GETSTATE _IOW('f', 41, __u32)
+#define EXT4_IOC_GET_ES_CACHE _IOWR('f', 42, struct fiemap)
+#define EXT4_IOC_CHECKPOINT _IOW('f', 43, __u32)
+#define EXT4_IOC_GETFSUUID _IOR('f', 44, struct fsuuid)
+#define EXT4_IOC_SETFSUUID _IOW('f', 44, struct fsuuid)
+#define EXT4_IOC_SHUTDOWN _IOR('X', 125, __u32)
+#define EXT4_IOC32_GETVERSION _IOR('f', 3, int)
+#define EXT4_IOC32_SETVERSION _IOW('f', 4, int)
+#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int)
+#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int)
+#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
+#define EXT4_IOC32_GROUP_ADD _IOW('f', 8, struct compat_ext4_new_group_input)
+#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
+#define EXT4_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
+#define EXT4_STATE_FLAG_EXT_PRECACHED 0x00000001
+#define EXT4_STATE_FLAG_NEW 0x00000002
+#define EXT4_STATE_FLAG_NEWENTRY 0x00000004
+#define EXT4_STATE_FLAG_DA_ALLOC_CLOSE 0x00000008
+#define EXT4_IOC_CHECKPOINT_FLAG_DISCARD 0x1
+#define EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT 0x2
+#define EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN 0x4
+#define EXT4_IOC_CHECKPOINT_FLAG_VALID (EXT4_IOC_CHECKPOINT_FLAG_DISCARD | EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT | EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN)
+struct fsuuid {
+ __u32 fsu_len;
+ __u32 fsu_flags;
+ __u8 fsu_uuid[];
+};
+struct move_extent {
+ __u32 reserved;
+ __u32 donor_fd;
+ __u64 orig_start;
+ __u64 donor_start;
+ __u64 len;
+ __u64 moved_len;
+};
+#define EXT4_GOING_FLAGS_DEFAULT 0x0
+#define EXT4_GOING_FLAGS_LOGFLUSH 0x1
+#define EXT4_GOING_FLAGS_NOLOGFLUSH 0x2
+struct ext4_new_group_input {
+ __u32 group;
+ __u64 block_bitmap;
+ __u64 inode_bitmap;
+ __u64 inode_table;
+ __u32 blocks_count;
+ __u16 reserved_blocks;
+ __u16 unused;
+};
+#define EXT4_FIEMAP_EXTENT_HOLE 0x08000000
+#endif
diff --git a/libc/kernel/uapi/linux/fanotify.h b/libc/kernel/uapi/linux/fanotify.h
index 9815a64..f9551a8 100644
--- a/libc/kernel/uapi/linux/fanotify.h
+++ b/libc/kernel/uapi/linux/fanotify.h
@@ -113,13 +113,27 @@
__s32 error;
__u32 error_count;
};
+#define FAN_RESPONSE_INFO_NONE 0
+#define FAN_RESPONSE_INFO_AUDIT_RULE 1
struct fanotify_response {
__s32 fd;
__u32 response;
};
+struct fanotify_response_info_header {
+ __u8 type;
+ __u8 pad;
+ __u16 len;
+};
+struct fanotify_response_info_audit_rule {
+ struct fanotify_response_info_header hdr;
+ __u32 rule_number;
+ __u32 subj_trust;
+ __u32 obj_trust;
+};
#define FAN_ALLOW 0x01
#define FAN_DENY 0x02
#define FAN_AUDIT 0x10
+#define FAN_INFO 0x20
#define FAN_NOFD - 1
#define FAN_NOPIDFD FAN_NOFD
#define FAN_EPIDFD - 2
diff --git a/libc/kernel/uapi/linux/fcntl.h b/libc/kernel/uapi/linux/fcntl.h
index a46726b..5ca840b 100644
--- a/libc/kernel/uapi/linux/fcntl.h
+++ b/libc/kernel/uapi/linux/fcntl.h
@@ -34,6 +34,7 @@
#define F_SEAL_GROW 0x0004
#define F_SEAL_WRITE 0x0008
#define F_SEAL_FUTURE_WRITE 0x0010
+#define F_SEAL_EXEC 0x0020
#define F_GET_RW_HINT (F_LINUX_SPECIFIC_BASE + 11)
#define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12)
#define F_GET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 13)
@@ -64,4 +65,5 @@
#define AT_STATX_FORCE_SYNC 0x2000
#define AT_STATX_DONT_SYNC 0x4000
#define AT_RECURSIVE 0x8000
+#define AT_HANDLE_FID AT_REMOVEDIR
#endif
diff --git a/libc/kernel/uapi/linux/firewire-cdev.h b/libc/kernel/uapi/linux/firewire-cdev.h
index a54191c..73a6a9b 100644
--- a/libc/kernel/uapi/linux/firewire-cdev.h
+++ b/libc/kernel/uapi/linux/firewire-cdev.h
@@ -31,6 +31,10 @@
#define FW_CDEV_EVENT_PHY_PACKET_SENT 0x07
#define FW_CDEV_EVENT_PHY_PACKET_RECEIVED 0x08
#define FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL 0x09
+#define FW_CDEV_EVENT_REQUEST3 0x0a
+#define FW_CDEV_EVENT_RESPONSE2 0x0b
+#define FW_CDEV_EVENT_PHY_PACKET_SENT2 0x0c
+#define FW_CDEV_EVENT_PHY_PACKET_RECEIVED2 0x0d
struct fw_cdev_event_common {
__u64 closure;
__u32 type;
@@ -52,6 +56,16 @@
__u32 length;
__u32 data[];
};
+struct fw_cdev_event_response2 {
+ __u64 closure;
+ __u32 type;
+ __u32 rcode;
+ __u32 length;
+ __u32 request_tstamp;
+ __u32 response_tstamp;
+ __u32 padding;
+ __u32 data[];
+};
struct fw_cdev_event_request {
__u64 closure;
__u32 type;
@@ -74,6 +88,21 @@
__u32 length;
__u32 data[];
};
+struct fw_cdev_event_request3 {
+ __u64 closure;
+ __u32 type;
+ __u32 tcode;
+ __u64 offset;
+ __u32 source_node_id;
+ __u32 destination_node_id;
+ __u32 card;
+ __u32 generation;
+ __u32 handle;
+ __u32 length;
+ __u32 tstamp;
+ __u32 padding;
+ __u32 data[];
+};
struct fw_cdev_event_iso_interrupt {
__u64 closure;
__u32 type;
@@ -100,6 +129,14 @@
__u32 length;
__u32 data[];
};
+struct fw_cdev_event_phy_packet2 {
+ __u64 closure;
+ __u32 type;
+ __u32 rcode;
+ __u32 length;
+ __u32 tstamp;
+ __u32 data[];
+};
union fw_cdev_event {
struct fw_cdev_event_common common;
struct fw_cdev_event_bus_reset bus_reset;
@@ -110,6 +147,9 @@
struct fw_cdev_event_iso_interrupt_mc iso_interrupt_mc;
struct fw_cdev_event_iso_resource iso_resource;
struct fw_cdev_event_phy_packet phy_packet;
+ struct fw_cdev_event_request3 request3;
+ struct fw_cdev_event_response2 response2;
+ struct fw_cdev_event_phy_packet2 phy_packet2;
};
#define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info)
#define FW_CDEV_IOC_SEND_REQUEST _IOW('#', 0x01, struct fw_cdev_send_request)
diff --git a/libc/kernel/uapi/linux/fou.h b/libc/kernel/uapi/linux/fou.h
index a16b8c6..7b06cff 100644
--- a/libc/kernel/uapi/linux/fou.h
+++ b/libc/kernel/uapi/linux/fou.h
@@ -19,7 +19,12 @@
#ifndef _UAPI_LINUX_FOU_H
#define _UAPI_LINUX_FOU_H
#define FOU_GENL_NAME "fou"
-#define FOU_GENL_VERSION 0x1
+#define FOU_GENL_VERSION 1
+enum {
+ FOU_ENCAP_UNSPEC,
+ FOU_ENCAP_DIRECT,
+ FOU_ENCAP_GUE,
+};
enum {
FOU_ATTR_UNSPEC,
FOU_ATTR_PORT,
@@ -33,7 +38,7 @@
FOU_ATTR_PEER_V6,
FOU_ATTR_PEER_PORT,
FOU_ATTR_IFINDEX,
- __FOU_ATTR_MAX,
+ __FOU_ATTR_MAX
};
#define FOU_ATTR_MAX (__FOU_ATTR_MAX - 1)
enum {
@@ -41,12 +46,7 @@
FOU_CMD_ADD,
FOU_CMD_DEL,
FOU_CMD_GET,
- __FOU_CMD_MAX,
-};
-enum {
- FOU_ENCAP_UNSPEC,
- FOU_ENCAP_DIRECT,
- FOU_ENCAP_GUE,
+ __FOU_CMD_MAX
};
#define FOU_CMD_MAX (__FOU_CMD_MAX - 1)
#endif
diff --git a/libc/kernel/uapi/linux/fuse.h b/libc/kernel/uapi/linux/fuse.h
index f1eec4d..ce4424e 100644
--- a/libc/kernel/uapi/linux/fuse.h
+++ b/libc/kernel/uapi/linux/fuse.h
@@ -111,6 +111,8 @@
#define FUSE_INIT_RESERVED (1 << 31)
#define FUSE_SECURITY_CTX (1ULL << 32)
#define FUSE_HAS_INODE_DAX (1ULL << 33)
+#define FUSE_CREATE_SUPP_GROUP (1ULL << 34)
+#define FUSE_HAS_EXPIRE_ONLY (1ULL << 35)
#if FUSE_KERNEL_VERSION > 7 || FUSE_KERNEL_VERSION == 7 && FUSE_KERNEL_MINOR_VERSION >= 36
#define FUSE_PASSTHROUGH (1ULL << 63)
#else
@@ -140,6 +142,10 @@
#define FUSE_OPEN_KILL_SUIDGID (1 << 0)
#define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0)
#define FUSE_EXPIRE_ONLY (1 << 0)
+enum fuse_ext_type {
+ FUSE_MAX_NR_SECCTX = 31,
+ FUSE_EXT_GROUPS = 32,
+};
enum fuse_opcode {
FUSE_LOOKUP = 1,
FUSE_FORGET = 2,
@@ -465,7 +471,8 @@
uint32_t uid;
uint32_t gid;
uint32_t pid;
- uint32_t padding;
+ uint16_t total_extlen;
+ uint16_t padding;
};
struct fuse_out_header {
uint32_t len;
@@ -575,4 +582,12 @@
uint32_t size;
uint32_t nr_secctx;
};
+struct fuse_ext_header {
+ uint32_t size;
+ uint32_t type;
+};
+struct fuse_supp_groups {
+ uint32_t nr_groups;
+ uint32_t groups[];
+};
#endif
diff --git a/libc/kernel/uapi/linux/gsmmux.h b/libc/kernel/uapi/linux/gsmmux.h
index 4e6920a..8ff29fd 100644
--- a/libc/kernel/uapi/linux/gsmmux.h
+++ b/libc/kernel/uapi/linux/gsmmux.h
@@ -47,4 +47,22 @@
#define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)
#define GSMIOC_DISABLE_NET _IO('G', 3)
#define GSMIOC_GETFIRST _IOR('G', 4, __u32)
+struct gsm_config_ext {
+ __u32 keep_alive;
+ __u32 wait_config;
+ __u32 reserved[6];
+};
+#define GSMIOC_GETCONF_EXT _IOR('G', 5, struct gsm_config_ext)
+#define GSMIOC_SETCONF_EXT _IOW('G', 6, struct gsm_config_ext)
+struct gsm_dlci_config {
+ __u32 channel;
+ __u32 adaption;
+ __u32 mtu;
+ __u32 priority;
+ __u32 i;
+ __u32 k;
+ __u32 reserved[8];
+};
+#define GSMIOC_GETCONF_DLCI _IOWR('G', 7, struct gsm_dlci_config)
+#define GSMIOC_SETCONF_DLCI _IOW('G', 8, struct gsm_dlci_config)
#endif
diff --git a/libc/kernel/uapi/linux/handshake.h b/libc/kernel/uapi/linux/handshake.h
new file mode 100644
index 0000000..e9923ae
--- /dev/null
+++ b/libc/kernel/uapi/linux/handshake.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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_HANDSHAKE_H
+#define _UAPI_LINUX_HANDSHAKE_H
+#define HANDSHAKE_FAMILY_NAME "handshake"
+#define HANDSHAKE_FAMILY_VERSION 1
+enum handshake_handler_class {
+ HANDSHAKE_HANDLER_CLASS_NONE,
+ HANDSHAKE_HANDLER_CLASS_TLSHD,
+ HANDSHAKE_HANDLER_CLASS_MAX,
+};
+enum handshake_msg_type {
+ HANDSHAKE_MSG_TYPE_UNSPEC,
+ HANDSHAKE_MSG_TYPE_CLIENTHELLO,
+ HANDSHAKE_MSG_TYPE_SERVERHELLO,
+};
+enum handshake_auth {
+ HANDSHAKE_AUTH_UNSPEC,
+ HANDSHAKE_AUTH_UNAUTH,
+ HANDSHAKE_AUTH_PSK,
+ HANDSHAKE_AUTH_X509,
+};
+enum {
+ HANDSHAKE_A_X509_CERT = 1,
+ HANDSHAKE_A_X509_PRIVKEY,
+ __HANDSHAKE_A_X509_MAX,
+ HANDSHAKE_A_X509_MAX = (__HANDSHAKE_A_X509_MAX - 1)
+};
+enum {
+ HANDSHAKE_A_ACCEPT_SOCKFD = 1,
+ HANDSHAKE_A_ACCEPT_HANDLER_CLASS,
+ HANDSHAKE_A_ACCEPT_MESSAGE_TYPE,
+ HANDSHAKE_A_ACCEPT_TIMEOUT,
+ HANDSHAKE_A_ACCEPT_AUTH_MODE,
+ HANDSHAKE_A_ACCEPT_PEER_IDENTITY,
+ HANDSHAKE_A_ACCEPT_CERTIFICATE,
+ HANDSHAKE_A_ACCEPT_PEERNAME,
+ __HANDSHAKE_A_ACCEPT_MAX,
+ HANDSHAKE_A_ACCEPT_MAX = (__HANDSHAKE_A_ACCEPT_MAX - 1)
+};
+enum {
+ HANDSHAKE_A_DONE_STATUS = 1,
+ HANDSHAKE_A_DONE_SOCKFD,
+ HANDSHAKE_A_DONE_REMOTE_AUTH,
+ __HANDSHAKE_A_DONE_MAX,
+ HANDSHAKE_A_DONE_MAX = (__HANDSHAKE_A_DONE_MAX - 1)
+};
+enum {
+ HANDSHAKE_CMD_READY = 1,
+ HANDSHAKE_CMD_ACCEPT,
+ HANDSHAKE_CMD_DONE,
+ __HANDSHAKE_CMD_MAX,
+ HANDSHAKE_CMD_MAX = (__HANDSHAKE_CMD_MAX - 1)
+};
+#define HANDSHAKE_MCGRP_NONE "none"
+#define HANDSHAKE_MCGRP_TLSHD "tlshd"
+#endif
diff --git a/libc/kernel/uapi/linux/hw_breakpoint.h b/libc/kernel/uapi/linux/hw_breakpoint.h
index 74acd53..416d746 100644
--- a/libc/kernel/uapi/linux/hw_breakpoint.h
+++ b/libc/kernel/uapi/linux/hw_breakpoint.h
@@ -36,9 +36,4 @@
HW_BREAKPOINT_X = 4,
HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
};
-enum bp_type_idx {
- TYPE_INST = 0,
- TYPE_DATA = 1,
- TYPE_MAX
-};
#endif
diff --git a/libc/kernel/uapi/linux/idxd.h b/libc/kernel/uapi/linux/idxd.h
index 01c62f2..f8cfc11 100644
--- a/libc/kernel/uapi/linux/idxd.h
+++ b/libc/kernel/uapi/linux/idxd.h
@@ -39,6 +39,7 @@
IDXD_SCMD_WQ_NO_PRIV = 0x800f0000,
IDXD_SCMD_WQ_IRQ_ERR = 0x80100000,
IDXD_SCMD_WQ_USER_NO_IOMMU = 0x80110000,
+ IDXD_SCMD_DEV_EVL_ERR = 0x80120000,
};
#define IDXD_SCMD_SOFTERR_MASK 0x80000000
#define IDXD_SCMD_SOFTERR_SHIFT 16
@@ -74,12 +75,14 @@
DSA_OPCODE_CR_DELTA,
DSA_OPCODE_AP_DELTA,
DSA_OPCODE_DUALCAST,
+ DSA_OPCODE_TRANSL_FETCH,
DSA_OPCODE_CRCGEN = 0x10,
DSA_OPCODE_COPY_CRC,
DSA_OPCODE_DIF_CHECK,
DSA_OPCODE_DIF_INS,
DSA_OPCODE_DIF_STRP,
DSA_OPCODE_DIF_UPDT,
+ DSA_OPCODE_DIX_GEN = 0x17,
DSA_OPCODE_CFLUSH = 0x20,
};
enum iax_opcode {
@@ -131,6 +134,8 @@
DSA_COMP_HW_ERR1,
DSA_COMP_HW_ERR_DRB,
DSA_COMP_TRANSLATION_FAIL,
+ DSA_COMP_DRAIN_EVL = 0x26,
+ DSA_COMP_BATCH_EVL_ERR,
};
enum iax_completion_status {
IAX_COMP_NONE = 0,
@@ -164,6 +169,7 @@
};
#define DSA_COMP_STATUS_MASK 0x7f
#define DSA_COMP_STATUS_WRITE 0x80
+#define DSA_COMP_STATUS(status) ((status) & DSA_COMP_STATUS_MASK)
struct dsa_hw_desc {
uint32_t pasid : 20;
uint32_t rsvd : 11;
@@ -176,6 +182,8 @@
uint64_t rdback_addr;
uint64_t pattern;
uint64_t desc_list_addr;
+ uint64_t pattern_lower;
+ uint64_t transl_fetch_addr;
};
union {
uint64_t dst_addr;
@@ -186,6 +194,7 @@
union {
uint32_t xfer_size;
uint32_t desc_count;
+ uint32_t region_size;
};
uint16_t int_handle;
uint16_t rsvd1;
@@ -234,6 +243,20 @@
uint16_t dest_app_tag_mask;
uint16_t dest_app_tag_seed;
};
+ uint64_t pattern_upper;
+ struct {
+ uint64_t transl_fetch_res;
+ uint32_t region_stride;
+ };
+ struct {
+ uint8_t dix_gen_res;
+ uint8_t dest_dif_flags;
+ uint8_t dif_flags;
+ uint8_t dix_gen_res2[13];
+ uint32_t ref_tag_seed;
+ uint16_t app_tag_mask;
+ uint16_t app_tag_seed;
+ };
uint8_t op_specific[24];
};
} __attribute__((packed));
@@ -267,8 +290,12 @@
uint8_t result;
uint8_t dif_status;
};
- uint16_t rsvd;
- uint32_t bytes_completed;
+ uint8_t fault_info;
+ uint8_t rsvd;
+ union {
+ uint32_t bytes_completed;
+ uint32_t descs_completed;
+ };
uint64_t fault_addr;
union {
struct {
@@ -296,6 +323,12 @@
uint16_t dif_upd_dest_app_tag_mask;
uint16_t dif_upd_dest_app_tag;
};
+ struct {
+ uint64_t dix_gen_res;
+ uint32_t dix_ref_tag;
+ uint16_t dix_app_tag_mask;
+ uint16_t dix_app_tag;
+ };
uint8_t op_specific[16];
};
} __attribute__((packed));
@@ -305,7 +338,8 @@
struct iax_completion_record {
volatile uint8_t status;
uint8_t error_code;
- uint16_t rsvd;
+ uint8_t fault_info;
+ uint8_t rsvd;
uint32_t bytes_completed;
uint64_t fault_addr;
uint32_t invalid_flags;
diff --git a/libc/kernel/uapi/linux/if_bridge.h b/libc/kernel/uapi/linux/if_bridge.h
index 702363e..1f90580 100644
--- a/libc/kernel/uapi/linux/if_bridge.h
+++ b/libc/kernel/uapi/linux/if_bridge.h
@@ -435,6 +435,9 @@
BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
BRIDGE_VLANDB_ENTRY_STATS,
BRIDGE_VLANDB_ENTRY_MCAST_ROUTER,
+ BRIDGE_VLANDB_ENTRY_MCAST_N_GROUPS,
+ BRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS,
+ BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS,
__BRIDGE_VLANDB_ENTRY_MAX,
};
#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
@@ -504,6 +507,11 @@
MDBA_MDB_EATTR_GROUP_MODE,
MDBA_MDB_EATTR_SOURCE,
MDBA_MDB_EATTR_RTPROT,
+ MDBA_MDB_EATTR_DST,
+ MDBA_MDB_EATTR_DST_PORT,
+ MDBA_MDB_EATTR_VNI,
+ MDBA_MDB_EATTR_IFINDEX,
+ MDBA_MDB_EATTR_SRC_VNI,
__MDBA_MDB_EATTR_MAX
};
#define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
@@ -579,6 +587,11 @@
MDBE_ATTR_SRC_LIST,
MDBE_ATTR_GROUP_MODE,
MDBE_ATTR_RTPROT,
+ MDBE_ATTR_DST,
+ MDBE_ATTR_DST_PORT,
+ MDBE_ATTR_VNI,
+ MDBE_ATTR_IFINDEX,
+ MDBE_ATTR_SRC_VNI,
__MDBE_ATTR_MAX,
};
#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
diff --git a/libc/kernel/uapi/linux/if_link.h b/libc/kernel/uapi/linux/if_link.h
index 19c6346..e0b504e 100644
--- a/libc/kernel/uapi/linux/if_link.h
+++ b/libc/kernel/uapi/linux/if_link.h
@@ -167,6 +167,8 @@
IFLA_TSO_MAX_SEGS,
IFLA_ALLMULTI,
IFLA_DEVLINK_PORT,
+ IFLA_GSO_IPV4_MAX_SIZE,
+ IFLA_GRO_IPV4_MAX_SIZE,
__IFLA_MAX
};
#define IFLA_MAX (__IFLA_MAX - 1)
@@ -307,6 +309,9 @@
IFLA_BRPORT_MCAST_EHT_HOSTS_CNT,
IFLA_BRPORT_LOCKED,
IFLA_BRPORT_MAB,
+ IFLA_BRPORT_MCAST_N_GROUPS,
+ IFLA_BRPORT_MCAST_MAX_GROUPS,
+ IFLA_BRPORT_NEIGH_VLAN_SUPPRESS,
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
@@ -360,6 +365,7 @@
IFLA_MACVLAN_MACADDR_COUNT,
IFLA_MACVLAN_BC_QUEUE_LEN,
IFLA_MACVLAN_BC_QUEUE_LEN_USED,
+ IFLA_MACVLAN_BC_CUTOFF,
__IFLA_MACVLAN_MAX,
};
#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
@@ -517,6 +523,7 @@
IFLA_VXLAN_TTL_INHERIT,
IFLA_VXLAN_DF,
IFLA_VXLAN_VNIFILTER,
+ IFLA_VXLAN_LOCALBYPASS,
__IFLA_VXLAN_MAX
};
#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
diff --git a/libc/kernel/uapi/linux/if_packet.h b/libc/kernel/uapi/linux/if_packet.h
index 340b2ee..cb0c804 100644
--- a/libc/kernel/uapi/linux/if_packet.h
+++ b/libc/kernel/uapi/linux/if_packet.h
@@ -32,7 +32,10 @@
unsigned short sll_hatype;
unsigned char sll_pkttype;
unsigned char sll_halen;
- unsigned char sll_addr[8];
+ union {
+ unsigned char sll_addr[8];
+ __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
+ };
};
#define PACKET_HOST 0
#define PACKET_BROADCAST 1
@@ -65,6 +68,7 @@
#define PACKET_ROLLOVER_STATS 21
#define PACKET_FANOUT_DATA 22
#define PACKET_IGNORE_OUTGOING 23
+#define PACKET_VNET_HDR_SZ 24
#define PACKET_FANOUT_HASH 0
#define PACKET_FANOUT_LB 1
#define PACKET_FANOUT_CPU 2
@@ -113,6 +117,7 @@
#define TP_STATUS_BLK_TMO (1 << 5)
#define TP_STATUS_VLAN_TPID_VALID (1 << 6)
#define TP_STATUS_CSUM_VALID (1 << 7)
+#define TP_STATUS_GSO_TCP (1 << 8)
#define TP_STATUS_AVAILABLE 0
#define TP_STATUS_SEND_REQUEST (1 << 0)
#define TP_STATUS_SENDING (1 << 1)
diff --git a/libc/kernel/uapi/linux/in.h b/libc/kernel/uapi/linux/in.h
index 53d3074..3e98b79 100644
--- a/libc/kernel/uapi/linux/in.h
+++ b/libc/kernel/uapi/linux/in.h
@@ -141,6 +141,8 @@
#define MCAST_MSFILTER 48
#define IP_MULTICAST_ALL 49
#define IP_UNICAST_IF 50
+#define IP_LOCAL_PORT_RANGE 51
+#define IP_PROTOCOL 52
#define MCAST_EXCLUDE 0
#define MCAST_INCLUDE 1
#define IP_DEFAULT_MULTICAST_TTL 1
diff --git a/libc/kernel/uapi/linux/io_uring.h b/libc/kernel/uapi/linux/io_uring.h
index 5561448..32c6c7b 100644
--- a/libc/kernel/uapi/linux/io_uring.h
+++ b/libc/kernel/uapi/linux/io_uring.h
@@ -118,6 +118,8 @@
#define IORING_SETUP_CQE32 (1U << 11)
#define IORING_SETUP_SINGLE_ISSUER (1U << 12)
#define IORING_SETUP_DEFER_TASKRUN (1U << 13)
+#define IORING_SETUP_NO_MMAP (1U << 14)
+#define IORING_SETUP_REGISTERED_FD_ONLY (1U << 15)
enum io_uring_op {
IORING_OP_NOP,
IORING_OP_READV,
@@ -171,6 +173,7 @@
IORING_OP_LAST,
};
#define IORING_URING_CMD_FIXED (1U << 0)
+#define IORING_URING_CMD_POLLED (1U << 31)
#define IORING_FSYNC_DATASYNC (1U << 0)
#define IORING_TIMEOUT_ABS (1U << 0)
#define IORING_TIMEOUT_UPDATE (1U << 1)
@@ -178,6 +181,7 @@
#define IORING_TIMEOUT_REALTIME (1U << 3)
#define IORING_LINK_TIMEOUT_UPDATE (1U << 4)
#define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5)
+#define IORING_TIMEOUT_MULTISHOT (1U << 6)
#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)
#define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)
#define SPLICE_F_FD_IN_FIXED (1U << 31)
@@ -200,6 +204,7 @@
IORING_MSG_SEND_FD,
};
#define IORING_MSG_RING_CQE_SKIP (1U << 0)
+#define IORING_MSG_RING_FLAGS_PASS (1U << 1)
struct io_uring_cqe {
__u64 user_data;
__s32 res;
@@ -216,6 +221,9 @@
#define IORING_OFF_SQ_RING 0ULL
#define IORING_OFF_CQ_RING 0x8000000ULL
#define IORING_OFF_SQES 0x10000000ULL
+#define IORING_OFF_PBUF_RING 0x80000000ULL
+#define IORING_OFF_PBUF_SHIFT 16
+#define IORING_OFF_MMAP_MASK 0xf8000000ULL
struct io_sqring_offsets {
__u32 head;
__u32 tail;
@@ -225,7 +233,7 @@
__u32 dropped;
__u32 array;
__u32 resv1;
- __u64 resv2;
+ __u64 user_addr;
};
#define IORING_SQ_NEED_WAKEUP (1U << 0)
#define IORING_SQ_CQ_OVERFLOW (1U << 1)
@@ -239,7 +247,7 @@
__u32 cqes;
__u32 flags;
__u32 resv1;
- __u64 resv2;
+ __u64 user_addr;
};
#define IORING_CQ_EVENTFD_DISABLED (1U << 0)
#define IORING_ENTER_GETEVENTS (1U << 0)
@@ -272,6 +280,7 @@
#define IORING_FEAT_RSRC_TAGS (1U << 10)
#define IORING_FEAT_CQE_SKIP (1U << 11)
#define IORING_FEAT_LINKED_FILE (1U << 12)
+#define IORING_FEAT_REG_REG_RING (1U << 13)
enum {
IORING_REGISTER_BUFFERS = 0,
IORING_UNREGISTER_BUFFERS = 1,
@@ -299,7 +308,8 @@
IORING_UNREGISTER_PBUF_RING = 23,
IORING_REGISTER_SYNC_CANCEL = 24,
IORING_REGISTER_FILE_ALLOC_RANGE = 25,
- IORING_REGISTER_LAST
+ IORING_REGISTER_LAST,
+ IORING_REGISTER_USE_REGISTERED_RING = 1U << 31
};
enum {
IO_WQ_BOUND,
@@ -331,17 +341,6 @@
__u32 nr;
__u32 resv2;
};
-struct io_uring_notification_slot {
- __u64 tag;
- __u64 resv[3];
-};
-struct io_uring_notification_register {
- __u32 nr_slots;
- __u32 resv;
- __u64 resv2;
- __u64 data;
- __u64 resv3;
-};
#define IORING_REGISTER_FILES_SKIP (- 2)
#define IO_URING_OP_SUPPORTED (1U << 0)
struct io_uring_probe_op {
@@ -381,14 +380,17 @@
__u16 resv3;
__u16 tail;
};
- struct io_uring_buf bufs[0];
+ __DECLARE_FLEX_ARRAY(struct io_uring_buf, bufs);
};
};
+enum {
+ IOU_PBUF_RING_MMAP = 1,
+};
struct io_uring_buf_reg {
__u64 ring_addr;
__u32 ring_entries;
__u16 bgid;
- __u16 pad;
+ __u16 flags;
__u64 resv[3];
};
enum {
diff --git a/libc/kernel/uapi/linux/ioam6.h b/libc/kernel/uapi/linux/ioam6.h
index e32c8e9..8d2a25b 100644
--- a/libc/kernel/uapi/linux/ioam6.h
+++ b/libc/kernel/uapi/linux/ioam6.h
@@ -58,6 +58,6 @@
#error "Please fix <asm/byteorder.h>"
#endif
#define IOAM6_TRACE_DATA_SIZE_MAX 244
- __u8 data[0];
+ __u8 data[];
} __attribute__((packed));
#endif
diff --git a/libc/kernel/uapi/linux/ioprio.h b/libc/kernel/uapi/linux/ioprio.h
index 7a90d87..c6dc42a 100644
--- a/libc/kernel/uapi/linux/ioprio.h
+++ b/libc/kernel/uapi/linux/ioprio.h
@@ -18,19 +18,25 @@
****************************************************************************/
#ifndef _UAPI_LINUX_IOPRIO_H
#define _UAPI_LINUX_IOPRIO_H
+#include <linux/stddef.h>
+#include <linux/types.h>
#define IOPRIO_CLASS_SHIFT 13
-#define IOPRIO_CLASS_MASK 0x07
+#define IOPRIO_NR_CLASSES 8
+#define IOPRIO_CLASS_MASK (IOPRIO_NR_CLASSES - 1)
#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
#define IOPRIO_PRIO_CLASS(ioprio) (((ioprio) >> IOPRIO_CLASS_SHIFT) & IOPRIO_CLASS_MASK)
#define IOPRIO_PRIO_DATA(ioprio) ((ioprio) & IOPRIO_PRIO_MASK)
-#define IOPRIO_PRIO_VALUE(class,data) ((((class) & IOPRIO_CLASS_MASK) << IOPRIO_CLASS_SHIFT) | ((data) & IOPRIO_PRIO_MASK))
enum {
- IOPRIO_CLASS_NONE,
- IOPRIO_CLASS_RT,
- IOPRIO_CLASS_BE,
- IOPRIO_CLASS_IDLE,
+ IOPRIO_CLASS_NONE = 0,
+ IOPRIO_CLASS_RT = 1,
+ IOPRIO_CLASS_BE = 2,
+ IOPRIO_CLASS_IDLE = 3,
+ IOPRIO_CLASS_INVALID = 7,
};
-#define IOPRIO_NR_LEVELS 8
+#define IOPRIO_LEVEL_NR_BITS 3
+#define IOPRIO_NR_LEVELS (1 << IOPRIO_LEVEL_NR_BITS)
+#define IOPRIO_LEVEL_MASK (IOPRIO_NR_LEVELS - 1)
+#define IOPRIO_PRIO_LEVEL(ioprio) ((ioprio) & IOPRIO_LEVEL_MASK)
#define IOPRIO_BE_NR IOPRIO_NR_LEVELS
enum {
IOPRIO_WHO_PROCESS = 1,
@@ -39,4 +45,22 @@
};
#define IOPRIO_NORM 4
#define IOPRIO_BE_NORM IOPRIO_NORM
+#define IOPRIO_HINT_SHIFT IOPRIO_LEVEL_NR_BITS
+#define IOPRIO_HINT_NR_BITS 10
+#define IOPRIO_NR_HINTS (1 << IOPRIO_HINT_NR_BITS)
+#define IOPRIO_HINT_MASK (IOPRIO_NR_HINTS - 1)
+#define IOPRIO_PRIO_HINT(ioprio) (((ioprio) >> IOPRIO_HINT_SHIFT) & IOPRIO_HINT_MASK)
+enum {
+ IOPRIO_HINT_NONE = 0,
+ IOPRIO_HINT_DEV_DURATION_LIMIT_1 = 1,
+ IOPRIO_HINT_DEV_DURATION_LIMIT_2 = 2,
+ IOPRIO_HINT_DEV_DURATION_LIMIT_3 = 3,
+ IOPRIO_HINT_DEV_DURATION_LIMIT_4 = 4,
+ IOPRIO_HINT_DEV_DURATION_LIMIT_5 = 5,
+ IOPRIO_HINT_DEV_DURATION_LIMIT_6 = 6,
+ IOPRIO_HINT_DEV_DURATION_LIMIT_7 = 7,
+};
+#define IOPRIO_BAD_VALUE(val,max) ((val) < 0 || (val) >= (max))
+#define IOPRIO_PRIO_VALUE(class,level) ioprio_value(class, level, IOPRIO_HINT_NONE)
+#define IOPRIO_PRIO_VALUE_HINT(class,level,hint) ioprio_value(class, level, hint)
#endif
diff --git a/libc/kernel/uapi/linux/ipv6.h b/libc/kernel/uapi/linux/ipv6.h
index d62d269..d8fe3cd 100644
--- a/libc/kernel/uapi/linux/ipv6.h
+++ b/libc/kernel/uapi/linux/ipv6.h
@@ -62,7 +62,7 @@
struct rt0_hdr {
struct ipv6_rt_hdr rt_hdr;
__u32 reserved;
- struct in6_addr addr[0];
+ struct in6_addr addr[];
#define rt0_type rt_hdr.type
};
struct rt2_hdr {
diff --git a/libc/kernel/uapi/linux/isst_if.h b/libc/kernel/uapi/linux/isst_if.h
index 322f70d..9d03b7a 100644
--- a/libc/kernel/uapi/linux/isst_if.h
+++ b/libc/kernel/uapi/linux/isst_if.h
@@ -67,10 +67,136 @@
__u32 cmd_count;
struct isst_if_msr_cmd msr_cmd[1];
};
+struct isst_core_power {
+ __u8 get_set;
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u8 enable;
+ __u8 supported;
+ __u8 priority_type;
+};
+struct isst_clos_param {
+ __u8 get_set;
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u8 clos;
+ __u16 min_freq_mhz;
+ __u16 max_freq_mhz;
+ __u8 prop_prio;
+};
+struct isst_if_clos_assoc {
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u16 logical_cpu;
+ __u16 clos;
+};
+struct isst_if_clos_assoc_cmds {
+ __u16 cmd_count;
+ __u16 get_set;
+ __u16 punit_cpu_map;
+ struct isst_if_clos_assoc assoc_info[1];
+};
+struct isst_tpmi_instance_count {
+ __u8 socket_id;
+ __u8 count;
+ __u16 valid_mask;
+};
+struct isst_perf_level_info {
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u8 max_level;
+ __u8 feature_rev;
+ __u8 level_mask;
+ __u8 current_level;
+ __u8 feature_state;
+ __u8 locked;
+ __u8 enabled;
+ __u8 sst_tf_support;
+ __u8 sst_bf_support;
+};
+struct isst_perf_level_control {
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u8 level;
+};
+struct isst_perf_feature_control {
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u8 feature;
+};
+#define TRL_MAX_BUCKETS 8
+#define TRL_MAX_LEVELS 6
+struct isst_perf_level_data_info {
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u16 level;
+ __u16 tdp_ratio;
+ __u16 base_freq_mhz;
+ __u16 base_freq_avx2_mhz;
+ __u16 base_freq_avx512_mhz;
+ __u16 base_freq_amx_mhz;
+ __u16 thermal_design_power_w;
+ __u16 tjunction_max_c;
+ __u16 max_memory_freq_mhz;
+ __u16 cooling_type;
+ __u16 p0_freq_mhz;
+ __u16 p1_freq_mhz;
+ __u16 pn_freq_mhz;
+ __u16 pm_freq_mhz;
+ __u16 p0_fabric_freq_mhz;
+ __u16 p1_fabric_freq_mhz;
+ __u16 pn_fabric_freq_mhz;
+ __u16 pm_fabric_freq_mhz;
+ __u16 max_buckets;
+ __u16 max_trl_levels;
+ __u16 bucket_core_counts[TRL_MAX_BUCKETS];
+ __u16 trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS];
+};
+struct isst_perf_level_cpu_mask {
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u8 level;
+ __u8 punit_cpu_map;
+ __u64 mask;
+ __u16 cpu_buffer_size;
+ __s8 cpu_buffer[1];
+};
+struct isst_base_freq_info {
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u16 level;
+ __u16 high_base_freq_mhz;
+ __u16 low_base_freq_mhz;
+ __u16 tjunction_max_c;
+ __u16 thermal_design_power_w;
+};
+struct isst_turbo_freq_info {
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u16 level;
+ __u16 max_clip_freqs;
+ __u16 max_buckets;
+ __u16 max_trl_levels;
+ __u16 lp_clip_freq_mhz[TRL_MAX_LEVELS];
+ __u16 bucket_core_counts[TRL_MAX_BUCKETS];
+ __u16 trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS];
+};
#define ISST_IF_MAGIC 0xFE
#define ISST_IF_GET_PLATFORM_INFO _IOR(ISST_IF_MAGIC, 0, struct isst_if_platform_info *)
#define ISST_IF_GET_PHY_ID _IOWR(ISST_IF_MAGIC, 1, struct isst_if_cpu_map *)
#define ISST_IF_IO_CMD _IOW(ISST_IF_MAGIC, 2, struct isst_if_io_regs *)
#define ISST_IF_MBOX_COMMAND _IOWR(ISST_IF_MAGIC, 3, struct isst_if_mbox_cmds *)
#define ISST_IF_MSR_COMMAND _IOWR(ISST_IF_MAGIC, 4, struct isst_if_msr_cmds *)
+#define ISST_IF_COUNT_TPMI_INSTANCES _IOR(ISST_IF_MAGIC, 5, struct isst_tpmi_instance_count *)
+#define ISST_IF_CORE_POWER_STATE _IOWR(ISST_IF_MAGIC, 6, struct isst_core_power *)
+#define ISST_IF_CLOS_PARAM _IOWR(ISST_IF_MAGIC, 7, struct isst_clos_param *)
+#define ISST_IF_CLOS_ASSOC _IOWR(ISST_IF_MAGIC, 8, struct isst_if_clos_assoc_cmds *)
+#define ISST_IF_PERF_LEVELS _IOWR(ISST_IF_MAGIC, 9, struct isst_perf_level_info *)
+#define ISST_IF_PERF_SET_LEVEL _IOW(ISST_IF_MAGIC, 10, struct isst_perf_level_control *)
+#define ISST_IF_PERF_SET_FEATURE _IOW(ISST_IF_MAGIC, 11, struct isst_perf_feature_control *)
+#define ISST_IF_GET_PERF_LEVEL_INFO _IOR(ISST_IF_MAGIC, 12, struct isst_perf_level_data_info *)
+#define ISST_IF_GET_PERF_LEVEL_CPU_MASK _IOR(ISST_IF_MAGIC, 13, struct isst_perf_level_cpu_mask *)
+#define ISST_IF_GET_BASE_FREQ_INFO _IOR(ISST_IF_MAGIC, 14, struct isst_base_freq_info *)
+#define ISST_IF_GET_BASE_FREQ_CPU_MASK _IOR(ISST_IF_MAGIC, 15, struct isst_perf_level_cpu_mask *)
+#define ISST_IF_GET_TURBO_FREQ_INFO _IOR(ISST_IF_MAGIC, 16, struct isst_turbo_freq_info *)
#endif
diff --git a/libc/kernel/uapi/linux/kd.h b/libc/kernel/uapi/linux/kd.h
index 903681b..a14cab6 100644
--- a/libc/kernel/uapi/linux/kd.h
+++ b/libc/kernel/uapi/linux/kd.h
@@ -158,5 +158,7 @@
#define KD_FONT_OP_GET 1
#define KD_FONT_OP_SET_DEFAULT 2
#define KD_FONT_OP_COPY 3
+#define KD_FONT_OP_SET_TALL 4
+#define KD_FONT_OP_GET_TALL 5
#define KD_FONT_FLAG_DONT_RECALC 1
#endif
diff --git a/libc/kernel/uapi/linux/kfd_ioctl.h b/libc/kernel/uapi/linux/kfd_ioctl.h
index d21e0fc..1094182 100644
--- a/libc/kernel/uapi/linux/kfd_ioctl.h
+++ b/libc/kernel/uapi/linux/kfd_ioctl.h
@@ -21,7 +21,7 @@
#include <drm/drm.h>
#include <linux/ioctl.h>
#define KFD_IOCTL_MAJOR_VERSION 1
-#define KFD_IOCTL_MINOR_VERSION 11
+#define KFD_IOCTL_MINOR_VERSION 14
struct kfd_ioctl_get_version_args {
__u32 major_version;
__u32 minor_version;
@@ -77,6 +77,31 @@
__u32 gpu_id;
__u32 pad;
};
+struct kfd_dbg_device_info_entry {
+ __u64 exception_status;
+ __u64 lds_base;
+ __u64 lds_limit;
+ __u64 scratch_base;
+ __u64 scratch_limit;
+ __u64 gpuvm_base;
+ __u64 gpuvm_limit;
+ __u32 gpu_id;
+ __u32 location_id;
+ __u32 vendor_id;
+ __u32 device_id;
+ __u32 revision_id;
+ __u32 subsystem_vendor_id;
+ __u32 subsystem_device_id;
+ __u32 fw_version;
+ __u32 gfx_target_version;
+ __u32 simd_count;
+ __u32 max_waves_per_simd;
+ __u32 array_count;
+ __u32 simd_arrays_per_engine;
+ __u32 num_xcc;
+ __u32 capability;
+ __u32 debug_prop;
+};
#define KFD_IOC_CACHE_POLICY_COHERENT 0
#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
struct kfd_ioctl_set_memory_policy_args {
@@ -198,10 +223,14 @@
__u32 memory_lost;
__u32 gpu_id;
};
+struct kfd_hsa_signal_event_data {
+ __u64 last_event_age;
+};
struct kfd_event_data {
union {
struct kfd_hsa_memory_exception_data memory_exception_data;
struct kfd_hsa_hw_exception_data hw_exception_data;
+ struct kfd_hsa_signal_event_data signal_event_data;
};
__u64 kfd_event_data_ext;
__u32 event_id;
@@ -294,6 +323,11 @@
__u32 gpu_id;
__u32 dmabuf_fd;
};
+struct kfd_ioctl_export_dmabuf_args {
+ __u64 handle;
+ __u32 flags;
+ __u32 dmabuf_fd;
+};
enum kfd_smi_event {
KFD_SMI_EVENT_NONE = 0,
KFD_SMI_EVENT_VMFAULT = 1,
@@ -411,6 +445,230 @@
struct kfd_ioctl_set_xnack_mode_args {
__s32 xnack_enabled;
};
+enum kfd_dbg_trap_override_mode {
+ KFD_DBG_TRAP_OVERRIDE_OR = 0,
+ KFD_DBG_TRAP_OVERRIDE_REPLACE = 1
+};
+enum kfd_dbg_trap_mask {
+ KFD_DBG_TRAP_MASK_FP_INVALID = 1,
+ KFD_DBG_TRAP_MASK_FP_INPUT_DENORMAL = 2,
+ KFD_DBG_TRAP_MASK_FP_DIVIDE_BY_ZERO = 4,
+ KFD_DBG_TRAP_MASK_FP_OVERFLOW = 8,
+ KFD_DBG_TRAP_MASK_FP_UNDERFLOW = 16,
+ KFD_DBG_TRAP_MASK_FP_INEXACT = 32,
+ KFD_DBG_TRAP_MASK_INT_DIVIDE_BY_ZERO = 64,
+ KFD_DBG_TRAP_MASK_DBG_ADDRESS_WATCH = 128,
+ KFD_DBG_TRAP_MASK_DBG_MEMORY_VIOLATION = 256,
+ KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_START = (1 << 30),
+ KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_END = (1 << 31)
+};
+enum kfd_dbg_trap_wave_launch_mode {
+ KFD_DBG_TRAP_WAVE_LAUNCH_MODE_NORMAL = 0,
+ KFD_DBG_TRAP_WAVE_LAUNCH_MODE_HALT = 1,
+ KFD_DBG_TRAP_WAVE_LAUNCH_MODE_DEBUG = 3
+};
+enum kfd_dbg_trap_address_watch_mode {
+ KFD_DBG_TRAP_ADDRESS_WATCH_MODE_READ = 0,
+ KFD_DBG_TRAP_ADDRESS_WATCH_MODE_NONREAD = 1,
+ KFD_DBG_TRAP_ADDRESS_WATCH_MODE_ATOMIC = 2,
+ KFD_DBG_TRAP_ADDRESS_WATCH_MODE_ALL = 3
+};
+enum kfd_dbg_trap_flags {
+ KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP = 1,
+};
+enum kfd_dbg_trap_exception_code {
+ EC_NONE = 0,
+ EC_QUEUE_WAVE_ABORT = 1,
+ EC_QUEUE_WAVE_TRAP = 2,
+ EC_QUEUE_WAVE_MATH_ERROR = 3,
+ EC_QUEUE_WAVE_ILLEGAL_INSTRUCTION = 4,
+ EC_QUEUE_WAVE_MEMORY_VIOLATION = 5,
+ EC_QUEUE_WAVE_APERTURE_VIOLATION = 6,
+ EC_QUEUE_PACKET_DISPATCH_DIM_INVALID = 16,
+ EC_QUEUE_PACKET_DISPATCH_GROUP_SEGMENT_SIZE_INVALID = 17,
+ EC_QUEUE_PACKET_DISPATCH_CODE_INVALID = 18,
+ EC_QUEUE_PACKET_RESERVED = 19,
+ EC_QUEUE_PACKET_UNSUPPORTED = 20,
+ EC_QUEUE_PACKET_DISPATCH_WORK_GROUP_SIZE_INVALID = 21,
+ EC_QUEUE_PACKET_DISPATCH_REGISTER_INVALID = 22,
+ EC_QUEUE_PACKET_VENDOR_UNSUPPORTED = 23,
+ EC_QUEUE_PREEMPTION_ERROR = 30,
+ EC_QUEUE_NEW = 31,
+ EC_DEVICE_QUEUE_DELETE = 32,
+ EC_DEVICE_MEMORY_VIOLATION = 33,
+ EC_DEVICE_RAS_ERROR = 34,
+ EC_DEVICE_FATAL_HALT = 35,
+ EC_DEVICE_NEW = 36,
+ EC_PROCESS_RUNTIME = 48,
+ EC_PROCESS_DEVICE_REMOVE = 49,
+ EC_MAX
+};
+#define KFD_EC_MASK(ecode) (1ULL << (ecode - 1))
+#define KFD_EC_MASK_QUEUE (KFD_EC_MASK(EC_QUEUE_WAVE_ABORT) | KFD_EC_MASK(EC_QUEUE_WAVE_TRAP) | KFD_EC_MASK(EC_QUEUE_WAVE_MATH_ERROR) | KFD_EC_MASK(EC_QUEUE_WAVE_ILLEGAL_INSTRUCTION) | KFD_EC_MASK(EC_QUEUE_WAVE_MEMORY_VIOLATION) | KFD_EC_MASK(EC_QUEUE_WAVE_APERTURE_VIOLATION) | KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_DIM_INVALID) | KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_GROUP_SEGMENT_SIZE_INVALID) | KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_CODE_INVALID) | KFD_EC_MASK(EC_QUEUE_PACKET_RESERVED) | KFD_EC_MASK(EC_QUEUE_PACKET_UNSUPPORTED) | KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_WORK_GROUP_SIZE_INVALID) | KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_REGISTER_INVALID) | KFD_EC_MASK(EC_QUEUE_PACKET_VENDOR_UNSUPPORTED) | KFD_EC_MASK(EC_QUEUE_PREEMPTION_ERROR) | KFD_EC_MASK(EC_QUEUE_NEW))
+#define KFD_EC_MASK_DEVICE (KFD_EC_MASK(EC_DEVICE_QUEUE_DELETE) | KFD_EC_MASK(EC_DEVICE_RAS_ERROR) | KFD_EC_MASK(EC_DEVICE_FATAL_HALT) | KFD_EC_MASK(EC_DEVICE_MEMORY_VIOLATION) | KFD_EC_MASK(EC_DEVICE_NEW))
+#define KFD_EC_MASK_PROCESS (KFD_EC_MASK(EC_PROCESS_RUNTIME) | KFD_EC_MASK(EC_PROCESS_DEVICE_REMOVE))
+#define KFD_DBG_EC_TYPE_IS_QUEUE(ecode) (! ! (KFD_EC_MASK(ecode) & KFD_EC_MASK_QUEUE))
+#define KFD_DBG_EC_TYPE_IS_DEVICE(ecode) (! ! (KFD_EC_MASK(ecode) & KFD_EC_MASK_DEVICE))
+#define KFD_DBG_EC_TYPE_IS_PROCESS(ecode) (! ! (KFD_EC_MASK(ecode) & KFD_EC_MASK_PROCESS))
+enum kfd_dbg_runtime_state {
+ DEBUG_RUNTIME_STATE_DISABLED = 0,
+ DEBUG_RUNTIME_STATE_ENABLED = 1,
+ DEBUG_RUNTIME_STATE_ENABLED_BUSY = 2,
+ DEBUG_RUNTIME_STATE_ENABLED_ERROR = 3
+};
+struct kfd_runtime_info {
+ __u64 r_debug;
+ __u32 runtime_state;
+ __u32 ttmp_setup;
+};
+#define KFD_RUNTIME_ENABLE_MODE_ENABLE_MASK 1
+#define KFD_RUNTIME_ENABLE_MODE_TTMP_SAVE_MASK 2
+struct kfd_ioctl_runtime_enable_args {
+ __u64 r_debug;
+ __u32 mode_mask;
+ __u32 capabilities_mask;
+};
+struct kfd_queue_snapshot_entry {
+ __u64 exception_status;
+ __u64 ring_base_address;
+ __u64 write_pointer_address;
+ __u64 read_pointer_address;
+ __u64 ctx_save_restore_address;
+ __u32 queue_id;
+ __u32 gpu_id;
+ __u32 ring_size;
+ __u32 queue_type;
+ __u32 ctx_save_restore_area_size;
+ __u32 reserved;
+};
+#define KFD_DBG_QUEUE_ERROR_BIT 30
+#define KFD_DBG_QUEUE_INVALID_BIT 31
+#define KFD_DBG_QUEUE_ERROR_MASK (1 << KFD_DBG_QUEUE_ERROR_BIT)
+#define KFD_DBG_QUEUE_INVALID_MASK (1 << KFD_DBG_QUEUE_INVALID_BIT)
+struct kfd_context_save_area_header {
+ struct {
+ __u32 control_stack_offset;
+ __u32 control_stack_size;
+ __u32 wave_state_offset;
+ __u32 wave_state_size;
+ } wave_state;
+ __u32 debug_offset;
+ __u32 debug_size;
+ __u64 err_payload_addr;
+ __u32 err_event_id;
+ __u32 reserved1;
+};
+enum kfd_dbg_trap_operations {
+ KFD_IOC_DBG_TRAP_ENABLE = 0,
+ KFD_IOC_DBG_TRAP_DISABLE = 1,
+ KFD_IOC_DBG_TRAP_SEND_RUNTIME_EVENT = 2,
+ KFD_IOC_DBG_TRAP_SET_EXCEPTIONS_ENABLED = 3,
+ KFD_IOC_DBG_TRAP_SET_WAVE_LAUNCH_OVERRIDE = 4,
+ KFD_IOC_DBG_TRAP_SET_WAVE_LAUNCH_MODE = 5,
+ KFD_IOC_DBG_TRAP_SUSPEND_QUEUES = 6,
+ KFD_IOC_DBG_TRAP_RESUME_QUEUES = 7,
+ KFD_IOC_DBG_TRAP_SET_NODE_ADDRESS_WATCH = 8,
+ KFD_IOC_DBG_TRAP_CLEAR_NODE_ADDRESS_WATCH = 9,
+ KFD_IOC_DBG_TRAP_SET_FLAGS = 10,
+ KFD_IOC_DBG_TRAP_QUERY_DEBUG_EVENT = 11,
+ KFD_IOC_DBG_TRAP_QUERY_EXCEPTION_INFO = 12,
+ KFD_IOC_DBG_TRAP_GET_QUEUE_SNAPSHOT = 13,
+ KFD_IOC_DBG_TRAP_GET_DEVICE_SNAPSHOT = 14
+};
+struct kfd_ioctl_dbg_trap_enable_args {
+ __u64 exception_mask;
+ __u64 rinfo_ptr;
+ __u32 rinfo_size;
+ __u32 dbg_fd;
+};
+struct kfd_ioctl_dbg_trap_send_runtime_event_args {
+ __u64 exception_mask;
+ __u32 gpu_id;
+ __u32 queue_id;
+};
+struct kfd_ioctl_dbg_trap_set_exceptions_enabled_args {
+ __u64 exception_mask;
+};
+struct kfd_ioctl_dbg_trap_set_wave_launch_override_args {
+ __u32 override_mode;
+ __u32 enable_mask;
+ __u32 support_request_mask;
+ __u32 pad;
+};
+struct kfd_ioctl_dbg_trap_set_wave_launch_mode_args {
+ __u32 launch_mode;
+ __u32 pad;
+};
+struct kfd_ioctl_dbg_trap_suspend_queues_args {
+ __u64 exception_mask;
+ __u64 queue_array_ptr;
+ __u32 num_queues;
+ __u32 grace_period;
+};
+struct kfd_ioctl_dbg_trap_resume_queues_args {
+ __u64 queue_array_ptr;
+ __u32 num_queues;
+ __u32 pad;
+};
+struct kfd_ioctl_dbg_trap_set_node_address_watch_args {
+ __u64 address;
+ __u32 mode;
+ __u32 mask;
+ __u32 gpu_id;
+ __u32 id;
+};
+struct kfd_ioctl_dbg_trap_clear_node_address_watch_args {
+ __u32 gpu_id;
+ __u32 id;
+};
+struct kfd_ioctl_dbg_trap_set_flags_args {
+ __u32 flags;
+ __u32 pad;
+};
+struct kfd_ioctl_dbg_trap_query_debug_event_args {
+ __u64 exception_mask;
+ __u32 gpu_id;
+ __u32 queue_id;
+};
+struct kfd_ioctl_dbg_trap_query_exception_info_args {
+ __u64 info_ptr;
+ __u32 info_size;
+ __u32 source_id;
+ __u32 exception_code;
+ __u32 clear_exception;
+};
+struct kfd_ioctl_dbg_trap_queue_snapshot_args {
+ __u64 exception_mask;
+ __u64 snapshot_buf_ptr;
+ __u32 num_queues;
+ __u32 entry_size;
+};
+struct kfd_ioctl_dbg_trap_device_snapshot_args {
+ __u64 exception_mask;
+ __u64 snapshot_buf_ptr;
+ __u32 num_devices;
+ __u32 entry_size;
+};
+struct kfd_ioctl_dbg_trap_args {
+ __u32 pid;
+ __u32 op;
+ union {
+ struct kfd_ioctl_dbg_trap_enable_args enable;
+ struct kfd_ioctl_dbg_trap_send_runtime_event_args send_runtime_event;
+ struct kfd_ioctl_dbg_trap_set_exceptions_enabled_args set_exceptions_enabled;
+ struct kfd_ioctl_dbg_trap_set_wave_launch_override_args launch_override;
+ struct kfd_ioctl_dbg_trap_set_wave_launch_mode_args launch_mode;
+ struct kfd_ioctl_dbg_trap_suspend_queues_args suspend_queues;
+ struct kfd_ioctl_dbg_trap_resume_queues_args resume_queues;
+ struct kfd_ioctl_dbg_trap_set_node_address_watch_args set_node_address_watch;
+ struct kfd_ioctl_dbg_trap_clear_node_address_watch_args clear_node_address_watch;
+ struct kfd_ioctl_dbg_trap_set_flags_args set_flags;
+ struct kfd_ioctl_dbg_trap_query_debug_event_args query_debug_event;
+ struct kfd_ioctl_dbg_trap_query_exception_info_args query_exception_info;
+ struct kfd_ioctl_dbg_trap_queue_snapshot_args queue_snapshot;
+ struct kfd_ioctl_dbg_trap_device_snapshot_args device_snapshot;
+ };
+};
#define AMDKFD_IOCTL_BASE 'K'
#define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr)
#define AMDKFD_IOR(nr,type) _IOR(AMDKFD_IOCTL_BASE, nr, type)
@@ -451,6 +709,9 @@
#define AMDKFD_IOC_SET_XNACK_MODE AMDKFD_IOWR(0x21, struct kfd_ioctl_set_xnack_mode_args)
#define AMDKFD_IOC_CRIU_OP AMDKFD_IOWR(0x22, struct kfd_ioctl_criu_args)
#define AMDKFD_IOC_AVAILABLE_MEMORY AMDKFD_IOWR(0x23, struct kfd_ioctl_get_available_memory_args)
+#define AMDKFD_IOC_EXPORT_DMABUF AMDKFD_IOWR(0x24, struct kfd_ioctl_export_dmabuf_args)
+#define AMDKFD_IOC_RUNTIME_ENABLE AMDKFD_IOWR(0x25, struct kfd_ioctl_runtime_enable_args)
+#define AMDKFD_IOC_DBG_TRAP AMDKFD_IOWR(0x26, struct kfd_ioctl_dbg_trap_args)
#define AMDKFD_COMMAND_START 0x01
-#define AMDKFD_COMMAND_END 0x24
+#define AMDKFD_COMMAND_END 0x27
#endif
diff --git a/libc/kernel/uapi/linux/kfd_sysfs.h b/libc/kernel/uapi/linux/kfd_sysfs.h
index 9604b03..333ad9d 100644
--- a/libc/kernel/uapi/linux/kfd_sysfs.h
+++ b/libc/kernel/uapi/linux/kfd_sysfs.h
@@ -34,6 +34,10 @@
#define HSA_CAP_DOORBELL_TYPE_1_0 0x1
#define HSA_CAP_DOORBELL_TYPE_2_0 0x2
#define HSA_CAP_AQL_QUEUE_DOUBLE_MAP 0x00004000
+#define HSA_CAP_TRAP_DEBUG_SUPPORT 0x00008000
+#define HSA_CAP_TRAP_DEBUG_WAVE_LAUNCH_TRAP_OVERRIDE_SUPPORTED 0x00010000
+#define HSA_CAP_TRAP_DEBUG_WAVE_LAUNCH_MODE_SUPPORTED 0x00020000
+#define HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED 0x00040000
#define HSA_CAP_RESERVED_WAS_SRAM_EDCSUPPORTED 0x00080000
#define HSA_CAP_MEM_EDCSUPPORTED 0x00100000
#define HSA_CAP_RASEVENTNOTIFY 0x00200000
@@ -42,7 +46,15 @@
#define HSA_CAP_SRAM_EDCSUPPORTED 0x04000000
#define HSA_CAP_SVMAPI_SUPPORTED 0x08000000
#define HSA_CAP_FLAGS_COHERENTHOSTACCESS 0x10000000
+#define HSA_CAP_TRAP_DEBUG_FIRMWARE_SUPPORTED 0x20000000
#define HSA_CAP_RESERVED 0xe00f8000
+#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_MASK 0x0000000f
+#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_SHIFT 0
+#define HSA_DBG_WATCH_ADDR_MASK_HI_BIT_MASK 0x000003f0
+#define HSA_DBG_WATCH_ADDR_MASK_HI_BIT_SHIFT 4
+#define HSA_DBG_DISPATCH_INFO_ALWAYS_VALID 0x00000400
+#define HSA_DBG_WATCHPOINTS_EXCLUSIVE 0x00000800
+#define HSA_DBG_RESERVED 0xfffffffffffff000ull
#define HSA_MEM_HEAP_TYPE_SYSTEM 0
#define HSA_MEM_HEAP_TYPE_FB_PUBLIC 1
#define HSA_MEM_HEAP_TYPE_FB_PRIVATE 2
diff --git a/libc/kernel/uapi/linux/kvm.h b/libc/kernel/uapi/linux/kvm.h
index 9d33399..ebed0e8 100644
--- a/libc/kernel/uapi/linux/kvm.h
+++ b/libc/kernel/uapi/linux/kvm.h
@@ -265,8 +265,10 @@
__u64 nr;
__u64 args[6];
__u64 ret;
- __u32 longmode;
- __u32 pad;
+ union {
+ __u32 longmode;
+ __u64 flags;
+ };
} hypercall;
struct {
__u64 rip;
@@ -436,6 +438,8 @@
struct {
__u8 ar;
__u8 key;
+ __u8 pad1[6];
+ __u64 old_addr;
};
__u32 sida_offset;
__u8 reserved[32];
@@ -447,9 +451,12 @@
#define KVM_S390_MEMOP_SIDA_WRITE 3
#define KVM_S390_MEMOP_ABSOLUTE_READ 4
#define KVM_S390_MEMOP_ABSOLUTE_WRITE 5
+#define KVM_S390_MEMOP_ABSOLUTE_CMPXCHG 6
#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
#define KVM_S390_MEMOP_F_SKEY_PROTECTION (1ULL << 2)
+#define KVM_S390_MEMOP_EXTENSION_CAP_BASE (1 << 0)
+#define KVM_S390_MEMOP_EXTENSION_CAP_CMPXCHG (1 << 1)
struct kvm_interrupt {
__u32 irq;
};
@@ -926,6 +933,10 @@
#define KVM_CAP_DIRTY_LOG_RING_ACQ_REL 223
#define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 224
#define KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP 225
+#define KVM_CAP_PMU_EVENT_MASKED_EVENTS 226
+#define KVM_CAP_COUNTER_OFFSET 227
+#define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 228
+#define KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES 229
#ifdef KVM_CAP_IRQ_ROUTING
struct kvm_irq_routing_irqchip {
__u32 irqchip;
@@ -1122,6 +1133,8 @@
#define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
KVM_DEV_TYPE_ARM_PV_TIME,
#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
+ KVM_DEV_TYPE_RISCV_AIA,
+#define KVM_DEV_TYPE_RISCV_AIA KVM_DEV_TYPE_RISCV_AIA
KVM_DEV_TYPE_MAX,
};
struct kvm_vfio_spapr_tce {
@@ -1192,6 +1205,7 @@
#define KVM_SET_PMU_EVENT_FILTER _IOW(KVMIO, 0xb2, struct kvm_pmu_event_filter)
#define KVM_PPC_SVM_OFF _IO(KVMIO, 0xb3)
#define KVM_ARM_MTE_COPY_TAGS _IOR(KVMIO, 0xb4, struct kvm_arm_copy_mte_tags)
+#define KVM_ARM_SET_COUNTER_OFFSET _IOW(KVMIO, 0xb5, struct kvm_arm_counter_offset)
#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)
#define KVM_SET_DEVICE_ATTR _IOW(KVMIO, 0xe1, struct kvm_device_attr)
#define KVM_GET_DEVICE_ATTR _IOW(KVMIO, 0xe2, struct kvm_device_attr)
diff --git a/libc/kernel/uapi/linux/mdio.h b/libc/kernel/uapi/linux/mdio.h
index 7a2c9af..2305f64 100644
--- a/libc/kernel/uapi/linux/mdio.h
+++ b/libc/kernel/uapi/linux/mdio.h
@@ -78,6 +78,8 @@
#define MDIO_AN_T1_LP_L 517
#define MDIO_AN_T1_LP_M 518
#define MDIO_AN_T1_LP_H 519
+#define MDIO_AN_10BT1_AN_CTRL 526
+#define MDIO_AN_10BT1_AN_STAT 527
#define MDIO_PMA_PMD_BT1_CTRL 2100
#define MDIO_PMA_LASI_RXCTRL 0x9000
#define MDIO_PMA_LASI_TXCTRL 0x9001
@@ -200,6 +202,28 @@
#define MDIO_PMA_EXTABLE_10BT 0x0100
#define MDIO_PMA_EXTABLE_BT1 0x0800
#define MDIO_PMA_EXTABLE_NBT 0x4000
+#define MDIO_AN_C73_0_S_MASK GENMASK(4, 0)
+#define MDIO_AN_C73_0_E_MASK GENMASK(9, 5)
+#define MDIO_AN_C73_0_PAUSE BIT(10)
+#define MDIO_AN_C73_0_ASM_DIR BIT(11)
+#define MDIO_AN_C73_0_C2 BIT(12)
+#define MDIO_AN_C73_0_RF BIT(13)
+#define MDIO_AN_C73_0_ACK BIT(14)
+#define MDIO_AN_C73_0_NP BIT(15)
+#define MDIO_AN_C73_1_T_MASK GENMASK(4, 0)
+#define MDIO_AN_C73_1_1000BASE_KX BIT(5)
+#define MDIO_AN_C73_1_10GBASE_KX4 BIT(6)
+#define MDIO_AN_C73_1_10GBASE_KR BIT(7)
+#define MDIO_AN_C73_1_40GBASE_KR4 BIT(8)
+#define MDIO_AN_C73_1_40GBASE_CR4 BIT(9)
+#define MDIO_AN_C73_1_100GBASE_CR10 BIT(10)
+#define MDIO_AN_C73_1_100GBASE_KP4 BIT(11)
+#define MDIO_AN_C73_1_100GBASE_KR4 BIT(12)
+#define MDIO_AN_C73_1_100GBASE_CR4 BIT(13)
+#define MDIO_AN_C73_1_25GBASE_R_S BIT(14)
+#define MDIO_AN_C73_1_25GBASE_R BIT(15)
+#define MDIO_AN_C73_2_2500BASE_KX BIT(0)
+#define MDIO_AN_C73_2_5GBASE_KR BIT(1)
#define MDIO_PHYXS_LNSTAT_SYNC0 0x0001
#define MDIO_PHYXS_LNSTAT_SYNC1 0x0002
#define MDIO_PHYXS_LNSTAT_SYNC2 0x0004
@@ -270,6 +294,8 @@
#define MDIO_AN_T1_LP_M_B10L 0x4000
#define MDIO_AN_T1_LP_H_10L_TX_HI_REQ 0x1000
#define MDIO_AN_T1_LP_H_10L_TX_HI 0x2000
+#define MDIO_AN_10BT1_AN_CTRL_ADV_EEE_T1L 0x4000
+#define MDIO_AN_10BT1_AN_STAT_LPA_EEE_T1L 0x4000
#define MDIO_PMA_PMD_BT1_CTRL_CFG_MST 0x4000
#define MDIO_AN_EEE_ADV_100TX 0x0002
#define MDIO_AN_EEE_ADV_1000T 0x0004
diff --git a/libc/kernel/uapi/linux/media-bus-format.h b/libc/kernel/uapi/linux/media-bus-format.h
index 87614cf..79d4cd5 100644
--- a/libc/kernel/uapi/linux/media-bus-format.h
+++ b/libc/kernel/uapi/linux/media-bus-format.h
@@ -30,8 +30,11 @@
#define MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007
#define MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008
#define MEDIA_BUS_FMT_RGB666_1X18 0x1009
+#define MEDIA_BUS_FMT_BGR666_1X18 0x1023
#define MEDIA_BUS_FMT_RBG888_1X24 0x100e
#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x1015
+#define MEDIA_BUS_FMT_BGR666_1X24_CPADHI 0x1024
+#define MEDIA_BUS_FMT_RGB565_1X24_CPADHI 0x1022
#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x1010
#define MEDIA_BUS_FMT_BGR888_1X24 0x1013
#define MEDIA_BUS_FMT_BGR888_3X8 0x101b
diff --git a/libc/kernel/uapi/linux/media.h b/libc/kernel/uapi/linux/media.h
index fe97e90..6027dc4 100644
--- a/libc/kernel/uapi/linux/media.h
+++ b/libc/kernel/uapi/linux/media.h
@@ -66,8 +66,8 @@
#define MEDIA_ENT_F_ATV_DECODER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 4)
#define MEDIA_ENT_F_DV_DECODER (MEDIA_ENT_F_BASE + 0x6001)
#define MEDIA_ENT_F_DV_ENCODER (MEDIA_ENT_F_BASE + 0x6002)
-#define MEDIA_ENT_FL_DEFAULT (1 << 0)
-#define MEDIA_ENT_FL_CONNECTOR (1 << 1)
+#define MEDIA_ENT_FL_DEFAULT (1U << 0)
+#define MEDIA_ENT_FL_CONNECTOR (1U << 1)
#define MEDIA_ENT_ID_FLAG_NEXT (1U << 31)
struct media_entity_desc {
__u32 id;
@@ -101,22 +101,22 @@
__u8 raw[184];
};
};
-#define MEDIA_PAD_FL_SINK (1 << 0)
-#define MEDIA_PAD_FL_SOURCE (1 << 1)
-#define MEDIA_PAD_FL_MUST_CONNECT (1 << 2)
+#define MEDIA_PAD_FL_SINK (1U << 0)
+#define MEDIA_PAD_FL_SOURCE (1U << 1)
+#define MEDIA_PAD_FL_MUST_CONNECT (1U << 2)
struct media_pad_desc {
__u32 entity;
__u16 index;
__u32 flags;
__u32 reserved[2];
};
-#define MEDIA_LNK_FL_ENABLED (1 << 0)
-#define MEDIA_LNK_FL_IMMUTABLE (1 << 1)
-#define MEDIA_LNK_FL_DYNAMIC (1 << 2)
+#define MEDIA_LNK_FL_ENABLED (1U << 0)
+#define MEDIA_LNK_FL_IMMUTABLE (1U << 1)
+#define MEDIA_LNK_FL_DYNAMIC (1U << 2)
#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)
-#define MEDIA_LNK_FL_DATA_LINK (0 << 28)
-#define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28)
-#define MEDIA_LNK_FL_ANCILLARY_LINK (2 << 28)
+#define MEDIA_LNK_FL_DATA_LINK (0U << 28)
+#define MEDIA_LNK_FL_INTERFACE_LINK (1U << 28)
+#define MEDIA_LNK_FL_ANCILLARY_LINK (2U << 28)
struct media_link_desc {
struct media_pad_desc source;
struct media_pad_desc sink;
@@ -146,7 +146,7 @@
#define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE)
#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1)
#define MEDIA_INTF_T_ALSA_CONTROL (MEDIA_INTF_T_ALSA_BASE + 2)
-#define MEDIA_V2_ENTITY_HAS_FLAGS(media_version) ((media_version) >= ((4 << 16) | (19 << 8) | 0))
+#define MEDIA_V2_ENTITY_HAS_FLAGS(media_version) ((media_version) >= ((4U << 16) | (19U << 8) | 0U))
struct media_v2_entity {
__u32 id;
char name[64];
@@ -168,7 +168,7 @@
__u32 raw[16];
};
} __attribute__((packed));
-#define MEDIA_V2_PAD_HAS_INDEX(media_version) ((media_version) >= ((4 << 16) | (19 << 8) | 0))
+#define MEDIA_V2_PAD_HAS_INDEX(media_version) ((media_version) >= ((4U << 16) | (19U << 8) | 0U))
struct media_v2_pad {
__u32 id;
__u32 entity_id;
@@ -229,5 +229,5 @@
#define MEDIA_INTF_T_ALSA_HWDEP (MEDIA_INTF_T_ALSA_BASE + 5)
#define MEDIA_INTF_T_ALSA_SEQUENCER (MEDIA_INTF_T_ALSA_BASE + 6)
#define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7)
-#define MEDIA_API_VERSION ((0 << 16) | (1 << 8) | 0)
+#define MEDIA_API_VERSION ((0U << 16) | (1U << 8) | 0U)
#endif
diff --git a/libc/kernel/uapi/linux/mei.h b/libc/kernel/uapi/linux/mei.h
index ed37abd..3d4ae66 100644
--- a/libc/kernel/uapi/linux/mei.h
+++ b/libc/kernel/uapi/linux/mei.h
@@ -18,7 +18,7 @@
****************************************************************************/
#ifndef _LINUX_MEI_H
#define _LINUX_MEI_H
-#include <linux/uuid.h>
+#include <linux/mei_uuid.h>
#define IOCTL_MEI_CONNECT_CLIENT _IOWR('H', 0x01, struct mei_connect_client_data)
struct mei_client {
__u32 max_msg_length;
diff --git a/libc/kernel/uapi/linux/mei_uuid.h b/libc/kernel/uapi/linux/mei_uuid.h
new file mode 100644
index 0000000..17f6e55
--- /dev/null
+++ b/libc/kernel/uapi/linux/mei_uuid.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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_MEI_UUID_H_
+#define _UAPI_LINUX_MEI_UUID_H_
+#include <linux/types.h>
+typedef struct {
+ __u8 b[16];
+} uuid_le;
+#define UUID_LE(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
+((uuid_le) \
+{ { (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, (b) & 0xff, ((b) >> 8) & 0xff, (c) & 0xff, ((c) >> 8) & 0xff, (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } })
+#define NULL_UUID_LE UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
+#endif
diff --git a/libc/kernel/uapi/linux/membarrier.h b/libc/kernel/uapi/linux/membarrier.h
index 43c103b..94dd797 100644
--- a/libc/kernel/uapi/linux/membarrier.h
+++ b/libc/kernel/uapi/linux/membarrier.h
@@ -29,6 +29,7 @@
MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 6),
MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ = (1 << 7),
MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ = (1 << 8),
+ MEMBARRIER_CMD_GET_REGISTRATIONS = (1 << 9),
MEMBARRIER_CMD_SHARED = MEMBARRIER_CMD_GLOBAL,
};
enum membarrier_cmd_flag {
diff --git a/libc/kernel/uapi/linux/memfd.h b/libc/kernel/uapi/linux/memfd.h
index 914c076..28228df 100644
--- a/libc/kernel/uapi/linux/memfd.h
+++ b/libc/kernel/uapi/linux/memfd.h
@@ -22,6 +22,8 @@
#define MFD_CLOEXEC 0x0001U
#define MFD_ALLOW_SEALING 0x0002U
#define MFD_HUGETLB 0x0004U
+#define MFD_NOEXEC_SEAL 0x0008U
+#define MFD_EXEC 0x0010U
#define MFD_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT
#define MFD_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK
#define MFD_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB
diff --git a/libc/kernel/uapi/linux/meye.h b/libc/kernel/uapi/linux/meye.h
deleted file mode 100644
index a1112c4..0000000
--- a/libc/kernel/uapi/linux/meye.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** 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 _MEYE_H_
-#define _MEYE_H_
-struct meye_params {
- unsigned char subsample;
- unsigned char quality;
- unsigned char sharpness;
- unsigned char agc;
- unsigned char picture;
- unsigned char framerate;
-};
-#define MEYEIOC_G_PARAMS _IOR('v', BASE_VIDIOC_PRIVATE + 0, struct meye_params)
-#define MEYEIOC_S_PARAMS _IOW('v', BASE_VIDIOC_PRIVATE + 1, struct meye_params)
-#define MEYEIOC_QBUF_CAPT _IOW('v', BASE_VIDIOC_PRIVATE + 2, int)
-#define MEYEIOC_SYNC _IOWR('v', BASE_VIDIOC_PRIVATE + 3, int)
-#define MEYEIOC_STILLCAPT _IO('v', BASE_VIDIOC_PRIVATE + 4)
-#define MEYEIOC_STILLJCAPT _IOR('v', BASE_VIDIOC_PRIVATE + 5, int)
-#define V4L2_CID_MEYE_AGC (V4L2_CID_USER_MEYE_BASE + 0)
-#define V4L2_CID_MEYE_PICTURE (V4L2_CID_USER_MEYE_BASE + 1)
-#define V4L2_CID_MEYE_FRAMERATE (V4L2_CID_USER_MEYE_BASE + 2)
-#endif
diff --git a/libc/kernel/uapi/linux/mman.h b/libc/kernel/uapi/linux/mman.h
index 9fdccf6..a58fc49 100644
--- a/libc/kernel/uapi/linux/mman.h
+++ b/libc/kernel/uapi/linux/mman.h
@@ -20,6 +20,7 @@
#define _UAPI_LINUX_MMAN_H
#include <asm/mman.h>
#include <asm-generic/hugetlb_encode.h>
+#include <linux/types.h>
#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2
#define MREMAP_DONTUNMAP 4
@@ -44,4 +45,15 @@
#define MAP_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB
#define MAP_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB
#define MAP_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB
+struct cachestat_range {
+ __u64 off;
+ __u64 len;
+};
+struct cachestat {
+ __u64 nr_cache;
+ __u64 nr_dirty;
+ __u64 nr_writeback;
+ __u64 nr_evicted;
+ __u64 nr_recently_evicted;
+};
#endif
diff --git a/libc/kernel/uapi/linux/mount.h b/libc/kernel/uapi/linux/mount.h
index 2099b48..28f233a 100644
--- a/libc/kernel/uapi/linux/mount.h
+++ b/libc/kernel/uapi/linux/mount.h
@@ -63,7 +63,8 @@
#define MOVE_MOUNT_T_AUTOMOUNTS 0x00000020
#define MOVE_MOUNT_T_EMPTY_PATH 0x00000040
#define MOVE_MOUNT_SET_GROUP 0x00000100
-#define MOVE_MOUNT__MASK 0x00000177
+#define MOVE_MOUNT_BENEATH 0x00000200
+#define MOVE_MOUNT__MASK 0x00000377
#define FSOPEN_CLOEXEC 0x00000001
#define FSPICK_CLOEXEC 0x00000001
#define FSPICK_SYMLINK_NOFOLLOW 0x00000002
diff --git a/libc/kernel/uapi/linux/mptcp.h b/libc/kernel/uapi/linux/mptcp.h
index 9f7215c..d84ab50 100644
--- a/libc/kernel/uapi/linux/mptcp.h
+++ b/libc/kernel/uapi/linux/mptcp.h
@@ -114,6 +114,11 @@
__u8 mptcpi_local_addr_used;
__u8 mptcpi_local_addr_max;
__u8 mptcpi_csum_enabled;
+ __u32 mptcpi_retransmits;
+ __u64 mptcpi_bytes_retrans;
+ __u64 mptcpi_bytes_sent;
+ __u64 mptcpi_bytes_received;
+ __u64 mptcpi_bytes_acked;
};
enum mptcp_event_type {
MPTCP_EVENT_UNSPEC = 0,
@@ -179,7 +184,23 @@
struct __kernel_sockaddr_storage ss_remote;
};
};
+struct mptcp_subflow_info {
+ __u32 id;
+ struct mptcp_subflow_addrs addrs;
+};
+struct mptcp_full_info {
+ __u32 size_tcpinfo_kernel;
+ __u32 size_tcpinfo_user;
+ __u32 size_sfinfo_kernel;
+ __u32 size_sfinfo_user;
+ __u32 num_subflows;
+ __u32 size_arrays_user;
+ __aligned_u64 subflow_info;
+ __aligned_u64 tcp_info;
+ struct mptcp_info mptcp_info;
+};
#define MPTCP_INFO 1
#define MPTCP_TCPINFO 2
#define MPTCP_SUBFLOW_ADDRS 3
+#define MPTCP_FULL_INFO 4
#endif
diff --git a/libc/kernel/uapi/linux/nbd.h b/libc/kernel/uapi/linux/nbd.h
index 3b74393..fee4b74 100644
--- a/libc/kernel/uapi/linux/nbd.h
+++ b/libc/kernel/uapi/linux/nbd.h
@@ -51,13 +51,19 @@
struct nbd_request {
__be32 magic;
__be32 type;
- char handle[8];
+ union {
+ __be64 cookie;
+ char handle[8];
+ };
__be64 from;
__be32 len;
} __attribute__((packed));
struct nbd_reply {
__be32 magic;
__be32 error;
- char handle[8];
+ union {
+ __be64 cookie;
+ char handle[8];
+ };
};
#endif
diff --git a/libc/kernel/uapi/linux/netdev.h b/libc/kernel/uapi/linux/netdev.h
new file mode 100644
index 0000000..53a237b
--- /dev/null
+++ b/libc/kernel/uapi/linux/netdev.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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_NETDEV_H
+#define _UAPI_LINUX_NETDEV_H
+#define NETDEV_FAMILY_NAME "netdev"
+#define NETDEV_FAMILY_VERSION 1
+enum netdev_xdp_act {
+ NETDEV_XDP_ACT_BASIC = 1,
+ NETDEV_XDP_ACT_REDIRECT = 2,
+ NETDEV_XDP_ACT_NDO_XMIT = 4,
+ NETDEV_XDP_ACT_XSK_ZEROCOPY = 8,
+ NETDEV_XDP_ACT_HW_OFFLOAD = 16,
+ NETDEV_XDP_ACT_RX_SG = 32,
+ NETDEV_XDP_ACT_NDO_XMIT_SG = 64,
+ NETDEV_XDP_ACT_MASK = 127,
+};
+enum {
+ NETDEV_A_DEV_IFINDEX = 1,
+ NETDEV_A_DEV_PAD,
+ NETDEV_A_DEV_XDP_FEATURES,
+ __NETDEV_A_DEV_MAX,
+ NETDEV_A_DEV_MAX = (__NETDEV_A_DEV_MAX - 1)
+};
+enum {
+ NETDEV_CMD_DEV_GET = 1,
+ NETDEV_CMD_DEV_ADD_NTF,
+ NETDEV_CMD_DEV_DEL_NTF,
+ NETDEV_CMD_DEV_CHANGE_NTF,
+ __NETDEV_CMD_MAX,
+ NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)
+};
+#define NETDEV_MCGRP_MGMT "mgmt"
+#endif
diff --git a/libc/kernel/uapi/linux/nfsd/export.h b/libc/kernel/uapi/linux/nfsd/export.h
index 4716fb1..63ccedc 100644
--- a/libc/kernel/uapi/linux/nfsd/export.h
+++ b/libc/kernel/uapi/linux/nfsd/export.h
@@ -41,4 +41,9 @@
#define NFSEXP_PNFS 0x20000
#define NFSEXP_ALLFLAGS 0x3FEFF
#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH | NFSEXP_ALLSQUASH | NFSEXP_INSECURE_PORT)
+#define NFSEXP_XPRTSEC_NONE 0x0001
+#define NFSEXP_XPRTSEC_TLS 0x0002
+#define NFSEXP_XPRTSEC_MTLS 0x0004
+#define NFSEXP_XPRTSEC_NUM (3)
+#define NFSEXP_XPRTSEC_ALL (NFSEXP_XPRTSEC_NONE | NFSEXP_XPRTSEC_TLS | NFSEXP_XPRTSEC_MTLS)
#endif
diff --git a/libc/kernel/uapi/linux/nl80211.h b/libc/kernel/uapi/linux/nl80211.h
index 83fe597..90d7b9e 100644
--- a/libc/kernel/uapi/linux/nl80211.h
+++ b/libc/kernel/uapi/linux/nl80211.h
@@ -190,6 +190,8 @@
NL80211_CMD_ADD_LINK_STA,
NL80211_CMD_MODIFY_LINK_STA,
NL80211_CMD_REMOVE_LINK_STA,
+ NL80211_CMD_SET_HW_TIMESTAMP,
+ NL80211_CMD_LINKS_REMOVED,
__NL80211_CMD_AFTER_LAST,
NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
};
@@ -528,6 +530,11 @@
NL80211_ATTR_TX_HW_TIMESTAMP,
NL80211_ATTR_RX_HW_TIMESTAMP,
NL80211_ATTR_TD_BITMAP,
+ NL80211_ATTR_PUNCT_BITMAP,
+ NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS,
+ NL80211_ATTR_HW_TIMESTAMP_ENABLED,
+ NL80211_ATTR_EMA_RNR_ELEMS,
+ NL80211_ATTR_MLO_LINK_DISABLED,
__NL80211_ATTR_AFTER_LAST,
NUM_NL80211_ATTR = __NL80211_ATTR_AFTER_LAST,
NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
@@ -682,6 +689,13 @@
NL80211_RATE_INFO_EHT_NSS,
NL80211_RATE_INFO_EHT_GI,
NL80211_RATE_INFO_EHT_RU_ALLOC,
+ NL80211_RATE_INFO_S1G_MCS,
+ NL80211_RATE_INFO_S1G_NSS,
+ NL80211_RATE_INFO_1_MHZ_WIDTH,
+ NL80211_RATE_INFO_2_MHZ_WIDTH,
+ NL80211_RATE_INFO_4_MHZ_WIDTH,
+ NL80211_RATE_INFO_8_MHZ_WIDTH,
+ NL80211_RATE_INFO_16_MHZ_WIDTH,
__NL80211_RATE_INFO_AFTER_LAST,
NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1
};
@@ -821,6 +835,8 @@
NL80211_BAND_ATTR_IFTYPE_DATA,
NL80211_BAND_ATTR_EDMG_CHANNELS,
NL80211_BAND_ATTR_EDMG_BW_CONFIG,
+ NL80211_BAND_ATTR_S1G_MCS_NSS_SET,
+ NL80211_BAND_ATTR_S1G_CAPA,
__NL80211_BAND_ATTR_AFTER_LAST,
NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
};
@@ -932,6 +948,7 @@
NL80211_RRF_NO_160MHZ = 1 << 16,
NL80211_RRF_NO_HE = 1 << 17,
NL80211_RRF_NO_320MHZ = 1 << 18,
+ NL80211_RRF_NO_EHT = 1 << 19,
};
#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
@@ -1396,6 +1413,7 @@
#define NL80211_KEK_LEN 16
#define NL80211_KCK_EXT_LEN 24
#define NL80211_KEK_EXT_LEN 32
+#define NL80211_KCK_EXT_LEN_32 32
#define NL80211_REPLAY_CTR_LEN 8
enum nl80211_rekey_data {
__NL80211_REKEY_DATA_INVALID,
@@ -1533,6 +1551,9 @@
NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
NL80211_EXT_FEATURE_RADAR_BACKGROUND,
NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
+ NL80211_EXT_FEATURE_PUNCT,
+ NL80211_EXT_FEATURE_SECURE_NAN,
+ NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
NUM_NL80211_EXT_FEATURES,
MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1
};
diff --git a/libc/kernel/uapi/linux/openvswitch.h b/libc/kernel/uapi/linux/openvswitch.h
index 0226e93..1e2a412 100644
--- a/libc/kernel/uapi/linux/openvswitch.h
+++ b/libc/kernel/uapi/linux/openvswitch.h
@@ -396,6 +396,7 @@
};
enum ovs_hash_alg {
OVS_HASH_ALG_L4,
+ OVS_HASH_ALG_SYM_L4,
};
struct ovs_action_hash {
__u32 hash_alg;
diff --git a/libc/kernel/uapi/linux/parport.h b/libc/kernel/uapi/linux/parport.h
index 8152224..611775f 100644
--- a/libc/kernel/uapi/linux/parport.h
+++ b/libc/kernel/uapi/linux/parport.h
@@ -75,4 +75,7 @@
#define IEEE1284_DATA 0
#define PARPORT_EPP_FAST (1 << 0)
#define PARPORT_W91284PIC (1 << 1)
+#define PARPORT_EPP_FAST_32 PARPORT_EPP_FAST
+#define PARPORT_EPP_FAST_16 (1 << 2)
+#define PARPORT_EPP_FAST_8 (1 << 3)
#endif
diff --git a/libc/kernel/uapi/linux/pci_regs.h b/libc/kernel/uapi/linux/pci_regs.h
index f932c18..888fb5c 100644
--- a/libc/kernel/uapi/linux/pci_regs.h
+++ b/libc/kernel/uapi/linux/pci_regs.h
@@ -594,6 +594,7 @@
#define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380
#define PCI_EXP_LNKCTL2_HASD 0x0020
#define PCI_EXP_LNKSTA2 0x32
+#define PCI_EXP_LNKSTA2_FLIT 0x0400
#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 0x32
#define PCI_EXP_SLTCAP2 0x34
#define PCI_EXP_SLTCAP2_IBPD 0x00000001
@@ -635,6 +636,7 @@
#define PCI_EXT_CAP_ID_DVSEC 0x23
#define PCI_EXT_CAP_ID_DLF 0x25
#define PCI_EXT_CAP_ID_PL_16GT 0x26
+#define PCI_EXT_CAP_ID_PL_32GT 0x2A
#define PCI_EXT_CAP_ID_DOE 0x2E
#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE
#define PCI_EXT_CAP_DSN_SIZEOF 12
diff --git a/libc/kernel/uapi/linux/perf_event.h b/libc/kernel/uapi/linux/perf_event.h
index 8f081ed..9223bd7 100644
--- a/libc/kernel/uapi/linux/perf_event.h
+++ b/libc/kernel/uapi/linux/perf_event.h
@@ -237,6 +237,7 @@
#define PERF_ATTR_SIZE_VER5 112
#define PERF_ATTR_SIZE_VER6 120
#define PERF_ATTR_SIZE_VER7 128
+#define PERF_ATTR_SIZE_VER8 136
struct perf_event_attr {
__u32 type;
__u32 size;
@@ -276,6 +277,7 @@
__u32 aux_sample_size;
__u32 __reserved_3;
__u64 sig_data;
+ __u64 config3;
};
struct perf_event_query_bpf {
__u32 ids_len;
diff --git a/libc/kernel/uapi/linux/pkt_cls.h b/libc/kernel/uapi/linux/pkt_cls.h
index 876cb73..0afec0d 100644
--- a/libc/kernel/uapi/linux/pkt_cls.h
+++ b/libc/kernel/uapi/linux/pkt_cls.h
@@ -463,6 +463,8 @@
TCA_FLOWER_KEY_PPPOE_SID,
TCA_FLOWER_KEY_PPP_PROTO,
TCA_FLOWER_KEY_L2TPV3_SID,
+ TCA_FLOWER_L2_MISS,
+ TCA_FLOWER_KEY_CFM,
__TCA_FLOWER_MAX,
};
#define TCA_FLOWER_MAX (__TCA_FLOWER_MAX - 1)
@@ -534,6 +536,13 @@
TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),
TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),
};
+enum {
+ TCA_FLOWER_KEY_CFM_OPT_UNSPEC,
+ TCA_FLOWER_KEY_CFM_MD_LEVEL,
+ TCA_FLOWER_KEY_CFM_OPCODE,
+ __TCA_FLOWER_KEY_CFM_OPT_MAX,
+};
+#define TCA_FLOWER_KEY_CFM_OPT_MAX (__TCA_FLOWER_KEY_CFM_OPT_MAX - 1)
#define TCA_FLOWER_MASK_FLAGS_RANGE (1 << 0)
struct tc_matchall_pcnt {
__u64 rhit;
diff --git a/libc/kernel/uapi/linux/pkt_sched.h b/libc/kernel/uapi/linux/pkt_sched.h
index c31b8bb..6a4b6e1 100644
--- a/libc/kernel/uapi/linux/pkt_sched.h
+++ b/libc/kernel/uapi/linux/pkt_sched.h
@@ -532,6 +532,10 @@
__TC_MQPRIO_SHAPER_MAX
};
#define __TC_MQPRIO_SHAPER_MAX (__TC_MQPRIO_SHAPER_MAX - 1)
+enum {
+ TC_FP_EXPRESS = 1,
+ TC_FP_PREEMPTIBLE = 2,
+};
struct tc_mqprio_qopt {
__u8 num_tc;
__u8 prio_tc_map[TC_QOPT_BITMASK + 1];
@@ -544,11 +548,19 @@
#define TC_MQPRIO_F_MIN_RATE 0x4
#define TC_MQPRIO_F_MAX_RATE 0x8
enum {
+ TCA_MQPRIO_TC_ENTRY_UNSPEC,
+ TCA_MQPRIO_TC_ENTRY_INDEX,
+ TCA_MQPRIO_TC_ENTRY_FP,
+ __TCA_MQPRIO_TC_ENTRY_CNT,
+ TCA_MQPRIO_TC_ENTRY_MAX = (__TCA_MQPRIO_TC_ENTRY_CNT - 1)
+};
+enum {
TCA_MQPRIO_UNSPEC,
TCA_MQPRIO_MODE,
TCA_MQPRIO_SHAPER,
TCA_MQPRIO_MIN_RATE64,
TCA_MQPRIO_MAX_RATE64,
+ TCA_MQPRIO_TC_ENTRY,
__TCA_MQPRIO_MAX,
};
#define TCA_MQPRIO_MAX (__TCA_MQPRIO_MAX - 1)
@@ -927,10 +939,18 @@
TCA_TAPRIO_TC_ENTRY_UNSPEC,
TCA_TAPRIO_TC_ENTRY_INDEX,
TCA_TAPRIO_TC_ENTRY_MAX_SDU,
+ TCA_TAPRIO_TC_ENTRY_FP,
__TCA_TAPRIO_TC_ENTRY_CNT,
TCA_TAPRIO_TC_ENTRY_MAX = (__TCA_TAPRIO_TC_ENTRY_CNT - 1)
};
enum {
+ TCA_TAPRIO_OFFLOAD_STATS_PAD = 1,
+ TCA_TAPRIO_OFFLOAD_STATS_WINDOW_DROPS,
+ TCA_TAPRIO_OFFLOAD_STATS_TX_OVERRUNS,
+ __TCA_TAPRIO_OFFLOAD_STATS_CNT,
+ TCA_TAPRIO_OFFLOAD_STATS_MAX = (__TCA_TAPRIO_OFFLOAD_STATS_CNT - 1)
+};
+enum {
TCA_TAPRIO_ATTR_UNSPEC,
TCA_TAPRIO_ATTR_PRIOMAP,
TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST,
diff --git a/libc/kernel/uapi/linux/pktcdvd.h b/libc/kernel/uapi/linux/pktcdvd.h
index eed22f8..c2414d1 100644
--- a/libc/kernel/uapi/linux/pktcdvd.h
+++ b/libc/kernel/uapi/linux/pktcdvd.h
@@ -23,7 +23,6 @@
#define MAX_WRITERS 8
#define PKT_RB_POOL_SIZE 512
#define PACKET_WAIT_TIME (HZ * 5 / 1000)
-#define USE_WCACHING 0
#define PACKET_CDR 1
#define PACKET_CDRW 2
#define PACKET_DVDR 3
diff --git a/libc/kernel/uapi/linux/prctl.h b/libc/kernel/uapi/linux/prctl.h
index 1dac726..0e86d95 100644
--- a/libc/kernel/uapi/linux/prctl.h
+++ b/libc/kernel/uapi/linux/prctl.h
@@ -184,6 +184,21 @@
#define PR_SME_GET_VL 64
#define PR_SME_VL_LEN_MASK 0xffff
#define PR_SME_VL_INHERIT (1 << 17)
+#define PR_SET_MDWE 65
+#define PR_MDWE_REFUSE_EXEC_GAIN 1
+#define PR_GET_MDWE 66
#define PR_SET_VMA 0x53564d41
#define PR_SET_VMA_ANON_NAME 0
+#define PR_GET_AUXV 0x41555856
+#define PR_SET_MEMORY_MERGE 67
+#define PR_GET_MEMORY_MERGE 68
+#define PR_RISCV_V_SET_CONTROL 69
+#define PR_RISCV_V_GET_CONTROL 70
+#define PR_RISCV_V_VSTATE_CTRL_DEFAULT 0
+#define PR_RISCV_V_VSTATE_CTRL_OFF 1
+#define PR_RISCV_V_VSTATE_CTRL_ON 2
+#define PR_RISCV_V_VSTATE_CTRL_INHERIT (1 << 4)
+#define PR_RISCV_V_VSTATE_CTRL_CUR_MASK 0x3
+#define PR_RISCV_V_VSTATE_CTRL_NEXT_MASK 0xc
+#define PR_RISCV_V_VSTATE_CTRL_MASK 0x1f
#endif
diff --git a/libc/kernel/uapi/linux/psp-sev.h b/libc/kernel/uapi/linux/psp-sev.h
index 8c9ec80..5aefc1c 100644
--- a/libc/kernel/uapi/linux/psp-sev.h
+++ b/libc/kernel/uapi/linux/psp-sev.h
@@ -32,6 +32,7 @@
SEV_MAX,
};
typedef enum {
+ SEV_RET_NO_FW_CALL = - 1,
SEV_RET_SUCCESS = 0,
SEV_RET_INVALID_PLATFORM_STATE,
SEV_RET_INVALID_GUEST_STATE,
diff --git a/libc/kernel/uapi/linux/ptp_clock.h b/libc/kernel/uapi/linux/ptp_clock.h
index ca6f3c3..fe26e6e 100644
--- a/libc/kernel/uapi/linux/ptp_clock.h
+++ b/libc/kernel/uapi/linux/ptp_clock.h
@@ -46,7 +46,8 @@
int n_pins;
int cross_timestamping;
int adjust_phase;
- int rsv[12];
+ int max_phase_adj;
+ int rsv[11];
};
struct ptp_extts_request {
unsigned int index;
diff --git a/libc/kernel/uapi/linux/ptrace.h b/libc/kernel/uapi/linux/ptrace.h
index 4bfa59a..56a350b 100644
--- a/libc/kernel/uapi/linux/ptrace.h
+++ b/libc/kernel/uapi/linux/ptrace.h
@@ -90,6 +90,14 @@
__u32 flags;
__u32 pad;
};
+#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG 0x4210
+#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG 0x4211
+struct ptrace_sud_config {
+ __u64 mode;
+ __u64 selector;
+ __u64 offset;
+ __u64 len;
+};
#define PTRACE_EVENTMSG_SYSCALL_ENTRY 1
#define PTRACE_EVENTMSG_SYSCALL_EXIT 2
#define PTRACE_PEEKSIGINFO_SHARED (1 << 0)
diff --git a/libc/kernel/uapi/linux/rpl.h b/libc/kernel/uapi/linux/rpl.h
index 3648bfc..4226297 100644
--- a/libc/kernel/uapi/linux/rpl.h
+++ b/libc/kernel/uapi/linux/rpl.h
@@ -34,8 +34,8 @@
#error "Please fix <asm/byteorder.h>"
#endif
union {
- struct in6_addr addr[0];
- __u8 data[0];
+ __DECLARE_FLEX_ARRAY(struct in6_addr, addr);
+ __DECLARE_FLEX_ARRAY(__u8, data);
} segments;
} __attribute__((packed));
#define rpl_segaddr segments.addr
diff --git a/libc/kernel/uapi/linux/rseq.h b/libc/kernel/uapi/linux/rseq.h
index 29a9457..f837720 100644
--- a/libc/kernel/uapi/linux/rseq.h
+++ b/libc/kernel/uapi/linux/rseq.h
@@ -49,5 +49,8 @@
__u32 cpu_id;
__u64 rseq_cs;
__u32 flags;
+ __u32 node_id;
+ __u32 mm_cid;
+ char end[];
} __attribute__((aligned(4 * sizeof(__u64))));
#endif
diff --git a/libc/kernel/uapi/linux/rtnetlink.h b/libc/kernel/uapi/linux/rtnetlink.h
index 7201827..335a19a 100644
--- a/libc/kernel/uapi/linux/rtnetlink.h
+++ b/libc/kernel/uapi/linux/rtnetlink.h
@@ -463,6 +463,7 @@
TCA_INGRESS_BLOCK,
TCA_EGRESS_BLOCK,
TCA_DUMP_FLAGS,
+ TCA_EXT_WARN_MSG,
__TCA_MAX
};
#define TCA_MAX (__TCA_MAX - 1)
@@ -589,6 +590,7 @@
TCA_ROOT_FLAGS,
TCA_ROOT_COUNT,
TCA_ROOT_TIME_DELTA,
+ TCA_ROOT_EXT_WARN_MSG,
__TCA_ROOT_MAX,
#define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
};
diff --git a/libc/kernel/uapi/linux/sctp.h b/libc/kernel/uapi/linux/sctp.h
index 4bf2412..b1a571c 100644
--- a/libc/kernel/uapi/linux/sctp.h
+++ b/libc/kernel/uapi/linux/sctp.h
@@ -709,7 +709,9 @@
SCTP_SS_DEFAULT = SCTP_SS_FCFS,
SCTP_SS_PRIO,
SCTP_SS_RR,
- SCTP_SS_MAX = SCTP_SS_RR
+ SCTP_SS_FC,
+ SCTP_SS_WFQ,
+ SCTP_SS_MAX = SCTP_SS_WFQ
};
struct sctp_probeinterval {
sctp_assoc_t spi_assoc_id;
diff --git a/libc/kernel/uapi/linux/sed-opal.h b/libc/kernel/uapi/linux/sed-opal.h
index 4c66231..fa1d7ed 100644
--- a/libc/kernel/uapi/linux/sed-opal.h
+++ b/libc/kernel/uapi/linux/sed-opal.h
@@ -74,6 +74,15 @@
__u32 WLE;
struct opal_session_info session;
};
+struct opal_lr_status {
+ struct opal_session_info session;
+ __u64 range_start;
+ __u64 range_length;
+ __u32 RLE;
+ __u32 WLE;
+ __u32 l_state;
+ __u8 align[4];
+};
struct opal_lock_unlock {
struct opal_session_info session;
__u32 l_state;
@@ -122,10 +131,18 @@
#define OPAL_FL_LOCKED 0x00000008
#define OPAL_FL_MBR_ENABLED 0x00000010
#define OPAL_FL_MBR_DONE 0x00000020
+#define OPAL_FL_SUM_SUPPORTED 0x00000040
struct opal_status {
__u32 flags;
__u32 reserved;
};
+struct opal_geometry {
+ __u8 align;
+ __u32 logical_block_size;
+ __u64 alignment_granularity;
+ __u64 lowest_aligned_lba;
+ __u8 __align[3];
+};
#define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)
#define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)
#define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)
@@ -143,4 +160,6 @@
#define IOC_OPAL_WRITE_SHADOW_MBR _IOW('p', 234, struct opal_shadow_mbr)
#define IOC_OPAL_GENERIC_TABLE_RW _IOW('p', 235, struct opal_read_write_table)
#define IOC_OPAL_GET_STATUS _IOR('p', 236, struct opal_status)
+#define IOC_OPAL_GET_LR_STATUS _IOW('p', 237, struct opal_lr_status)
+#define IOC_OPAL_GET_GEOMETRY _IOR('p', 238, struct opal_geometry)
#endif
diff --git a/libc/kernel/uapi/linux/serial_core.h b/libc/kernel/uapi/linux/serial_core.h
index 1e04429..ecd395c 100644
--- a/libc/kernel/uapi/linux/serial_core.h
+++ b/libc/kernel/uapi/linux/serial_core.h
@@ -99,6 +99,7 @@
#define PORT_VT8500 97
#define PORT_XUARTPS 98
#define PORT_AR933X 99
+#define PORT_MCHP16550A 100
#define PORT_ARC 101
#define PORT_RP2 102
#define PORT_LPUART 103
diff --git a/libc/kernel/uapi/linux/serial_reg.h b/libc/kernel/uapi/linux/serial_reg.h
index e41e649..36d778d 100644
--- a/libc/kernel/uapi/linux/serial_reg.h
+++ b/libc/kernel/uapi/linux/serial_reg.h
@@ -37,6 +37,11 @@
#define UART_IIR_RX_TIMEOUT 0x0c
#define UART_IIR_XOFF 0x10
#define UART_IIR_CTS_RTS_DSR 0x20
+#define UART_IIR_64BYTE_FIFO 0x20
+#define UART_IIR_FIFO_ENABLED 0xc0
+#define UART_IIR_FIFO_ENABLED_8250 0x00
+#define UART_IIR_FIFO_ENABLED_16550 0x80
+#define UART_IIR_FIFO_ENABLED_16550A 0xc0
#define UART_FCR 2
#define UART_FCR_ENABLE_FIFO 0x01
#define UART_FCR_CLEAR_RCVR 0x02
diff --git a/libc/kernel/uapi/linux/sev-guest.h b/libc/kernel/uapi/linux/sev-guest.h
index 796479a..3e8c0bf 100644
--- a/libc/kernel/uapi/linux/sev-guest.h
+++ b/libc/kernel/uapi/linux/sev-guest.h
@@ -42,7 +42,13 @@
__u8 msg_version;
__u64 req_data;
__u64 resp_data;
- __u64 fw_err;
+ union {
+ __u64 exitinfo2;
+ struct {
+ __u32 fw_error;
+ __u32 vmm_error;
+ };
+ };
};
struct snp_ext_report_req {
struct snp_report_req data;
@@ -53,4 +59,9 @@
#define SNP_GET_REPORT _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x0, struct snp_guest_request_ioctl)
#define SNP_GET_DERIVED_KEY _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x1, struct snp_guest_request_ioctl)
#define SNP_GET_EXT_REPORT _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x2, struct snp_guest_request_ioctl)
+#define SNP_GUEST_FW_ERR_MASK GENMASK_ULL(31, 0)
+#define SNP_GUEST_VMM_ERR_SHIFT 32
+#define SNP_GUEST_VMM_ERR(x) (((u64) x) << SNP_GUEST_VMM_ERR_SHIFT)
+#define SNP_GUEST_VMM_ERR_INVALID_LEN 1
+#define SNP_GUEST_VMM_ERR_BUSY 2
#endif
diff --git a/libc/kernel/uapi/linux/snmp.h b/libc/kernel/uapi/linux/snmp.h
index e3d6ee3..ea3f058 100644
--- a/libc/kernel/uapi/linux/snmp.h
+++ b/libc/kernel/uapi/linux/snmp.h
@@ -87,6 +87,8 @@
ICMP_MIB_OUTADDRMASKS,
ICMP_MIB_OUTADDRMASKREPS,
ICMP_MIB_CSUMERRORS,
+ ICMP_MIB_RATELIMITGLOBAL,
+ ICMP_MIB_RATELIMITHOST,
__ICMP_MIB_MAX
};
#define __ICMPMSG_MIB_MAX 512
@@ -97,6 +99,7 @@
ICMP6_MIB_OUTMSGS,
ICMP6_MIB_OUTERRORS,
ICMP6_MIB_CSUMERRORS,
+ ICMP6_MIB_RATELIMITHOST,
__ICMP6_MIB_MAX
};
#define __ICMP6MSG_MIB_MAX 512
diff --git a/libc/kernel/uapi/linux/spi/spi.h b/libc/kernel/uapi/linux/spi/spi.h
index 693e752..a5af3f4 100644
--- a/libc/kernel/uapi/linux/spi/spi.h
+++ b/libc/kernel/uapi/linux/spi/spi.h
@@ -41,5 +41,6 @@
#define SPI_RX_OCTAL _BITUL(14)
#define SPI_3WIRE_HIZ _BITUL(15)
#define SPI_RX_CPHA_FLIP _BITUL(16)
-#define SPI_MODE_USER_MASK (_BITUL(17) - 1)
+#define SPI_MOSI_IDLE_LOW _BITUL(17)
+#define SPI_MODE_USER_MASK (_BITUL(18) - 1)
#endif
diff --git a/libc/kernel/uapi/linux/target_core_user.h b/libc/kernel/uapi/linux/target_core_user.h
index 83e155e..84af2d2 100644
--- a/libc/kernel/uapi/linux/target_core_user.h
+++ b/libc/kernel/uapi/linux/target_core_user.h
@@ -61,7 +61,7 @@
__u64 cdb_off;
__u64 __pad1;
__u64 __pad2;
- struct iovec iov[0];
+ __DECLARE_FLEX_ARRAY(struct iovec, iov);
} req;
struct {
__u8 scsi_status;
diff --git a/libc/kernel/uapi/linux/taskstats.h b/libc/kernel/uapi/linux/taskstats.h
index c1cda52..4f1637e 100644
--- a/libc/kernel/uapi/linux/taskstats.h
+++ b/libc/kernel/uapi/linux/taskstats.h
@@ -19,7 +19,7 @@
#ifndef _LINUX_TASKSTATS_H
#define _LINUX_TASKSTATS_H
#include <linux/types.h>
-#define TASKSTATS_VERSION 13
+#define TASKSTATS_VERSION 14
#define TS_COMM_LEN 32
struct taskstats {
__u16 version;
@@ -77,6 +77,8 @@
__u64 ac_exe_inode;
__u64 wpcopy_count;
__u64 wpcopy_delay_total;
+ __u64 irq_count;
+ __u64 irq_delay_total;
};
enum {
TASKSTATS_CMD_UNSPEC = 0,
diff --git a/libc/kernel/uapi/linux/tc_act/tc_tunnel_key.h b/libc/kernel/uapi/linux/tc_act/tc_tunnel_key.h
index e137ae8..7eb61e8 100644
--- a/libc/kernel/uapi/linux/tc_act/tc_tunnel_key.h
+++ b/libc/kernel/uapi/linux/tc_act/tc_tunnel_key.h
@@ -40,6 +40,7 @@
TCA_TUNNEL_KEY_ENC_OPTS,
TCA_TUNNEL_KEY_ENC_TOS,
TCA_TUNNEL_KEY_ENC_TTL,
+ TCA_TUNNEL_KEY_NO_FRAG,
__TCA_TUNNEL_KEY_MAX,
};
#define TCA_TUNNEL_KEY_MAX (__TCA_TUNNEL_KEY_MAX - 1)
diff --git a/libc/kernel/uapi/linux/tps6594_pfsm.h b/libc/kernel/uapi/linux/tps6594_pfsm.h
new file mode 100644
index 0000000..ca3222b
--- /dev/null
+++ b/libc/kernel/uapi/linux/tps6594_pfsm.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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 __TPS6594_PFSM_H
+#define __TPS6594_PFSM_H
+#include <linux/const.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+struct pmic_state_opt {
+ __u8 gpio_retention;
+ __u8 ddr_retention;
+ __u8 mcu_only_startup_dest;
+};
+#define PMIC_BASE 'P'
+#define PMIC_GOTO_STANDBY _IO(PMIC_BASE, 0)
+#define PMIC_GOTO_LP_STANDBY _IO(PMIC_BASE, 1)
+#define PMIC_UPDATE_PGM _IO(PMIC_BASE, 2)
+#define PMIC_SET_ACTIVE_STATE _IO(PMIC_BASE, 3)
+#define PMIC_SET_MCU_ONLY_STATE _IOW(PMIC_BASE, 4, struct pmic_state_opt)
+#define PMIC_SET_RETENTION_STATE _IOW(PMIC_BASE, 5, struct pmic_state_opt)
+#endif
diff --git a/libc/kernel/uapi/linux/types.h b/libc/kernel/uapi/linux/types.h
index f41d676..cbc079d 100644
--- a/libc/kernel/uapi/linux/types.h
+++ b/libc/kernel/uapi/linux/types.h
@@ -21,6 +21,10 @@
#include <asm/types.h>
#ifndef __ASSEMBLY__
#include <linux/posix_types.h>
+#ifdef __SIZEOF_INT128__
+typedef __signed__ __int128 __s128 __attribute__((aligned(16)));
+typedef unsigned __int128 __u128 __attribute__((aligned(16)));
+#endif
#define __bitwise
#define __bitwise__ __bitwise
typedef __u16 __bitwise __le16;
diff --git a/libc/kernel/uapi/linux/ublk_cmd.h b/libc/kernel/uapi/linux/ublk_cmd.h
index 8c9cbeb..975015f 100644
--- a/libc/kernel/uapi/linux/ublk_cmd.h
+++ b/libc/kernel/uapi/linux/ublk_cmd.h
@@ -29,20 +29,52 @@
#define UBLK_CMD_GET_PARAMS 0x09
#define UBLK_CMD_START_USER_RECOVERY 0x10
#define UBLK_CMD_END_USER_RECOVERY 0x11
+#define UBLK_CMD_GET_DEV_INFO2 0x12
+#define UBLK_U_CMD_GET_QUEUE_AFFINITY _IOR('u', UBLK_CMD_GET_QUEUE_AFFINITY, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_GET_DEV_INFO _IOR('u', UBLK_CMD_GET_DEV_INFO, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_ADD_DEV _IOWR('u', UBLK_CMD_ADD_DEV, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_DEL_DEV _IOWR('u', UBLK_CMD_DEL_DEV, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_START_DEV _IOWR('u', UBLK_CMD_START_DEV, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_STOP_DEV _IOWR('u', UBLK_CMD_STOP_DEV, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_SET_PARAMS _IOWR('u', UBLK_CMD_SET_PARAMS, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_GET_PARAMS _IOR('u', UBLK_CMD_GET_PARAMS, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_START_USER_RECOVERY _IOWR('u', UBLK_CMD_START_USER_RECOVERY, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_END_USER_RECOVERY _IOWR('u', UBLK_CMD_END_USER_RECOVERY, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_GET_DEV_INFO2 _IOR('u', UBLK_CMD_GET_DEV_INFO2, struct ublksrv_ctrl_cmd)
+#define UBLK_U_CMD_GET_FEATURES _IOR('u', 0x13, struct ublksrv_ctrl_cmd)
+#define UBLK_FEATURES_LEN 8
#define UBLK_IO_FETCH_REQ 0x20
#define UBLK_IO_COMMIT_AND_FETCH_REQ 0x21
#define UBLK_IO_NEED_GET_DATA 0x22
+#define UBLK_U_IO_FETCH_REQ _IOWR('u', UBLK_IO_FETCH_REQ, struct ublksrv_io_cmd)
+#define UBLK_U_IO_COMMIT_AND_FETCH_REQ _IOWR('u', UBLK_IO_COMMIT_AND_FETCH_REQ, struct ublksrv_io_cmd)
+#define UBLK_U_IO_NEED_GET_DATA _IOWR('u', UBLK_IO_NEED_GET_DATA, struct ublksrv_io_cmd)
#define UBLK_IO_RES_OK 0
#define UBLK_IO_RES_NEED_GET_DATA 1
#define UBLK_IO_RES_ABORT (- ENODEV)
#define UBLKSRV_CMD_BUF_OFFSET 0
#define UBLKSRV_IO_BUF_OFFSET 0x80000000
#define UBLK_MAX_QUEUE_DEPTH 4096
+#define UBLK_IO_BUF_OFF 0
+#define UBLK_IO_BUF_BITS 25
+#define UBLK_IO_BUF_BITS_MASK ((1ULL << UBLK_IO_BUF_BITS) - 1)
+#define UBLK_TAG_OFF UBLK_IO_BUF_BITS
+#define UBLK_TAG_BITS 16
+#define UBLK_TAG_BITS_MASK ((1ULL << UBLK_TAG_BITS) - 1)
+#define UBLK_QID_OFF (UBLK_TAG_OFF + UBLK_TAG_BITS)
+#define UBLK_QID_BITS 12
+#define UBLK_QID_BITS_MASK ((1ULL << UBLK_QID_BITS) - 1)
+#define UBLK_MAX_NR_QUEUES (1U << UBLK_QID_BITS)
+#define UBLKSRV_IO_BUF_TOTAL_BITS (UBLK_QID_OFF + UBLK_QID_BITS)
+#define UBLKSRV_IO_BUF_TOTAL_SIZE (1ULL << UBLKSRV_IO_BUF_TOTAL_BITS)
#define UBLK_F_SUPPORT_ZERO_COPY (1ULL << 0)
#define UBLK_F_URING_CMD_COMP_IN_TASK (1ULL << 1)
#define UBLK_F_NEED_GET_DATA (1UL << 2)
#define UBLK_F_USER_RECOVERY (1UL << 3)
#define UBLK_F_USER_RECOVERY_REISSUE (1UL << 4)
+#define UBLK_F_UNPRIVILEGED_DEV (1UL << 5)
+#define UBLK_F_CMD_IOCTL_ENCODE (1UL << 6)
+#define UBLK_F_USER_COPY (1UL << 7)
#define UBLK_S_DEV_DEAD 0
#define UBLK_S_DEV_LIVE 1
#define UBLK_S_DEV_QUIESCED 2
@@ -51,7 +83,10 @@
__u16 queue_id;
__u16 len;
__u64 addr;
- __u64 data[2];
+ __u64 data[1];
+ __u16 dev_path_len;
+ __u16 pad;
+ __u32 reserved;
};
struct ublksrv_ctrl_dev_info {
__u16 nr_hw_queues;
@@ -64,7 +99,8 @@
__u32 pad1;
__u64 flags;
__u64 ublksrv_flags;
- __u64 reserved0;
+ __u32 owner_uid;
+ __u32 owner_gid;
__u64 reserved1;
__u64 reserved2;
};
@@ -116,12 +152,20 @@
__u16 max_discard_segments;
__u16 reserved0;
};
+struct ublk_param_devt {
+ __u32 char_major;
+ __u32 char_minor;
+ __u32 disk_major;
+ __u32 disk_minor;
+};
struct ublk_params {
__u32 len;
#define UBLK_PARAM_TYPE_BASIC (1 << 0)
#define UBLK_PARAM_TYPE_DISCARD (1 << 1)
+#define UBLK_PARAM_TYPE_DEVT (1 << 2)
__u32 types;
struct ublk_param_basic basic;
struct ublk_param_discard discard;
+ struct ublk_param_devt devt;
};
#endif
diff --git a/libc/kernel/uapi/linux/usb/ch9.h b/libc/kernel/uapi/linux/usb/ch9.h
index 49eb5fa..dd66991 100644
--- a/libc/kernel/uapi/linux/usb/ch9.h
+++ b/libc/kernel/uapi/linux/usb/ch9.h
@@ -203,7 +203,10 @@
struct usb_string_descriptor {
__u8 bLength;
__u8 bDescriptorType;
- __le16 wData[1];
+ union {
+ __le16 legacy_padding;
+ __DECLARE_FLEX_ARRAY(__le16, wData);
+ };
} __attribute__((packed));
struct usb_interface_descriptor {
__u8 bLength;
@@ -417,6 +420,16 @@
__u8 ContainerID[16];
} __attribute__((packed));
#define USB_DT_USB_SS_CONTN_ID_SIZE 20
+#define USB_PLAT_DEV_CAP_TYPE 5
+struct usb_plat_dev_cap_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDevCapabilityType;
+ __u8 bReserved;
+ __u8 UUID[16];
+ __u8 CapabilityData[];
+} __attribute__((packed));
+#define USB_DT_USB_PLAT_DEV_CAP_SIZE(capability_data_size) (20 + capability_data_size)
#define USB_SSP_CAP_TYPE 0xa
struct usb_ssp_cap_descriptor {
__u8 bLength;
@@ -431,7 +444,10 @@
#define USB_SSP_MIN_RX_LANE_COUNT (0xf << 8)
#define USB_SSP_MIN_TX_LANE_COUNT (0xf << 12)
__le16 wReserved;
- __le32 bmSublinkSpeedAttr[1];
+ union {
+ __le32 legacy_padding;
+ __DECLARE_FLEX_ARRAY(__le32, bmSublinkSpeedAttr);
+ };
#define USB_SSP_SUBLINK_SPEED_SSID (0xf)
#define USB_SSP_SUBLINK_SPEED_LSE (0x3 << 4)
#define USB_SSP_SUBLINK_SPEED_LSE_BPS 0
diff --git a/libc/kernel/uapi/linux/usb/video.h b/libc/kernel/uapi/linux/usb/video.h
index c3d360a..0ceabe7 100644
--- a/libc/kernel/uapi/linux/usb/video.h
+++ b/libc/kernel/uapi/linux/usb/video.h
@@ -139,6 +139,32 @@
#define UVC_CONTROL_CAP_DISABLED (1 << 2)
#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
+enum uvc_color_primaries_values {
+ UVC_COLOR_PRIMARIES_UNSPECIFIED,
+ UVC_COLOR_PRIMARIES_BT_709_SRGB,
+ UVC_COLOR_PRIMARIES_BT_470_2_M,
+ UVC_COLOR_PRIMARIES_BT_470_2_B_G,
+ UVC_COLOR_PRIMARIES_SMPTE_170M,
+ UVC_COLOR_PRIMARIES_SMPTE_240M,
+};
+enum uvc_transfer_characteristics_values {
+ UVC_TRANSFER_CHARACTERISTICS_UNSPECIFIED,
+ UVC_TRANSFER_CHARACTERISTICS_BT_709,
+ UVC_TRANSFER_CHARACTERISTICS_BT_470_2_M,
+ UVC_TRANSFER_CHARACTERISTICS_BT_470_2_B_G,
+ UVC_TRANSFER_CHARACTERISTICS_SMPTE_170M,
+ UVC_TRANSFER_CHARACTERISTICS_SMPTE_240M,
+ UVC_TRANSFER_CHARACTERISTICS_LINEAR,
+ UVC_TRANSFER_CHARACTERISTICS_SRGB,
+};
+enum uvc_matrix_coefficients {
+ UVC_MATRIX_COEFFICIENTS_UNSPECIFIED,
+ UVC_MATRIX_COEFFICIENTS_BT_709,
+ UVC_MATRIX_COEFFICIENTS_FCC,
+ UVC_MATRIX_COEFFICIENTS_BT_470_2_B_G,
+ UVC_MATRIX_COEFFICIENTS_SMPTE_170M,
+ UVC_MATRIX_COEFFICIENTS_SMPTE_240M,
+};
struct uvc_descriptor_header {
__u8 bLength;
__u8 bDescriptorType;
diff --git a/libc/kernel/uapi/linux/user_events.h b/libc/kernel/uapi/linux/user_events.h
new file mode 100644
index 0000000..f26519e
--- /dev/null
+++ b/libc/kernel/uapi/linux/user_events.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** 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_USER_EVENTS_H
+#define _UAPI_LINUX_USER_EVENTS_H
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#define USER_EVENTS_SYSTEM "user_events"
+#define USER_EVENTS_PREFIX "u:"
+#define DYN_LOC(offset,size) ((size) << 16 | (offset))
+struct user_reg {
+ __u32 size;
+ __u8 enable_bit;
+ __u8 enable_size;
+ __u16 flags;
+ __u64 enable_addr;
+ __u64 name_args;
+ __u32 write_index;
+} __attribute__((__packed__));
+struct user_unreg {
+ __u32 size;
+ __u8 disable_bit;
+ __u8 __reserved;
+ __u16 __reserved2;
+ __u64 disable_addr;
+} __attribute__((__packed__));
+#define DIAG_IOC_MAGIC '*'
+#define DIAG_IOCSREG _IOWR(DIAG_IOC_MAGIC, 0, struct user_reg *)
+#define DIAG_IOCSDEL _IOW(DIAG_IOC_MAGIC, 1, char *)
+#define DIAG_IOCSUNREG _IOW(DIAG_IOC_MAGIC, 2, struct user_unreg *)
+#endif
diff --git a/libc/kernel/uapi/linux/userfaultfd.h b/libc/kernel/uapi/linux/userfaultfd.h
index 09e0d80..816198f 100644
--- a/libc/kernel/uapi/linux/userfaultfd.h
+++ b/libc/kernel/uapi/linux/userfaultfd.h
@@ -23,7 +23,7 @@
#define USERFAULTFD_IOC_NEW _IO(USERFAULTFD_IOC, 0x00)
#define UFFD_API ((__u64) 0xAA)
#define UFFD_API_REGISTER_MODES (UFFDIO_REGISTER_MODE_MISSING | UFFDIO_REGISTER_MODE_WP | UFFDIO_REGISTER_MODE_MINOR)
-#define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP | UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_EVENT_REMAP | UFFD_FEATURE_EVENT_REMOVE | UFFD_FEATURE_EVENT_UNMAP | UFFD_FEATURE_MISSING_HUGETLBFS | UFFD_FEATURE_MISSING_SHMEM | UFFD_FEATURE_SIGBUS | UFFD_FEATURE_THREAD_ID | UFFD_FEATURE_MINOR_HUGETLBFS | UFFD_FEATURE_MINOR_SHMEM | UFFD_FEATURE_EXACT_ADDRESS | UFFD_FEATURE_WP_HUGETLBFS_SHMEM)
+#define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP | UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_EVENT_REMAP | UFFD_FEATURE_EVENT_REMOVE | UFFD_FEATURE_EVENT_UNMAP | UFFD_FEATURE_MISSING_HUGETLBFS | UFFD_FEATURE_MISSING_SHMEM | UFFD_FEATURE_SIGBUS | UFFD_FEATURE_THREAD_ID | UFFD_FEATURE_MINOR_HUGETLBFS | UFFD_FEATURE_MINOR_SHMEM | UFFD_FEATURE_EXACT_ADDRESS | UFFD_FEATURE_WP_HUGETLBFS_SHMEM | UFFD_FEATURE_WP_UNPOPULATED)
#define UFFD_API_IOCTLS ((__u64) 1 << _UFFDIO_REGISTER | (__u64) 1 << _UFFDIO_UNREGISTER | (__u64) 1 << _UFFDIO_API)
#define UFFD_API_RANGE_IOCTLS ((__u64) 1 << _UFFDIO_WAKE | (__u64) 1 << _UFFDIO_COPY | (__u64) 1 << _UFFDIO_ZEROPAGE | (__u64) 1 << _UFFDIO_WRITEPROTECT | (__u64) 1 << _UFFDIO_CONTINUE)
#define UFFD_API_RANGE_IOCTLS_BASIC ((__u64) 1 << _UFFDIO_WAKE | (__u64) 1 << _UFFDIO_COPY | (__u64) 1 << _UFFDIO_CONTINUE | (__u64) 1 << _UFFDIO_WRITEPROTECT)
@@ -99,6 +99,7 @@
#define UFFD_FEATURE_MINOR_SHMEM (1 << 10)
#define UFFD_FEATURE_EXACT_ADDRESS (1 << 11)
#define UFFD_FEATURE_WP_HUGETLBFS_SHMEM (1 << 12)
+#define UFFD_FEATURE_WP_UNPOPULATED (1 << 13)
__u64 features;
__u64 ioctls;
};
@@ -138,6 +139,7 @@
struct uffdio_continue {
struct uffdio_range range;
#define UFFDIO_CONTINUE_MODE_DONTWAKE ((__u64) 1 << 0)
+#define UFFDIO_CONTINUE_MODE_WP ((__u64) 1 << 1)
__u64 mode;
__s64 mapped;
};
diff --git a/libc/kernel/uapi/linux/uuid.h b/libc/kernel/uapi/linux/uuid.h
index d0f82c1..73529c9 100644
--- a/libc/kernel/uapi/linux/uuid.h
+++ b/libc/kernel/uapi/linux/uuid.h
@@ -16,16 +16,4 @@
***
****************************************************************************
****************************************************************************/
-#ifndef _UAPI_LINUX_UUID_H_
-#define _UAPI_LINUX_UUID_H_
-#include <linux/types.h>
-typedef struct {
- __u8 b[16];
-} guid_t;
-#define GUID_INIT(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
-((guid_t) \
-{ { (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, (b) & 0xff, ((b) >> 8) & 0xff, (c) & 0xff, ((c) >> 8) & 0xff, (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } })
-typedef guid_t uuid_le;
-#define UUID_LE(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)
-#define NULL_UUID_LE UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
-#endif
+#include <linux/mei_uuid.h>
diff --git a/libc/kernel/uapi/linux/uvcvideo.h b/libc/kernel/uapi/linux/uvcvideo.h
index f15ed78..b63858f 100644
--- a/libc/kernel/uapi/linux/uvcvideo.h
+++ b/libc/kernel/uapi/linux/uvcvideo.h
@@ -36,9 +36,10 @@
#define UVC_CTRL_FLAG_AUTO_UPDATE (1 << 7)
#define UVC_CTRL_FLAG_ASYNCHRONOUS (1 << 8)
#define UVC_CTRL_FLAG_GET_RANGE (UVC_CTRL_FLAG_GET_CUR | UVC_CTRL_FLAG_GET_MIN | UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | UVC_CTRL_FLAG_GET_DEF)
+#define UVC_MENU_NAME_LEN 32
struct uvc_menu_info {
__u32 value;
- __u8 name[32];
+ __u8 name[UVC_MENU_NAME_LEN];
};
struct uvc_xu_control_mapping {
__u32 id;
diff --git a/libc/kernel/uapi/linux/v4l2-controls.h b/libc/kernel/uapi/linux/v4l2-controls.h
index a6e70c0..d77be94 100644
--- a/libc/kernel/uapi/linux/v4l2-controls.h
+++ b/libc/kernel/uapi/linux/v4l2-controls.h
@@ -691,6 +691,39 @@
#define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MAX_QP (V4L2_CID_CODEC_BASE + 652)
#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (V4L2_CID_CODEC_BASE + 653)
#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (V4L2_CID_CODEC_BASE + 654)
+#define V4L2_CID_MPEG_VIDEO_AV1_PROFILE (V4L2_CID_CODEC_BASE + 655)
+enum v4l2_mpeg_video_av1_profile {
+ V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN = 0,
+ V4L2_MPEG_VIDEO_AV1_PROFILE_HIGH = 1,
+ V4L2_MPEG_VIDEO_AV1_PROFILE_PROFESSIONAL = 2,
+};
+#define V4L2_CID_MPEG_VIDEO_AV1_LEVEL (V4L2_CID_CODEC_BASE + 656)
+enum v4l2_mpeg_video_av1_level {
+ V4L2_MPEG_VIDEO_AV1_LEVEL_2_0 = 0,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_2_1 = 1,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_2_2 = 2,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_2_3 = 3,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_3_0 = 4,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_3_1 = 5,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_3_2 = 6,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_3_3 = 7,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_4_0 = 8,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_4_1 = 9,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_4_2 = 10,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_4_3 = 11,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_5_0 = 12,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_5_1 = 13,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_5_2 = 14,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_5_3 = 15,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_6_0 = 16,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_6_1 = 17,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_6_2 = 18,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_6_3 = 19,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_7_0 = 20,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_7_1 = 21,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_7_2 = 22,
+ V4L2_MPEG_VIDEO_AV1_LEVEL_7_3 = 23
+};
#define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000)
#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE + 0)
enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
@@ -1520,7 +1553,8 @@
__u8 poc_st_curr_before[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
__u8 poc_st_curr_after[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
__u8 poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
- __u8 reserved[4];
+ __u8 num_delta_pocs_of_ref_rps_idx;
+ __u8 reserved[3];
struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
__u64 flags;
};
@@ -1684,6 +1718,271 @@
__u8 partition[16][3];
struct v4l2_vp9_mv_probs mv;
};
+#define V4L2_AV1_TOTAL_REFS_PER_FRAME 8
+#define V4L2_AV1_CDEF_MAX 8
+#define V4L2_AV1_NUM_PLANES_MAX 3
+#define V4L2_AV1_MAX_SEGMENTS 8
+#define V4L2_AV1_MAX_OPERATING_POINTS (1 << 5)
+#define V4L2_AV1_REFS_PER_FRAME 7
+#define V4L2_AV1_MAX_NUM_Y_POINTS (1 << 4)
+#define V4L2_AV1_MAX_NUM_CB_POINTS (1 << 4)
+#define V4L2_AV1_MAX_NUM_CR_POINTS (1 << 4)
+#define V4L2_AV1_AR_COEFFS_SIZE 25
+#define V4L2_AV1_MAX_NUM_PLANES 3
+#define V4L2_AV1_MAX_TILE_COLS 64
+#define V4L2_AV1_MAX_TILE_ROWS 64
+#define V4L2_AV1_MAX_TILE_COUNT 512
+#define V4L2_AV1_SEQUENCE_FLAG_STILL_PICTURE 0x00000001
+#define V4L2_AV1_SEQUENCE_FLAG_USE_128X128_SUPERBLOCK 0x00000002
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_FILTER_INTRA 0x00000004
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTRA_EDGE_FILTER 0x00000008
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTERINTRA_COMPOUND 0x00000010
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_MASKED_COMPOUND 0x00000020
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_WARPED_MOTION 0x00000040
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_DUAL_FILTER 0x00000080
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_ORDER_HINT 0x00000100
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_JNT_COMP 0x00000200
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_REF_FRAME_MVS 0x00000400
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_SUPERRES 0x00000800
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF 0x00001000
+#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_RESTORATION 0x00002000
+#define V4L2_AV1_SEQUENCE_FLAG_MONO_CHROME 0x00004000
+#define V4L2_AV1_SEQUENCE_FLAG_COLOR_RANGE 0x00008000
+#define V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_X 0x00010000
+#define V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_Y 0x00020000
+#define V4L2_AV1_SEQUENCE_FLAG_FILM_GRAIN_PARAMS_PRESENT 0x00040000
+#define V4L2_AV1_SEQUENCE_FLAG_SEPARATE_UV_DELTA_Q 0x00080000
+#define V4L2_CID_STATELESS_AV1_SEQUENCE (V4L2_CID_CODEC_STATELESS_BASE + 500)
+struct v4l2_ctrl_av1_sequence {
+ __u32 flags;
+ __u8 seq_profile;
+ __u8 order_hint_bits;
+ __u8 bit_depth;
+ __u8 reserved;
+ __u16 max_frame_width_minus_1;
+ __u16 max_frame_height_minus_1;
+};
+#define V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY (V4L2_CID_CODEC_STATELESS_BASE + 501)
+struct v4l2_ctrl_av1_tile_group_entry {
+ __u32 tile_offset;
+ __u32 tile_size;
+ __u32 tile_row;
+ __u32 tile_col;
+};
+enum v4l2_av1_warp_model {
+ V4L2_AV1_WARP_MODEL_IDENTITY = 0,
+ V4L2_AV1_WARP_MODEL_TRANSLATION = 1,
+ V4L2_AV1_WARP_MODEL_ROTZOOM = 2,
+ V4L2_AV1_WARP_MODEL_AFFINE = 3,
+};
+enum v4l2_av1_reference_frame {
+ V4L2_AV1_REF_INTRA_FRAME = 0,
+ V4L2_AV1_REF_LAST_FRAME = 1,
+ V4L2_AV1_REF_LAST2_FRAME = 2,
+ V4L2_AV1_REF_LAST3_FRAME = 3,
+ V4L2_AV1_REF_GOLDEN_FRAME = 4,
+ V4L2_AV1_REF_BWDREF_FRAME = 5,
+ V4L2_AV1_REF_ALTREF2_FRAME = 6,
+ V4L2_AV1_REF_ALTREF_FRAME = 7,
+};
+#define V4L2_AV1_GLOBAL_MOTION_IS_INVALID(ref) (1 << (ref))
+#define V4L2_AV1_GLOBAL_MOTION_FLAG_IS_GLOBAL 0x1
+#define V4L2_AV1_GLOBAL_MOTION_FLAG_IS_ROT_ZOOM 0x2
+#define V4L2_AV1_GLOBAL_MOTION_FLAG_IS_TRANSLATION 0x4
+struct v4l2_av1_global_motion {
+ __u8 flags[V4L2_AV1_TOTAL_REFS_PER_FRAME];
+ enum v4l2_av1_warp_model type[V4L2_AV1_TOTAL_REFS_PER_FRAME];
+ __s32 params[V4L2_AV1_TOTAL_REFS_PER_FRAME][6];
+ __u8 invalid;
+ __u8 reserved[3];
+};
+enum v4l2_av1_frame_restoration_type {
+ V4L2_AV1_FRAME_RESTORE_NONE = 0,
+ V4L2_AV1_FRAME_RESTORE_WIENER = 1,
+ V4L2_AV1_FRAME_RESTORE_SGRPROJ = 2,
+ V4L2_AV1_FRAME_RESTORE_SWITCHABLE = 3,
+};
+#define V4L2_AV1_LOOP_RESTORATION_FLAG_USES_LR 0x1
+#define V4L2_AV1_LOOP_RESTORATION_FLAG_USES_CHROMA_LR 0x2
+struct v4l2_av1_loop_restoration {
+ __u8 flags;
+ __u8 lr_unit_shift;
+ __u8 lr_uv_shift;
+ __u8 reserved;
+ enum v4l2_av1_frame_restoration_type frame_restoration_type[V4L2_AV1_NUM_PLANES_MAX];
+ __u32 loop_restoration_size[V4L2_AV1_MAX_NUM_PLANES];
+};
+struct v4l2_av1_cdef {
+ __u8 damping_minus_3;
+ __u8 bits;
+ __u8 y_pri_strength[V4L2_AV1_CDEF_MAX];
+ __u8 y_sec_strength[V4L2_AV1_CDEF_MAX];
+ __u8 uv_pri_strength[V4L2_AV1_CDEF_MAX];
+ __u8 uv_sec_strength[V4L2_AV1_CDEF_MAX];
+};
+#define V4L2_AV1_SEGMENTATION_FLAG_ENABLED 0x1
+#define V4L2_AV1_SEGMENTATION_FLAG_UPDATE_MAP 0x2
+#define V4L2_AV1_SEGMENTATION_FLAG_TEMPORAL_UPDATE 0x4
+#define V4L2_AV1_SEGMENTATION_FLAG_UPDATE_DATA 0x8
+#define V4L2_AV1_SEGMENTATION_FLAG_SEG_ID_PRE_SKIP 0x10
+enum v4l2_av1_segment_feature {
+ V4L2_AV1_SEG_LVL_ALT_Q = 0,
+ V4L2_AV1_SEG_LVL_ALT_LF_Y_V = 1,
+ V4L2_AV1_SEG_LVL_REF_FRAME = 5,
+ V4L2_AV1_SEG_LVL_REF_SKIP = 6,
+ V4L2_AV1_SEG_LVL_REF_GLOBALMV = 7,
+ V4L2_AV1_SEG_LVL_MAX = 8
+};
+#define V4L2_AV1_SEGMENT_FEATURE_ENABLED(id) (1 << (id))
+struct v4l2_av1_segmentation {
+ __u8 flags;
+ __u8 last_active_seg_id;
+ __u8 feature_enabled[V4L2_AV1_MAX_SEGMENTS];
+ __s16 feature_data[V4L2_AV1_MAX_SEGMENTS][V4L2_AV1_SEG_LVL_MAX];
+};
+#define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_ENABLED 0x1
+#define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2
+#define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_PRESENT 0x4
+#define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_MULTI 0x8
+struct v4l2_av1_loop_filter {
+ __u8 flags;
+ __u8 level[4];
+ __u8 sharpness;
+ __s8 ref_deltas[V4L2_AV1_TOTAL_REFS_PER_FRAME];
+ __s8 mode_deltas[2];
+ __u8 delta_lf_res;
+};
+#define V4L2_AV1_QUANTIZATION_FLAG_DIFF_UV_DELTA 0x1
+#define V4L2_AV1_QUANTIZATION_FLAG_USING_QMATRIX 0x2
+#define V4L2_AV1_QUANTIZATION_FLAG_DELTA_Q_PRESENT 0x4
+struct v4l2_av1_quantization {
+ __u8 flags;
+ __u8 base_q_idx;
+ __s8 delta_q_y_dc;
+ __s8 delta_q_u_dc;
+ __s8 delta_q_u_ac;
+ __s8 delta_q_v_dc;
+ __s8 delta_q_v_ac;
+ __u8 qm_y;
+ __u8 qm_u;
+ __u8 qm_v;
+ __u8 delta_q_res;
+};
+#define V4L2_AV1_TILE_INFO_FLAG_UNIFORM_TILE_SPACING 0x1
+struct v4l2_av1_tile_info {
+ __u8 flags;
+ __u8 context_update_tile_id;
+ __u8 tile_cols;
+ __u8 tile_rows;
+ __u32 mi_col_starts[V4L2_AV1_MAX_TILE_COLS + 1];
+ __u32 mi_row_starts[V4L2_AV1_MAX_TILE_ROWS + 1];
+ __u32 width_in_sbs_minus_1[V4L2_AV1_MAX_TILE_COLS];
+ __u32 height_in_sbs_minus_1[V4L2_AV1_MAX_TILE_ROWS];
+ __u8 tile_size_bytes;
+ __u8 reserved[3];
+};
+enum v4l2_av1_frame_type {
+ V4L2_AV1_KEY_FRAME = 0,
+ V4L2_AV1_INTER_FRAME = 1,
+ V4L2_AV1_INTRA_ONLY_FRAME = 2,
+ V4L2_AV1_SWITCH_FRAME = 3
+};
+enum v4l2_av1_interpolation_filter {
+ V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP = 0,
+ V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH = 1,
+ V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP = 2,
+ V4L2_AV1_INTERPOLATION_FILTER_BILINEAR = 3,
+ V4L2_AV1_INTERPOLATION_FILTER_SWITCHABLE = 4,
+};
+enum v4l2_av1_tx_mode {
+ V4L2_AV1_TX_MODE_ONLY_4X4 = 0,
+ V4L2_AV1_TX_MODE_LARGEST = 1,
+ V4L2_AV1_TX_MODE_SELECT = 2
+};
+#define V4L2_AV1_FRAME_FLAG_SHOW_FRAME 0x00000001
+#define V4L2_AV1_FRAME_FLAG_SHOWABLE_FRAME 0x00000002
+#define V4L2_AV1_FRAME_FLAG_ERROR_RESILIENT_MODE 0x00000004
+#define V4L2_AV1_FRAME_FLAG_DISABLE_CDF_UPDATE 0x00000008
+#define V4L2_AV1_FRAME_FLAG_ALLOW_SCREEN_CONTENT_TOOLS 0x00000010
+#define V4L2_AV1_FRAME_FLAG_FORCE_INTEGER_MV 0x00000020
+#define V4L2_AV1_FRAME_FLAG_ALLOW_INTRABC 0x00000040
+#define V4L2_AV1_FRAME_FLAG_USE_SUPERRES 0x00000080
+#define V4L2_AV1_FRAME_FLAG_ALLOW_HIGH_PRECISION_MV 0x00000100
+#define V4L2_AV1_FRAME_FLAG_IS_MOTION_MODE_SWITCHABLE 0x00000200
+#define V4L2_AV1_FRAME_FLAG_USE_REF_FRAME_MVS 0x00000400
+#define V4L2_AV1_FRAME_FLAG_DISABLE_FRAME_END_UPDATE_CDF 0x00000800
+#define V4L2_AV1_FRAME_FLAG_ALLOW_WARPED_MOTION 0x00001000
+#define V4L2_AV1_FRAME_FLAG_REFERENCE_SELECT 0x00002000
+#define V4L2_AV1_FRAME_FLAG_REDUCED_TX_SET 0x00004000
+#define V4L2_AV1_FRAME_FLAG_SKIP_MODE_ALLOWED 0x00008000
+#define V4L2_AV1_FRAME_FLAG_SKIP_MODE_PRESENT 0x00010000
+#define V4L2_AV1_FRAME_FLAG_FRAME_SIZE_OVERRIDE 0x00020000
+#define V4L2_AV1_FRAME_FLAG_BUFFER_REMOVAL_TIME_PRESENT 0x00040000
+#define V4L2_AV1_FRAME_FLAG_FRAME_REFS_SHORT_SIGNALING 0x00080000
+#define V4L2_CID_STATELESS_AV1_FRAME (V4L2_CID_CODEC_STATELESS_BASE + 502)
+struct v4l2_ctrl_av1_frame {
+ struct v4l2_av1_tile_info tile_info;
+ struct v4l2_av1_quantization quantization;
+ __u8 superres_denom;
+ struct v4l2_av1_segmentation segmentation;
+ struct v4l2_av1_loop_filter loop_filter;
+ struct v4l2_av1_cdef cdef;
+ __u8 skip_mode_frame[2];
+ __u8 primary_ref_frame;
+ struct v4l2_av1_loop_restoration loop_restoration;
+ struct v4l2_av1_global_motion global_motion;
+ __u32 flags;
+ enum v4l2_av1_frame_type frame_type;
+ __u32 order_hint;
+ __u32 upscaled_width;
+ enum v4l2_av1_interpolation_filter interpolation_filter;
+ enum v4l2_av1_tx_mode tx_mode;
+ __u32 frame_width_minus_1;
+ __u32 frame_height_minus_1;
+ __u16 render_width_minus_1;
+ __u16 render_height_minus_1;
+ __u32 current_frame_id;
+ __u32 buffer_removal_time[V4L2_AV1_MAX_OPERATING_POINTS];
+ __u8 reserved[4];
+ __u32 order_hints[V4L2_AV1_TOTAL_REFS_PER_FRAME];
+ __u64 reference_frame_ts[V4L2_AV1_TOTAL_REFS_PER_FRAME];
+ __s8 ref_frame_idx[V4L2_AV1_REFS_PER_FRAME];
+ __u8 refresh_frame_flags;
+};
+#define V4L2_AV1_FILM_GRAIN_FLAG_APPLY_GRAIN 0x1
+#define V4L2_AV1_FILM_GRAIN_FLAG_UPDATE_GRAIN 0x2
+#define V4L2_AV1_FILM_GRAIN_FLAG_CHROMA_SCALING_FROM_LUMA 0x4
+#define V4L2_AV1_FILM_GRAIN_FLAG_OVERLAP 0x8
+#define V4L2_AV1_FILM_GRAIN_FLAG_CLIP_TO_RESTRICTED_RANGE 0x10
+#define V4L2_CID_STATELESS_AV1_FILM_GRAIN (V4L2_CID_CODEC_STATELESS_BASE + 505)
+struct v4l2_ctrl_av1_film_grain {
+ __u8 flags;
+ __u8 cr_mult;
+ __u16 grain_seed;
+ __u8 film_grain_params_ref_idx;
+ __u8 num_y_points;
+ __u8 point_y_value[V4L2_AV1_MAX_NUM_Y_POINTS];
+ __u8 point_y_scaling[V4L2_AV1_MAX_NUM_Y_POINTS];
+ __u8 num_cb_points;
+ __u8 point_cb_value[V4L2_AV1_MAX_NUM_CB_POINTS];
+ __u8 point_cb_scaling[V4L2_AV1_MAX_NUM_CB_POINTS];
+ __u8 num_cr_points;
+ __u8 point_cr_value[V4L2_AV1_MAX_NUM_CR_POINTS];
+ __u8 point_cr_scaling[V4L2_AV1_MAX_NUM_CR_POINTS];
+ __u8 grain_scaling_minus_8;
+ __u8 ar_coeff_lag;
+ __u8 ar_coeffs_y_plus_128[V4L2_AV1_AR_COEFFS_SIZE];
+ __u8 ar_coeffs_cb_plus_128[V4L2_AV1_AR_COEFFS_SIZE];
+ __u8 ar_coeffs_cr_plus_128[V4L2_AV1_AR_COEFFS_SIZE];
+ __u8 ar_coeff_shift_minus_6;
+ __u8 grain_scale_shift;
+ __u8 cb_mult;
+ __u8 cb_luma_mult;
+ __u8 cr_luma_mult;
+ __u16 cb_offset;
+ __u16 cr_offset;
+ __u8 reserved[4];
+};
#define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC
#define V4L2_CID_MPEG_CLASS V4L2_CID_CODEC_CLASS
#define V4L2_CID_MPEG_BASE V4L2_CID_CODEC_BASE
diff --git a/libc/kernel/uapi/linux/v4l2-subdev.h b/libc/kernel/uapi/linux/v4l2-subdev.h
index 2954dc3..55d7192 100644
--- a/libc/kernel/uapi/linux/v4l2-subdev.h
+++ b/libc/kernel/uapi/linux/v4l2-subdev.h
@@ -18,6 +18,7 @@
****************************************************************************/
#ifndef __LINUX_V4L2_SUBDEV_H
#define __LINUX_V4L2_SUBDEV_H
+#include <linux/const.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/v4l2-common.h>
@@ -30,13 +31,15 @@
__u32 which;
__u32 pad;
struct v4l2_mbus_framefmt format;
- __u32 reserved[8];
+ __u32 stream;
+ __u32 reserved[7];
};
struct v4l2_subdev_crop {
__u32 which;
__u32 pad;
struct v4l2_rect rect;
- __u32 reserved[8];
+ __u32 stream;
+ __u32 reserved[7];
};
#define V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE 0x00000001
#define V4L2_SUBDEV_MBUS_CODE_CSC_XFER_FUNC 0x00000002
@@ -49,7 +52,8 @@
__u32 code;
__u32 which;
__u32 flags;
- __u32 reserved[7];
+ __u32 stream;
+ __u32 reserved[6];
};
struct v4l2_subdev_frame_size_enum {
__u32 index;
@@ -60,12 +64,14 @@
__u32 min_height;
__u32 max_height;
__u32 which;
- __u32 reserved[8];
+ __u32 stream;
+ __u32 reserved[7];
};
struct v4l2_subdev_frame_interval {
__u32 pad;
struct v4l2_fract interval;
- __u32 reserved[9];
+ __u32 stream;
+ __u32 reserved[8];
};
struct v4l2_subdev_frame_interval_enum {
__u32 index;
@@ -75,7 +81,8 @@
__u32 height;
struct v4l2_fract interval;
__u32 which;
- __u32 reserved[8];
+ __u32 stream;
+ __u32 reserved[7];
};
struct v4l2_subdev_selection {
__u32 which;
@@ -83,7 +90,8 @@
__u32 target;
__u32 flags;
struct v4l2_rect r;
- __u32 reserved[8];
+ __u32 stream;
+ __u32 reserved[7];
};
struct v4l2_subdev_capability {
__u32 version;
@@ -91,6 +99,26 @@
__u32 reserved[14];
};
#define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001
+#define V4L2_SUBDEV_CAP_STREAMS 0x00000002
+#define V4L2_SUBDEV_ROUTE_FL_ACTIVE (1U << 0)
+struct v4l2_subdev_route {
+ __u32 sink_pad;
+ __u32 sink_stream;
+ __u32 source_pad;
+ __u32 source_stream;
+ __u32 flags;
+ __u32 reserved[5];
+};
+struct v4l2_subdev_routing {
+ __u32 which;
+ __u32 num_routes;
+ __u64 routes;
+ __u32 reserved[6];
+};
+#define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1U << 0)
+struct v4l2_subdev_client_capability {
+ __u64 capabilities;
+};
#define v4l2_subdev_edid v4l2_edid
#define VIDIOC_SUBDEV_QUERYCAP _IOR('V', 0, struct v4l2_subdev_capability)
#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
@@ -104,6 +132,10 @@
#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)
+#define VIDIOC_SUBDEV_G_ROUTING _IOWR('V', 38, struct v4l2_subdev_routing)
+#define VIDIOC_SUBDEV_S_ROUTING _IOWR('V', 39, struct v4l2_subdev_routing)
+#define VIDIOC_SUBDEV_G_CLIENT_CAP _IOR('V', 101, struct v4l2_subdev_client_capability)
+#define VIDIOC_SUBDEV_S_CLIENT_CAP _IOWR('V', 102, struct v4l2_subdev_client_capability)
#define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id)
#define VIDIOC_SUBDEV_S_STD _IOW('V', 24, v4l2_std_id)
#define VIDIOC_SUBDEV_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
diff --git a/libc/kernel/uapi/linux/version.h b/libc/kernel/uapi/linux/version.h
index 0d50613..52d0113 100644
--- a/libc/kernel/uapi/linux/version.h
+++ b/libc/kernel/uapi/linux/version.h
@@ -16,8 +16,8 @@
***
****************************************************************************
****************************************************************************/
-#define LINUX_VERSION_CODE 393728
+#define LINUX_VERSION_CODE 394496
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
#define LINUX_VERSION_MAJOR 6
-#define LINUX_VERSION_PATCHLEVEL 2
+#define LINUX_VERSION_PATCHLEVEL 5
#define LINUX_VERSION_SUBLEVEL 0
diff --git a/libc/kernel/uapi/linux/vfio.h b/libc/kernel/uapi/linux/vfio.h
index 3c1821c..b404238 100644
--- a/libc/kernel/uapi/linux/vfio.h
+++ b/libc/kernel/uapi/linux/vfio.h
@@ -62,6 +62,7 @@
#define VFIO_DEVICE_FLAGS_AP (1 << 5)
#define VFIO_DEVICE_FLAGS_FSL_MC (1 << 6)
#define VFIO_DEVICE_FLAGS_CAPS (1 << 7)
+#define VFIO_DEVICE_FLAGS_CDX (1 << 8)
__u32 num_regions;
__u32 num_irqs;
__u32 cap_offset;
@@ -76,6 +77,15 @@
#define VFIO_DEVICE_INFO_CAP_ZPCI_GROUP 2
#define VFIO_DEVICE_INFO_CAP_ZPCI_UTIL 3
#define VFIO_DEVICE_INFO_CAP_ZPCI_PFIP 4
+#define VFIO_DEVICE_INFO_CAP_PCI_ATOMIC_COMP 5
+struct vfio_device_info_cap_pci_atomic_comp {
+ struct vfio_info_cap_header header;
+ __u32 flags;
+#define VFIO_PCI_ATOMIC_COMP32 (1 << 0)
+#define VFIO_PCI_ATOMIC_COMP64 (1 << 1)
+#define VFIO_PCI_ATOMIC_COMP128 (1 << 2)
+ __u32 reserved;
+};
struct vfio_region_info {
__u32 argsz;
__u32 flags;
@@ -217,6 +227,10 @@
VFIO_CCW_REQ_IRQ_INDEX,
VFIO_CCW_NUM_IRQS
};
+enum {
+ VFIO_AP_REQ_IRQ_INDEX,
+ VFIO_AP_NUM_IRQS
+};
struct vfio_pci_dependent_device {
__u32 group_id;
__u16 segment;
diff --git a/libc/kernel/uapi/linux/vhost.h b/libc/kernel/uapi/linux/vhost.h
index e5b1327..7e0a55a 100644
--- a/libc/kernel/uapi/linux/vhost.h
+++ b/libc/kernel/uapi/linux/vhost.h
@@ -30,6 +30,8 @@
#define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory)
#define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64)
#define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int)
+#define VHOST_NEW_WORKER _IOR(VHOST_VIRTIO, 0x8, struct vhost_worker_state)
+#define VHOST_FREE_WORKER _IOW(VHOST_VIRTIO, 0x9, struct vhost_worker_state)
#define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, struct vhost_vring_state)
#define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, struct vhost_vring_addr)
#define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
@@ -38,6 +40,8 @@
#define VHOST_VRING_BIG_ENDIAN 1
#define VHOST_SET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x13, struct vhost_vring_state)
#define VHOST_GET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x14, struct vhost_vring_state)
+#define VHOST_ATTACH_VRING_WORKER _IOW(VHOST_VIRTIO, 0x15, struct vhost_vring_worker)
+#define VHOST_GET_VRING_WORKER _IOWR(VHOST_VIRTIO, 0x16, struct vhost_vring_worker)
#define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, struct vhost_vring_file)
#define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, struct vhost_vring_file)
#define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, struct vhost_vring_file)
@@ -69,4 +73,5 @@
#define VHOST_VDPA_GET_VRING_GROUP _IOWR(VHOST_VIRTIO, 0x7B, struct vhost_vring_state)
#define VHOST_VDPA_SET_GROUP_ASID _IOW(VHOST_VIRTIO, 0x7C, struct vhost_vring_state)
#define VHOST_VDPA_SUSPEND _IO(VHOST_VIRTIO, 0x7D)
+#define VHOST_VDPA_RESUME _IO(VHOST_VIRTIO, 0x7E)
#endif
diff --git a/libc/kernel/uapi/linux/vhost_types.h b/libc/kernel/uapi/linux/vhost_types.h
index 32efa85..1cd6965 100644
--- a/libc/kernel/uapi/linux/vhost_types.h
+++ b/libc/kernel/uapi/linux/vhost_types.h
@@ -39,6 +39,13 @@
__u64 avail_user_addr;
__u64 log_guest_addr;
};
+struct vhost_worker_state {
+ unsigned int worker_id;
+};
+struct vhost_vring_worker {
+ unsigned int index;
+ unsigned int worker_id;
+};
struct vhost_iotlb_msg {
__u64 iova;
__u64 size;
@@ -106,4 +113,5 @@
#define VHOST_BACKEND_F_IOTLB_BATCH 0x2
#define VHOST_BACKEND_F_IOTLB_ASID 0x3
#define VHOST_BACKEND_F_SUSPEND 0x4
+#define VHOST_BACKEND_F_RESUME 0x5
#endif
diff --git a/libc/kernel/uapi/linux/videodev2.h b/libc/kernel/uapi/linux/videodev2.h
index 4fb0a25..2cd1beb 100644
--- a/libc/kernel/uapi/linux/videodev2.h
+++ b/libc/kernel/uapi/linux/videodev2.h
@@ -244,11 +244,17 @@
#define V4L2_PIX_FMT_RGBX32 v4l2_fourcc('X', 'B', '2', '4')
#define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4')
#define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4')
+#define V4L2_PIX_FMT_RGBX1010102 v4l2_fourcc('R', 'X', '3', '0')
+#define V4L2_PIX_FMT_RGBA1010102 v4l2_fourcc('R', 'A', '3', '0')
+#define V4L2_PIX_FMT_ARGB2101010 v4l2_fourcc('A', 'R', '3', '0')
+#define V4L2_PIX_FMT_BGR48_12 v4l2_fourcc('B', '3', '1', '2')
+#define V4L2_PIX_FMT_ABGR64_12 v4l2_fourcc('B', '4', '1', '2')
#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y')
#define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ')
#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ')
#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ')
#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ')
+#define V4L2_PIX_FMT_Y012 v4l2_fourcc('Y', '0', '1', '2')
#define V4L2_PIX_FMT_Y14 v4l2_fourcc('Y', '1', '4', ' ')
#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ')
#define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ')
@@ -275,6 +281,10 @@
#define V4L2_PIX_FMT_YUVA32 v4l2_fourcc('Y', 'U', 'V', 'A')
#define V4L2_PIX_FMT_YUVX32 v4l2_fourcc('Y', 'U', 'V', 'X')
#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0')
+#define V4L2_PIX_FMT_YUV48_12 v4l2_fourcc('Y', '3', '1', '2')
+#define V4L2_PIX_FMT_Y210 v4l2_fourcc('Y', '2', '1', '0')
+#define V4L2_PIX_FMT_Y212 v4l2_fourcc('Y', '2', '1', '2')
+#define V4L2_PIX_FMT_Y216 v4l2_fourcc('Y', '2', '1', '6')
#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2')
#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1')
#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6')
@@ -282,10 +292,12 @@
#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4')
#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2')
#define V4L2_PIX_FMT_P010 v4l2_fourcc('P', '0', '1', '0')
+#define V4L2_PIX_FMT_P012 v4l2_fourcc('P', '0', '1', '2')
#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2')
#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1')
#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6')
#define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1')
+#define V4L2_PIX_FMT_P012M v4l2_fourcc('P', 'M', '1', '2')
#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9')
#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9')
#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P')
@@ -301,6 +313,7 @@
#define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2')
#define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2')
#define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2')
+#define V4L2_PIX_FMT_NV15_4L4 v4l2_fourcc('V', 'T', '1', '5')
#define V4L2_PIX_FMT_P010_4L4 v4l2_fourcc('T', '0', '1', '0')
#define V4L2_PIX_FMT_NV12_8L128 v4l2_fourcc('A', 'T', '1', '2')
#define V4L2_PIX_FMT_NV12_10BE_8L128 v4l2_fourcc_be('A', 'X', '1', '2')
@@ -374,6 +387,10 @@
#define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H')
#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4')
#define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5')
+#define V4L2_PIX_FMT_AV1_FRAME v4l2_fourcc('A', 'V', '1', 'F')
+#define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0')
+#define V4L2_PIX_FMT_RV30 v4l2_fourcc('R', 'V', '3', '0')
+#define V4L2_PIX_FMT_RV40 v4l2_fourcc('R', 'V', '4', '0')
#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A')
#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A')
#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0')
@@ -899,8 +916,8 @@
__u8 * p_u8;
__u16 * p_u16;
__u32 * p_u32;
- __u32 * p_s32;
- __u32 * p_s64;
+ __s32 * p_s32;
+ __s64 * p_s64;
struct v4l2_area * p_area;
struct v4l2_ctrl_h264_sps * p_h264_sps;
struct v4l2_ctrl_h264_pps * p_h264_pps;
@@ -920,6 +937,10 @@
struct v4l2_ctrl_hevc_slice_params * p_hevc_slice_params;
struct v4l2_ctrl_hevc_scaling_matrix * p_hevc_scaling_matrix;
struct v4l2_ctrl_hevc_decode_params * p_hevc_decode_params;
+ struct v4l2_ctrl_av1_sequence * p_av1_sequence;
+ struct v4l2_ctrl_av1_tile_group_entry * p_av1_tile_group_entry;
+ struct v4l2_ctrl_av1_frame * p_av1_frame;
+ struct v4l2_ctrl_av1_film_grain * p_av1_film_grain;
void * ptr;
};
} __attribute__((packed));
@@ -977,6 +998,10 @@
V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS = 0x0272,
V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX = 0x0273,
V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS = 0x0274,
+ V4L2_CTRL_TYPE_AV1_SEQUENCE = 0x280,
+ V4L2_CTRL_TYPE_AV1_TILE_GROUP_ENTRY = 0x281,
+ V4L2_CTRL_TYPE_AV1_FRAME = 0x282,
+ V4L2_CTRL_TYPE_AV1_FILM_GRAIN = 0x283,
};
struct v4l2_queryctrl {
__u32 id;
diff --git a/libc/kernel/uapi/linux/virtio_blk.h b/libc/kernel/uapi/linux/virtio_blk.h
index 0dd08c5..1b7c7e9 100644
--- a/libc/kernel/uapi/linux/virtio_blk.h
+++ b/libc/kernel/uapi/linux/virtio_blk.h
@@ -32,6 +32,7 @@
#define VIRTIO_BLK_F_DISCARD 13
#define VIRTIO_BLK_F_WRITE_ZEROES 14
#define VIRTIO_BLK_F_SECURE_ERASE 16
+#define VIRTIO_BLK_F_ZONED 17
#ifndef VIRTIO_BLK_NO_LEGACY
#define VIRTIO_BLK_F_BARRIER 0
#define VIRTIO_BLK_F_SCSI 7
@@ -67,6 +68,15 @@
__virtio32 max_secure_erase_sectors;
__virtio32 max_secure_erase_seg;
__virtio32 secure_erase_sector_alignment;
+ struct virtio_blk_zoned_characteristics {
+ __virtio32 zone_sectors;
+ __virtio32 max_open_zones;
+ __virtio32 max_active_zones;
+ __virtio32 max_append_sectors;
+ __virtio32 write_granularity;
+ __u8 model;
+ __u8 unused2[3];
+ } zoned;
} __attribute__((packed));
#define VIRTIO_BLK_T_IN 0
#define VIRTIO_BLK_T_OUT 1
@@ -78,6 +88,13 @@
#define VIRTIO_BLK_T_DISCARD 11
#define VIRTIO_BLK_T_WRITE_ZEROES 13
#define VIRTIO_BLK_T_SECURE_ERASE 14
+#define VIRTIO_BLK_T_ZONE_APPEND 15
+#define VIRTIO_BLK_T_ZONE_REPORT 16
+#define VIRTIO_BLK_T_ZONE_OPEN 18
+#define VIRTIO_BLK_T_ZONE_CLOSE 20
+#define VIRTIO_BLK_T_ZONE_FINISH 22
+#define VIRTIO_BLK_T_ZONE_RESET 24
+#define VIRTIO_BLK_T_ZONE_RESET_ALL 26
#ifndef VIRTIO_BLK_NO_LEGACY
#define VIRTIO_BLK_T_BARRIER 0x80000000
#endif
@@ -86,6 +103,33 @@
__virtio32 ioprio;
__virtio64 sector;
};
+#define VIRTIO_BLK_Z_NONE 0
+#define VIRTIO_BLK_Z_HM 1
+#define VIRTIO_BLK_Z_HA 2
+struct virtio_blk_zone_descriptor {
+ __virtio64 z_cap;
+ __virtio64 z_start;
+ __virtio64 z_wp;
+ __u8 z_type;
+ __u8 z_state;
+ __u8 reserved[38];
+};
+struct virtio_blk_zone_report {
+ __virtio64 nr_zones;
+ __u8 reserved[56];
+ struct virtio_blk_zone_descriptor zones[];
+};
+#define VIRTIO_BLK_ZT_CONV 1
+#define VIRTIO_BLK_ZT_SWR 2
+#define VIRTIO_BLK_ZT_SWP 3
+#define VIRTIO_BLK_ZS_NOT_WP 0
+#define VIRTIO_BLK_ZS_EMPTY 1
+#define VIRTIO_BLK_ZS_IOPEN 2
+#define VIRTIO_BLK_ZS_EOPEN 3
+#define VIRTIO_BLK_ZS_CLOSED 4
+#define VIRTIO_BLK_ZS_RDONLY 13
+#define VIRTIO_BLK_ZS_FULL 14
+#define VIRTIO_BLK_ZS_OFFLINE 15
#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001
struct virtio_blk_discard_write_zeroes {
__le64 sector;
@@ -103,4 +147,8 @@
#define VIRTIO_BLK_S_OK 0
#define VIRTIO_BLK_S_IOERR 1
#define VIRTIO_BLK_S_UNSUPP 2
+#define VIRTIO_BLK_S_ZONE_INVALID_CMD 3
+#define VIRTIO_BLK_S_ZONE_UNALIGNED_WP 4
+#define VIRTIO_BLK_S_ZONE_OPEN_RESOURCE 5
+#define VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE 6
#endif
diff --git a/libc/kernel/uapi/linux/virtio_config.h b/libc/kernel/uapi/linux/virtio_config.h
index bdd2e73..152d854 100644
--- a/libc/kernel/uapi/linux/virtio_config.h
+++ b/libc/kernel/uapi/linux/virtio_config.h
@@ -38,5 +38,6 @@
#define VIRTIO_F_IN_ORDER 35
#define VIRTIO_F_ORDER_PLATFORM 36
#define VIRTIO_F_SR_IOV 37
+#define VIRTIO_F_NOTIFICATION_DATA 38
#define VIRTIO_F_RING_RESET 40
#endif
diff --git a/libc/kernel/uapi/linux/virtio_net.h b/libc/kernel/uapi/linux/virtio_net.h
index da7285e..d2554a0 100644
--- a/libc/kernel/uapi/linux/virtio_net.h
+++ b/libc/kernel/uapi/linux/virtio_net.h
@@ -50,6 +50,7 @@
#define VIRTIO_NET_F_GUEST_USO6 55
#define VIRTIO_NET_F_HOST_USO 56
#define VIRTIO_NET_F_HASH_REPORT 57
+#define VIRTIO_NET_F_GUEST_HDRLEN 59
#define VIRTIO_NET_F_RSS 60
#define VIRTIO_NET_F_RSC_EXT 61
#define VIRTIO_NET_F_STANDBY 62
diff --git a/libc/kernel/uapi/linux/wireless.h b/libc/kernel/uapi/linux/wireless.h
index eb57fff..e6b0330 100644
--- a/libc/kernel/uapi/linux/wireless.h
+++ b/libc/kernel/uapi/linux/wireless.h
@@ -314,7 +314,7 @@
struct sockaddr addr;
__u16 alg;
__u16 key_len;
- __u8 key[0];
+ __u8 key[];
};
struct iw_mlme {
__u16 cmd;
diff --git a/libc/kernel/uapi/rdma/bnxt_re-abi.h b/libc/kernel/uapi/rdma/bnxt_re-abi.h
index 62ba685..68cb06a 100644
--- a/libc/kernel/uapi/rdma/bnxt_re-abi.h
+++ b/libc/kernel/uapi/rdma/bnxt_re-abi.h
@@ -19,6 +19,7 @@
#ifndef __BNXT_RE_UVERBS_ABI_H__
#define __BNXT_RE_UVERBS_ABI_H__
#include <linux/types.h>
+#include <rdma/ib_user_ioctl_cmds.h>
#define BNXT_RE_ABI_VERSION 1
#define BNXT_RE_CHIP_ID0_CHIP_NUM_SFT 0x00
#define BNXT_RE_CHIP_ID0_CHIP_REV_SFT 0x10
@@ -26,6 +27,7 @@
enum {
BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL,
BNXT_RE_UCNTX_CMASK_HAVE_MODE = 0x02ULL,
+ BNXT_RE_UCNTX_CMASK_WC_DPI_ENABLED = 0x04ULL,
};
enum bnxt_re_wqe_mode {
BNXT_QPLIB_WQE_MODE_STATIC = 0x00,
@@ -60,6 +62,9 @@
__u32 phase;
__u32 rsvd;
};
+struct bnxt_re_resize_cq_req {
+ __aligned_u64 cq_va;
+};
struct bnxt_re_qp_req {
__aligned_u64 qpsva;
__aligned_u64 qprva;
@@ -82,4 +87,24 @@
BNXT_RE_AVID_SIZE = 0x04,
BNXT_RE_END_RESV_OFFT = 0xFF0
};
+enum bnxt_re_objects {
+ BNXT_RE_OBJECT_ALLOC_PAGE = (1U << UVERBS_ID_NS_SHIFT),
+};
+enum bnxt_re_alloc_page_type {
+ BNXT_RE_ALLOC_WC_PAGE = 0,
+};
+enum bnxt_re_var_alloc_page_attrs {
+ BNXT_RE_ALLOC_PAGE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
+ BNXT_RE_ALLOC_PAGE_TYPE,
+ BNXT_RE_ALLOC_PAGE_DPI,
+ BNXT_RE_ALLOC_PAGE_MMAP_OFFSET,
+ BNXT_RE_ALLOC_PAGE_MMAP_LENGTH,
+};
+enum bnxt_re_alloc_page_attrs {
+ BNXT_RE_DESTROY_PAGE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
+};
+enum bnxt_re_alloc_page_methods {
+ BNXT_RE_METHOD_ALLOC_PAGE = (1U << UVERBS_ID_NS_SHIFT),
+ BNXT_RE_METHOD_DESTROY_PAGE,
+};
#endif
diff --git a/libc/kernel/uapi/rdma/efa-abi.h b/libc/kernel/uapi/rdma/efa-abi.h
index bfb3f18..aab5902 100644
--- a/libc/kernel/uapi/rdma/efa-abi.h
+++ b/libc/kernel/uapi/rdma/efa-abi.h
@@ -104,6 +104,8 @@
EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,
EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID = 1 << 3,
+ EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128 = 1 << 4,
+ EFA_QUERY_DEVICE_CAPS_RDMA_WRITE = 1 << 5,
};
struct efa_ibv_ex_query_device_resp {
__u32 comp_mask;
diff --git a/libc/kernel/uapi/rdma/hns-abi.h b/libc/kernel/uapi/rdma/hns-abi.h
index 0407571..f778ef2 100644
--- a/libc/kernel/uapi/rdma/hns-abi.h
+++ b/libc/kernel/uapi/rdma/hns-abi.h
@@ -62,9 +62,13 @@
};
enum {
HNS_ROCE_EXSGE_FLAGS = 1 << 0,
+ HNS_ROCE_RQ_INLINE_FLAGS = 1 << 1,
+ HNS_ROCE_CQE_INLINE_FLAGS = 1 << 2,
};
enum {
HNS_ROCE_RSP_EXSGE_FLAGS = 1 << 0,
+ HNS_ROCE_RSP_RQ_INLINE_FLAGS = 1 << 1,
+ HNS_ROCE_RSP_CQE_INLINE_FLAGS = 1 << 2,
};
struct hns_roce_ib_alloc_ucontext_resp {
__u32 qp_tab_size;
diff --git a/libc/kernel/uapi/scsi/scsi_bsg_fc.h b/libc/kernel/uapi/scsi/scsi_bsg_fc.h
index 2647249..3836282 100644
--- a/libc/kernel/uapi/scsi/scsi_bsg_fc.h
+++ b/libc/kernel/uapi/scsi/scsi_bsg_fc.h
@@ -69,7 +69,7 @@
__u32 vendor_cmd[];
};
struct fc_bsg_host_vendor_reply {
- __u32 vendor_rsp[0];
+ __DECLARE_FLEX_ARRAY(__u32, vendor_rsp);
};
struct fc_bsg_rport_els {
__u8 els_code;
diff --git a/libc/kernel/uapi/scsi/scsi_bsg_mpi3mr.h b/libc/kernel/uapi/scsi/scsi_bsg_mpi3mr.h
index fcba8cd..48e88d3 100644
--- a/libc/kernel/uapi/scsi/scsi_bsg_mpi3mr.h
+++ b/libc/kernel/uapi/scsi/scsi_bsg_mpi3mr.h
@@ -220,9 +220,6 @@
struct mpi3mr_bsg_mptcmd mptcmd;
} cmd;
};
-#ifndef MPI3_NVME_ENCAP_CMD_MAX
-#define MPI3_NVME_ENCAP_CMD_MAX (1)
-#endif
struct mpi3_nvme_encapsulated_request {
__le16 host_tag;
__u8 ioc_use_only02;
@@ -236,7 +233,7 @@
__le16 flags;
__le32 data_length;
__le32 reserved14[3];
- __le32 command[MPI3_NVME_ENCAP_CMD_MAX];
+ __le32 command[];
};
struct mpi3_nvme_encapsulated_error_reply {
__le16 host_tag;
diff --git a/libc/kernel/uapi/scsi/scsi_bsg_ufs.h b/libc/kernel/uapi/scsi/scsi_bsg_ufs.h
index ae5c757..b820c07 100644
--- a/libc/kernel/uapi/scsi/scsi_bsg_ufs.h
+++ b/libc/kernel/uapi/scsi/scsi_bsg_ufs.h
@@ -20,8 +20,22 @@
#define SCSI_BSG_UFS_H
#include <linux/types.h>
#define UFS_CDB_SIZE 16
-#define UPIU_TRANSACTION_UIC_CMD 0x1F
#define UIC_CMD_SIZE (sizeof(__u32) * 4)
+enum ufs_bsg_msg_code {
+ UPIU_TRANSACTION_UIC_CMD = 0x1F,
+ UPIU_TRANSACTION_ARPMB_CMD,
+};
+enum ufs_rpmb_op_type {
+ UFS_RPMB_WRITE_KEY = 0x01,
+ UFS_RPMB_READ_CNT = 0x02,
+ UFS_RPMB_WRITE = 0x03,
+ UFS_RPMB_READ = 0x04,
+ UFS_RPMB_READ_RESP = 0x05,
+ UFS_RPMB_SEC_CONF_WRITE = 0x06,
+ UFS_RPMB_SEC_CONF_READ = 0x07,
+ UFS_RPMB_PURGE_ENABLE = 0x08,
+ UFS_RPMB_PURGE_STATUS_READ = 0x09,
+};
struct utp_upiu_header {
__be32 dword_0;
__be32 dword_1;
@@ -37,6 +51,18 @@
__be32 value;
__be32 reserved[2];
};
+struct utp_upiu_query_v4_0 {
+ __u8 opcode;
+ __u8 idn;
+ __u8 index;
+ __u8 selector;
+ __u8 osf3;
+ __u8 osf4;
+ __be16 osf5;
+ __be32 osf6;
+ __be32 osf7;
+ __be32 reserved;
+};
struct utp_upiu_cmd {
__be32 exp_data_transfer_len;
__u8 cdb[UFS_CDB_SIZE];
@@ -49,13 +75,36 @@
struct utp_upiu_query uc;
};
};
+struct ufs_arpmb_meta {
+ __be16 req_resp_type;
+ __u8 nonce[16];
+ __be32 write_counter;
+ __be16 addr_lun;
+ __be16 block_count;
+ __be16 result;
+} __attribute__((__packed__));
+struct ufs_ehs {
+ __u8 length;
+ __u8 ehs_type;
+ __be16 ehssub_type;
+ struct ufs_arpmb_meta meta;
+ __u8 mac_key[32];
+} __attribute__((__packed__));
struct ufs_bsg_request {
__u32 msgcode;
struct utp_upiu_req upiu_req;
};
struct ufs_bsg_reply {
- __u32 result;
+ int result;
__u32 reply_payload_rcv_len;
struct utp_upiu_req upiu_rsp;
};
+struct ufs_rpmb_request {
+ struct ufs_bsg_request bsg_request;
+ struct ufs_ehs ehs_req;
+};
+struct ufs_rpmb_reply {
+ struct ufs_bsg_reply bsg_reply;
+ struct ufs_ehs ehs_rsp;
+};
#endif
diff --git a/libc/kernel/uapi/sound/asequencer.h b/libc/kernel/uapi/sound/asequencer.h
index 01a5058..e90e812 100644
--- a/libc/kernel/uapi/sound/asequencer.h
+++ b/libc/kernel/uapi/sound/asequencer.h
@@ -19,7 +19,7 @@
#ifndef _UAPI__SOUND_ASEQUENCER_H
#define _UAPI__SOUND_ASEQUENCER_H
#include <sound/asound.h>
-#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 2)
+#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 3)
#define SNDRV_SEQ_EVENT_SYSTEM 0
#define SNDRV_SEQ_EVENT_RESULT 1
#define SNDRV_SEQ_EVENT_NOTE 5
@@ -106,6 +106,7 @@
#define SNDRV_SEQ_PRIORITY_NORMAL (0 << 4)
#define SNDRV_SEQ_PRIORITY_HIGH (1 << 4)
#define SNDRV_SEQ_PRIORITY_MASK (1 << 4)
+#define SNDRV_SEQ_EVENT_UMP (1 << 5)
struct snd_seq_ev_note {
unsigned char channel;
unsigned char note;
@@ -163,6 +164,19 @@
unsigned short value;
struct snd_seq_event * event;
} __attribute__((packed));
+union snd_seq_event_data {
+ struct snd_seq_ev_note note;
+ struct snd_seq_ev_ctrl control;
+ struct snd_seq_ev_raw8 raw8;
+ struct snd_seq_ev_raw32 raw32;
+ struct snd_seq_ev_ext ext;
+ struct snd_seq_ev_queue_control queue;
+ union snd_seq_timestamp time;
+ struct snd_seq_addr addr;
+ struct snd_seq_connect connect;
+ struct snd_seq_result result;
+ struct snd_seq_ev_quote quote;
+};
struct snd_seq_event {
snd_seq_event_type_t type;
unsigned char flags;
@@ -171,19 +185,20 @@
union snd_seq_timestamp time;
struct snd_seq_addr source;
struct snd_seq_addr dest;
+ union snd_seq_event_data data;
+};
+struct snd_seq_ump_event {
+ snd_seq_event_type_t type;
+ unsigned char flags;
+ char tag;
+ unsigned char queue;
+ union snd_seq_timestamp time;
+ struct snd_seq_addr source;
+ struct snd_seq_addr dest;
union {
- struct snd_seq_ev_note note;
- struct snd_seq_ev_ctrl control;
- struct snd_seq_ev_raw8 raw8;
- struct snd_seq_ev_raw32 raw32;
- struct snd_seq_ev_ext ext;
- struct snd_seq_ev_queue_control queue;
- union snd_seq_timestamp time;
- struct snd_seq_addr addr;
- struct snd_seq_connect connect;
- struct snd_seq_result result;
- struct snd_seq_ev_quote quote;
- } data;
+ union snd_seq_event_data data;
+ unsigned int ump[4];
+ };
};
struct snd_seq_event_bounce {
int err;
@@ -215,6 +230,7 @@
#define SNDRV_SEQ_FILTER_BROADCAST (1U << 0)
#define SNDRV_SEQ_FILTER_MULTICAST (1U << 1)
#define SNDRV_SEQ_FILTER_BOUNCE (1U << 2)
+#define SNDRV_SEQ_FILTER_NO_CONVERT (1U << 30)
#define SNDRV_SEQ_FILTER_USE_EVENT (1U << 31)
struct snd_seq_client_info {
int client;
@@ -227,8 +243,13 @@
int event_lost;
int card;
int pid;
- char reserved[56];
+ unsigned int midi_version;
+ unsigned int group_filter;
+ char reserved[48];
};
+#define SNDRV_SEQ_CLIENT_LEGACY_MIDI 0
+#define SNDRV_SEQ_CLIENT_UMP_MIDI_1_0 1
+#define SNDRV_SEQ_CLIENT_UMP_MIDI_2_0 2
struct snd_seq_client_pool {
int client;
int output_pool;
@@ -268,6 +289,8 @@
#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1 << 5)
#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1 << 6)
#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1 << 7)
+#define SNDRV_SEQ_PORT_CAP_INACTIVE (1 << 8)
+#define SNDRV_SEQ_PORT_CAP_UMP_ENDPOINT (1 << 9)
#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1 << 0)
#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1 << 1)
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1 << 2)
@@ -275,6 +298,7 @@
#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1 << 4)
#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1 << 5)
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1 << 6)
+#define SNDRV_SEQ_PORT_TYPE_MIDI_UMP (1 << 7)
#define SNDRV_SEQ_PORT_TYPE_SYNTH (1 << 10)
#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1 << 11)
#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1 << 12)
@@ -286,6 +310,10 @@
#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1 << 0)
#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1 << 1)
#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1 << 2)
+#define SNDRV_SEQ_PORT_DIR_UNKNOWN 0
+#define SNDRV_SEQ_PORT_DIR_INPUT 1
+#define SNDRV_SEQ_PORT_DIR_OUTPUT 2
+#define SNDRV_SEQ_PORT_DIR_BIDIRECTION 3
struct snd_seq_port_info {
struct snd_seq_addr addr;
char name[64];
@@ -299,7 +327,9 @@
void * kernel;
unsigned int flags;
unsigned char time_queue;
- char reserved[59];
+ unsigned char direction;
+ unsigned char ump_group;
+ char reserved[57];
};
#define SNDRV_SEQ_QUEUE_FLG_SYNC (1 << 0)
struct snd_seq_queue_info {
@@ -371,12 +401,22 @@
unsigned int flags;
char reserved[64];
};
+#define SNDRV_SEQ_CLIENT_UMP_INFO_ENDPOINT 0
+#define SNDRV_SEQ_CLIENT_UMP_INFO_BLOCK 1
+struct snd_seq_client_ump_info {
+ int client;
+ int type;
+ unsigned char info[512];
+} __attribute__((__packed__));
#define SNDRV_SEQ_IOCTL_PVERSION _IOR('S', 0x00, int)
#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR('S', 0x01, int)
#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
+#define SNDRV_SEQ_IOCTL_USER_PVERSION _IOW('S', 0x04, int)
#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW('S', 0x11, struct snd_seq_client_info)
+#define SNDRV_SEQ_IOCTL_GET_CLIENT_UMP_INFO _IOWR('S', 0x12, struct snd_seq_client_ump_info)
+#define SNDRV_SEQ_IOCTL_SET_CLIENT_UMP_INFO _IOWR('S', 0x13, struct snd_seq_client_ump_info)
#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW('S', 0x21, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
diff --git a/libc/kernel/uapi/sound/asoc.h b/libc/kernel/uapi/sound/asoc.h
index 1940e5d..b156267 100644
--- a/libc/kernel/uapi/sound/asoc.h
+++ b/libc/kernel/uapi/sound/asoc.h
@@ -149,9 +149,9 @@
__le32 type;
__le32 num_elems;
union {
- struct snd_soc_tplg_vendor_uuid_elem uuid[0];
- struct snd_soc_tplg_vendor_value_elem value[0];
- struct snd_soc_tplg_vendor_string_elem string[0];
+ __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_uuid_elem, uuid);
+ __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_value_elem, value);
+ __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_string_elem, string);
};
} __attribute__((packed));
struct snd_soc_tplg_private {
diff --git a/libc/kernel/uapi/sound/asound.h b/libc/kernel/uapi/sound/asound.h
index 9c1a3ae..ee75e7d 100644
--- a/libc/kernel/uapi/sound/asound.h
+++ b/libc/kernel/uapi/sound/asound.h
@@ -219,6 +219,7 @@
#define SNDRV_PCM_INFO_DOUBLE 0x00000004
#define SNDRV_PCM_INFO_BATCH 0x00000010
#define SNDRV_PCM_INFO_SYNC_APPLPTR 0x00000020
+#define SNDRV_PCM_INFO_PERFECT_DRAIN 0x00000040
#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100
#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200
#define SNDRV_PCM_INFO_COMPLEX 0x00000400
@@ -310,6 +311,7 @@
#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1 << 0)
#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1 << 1)
#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1 << 2)
+#define SNDRV_PCM_HW_PARAMS_NO_DRAIN_SILENCE (1 << 3)
struct snd_interval {
unsigned int min, max;
unsigned int openmin : 1, openmax : 1, integer : 1, empty : 1;
@@ -565,7 +567,7 @@
#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
-#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2)
+#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4)
enum {
SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
SNDRV_RAWMIDI_STREAM_INPUT,
@@ -574,6 +576,7 @@
#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
+#define SNDRV_RAWMIDI_INFO_UMP 0x00000008
struct snd_rawmidi_info {
unsigned int device;
unsigned int subdevice;
@@ -622,6 +625,56 @@
size_t xruns;
unsigned char reserved[16];
};
+#define SNDRV_UMP_EP_INFO_STATIC_BLOCKS 0x01
+#define SNDRV_UMP_EP_INFO_PROTO_MIDI_MASK 0x0300
+#define SNDRV_UMP_EP_INFO_PROTO_MIDI1 0x0100
+#define SNDRV_UMP_EP_INFO_PROTO_MIDI2 0x0200
+#define SNDRV_UMP_EP_INFO_PROTO_JRTS_MASK 0x0003
+#define SNDRV_UMP_EP_INFO_PROTO_JRTS_TX 0x0001
+#define SNDRV_UMP_EP_INFO_PROTO_JRTS_RX 0x0002
+struct snd_ump_endpoint_info {
+ int card;
+ int device;
+ unsigned int flags;
+ unsigned int protocol_caps;
+ unsigned int protocol;
+ unsigned int num_blocks;
+ unsigned short version;
+ unsigned short family_id;
+ unsigned short model_id;
+ unsigned int manufacturer_id;
+ unsigned char sw_revision[4];
+ unsigned short padding;
+ unsigned char name[128];
+ unsigned char product_id[128];
+ unsigned char reserved[32];
+} __attribute__((__packed__));
+#define SNDRV_UMP_DIR_INPUT 0x01
+#define SNDRV_UMP_DIR_OUTPUT 0x02
+#define SNDRV_UMP_DIR_BIDIRECTION 0x03
+#define SNDRV_UMP_BLOCK_IS_MIDI1 (1U << 0)
+#define SNDRV_UMP_BLOCK_IS_LOWSPEED (1U << 1)
+#define SNDRV_UMP_BLOCK_UI_HINT_UNKNOWN 0x00
+#define SNDRV_UMP_BLOCK_UI_HINT_RECEIVER 0x01
+#define SNDRV_UMP_BLOCK_UI_HINT_SENDER 0x02
+#define SNDRV_UMP_BLOCK_UI_HINT_BOTH 0x03
+#define SNDRV_UMP_MAX_GROUPS 16
+#define SNDRV_UMP_MAX_BLOCKS 32
+struct snd_ump_block_info {
+ int card;
+ int device;
+ unsigned char block_id;
+ unsigned char direction;
+ unsigned char active;
+ unsigned char first_group;
+ unsigned char num_groups;
+ unsigned char midi_ci_version;
+ unsigned char sysex8_streams;
+ unsigned char ui_hint;
+ unsigned int flags;
+ unsigned char name[128];
+ unsigned char reserved[32];
+} __attribute__((__packed__));
#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
#define SNDRV_RAWMIDI_IOCTL_USER_PVERSION _IOW('W', 0x02, int)
@@ -629,6 +682,8 @@
#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
+#define SNDRV_UMP_IOCTL_ENDPOINT_INFO _IOR('W', 0x40, struct snd_ump_endpoint_info)
+#define SNDRV_UMP_IOCTL_BLOCK_INFO _IOR('W', 0x41, struct snd_ump_block_info)
#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
enum {
SNDRV_TIMER_CLASS_NONE = - 1,
@@ -763,7 +818,7 @@
unsigned int val;
__time_pad pad2;
};
-#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)
+#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9)
struct snd_ctl_card_info {
int card;
int pad;
@@ -909,6 +964,9 @@
#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
+#define SNDRV_CTL_IOCTL_UMP_NEXT_DEVICE _IOWR('U', 0x43, int)
+#define SNDRV_CTL_IOCTL_UMP_ENDPOINT_INFO _IOWR('U', 0x44, struct snd_ump_endpoint_info)
+#define SNDRV_CTL_IOCTL_UMP_BLOCK_INFO _IOWR('U', 0x45, struct snd_ump_block_info)
#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
enum sndrv_ctl_event_type {
diff --git a/libc/kernel/uapi/sound/emu10k1.h b/libc/kernel/uapi/sound/emu10k1.h
index 483309e..dbf0eeb 100644
--- a/libc/kernel/uapi/sound/emu10k1.h
+++ b/libc/kernel/uapi/sound/emu10k1.h
@@ -21,8 +21,6 @@
#ifdef __linux__
#include <linux/types.h>
#endif
-#define EMU10K1_CARD_CREATIVE 0x00000000
-#define EMU10K1_CARD_EMUAPS 0x00000001
#define EMU10K1_FX8010_PCM_COUNT 8
#define __EMU10K1_DECLARE_BITMAP(name,bits) unsigned long name[(bits) / (sizeof(unsigned long) * 8)]
#define iMAC0 0x00
@@ -41,10 +39,29 @@
#define iEXP 0x0d
#define iINTERP 0x0e
#define iSKIP 0x0f
+#define LOWORD_OPX_MASK 0x000ffc00
+#define LOWORD_OPY_MASK 0x000003ff
+#define HIWORD_OPCODE_MASK 0x00f00000
+#define HIWORD_RESULT_MASK 0x000ffc00
+#define HIWORD_OPA_MASK 0x000003ff
+#define A_LOWORD_OPX_MASK 0x007ff000
+#define A_LOWORD_OPY_MASK 0x000007ff
+#define A_HIWORD_OPCODE_MASK 0x0f000000
+#define A_HIWORD_RESULT_MASK 0x007ff000
+#define A_HIWORD_OPA_MASK 0x000007ff
#define FXBUS(x) (0x00 + (x))
#define EXTIN(x) (0x10 + (x))
#define EXTOUT(x) (0x20 + (x))
#define FXBUS2(x) (0x30 + (x))
+#define A_FXBUS(x) (0x00 + (x))
+#define A_EXTIN(x) (0x40 + (x))
+#define A_P16VIN(x) (0x50 + (x))
+#define A_EXTOUT(x) (0x60 + (x))
+#define A_FXBUS2(x) (0x80 + (x))
+#define A_EMU32OUTH(x) (0xa0 + (x))
+#define A_EMU32OUTL(x) (0xb0 + (x))
+#define A3_EMU32IN(x) (0x160 + (x))
+#define A3_EMU32OUT(x) (0x1E0 + (x))
#define C_00000000 0x40
#define C_00000001 0x41
#define C_00000002 0x42
@@ -73,33 +90,71 @@
#define GPR_NOISE1 0x59
#define GPR_IRQ 0x5a
#define GPR_DBAC 0x5b
+#define A_C_00000000 0xc0
+#define A_C_00000001 0xc1
+#define A_C_00000002 0xc2
+#define A_C_00000003 0xc3
+#define A_C_00000004 0xc4
+#define A_C_00000008 0xc5
+#define A_C_00000010 0xc6
+#define A_C_00000020 0xc7
+#define A_C_00000100 0xc8
+#define A_C_00010000 0xc9
+#define A_C_00000800 0xca
+#define A_C_10000000 0xcb
+#define A_C_20000000 0xcc
+#define A_C_40000000 0xcd
+#define A_C_80000000 0xce
+#define A_C_7fffffff 0xcf
+#define A_C_ffffffff 0xd0
+#define A_C_fffffffe 0xd1
+#define A_C_c0000000 0xd2
+#define A_C_4f1bbcdc 0xd3
+#define A_C_5a7ef9db 0xd4
+#define A_C_00100000 0xd5
+#define A_GPR_ACCU 0xd6
+#define A_GPR_COND 0xd7
+#define A_GPR_NOISE0 0xd8
+#define A_GPR_NOISE1 0xd9
+#define A_GPR_IRQ 0xda
+#define A_GPR_DBAC 0xdb
+#define A_GPR_DBACE 0xde
+#define FXGPREGBASE 0x100
+#define A_FXGPREGBASE 0x400
+#define A_TANKMEMCTLREGBASE 0x100
+#define A_TANKMEMCTLREG_MASK 0x1f
+#define TANKMEMDATAREGBASE 0x200
+#define TANKMEMDATAREG_MASK 0x000fffff
+#define TANKMEMADDRREGBASE 0x300
+#define TANKMEMADDRREG_ADDR_MASK 0x000fffff
+#define TANKMEMADDRREG_CLEAR 0x00800000
+#define TANKMEMADDRREG_ALIGN 0x00400000
+#define TANKMEMADDRREG_WRITE 0x00200000
+#define TANKMEMADDRREG_READ 0x00100000
#define GPR(x) (FXGPREGBASE + (x))
#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x))
#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x))
#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x))
#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x))
+#define A_GPR(x) (A_FXGPREGBASE + (x))
#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x))
#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x))
#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x))
#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x))
#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x))
#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x))
-#define A_FXBUS(x) (0x00 + (x))
-#define A_EXTIN(x) (0x40 + (x))
-#define A_P16VIN(x) (0x50 + (x))
-#define A_EXTOUT(x) (0x60 + (x))
-#define A_FXBUS2(x) (0x80 + (x))
-#define A_EMU32OUTH(x) (0xa0 + (x))
-#define A_EMU32OUTL(x) (0xb0 + (x))
-#define A3_EMU32IN(x) (0x160 + (x))
-#define A3_EMU32OUT(x) (0x1E0 + (x))
-#define A_GPR(x) (A_FXGPREGBASE + (x))
#define CC_REG_NORMALIZED C_00000001
#define CC_REG_BORROW C_00000002
#define CC_REG_MINUS C_00000004
#define CC_REG_ZERO C_00000008
#define CC_REG_SATURATE C_00000010
#define CC_REG_NONZERO C_00000100
+#define A_CC_REG_NORMALIZED A_C_00000001
+#define A_CC_REG_BORROW A_C_00000002
+#define A_CC_REG_MINUS A_C_00000004
+#define A_CC_REG_ZERO A_C_00000008
+#define A_CC_REG_SATURATE A_C_00000010
+#define A_CC_REG_NONZERO A_C_00000100
#define FXBUS_PCM_LEFT 0x00
#define FXBUS_PCM_RIGHT 0x01
#define FXBUS_PCM_LEFT_REAR 0x02
@@ -180,35 +235,6 @@
#define A_EXTOUT_ADC_CAP_L 0x16
#define A_EXTOUT_ADC_CAP_R 0x17
#define A_EXTOUT_MIC_CAP 0x18
-#define A_C_00000000 0xc0
-#define A_C_00000001 0xc1
-#define A_C_00000002 0xc2
-#define A_C_00000003 0xc3
-#define A_C_00000004 0xc4
-#define A_C_00000008 0xc5
-#define A_C_00000010 0xc6
-#define A_C_00000020 0xc7
-#define A_C_00000100 0xc8
-#define A_C_00010000 0xc9
-#define A_C_00000800 0xca
-#define A_C_10000000 0xcb
-#define A_C_20000000 0xcc
-#define A_C_40000000 0xcd
-#define A_C_80000000 0xce
-#define A_C_7fffffff 0xcf
-#define A_C_ffffffff 0xd0
-#define A_C_fffffffe 0xd1
-#define A_C_c0000000 0xd2
-#define A_C_4f1bbcdc 0xd3
-#define A_C_5a7ef9db 0xd4
-#define A_C_00100000 0xd5
-#define A_GPR_ACCU 0xd6
-#define A_GPR_COND 0xd7
-#define A_GPR_NOISE0 0xd8
-#define A_GPR_NOISE1 0xd9
-#define A_GPR_IRQ 0xda
-#define A_GPR_DBAC 0xdb
-#define A_GPR_DBACE 0xde
#define EMU10K1_DBG_ZC 0x80000000
#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000
#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000
@@ -216,11 +242,13 @@
#define EMU10K1_DBG_STEP 0x00004000
#define EMU10K1_DBG_CONDITION_CODE 0x00003e00
#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff
-#define TANKMEMADDRREG_ADDR_MASK 0x000fffff
-#define TANKMEMADDRREG_CLEAR 0x00800000
-#define TANKMEMADDRREG_ALIGN 0x00400000
-#define TANKMEMADDRREG_WRITE 0x00200000
-#define TANKMEMADDRREG_READ 0x00100000
+#define A_DBG_ZC 0x40000000
+#define A_DBG_SATURATION_OCCURED 0x20000000
+#define A_DBG_SATURATION_ADDR 0x0ffc0000
+#define A_DBG_SINGLE_STEP 0x00020000
+#define A_DBG_STEP 0x00010000
+#define A_DBG_CONDITION_CODE 0x0000f800
+#define A_DBG_STEP_ADDR 0x000003ff
struct snd_emu10k1_fx8010_info {
unsigned int internal_tram_size;
unsigned int external_tram_size;
@@ -234,6 +262,8 @@
#define EMU10K1_GPR_TRANSLATION_BASS 2
#define EMU10K1_GPR_TRANSLATION_TREBLE 3
#define EMU10K1_GPR_TRANSLATION_ONOFF 4
+#define EMU10K1_GPR_TRANSLATION_NEGATE 5
+#define EMU10K1_GPR_TRANSLATION_NEG_TABLE100 6
enum emu10k1_ctl_elem_iface {
EMU10K1_CTL_ELEM_IFACE_MIXER = 2,
EMU10K1_CTL_ELEM_IFACE_PCM = 3,
@@ -251,9 +281,9 @@
unsigned int vcount;
unsigned int count;
unsigned short gpr[32];
- unsigned int value[32];
- unsigned int min;
- unsigned int max;
+ int value[32];
+ int min;
+ int max;
unsigned int translation;
const unsigned int * tlv;
};
diff --git a/libc/kernel/uapi/sound/firewire.h b/libc/kernel/uapi/sound/firewire.h
index d26d722..cc13cb9 100644
--- a/libc/kernel/uapi/sound/firewire.h
+++ b/libc/kernel/uapi/sound/firewire.h
@@ -27,6 +27,7 @@
#define SNDRV_FIREWIRE_EVENT_MOTU_NOTIFICATION 0x64776479
#define SNDRV_FIREWIRE_EVENT_TASCAM_CONTROL 0x7473636d
#define SNDRV_FIREWIRE_EVENT_MOTU_REGISTER_DSP_CHANGE 0x4d545244
+#define SNDRV_FIREWIRE_EVENT_FF400_MESSAGE 0x4f6c6761
struct snd_firewire_event_common {
unsigned int type;
};
@@ -74,6 +75,14 @@
__u32 count;
__u32 changes[];
};
+struct snd_firewire_event_ff400_message {
+ unsigned int type;
+ unsigned int message_count;
+ struct {
+ __u32 message;
+ __u32 tstamp;
+ } messages[];
+};
union snd_firewire_event {
struct snd_firewire_event_common common;
struct snd_firewire_event_lock_status lock_status;
@@ -83,6 +92,7 @@
struct snd_firewire_event_tascam_control tascam_control;
struct snd_firewire_event_motu_notification motu_notification;
struct snd_firewire_event_motu_register_dsp_change motu_register_dsp_change;
+ struct snd_firewire_event_ff400_message ff400_message;
};
#define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
#define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
diff --git a/libc/kernel/uapi/sound/intel/avs/tokens.h b/libc/kernel/uapi/sound/intel/avs/tokens.h
index b6b3002..d524278 100644
--- a/libc/kernel/uapi/sound/intel/avs/tokens.h
+++ b/libc/kernel/uapi/sound/intel/avs/tokens.h
@@ -100,6 +100,7 @@
AVS_TKN_MOD_CORE_ID_U8 = 1704,
AVS_TKN_MOD_PROC_DOMAIN_U8 = 1705,
AVS_TKN_MOD_MODCFG_EXT_ID_U32 = 1706,
+ AVS_TKN_MOD_KCONTROL_ID_U32 = 1707,
AVS_TKN_PATH_TMPL_ID_U32 = 1801,
AVS_TKN_PATH_ID_U32 = 1901,
AVS_TKN_PATH_FE_FMT_ID_U32 = 1902,
@@ -107,5 +108,6 @@
AVS_TKN_PIN_FMT_INDEX_U32 = 2201,
AVS_TKN_PIN_FMT_IOBS_U32 = 2202,
AVS_TKN_PIN_FMT_AFMT_ID_U32 = 2203,
+ AVS_TKN_KCONTROL_ID_U32 = 2301,
};
#endif
diff --git a/libc/kernel/uapi/sound/skl-tplg-interface.h b/libc/kernel/uapi/sound/skl-tplg-interface.h
index 6dd9655..ff3d42a 100644
--- a/libc/kernel/uapi/sound/skl-tplg-interface.h
+++ b/libc/kernel/uapi/sound/skl-tplg-interface.h
@@ -47,7 +47,8 @@
SKL_CH_CFG_DUAL_MONO = 9,
SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10,
SKL_CH_CFG_I2S_DUAL_STEREO_1 = 11,
- SKL_CH_CFG_4_CHANNEL = 12,
+ SKL_CH_CFG_7_1 = 12,
+ SKL_CH_CFG_4_CHANNEL = SKL_CH_CFG_7_1,
SKL_CH_CFG_INVALID
};
enum skl_module_type {
diff --git a/libc/kernel/uapi/sound/sof/abi.h b/libc/kernel/uapi/sound/sof/abi.h
index dc4e525..a4844d6 100644
--- a/libc/kernel/uapi/sound/sof/abi.h
+++ b/libc/kernel/uapi/sound/sof/abi.h
@@ -35,4 +35,5 @@
#define SOF_ABI_VERSION_INCOMPATIBLE(sof_ver,client_ver) (SOF_ABI_VERSION_MAJOR((sof_ver)) != SOF_ABI_VERSION_MAJOR((client_ver)))
#define SOF_ABI_VERSION SOF_ABI_VER(SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_PATCH)
#define SOF_ABI_MAGIC 0x00464F53
+#define SOF_IPC4_ABI_MAGIC 0x34464F53
#endif
diff --git a/libc/kernel/uapi/sound/sof/tokens.h b/libc/kernel/uapi/sound/sof/tokens.h
index 3726546..48ef360 100644
--- a/libc/kernel/uapi/sound/sof/tokens.h
+++ b/libc/kernel/uapi/sound/sof/tokens.h
@@ -39,6 +39,7 @@
#define SOF_TKN_SCHED_DYNAMIC_PIPELINE 206
#define SOF_TKN_SCHED_LP_MODE 207
#define SOF_TKN_SCHED_MEM_USAGE 208
+#define SOF_TKN_SCHED_USE_CHAIN_DMA 209
#define SOF_TKN_VOLUME_RAMP_STEP_TYPE 250
#define SOF_TKN_VOLUME_RAMP_STEP_MS 251
#define SOF_TKN_GAIN_RAMP_TYPE 260
@@ -59,10 +60,12 @@
#define SOF_TKN_COMP_CPC 406
#define SOF_TKN_COMP_IS_PAGES 409
#define SOF_TKN_COMP_NUM_AUDIO_FORMATS 410
-#define SOF_TKN_COMP_NUM_SINK_PINS 411
-#define SOF_TKN_COMP_NUM_SOURCE_PINS 412
-#define SOF_TKN_COMP_SINK_PIN_BINDING_WNAME 413
-#define SOF_TKN_COMP_SRC_PIN_BINDING_WNAME 414
+#define SOF_TKN_COMP_NUM_INPUT_PINS 411
+#define SOF_TKN_COMP_NUM_OUTPUT_PINS 412
+#define SOF_TKN_COMP_INPUT_PIN_BINDING_WNAME 413
+#define SOF_TKN_COMP_OUTPUT_PIN_BINDING_WNAME 414
+#define SOF_TKN_COMP_NUM_INPUT_AUDIO_FORMATS 415
+#define SOF_TKN_COMP_NUM_OUTPUT_AUDIO_FORMATS 416
#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
#define SOF_TKN_INTEL_SSP_MCLK_ID 501
#define SOF_TKN_INTEL_SSP_SAMPLE_BITS 502
@@ -107,26 +110,29 @@
#define SOF_TKN_AMD_ACPDMIC_CH 1801
#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_RATE 1900
#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_BIT_DEPTH 1901
-#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_VALID_BIT 1902
+#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_VALID_BIT_DEPTH 1902
#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_CHANNELS 1903
#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_CH_MAP 1904
#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_CH_CFG 1905
#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_INTERLEAVING_STYLE 1906
#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_FMT_CFG 1907
#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_SAMPLE_TYPE 1908
+#define SOF_TKN_CAVS_AUDIO_FORMAT_INPUT_PIN_INDEX 1909
#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_RATE 1930
#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_BIT_DEPTH 1931
-#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_VALID_BIT 1932
+#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_VALID_BIT_DEPTH 1932
#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CHANNELS 1933
#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CH_MAP 1934
#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CH_CFG 1935
#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_INTERLEAVING_STYLE 1936
#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_FMT_CFG 1937
#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_SAMPLE_TYPE 1938
+#define SOF_TKN_CAVS_AUDIO_FORMAT_OUTPUT_PIN_INDEX 1939
#define SOF_TKN_CAVS_AUDIO_FORMAT_IBS 1970
#define SOF_TKN_CAVS_AUDIO_FORMAT_OBS 1971
#define SOF_TKN_CAVS_AUDIO_FORMAT_DMA_BUFFER_SIZE 1972
#define SOF_TKN_INTEL_COPIER_NODE_TYPE 1980
+#define SOF_TKN_INTEL_COPIER_DEEP_BUFFER_DMA_MS 1981
#define SOF_TKN_AMD_ACPI2S_RATE 1700
#define SOF_TKN_AMD_ACPI2S_CH 1701
#define SOF_TKN_AMD_ACPI2S_TDM_MODE 1702
diff --git a/libc/kernel/uapi/xen/evtchn.h b/libc/kernel/uapi/xen/evtchn.h
index aa4aaaf..1b27bdb 100644
--- a/libc/kernel/uapi/xen/evtchn.h
+++ b/libc/kernel/uapi/xen/evtchn.h
@@ -43,4 +43,8 @@
struct ioctl_evtchn_restrict_domid {
domid_t domid;
};
+#define IOCTL_EVTCHN_BIND_STATIC _IOC(_IOC_NONE, 'E', 7, sizeof(struct ioctl_evtchn_bind))
+struct ioctl_evtchn_bind {
+ unsigned int port;
+};
#endif
diff --git a/libc/libc.map.txt b/libc/libc.map.txt
index 0102b30..e6ea3c2 100644
--- a/libc/libc.map.txt
+++ b/libc/libc.map.txt
@@ -74,28 +74,28 @@
__memrchr_chk; # introduced=23
__memset_chk; # introduced-arm=17 introduced-arm64=21 introduced-x86=17 introduced-x86_64=21
__mmap2; # arm x86
- __ns_format_ttl; # arm x86
- __ns_get16; # arm x86
- __ns_get32; # arm x86
- __ns_initparse; # arm x86
- __ns_makecanon; # arm x86
- __ns_msg_getflag; # arm x86
- __ns_name_compress; # arm x86
- __ns_name_ntol; # arm x86
- __ns_name_ntop; # arm x86
- __ns_name_pack; # arm x86
- __ns_name_pton; # arm x86
- __ns_name_rollback; # arm x86
- __ns_name_skip; # arm x86
- __ns_name_uncompress; # arm x86
- __ns_name_unpack; # arm x86
- __ns_parserr; # arm x86
- __ns_put16; # arm x86
- __ns_put32; # arm x86
- __ns_samename; # arm x86
- __ns_skiprr; # arm x86
- __ns_sprintrr; # arm x86
- __ns_sprintrrf; # arm x86
+ __ns_format_ttl; # arm x86 introduced=22
+ __ns_get16; # arm x86 introduced=22
+ __ns_get32; # arm x86 introduced=22
+ __ns_initparse; # arm x86 introduced=22
+ __ns_makecanon; # arm x86 introduced=22
+ __ns_msg_getflag; # arm x86 introduced=22
+ __ns_name_compress; # arm x86 introduced=22
+ __ns_name_ntol; # arm x86 introduced=22
+ __ns_name_ntop; # arm x86 introduced=22
+ __ns_name_pack; # arm x86 introduced=22
+ __ns_name_pton; # arm x86 introduced=22
+ __ns_name_rollback; # arm x86 introduced=22
+ __ns_name_skip; # arm x86 introduced=22
+ __ns_name_uncompress; # arm x86 introduced=22
+ __ns_name_unpack; # arm x86 introduced=22
+ __ns_parserr; # arm x86 introduced=22
+ __ns_put16; # arm x86 introduced=22
+ __ns_put32; # arm x86 introduced=22
+ __ns_samename; # arm x86 introduced=22
+ __ns_skiprr; # arm x86 introduced=22
+ __ns_sprintrr; # arm x86 introduced=22
+ __ns_sprintrrf; # arm x86 introduced=22
__open_2; # introduced-arm=17 introduced-arm64=21 introduced-x86=17 introduced-x86_64=21
__openat; # arm x86
__openat_2; # introduced-arm=17 introduced-arm64=21 introduced-x86=17 introduced-x86_64=21
@@ -955,7 +955,7 @@
sigaction;
sigaddset; # introduced=21
sigaltstack;
- sigblock;
+ sigblock; # arm x86 arm64 x86_64
sigdelset; # introduced=21
sigemptyset; # introduced=21
sigfillset; # introduced=21
@@ -968,7 +968,7 @@
sigprocmask;
sigqueue; # introduced=23
sigsetjmp; # introduced-arm=9 introduced-arm64=21 introduced-x86=12 introduced-x86_64=21
- sigsetmask;
+ sigsetmask; # arm x86 arm64 x86_64
sigsuspend;
sigtimedwait; # introduced=23
sigwait;
@@ -1586,7 +1586,19 @@
LIBC_V { # introduced=VanillaIceCream
global:
+ epoll_pwait2;
+ epoll_pwait2_64;
+ localtime_rz;
+ mbsrtowcs_l;
+ mktime_z;
+ __riscv_flush_icache; # riscv64
+ __riscv_hwprobe; # riscv64
+ tcgetwinsize;
+ tcsetwinsize;
timespec_getres;
+ tzalloc;
+ tzfree;
+ wcsrtombs_l;
} LIBC_U;
LIBC_PRIVATE {
diff --git a/libc/malloc_debug/Android.bp b/libc/malloc_debug/Android.bp
index 373d497..24bb18a 100644
--- a/libc/malloc_debug/Android.bp
+++ b/libc/malloc_debug/Android.bp
@@ -197,4 +197,5 @@
"-O0",
],
test_suites: ["general-tests"],
+ test_config: "tests/AndroidTest.xml",
}
diff --git a/libc/malloc_debug/tests/AndroidTest.xml b/libc/malloc_debug/tests/AndroidTest.xml
new file mode 100644
index 0000000..c89cbb5
--- /dev/null
+++ b/libc/malloc_debug/tests/AndroidTest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 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.
+-->
+<configuration description="Runs malloc_debug_system_tests.">
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-suite-tag" value="apct-native" />
+
+ <!-- cannot be autogenerated: b/153565474 -->
+ <target_preparer class="com.android.tradefed.targetprep.RebootTargetPreparer">
+ <!-- flake mitigation, in case device is in bad state-->
+ <option name="pre-reboot" value="true" />
+ <!-- This test can become flaky if there are lots of other tests
+ running at the same time so do this to attempt to run this test
+ as isolated as possible.
+ tests. -->
+ <option name="post-reboot" value="true" />
+ </target_preparer>
+
+ <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
+
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="malloc_debug_system_tests->/data/local/tests/unrestricted/malloc_debug_system_tests" />
+ </target_preparer>
+
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tests/unrestricted/" />
+ <option name="module-name" value="malloc_debug_system_tests" />
+ </test>
+</configuration>
diff --git a/libc/platform/bionic/android_unsafe_frame_pointer_chase.h b/libc/platform/bionic/android_unsafe_frame_pointer_chase.h
index 2b9a32f..406ad92 100644
--- a/libc/platform/bionic/android_unsafe_frame_pointer_chase.h
+++ b/libc/platform/bionic/android_unsafe_frame_pointer_chase.h
@@ -44,4 +44,4 @@
* take stack traces efficiently. Normal applications should use APIs such as libunwindstack or
* _Unwind_Backtrace.
*/
-extern "C" size_t android_unsafe_frame_pointer_chase(uintptr_t* buf, size_t num_entries);
+extern "C" size_t android_unsafe_frame_pointer_chase(uintptr_t* _Nonnull buf, size_t num_entries);
diff --git a/libc/platform/bionic/fdtrack.h b/libc/platform/bionic/fdtrack.h
index fe6ca84..7fc304a 100644
--- a/libc/platform/bionic/fdtrack.h
+++ b/libc/platform/bionic/fdtrack.h
@@ -43,6 +43,8 @@
ANDROID_FDTRACK_EVENT_TYPE_CLOSE,
};
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnullability-completeness"
struct android_fdtrack_event {
// File descriptor for which this event occurred.
int fd;
@@ -57,12 +59,15 @@
} create;
} data;
};
+#pragma clang diagnostic pop
// Callback invoked upon file descriptor creation/closure.
-typedef void (*android_fdtrack_hook_t)(struct android_fdtrack_event*);
+typedef void (*_Nullable android_fdtrack_hook_t)(struct android_fdtrack_event* _Nullable);
// Register a hook which is called to track fd lifecycle events.
-bool android_fdtrack_compare_exchange_hook(android_fdtrack_hook_t* expected, android_fdtrack_hook_t value) __INTRODUCED_IN(30);
+// Set value to null to disable tracking.
+bool android_fdtrack_compare_exchange_hook(android_fdtrack_hook_t* _Nonnull expected,
+ android_fdtrack_hook_t value) __INTRODUCED_IN(30);
// Enable/disable fdtrack *on the current thread*.
// This is primarily useful when performing operations which you don't want to track
diff --git a/libc/platform/bionic/macros.h b/libc/platform/bionic/macros.h
index 9e13e0d..93268c1 100644
--- a/libc/platform/bionic/macros.h
+++ b/libc/platform/bionic/macros.h
@@ -40,12 +40,12 @@
}
template <typename T>
-static inline T* align_down(T* p, size_t align) {
+static inline T* _Nonnull align_down(T* _Nonnull p, size_t align) {
return reinterpret_cast<T*>(align_down(reinterpret_cast<uintptr_t>(p), align));
}
template <typename T>
-static inline T* align_up(T* p, size_t align) {
+static inline T* _Nonnull align_up(T* _Nonnull p, size_t align) {
return reinterpret_cast<T*>(align_up(reinterpret_cast<uintptr_t>(p), align));
}
@@ -94,6 +94,6 @@
}
template <typename T>
-static inline T* untag_address(T* p) {
+static inline T* _Nonnull untag_address(T* _Nonnull p) {
return reinterpret_cast<T*>(untag_address(reinterpret_cast<uintptr_t>(p)));
}
diff --git a/libc/platform/bionic/malloc.h b/libc/platform/bionic/malloc.h
index 3c290fc..0a6546e 100644
--- a/libc/platform/bionic/malloc.h
+++ b/libc/platform/bionic/malloc.h
@@ -33,7 +33,8 @@
#include <stdint.h>
// Structures for android_mallopt.
-
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnullability-completeness"
typedef struct {
// Pointer to the buffer allocated by a call to M_GET_MALLOC_LEAK_INFO.
uint8_t* buffer;
@@ -47,7 +48,7 @@
// The maximum number of backtrace entries.
size_t backtrace_size;
} android_mallopt_leak_info_t;
-
+#pragma clang diagnostic pop
// Opcodes for android_mallopt.
enum {
@@ -105,6 +106,8 @@
#define M_MEMTAG_STACK_IS_ON M_MEMTAG_STACK_IS_ON
};
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnullability-completeness"
typedef struct {
// The null-terminated name that the zygote is spawning. Because native
// SpecializeCommon (where the GWP-ASan mallopt() is called from) happens
@@ -147,9 +150,9 @@
Action desire = DONT_TURN_ON_UNLESS_OVERRIDDEN;
} android_mallopt_gwp_asan_options_t;
-
+#pragma clang diagnostic pop
// Manipulates bionic-specific handling of memory allocation APIs such as
// malloc. Only for use by the Android platform and APEXes.
//
// On success, returns true. On failure, returns false and sets errno.
-extern "C" bool android_mallopt(int opcode, void* arg, size_t arg_size);
+extern "C" bool android_mallopt(int opcode, void* _Nullable arg, size_t arg_size);
diff --git a/libc/platform/bionic/page.h b/libc/platform/bionic/page.h
index d063a98..65faba4 100644
--- a/libc/platform/bionic/page.h
+++ b/libc/platform/bionic/page.h
@@ -16,15 +16,42 @@
#pragma once
-// Get PAGE_SIZE and PAGE_MASK.
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/auxv.h>
+
+// For PAGE_SIZE.
#include <sys/user.h>
+inline size_t page_size() {
+#if defined(PAGE_SIZE)
+ return PAGE_SIZE;
+#else
+ static const size_t page_size = getauxval(AT_PAGESZ);
+ return page_size;
+#endif
+}
+
+constexpr size_t max_page_size() {
+#if defined(PAGE_SIZE)
+ return PAGE_SIZE;
+#else
+ return 65536;
+#endif
+}
+
// Returns the address of the page containing address 'x'.
-#define PAGE_START(x) ((x) & PAGE_MASK)
+inline uintptr_t page_start(uintptr_t x) {
+ return x & ~(page_size() - 1);
+}
// Returns the offset of address 'x' in its page.
-#define PAGE_OFFSET(x) ((x) & ~PAGE_MASK)
+inline uintptr_t page_offset(uintptr_t x) {
+ return x & (page_size() - 1);
+}
// Returns the address of the next page after address 'x', unless 'x' is
// itself at the start of a page.
-#define PAGE_END(x) PAGE_START((x) + (PAGE_SIZE-1))
+inline uintptr_t page_end(uintptr_t x) {
+ return page_start(x + page_size() - 1);
+}
diff --git a/libc/platform/scudo_platform_tls_slot.h b/libc/platform/scudo_platform_tls_slot.h
index 9d017c0..a86b828 100644
--- a/libc/platform/scudo_platform_tls_slot.h
+++ b/libc/platform/scudo_platform_tls_slot.h
@@ -30,6 +30,6 @@
#include "bionic/tls.h"
-inline uintptr_t *getPlatformAllocatorTlsSlot() {
+inline uintptr_t* _Nonnull getPlatformAllocatorTlsSlot() {
return reinterpret_cast<uintptr_t*>(&__get_tls()[TLS_SLOT_SANITIZER]);
}
diff --git a/libc/private/CFIShadow.h b/libc/private/CFIShadow.h
index ec87e3c..cbdf0f7 100644
--- a/libc/private/CFIShadow.h
+++ b/libc/private/CFIShadow.h
@@ -68,8 +68,7 @@
#endif
// Shadow is 2 -> 2**kShadowGranularity.
- static constexpr uintptr_t kShadowSize =
- align_up((kMaxTargetAddr >> (kShadowGranularity - 1)), PAGE_SIZE);
+ static constexpr uintptr_t kShadowSize = kMaxTargetAddr >> (kShadowGranularity - 1);
// Returns offset inside the shadow region for an address.
static constexpr uintptr_t MemToShadowOffset(uintptr_t x) {
diff --git a/libc/private/SigSetConverter.h b/libc/private/SigSetConverter.h
index 7d0b215..9e9df73 100644
--- a/libc/private/SigSetConverter.h
+++ b/libc/private/SigSetConverter.h
@@ -28,8 +28,45 @@
#pragma once
-union SigSetConverter {
- int bsd;
- sigset_t sigset;
- sigset64_t sigset64;
+// Android's 32-bit ABI shipped with a sigset_t too small to include any
+// of the realtime signals, so we have both sigset_t and sigset64_t. Many
+// new system calls only accept a sigset64_t, so this helps paper over
+// the difference at zero cost to LP64 in most cases after the optimizer
+// removes the unnecessary temporary `ptr`.
+struct SigSetConverter {
+ public:
+ SigSetConverter(const sigset_t* s) : SigSetConverter(const_cast<sigset_t*>(s)) {}
+
+ SigSetConverter(sigset_t* s) {
+#if defined(__LP64__)
+ // sigset_t == sigset64_t on LP64.
+ ptr = s;
+#else
+ sigset64 = {};
+ if (s != nullptr) {
+ original_ptr = s;
+ sigset = *s;
+ ptr = &sigset64;
+ } else {
+ ptr = nullptr;
+ }
+#endif
+ }
+
+ void copy_out() {
+#if defined(__LP64__)
+ // We used the original pointer directly, so no copy needed.
+#else
+ *original_ptr = sigset;
+#endif
+ }
+
+ sigset64_t* ptr;
+
+ private:
+ [[maybe_unused]] sigset_t* original_ptr;
+ union {
+ sigset_t sigset;
+ sigset64_t sigset64;
+ };
};
diff --git a/libc/private/WriteProtected.h b/libc/private/WriteProtected.h
index 746f72a..2faaf77 100644
--- a/libc/private/WriteProtected.h
+++ b/libc/private/WriteProtected.h
@@ -25,15 +25,16 @@
#include <async_safe/log.h>
#include "platform/bionic/macros.h"
+#include "platform/bionic/page.h"
template <typename T>
union WriteProtectedContents {
T value;
- char padding[PAGE_SIZE];
+ char padding[max_page_size()];
WriteProtectedContents() = default;
BIONIC_DISALLOW_COPY_AND_ASSIGN(WriteProtectedContents);
-} __attribute__((aligned(PAGE_SIZE)));
+} __attribute__((aligned(max_page_size())));
// Write protected wrapper class that aligns its contents to a page boundary,
// and sets the memory protection to be non-writable, except when being modified
@@ -41,8 +42,8 @@
template <typename T>
class WriteProtected {
public:
- static_assert(sizeof(T) < PAGE_SIZE,
- "WriteProtected only supports contents up to PAGE_SIZE");
+ static_assert(sizeof(T) < max_page_size(),
+ "WriteProtected only supports contents up to max_page_size()");
static_assert(__is_pod(T), "WriteProtected only supports POD contents");
WriteProtected() = default;
@@ -80,7 +81,7 @@
// ourselves.
addr = untag_address(addr);
#endif
- if (mprotect(reinterpret_cast<void*>(addr), PAGE_SIZE, prot) == -1) {
+ if (mprotect(reinterpret_cast<void*>(addr), max_page_size(), prot) == -1) {
async_safe_fatal("WriteProtected mprotect %x failed: %s", prot, strerror(errno));
}
}
diff --git a/libc/private/bionic_asm.h b/libc/private/bionic_asm.h
index 78e5046..f9d85b2 100644
--- a/libc/private/bionic_asm.h
+++ b/libc/private/bionic_asm.h
@@ -90,3 +90,5 @@
#define NOTE_GNU_PROPERTY() \
__bionic_asm_custom_note_gnu_section()
+
+#define L(__label) .L##__label
diff --git a/libc/private/bionic_asm_offsets.h b/libc/private/bionic_asm_offsets.h
new file mode 100644
index 0000000..e72adda
--- /dev/null
+++ b/libc/private/bionic_asm_offsets.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+#if defined(__aarch64__)
+#define OFFSETOF_libc_globals_memtag_stack 64
+#endif
diff --git a/libc/private/bionic_constants.h b/libc/private/bionic_constants.h
index d7f4474..05914f4 100644
--- a/libc/private/bionic_constants.h
+++ b/libc/private/bionic_constants.h
@@ -21,7 +21,9 @@
// Size of the shadow call stack. This can be small because these stacks only
// contain return addresses. This must be a power of 2 so the mask trick works.
// See the SCS commentary in pthread_internal.h for more detail.
-#define SCS_SIZE (8 * 1024)
+// SCS_SIZE must be a multiple of page size.
+// We used 8KiB until V but switched to 16KiB in V to experiment with 16KiB pages.
+#define SCS_SIZE (16 * 1024)
#define SCS_MASK (SCS_SIZE - 1)
// The shadow call stack is allocated at an aligned address within a guard region of this size. The
diff --git a/libc/private/bionic_globals.h b/libc/private/bionic_globals.h
index c375cc4..510d556 100644
--- a/libc/private/bionic_globals.h
+++ b/libc/private/bionic_globals.h
@@ -38,6 +38,7 @@
#include "private/WriteProtected.h"
#include "private/bionic_allocator.h"
+#include "private/bionic_asm_offsets.h"
#include "private/bionic_elf_tls.h"
#include "private/bionic_fdsan.h"
#include "private/bionic_malloc_dispatch.h"
@@ -65,6 +66,10 @@
MallocDispatch malloc_dispatch_table;
};
+#ifdef __aarch64__
+static_assert(OFFSETOF_libc_globals_memtag_stack == offsetof(libc_globals, memtag_stack));
+#endif
+
__LIBC_HIDDEN__ extern WriteProtected<libc_globals> __libc_globals;
struct abort_msg_t;
diff --git a/libc/private/bionic_inline_raise.h b/libc/private/bionic_inline_raise.h
index 8565c80..82a564d 100644
--- a/libc/private/bionic_inline_raise.h
+++ b/libc/private/bionic_inline_raise.h
@@ -60,6 +60,13 @@
register long x3 __asm__("x3") = reinterpret_cast<long>(&info);
register long x8 __asm__("x8") = __NR_rt_tgsigqueueinfo;
__asm__("svc #0" : "=r"(x0) : "r"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x8) : "memory");
+#elif defined(__riscv)
+ register long a0 __asm__("a0") = pid;
+ register long a1 __asm__("a1") = tid;
+ register long a2 __asm__("a2") = sig;
+ register long a3 __asm__("a3") = reinterpret_cast<long>(&info);
+ register long a7 __asm__("a7") = __NR_rt_tgsigqueueinfo;
+ __asm__("ecall" : "=r"(a0) : "r"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a7) : "memory");
#elif defined(__x86_64__)
register long rax __asm__("rax") = __NR_rt_tgsigqueueinfo;
register long rdi __asm__("rdi") = pid;
diff --git a/libc/private/bionic_mbstate.h b/libc/private/bionic_mbstate.h
index 243b220..0e5f861 100644
--- a/libc/private/bionic_mbstate.h
+++ b/libc/private/bionic_mbstate.h
@@ -34,15 +34,9 @@
__BEGIN_DECLS
-/*
- * These return values are specified by POSIX for multibyte conversion
- * functions.
- */
-#define __MB_ERR_ILLEGAL_SEQUENCE static_cast<size_t>(-1)
-#define __MB_ERR_INCOMPLETE_SEQUENCE static_cast<size_t>(-2)
-
-#define __MB_IS_ERR(rv) (rv == __MB_ERR_ILLEGAL_SEQUENCE || \
- rv == __MB_ERR_INCOMPLETE_SEQUENCE)
+#define __MB_IS_ERR(rv) \
+ (rv == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE || \
+ rv == BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE)
static inline __wur bool mbstate_is_initial(const mbstate_t* ps) {
return *(reinterpret_cast<const uint32_t*>(ps->__seq)) == 0;
@@ -63,14 +57,18 @@
return ps->__seq[n];
}
-static inline __wur size_t mbstate_reset_and_return_illegal(int _errno, mbstate_t* ps) {
- errno = _errno;
+static inline void mbstate_reset(mbstate_t* ps) {
*(reinterpret_cast<uint32_t*>(ps->__seq)) = 0;
- return __MB_ERR_ILLEGAL_SEQUENCE;
}
-static inline __wur size_t mbstate_reset_and_return(int _return, mbstate_t* ps) {
- *(reinterpret_cast<uint32_t*>(ps->__seq)) = 0;
+static inline __wur size_t mbstate_reset_and_return_illegal(int _errno, mbstate_t* ps) {
+ errno = _errno;
+ mbstate_reset(ps);
+ return BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE;
+}
+
+static inline __wur size_t mbstate_reset_and_return(size_t _return, mbstate_t* ps) {
+ mbstate_reset(ps);
return _return;
}
diff --git a/libc/private/bionic_vdso.h b/libc/private/bionic_vdso.h
index da19b29..406b064 100644
--- a/libc/private/bionic_vdso.h
+++ b/libc/private/bionic_vdso.h
@@ -26,26 +26,23 @@
* SUCH DAMAGE.
*/
-#ifndef _PRIVATE_BIONIC_VDSO_H
-#define _PRIVATE_BIONIC_VDSO_H
-
-#include <time.h>
+#pragma once
#if defined(__aarch64__)
#define VDSO_CLOCK_GETTIME_SYMBOL "__kernel_clock_gettime"
-#define VDSO_CLOCK_GETRES_SYMBOL "__kernel_clock_getres"
-#define VDSO_GETTIMEOFDAY_SYMBOL "__kernel_gettimeofday"
-#define VDSO_TIME_SYMBOL "__kernel_time"
+#define VDSO_CLOCK_GETRES_SYMBOL "__kernel_clock_getres"
+#define VDSO_GETTIMEOFDAY_SYMBOL "__kernel_gettimeofday"
#else
#define VDSO_CLOCK_GETTIME_SYMBOL "__vdso_clock_gettime"
-#define VDSO_CLOCK_GETRES_SYMBOL "__vdso_clock_getres"
-#define VDSO_GETTIMEOFDAY_SYMBOL "__vdso_gettimeofday"
-#define VDSO_TIME_SYMBOL "__vdso_time"
+#define VDSO_CLOCK_GETRES_SYMBOL "__vdso_clock_getres"
+#define VDSO_GETTIMEOFDAY_SYMBOL "__vdso_gettimeofday"
#endif
-
-extern "C" int __clock_gettime(int, timespec*);
-extern "C" int __clock_getres(int, timespec*);
-extern "C" int __gettimeofday(timeval*, struct timezone*);
+#if defined(__riscv)
+#define VDSO_RISCV_HWPROBE_SYMBOL "__vdso_riscv_hwprobe"
+#endif
+#if defined(__i386__) || defined(__x86_64__)
+#define VDSO_TIME_SYMBOL "__vdso_time"
+#endif
struct vdso_entry {
const char* name;
@@ -56,8 +53,11 @@
VDSO_CLOCK_GETTIME = 0,
VDSO_CLOCK_GETRES,
VDSO_GETTIMEOFDAY,
+#if defined(VDSO_TIME_SYMBOL)
VDSO_TIME,
+#endif
+#if defined(VDSO_RISCV_HWPROBE_SYMBOL)
+ VDSO_RISCV_HWPROBE,
+#endif
VDSO_END
};
-
-#endif // _PRIVATE_BIONIC_VDSO_H
diff --git a/libc/private/thread_private.h b/libc/private/thread_private.h
index 1f9eeb6..1a13690 100644
--- a/libc/private/thread_private.h
+++ b/libc/private/thread_private.h
@@ -29,7 +29,6 @@
#define _ARC4_LOCK() _thread_arc4_lock()
#define _ARC4_UNLOCK() _thread_arc4_unlock()
-#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
extern volatile sig_atomic_t _rs_forked;
diff --git a/libc/stdio/local.h b/libc/stdio/local.h
index 2fc12a0..a5eb636 100644
--- a/libc/stdio/local.h
+++ b/libc/stdio/local.h
@@ -290,17 +290,21 @@
#define WCIO_GET(fp) (_EXT(fp) ? &(_EXT(fp)->_wcio) : (struct wchar_io_data*)0)
-#define _SET_ORIENTATION(fp, mode) \
- do { \
- struct wchar_io_data* _wcio = WCIO_GET(fp); \
- if (_wcio && _wcio->wcio_mode == 0) _wcio->wcio_mode = (mode); \
+#define ORIENT_BYTES (-1)
+#define ORIENT_UNKNOWN 0
+#define ORIENT_CHARS 1
+
+#define _SET_ORIENTATION(fp, mode) \
+ do { \
+ struct wchar_io_data* _wcio = WCIO_GET(fp); \
+ if (_wcio && _wcio->wcio_mode == ORIENT_UNKNOWN) _wcio->wcio_mode = (mode); \
} while (0)
#define WCIO_FREE(fp) \
do { \
struct wchar_io_data* _wcio = WCIO_GET(fp); \
if (_wcio) { \
- _wcio->wcio_mode = 0; \
+ _wcio->wcio_mode = ORIENT_UNKNOWN; \
_wcio->wcio_ungetwc_inbuf = 0; \
} \
} while (0)
diff --git a/libc/stdio/scanf_common.h b/libc/stdio/scanf_common.h
new file mode 100644
index 0000000..8132e90
--- /dev/null
+++ b/libc/stdio/scanf_common.h
@@ -0,0 +1,115 @@
+/* $OpenBSD: vfscanf.c,v 1.31 2014/03/19 05:17:01 guenther Exp $ */
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * 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 <ctype.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <locale.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
+#include <wctype.h>
+#include "local.h"
+
+#include <platform/bionic/macros.h>
+#include <private/bionic_fortify.h>
+#include <private/bionic_mbstate.h>
+
+#define BUF 513 /* Maximum length of numeric string. */
+
+// Flags used during conversion.
+// Size/type:
+#define LONG 0x00001 // l: long or double
+#define LONGDBL 0x00002 // L: long double
+#define SHORT 0x00004 // h: short
+#define SHORTSHORT 0x00008 // hh: 8 bit integer
+#define LLONG 0x00010 // ll: long long (+ deprecated q: quad)
+#define POINTER 0x00020 // p: void* (as hex)
+#define SIZEINT 0x00040 // z: (signed) size_t
+#define MAXINT 0x00080 // j: intmax_t
+#define PTRINT 0x00100 // t: ptrdiff_t
+#define NOSKIP 0x00200 // [ or c: do not skip blanks
+// Modifiers:
+#define SUPPRESS 0x00400 // *: suppress assignment
+#define UNSIGNED 0x00800 // %[oupxX] conversions
+#define ALLOCATE 0x01000 // m: allocate a char*
+// Internal use during integer parsing:
+#define SIGNOK 0x02000 // +/- is (still) legal
+#define HAVESIGN 0x04000 // Sign detected
+#define NDIGITS 0x08000 // No digits detected
+#define PFXOK 0x10000 // "0x" prefix is (still) legal
+#define PFBOK 0x20000 // "0b" prefix is (still) legal
+#define NZDIGITS 0x40000 // No zero digits detected
+
+// Conversion types.
+#define CT_CHAR 0 // %c conversion
+#define CT_CCL 1 // %[...] conversion
+#define CT_STRING 2 // %s conversion
+#define CT_INT 3 // Integer: strtoimax/strtoumax
+#define CT_FLOAT 4 // Float: strtod
+
+#define to_digit(c) static_cast<int>((c) - '0')
+#define is_digit(c) ((unsigned)to_digit(c) <= 9)
+
+// Append a digit to a value and check for overflow.
+#define APPEND_DIGIT(val, dig) \
+ do { \
+ if ((val) > INT_MAX / 10) \
+ errno = ENOMEM; \
+ else { \
+ (val) *= 10; \
+ if ((val) > INT_MAX - to_digit((dig))) \
+ errno = ENOMEM; \
+ else \
+ (val) += to_digit((dig)); \
+ } \
+ } while (0)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+// Trasnlate a fixed size integer argument for the %w/%wf format to a
+// flag representation. Supported sizes are 8, 16, 32, and 64 so far.
+// See details in bionic/libc/include/stdint.h
+static int w_to_flag(int size, bool fast) {
+ static constexpr int fast_size = sizeof(void*) == 8 ? LLONG : 0;
+ if (size == 8) return SHORTSHORT;
+ if (size == 16) return fast ? fast_size : SHORT;
+ if (size == 32) return fast ? fast_size : 0;
+ if (size == 64) return LLONG;
+ __fortify_fatal("%%w%s%d is unsupported", fast ? "f" : "", size);
+}
+
+#pragma clang diagnostic pop
\ No newline at end of file
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp
index 645aefa..f18cd81 100644
--- a/libc/stdio/stdio.cpp
+++ b/libc/stdio/stdio.cpp
@@ -773,7 +773,7 @@
char* fgets_unlocked(char* buf, int n, FILE* fp) {
if (n <= 0) __fortify_fatal("fgets: buffer size %d <= 0", n);
- _SET_ORIENTATION(fp, -1);
+ _SET_ORIENTATION(fp, ORIENT_BYTES);
char* s = buf;
n--; // Leave space for NUL.
@@ -903,7 +903,7 @@
errno = EBADF;
return EOF;
}
- _SET_ORIENTATION(fp, -1);
+ _SET_ORIENTATION(fp, ORIENT_BYTES);
if (--fp->_w >= 0 || (fp->_w >= fp->_lbfsize && c != '\n')) {
return (*fp->_p++ = c);
}
@@ -1098,7 +1098,7 @@
size_t total = desired_total;
if (total == 0) return 0;
- _SET_ORIENTATION(fp, -1);
+ _SET_ORIENTATION(fp, ORIENT_BYTES);
// TODO: how can this ever happen?!
if (fp->_r < 0) fp->_r = 0;
@@ -1165,7 +1165,7 @@
__siov iov = { .iov_base = const_cast<void*>(buf), .iov_len = n };
__suio uio = { .uio_iov = &iov, .uio_iovcnt = 1, .uio_resid = n };
- _SET_ORIENTATION(fp, -1);
+ _SET_ORIENTATION(fp, ORIENT_BYTES);
// The usual case is success (__sfvwrite returns 0); skip the divide if this happens,
// since divides are generally slow.
diff --git a/libc/stdio/vfprintf.cpp b/libc/stdio/vfprintf.cpp
index 994269b..12cceeb 100644
--- a/libc/stdio/vfprintf.cpp
+++ b/libc/stdio/vfprintf.cpp
@@ -39,7 +39,27 @@
#define CHAR_TYPE_inf "inf"
#define CHAR_TYPE_NAN "NAN"
#define CHAR_TYPE_nan "nan"
-#define CHAR_TYPE_ORIENTATION -1
+#define CHAR_TYPE_ORIENTATION ORIENT_BYTES
+
+#define PRINT(ptr, len) \
+ do { \
+ iovp->iov_base = (ptr); \
+ iovp->iov_len = (len); \
+ uio.uio_resid += (len); \
+ iovp++; \
+ if (++uio.uio_iovcnt >= NIOV) { \
+ if (helpers::sprint(fp, &uio)) goto error; \
+ iovp = iov; \
+ } \
+ } while (0)
+
+#define FLUSH() \
+ do { \
+ if (uio.uio_resid && helpers::sprint(fp, &uio)) goto error; \
+ uio.uio_iovcnt = 0; \
+ iovp = iov; \
+ } while (0)
+
#include "printf_common.h"
int FUNCTION_NAME(FILE* fp, const CHAR_TYPE* fmt0, va_list ap) {
@@ -115,24 +135,6 @@
static const char xdigs_lower[] = "0123456789abcdef";
static const char xdigs_upper[] = "0123456789ABCDEF";
-#define PRINT(ptr, len) \
- do { \
- iovp->iov_base = (ptr); \
- iovp->iov_len = (len); \
- uio.uio_resid += (len); \
- iovp++; \
- if (++uio.uio_iovcnt >= NIOV) { \
- if (helpers::sprint(fp, &uio)) goto error; \
- iovp = iov; \
- } \
- } while (0)
-#define FLUSH() \
- do { \
- if (uio.uio_resid && helpers::sprint(fp, &uio)) goto error; \
- uio.uio_iovcnt = 0; \
- iovp = iov; \
- } while (0)
-
_SET_ORIENTATION(fp, CHAR_TYPE_ORIENTATION);
// Writing "" to a read only file returns EOF, not 0.
@@ -359,14 +361,14 @@
if (dtoaresult) __freedtoa(dtoaresult);
if (flags & LONGDBL) {
fparg.ldbl = GETARG(long double);
- dtoaresult = cp = __hldtoa(fparg.ldbl, xdigs, prec, &expt, &signflag, &dtoaend);
+ dtoaresult = __hldtoa(fparg.ldbl, xdigs, prec, &expt, &signflag, &dtoaend);
if (dtoaresult == nullptr) {
errno = ENOMEM;
goto error;
}
} else {
fparg.dbl = GETARG(double);
- dtoaresult = cp = __hdtoa(fparg.dbl, xdigs, prec, &expt, &signflag, &dtoaend);
+ dtoaresult = __hdtoa(fparg.dbl, xdigs, prec, &expt, &signflag, &dtoaend);
if (dtoaresult == nullptr) {
errno = ENOMEM;
goto error;
@@ -396,14 +398,14 @@
if (dtoaresult) __freedtoa(dtoaresult);
if (flags & LONGDBL) {
fparg.ldbl = GETARG(long double);
- dtoaresult = cp = __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, &expt, &signflag, &dtoaend);
+ dtoaresult = __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, &expt, &signflag, &dtoaend);
if (dtoaresult == nullptr) {
errno = ENOMEM;
goto error;
}
} else {
fparg.dbl = GETARG(double);
- dtoaresult = cp = __dtoa(fparg.dbl, expchar ? 2 : 3, prec, &expt, &signflag, &dtoaend);
+ dtoaresult = __dtoa(fparg.dbl, expchar ? 2 : 3, prec, &expt, &signflag, &dtoaend);
if (dtoaresult == nullptr) {
errno = ENOMEM;
goto error;
@@ -411,6 +413,13 @@
if (expt == 9999) expt = INT_MAX;
}
fp_common:
+#if CHAR_TYPE_ORIENTATION == ORIENT_BYTES
+ cp = dtoaresult;
+#else
+ free(convbuf);
+ cp = convbuf = helpers::mbsconv(dtoaresult, -1);
+ if (cp == nullptr) goto error;
+#endif
if (signflag) sign = '-';
if (expt == INT_MAX) { /* inf or nan */
if (*cp == 'N') {
@@ -423,7 +432,7 @@
break;
}
flags |= FPT;
- ndig = dtoaend - cp;
+ ndig = dtoaend - dtoaresult;
if (ch == 'g' || ch == 'G') {
if (expt > -4 && expt <= prec) {
/* Make %[gG] smell like %[fF] */
@@ -660,6 +669,7 @@
} else { /* glue together f_p fragments */
if (decimal_point == nullptr) decimal_point = nl_langinfo(RADIXCHAR);
if (!expchar) { /* %[fF] or sufficiently short %[gG] */
+ CHAR_TYPE* end = cp + ndig;
if (expt <= 0) {
PRINT(zeroes, 1);
if (prec || flags & ALT) PRINT(decimal_point, 1);
@@ -667,11 +677,11 @@
/* already handled initial 0's */
prec += expt;
} else {
- PRINTANDPAD(cp, dtoaend, lead, zeroes);
+ PRINTANDPAD(cp, end, lead, zeroes);
cp += lead;
if (prec || flags & ALT) PRINT(decimal_point, 1);
}
- PRINTANDPAD(cp, dtoaend, prec, zeroes);
+ PRINTANDPAD(cp, end, prec, zeroes);
} else { /* %[eE] or sufficiently long %[gG] */
if (prec > 1 || flags & ALT) {
buf[0] = *cp++;
diff --git a/libc/stdio/vfscanf.cpp b/libc/stdio/vfscanf.cpp
index d05a3a6..3607995 100644
--- a/libc/stdio/vfscanf.cpp
+++ b/libc/stdio/vfscanf.cpp
@@ -31,53 +31,7 @@
* SUCH DAMAGE.
*/
-#include <ctype.h>
-#include <inttypes.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/param.h>
-#include <wctype.h>
-#include "local.h"
-
-#include <private/bionic_fortify.h>
-#include <platform/bionic/macros.h>
-#include <private/bionic_mbstate.h>
-
-#define BUF 513 /* Maximum length of numeric string. */
-
-// Flags used during conversion.
-// Size/type:
-#define LONG 0x00001 // l: long or double
-#define LONGDBL 0x00002 // L: long double
-#define SHORT 0x00004 // h: short
-#define SHORTSHORT 0x00008 // hh: 8 bit integer
-#define LLONG 0x00010 // ll: long long (+ deprecated q: quad)
-#define POINTER 0x00020 // p: void* (as hex)
-#define SIZEINT 0x00040 // z: (signed) size_t
-#define MAXINT 0x00080 // j: intmax_t
-#define PTRINT 0x00100 // t: ptrdiff_t
-#define NOSKIP 0x00200 // [ or c: do not skip blanks
-// Modifiers:
-#define SUPPRESS 0x00400 // *: suppress assignment
-#define UNSIGNED 0x00800 // %[oupxX] conversions
-#define ALLOCATE 0x01000 // m: allocate a char*
-// Internal use during integer parsing:
-#define SIGNOK 0x02000 // +/- is (still) legal
-#define HAVESIGN 0x04000 // Sign detected
-#define NDIGITS 0x08000 // No digits detected
-#define PFXOK 0x10000 // "0x" prefix is (still) legal
-#define PFBOK 0x20000 // "0b" prefix is (still) legal
-#define NZDIGITS 0x40000 // No zero digits detected
-
-// Conversion types.
-#define CT_CHAR 0 // %c conversion
-#define CT_CCL 1 // %[...] conversion
-#define CT_STRING 2 // %s conversion
-#define CT_INT 3 // Integer: strtoimax/strtoumax
-#define CT_FLOAT 4 // Float: strtod
+#include "scanf_common.h"
static const unsigned char* __sccl(char*, const unsigned char*);
@@ -102,7 +56,7 @@
void* allocation = nullptr; // Allocated but unassigned result for %mc/%ms/%m[.
size_t capacity = 0; // Number of char/wchar_t units allocated in `allocation`.
- _SET_ORIENTATION(fp, -1);
+ _SET_ORIENTATION(fp, ORIENT_BYTES);
nassigned = 0;
nread = 0;
@@ -122,6 +76,7 @@
*/
again:
c = *fmt++;
+reswitch:
switch (c) {
case '%':
literal:
@@ -220,6 +175,22 @@
base = 10;
break;
+ case 'w': {
+ int size = 0;
+ bool fast = false;
+ c = *fmt++;
+ if (c == 'f') {
+ fast = true;
+ c = *fmt++;
+ }
+ while (is_digit(c)) {
+ APPEND_DIGIT(size, c);
+ c = *fmt++;
+ }
+ flags |= w_to_flag(size, fast);
+ goto reswitch;
+ }
+
case 'X':
case 'x':
flags |= PFXOK; /* enable 0x prefixing */
@@ -356,12 +327,12 @@
fp->_r--;
memset(&mbs, 0, sizeof(mbs));
nconv = mbrtowc(wcp, buf, bytes, &mbs);
- if (nconv == __MB_ERR_ILLEGAL_SEQUENCE) {
+ if (nconv == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE) {
fp->_flags |= __SERR;
goto input_failure;
}
if (nconv == 0 && !(flags & SUPPRESS)) *wcp = L'\0';
- if (nconv != __MB_ERR_INCOMPLETE_SEQUENCE) {
+ if (nconv != BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE) {
nread += bytes;
width--;
if (!(flags & SUPPRESS)) wcp++;
@@ -446,11 +417,11 @@
wchar_t wc = L'\0';
memset(&mbs, 0, sizeof(mbs));
nconv = mbrtowc(&wc, buf, bytes, &mbs);
- if (nconv == __MB_ERR_ILLEGAL_SEQUENCE) {
+ if (nconv == BIONIC_MULTIBYTE_RESULT_ILLEGAL_SEQUENCE) {
fp->_flags |= __SERR;
goto input_failure;
}
- if (nconv != __MB_ERR_INCOMPLETE_SEQUENCE) {
+ if (nconv != BIONIC_MULTIBYTE_RESULT_INCOMPLETE_SEQUENCE) {
if ((c == CT_CCL && wctob(wc) != EOF && !ccltab[wctob(wc)]) || (c == CT_STRING && iswspace(wc))) {
while (bytes != 0) {
bytes--;
diff --git a/libc/stdio/vfwprintf.cpp b/libc/stdio/vfwprintf.cpp
index 0caeb2d..d6f6a6b 100644
--- a/libc/stdio/vfwprintf.cpp
+++ b/libc/stdio/vfwprintf.cpp
@@ -39,7 +39,17 @@
#define CHAR_TYPE_inf L"inf"
#define CHAR_TYPE_NAN L"NAN"
#define CHAR_TYPE_nan L"nan"
-#define CHAR_TYPE_ORIENTATION 1
+#define CHAR_TYPE_ORIENTATION ORIENT_CHARS
+
+#define PRINT(ptr, len) \
+ do { \
+ for (int n3 = 0; n3 < (len); n3++) { \
+ if ((helpers::xfputwc((ptr)[n3], fp)) == WEOF) goto error; \
+ } \
+ } while (0)
+
+#define FLUSH()
+
#include "printf_common.h"
int FUNCTION_NAME(FILE* fp, const CHAR_TYPE* fmt0, va_list ap) {
@@ -115,13 +125,6 @@
static const char xdigs_lower[] = "0123456789abcdef";
static const char xdigs_upper[] = "0123456789ABCDEF";
-#define PRINT(ptr, len) \
- do { \
- for (int n3 = 0; n3 < (len); n3++) { \
- if ((helpers::xfputwc((ptr)[n3], fp)) == WEOF) goto error; \
- } \
- } while (0)
-
_SET_ORIENTATION(fp, CHAR_TYPE_ORIENTATION);
// Writing "" to a read only file returns EOF, not 0.
@@ -352,10 +355,6 @@
}
if (prec < 0) prec = dtoaend - dtoaresult;
if (expt == INT_MAX) ox[1] = '\0';
- free(convbuf);
- cp = convbuf = helpers::mbsconv(dtoaresult, -1);
- if (cp == nullptr) goto error;
- ndig = dtoaend - dtoaresult;
goto fp_common;
case 'e':
case 'E':
@@ -392,11 +391,14 @@
}
if (expt == 9999) expt = INT_MAX;
}
+ fp_common:
+#if CHAR_TYPE_ORIENTATION == ORIENT_BYTES
+ cp = dtoaresult;
+#else
free(convbuf);
cp = convbuf = helpers::mbsconv(dtoaresult, -1);
if (cp == nullptr) goto error;
- ndig = dtoaend - dtoaresult;
- fp_common:
+#endif
if (signflag) sign = '-';
if (expt == INT_MAX) { /* inf or nan */
if (*cp == 'N') {
@@ -409,6 +411,7 @@
break;
}
flags |= FPT;
+ ndig = dtoaend - dtoaresult;
if (ch == 'g' || ch == 'G') {
if (expt > -4 && expt <= prec) {
/* Make %[gG] smell like %[fF] */
@@ -649,6 +652,7 @@
} else { /* glue together f_p fragments */
if (decimal_point == nullptr) decimal_point = nl_langinfo(RADIXCHAR);
if (!expchar) { /* %[fF] or sufficiently short %[gG] */
+ CHAR_TYPE* end = cp + ndig;
if (expt <= 0) {
PRINT(zeroes, 1);
if (prec || flags & ALT) PRINT(decimal_point, 1);
@@ -656,11 +660,11 @@
/* already handled initial 0's */
prec += expt;
} else {
- PRINTANDPAD(cp, convbuf + ndig, lead, zeroes);
+ PRINTANDPAD(cp, end, lead, zeroes);
cp += lead;
if (prec || flags & ALT) PRINT(decimal_point, 1);
}
- PRINTANDPAD(cp, convbuf + ndig, prec, zeroes);
+ PRINTANDPAD(cp, end, prec, zeroes);
} else { /* %[eE] or sufficiently long %[gG] */
if (prec > 1 || flags & ALT) {
buf[0] = *cp++;
@@ -681,8 +685,11 @@
if (width < realsz) width = realsz;
if (width > INT_MAX - ret) goto overflow;
ret += width;
+
+ FLUSH(); /* copy out the I/O vectors */
}
done:
+ FLUSH();
error:
va_end(orgap);
if (__sferror(fp)) ret = -1;
diff --git a/libc/stdio/vfwscanf.cpp b/libc/stdio/vfwscanf.cpp
index 06f706a..3df4a87 100644
--- a/libc/stdio/vfwscanf.cpp
+++ b/libc/stdio/vfwscanf.cpp
@@ -31,62 +31,7 @@
* SUCH DAMAGE.
*/
-#include <inttypes.h>
-#include <limits.h>
-#include <locale.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <wctype.h>
-#include "local.h"
-
-#include <platform/bionic/macros.h>
-
-#define BUF 513 /* Maximum length of numeric string. */
-
-/*
- * Flags used during conversion.
- */
-#define LONG 0x00001 /* l: long or double */
-#define LONGDBL 0x00002 /* L: long double */
-#define SHORT 0x00004 /* h: short */
-#define SHORTSHORT 0x00008 /* hh: 8 bit integer */
-#define LLONG 0x00010 /* ll: long long (+ deprecated q: quad) */
-#define POINTER 0x00020 /* p: void * (as hex) */
-#define SIZEINT 0x00040 /* z: (signed) size_t */
-#define MAXINT 0x00080 /* j: intmax_t */
-#define PTRINT 0x00100 /* t: ptrdiff_t */
-#define NOSKIP 0x00200 /* [ or c: do not skip blanks */
-#define SUPPRESS 0x00400 /* *: suppress assignment */
-#define UNSIGNED 0x00800 /* %[oupxX] conversions */
-
-/*
- * The following are used in numeric conversions only:
- * SIGNOK, HAVESIGN, NDIGITS, DPTOK, and EXPOK are for floating point;
- * SIGNOK, HAVESIGN, NDIGITS, PFXOK, and NZDIGITS are for integral.
- */
-#define SIGNOK 0x01000 /* +/- is (still) legal */
-#define HAVESIGN 0x02000 /* sign detected */
-#define NDIGITS 0x04000 /* no digits detected */
-
-#define DPTOK 0x08000 /* (float) decimal point is still legal */
-#define EXPOK 0x10000 /* (float) exponent (e+3, etc) still legal */
-
-#define PFBOK 0x20000 /* 0x prefix is (still) legal */
-#define PFXOK 0x40000 /* 0x prefix is (still) legal */
-#define NZDIGITS 0x80000 /* no zero digits detected */
-
-/*
- * Conversion types.
- */
-#define CT_CHAR 0 /* %c conversion */
-#define CT_CCL 1 /* %[...] conversion */
-#define CT_STRING 2 /* %s conversion */
-#define CT_INT 3 /* integer, i.e., strtoimax or strtoumax */
-#define CT_FLOAT 4 /* floating, i.e., strtod */
-
+#include "scanf_common.h"
// An interpretive version of __sccl from vfscanf.c --- a table of all wchar_t values would
// be a little too expensive, and some kind of compressed version isn't worth the trouble.
static inline bool in_ccl(wchar_t wc, const wchar_t* ccl) {
@@ -150,7 +95,7 @@
char mbbuf[MB_LEN_MAX]; /* temporary mb. character buffer */
mbstate_t mbs;
- _SET_ORIENTATION(fp, 1);
+ _SET_ORIENTATION(fp, ORIENT_CHARS);
nassigned = 0;
nconversions = 0;
@@ -176,6 +121,7 @@
*/
again:
c = *fmt++;
+ reswitch:
switch (c) {
case '%':
literal:
@@ -273,6 +219,22 @@
base = 10;
break;
+ case 'w': {
+ int size = 0;
+ bool fast = false;
+ c = *fmt++;
+ if (c == 'f') {
+ fast = true;
+ c = *fmt++;
+ }
+ while (is_digit(c)) {
+ APPEND_DIGIT(size, c);
+ c = *fmt++;
+ }
+ flags |= w_to_flag(size, fast);
+ goto reswitch;
+ }
+
case 'X':
case 'x':
flags |= PFXOK; /* enable 0x prefixing */
diff --git a/libc/system_properties/context_lookup_benchmark_data.h b/libc/system_properties/context_lookup_benchmark_data.h
index b928875..1d7250c 100644
--- a/libc/system_properties/context_lookup_benchmark_data.h
+++ b/libc/system_properties/context_lookup_benchmark_data.h
@@ -321,7 +321,7 @@
persist.vendor. u:object_r:vendor_default_prop:s0
vendor. u:object_r:vendor_default_prop:s0
-# Properties that relate to time / time zone detection behavior.
+# Properties that relate to time / timezone detection behavior.
persist.time. u:object_r:time_prop:s0
# Properties that relate to server configurable flags
diff --git a/libc/system_properties/context_node.cpp b/libc/system_properties/context_node.cpp
index d392c0a..572bf97 100644
--- a/libc/system_properties/context_node.cpp
+++ b/libc/system_properties/context_node.cpp
@@ -49,17 +49,11 @@
return true;
}
- char filename[PROP_FILENAME_MAX];
- int len = async_safe_format_buffer(filename, sizeof(filename), "%s/%s", filename_, context_);
- if (len < 0 || len >= PROP_FILENAME_MAX) {
- lock_.unlock();
- return false;
- }
-
+ PropertiesFilename filename(filename_, context_);
if (access_rw) {
- pa_ = prop_area::map_prop_area_rw(filename, context_, fsetxattr_failed);
+ pa_ = prop_area::map_prop_area_rw(filename.c_str(), context_, fsetxattr_failed);
} else {
- pa_ = prop_area::map_prop_area(filename);
+ pa_ = prop_area::map_prop_area(filename.c_str());
}
lock_.unlock();
return pa_;
@@ -84,13 +78,8 @@
}
bool ContextNode::CheckAccess() {
- char filename[PROP_FILENAME_MAX];
- int len = async_safe_format_buffer(filename, sizeof(filename), "%s/%s", filename_, context_);
- if (len < 0 || len >= PROP_FILENAME_MAX) {
- return false;
- }
-
- return access(filename, R_OK) == 0;
+ PropertiesFilename filename(filename_, context_);
+ return access(filename.c_str(), R_OK) == 0;
}
void ContextNode::Unmap() {
diff --git a/libc/system_properties/contexts_serialized.cpp b/libc/system_properties/contexts_serialized.cpp
index 6ccd46c..f05aaa0 100644
--- a/libc/system_properties/contexts_serialized.cpp
+++ b/libc/system_properties/contexts_serialized.cpp
@@ -66,18 +66,12 @@
}
bool ContextsSerialized::MapSerialPropertyArea(bool access_rw, bool* fsetxattr_failed) {
- char filename[PROP_FILENAME_MAX];
- int len = async_safe_format_buffer(filename, sizeof(filename), "%s/properties_serial", filename_);
- if (len < 0 || len >= PROP_FILENAME_MAX) {
- serial_prop_area_ = nullptr;
- return false;
- }
-
+ PropertiesFilename filename(filename_, "properties_serial");
if (access_rw) {
- serial_prop_area_ =
- prop_area::map_prop_area_rw(filename, "u:object_r:properties_serial:s0", fsetxattr_failed);
+ serial_prop_area_ = prop_area::map_prop_area_rw(
+ filename.c_str(), "u:object_r:properties_serial:s0", fsetxattr_failed);
} else {
- serial_prop_area_ = prop_area::map_prop_area(filename);
+ serial_prop_area_ = prop_area::map_prop_area(filename.c_str());
}
return serial_prop_area_;
}
diff --git a/libc/system_properties/contexts_split.cpp b/libc/system_properties/contexts_split.cpp
index 7ba835a..3579f55 100644
--- a/libc/system_properties/contexts_split.cpp
+++ b/libc/system_properties/contexts_split.cpp
@@ -192,18 +192,12 @@
}
bool ContextsSplit::MapSerialPropertyArea(bool access_rw, bool* fsetxattr_failed) {
- char filename[PROP_FILENAME_MAX];
- int len = async_safe_format_buffer(filename, sizeof(filename), "%s/properties_serial", filename_);
- if (len < 0 || len >= PROP_FILENAME_MAX) {
- serial_prop_area_ = nullptr;
- return false;
- }
-
+ PropertiesFilename filename(filename_, "properties_serial");
if (access_rw) {
- serial_prop_area_ =
- prop_area::map_prop_area_rw(filename, "u:object_r:properties_serial:s0", fsetxattr_failed);
+ serial_prop_area_ = prop_area::map_prop_area_rw(
+ filename.c_str(), "u:object_r:properties_serial:s0", fsetxattr_failed);
} else {
- serial_prop_area_ = prop_area::map_prop_area(filename);
+ serial_prop_area_ = prop_area::map_prop_area(filename.c_str());
}
return serial_prop_area_;
}
diff --git a/libc/system_properties/include/system_properties/prop_area.h b/libc/system_properties/include/system_properties/prop_area.h
index e32a8d7..187ff75 100644
--- a/libc/system_properties/include/system_properties/prop_area.h
+++ b/libc/system_properties/include/system_properties/prop_area.h
@@ -53,14 +53,14 @@
// +-----+ +-----+ +-----+ +===========+
// Represents a node in the trie.
-struct prop_bt {
+struct prop_trie_node {
uint32_t namelen;
// The property trie is updated only by the init process (single threaded) which provides
// property service. And it can be read by multiple threads at the same time.
// As the property trie is not protected by locks, we use atomic_uint_least32_t types for the
// left, right, children "pointers" in the trie node. To make sure readers who see the
- // change of "pointers" can also notice the change of prop_bt structure contents pointed by
+ // change of "pointers" can also notice the change of prop_trie_node structure contents pointed by
// the "pointers", we always use release-consume ordering pair when accessing these "pointers".
// prop "points" to prop_info structure if there is a propery associated with the trie node.
@@ -79,14 +79,14 @@
char name[0];
- prop_bt(const char* name, const uint32_t name_length) {
+ prop_trie_node(const char* name, const uint32_t name_length) {
this->namelen = name_length;
memcpy(this->name, name, name_length);
this->name[name_length] = '\0';
}
private:
- BIONIC_DISALLOW_COPY_AND_ASSIGN(prop_bt);
+ BIONIC_DISALLOW_COPY_AND_ASSIGN(prop_trie_node);
};
class prop_area {
@@ -105,7 +105,7 @@
atomic_init(&serial_, 0u);
memset(reserved_, 0, sizeof(reserved_));
// Allocate enough space for the root node.
- bytes_used_ = sizeof(prop_bt);
+ bytes_used_ = sizeof(prop_trie_node);
// To make property reads wait-free, we reserve a
// PROP_VALUE_MAX-sized block of memory, the "dirty backup area",
// just after the root node. When we're about to modify a
@@ -136,30 +136,29 @@
uint32_t version() const {
return version_;
}
- char* dirty_backup_area() {
- return data_ + sizeof (prop_bt);
- }
+ char* dirty_backup_area() { return data_ + sizeof(prop_trie_node); }
private:
static prop_area* map_fd_ro(const int fd);
void* allocate_obj(const size_t size, uint_least32_t* const off);
- prop_bt* new_prop_bt(const char* name, uint32_t namelen, uint_least32_t* const off);
+ prop_trie_node* new_prop_trie_node(const char* name, uint32_t namelen, uint_least32_t* const off);
prop_info* new_prop_info(const char* name, uint32_t namelen, const char* value, uint32_t valuelen,
uint_least32_t* const off);
void* to_prop_obj(uint_least32_t off);
- prop_bt* to_prop_bt(atomic_uint_least32_t* off_p);
+ prop_trie_node* to_prop_trie_node(atomic_uint_least32_t* off_p);
prop_info* to_prop_info(atomic_uint_least32_t* off_p);
- prop_bt* root_node();
+ prop_trie_node* root_node();
- prop_bt* find_prop_bt(prop_bt* const bt, const char* name, uint32_t namelen, bool alloc_if_needed);
+ prop_trie_node* find_prop_trie_node(prop_trie_node* const trie, const char* name,
+ uint32_t namelen, bool alloc_if_needed);
- const prop_info* find_property(prop_bt* const trie, const char* name, uint32_t namelen,
+ const prop_info* find_property(prop_trie_node* const trie, const char* name, uint32_t namelen,
const char* value, uint32_t valuelen, bool alloc_if_needed);
- bool foreach_property(prop_bt* const trie, void (*propfn)(const prop_info* pi, void* cookie),
- void* cookie);
+ bool foreach_property(prop_trie_node* const trie,
+ void (*propfn)(const prop_info* pi, void* cookie), void* cookie);
// The original design doesn't include pa_size or pa_data_size in the prop_area struct itself.
// Since we'll need to be backwards compatible with that design, we don't gain much by adding it
diff --git a/libc/system_properties/include/system_properties/prop_info.h b/libc/system_properties/include/system_properties/prop_info.h
index 3ebe7c5..e2236b0 100644
--- a/libc/system_properties/include/system_properties/prop_info.h
+++ b/libc/system_properties/include/system_properties/prop_info.h
@@ -45,14 +45,14 @@
// Read only properties will not set anything but the bottom most bit of serial and the top byte.
// We borrow the 2nd from the top byte for extra flags, and use the bottom most bit of that for
// our first user, kLongFlag.
- constexpr static uint32_t kLongFlag = 1 << 16;
+ static constexpr uint32_t kLongFlag = 1 << 16;
// The error message fits in part of a union with the previous 92 char property value so there
// must be room left over after the error message for the offset to the new longer property value
// and future expansion fields if needed. Note that this value cannot ever increase. The offset
// to the new longer property value appears immediately after it, so an increase of this size will
// break compatibility.
- constexpr static size_t kLongLegacyErrorBufferSize = 56;
+ static constexpr size_t kLongLegacyErrorBufferSize = 56;
public:
atomic_uint_least32_t serial;
diff --git a/libc/system_properties/include/system_properties/system_properties.h b/libc/system_properties/include/system_properties/system_properties.h
index 0666e28..4d84b39 100644
--- a/libc/system_properties/include/system_properties/system_properties.h
+++ b/libc/system_properties/include/system_properties/system_properties.h
@@ -37,7 +37,25 @@
#include "contexts_serialized.h"
#include "contexts_split.h"
-constexpr int PROP_FILENAME_MAX = 1024;
+class PropertiesFilename {
+ public:
+ PropertiesFilename() = default;
+ PropertiesFilename(const char* dir, const char* file) {
+ if (snprintf(filename_, sizeof(filename_), "%s/%s", dir, file) >=
+ static_cast<int>(sizeof(filename_))) {
+ abort();
+ }
+ }
+ void operator=(const char* value) {
+ if (strlen(value) >= sizeof(filename_)) abort();
+ strcpy(filename_, value);
+ }
+ const char* c_str() { return filename_; }
+
+ private:
+ // Typically something like "/dev/__properties__/properties_serial".
+ char filename_[128];
+};
class SystemProperties {
public:
@@ -86,5 +104,5 @@
Contexts* contexts_;
bool initialized_;
- char property_filename_[PROP_FILENAME_MAX];
+ PropertiesFilename properties_filename_;
};
diff --git a/libc/system_properties/prop_area.cpp b/libc/system_properties/prop_area.cpp
index 42bee9f..4668eed 100644
--- a/libc/system_properties/prop_area.cpp
+++ b/libc/system_properties/prop_area.cpp
@@ -154,16 +154,15 @@
return data_ + *off;
}
-prop_bt* prop_area::new_prop_bt(const char* name, uint32_t namelen, uint_least32_t* const off) {
+prop_trie_node* prop_area::new_prop_trie_node(const char* name, uint32_t namelen,
+ uint_least32_t* const off) {
uint_least32_t new_offset;
- void* const p = allocate_obj(sizeof(prop_bt) + namelen + 1, &new_offset);
- if (p != nullptr) {
- prop_bt* bt = new (p) prop_bt(name, namelen);
- *off = new_offset;
- return bt;
- }
+ void* const p = allocate_obj(sizeof(prop_trie_node) + namelen + 1, &new_offset);
+ if (p == nullptr) return nullptr;
- return nullptr;
+ prop_trie_node* node = new (p) prop_trie_node(name, namelen);
+ *off = new_offset;
+ return node;
}
prop_info* prop_area::new_prop_info(const char* name, uint32_t namelen, const char* value,
@@ -200,9 +199,9 @@
return (data_ + off);
}
-inline prop_bt* prop_area::to_prop_bt(atomic_uint_least32_t* off_p) {
+inline prop_trie_node* prop_area::to_prop_trie_node(atomic_uint_least32_t* off_p) {
uint_least32_t off = atomic_load_explicit(off_p, memory_order_consume);
- return reinterpret_cast<prop_bt*>(to_prop_obj(off));
+ return reinterpret_cast<prop_trie_node*>(to_prop_obj(off));
}
inline prop_info* prop_area::to_prop_info(atomic_uint_least32_t* off_p) {
@@ -210,8 +209,8 @@
return reinterpret_cast<prop_info*>(to_prop_obj(off));
}
-inline prop_bt* prop_area::root_node() {
- return reinterpret_cast<prop_bt*>(to_prop_obj(0));
+inline prop_trie_node* prop_area::root_node() {
+ return reinterpret_cast<prop_trie_node*>(to_prop_obj(0));
}
static int cmp_prop_name(const char* one, uint32_t one_len, const char* two, uint32_t two_len) {
@@ -223,9 +222,9 @@
return strncmp(one, two, one_len);
}
-prop_bt* prop_area::find_prop_bt(prop_bt* const bt, const char* name, uint32_t namelen,
- bool alloc_if_needed) {
- prop_bt* current = bt;
+prop_trie_node* prop_area::find_prop_trie_node(prop_trie_node* const trie, const char* name,
+ uint32_t namelen, bool alloc_if_needed) {
+ prop_trie_node* current = trie;
while (true) {
if (!current) {
return nullptr;
@@ -239,46 +238,46 @@
if (ret < 0) {
uint_least32_t left_offset = atomic_load_explicit(¤t->left, memory_order_relaxed);
if (left_offset != 0) {
- current = to_prop_bt(¤t->left);
+ current = to_prop_trie_node(¤t->left);
} else {
if (!alloc_if_needed) {
return nullptr;
}
uint_least32_t new_offset;
- prop_bt* new_bt = new_prop_bt(name, namelen, &new_offset);
- if (new_bt) {
+ prop_trie_node* new_node = new_prop_trie_node(name, namelen, &new_offset);
+ if (new_node) {
atomic_store_explicit(¤t->left, new_offset, memory_order_release);
}
- return new_bt;
+ return new_node;
}
} else {
uint_least32_t right_offset = atomic_load_explicit(¤t->right, memory_order_relaxed);
if (right_offset != 0) {
- current = to_prop_bt(¤t->right);
+ current = to_prop_trie_node(¤t->right);
} else {
if (!alloc_if_needed) {
return nullptr;
}
uint_least32_t new_offset;
- prop_bt* new_bt = new_prop_bt(name, namelen, &new_offset);
- if (new_bt) {
+ prop_trie_node* new_node = new_prop_trie_node(name, namelen, &new_offset);
+ if (new_node) {
atomic_store_explicit(¤t->right, new_offset, memory_order_release);
}
- return new_bt;
+ return new_node;
}
}
}
}
-const prop_info* prop_area::find_property(prop_bt* const trie, const char* name, uint32_t namelen,
- const char* value, uint32_t valuelen,
+const prop_info* prop_area::find_property(prop_trie_node* const trie, const char* name,
+ uint32_t namelen, const char* value, uint32_t valuelen,
bool alloc_if_needed) {
if (!trie) return nullptr;
const char* remaining_name = name;
- prop_bt* current = trie;
+ prop_trie_node* current = trie;
while (true) {
const char* sep = strchr(remaining_name, '.');
const bool want_subtree = (sep != nullptr);
@@ -288,13 +287,13 @@
return nullptr;
}
- prop_bt* root = nullptr;
+ prop_trie_node* root = nullptr;
uint_least32_t children_offset = atomic_load_explicit(¤t->children, memory_order_relaxed);
if (children_offset != 0) {
- root = to_prop_bt(¤t->children);
+ root = to_prop_trie_node(¤t->children);
} else if (alloc_if_needed) {
uint_least32_t new_offset;
- root = new_prop_bt(remaining_name, substr_size, &new_offset);
+ root = new_prop_trie_node(remaining_name, substr_size, &new_offset);
if (root) {
atomic_store_explicit(¤t->children, new_offset, memory_order_release);
}
@@ -304,7 +303,7 @@
return nullptr;
}
- current = find_prop_bt(root, remaining_name, substr_size, alloc_if_needed);
+ current = find_prop_trie_node(root, remaining_name, substr_size, alloc_if_needed);
if (!current) {
return nullptr;
}
@@ -330,13 +329,13 @@
}
}
-bool prop_area::foreach_property(prop_bt* const trie,
+bool prop_area::foreach_property(prop_trie_node* const trie,
void (*propfn)(const prop_info* pi, void* cookie), void* cookie) {
if (!trie) return false;
uint_least32_t left_offset = atomic_load_explicit(&trie->left, memory_order_relaxed);
if (left_offset != 0) {
- const int err = foreach_property(to_prop_bt(&trie->left), propfn, cookie);
+ const int err = foreach_property(to_prop_trie_node(&trie->left), propfn, cookie);
if (err < 0) return false;
}
uint_least32_t prop_offset = atomic_load_explicit(&trie->prop, memory_order_relaxed);
@@ -347,12 +346,12 @@
}
uint_least32_t children_offset = atomic_load_explicit(&trie->children, memory_order_relaxed);
if (children_offset != 0) {
- const int err = foreach_property(to_prop_bt(&trie->children), propfn, cookie);
+ const int err = foreach_property(to_prop_trie_node(&trie->children), propfn, cookie);
if (err < 0) return false;
}
uint_least32_t right_offset = atomic_load_explicit(&trie->right, memory_order_relaxed);
if (right_offset != 0) {
- const int err = foreach_property(to_prop_bt(&trie->right), propfn, cookie);
+ const int err = foreach_property(to_prop_trie_node(&trie->right), propfn, cookie);
if (err < 0) return false;
}
diff --git a/libc/system_properties/prop_info.cpp b/libc/system_properties/prop_info.cpp
index 890d1cf..c3bf177 100644
--- a/libc/system_properties/prop_info.cpp
+++ b/libc/system_properties/prop_info.cpp
@@ -30,7 +30,7 @@
#include <string.h>
-constexpr static const char kLongLegacyError[] =
+static constexpr const char kLongLegacyError[] =
"Must use __system_property_read_callback() to read";
static_assert(sizeof(kLongLegacyError) < prop_info::kLongLegacyErrorBufferSize,
"Error message for long properties read by legacy libc must fit within 56 chars");
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
index 1cb15c3..049236f 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
@@ -67,26 +67,23 @@
return true;
}
- if (strlen(filename) >= PROP_FILENAME_MAX) {
- return false;
- }
- strcpy(property_filename_, filename);
+ properties_filename_ = filename;
- if (is_dir(property_filename_)) {
+ if (is_dir(properties_filename_.c_str())) {
if (access("/dev/__properties__/property_info", R_OK) == 0) {
contexts_ = new (contexts_data_) ContextsSerialized();
- if (!contexts_->Initialize(false, property_filename_, nullptr)) {
+ if (!contexts_->Initialize(false, properties_filename_.c_str(), nullptr)) {
return false;
}
} else {
contexts_ = new (contexts_data_) ContextsSplit();
- if (!contexts_->Initialize(false, property_filename_, nullptr)) {
+ if (!contexts_->Initialize(false, properties_filename_.c_str(), nullptr)) {
return false;
}
}
} else {
contexts_ = new (contexts_data_) ContextsPreSplit();
- if (!contexts_->Initialize(false, property_filename_, nullptr)) {
+ if (!contexts_->Initialize(false, properties_filename_.c_str(), nullptr)) {
return false;
}
}
@@ -95,13 +92,9 @@
}
bool SystemProperties::AreaInit(const char* filename, bool* fsetxattr_failed) {
- if (strlen(filename) >= PROP_FILENAME_MAX) {
- return false;
- }
- strcpy(property_filename_, filename);
-
+ properties_filename_ = filename;
contexts_ = new (contexts_data_) ContextsSerialized();
- if (!contexts_->Initialize(true, property_filename_, fsetxattr_failed)) {
+ if (!contexts_->Initialize(true, properties_filename_.c_str(), fsetxattr_failed)) {
return false;
}
initialized_ = true;
diff --git a/libc/tools/generate_notice.py b/libc/tools/generate_notice.py
index e004d74..505708a 100755
--- a/libc/tools/generate_notice.py
+++ b/libc/tools/generate_notice.py
@@ -33,6 +33,7 @@
".pyc",
".swp",
".txt",
+ ".xml",
]
if path.suffix in uninteresting_extensions:
return False
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index 558b004..8c457c8 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -88,7 +88,7 @@
ecall
li a7, -MAX_ERRNO
- bgtu a0, a7, 1f
+ bgeu a0, a7, 1f
ret
1:
@@ -227,11 +227,6 @@
aliases = syscall["aliases"]
for alias in aliases:
stub += "\nALIAS_SYMBOL(%s, %s)\n" % (alias, syscall["func"])
-
- # Use hidden visibility on LP64 for any functions beginning with underscores.
- if pointer_length == 64 and syscall["func"].startswith("__"):
- stub += '.hidden ' + syscall["func"] + '\n'
-
return stub
diff --git a/libc/tzcode/bionic.cpp b/libc/tzcode/bionic.cpp
index d2b5d80..7091707 100644
--- a/libc/tzcode/bionic.cpp
+++ b/libc/tzcode/bionic.cpp
@@ -36,10 +36,45 @@
#include "private/CachedProperty.h"
extern "C" void tzset_unlocked(void);
+extern "C" void __bionic_get_system_tz(char* buf, size_t n);
extern "C" int __bionic_open_tzdata(const char*, int32_t*);
extern "C" void tzsetlcl(char const*);
+void __bionic_get_system_tz(char* buf, size_t n) {
+ static CachedProperty persist_sys_timezone("persist.sys.timezone");
+ const char* name = persist_sys_timezone.Get();
+
+ // If the system property is not set, perhaps because this is called
+ // before the default value has been set (the recovery image being a
+ // classic example), fall back to GMT.
+ if (name == nullptr) name = "GMT";
+
+ strlcpy(buf, name, n);
+
+ if (!strcmp(buf, "GMT")) {
+ // Typically we'll set the system property to an Olson ID, but
+ // java.util.TimeZone also supports the "GMT+xxxx" style, and at
+ // least historically (see http://b/25463955) some Android-based set
+ // top boxes would get the timezone from the TV network in this format
+ // and use it directly in the system property. This caused trouble
+ // for native code because POSIX and Java disagree about the sign in
+ // a timezone string. For POSIX, "GMT+3" means "3 hours west/behind",
+ // but for Java it means "3 hours east/ahead". Since (a) Java is the
+ // one that matches human expectations and (b) this system property is
+ // used directly by Java, we flip the sign here to translate from Java
+ // to POSIX. We only need to worry about the "GMT+xxxx" case because
+ // the expectation is that these are valid java.util.TimeZone ids,
+ // not general POSIX custom timezone specifications (which is why this
+ // code only applies to the system property, and not to the environment
+ // variable).
+ char sign = buf[3];
+ if (sign == '-' || sign == '+') {
+ buf[3] = (sign == '-') ? '+' : '-';
+ }
+ }
+}
+
void tzset_unlocked() {
// The TZ environment variable is meant to override the system-wide setting.
const char* name = getenv("TZ");
@@ -47,26 +82,10 @@
// If that's not set, look at the "persist.sys.timezone" system property.
if (name == nullptr) {
- static CachedProperty persist_sys_timezone("persist.sys.timezone");
-
- if ((name = persist_sys_timezone.Get()) != nullptr && strlen(name) > 3) {
- // POSIX and Java disagree about the sign in a timezone string. For POSIX, "GMT+3" means
- // "3 hours west/behind", but for Java it means "3 hours east/ahead". Since (a) Java is
- // the one that matches human expectations and (b) this system property is used directly
- // by Java, we flip the sign here to translate from Java to POSIX. http://b/25463955.
- char sign = name[3];
- if (sign == '-' || sign == '+') {
- strlcpy(buf, name, sizeof(buf));
- buf[3] = (sign == '-') ? '+' : '-';
- name = buf;
- }
- }
+ __bionic_get_system_tz(buf, sizeof(buf));
+ name = buf;
}
- // If the system property is also not available (because you're running AOSP on a WiFi-only
- // device, say), fall back to GMT.
- if (name == nullptr) name = "GMT";
-
tzsetlcl(name);
}
@@ -192,14 +211,14 @@
close(fd);
// This file descriptor (-1) is passed to localtime.c. In invalid fd case
// upstream passes errno value around methods and having 0 there will
- // indicate that time zone was found and read successfully and localtime's
+ // indicate that timezone was found and read successfully and localtime's
// internal state was properly initialized (which wasn't as we couldn't find
- // requested time zone in the tzdata file).
+ // requested timezone in the tzdata file).
// If we reached this point errno is unlikely to be touched. It is only
// close(fd) which can do it, but that is very unlikely to happen. And
// even if it happens we can't extract any useful insights from it.
// We are overriding it to ENOENT as it matches upstream expectations -
- // time zone is absent in the tzdata file == there is no TZif file in
+ // timezone is absent in the tzdata file == there is no TZif file in
// /usr/share/zoneinfo.
errno = ENOENT;
return -1;
@@ -219,7 +238,7 @@
int fd;
// Try the two locations for the tzdata file in a strict order:
- // 1: The time zone data module which contains the main copy. This is the
+ // 1: The timezone data module which contains the main copy. This is the
// common case for current devices.
// 2: The ultimate fallback: the non-updatable copy in /system.
diff --git a/libc/tzcode/localtime.c b/libc/tzcode/localtime.c
index 5e1181f..018acad 100644
--- a/libc/tzcode/localtime.c
+++ b/libc/tzcode/localtime.c
@@ -374,8 +374,11 @@
+ 4 * TZ_MAX_TIMES];
};
-// Android-removed: There is no directory with file-per-time zone on Android.
-#ifndef __BIONIC__
+#if defined(__BIONIC__)
+// Android: there is no directory with one file per timezone on Android,
+// but we do have a system property instead.
+#include <sys/system_properties.h>
+#else
/* TZDIR with a trailing '/' rather than a trailing '\0'. */
static char const tzdirslash[sizeof TZDIR] = TZDIR "/";
#endif
@@ -415,13 +418,20 @@
#endif
register union input_buffer *up = &lsp->u.u;
register int tzheadsize = sizeof(struct tzhead);
+ char system_tz_name[PROP_VALUE_MAX];
sp->goback = sp->goahead = false;
if (! name) {
+#if defined(__BIONIC__)
+ extern void __bionic_get_system_tz(char* , size_t);
+ __bionic_get_system_tz(system_tz_name, sizeof(system_tz_name));
+ name = system_tz_name;
+#else
name = TZDEFAULT;
if (! name)
return EINVAL;
+#endif
}
#if defined(__BIONIC__)
diff --git a/libc/tzcode/strptime.c b/libc/tzcode/strptime.c
index d31a501..ae7881e 100644
--- a/libc/tzcode/strptime.c
+++ b/libc/tzcode/strptime.c
@@ -28,6 +28,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "private.h"
+
#include <ctype.h>
#include <errno.h>
#include <limits.h>
@@ -37,7 +39,6 @@
#include <time.h>
#include "localedef.h"
-#include "private.h"
#include "tzfile.h"
// Android: ignore OpenBSD's DEF_WEAK() stuff.
diff --git a/libc/upstream-freebsd/android/include/libc_private.h b/libc/upstream-freebsd/android/include/libc_private.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/libc/upstream-freebsd/android/include/libc_private.h
diff --git a/libc/upstream-freebsd/android/include/xlocale_private.h b/libc/upstream-freebsd/android/include/xlocale_private.h
new file mode 100644
index 0000000..010d70c
--- /dev/null
+++ b/libc/upstream-freebsd/android/include/xlocale_private.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+#include <locale.h>
+
+#define __get_locale() LC_GLOBAL_LOCALE
+
+#define FIX_LOCALE(__l) /* Nothing. */
diff --git a/libc/upstream-freebsd/lib/libc/gen/ldexp.c b/libc/upstream-freebsd/lib/libc/gen/ldexp.c
deleted file mode 100644
index 887f673..0000000
--- a/libc/upstream-freebsd/lib/libc/gen/ldexp.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* @(#)s_scalbn.c 5.1 93/09/24 */
-/* @(#)fdlibm.h 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$");
-
-#include <sys/types.h>
-#include <machine/endian.h>
-#include <math.h>
-
-/* Bit fiddling routines copied from msun/src/math_private.h,v 1.15 */
-
-#if BYTE_ORDER == BIG_ENDIAN
-
-typedef union
-{
- double value;
- struct
- {
- u_int32_t msw;
- u_int32_t lsw;
- } parts;
-} ieee_double_shape_type;
-
-#endif
-
-#if BYTE_ORDER == LITTLE_ENDIAN
-
-typedef union
-{
- double value;
- struct
- {
- u_int32_t lsw;
- u_int32_t msw;
- } parts;
-} ieee_double_shape_type;
-
-#endif
-
-/* Get two 32 bit ints from a double. */
-
-#define EXTRACT_WORDS(ix0,ix1,d) \
-do { \
- ieee_double_shape_type ew_u; \
- ew_u.value = (d); \
- (ix0) = ew_u.parts.msw; \
- (ix1) = ew_u.parts.lsw; \
-} while (0)
-
-/* Get the more significant 32 bit int from a double. */
-
-#define GET_HIGH_WORD(i,d) \
-do { \
- ieee_double_shape_type gh_u; \
- gh_u.value = (d); \
- (i) = gh_u.parts.msw; \
-} while (0)
-
-/* Set the more significant 32 bits of a double from an int. */
-
-#define SET_HIGH_WORD(d,v) \
-do { \
- ieee_double_shape_type sh_u; \
- sh_u.value = (d); \
- sh_u.parts.msw = (v); \
- (d) = sh_u.value; \
-} while (0)
-
-
-static const double
-two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
-twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
-huge = 1.0e+300,
-tiny = 1.0e-300;
-
-static double
-_copysign(double x, double y)
-{
- u_int32_t hx,hy;
- GET_HIGH_WORD(hx,x);
- GET_HIGH_WORD(hy,y);
- SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000));
- return x;
-}
-
-double
-ldexp(double x, int n)
-{
- int32_t k,hx,lx;
- EXTRACT_WORDS(hx,lx,x);
- k = (hx&0x7ff00000)>>20; /* extract exponent */
- if (k==0) { /* 0 or subnormal x */
- if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
- x *= two54;
- GET_HIGH_WORD(hx,x);
- k = ((hx&0x7ff00000)>>20) - 54;
- if (n< -50000) return tiny*x; /*underflow*/
- }
- if (k==0x7ff) return x+x; /* NaN or Inf */
- k = k+n;
- if (k > 0x7fe) return huge*_copysign(huge,x); /* overflow */
- if (k > 0) /* normal result */
- {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
- if (k <= -54) {
- if (n > 50000) /* in case integer overflow in n+k */
- return huge*_copysign(huge,x); /*overflow*/
- else return tiny*_copysign(tiny,x); /*underflow*/
- }
- k += 54; /* subnormal result */
- SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
- return x*twom54;
-}
diff --git a/libc/upstream-freebsd/lib/libc/locale/wcsftime.c b/libc/upstream-freebsd/lib/libc/locale/wcsftime.c
new file mode 100644
index 0000000..4fe6ad5
--- /dev/null
+++ b/libc/upstream-freebsd/lib/libc/locale/wcsftime.c
@@ -0,0 +1,124 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2002 Tim J. Robbins
+ * All rights reserved.
+ *
+ * Copyright (c) 2011 The FreeBSD Foundation
+ *
+ * Portions of this software were developed by David Chisnall
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * 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 <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <time.h>
+#include <wchar.h>
+#include "xlocale_private.h"
+
+/*
+ * Convert date and time to a wide-character string.
+ *
+ * This is the wide-character counterpart of strftime(). So that we do not
+ * have to duplicate the code of strftime(), we convert the format string to
+ * multibyte, call strftime(), then convert the result back into wide
+ * characters.
+ *
+ * This technique loses in the presence of stateful multibyte encoding if any
+ * of the conversions in the format string change conversion state. When
+ * stateful encoding is implemented, we will need to reset the state between
+ * format specifications in the format string.
+ */
+size_t
+wcsftime_l(wchar_t * __restrict wcs, size_t maxsize,
+ const wchar_t * __restrict format, const struct tm * __restrict timeptr,
+ locale_t locale)
+{
+ static const mbstate_t initial;
+ mbstate_t mbs;
+ char *dst, *sformat;
+ const char *dstp;
+ const wchar_t *formatp;
+ size_t n, sflen;
+ int sverrno;
+ FIX_LOCALE(locale);
+
+ sformat = dst = NULL;
+
+ /*
+ * Convert the supplied format string to a multibyte representation
+ * for strftime(), which only handles single-byte characters.
+ */
+ mbs = initial;
+ formatp = format;
+ sflen = wcsrtombs_l(NULL, &formatp, 0, &mbs, locale);
+ if (sflen == (size_t)-1)
+ goto error;
+ if ((sformat = malloc(sflen + 1)) == NULL)
+ goto error;
+ mbs = initial;
+ wcsrtombs_l(sformat, &formatp, sflen + 1, &mbs, locale);
+
+ /*
+ * Allocate memory for longest multibyte sequence that will fit
+ * into the caller's buffer and call strftime() to fill it.
+ * Then, copy and convert the result back into wide characters in
+ * the caller's buffer.
+ */
+ if (SIZE_T_MAX / MB_CUR_MAX <= maxsize) {
+ /* maxsize is prepostorously large - avoid int. overflow. */
+ errno = EINVAL;
+ goto error;
+ }
+ if ((dst = malloc(maxsize * MB_CUR_MAX)) == NULL)
+ goto error;
+ if (strftime_l(dst, maxsize, sformat, timeptr, locale) == 0)
+ goto error;
+ dstp = dst;
+ mbs = initial;
+ n = mbsrtowcs_l(wcs, &dstp, maxsize, &mbs, locale);
+ if (n == (size_t)-2 || n == (size_t)-1 || dstp != NULL)
+ goto error;
+
+ free(sformat);
+ free(dst);
+ return (n);
+
+error:
+ sverrno = errno;
+ free(sformat);
+ free(dst);
+ errno = sverrno;
+ return (0);
+}
+size_t
+wcsftime(wchar_t * __restrict wcs, size_t maxsize,
+ const wchar_t * __restrict format, const struct tm * __restrict timeptr)
+{
+ return wcsftime_l(wcs, maxsize, format, timeptr, __get_locale());
+}
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/getopt_long.c b/libc/upstream-freebsd/lib/libc/stdlib/getopt_long.c
index 6a3067c..1f3548b 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/getopt_long.c
+++ b/libc/upstream-freebsd/lib/libc/stdlib/getopt_long.c
@@ -55,7 +55,7 @@
#endif /* LIBC_SCCS and not lint */
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/stdlib/getopt_long.c 342757 2019-01-04 03:13:24Z kevans $");
+__FBSDID("$FreeBSD$");
#include <err.h>
#include <errno.h>
@@ -88,7 +88,7 @@
#define BADARG ((*options == ':') ? (int)':' : (int)'?')
#define INORDER (int)1
-#define EMSG ""
+static char EMSG[] = "";
#ifdef GNU_COMPATIBLE
#define NO_PREFIX (-1)
@@ -194,7 +194,7 @@
{
char *current_argv, *has_equal;
#ifdef GNU_COMPATIBLE
- char *current_dash;
+ const char *current_dash;
#endif
size_t current_argv_len;
int i, match, exact_match, second_partial_match;
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/hcreate.c b/libc/upstream-freebsd/lib/libc/stdlib/hcreate.c
index b175d34..c9a0847 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/hcreate.c
+++ b/libc/upstream-freebsd/lib/libc/stdlib/hcreate.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2015 Nuxi, https://nuxi.nl/
*
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/stdlib/hcreate.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <search.h>
#include <stdbool.h>
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/hcreate_r.c b/libc/upstream-freebsd/lib/libc/stdlib/hcreate_r.c
index 34db88e..83e322a 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/hcreate_r.c
+++ b/libc/upstream-freebsd/lib/libc/stdlib/hcreate_r.c
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/stdlib/hcreate_r.c 292767 2015-12-27 07:50:11Z ed $");
+__FBSDID("$FreeBSD$");
#include <search.h>
#include <stdlib.h>
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/hdestroy_r.c b/libc/upstream-freebsd/lib/libc/stdlib/hdestroy_r.c
index 76d8a42..890bd08 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/hdestroy_r.c
+++ b/libc/upstream-freebsd/lib/libc/stdlib/hdestroy_r.c
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/stdlib/hdestroy_r.c 292767 2015-12-27 07:50:11Z ed $");
+__FBSDID("$FreeBSD$");
#include <search.h>
#include <stdlib.h>
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/hsearch.h b/libc/upstream-freebsd/lib/libc/stdlib/hsearch.h
index a0542b5..649933d 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/hsearch.h
+++ b/libc/upstream-freebsd/lib/libc/stdlib/hsearch.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: head/lib/libc/stdlib/hsearch.h 292767 2015-12-27 07:50:11Z ed $
+ * $FreeBSD$
*/
#ifndef HSEARCH_H
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/hsearch_r.c b/libc/upstream-freebsd/lib/libc/stdlib/hsearch_r.c
index 9a859d3..2fb5991 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/hsearch_r.c
+++ b/libc/upstream-freebsd/lib/libc/stdlib/hsearch_r.c
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/stdlib/hsearch_r.c 292767 2015-12-27 07:50:11Z ed $");
+__FBSDID("$FreeBSD$");
#include <errno.h>
#include <limits.h>
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/qsort.c b/libc/upstream-freebsd/lib/libc/stdlib/qsort.c
index e0db4f3..0d65cd1 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/qsort.c
+++ b/libc/upstream-freebsd/lib/libc/stdlib/qsort.c
@@ -33,12 +33,20 @@
static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/stdlib/qsort.c 334928 2018-06-10 17:54:44Z kib $");
+__FBSDID("$FreeBSD$");
+#include <errno.h>
+#include <stdint.h>
#include <stdlib.h>
+#include <string.h>
+#include "libc_private.h"
-#ifdef I_AM_QSORT_R
+#if defined(I_AM_QSORT_R)
+typedef int cmp_t(const void *, const void *, void *);
+#elif defined(I_AM_QSORT_R_COMPAT)
typedef int cmp_t(void *, const void *, const void *);
+#elif defined(I_AM_QSORT_S)
+typedef int cmp_t(const void *, const void *, void *);
#else
typedef int cmp_t(const void *, const void *);
#endif
@@ -65,15 +73,19 @@
#define vecswap(a, b, n) \
if ((n) > 0) swapfunc(a, b, n)
-#ifdef I_AM_QSORT_R
+#if defined(I_AM_QSORT_R)
+#define CMP(t, x, y) (cmp((x), (y), (t)))
+#elif defined(I_AM_QSORT_R_COMPAT)
#define CMP(t, x, y) (cmp((t), (x), (y)))
+#elif defined(I_AM_QSORT_S)
+#define CMP(t, x, y) (cmp((x), (y), (t)))
#else
#define CMP(t, x, y) (cmp((x), (y)))
#endif
static inline char *
med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk
-#ifndef I_AM_QSORT_R
+#if !defined(I_AM_QSORT_R) && !defined(I_AM_QSORT_R_COMPAT) && !defined(I_AM_QSORT_S)
__unused
#endif
)
@@ -83,20 +95,28 @@
:(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
}
-#ifdef I_AM_QSORT_R
-void
-qsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
-#else
-#define thunk NULL
-void
-qsort(void *a, size_t n, size_t es, cmp_t *cmp)
+/*
+ * The actual qsort() implementation is static to avoid preemptible calls when
+ * recursing. Also give them different names for improved debugging.
+ */
+#if defined(I_AM_QSORT_R)
+#define local_qsort local_qsort_r
+#elif defined(I_AM_QSORT_R_COMPAT)
+#define local_qsort local_qsort_r_compat
+#elif defined(I_AM_QSORT_S)
+#define local_qsort local_qsort_s
#endif
+static void
+local_qsort(void *a, size_t n, size_t es, cmp_t *cmp, void *thunk)
{
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
size_t d1, d2;
int cmp_result;
int swap_cnt;
+ /* if there are less than 2 elements, then sorting is not needed */
+ if (__predict_false(n < 2))
+ return;
loop:
swap_cnt = 0;
if (n < 7) {
@@ -160,7 +180,12 @@
pn = (char *)a + n * es;
d1 = MIN(pa - (char *)a, pb - pa);
vecswap(a, pb - d1, d1);
- d1 = MIN(pd - pc, pn - pd - es);
+ /*
+ * Cast es to preserve signedness of right-hand side of MIN()
+ * expression, to avoid sign ambiguity in the implied comparison. es
+ * is safely within [0, SSIZE_MAX].
+ */
+ d1 = MIN(pd - pc, pn - pd - (ssize_t)es);
vecswap(pb, pn - d1, d1);
d1 = pb - pa;
@@ -168,11 +193,7 @@
if (d1 <= d2) {
/* Recurse on left partition, then iterate on right partition */
if (d1 > es) {
-#ifdef I_AM_QSORT_R
- qsort_r(a, d1 / es, es, thunk, cmp);
-#else
- qsort(a, d1 / es, es, cmp);
-#endif
+ local_qsort(a, d1 / es, es, cmp, thunk);
}
if (d2 > es) {
/* Iterate rather than recurse to save stack space */
@@ -184,11 +205,7 @@
} else {
/* Recurse on right partition, then iterate on left partition */
if (d2 > es) {
-#ifdef I_AM_QSORT_R
- qsort_r(pn - d2, d2 / es, es, thunk, cmp);
-#else
- qsort(pn - d2, d2 / es, es, cmp);
-#endif
+ local_qsort(pn - d2, d2 / es, es, cmp, thunk);
}
if (d1 > es) {
/* Iterate rather than recurse to save stack space */
@@ -198,3 +215,53 @@
}
}
}
+
+#if defined(I_AM_QSORT_R)
+void
+(qsort_r)(void *a, size_t n, size_t es, cmp_t *cmp, void *thunk)
+{
+ local_qsort_r(a, n, es, cmp, thunk);
+}
+#elif defined(I_AM_QSORT_R_COMPAT)
+void
+__qsort_r_compat(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
+{
+ local_qsort_r_compat(a, n, es, cmp, thunk);
+}
+#elif defined(I_AM_QSORT_S)
+errno_t
+qsort_s(void *a, rsize_t n, rsize_t es, cmp_t *cmp, void *thunk)
+{
+ if (n > RSIZE_MAX) {
+ __throw_constraint_handler_s("qsort_s : n > RSIZE_MAX", EINVAL);
+ return (EINVAL);
+ } else if (es > RSIZE_MAX) {
+ __throw_constraint_handler_s("qsort_s : es > RSIZE_MAX",
+ EINVAL);
+ return (EINVAL);
+ } else if (n != 0) {
+ if (a == NULL) {
+ __throw_constraint_handler_s("qsort_s : a == NULL",
+ EINVAL);
+ return (EINVAL);
+ } else if (cmp == NULL) {
+ __throw_constraint_handler_s("qsort_s : cmp == NULL",
+ EINVAL);
+ return (EINVAL);
+ } else if (es <= 0) {
+ __throw_constraint_handler_s("qsort_s : es <= 0",
+ EINVAL);
+ return (EINVAL);
+ }
+ }
+
+ local_qsort_s(a, n, es, cmp, thunk);
+ return (0);
+}
+#else
+void
+qsort(void *a, size_t n, size_t es, cmp_t *cmp)
+{
+ local_qsort(a, n, es, cmp, NULL);
+}
+#endif
diff --git a/libc/upstream-freebsd/lib/libc/stdlib/quick_exit.c b/libc/upstream-freebsd/lib/libc/stdlib/quick_exit.c
index 9e4e79d..d486b1a 100644
--- a/libc/upstream-freebsd/lib/libc/stdlib/quick_exit.c
+++ b/libc/upstream-freebsd/lib/libc/stdlib/quick_exit.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011 David Chisnall
* All rights reserved.
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: head/lib/libc/stdlib/quick_exit.c 326193 2017-11-25 17:12:48Z pfg $
+ * $FreeBSD$
*/
#include <sys/types.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcpcpy.c b/libc/upstream-freebsd/lib/libc/string/wcpcpy.c
index e040dba..41b7c51 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcpcpy.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcpcpy.c
@@ -35,7 +35,7 @@
static char sccsid[] = "@(#)strcpy.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcpcpy.c 326025 2017-11-20 19:49:47Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcpncpy.c b/libc/upstream-freebsd/lib/libc/string/wcpncpy.c
index 8bf6e87..ccc64cd 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcpncpy.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcpncpy.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2009 David Schultz <das@FreeBSD.org>
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcpncpy.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcscasecmp.c b/libc/upstream-freebsd/lib/libc/string/wcscasecmp.c
index 5bd468d..03a61f8 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcscasecmp.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcscasecmp.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2009 David Schultz <das@FreeBSD.org>
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcscasecmp.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
#include <wctype.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcscat.c b/libc/upstream-freebsd/lib/libc/string/wcscat.c
index 792f61e..777a576 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcscat.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcscat.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c)1999 Citrus Project,
* All rights reserved.
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wcscat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wcscat.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcschr.c b/libc/upstream-freebsd/lib/libc/string/wcschr.c
index ca740c0..a7f1de0 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcschr.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcschr.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2002 Tim J. Robbins
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcschr.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcscmp.c b/libc/upstream-freebsd/lib/libc/string/wcscmp.c
index db01892..7205238 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcscmp.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcscmp.c
@@ -39,7 +39,7 @@
__RCSID("$NetBSD: wcscmp.c,v 1.3 2001/01/05 12:13:12 itojun Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
-__FBSDID("$FreeBSD: head/lib/libc/string/wcscmp.c 326025 2017-11-20 19:49:47Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcscpy.c b/libc/upstream-freebsd/lib/libc/string/wcscpy.c
index a639e74..b400fae 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcscpy.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcscpy.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wcscpy.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcscspn.c b/libc/upstream-freebsd/lib/libc/string/wcscspn.c
index 8a7682f..a0db715 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcscspn.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcscspn.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wcscspn.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wcscspn.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcsdup.c b/libc/upstream-freebsd/lib/libc/string/wcsdup.c
index b97f766..327574b 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcsdup.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcsdup.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 Tim J. Robbins.
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcsdup.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcslcat.c b/libc/upstream-freebsd/lib/libc/string/wcslcat.c
index 9706fa6..f954b73 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcslcat.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcslcat.c
@@ -35,7 +35,7 @@
__RCSID("$NetBSD: wcslcat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wcslcat.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcslen.c b/libc/upstream-freebsd/lib/libc/string/wcslen.c
index c596825..cfd3aa2 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcslen.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcslen.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wcslen.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wcslen.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcsncasecmp.c b/libc/upstream-freebsd/lib/libc/string/wcsncasecmp.c
index a963444..39f58be 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcsncasecmp.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcsncasecmp.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2009 David Schultz <das@FreeBSD.org>
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcsncasecmp.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
#include <wctype.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcsncat.c b/libc/upstream-freebsd/lib/libc/string/wcsncat.c
index 0214af4..eb13fab 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcsncat.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcsncat.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wcsncat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wcsncat.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcsncmp.c b/libc/upstream-freebsd/lib/libc/string/wcsncmp.c
index 77b709c..55c88f6 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcsncmp.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcsncmp.c
@@ -36,7 +36,7 @@
__RCSID("$NetBSD: wcsncmp.c,v 1.3 2001/01/05 12:13:13 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wcsncmp.c 326025 2017-11-20 19:49:47Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcsncpy.c b/libc/upstream-freebsd/lib/libc/string/wcsncpy.c
index 4075ecc..f86e40f 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcsncpy.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcsncpy.c
@@ -38,7 +38,7 @@
#endif /* LIBC_SCCS and not lint */
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcsncpy.c 326025 2017-11-20 19:49:47Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcsnlen.c b/libc/upstream-freebsd/lib/libc/string/wcsnlen.c
index 271d341..15fd520 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcsnlen.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcsnlen.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2009 David Schultz <das@FreeBSD.org>
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcsnlen.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcspbrk.c b/libc/upstream-freebsd/lib/libc/string/wcspbrk.c
index 63efb01..0e9ccf6 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcspbrk.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcspbrk.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wcspbrk.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wcspbrk.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcsrchr.c b/libc/upstream-freebsd/lib/libc/string/wcsrchr.c
index 97665ca..cc5e7f2 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcsrchr.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcsrchr.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2002 Tim J. Robbins
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcsrchr.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcsspn.c b/libc/upstream-freebsd/lib/libc/string/wcsspn.c
index b08a39e..2b08acb 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcsspn.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcsspn.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wcsspn.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wcsspn.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcsstr.c b/libc/upstream-freebsd/lib/libc/string/wcsstr.c
index 4309025..74921fe 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcsstr.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcsstr.c
@@ -38,7 +38,7 @@
#endif /* LIBC_SCCS and not lint */
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcsstr.c 326025 2017-11-20 19:49:47Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wcstok.c b/libc/upstream-freebsd/lib/libc/string/wcstok.c
index 8d62bf7..b4bdc86 100644
--- a/libc/upstream-freebsd/lib/libc/string/wcstok.c
+++ b/libc/upstream-freebsd/lib/libc/string/wcstok.c
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/libc/string/wcstok.c 326025 2017-11-20 19:49:47Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wmemchr.c b/libc/upstream-freebsd/lib/libc/string/wmemchr.c
index 412a276..42ae286 100644
--- a/libc/upstream-freebsd/lib/libc/string/wmemchr.c
+++ b/libc/upstream-freebsd/lib/libc/string/wmemchr.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wmemchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wmemchr.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wmemcmp.c b/libc/upstream-freebsd/lib/libc/string/wmemcmp.c
index c1e9f3c..f1b1b00 100644
--- a/libc/upstream-freebsd/lib/libc/string/wmemcmp.c
+++ b/libc/upstream-freebsd/lib/libc/string/wmemcmp.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wmemcmp.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wmemcmp.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wmemcpy.c b/libc/upstream-freebsd/lib/libc/string/wmemcpy.c
index e0d6c04..30956eb 100644
--- a/libc/upstream-freebsd/lib/libc/string/wmemcpy.c
+++ b/libc/upstream-freebsd/lib/libc/string/wmemcpy.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wmemcpy.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wmemcpy.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <string.h>
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wmemmove.c b/libc/upstream-freebsd/lib/libc/string/wmemmove.c
index b84c2c0..5e8da9f 100644
--- a/libc/upstream-freebsd/lib/libc/string/wmemmove.c
+++ b/libc/upstream-freebsd/lib/libc/string/wmemmove.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wmemmove.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wmemmove.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <string.h>
#include <wchar.h>
diff --git a/libc/upstream-freebsd/lib/libc/string/wmemset.c b/libc/upstream-freebsd/lib/libc/string/wmemset.c
index d4d6308..fcf40ef 100644
--- a/libc/upstream-freebsd/lib/libc/string/wmemset.c
+++ b/libc/upstream-freebsd/lib/libc/string/wmemset.c
@@ -34,7 +34,7 @@
__RCSID("$NetBSD: wmemset.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
-__FBSDID("$FreeBSD: head/lib/libc/string/wmemset.c 326193 2017-11-25 17:12:48Z pfg $");
+__FBSDID("$FreeBSD$");
#include <wchar.h>
diff --git a/libc/upstream-netbsd/lib/libc/regex/regcomp.c b/libc/upstream-netbsd/lib/libc/regex/regcomp.c
index 957f8ac..86321c1 100644
--- a/libc/upstream-netbsd/lib/libc/regex/regcomp.c
+++ b/libc/upstream-netbsd/lib/libc/regex/regcomp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: regcomp.c,v 1.46 2021/03/11 15:00:29 christos Exp $ */
+/* $NetBSD: regcomp.c,v 1.47 2022/12/21 17:44:15 wiz Exp $ */
/*-
* SPDX-License-Identifier: BSD-3-Clause
@@ -51,9 +51,7 @@
static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
__FBSDID("$FreeBSD: head/lib/libc/regex/regcomp.c 368359 2020-12-05 03:18:48Z kevans $");
#endif
-__RCSID("$NetBSD: regcomp.c,v 1.46 2021/03/11 15:00:29 christos Exp $");
-
-#define _OPENBSD_SOURCE
+__RCSID("$NetBSD: regcomp.c,v 1.47 2022/12/21 17:44:15 wiz Exp $");
#ifndef LIBHACK
#define REGEX_GNU_EXTENSIONS
diff --git a/libc/upstream-netbsd/android/include/rand48.h b/libc/upstream-netbsd/lib/libc/stdlib/rand48.h
similarity index 80%
rename from libc/upstream-netbsd/android/include/rand48.h
rename to libc/upstream-netbsd/lib/libc/stdlib/rand48.h
index 1279906..1ad8b0d 100644
--- a/libc/upstream-netbsd/android/include/rand48.h
+++ b/libc/upstream-netbsd/lib/libc/stdlib/rand48.h
@@ -18,10 +18,10 @@
#include <stdlib.h>
-__LIBC_HIDDEN__ void __dorand48(unsigned short[3]);
-__LIBC_HIDDEN__ unsigned short __rand48_seed[3];
-__LIBC_HIDDEN__ unsigned short __rand48_mult[3];
-__LIBC_HIDDEN__ unsigned short __rand48_add;
+extern void __dorand48(unsigned short[3]);
+extern unsigned short __rand48_seed[3];
+extern unsigned short __rand48_mult[3];
+extern unsigned short __rand48_add;
#define RAND48_SEED_0 (0x330e)
#define RAND48_SEED_1 (0xabcd)
diff --git a/libc/upstream-openbsd/lib/libc/stdio/open_memstream.c b/libc/upstream-openbsd/lib/libc/stdio/open_memstream.c
index 6ee5a5c..af0169f 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/open_memstream.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/open_memstream.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: open_memstream.c,v 1.8 2019/05/02 08:30:10 yasuoka Exp $ */
+/* $OpenBSD: open_memstream.c,v 1.10 2023/07/11 12:14:16 claudio Exp $ */
/*
* Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -53,7 +53,6 @@
p = recallocarray(st->string, st->size, sz, 1);
if (!p)
return (-1);
- bzero(p + st->size, sz - st->size);
*st->pbuf = st->string = p;
st->size = sz;
}
@@ -136,7 +135,6 @@
return (NULL);
}
- *st->string = '\0';
st->pos = 0;
st->len = 0;
st->pbuf = pbuf;
diff --git a/libc/upstream-openbsd/lib/libc/stdio/open_wmemstream.c b/libc/upstream-openbsd/lib/libc/stdio/open_wmemstream.c
index aceef35..fca0b71 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/open_wmemstream.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/open_wmemstream.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: open_wmemstream.c,v 1.8 2015/09/12 16:23:14 guenther Exp $ */
+/* $OpenBSD: open_wmemstream.c,v 1.10 2023/07/11 12:14:16 claudio Exp $ */
/*
* Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -52,10 +52,9 @@
if (sz < end + 1)
sz = end + 1;
- p = reallocarray(st->string, sz, sizeof(wchar_t));
+ p = recallocarray(st->string, st->size, 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;
}
@@ -146,7 +145,6 @@
return (NULL);
}
- *st->string = L'\0';
st->pos = 0;
st->len = 0;
st->pbuf = pbuf;
diff --git a/libc/upstream-openbsd/lib/libc/time/wcsftime.c b/libc/upstream-openbsd/lib/libc/time/wcsftime.c
deleted file mode 100644
index 6870871..0000000
--- a/libc/upstream-openbsd/lib/libc/time/wcsftime.c
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $OpenBSD: wcsftime.c,v 1.7 2019/05/12 12:49:52 schwarze Exp $ */
-/*
-** Based on the UCB version with the ID appearing below.
-** This is ANSIish only when "multibyte character == plain character".
-**
-** Copyright (c) 1989, 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 <fcntl.h>
-#include <locale.h>
-#include <wchar.h>
-
-#include "private.h"
-#include "tzfile.h"
-
-struct lc_time_T {
- const wchar_t * mon[MONSPERYEAR];
- const wchar_t * month[MONSPERYEAR];
- const wchar_t * wday[DAYSPERWEEK];
- const wchar_t * weekday[DAYSPERWEEK];
- const wchar_t * X_fmt;
- const wchar_t * x_fmt;
- const wchar_t * c_fmt;
- const wchar_t * am;
- const wchar_t * pm;
- const wchar_t * date_fmt;
-};
-
-#define Locale (&C_time_locale)
-
-static const struct lc_time_T C_time_locale = {
- {
- L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun",
- L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec"
- }, {
- L"January", L"February", L"March", L"April", L"May", L"June",
- L"July", L"August", L"September", L"October", L"November",
- L"December"
- }, {
- L"Sun", L"Mon", L"Tue", L"Wed",
- L"Thu", L"Fri", L"Sat"
- }, {
- L"Sunday", L"Monday", L"Tuesday", L"Wednesday",
- L"Thursday", L"Friday", L"Saturday"
- },
-
- /* X_fmt */
- L"%H:%M:%S",
-
- /*
- ** x_fmt
- ** C99 requires this format.
- ** Using just numbers (as here) makes Quakers happier;
- ** it's also compatible with SVR4.
- */
- L"%m/%d/%y",
-
- /*
- ** c_fmt
- ** C99 requires this format.
- ** Previously this code used "%D %X", but we now conform to C99.
- ** Note that
- ** "%a %b %d %H:%M:%S %Y"
- ** is used by Solaris 2.3.
- */
- L"%a %b %e %T %Y",
-
- /* am */
- L"AM",
-
- /* pm */
- L"PM",
-
- /* date_fmt */
- L"%a %b %e %H:%M:%S %Z %Y"
-};
-
-#define UNKNOWN L"?"
-static wchar_t * _add(const wchar_t *, wchar_t *, const wchar_t *);
-static wchar_t * _sadd(const char *, wchar_t *, const wchar_t *);
-static wchar_t * _conv(int, const wchar_t *, wchar_t *, const wchar_t *);
-static wchar_t * _fmt(const wchar_t *, const struct tm *, wchar_t *, const wchar_t *,
- int *);
-static wchar_t * _yconv(int, int, int, int, wchar_t *, const wchar_t *);
-
-extern char * tzname[];
-
-#define IN_NONE 0
-#define IN_SOME 1
-#define IN_THIS 2
-#define IN_ALL 3
-
-size_t
-wcsftime(wchar_t *__restrict s, size_t maxsize,
- const wchar_t *__restrict format, const struct tm *__restrict t)
-{
- wchar_t *p;
- int warn;
-
- tzset();
- warn = IN_NONE;
- p = _fmt(((format == NULL) ? L"%c" : format), t, s, s + maxsize, &warn);
- if (p == s + maxsize) {
- if (maxsize > 0)
- s[maxsize - 1] = '\0';
- return 0;
- }
- *p = L'\0';
- return p - s;
-}
-
-static wchar_t *
-_fmt(const wchar_t *format, const struct tm *t, wchar_t *pt,
- const wchar_t *ptlim, int *warnp)
-{
- for ( ; *format; ++format) {
- if (*format != L'%') {
- if (pt == ptlim)
- break;
- *pt++ = *format;
- continue;
- }
-label:
- switch (*++format) {
- case '\0':
- --format;
- break;
- case 'A':
- pt = _add((t->tm_wday < 0 ||
- t->tm_wday >= DAYSPERWEEK) ?
- UNKNOWN : Locale->weekday[t->tm_wday],
- pt, ptlim);
- continue;
- case 'a':
- pt = _add((t->tm_wday < 0 ||
- t->tm_wday >= DAYSPERWEEK) ?
- UNKNOWN : Locale->wday[t->tm_wday],
- pt, ptlim);
- continue;
- case 'B':
- pt = _add((t->tm_mon < 0 ||
- t->tm_mon >= MONSPERYEAR) ?
- UNKNOWN : Locale->month[t->tm_mon],
- pt, ptlim);
- continue;
- case 'b':
- case 'h':
- pt = _add((t->tm_mon < 0 ||
- t->tm_mon >= MONSPERYEAR) ?
- UNKNOWN : Locale->mon[t->tm_mon],
- pt, ptlim);
- continue;
- case 'C':
- /*
- ** %C used to do a...
- ** _fmt("%a %b %e %X %Y", t);
- ** ...whereas now POSIX 1003.2 calls for
- ** something completely different.
- ** (ado, 1993-05-24)
- */
- pt = _yconv(t->tm_year, TM_YEAR_BASE, 1, 0,
- pt, ptlim);
- continue;
- case 'c':
- {
- int warn2 = IN_SOME;
-
- pt = _fmt(Locale->c_fmt, t, pt, ptlim, &warn2);
- if (warn2 == IN_ALL)
- warn2 = IN_THIS;
- if (warn2 > *warnp)
- *warnp = warn2;
- }
- continue;
- case 'D':
- pt = _fmt(L"%m/%d/%y", t, pt, ptlim, warnp);
- continue;
- case 'd':
- pt = _conv(t->tm_mday, L"%02d", pt, ptlim);
- continue;
- case 'E':
- case 'O':
- /*
- ** C99 locale modifiers.
- ** The sequences
- ** %Ec %EC %Ex %EX %Ey %EY
- ** %Od %oe %OH %OI %Om %OM
- ** %OS %Ou %OU %OV %Ow %OW %Oy
- ** are supposed to provide alternate
- ** representations.
- */
- goto label;
- case 'e':
- pt = _conv(t->tm_mday, L"%2d", pt, ptlim);
- continue;
- case 'F':
- pt = _fmt(L"%Y-%m-%d", t, pt, ptlim, warnp);
- continue;
- case 'H':
- pt = _conv(t->tm_hour, L"%02d", pt, ptlim);
- continue;
- case 'I':
- pt = _conv((t->tm_hour % 12) ?
- (t->tm_hour % 12) : 12,
- L"%02d", pt, ptlim);
- continue;
- case 'j':
- pt = _conv(t->tm_yday + 1, L"%03d", pt, ptlim);
- continue;
- case 'k':
- /*
- ** This used to be...
- ** _conv(t->tm_hour % 12 ?
- ** t->tm_hour % 12 : 12, 2, ' ');
- ** ...and has been changed to the below to
- ** match SunOS 4.1.1 and Arnold Robbins'
- ** strftime version 3.0. That is, "%k" and
- ** "%l" have been swapped.
- ** (ado, 1993-05-24)
- */
- pt = _conv(t->tm_hour, L"%2d", pt, ptlim);
- continue;
- case 'l':
- /*
- ** This used to be...
- ** _conv(t->tm_hour, 2, ' ');
- ** ...and has been changed to the below to
- ** match SunOS 4.1.1 and Arnold Robbin's
- ** strftime version 3.0. That is, "%k" and
- ** "%l" have been swapped.
- ** (ado, 1993-05-24)
- */
- pt = _conv((t->tm_hour % 12) ?
- (t->tm_hour % 12) : 12,
- L"%2d", pt, ptlim);
- continue;
- case 'M':
- pt = _conv(t->tm_min, L"%02d", pt, ptlim);
- continue;
- case 'm':
- pt = _conv(t->tm_mon + 1, L"%02d", pt, ptlim);
- continue;
- case 'n':
- pt = _add(L"\n", pt, ptlim);
- continue;
- case 'p':
- pt = _add((t->tm_hour >= (HOURSPERDAY / 2)) ?
- Locale->pm :
- Locale->am,
- pt, ptlim);
- continue;
- case 'R':
- pt = _fmt(L"%H:%M", t, pt, ptlim, warnp);
- continue;
- case 'r':
- pt = _fmt(L"%I:%M:%S %p", t, pt, ptlim, warnp);
- continue;
- case 'S':
- pt = _conv(t->tm_sec, L"%02d", pt, ptlim);
- continue;
- case 's':
- {
- struct tm tm;
- wchar_t buf[INT_STRLEN_MAXIMUM(
- time_t) + 1];
- time_t mkt;
-
- tm = *t;
- mkt = mktime(&tm);
- (void) swprintf(buf,
- sizeof buf/sizeof buf[0],
- L"%ld", (long) mkt);
- pt = _add(buf, pt, ptlim);
- }
- continue;
- case 'T':
- pt = _fmt(L"%H:%M:%S", t, pt, ptlim, warnp);
- continue;
- case 't':
- pt = _add(L"\t", pt, ptlim);
- continue;
- case 'U':
- pt = _conv((t->tm_yday + DAYSPERWEEK -
- t->tm_wday) / DAYSPERWEEK,
- L"%02d", pt, ptlim);
- continue;
- case 'u':
- /*
- ** From Arnold Robbins' strftime version 3.0:
- ** "ISO 8601: Weekday as a decimal number
- ** [1 (Monday) - 7]"
- ** (ado, 1993-05-24)
- */
- pt = _conv((t->tm_wday == 0) ?
- DAYSPERWEEK : t->tm_wday,
- L"%d", pt, ptlim);
- continue;
- case 'V': /* ISO 8601 week number */
- case 'G': /* ISO 8601 year (four digits) */
- case 'g': /* ISO 8601 year (two digits) */
-/*
-** From Arnold Robbins' strftime version 3.0: "the week number of the
-** year (the first Monday as the first day of week 1) as a decimal number
-** (01-53)."
-** (ado, 1993-05-24)
-**
-** From "http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html" by Markus Kuhn:
-** "Week 01 of a year is per definition the first week which has the
-** Thursday in this year, which is equivalent to the week which contains
-** the fourth day of January. In other words, the first week of a new year
-** is the week which has the majority of its days in the new year. Week 01
-** might also contain days from the previous year and the week before week
-** 01 of a year is the last week (52 or 53) of the previous year even if
-** it contains days from the new year. A week starts with Monday (day 1)
-** and ends with Sunday (day 7). For example, the first week of the year
-** 1997 lasts from 1996-12-30 to 1997-01-05..."
-** (ado, 1996-01-02)
-*/
- {
- int year;
- int base;
- int yday;
- int wday;
- int w;
-
- year = t->tm_year;
- base = TM_YEAR_BASE;
- yday = t->tm_yday;
- wday = t->tm_wday;
- for ( ; ; ) {
- int len;
- int bot;
- int top;
-
- len = isleap_sum(year, base) ?
- DAYSPERLYEAR :
- DAYSPERNYEAR;
- /*
- ** What yday (-3 ... 3) does the ISO year
- ** begin on?
- */
- bot = ((yday + 11 - wday) % DAYSPERWEEK) - 3;
- /*
- ** What yday does the NEXT ISO year begin on?
- */
- top = bot - (len % DAYSPERWEEK);
- if (top < -3)
- top += DAYSPERWEEK;
- top += len;
- if (yday >= top) {
- ++base;
- w = 1;
- break;
- }
- if (yday >= bot) {
- w = 1 + ((yday - bot) / DAYSPERWEEK);
- break;
- }
- --base;
- yday += isleap_sum(year, base) ?
- DAYSPERLYEAR :
- DAYSPERNYEAR;
- }
- if ((w == 52 && t->tm_mon == TM_JANUARY) ||
- (w == 1 && t->tm_mon == TM_DECEMBER))
- w = 53;
- if (*format == 'V')
- pt = _conv(w, L"%02d", pt, ptlim);
- else if (*format == 'g') {
- *warnp = IN_ALL;
- pt = _yconv(year, base, 0, 1, pt, ptlim);
- } else
- pt = _yconv(year, base, 1, 1, pt, ptlim);
- }
- continue;
- case 'v':
- /*
- ** From Arnold Robbins' strftime version 3.0:
- ** "date as dd-bbb-YYYY"
- ** (ado, 1993-05-24)
- */
- pt = _fmt(L"%e-%b-%Y", t, pt, ptlim, warnp);
- continue;
- case 'W':
- pt = _conv((t->tm_yday + DAYSPERWEEK -
- (t->tm_wday ?
- (t->tm_wday - 1) :
- (DAYSPERWEEK - 1))) / DAYSPERWEEK,
- L"%02d", pt, ptlim);
- continue;
- case 'w':
- pt = _conv(t->tm_wday, L"%d", pt, ptlim);
- continue;
- case 'X':
- pt = _fmt(Locale->X_fmt, t, pt, ptlim, warnp);
- continue;
- case 'x':
- {
- int warn2 = IN_SOME;
-
- pt = _fmt(Locale->x_fmt, t, pt, ptlim, &warn2);
- if (warn2 == IN_ALL)
- warn2 = IN_THIS;
- if (warn2 > *warnp)
- *warnp = warn2;
- }
- continue;
- case 'y':
- *warnp = IN_ALL;
- pt = _yconv(t->tm_year, TM_YEAR_BASE, 0, 1, pt, ptlim);
- continue;
- case 'Y':
- pt = _yconv(t->tm_year, TM_YEAR_BASE, 1, 1, pt, ptlim);
- continue;
- case 'Z':
- if (t->tm_zone != NULL)
- pt = _sadd(t->tm_zone, pt, ptlim);
- else
- if (t->tm_isdst >= 0)
- pt = _sadd(tzname[t->tm_isdst != 0],
- pt, ptlim);
- /*
- ** C99 says that %Z must be replaced by the
- ** empty string if the time zone is not
- ** determinable.
- */
- continue;
- case 'z':
- {
- int diff;
- wchar_t const * sign;
-
- if (t->tm_isdst < 0)
- continue;
- diff = t->tm_gmtoff;
- if (diff < 0) {
- sign = L"-";
- diff = -diff;
- } else
- sign = L"+";
- pt = _add(sign, pt, ptlim);
- diff /= SECSPERMIN;
- diff = (diff / MINSPERHOUR) * 100 +
- (diff % MINSPERHOUR);
- pt = _conv(diff, L"%04d", pt, ptlim);
- }
- continue;
- case '+':
- pt = _fmt(Locale->date_fmt, t, pt, ptlim, warnp);
- continue;
- case '%':
- /*
- ** X311J/88-090 (4.12.3.5): if conversion wchar_t is
- ** undefined, behavior is undefined. Print out the
- ** character itself as printf(3) also does.
- */
- default:
- if (pt != ptlim)
- *pt++ = *format;
- break;
- }
- }
- return pt;
-}
-
-static wchar_t *
-_conv(int n, const wchar_t *format, wchar_t *pt, const wchar_t *ptlim)
-{
- wchar_t buf[INT_STRLEN_MAXIMUM(int) + 1];
-
- (void) swprintf(buf, sizeof buf/sizeof buf[0], format, n);
- return _add(buf, pt, ptlim);
-}
-
-static wchar_t *
-_add(const wchar_t *str, wchar_t *pt, const wchar_t *ptlim)
-{
- while (pt < ptlim && (*pt = *str++) != L'\0')
- ++pt;
- return pt;
-}
-
-static wchar_t *
-_sadd(const char *str, wchar_t *pt, const wchar_t *ptlim)
-{
- while (pt < ptlim && (*pt = btowc(*str++)) != L'\0')
- ++pt;
- return pt;
-}
-/*
-** POSIX and the C Standard are unclear or inconsistent about
-** what %C and %y do if the year is negative or exceeds 9999.
-** Use the convention that %C concatenated with %y yields the
-** same output as %Y, and that %Y contains at least 4 bytes,
-** with more only if necessary.
-*/
-
-static wchar_t *
-_yconv(int a, int b, int convert_top, int convert_yy, wchar_t *pt,
- const wchar_t *ptlim)
-{
- int lead;
- int trail;
-
-#define DIVISOR 100
- trail = a % DIVISOR + b % DIVISOR;
- lead = a / DIVISOR + b / DIVISOR + trail / DIVISOR;
- trail %= DIVISOR;
- if (trail < 0 && lead > 0) {
- trail += DIVISOR;
- --lead;
- } else if (lead < 0 && trail > 0) {
- trail -= DIVISOR;
- ++lead;
- }
- if (convert_top) {
- if (lead == 0 && trail < 0)
- pt = _add(L"-0", pt, ptlim);
- else pt = _conv(lead, L"%02d", pt, ptlim);
- }
- if (convert_yy)
- pt = _conv(((trail < 0) ? -trail : trail), L"%02d", pt, ptlim);
- return pt;
-}
-
diff --git a/libdl/libdl_cfi.cpp b/libdl/libdl_cfi.cpp
index 3b68fc7..23cd7f5 100644
--- a/libdl/libdl_cfi.cpp
+++ b/libdl/libdl_cfi.cpp
@@ -26,15 +26,15 @@
// dlopen/dlclose.
static struct {
uintptr_t v;
- char padding[PAGE_SIZE - sizeof(v)];
-} shadow_base_storage alignas(PAGE_SIZE);
+ char padding[max_page_size() - sizeof(v)];
+} shadow_base_storage alignas(max_page_size());
// __cfi_init is called by the loader as soon as the shadow is mapped. This may happen very early
// during startup, before libdl.so global constructors, and, on i386, even before __libc_sysinfo is
// initialized. This function should not do any system calls.
extern "C" uintptr_t* __cfi_init(uintptr_t shadow_base) {
shadow_base_storage.v = shadow_base;
- static_assert(sizeof(shadow_base_storage) == PAGE_SIZE, "");
+ static_assert(sizeof(shadow_base_storage) == max_page_size(), "");
return &shadow_base_storage.v;
}
diff --git a/libfdtrack/Android.bp b/libfdtrack/Android.bp
index 83ea7cb..7539052 100644
--- a/libfdtrack/Android.bp
+++ b/libfdtrack/Android.bp
@@ -22,10 +22,16 @@
static_libs: [
"libasync_safe",
"libbase",
+ "libdexfile_support",
"libunwindstack",
"liblzma",
"liblog",
],
+ target: {
+ recovery: {
+ exclude_static_libs: ["libdexfile_support"],
+ },
+ },
version_script: "libfdtrack.map.txt",
allow_undefined_symbols: true,
diff --git a/libfdtrack/fdtrack.cpp b/libfdtrack/fdtrack.cpp
index b064401..57b9d37 100644
--- a/libfdtrack/fdtrack.cpp
+++ b/libfdtrack/fdtrack.cpp
@@ -45,10 +45,8 @@
#include <android-base/thread_annotations.h>
#include <async_safe/log.h>
#include <bionic/reserved_signals.h>
-#include <unwindstack/Maps.h>
-#include <unwindstack/Regs.h>
-#include <unwindstack/RegsGetLocal.h>
-#include <unwindstack/Unwinder.h>
+
+#include <unwindstack/AndroidUnwinder.h>
struct FdEntry {
std::mutex mutex;
@@ -70,22 +68,16 @@
// Only unwind up to 32 frames outside of libfdtrack.so.
static constexpr size_t kStackDepth = 32;
-// Skip any initial frames from libfdtrack.so.
-// Also ignore frames from ART (http://b/236197847) because we'd rather spend
-// our precious few frames on the actual Java calling code rather than the
-// implementation of JNI!
-static std::vector<std::string> kSkipFdtrackLib
- [[clang::no_destroy]] = {"libfdtrack.so", "libart.so"};
-
static bool installed = false;
static std::array<FdEntry, kFdTableSize> stack_traces [[clang::no_destroy]];
-static unwindstack::LocalUpdatableMaps& Maps() {
- static android::base::NoDestructor<unwindstack::LocalUpdatableMaps> maps;
- return *maps.get();
-}
-static std::shared_ptr<unwindstack::Memory>& ProcessMemory() {
- static android::base::NoDestructor<std::shared_ptr<unwindstack::Memory>> process_memory;
- return *process_memory.get();
+static unwindstack::AndroidLocalUnwinder& Unwinder() {
+ // Skip any initial frames from libfdtrack.so.
+ // Also ignore frames from ART (http://b/236197847) because we'd rather spend
+ // our precious few frames on the actual Java calling code rather than the
+ // implementation of JNI!
+ static android::base::NoDestructor<unwindstack::AndroidLocalUnwinder> unwinder(
+ std::vector<std::string>{"libfdtrack.so", "libart.so"});
+ return *unwinder.get();
}
__attribute__((constructor)) static void ctor() {
@@ -104,8 +96,8 @@
sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
sigaction(BIONIC_SIGNAL_FDTRACK, &sa, nullptr);
- if (Maps().Parse()) {
- ProcessMemory() = unwindstack::Memory::CreateProcessMemoryThreadCached(getpid());
+ unwindstack::ErrorData error;
+ if (Unwinder().Initialize(error)) {
android_fdtrack_hook_t expected = nullptr;
installed = android_fdtrack_compare_exchange_hook(&expected, &fd_hook);
}
@@ -133,11 +125,10 @@
std::lock_guard<std::mutex> lock(entry->mutex);
entry->backtrace.clear();
- std::unique_ptr<unwindstack::Regs> regs(unwindstack::Regs::CreateFromLocal());
- unwindstack::RegsGetLocal(regs.get());
- unwindstack::Unwinder unwinder(kStackDepth, &Maps(), regs.get(), ProcessMemory());
- unwinder.Unwind(&kSkipFdtrackLib);
- entry->backtrace = unwinder.ConsumeFrames();
+ unwindstack::AndroidUnwinderData data(kStackDepth);
+ if (Unwinder().Unwind(data)) {
+ entry->backtrace = std::move(data.frames);
+ }
}
} else if (event->type == ANDROID_FDTRACK_EVENT_TYPE_CLOSE) {
if (FdEntry* entry = GetFdEntry(event->fd); entry) {
diff --git a/libm/Android.bp b/libm/Android.bp
index 13fbf9a..a89885f 100644
--- a/libm/Android.bp
+++ b/libm/Android.bp
@@ -400,7 +400,6 @@
],
cflags: [
- "-D__BIONIC_LP32_USE_LONG_DOUBLE",
"-D_BSD_SOURCE",
"-DFLT_EVAL_METHOD=0",
"-include freebsd-compat.h",
@@ -467,8 +466,6 @@
name: "libm",
symbol_file: "libm.map.txt",
first_version: "9",
- // APIs implemented in asm don't have debug info: http://b/190554910.
- allow_untyped_symbols: true,
}
genrule {
@@ -510,3 +507,8 @@
tools: ["generate-version-script"],
cmd: "$(location generate-version-script) x86_64 $(in) $(out)",
}
+
+filegroup {
+ name: "libc_ldexp_srcs",
+ srcs: ["upstream-freebsd/lib/msun/src/s_scalbn.c"],
+}
diff --git a/libm/NOTICE b/libm/NOTICE
index 5e2f8ca..31337e7 100644
--- a/libm/NOTICE
+++ b/libm/NOTICE
@@ -1176,6 +1176,32 @@
-------------------------------------------------------------------
+Copyright (c) 2017, 2023 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.
+
+-------------------------------------------------------------------
+
From: @(#)s_ilogb.c 5.1 93/09/24
====================================================
Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/ld128/invtrig.c b/libm/upstream-freebsd/lib/msun/ld128/invtrig.c
index ab93732..3ba767b 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/invtrig.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/invtrig.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/ld128/invtrig.h b/libm/upstream-freebsd/lib/msun/ld128/invtrig.h
index 423b568..3f505c5 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/invtrig.h
+++ b/libm/upstream-freebsd/lib/msun/ld128/invtrig.h
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/ld128/k_expl.h b/libm/upstream-freebsd/lib/msun/ld128/k_expl.h
index 159338f..3faf7a7 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/k_expl.h
+++ b/libm/upstream-freebsd/lib/msun/ld128/k_expl.h
@@ -1,7 +1,7 @@
/* from: FreeBSD: head/lib/msun/ld128/s_expl.c 251345 2013-06-03 20:09:22Z kargl */
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2009-2013 Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_exp2l.c b/libm/upstream-freebsd/lib/msun/ld128/s_exp2l.c
index ee3d2c7..bcbdc5f 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/s_exp2l.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_exp2l.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005-2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_expl.c b/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
index 5b786af..0274a8f 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2009-2013 Steven G. Kargl
* All rights reserved.
@@ -65,8 +65,6 @@
int k;
uint16_t hx, ix;
- DOPRINT_START(&x);
-
/* Filter out exceptional cases. */
u.e = x;
hx = u.xbits.expsign;
@@ -74,15 +72,15 @@
if (ix >= BIAS + 13) { /* |x| >= 8192 or x is NaN */
if (ix == BIAS + LDBL_MAX_EXP) {
if (hx & 0x8000) /* x is -Inf or -NaN */
- RETURNP(-1 / x);
- RETURNP(x + x); /* x is +Inf or +NaN */
+ RETURNF(-1 / x);
+ RETURNF(x + x); /* x is +Inf or +NaN */
}
if (x > o_threshold)
- RETURNP(huge * huge);
+ RETURNF(huge * huge);
if (x < u_threshold)
- RETURNP(tiny * tiny);
+ RETURNF(tiny * tiny);
} else if (ix < BIAS - 114) { /* |x| < 0x1p-114 */
- RETURN2P(1, x); /* 1 with inexact iff x != 0 */
+ RETURNF(1 + x); /* 1 with inexact iff x != 0 */
}
ENTERI();
@@ -210,8 +208,6 @@
int k, n, n2;
uint16_t hx, ix;
- DOPRINT_START(&x);
-
/* Filter out exceptional cases. */
u.e = x;
hx = u.xbits.expsign;
@@ -219,11 +215,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 */
- RETURNP(-1 / x - 1);
- RETURNP(x + x); /* x is +Inf or +NaN */
+ RETURNF(-1 / x - 1);
+ RETURNF(x + x); /* x is +Inf or +NaN */
}
if (x > o_threshold)
- RETURNP(huge * huge);
+ RETURNF(huge * huge);
/*
* expm1l() never underflows, but it must avoid
* unrepresentable large negative exponents. We used a
@@ -232,7 +228,7 @@
* in the same way as large ones here.
*/
if (hx & 0x8000) /* x <= -128 */
- RETURN2P(tiny, -1); /* good for x < -114ln2 - eps */
+ RETURNF(tiny - 1); /* good for x < -114ln2 - eps */
}
ENTERI();
@@ -244,7 +240,7 @@
if (x < T3) {
if (ix < BIAS - 113) { /* |x| < 0x1p-113 */
/* x (rounded) with inexact if x != 0: */
- RETURNPI(x == 0 ? x :
+ RETURNI(x == 0 ? x :
(0x1p200 * x + fabsl(x)) * 0x1p-200);
}
q = x * x2 * C3 + x2 * x2 * (C4 + x * (C5 + x * (C6 +
@@ -265,9 +261,9 @@
hx2_hi = x_hi * x_hi / 2;
hx2_lo = x_lo * (x + x_hi) / 2;
if (ix >= BIAS - 7)
- RETURN2PI(hx2_hi + x_hi, hx2_lo + x_lo + q);
+ RETURNI((hx2_hi + x_hi) + (hx2_lo + x_lo + q));
else
- RETURN2PI(x, hx2_lo + q + hx2_hi);
+ RETURNI(x + (hx2_lo + q + hx2_hi));
}
/* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_logl.c b/libm/upstream-freebsd/lib/msun/ld128/s_logl.c
index 4774a27..bc53884 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/s_logl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_logl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007-2013 Bruce D. Evans
* All rights reserved.
@@ -573,24 +573,23 @@
int i, k;
int16_t ax, hx;
- DOPRINT_START(&x);
EXTRACT_LDBL128_WORDS(hx, lx, llx, x);
if (hx < 0x3fff) { /* x < 1, or x neg NaN */
ax = hx & 0x7fff;
if (ax >= 0x3fff) { /* x <= -1, or x neg NaN */
if (ax == 0x3fff && (lx | llx) == 0)
- RETURNP(-1 / zero); /* log1p(-1) = -Inf */
+ RETURNF(-1 / zero); /* log1p(-1) = -Inf */
/* log1p(x < 1, or x NaN) = qNaN: */
- RETURNP((x - x) / (x - x));
+ RETURNF((x - x) / (x - x));
}
if (ax <= 0x3f8d) { /* |x| < 2**-113 */
if ((int)x == 0)
- RETURNP(x); /* x with inexact if x != 0 */
+ RETURNF(x); /* x with inexact if x != 0 */
}
f_hi = 1;
f_lo = x;
} else if (hx >= 0x7fff) { /* x +Inf or non-neg NaN */
- RETURNP(x + x); /* log1p(Inf or NaN) = Inf or qNaN */
+ RETURNF(x + x); /* log1p(Inf or NaN) = Inf or qNaN */
} else if (hx < 0x40e1) { /* 1 <= x < 2**226 */
f_hi = x;
f_lo = 1;
@@ -669,7 +668,7 @@
#endif
_3sumF(val_hi, val_lo, F_hi(i) + dk * ln2_hi);
- RETURN2PI(val_hi, val_lo);
+ RETURNI(val_hi + val_lo);
}
#ifdef STRUCT_RETURN
@@ -680,7 +679,6 @@
struct ld r;
ENTERI();
- DOPRINT_START(&x);
k_logl(x, &r);
RETURNSPI(&r);
}
@@ -708,15 +706,13 @@
long double hi, lo;
ENTERI();
- DOPRINT_START(&x);
k_logl(x, &r);
if (!r.lo_set)
- RETURNPI(r.hi);
+ RETURNI(r.hi);
_2sumF(r.hi, r.lo);
hi = (float)r.hi;
lo = r.lo + (r.hi - hi);
- RETURN2PI(invln10_hi * hi,
- invln10_lo_plus_hi * lo + invln10_lo * hi);
+ RETURNI(invln10_hi * hi + (invln10_lo_plus_hi * lo + invln10_lo * hi));
}
long double
@@ -726,15 +722,13 @@
long double hi, lo;
ENTERI();
- DOPRINT_START(&x);
k_logl(x, &r);
if (!r.lo_set)
- RETURNPI(r.hi);
+ RETURNI(r.hi);
_2sumF(r.hi, r.lo);
hi = (float)r.hi;
lo = r.lo + (r.hi - hi);
- RETURN2PI(invln2_hi * hi,
- invln2_lo_plus_hi * lo + invln2_lo * hi);
+ RETURNI(invln2_hi * hi + (invln2_lo_plus_hi * lo + invln2_lo * hi));
}
#endif /* STRUCT_RETURN */
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_nanl.c b/libm/upstream-freebsd/lib/msun/ld128/s_nanl.c
index 45d10e5..cde3f18 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/s_nanl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_nanl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007 David Schultz
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/catrig.c b/libm/upstream-freebsd/lib/msun/src/catrig.c
index 431d8e6..82061b5 100644
--- a/libm/upstream-freebsd/lib/msun/src/catrig.c
+++ b/libm/upstream-freebsd/lib/msun/src/catrig.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/catrigf.c b/libm/upstream-freebsd/lib/msun/src/catrigf.c
index 62bcd39..fb4a6bf 100644
--- a/libm/upstream-freebsd/lib/msun/src/catrigf.c
+++ b/libm/upstream-freebsd/lib/msun/src/catrigf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/e_acos.c b/libm/upstream-freebsd/lib/msun/src/e_acos.c
index 1f6dca5..6623355 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_acos.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_acos.c
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_acos(x)
+/* acos(x)
* Method :
* acos(x) = pi/2 - asin(x)
* acos(-x) = pi/2 + asin(x)
@@ -62,7 +62,7 @@
qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
double
-__ieee754_acos(double x)
+acos(double x)
{
double z,p,q,r,w,s,c,df;
int32_t hx,ix;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_acosf.c b/libm/upstream-freebsd/lib/msun/src/e_acosf.c
index c9f62cc..64f1c5a 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_acosf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_acosf.c
@@ -32,7 +32,7 @@
qS1 = -7.0662963390e-01;
float
-__ieee754_acosf(float x)
+acosf(float x)
{
float z,p,q,r,w,s,c,df;
int32_t hx,ix;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_acosh.c b/libm/upstream-freebsd/lib/msun/src/e_acosh.c
index 358c8bd..7947995 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_acosh.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_acosh.c
@@ -15,7 +15,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_acosh(x)
+/* acosh(x)
* Method :
* Based on
* acosh(x) = log [ x + sqrt(x*x-1) ]
@@ -39,7 +39,7 @@
ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */
double
-__ieee754_acosh(double x)
+acosh(double x)
{
double t;
int32_t hx;
@@ -51,12 +51,12 @@
if(hx >=0x7ff00000) { /* x is inf of NaN */
return x+x;
} else
- return __ieee754_log(x)+ln2; /* acosh(huge)=log(2x) */
+ return log(x)+ln2; /* acosh(huge)=log(2x) */
} else if(((hx-0x3ff00000)|lx)==0) {
return 0.0; /* acosh(1) = 0 */
} else if (hx > 0x40000000) { /* 2**28 > x > 2 */
t=x*x;
- return __ieee754_log(2.0*x-one/(x+sqrt(t-one)));
+ return log(2.0*x-one/(x+sqrt(t-one)));
} else { /* 1<x<2 */
t = x-one;
return log1p(t+sqrt(2.0*t+t*t));
diff --git a/libm/upstream-freebsd/lib/msun/src/e_acoshf.c b/libm/upstream-freebsd/lib/msun/src/e_acoshf.c
index f529b20..781ccf2 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_acoshf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_acoshf.c
@@ -24,7 +24,7 @@
ln2 = 6.9314718246e-01; /* 0x3f317218 */
float
-__ieee754_acoshf(float x)
+acoshf(float x)
{
float t;
int32_t hx;
@@ -35,14 +35,14 @@
if(hx >=0x7f800000) { /* x is inf of NaN */
return x+x;
} else
- return __ieee754_logf(x)+ln2; /* acosh(huge)=log(2x) */
+ return logf(x)+ln2; /* acosh(huge)=log(2x) */
} else if (hx==0x3f800000) {
return 0.0; /* acosh(1) = 0 */
} else if (hx > 0x40000000) { /* 2**28 > x > 2 */
t=x*x;
- return __ieee754_logf((float)2.0*x-one/(x+__ieee754_sqrtf(t-one)));
+ return logf((float)2.0*x-one/(x+sqrtf(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return log1pf(t+__ieee754_sqrtf((float)2.0*t+t*t));
+ return log1pf(t+sqrtf((float)2.0*t+t*t));
}
}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_asin.c b/libm/upstream-freebsd/lib/msun/src/e_asin.c
index 931b270..fa180ab 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_asin.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_asin.c
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_asin(x)
+/* asin(x)
* Method :
* Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ...
* we approximate asin(x) on [0,0.5] by
@@ -68,7 +68,7 @@
qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
double
-__ieee754_asin(double x)
+asin(double x)
{
double t=0.0,w,p,q,c,r,s;
int32_t hx,ix;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_asinf.c b/libm/upstream-freebsd/lib/msun/src/e_asinf.c
index deaabb6..db4b9b6 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_asinf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_asinf.c
@@ -32,7 +32,7 @@
pio2 = 1.570796326794896558e+00;
float
-__ieee754_asinf(float x)
+asinf(float x)
{
double s;
float t,w,p,q;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_atan2.c b/libm/upstream-freebsd/lib/msun/src/e_atan2.c
index 231a161..0b2e721 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_atan2.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_atan2.c
@@ -15,7 +15,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_atan2(y,x)
+/* atan2(y,x)
* Method :
* 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x).
* 2. Reduce x to positive by (if x and y are unexceptional):
@@ -58,7 +58,7 @@
pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
double
-__ieee754_atan2(double y, double x)
+atan2(double y, double x)
{
double z;
int32_t k,m,hx,hy,ix,iy;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_atan2f.c b/libm/upstream-freebsd/lib/msun/src/e_atan2f.c
index 346d767..4ea001d 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_atan2f.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_atan2f.c
@@ -30,7 +30,7 @@
pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */
float
-__ieee754_atan2f(float y, float x)
+atan2f(float y, float x)
{
float z;
int32_t k,m,hx,hy,ix,iy;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_atanh.c b/libm/upstream-freebsd/lib/msun/src/e_atanh.c
index 422ff26..41f3bca 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_atanh.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_atanh.c
@@ -15,7 +15,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_atanh(x)
+/* atanh(x)
* Method :
* 1.Reduced x to positive by atanh(-x) = -atanh(x)
* 2.For x>=0.5
@@ -42,7 +42,7 @@
static const double zero = 0.0;
double
-__ieee754_atanh(double x)
+atanh(double x)
{
double t;
int32_t hx,ix;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_atanhf.c b/libm/upstream-freebsd/lib/msun/src/e_atanhf.c
index 4bd6a8f..46643be 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_atanhf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_atanhf.c
@@ -24,7 +24,7 @@
static const float zero = 0.0;
float
-__ieee754_atanhf(float x)
+atanhf(float x)
{
float t;
int32_t hx,ix;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_cosh.c b/libm/upstream-freebsd/lib/msun/src/e_cosh.c
index 246b5fb..071663e 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_cosh.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_cosh.c
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_cosh(x)
+/* cosh(x)
* Method :
* mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2
* 1. Replace x by |x| (cosh(x) = cosh(-x)).
@@ -43,7 +43,7 @@
static const double one = 1.0, half=0.5, huge = 1.0e300;
double
-__ieee754_cosh(double x)
+cosh(double x)
{
double t,w;
int32_t ix;
@@ -65,12 +65,12 @@
/* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
if (ix < 0x40360000) {
- t = __ieee754_exp(fabs(x));
+ t = exp(fabs(x));
return half*t+half/t;
}
/* |x| in [22, log(maxdouble)] return half*exp(|x|) */
- if (ix < 0x40862E42) return half*__ieee754_exp(fabs(x));
+ if (ix < 0x40862E42) return half*exp(fabs(x));
/* |x| in [log(maxdouble), overflowthresold] */
if (ix<=0x408633CE)
diff --git a/libm/upstream-freebsd/lib/msun/src/e_coshf.c b/libm/upstream-freebsd/lib/msun/src/e_coshf.c
index 95a0d6e..1673315 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_coshf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_coshf.c
@@ -22,7 +22,7 @@
static const float one = 1.0, half=0.5, huge = 1.0e30;
float
-__ieee754_coshf(float x)
+coshf(float x)
{
float t,w;
int32_t ix;
@@ -43,12 +43,12 @@
/* |x| in [0.5*ln2,9], return (exp(|x|)+1/exp(|x|))/2; */
if (ix < 0x41100000) {
- t = __ieee754_expf(fabsf(x));
+ t = expf(fabsf(x));
return half*t+half/t;
}
/* |x| in [9, log(maxfloat)] return half*exp(|x|) */
- if (ix < 0x42b17217) return half*__ieee754_expf(fabsf(x));
+ if (ix < 0x42b17217) return half*expf(fabsf(x));
/* |x| in [log(maxfloat), overflowthresold] */
if (ix<=0x42b2d4fc)
diff --git a/libm/upstream-freebsd/lib/msun/src/e_exp.c b/libm/upstream-freebsd/lib/msun/src/e_exp.c
index dd04d8e..59da392 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_exp.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_exp.c
@@ -13,7 +13,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_exp(x)
+/* exp(x)
* Returns the exponential of x.
*
* Method
@@ -102,7 +102,7 @@
twom1000= 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0*/
double
-__ieee754_exp(double x) /* default IEEE double exp */
+exp(double x) /* default IEEE double exp */
{
double y,hi=0.0,lo=0.0,c,t,twopk;
int32_t k=0,xsb;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_expf.c b/libm/upstream-freebsd/lib/msun/src/e_expf.c
index 4903d55..620d341 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_expf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_expf.c
@@ -43,7 +43,7 @@
twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */
float
-__ieee754_expf(float x)
+expf(float x)
{
float y,hi=0.0,lo=0.0,c,t,twopk;
int32_t k=0,xsb;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_fmod.c b/libm/upstream-freebsd/lib/msun/src/e_fmod.c
index 3a28dc4..6d5f533 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_fmod.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_fmod.c
@@ -15,7 +15,7 @@
__FBSDID("$FreeBSD$");
/*
- * __ieee754_fmod(x,y)
+ * fmod(x,y)
* Return x mod y in exact arithmetic
* Method: shift and subtract
*/
@@ -28,7 +28,7 @@
static const double one = 1.0, Zero[] = {0.0, -0.0,};
double
-__ieee754_fmod(double x, double y)
+fmod(double x, double y)
{
int32_t n,hx,hy,hz,ix,iy,sx,i;
u_int32_t lx,ly,lz;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_fmodf.c b/libm/upstream-freebsd/lib/msun/src/e_fmodf.c
index 1b6bf36..3cef921 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_fmodf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_fmodf.c
@@ -17,7 +17,7 @@
__FBSDID("$FreeBSD$");
/*
- * __ieee754_fmodf(x,y)
+ * fmodf(x,y)
* Return x mod y in exact arithmetic
* Method: shift and subtract
*/
@@ -28,7 +28,7 @@
static const float one = 1.0, Zero[] = {0.0, -0.0,};
float
-__ieee754_fmodf(float x, float y)
+fmodf(float x, float y)
{
int32_t n,hx,hy,hz,ix,iy,sx,i;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_gamma.c b/libm/upstream-freebsd/lib/msun/src/e_gamma.c
index 28fb5cc..a13f3e2 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_gamma.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_gamma.c
@@ -15,10 +15,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_gamma(x)
+/* gamma(x)
* Return the logarithm of the Gamma function of x.
*
- * Method: call __ieee754_gamma_r
+ * Method: call gamma_r
*/
#include "math.h"
@@ -27,7 +27,7 @@
extern int signgam;
double
-__ieee754_gamma(double x)
+gamma(double x)
{
- return __ieee754_gamma_r(x,&signgam);
+ return gamma_r(x,&signgam);
}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_gamma_r.c b/libm/upstream-freebsd/lib/msun/src/e_gamma_r.c
index 2c423dc..2d996ca 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_gamma_r.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_gamma_r.c
@@ -15,18 +15,18 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_gamma_r(x, signgamp)
+/* gamma_r(x, signgamp)
* Reentrant version of the logarithm of the Gamma function
* with user provide pointer for the sign of Gamma(x).
*
- * Method: See __ieee754_lgamma_r
+ * Method: See lgamma_r
*/
#include "math.h"
#include "math_private.h"
double
-__ieee754_gamma_r(double x, int *signgamp)
+gamma_r(double x, int *signgamp)
{
- return __ieee754_lgamma_r(x,signgamp);
+ return lgamma_r(x,signgamp);
}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_gammaf.c b/libm/upstream-freebsd/lib/msun/src/e_gammaf.c
index c1b1668..563c148 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_gammaf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_gammaf.c
@@ -16,10 +16,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_gammaf(x)
+/* gammaf(x)
* Return the logarithm of the Gamma function of x.
*
- * Method: call __ieee754_gammaf_r
+ * Method: call gammaf_r
*/
#include "math.h"
@@ -28,7 +28,7 @@
extern int signgam;
float
-__ieee754_gammaf(float x)
+gammaf(float x)
{
- return __ieee754_gammaf_r(x,&signgam);
+ return gammaf_r(x,&signgam);
}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_gammaf_r.c b/libm/upstream-freebsd/lib/msun/src/e_gammaf_r.c
index 9d7831b..d7fc2db 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_gammaf_r.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_gammaf_r.c
@@ -16,18 +16,18 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_gammaf_r(x, signgamp)
+/* gammaf_r(x, signgamp)
* Reentrant version of the logarithm of the Gamma function
* with user provide pointer for the sign of Gamma(x).
*
- * Method: See __ieee754_lgammaf_r
+ * Method: See lgammaf_r
*/
#include "math.h"
#include "math_private.h"
float
-__ieee754_gammaf_r(float x, int *signgamp)
+gammaf_r(float x, int *signgamp)
{
- return __ieee754_lgammaf_r(x,signgamp);
+ return lgammaf_r(x,signgamp);
}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_hypot.c b/libm/upstream-freebsd/lib/msun/src/e_hypot.c
index 7c455bb..8e3f931 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_hypot.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_hypot.c
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_hypot(x,y)
+/* hypot(x,y)
*
* Method :
* If (assume round-to-nearest) z=x*x+y*y
@@ -52,7 +52,7 @@
#include "math_private.h"
double
-__ieee754_hypot(double x, double y)
+hypot(double x, double y)
{
double a,b,t1,t2,y1,y2,w;
int32_t j,k,ha,hb;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_hypotf.c b/libm/upstream-freebsd/lib/msun/src/e_hypotf.c
index 0061026..a3b8c86 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_hypotf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_hypotf.c
@@ -20,7 +20,7 @@
#include "math_private.h"
float
-__ieee754_hypotf(float x, float y)
+hypotf(float x, float y)
{
float a,b,t1,t2,y1,y2,w;
int32_t j,k,ha,hb;
@@ -67,14 +67,14 @@
if (w>b) {
SET_FLOAT_WORD(t1,ha&0xfffff000);
t2 = a-t1;
- w = __ieee754_sqrtf(t1*t1-(b*(-b)-t2*(a+t1)));
+ w = sqrtf(t1*t1-(b*(-b)-t2*(a+t1)));
} else {
a = a+a;
SET_FLOAT_WORD(y1,hb&0xfffff000);
y2 = b - y1;
SET_FLOAT_WORD(t1,(ha+0x00800000)&0xfffff000);
t2 = a - t1;
- w = __ieee754_sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b)));
+ w = sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
SET_FLOAT_WORD(t1,(127+k)<<23);
diff --git a/libm/upstream-freebsd/lib/msun/src/e_j0.c b/libm/upstream-freebsd/lib/msun/src/e_j0.c
index 5d862b6..c43ab69 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_j0.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_j0.c
@@ -13,7 +13,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_j0(x), __ieee754_y0(x)
+/* j0(x), y0(x)
* Bessel function of the first and second kinds of order zero.
* Method -- j0(x):
* 1. For tiny x, we use j0(x) = 1 - x^2/4 + x^4/64 - ...
@@ -83,7 +83,7 @@
static const double zero = 0, qrtr = 0.25;
double
-__ieee754_j0(double x)
+j0(double x)
{
double z, s,c,ss,cc,r,u,v;
int32_t hx,ix;
@@ -143,7 +143,7 @@
v04 = 4.41110311332675467403e-10; /* 0x3DFE5018, 0x3BD6D9EF */
double
-__ieee754_y0(double x)
+y0(double x)
{
double z, s,c,ss,cc,u,v;
int32_t hx,ix,lx;
@@ -192,12 +192,12 @@
return z;
}
if(ix<=0x3e400000) { /* x < 2**-27 */
- return(u00 + tpi*__ieee754_log(x));
+ return(u00 + tpi*log(x));
}
z = x*x;
u = u00+z*(u01+z*(u02+z*(u03+z*(u04+z*(u05+z*u06)))));
v = one+z*(v01+z*(v02+z*(v03+z*v04)));
- return(u/v + tpi*(__ieee754_j0(x)*__ieee754_log(x)));
+ return(u/v + tpi*(j0(x)*log(x)));
}
/* The asymptotic expansions of pzero is
diff --git a/libm/upstream-freebsd/lib/msun/src/e_j0f.c b/libm/upstream-freebsd/lib/msun/src/e_j0f.c
index 1c5ef4d..290be04 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_j0f.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_j0f.c
@@ -45,7 +45,7 @@
static const float zero = 0, qrtr = 0.25;
float
-__ieee754_j0f(float x)
+j0f(float x)
{
float z, s,c,ss,cc,r,u,v;
int32_t hx,ix;
@@ -105,7 +105,7 @@
v04 = 4.4111031494e-10; /* 0x2ff280c2 */
float
-__ieee754_y0f(float x)
+y0f(float x)
{
float z, s,c,ss,cc,u,v;
int32_t hx,ix;
@@ -147,12 +147,12 @@
return z;
}
if(ix<=0x39000000) { /* x < 2**-13 */
- return(u00 + tpi*__ieee754_logf(x));
+ return(u00 + tpi*logf(x));
}
z = x*x;
u = u00+z*(u01+z*(u02+z*(u03+z*(u04+z*(u05+z*u06)))));
v = one+z*(v01+z*(v02+z*(v03+z*v04)));
- return(u/v + tpi*(__ieee754_j0f(x)*__ieee754_logf(x)));
+ return(u/v + tpi*(j0f(x)*logf(x)));
}
/* The asymptotic expansions of pzero is
diff --git a/libm/upstream-freebsd/lib/msun/src/e_j1.c b/libm/upstream-freebsd/lib/msun/src/e_j1.c
index fb44627..ee3f6fc 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_j1.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_j1.c
@@ -13,7 +13,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_j1(x), __ieee754_y1(x)
+/* j1(x), y1(x)
* Bessel function of the first and second kinds of order zero.
* Method -- j1(x):
* 1. For tiny x, we use j1(x) = x/2 - x^3/16 + x^5/384 - ...
@@ -84,7 +84,7 @@
static const double zero = 0.0;
double
-__ieee754_j1(double x)
+j1(double x)
{
double z, s,c,ss,cc,r,u,v,y;
int32_t hx,ix;
@@ -140,7 +140,7 @@
};
double
-__ieee754_y1(double x)
+y1(double x)
{
double z, s,c,ss,cc,u,v;
int32_t hx,ix,lx;
@@ -190,7 +190,7 @@
z = x*x;
u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4])));
v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4]))));
- return(x*(u/v) + tpi*(__ieee754_j1(x)*__ieee754_log(x)-one/x));
+ return(x*(u/v) + tpi*(j1(x)*log(x)-one/x));
}
/* For x >= 8, the asymptotic expansions of pone is
diff --git a/libm/upstream-freebsd/lib/msun/src/e_j1f.c b/libm/upstream-freebsd/lib/msun/src/e_j1f.c
index c6c45c1..e1f4498 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_j1f.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_j1f.c
@@ -46,7 +46,7 @@
static const float zero = 0.0;
float
-__ieee754_j1f(float x)
+j1f(float x)
{
float z, s,c,ss,cc,r,u,v,y;
int32_t hx,ix;
@@ -102,7 +102,7 @@
};
float
-__ieee754_y1f(float x)
+y1f(float x)
{
float z, s,c,ss,cc,u,v;
int32_t hx,ix;
@@ -145,7 +145,7 @@
z = x*x;
u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4])));
v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4]))));
- return(x*(u/v) + tpi*(__ieee754_j1f(x)*__ieee754_logf(x)-one/x));
+ return(x*(u/v) + tpi*(j1f(x)*logf(x)-one/x));
}
/* For x >= 8, the asymptotic expansions of pone is
diff --git a/libm/upstream-freebsd/lib/msun/src/e_jn.c b/libm/upstream-freebsd/lib/msun/src/e_jn.c
index c7ba7da..6b876ce 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_jn.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_jn.c
@@ -14,7 +14,7 @@
__FBSDID("$FreeBSD$");
/*
- * __ieee754_jn(n, x), __ieee754_yn(n, x)
+ * jn(n, x), yn(n, x)
* floating point Bessel's function of the 1st and 2nd kind
* of order n
*
@@ -22,15 +22,15 @@
* y0(0)=y1(0)=yn(n,0) = -inf with division by zero signal;
* y0(-ve)=y1(-ve)=yn(n,-ve) are NaN with invalid signal.
* Note 2. About jn(n,x), yn(n,x)
- * For n=0, j0(x) is called,
- * for n=1, j1(x) is called,
- * for n<x, forward recursion us used starting
+ * For n=0, j0(x) is called.
+ * For n=1, j1(x) is called.
+ * For n<x, forward recursion is used starting
* from values of j0(x) and j1(x).
- * for n>x, a continued fraction approximation to
+ * For n>x, a continued fraction approximation to
* j(n,x)/j(n-1,x) is evaluated and then backward
* recursion is used starting from a supposed value
- * for j(n,x). The resulting value of j(0,x) is
- * compared with the actual value to correct the
+ * for j(n,x). The resulting values of j(0,x) or j(1,x) are
+ * compared with the actual values to correct the
* supposed value of j(n,x).
*
* yn(n,x) is similar in all respects, except
@@ -51,7 +51,7 @@
static const double zero = 0.00000000000000000000e+00;
double
-__ieee754_jn(int n, double x)
+jn(int n, double x)
{
int32_t i,hx,ix,lx, sgn;
double a, b, c, s, temp, di;
@@ -69,8 +69,8 @@
x = -x;
hx ^= 0x80000000;
}
- if(n==0) return(__ieee754_j0(x));
- if(n==1) return(__ieee754_j1(x));
+ if(n==0) return(j0(x));
+ if(n==1) return(j1(x));
sgn = (n&1)&(hx>>31); /* even n -- 0, odd n -- sign(x) */
x = fabs(x);
if((ix|lx)==0||ix>=0x7ff00000) /* if x is 0 or inf */
@@ -100,8 +100,8 @@
}
b = invsqrtpi*temp/sqrt(x);
} else {
- a = __ieee754_j0(x);
- b = __ieee754_j1(x);
+ a = j0(x);
+ b = j1(x);
for(i=1;i<n;i++){
temp = b;
b = b*((double)(i+i)/x) - a; /* avoid underflow */
@@ -177,7 +177,7 @@
*/
tmp = n;
v = two/x;
- tmp = tmp*__ieee754_log(fabs(v*tmp));
+ tmp = tmp*log(fabs(v*tmp));
if(tmp<7.09782712893383973096e+02) {
for(i=n-1,di=(double)(i+i);i>0;i--){
temp = b;
@@ -201,8 +201,8 @@
}
}
}
- z = __ieee754_j0(x);
- w = __ieee754_j1(x);
+ z = j0(x);
+ w = j1(x);
if (fabs(z) >= fabs(w))
b = (t*z/b);
else
@@ -213,7 +213,7 @@
}
double
-__ieee754_yn(int n, double x)
+yn(int n, double x)
{
int32_t i,hx,ix,lx;
int32_t sign;
@@ -232,8 +232,8 @@
n = -n;
sign = 1 - ((n&1)<<1);
}
- if(n==0) return(__ieee754_y0(x));
- if(n==1) return(sign*__ieee754_y1(x));
+ if(n==0) return(y0(x));
+ if(n==1) return(sign*y1(x));
if(ix==0x7ff00000) return zero;
if(ix>=0x52D00000) { /* x > 2**302 */
/* (x >> n**2)
@@ -259,8 +259,8 @@
b = invsqrtpi*temp/sqrt(x);
} else {
u_int32_t high;
- a = __ieee754_y0(x);
- b = __ieee754_y1(x);
+ a = y0(x);
+ b = y1(x);
/* quit if b is -inf */
GET_HIGH_WORD(high,b);
for(i=1;i<n&&high!=0xfff00000;i++){
diff --git a/libm/upstream-freebsd/lib/msun/src/e_jnf.c b/libm/upstream-freebsd/lib/msun/src/e_jnf.c
index 965feeb..ba58622 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_jnf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_jnf.c
@@ -32,7 +32,7 @@
static const float zero = 0.0000000000e+00;
float
-__ieee754_jnf(int n, float x)
+jnf(int n, float x)
{
int32_t i,hx,ix, sgn;
float a, b, temp, di;
@@ -50,16 +50,16 @@
x = -x;
hx ^= 0x80000000;
}
- if(n==0) return(__ieee754_j0f(x));
- if(n==1) return(__ieee754_j1f(x));
+ if(n==0) return(j0f(x));
+ if(n==1) return(j1f(x));
sgn = (n&1)&(hx>>31); /* even n -- 0, odd n -- sign(x) */
x = fabsf(x);
if(ix==0||ix>=0x7f800000) /* if x is 0 or inf */
b = zero;
else if((float)n<=x) {
/* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */
- a = __ieee754_j0f(x);
- b = __ieee754_j1f(x);
+ a = j0f(x);
+ b = j1f(x);
for(i=1;i<n;i++){
temp = b;
b = b*((float)(i+i)/x) - a; /* avoid underflow */
@@ -134,7 +134,7 @@
*/
tmp = n;
v = two/x;
- tmp = tmp*__ieee754_logf(fabsf(v*tmp));
+ tmp = tmp*logf(fabsf(v*tmp));
if(tmp<(float)8.8721679688e+01) {
for(i=n-1,di=(float)(i+i);i>0;i--){
temp = b;
@@ -158,8 +158,8 @@
}
}
}
- z = __ieee754_j0f(x);
- w = __ieee754_j1f(x);
+ z = j0f(x);
+ w = j1f(x);
if (fabsf(z) >= fabsf(w))
b = (t*z/b);
else
@@ -170,7 +170,7 @@
}
float
-__ieee754_ynf(int n, float x)
+ynf(int n, float x)
{
int32_t i,hx,ix,ib;
int32_t sign;
@@ -186,12 +186,12 @@
n = -n;
sign = 1 - ((n&1)<<1);
}
- if(n==0) return(__ieee754_y0f(x));
- if(n==1) return(sign*__ieee754_y1f(x));
+ if(n==0) return(y0f(x));
+ if(n==1) return(sign*y1f(x));
if(ix==0x7f800000) return zero;
- a = __ieee754_y0f(x);
- b = __ieee754_y1f(x);
+ a = y0f(x);
+ b = y1f(x);
/* quit if b is -inf */
GET_FLOAT_WORD(ib,b);
for(i=1;i<n&&ib!=0xff800000;i++){
diff --git a/libm/upstream-freebsd/lib/msun/src/e_lgamma.c b/libm/upstream-freebsd/lib/msun/src/e_lgamma.c
index 43f5175..9c4a30e 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_lgamma.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_lgamma.c
@@ -15,10 +15,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_lgamma(x)
+/* lgamma(x)
* Return the logarithm of the Gamma function of x.
*
- * Method: call __ieee754_lgamma_r
+ * Method: call lgamma_r
*/
#include <float.h>
@@ -29,9 +29,9 @@
extern int signgam;
double
-__ieee754_lgamma(double x)
+lgamma(double x)
{
- return __ieee754_lgamma_r(x,&signgam);
+ return lgamma_r(x,&signgam);
}
#if (LDBL_MANT_DIG == 53)
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 be70767..c020b63 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_lgamma_r.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_lgamma_r.c
@@ -13,7 +13,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_lgamma_r(x, signgamp)
+/* lgamma_r(x, signgamp)
* Reentrant version of the logarithm of the Gamma function
* with user provide pointer for the sign of Gamma(x).
*
@@ -27,7 +27,7 @@
* = log(6.3*5.3) + lgamma(5.3)
* = log(6.3*5.3*4.3*3.3*2.3) + lgamma(2.3)
* 2. Polynomial approximation of lgamma around its
- * minimun ymin=1.461632144968362245 to maintain monotonicity.
+ * minimum ymin=1.461632144968362245 to maintain monotonicity.
* On [ymin-0.23, ymin+0.27] (i.e., [1.23164,1.73163]), use
* Let z = x-ymin;
* lgamma(x) = -1.214862905358496078218 + z^2*poly(z)
@@ -199,7 +199,7 @@
double
-__ieee754_lgamma_r(double x, int *signgamp)
+lgamma_r(double x, int *signgamp)
{
double nadj,p,p1,p2,p3,q,r,t,w,y,z;
int32_t hx;
@@ -217,7 +217,7 @@
if(ix<0x3c700000) { /* |x|<2**-56, return -log(|x|) */
if((ix|lx)==0)
return one/vzero;
- return -__ieee754_log(fabs(x));
+ return -log(fabs(x));
}
/* purge negative integers and start evaluation for other x < 0 */
@@ -227,7 +227,7 @@
return one/vzero;
t = sin_pi(x);
if(t==zero) return one/vzero; /* -integer */
- nadj = __ieee754_log(pi/fabs(t*x));
+ nadj = log(pi/fabs(t*x));
if(t<zero) *signgamp = -1;
x = -x;
}
@@ -237,7 +237,7 @@
/* for x < 2.0 */
else if(ix<0x40000000) {
if(ix<=0x3feccccc) { /* lgamma(x) = lgamma(x+1)-log(x) */
- r = -__ieee754_log(x);
+ r = -log(x);
if(ix>=0x3FE76944) {y = one-x; i= 0;}
else if(ix>=0x3FCDA661) {y= x-(tc-one); i=1;}
else {y = x; i=2;}
@@ -282,18 +282,18 @@
case 5: z *= (y+4); /* FALLTHRU */
case 4: z *= (y+3); /* FALLTHRU */
case 3: z *= (y+2); /* FALLTHRU */
- r += __ieee754_log(z); break;
+ r += log(z); break;
}
/* 8.0 <= x < 2**56 */
} else if (ix < 0x43700000) {
- t = __ieee754_log(x);
+ t = 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**56 <= x <= inf */
- r = x*(__ieee754_log(x)-one);
+ r = x*(log(x)-one);
if(hx<0) r = nadj - r;
return r;
}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_lgammaf.c b/libm/upstream-freebsd/lib/msun/src/e_lgammaf.c
index 1e2c552..00a816c 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_lgammaf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_lgammaf.c
@@ -16,10 +16,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_lgammaf(x)
+/* lgammaf(x)
* Return the logarithm of the Gamma function of x.
*
- * Method: call __ieee754_lgammaf_r
+ * Method: call lgammaf_r
*/
#include "math.h"
@@ -28,7 +28,7 @@
extern int signgam;
float
-__ieee754_lgammaf(float x)
+lgammaf(float x)
{
- return __ieee754_lgammaf_r(x,&signgam);
+ return lgammaf_r(x,&signgam);
}
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 48346c3..fdd2321 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_lgammaf_r.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_lgammaf_r.c
@@ -120,7 +120,7 @@
float
-__ieee754_lgammaf_r(float x, int *signgamp)
+lgammaf_r(float x, int *signgamp)
{
float nadj,p,p1,p2,q,r,t,w,y,z;
int32_t hx;
@@ -138,7 +138,7 @@
if(ix<0x32000000) { /* |x|<2**-27, return -log(|x|) */
if(ix==0)
return one/vzero;
- return -__ieee754_logf(fabsf(x));
+ return -logf(fabsf(x));
}
/* purge negative integers and start evaluation for other x < 0 */
@@ -148,7 +148,7 @@
return one/vzero;
t = sin_pif(x);
if(t==zero) return one/vzero; /* -integer */
- nadj = __ieee754_logf(pi/fabsf(t*x));
+ nadj = logf(pi/fabsf(t*x));
if(t<zero) *signgamp = -1;
x = -x;
}
@@ -158,7 +158,7 @@
/* for x < 2.0 */
else if(ix<0x40000000) {
if(ix<=0x3f666666) { /* lgamma(x) = lgamma(x+1)-log(x) */
- r = -__ieee754_logf(x);
+ r = -logf(x);
if(ix>=0x3f3b4a20) {y = one-x; i= 0;}
else if(ix>=0x3e6d3308) {y= x-(tc-one); i=1;}
else {y = x; i=2;}
@@ -198,18 +198,18 @@
case 5: z *= (y+4); /* FALLTHRU */
case 4: z *= (y+3); /* FALLTHRU */
case 3: z *= (y+2); /* FALLTHRU */
- r += __ieee754_logf(z); break;
+ r += logf(z); break;
}
/* 8.0 <= x < 2**27 */
} else if (ix < 0x4d000000) {
- t = __ieee754_logf(x);
+ t = logf(x);
z = one/x;
y = z*z;
w = w0+z*(w1+y*w2);
r = (x-half)*(t-one)+w;
} else
/* 2**27 <= x <= inf */
- r = x*(__ieee754_logf(x)-one);
+ r = x*(logf(x)-one);
if(hx<0) r = nadj - r;
return r;
}
diff --git a/libm/upstream-freebsd/lib/msun/src/e_log.c b/libm/upstream-freebsd/lib/msun/src/e_log.c
index 68bc107..03ce820 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_log.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_log.c
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_log(x)
+/* log(x)
* Return the logrithm of x
*
* Method :
@@ -86,7 +86,7 @@
static volatile double vzero = 0.0;
double
-__ieee754_log(double x)
+log(double x)
{
double hfsq,f,s,z,R,w,t1,t2,dk;
int32_t k,hx,i,j;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_log10.c b/libm/upstream-freebsd/lib/msun/src/e_log10.c
index 3c89ed2..595c238 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_log10.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_log10.c
@@ -39,7 +39,7 @@
static volatile double vzero = 0.0;
double
-__ieee754_log10(double x)
+log10(double x)
{
double f,hfsq,hi,lo,r,val_hi,val_lo,w,y,y2;
int32_t i,k,hx;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_log10f.c b/libm/upstream-freebsd/lib/msun/src/e_log10f.c
index 9856df2..d0c3a53 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_log10f.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_log10f.c
@@ -31,7 +31,7 @@
static volatile float vzero = 0.0;
float
-__ieee754_log10f(float x)
+log10f(float x)
{
float f,hfsq,hi,lo,r,y;
int32_t i,k,hx;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_log2.c b/libm/upstream-freebsd/lib/msun/src/e_log2.c
index 4766cdb..10b1c00 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_log2.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_log2.c
@@ -39,7 +39,7 @@
static volatile double vzero = 0.0;
double
-__ieee754_log2(double x)
+log2(double x)
{
double f,hfsq,hi,lo,r,val_hi,val_lo,w,y;
int32_t i,k,hx;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_log2f.c b/libm/upstream-freebsd/lib/msun/src/e_log2f.c
index 1794484..956f33a 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_log2f.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_log2f.c
@@ -29,7 +29,7 @@
static volatile float vzero = 0.0;
float
-__ieee754_log2f(float x)
+log2f(float x)
{
float f,hfsq,hi,lo,r,y;
int32_t i,k,hx;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_logf.c b/libm/upstream-freebsd/lib/msun/src/e_logf.c
index ec3985f..68a4d5d 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_logf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_logf.c
@@ -33,7 +33,7 @@
static volatile float vzero = 0.0;
float
-__ieee754_logf(float x)
+logf(float x)
{
float hfsq,f,s,z,R,w,t1,t2,dk;
int32_t k,ix,i,j;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_pow.c b/libm/upstream-freebsd/lib/msun/src/e_pow.c
index 52b2f5c..adc64c9 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_pow.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_pow.c
@@ -12,7 +12,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_pow(x,y) return x**y
+/* pow(x,y) return x**y
*
* n
* Method: Let x = 2 * (1+f)
@@ -98,7 +98,7 @@
ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/
double
-__ieee754_pow(double x, double y)
+pow(double x, double y)
{
double z,ax,z_h,z_l,p_h,p_l;
double y1,t1,t2,r,s,t,u,v,w;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_powf.c b/libm/upstream-freebsd/lib/msun/src/e_powf.c
index 122da45..f5a2c70 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_powf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_powf.c
@@ -56,7 +56,7 @@
ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
float
-__ieee754_powf(float x, float y)
+powf(float x, float y)
{
float z,ax,z_h,z_l,p_h,p_l;
float y1,t1,t2,r,s,sn,t,u,v,w;
@@ -108,7 +108,7 @@
if(hy==0x40000000) return x*x; /* y is 2 */
if(hy==0x3f000000) { /* y is 0.5 */
if(hx>=0) /* x >= +0 */
- return __ieee754_sqrtf(x);
+ return sqrtf(x);
}
ax = fabsf(x);
diff --git a/libm/upstream-freebsd/lib/msun/src/e_remainder.c b/libm/upstream-freebsd/lib/msun/src/e_remainder.c
index a4ae0b7..13156d8 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_remainder.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_remainder.c
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_remainder(x,p)
+/* remainder(x,p)
* Return :
* returns x REM p = x - [x/p]*p as if in infinite
* precise arithmetic, where [x/p] is the (infinite bit)
@@ -32,7 +32,7 @@
double
-__ieee754_remainder(double x, double p)
+remainder(double x, double p)
{
int32_t hx,hp;
u_int32_t sx,lx,lp;
@@ -52,7 +52,7 @@
return nan_mix_op(x, p, *)/nan_mix_op(x, p, *);
- if (hp<=0x7fdfffff) x = __ieee754_fmod(x,p+p); /* now x < 2p */
+ if (hp<=0x7fdfffff) x = fmod(x,p+p); /* now x < 2p */
if (((hx-hp)|(lx-lp))==0) return zero*x;
x = fabs(x);
p = fabs(p);
diff --git a/libm/upstream-freebsd/lib/msun/src/e_remainderf.c b/libm/upstream-freebsd/lib/msun/src/e_remainderf.c
index 8004493..e0dcfd1 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_remainderf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_remainderf.c
@@ -23,7 +23,7 @@
float
-__ieee754_remainderf(float x, float p)
+remainderf(float x, float p)
{
int32_t hx,hp;
u_int32_t sx;
@@ -42,7 +42,7 @@
return nan_mix_op(x, p, *)/nan_mix_op(x, p, *);
- if (hp<=0x7effffff) x = __ieee754_fmodf(x,p+p); /* now x < 2p */
+ if (hp<=0x7effffff) x = fmodf(x,p+p); /* now x < 2p */
if ((hx-hp)==0) return zero*x;
x = fabsf(x);
p = fabsf(p);
diff --git a/libm/upstream-freebsd/lib/msun/src/e_remainderl.c b/libm/upstream-freebsd/lib/msun/src/e_remainderl.c
index 4a67863..2295673 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_remainderl.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_remainderl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/e_scalb.c b/libm/upstream-freebsd/lib/msun/src/e_scalb.c
index c0a7b5b..84a6893 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_scalb.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_scalb.c
@@ -15,7 +15,7 @@
__FBSDID("$FreeBSD$");
/*
- * __ieee754_scalb(x, fn) is provide for
+ * scalb(x, fn) is provide for
* passing various standard test suite. One
* should use scalbn() instead.
*/
@@ -25,10 +25,10 @@
#ifdef _SCALB_INT
double
-__ieee754_scalb(double x, int fn)
+scalb(double x, int fn)
#else
double
-__ieee754_scalb(double x, double fn)
+scalb(double x, double fn)
#endif
{
#ifdef _SCALB_INT
diff --git a/libm/upstream-freebsd/lib/msun/src/e_scalbf.c b/libm/upstream-freebsd/lib/msun/src/e_scalbf.c
index d49e904..28483a5 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_scalbf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_scalbf.c
@@ -21,10 +21,10 @@
#ifdef _SCALB_INT
float
-__ieee754_scalbf(float x, int fn)
+scalbf(float x, int fn)
#else
float
-__ieee754_scalbf(float x, float fn)
+scalbf(float x, float fn)
#endif
{
#ifdef _SCALB_INT
diff --git a/libm/upstream-freebsd/lib/msun/src/e_sinh.c b/libm/upstream-freebsd/lib/msun/src/e_sinh.c
index 6c01f4a..9fe8999 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_sinh.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_sinh.c
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* __ieee754_sinh(x)
+/* sinh(x)
* Method :
* mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
* 1. Replace x by |x| (sinh(-x) = -sinh(x)).
@@ -40,7 +40,7 @@
static const double one = 1.0, shuge = 1.0e307;
double
-__ieee754_sinh(double x)
+sinh(double x)
{
double t,h;
int32_t ix,jx;
@@ -64,7 +64,7 @@
}
/* |x| in [22, log(maxdouble)] return 0.5*exp(|x|) */
- if (ix < 0x40862E42) return h*__ieee754_exp(fabs(x));
+ if (ix < 0x40862E42) return h*exp(fabs(x));
/* |x| in [log(maxdouble), overflowthresold] */
if (ix<=0x408633CE)
diff --git a/libm/upstream-freebsd/lib/msun/src/e_sinhf.c b/libm/upstream-freebsd/lib/msun/src/e_sinhf.c
index 1be2dc3..082beb1 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_sinhf.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_sinhf.c
@@ -22,7 +22,7 @@
static const float one = 1.0, shuge = 1.0e37;
float
-__ieee754_sinhf(float x)
+sinhf(float x)
{
float t,h;
int32_t ix,jx;
@@ -45,7 +45,7 @@
}
/* |x| in [9, logf(maxfloat)] return 0.5*exp(|x|) */
- if (ix < 0x42b17217) return h*__ieee754_expf(fabsf(x));
+ if (ix < 0x42b17217) return h*expf(fabsf(x));
/* |x| in [logf(maxfloat), overflowthresold] */
if (ix<=0x42b2d4fc)
diff --git a/libm/upstream-freebsd/lib/msun/src/e_sqrtl.c b/libm/upstream-freebsd/lib/msun/src/e_sqrtl.c
index 565d963..67c777f 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_sqrtl.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_sqrtl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007 Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/k_exp.c b/libm/upstream-freebsd/lib/msun/src/k_exp.c
index dd15ff4..1b86cd6 100644
--- a/libm/upstream-freebsd/lib/msun/src/k_exp.c
+++ b/libm/upstream-freebsd/lib/msun/src/k_exp.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/k_expf.c b/libm/upstream-freebsd/lib/msun/src/k_expf.c
index 80e629b..7071632 100644
--- a/libm/upstream-freebsd/lib/msun/src/k_expf.c
+++ b/libm/upstream-freebsd/lib/msun/src/k_expf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/k_tanf.c b/libm/upstream-freebsd/lib/msun/src/k_tanf.c
index 52f1aaa..5be1445 100644
--- a/libm/upstream-freebsd/lib/msun/src/k_tanf.c
+++ b/libm/upstream-freebsd/lib/msun/src/k_tanf.c
@@ -50,7 +50,7 @@
* We add the small terms from lowest degree up for efficiency on
* non-sequential machines (the lowest degree terms tend to be ready
* earlier). Apart from this, we don't care about order of
- * operations, and don't need to to care since we have precision to
+ * operations, and don't need to care since we have precision to
* spare. However, the chosen splitting is good for accuracy too,
* and would give results as accurate as Horner's method if the
* small terms were added from highest degree down.
diff --git a/libm/upstream-freebsd/lib/msun/src/math_private.h b/libm/upstream-freebsd/lib/msun/src/math_private.h
index df526e7..a55d97a 100644
--- a/libm/upstream-freebsd/lib/msun/src/math_private.h
+++ b/libm/upstream-freebsd/lib/msun/src/math_private.h
@@ -624,7 +624,7 @@
* The complications for extra precision are smaller for rnintl() since it
* can safely assume that the rounding precision has been increased from
* its default to FP_PE on x86. We don't exploit that here to get small
- * optimizations from limiting the rangle to double. We just need it for
+ * optimizations from limiting the range to double. We just need it for
* the magic number to work with long doubles. ld128 callers should use
* rnint() instead of this if possible. ld80 callers should prefer
* rnintl() since for amd64 this avoids swapping the register set, while
@@ -688,6 +688,59 @@
}
#endif
+/*
+ * The following are fast floor macros for 0 <= |x| < 0x1p(N-1), where
+ * N is the precision of the type of x. These macros are used in the
+ * half-cycle trignometric functions (e.g., sinpi(x)).
+ */
+#define FFLOORF(x, j0, ix) do { \
+ (j0) = (((ix) >> 23) & 0xff) - 0x7f; \
+ (ix) &= ~(0x007fffff >> (j0)); \
+ SET_FLOAT_WORD((x), (ix)); \
+} while (0)
+
+#define FFLOOR(x, j0, ix, lx) do { \
+ (j0) = (((ix) >> 20) & 0x7ff) - 0x3ff; \
+ if ((j0) < 20) { \
+ (ix) &= ~(0x000fffff >> (j0)); \
+ (lx) = 0; \
+ } else { \
+ (lx) &= ~((uint32_t)0xffffffff >> ((j0) - 20)); \
+ } \
+ INSERT_WORDS((x), (ix), (lx)); \
+} while (0)
+
+#define FFLOORL80(x, j0, ix, lx) do { \
+ j0 = ix - 0x3fff + 1; \
+ if ((j0) < 32) { \
+ (lx) = ((lx) >> 32) << 32; \
+ (lx) &= ~((((lx) << 32)-1) >> (j0)); \
+ } else { \
+ uint64_t _m; \
+ _m = (uint64_t)-1 >> (j0); \
+ if ((lx) & _m) (lx) &= ~_m; \
+ } \
+ INSERT_LDBL80_WORDS((x), (ix), (lx)); \
+} while (0)
+
+#define FFLOORL128(x, ai, ar) do { \
+ union IEEEl2bits u; \
+ uint64_t m; \
+ int e; \
+ u.e = (x); \
+ e = u.bits.exp - 16383; \
+ if (e < 48) { \
+ m = ((1llu << 49) - 1) >> (e + 1); \
+ u.bits.manh &= ~m; \
+ u.bits.manl = 0; \
+ } else { \
+ m = (uint64_t)-1 >> (e - 48); \
+ u.bits.manl &= ~m; \
+ } \
+ (ai) = u.e; \
+ (ar) = (x) - (ai); \
+} while (0)
+
#ifdef DEBUG
#if defined(__amd64__) || defined(__i386__)
#define breakpoint() asm("int $3")
@@ -698,191 +751,25 @@
#endif
#endif
-/* Write a pari script to test things externally. */
-#ifdef DOPRINT
-#include <stdio.h>
-
-#ifndef DOPRINT_SWIZZLE
-#define DOPRINT_SWIZZLE 0
-#endif
-
-#ifdef DOPRINT_LD80
-
-#define DOPRINT_START(xp) do { \
- uint64_t __lx; \
- uint16_t __hx; \
- \
- /* Hack to give more-problematic args. */ \
- EXTRACT_LDBL80_WORDS(__hx, __lx, *xp); \
- __lx ^= DOPRINT_SWIZZLE; \
- INSERT_LDBL80_WORDS(*xp, __hx, __lx); \
- printf("x = %.21Lg; ", (long double)*xp); \
-} while (0)
-#define DOPRINT_END1(v) \
- printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v))
-#define DOPRINT_END2(hi, lo) \
- printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n", \
- (long double)(hi), (long double)(lo))
-
-#elif defined(DOPRINT_D64)
-
-#define DOPRINT_START(xp) do { \
- uint32_t __hx, __lx; \
- \
- EXTRACT_WORDS(__hx, __lx, *xp); \
- __lx ^= DOPRINT_SWIZZLE; \
- INSERT_WORDS(*xp, __hx, __lx); \
- printf("x = %.21Lg; ", (long double)*xp); \
-} while (0)
-#define DOPRINT_END1(v) \
- printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v))
-#define DOPRINT_END2(hi, lo) \
- printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n", \
- (long double)(hi), (long double)(lo))
-
-#elif defined(DOPRINT_F32)
-
-#define DOPRINT_START(xp) do { \
- uint32_t __hx; \
- \
- GET_FLOAT_WORD(__hx, *xp); \
- __hx ^= DOPRINT_SWIZZLE; \
- SET_FLOAT_WORD(*xp, __hx); \
- printf("x = %.21Lg; ", (long double)*xp); \
-} while (0)
-#define DOPRINT_END1(v) \
- printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v))
-#define DOPRINT_END2(hi, lo) \
- printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n", \
- (long double)(hi), (long double)(lo))
-
-#else /* !DOPRINT_LD80 && !DOPRINT_D64 (LD128 only) */
-
-#ifndef DOPRINT_SWIZZLE_HIGH
-#define DOPRINT_SWIZZLE_HIGH 0
-#endif
-
-#define DOPRINT_START(xp) do { \
- uint64_t __lx, __llx; \
- uint16_t __hx; \
- \
- EXTRACT_LDBL128_WORDS(__hx, __lx, __llx, *xp); \
- __llx ^= DOPRINT_SWIZZLE; \
- __lx ^= DOPRINT_SWIZZLE_HIGH; \
- INSERT_LDBL128_WORDS(*xp, __hx, __lx, __llx); \
- printf("x = %.36Lg; ", (long double)*xp); \
-} while (0)
-#define DOPRINT_END1(v) \
- printf("y = %.36Lg; z = 0; show(x, y, z);\n", (long double)(v))
-#define DOPRINT_END2(hi, lo) \
- printf("y = %.36Lg; z = %.36Lg; show(x, y, z);\n", \
- (long double)(hi), (long double)(lo))
-
-#endif /* DOPRINT_LD80 */
-
-#else /* !DOPRINT */
-#define DOPRINT_START(xp)
-#define DOPRINT_END1(v)
-#define DOPRINT_END2(hi, lo)
-#endif /* DOPRINT */
-
-#define RETURNP(x) do { \
- DOPRINT_END1(x); \
- RETURNF(x); \
-} while (0)
-#define RETURNPI(x) do { \
- DOPRINT_END1(x); \
- RETURNI(x); \
-} while (0)
-#define RETURN2P(x, y) do { \
- DOPRINT_END2((x), (y)); \
- RETURNF((x) + (y)); \
-} while (0)
-#define RETURN2PI(x, y) do { \
- DOPRINT_END2((x), (y)); \
- RETURNI((x) + (y)); \
-} while (0)
#ifdef STRUCT_RETURN
#define RETURNSP(rp) do { \
if (!(rp)->lo_set) \
- RETURNP((rp)->hi); \
- RETURN2P((rp)->hi, (rp)->lo); \
+ RETURNF((rp)->hi); \
+ RETURNF((rp)->hi + (rp)->lo); \
} while (0)
#define RETURNSPI(rp) do { \
if (!(rp)->lo_set) \
- RETURNPI((rp)->hi); \
- RETURN2PI((rp)->hi, (rp)->lo); \
+ RETURNI((rp)->hi); \
+ RETURNI((rp)->hi + (rp)->lo); \
} while (0)
#endif
+
#define SUM2P(x, y) ({ \
const __typeof (x) __x = (x); \
const __typeof (y) __y = (y); \
- \
- DOPRINT_END2(__x, __y); \
__x + __y; \
})
-/*
- * ieee style elementary functions
- *
- * We rename functions here to improve other sources' diffability
- * against fdlibm.
- */
-#define __ieee754_sqrt sqrt
-#define __ieee754_acos acos
-#define __ieee754_acosh acosh
-#define __ieee754_log log
-#define __ieee754_log2 log2
-#define __ieee754_atanh atanh
-#define __ieee754_asin asin
-#define __ieee754_atan2 atan2
-#define __ieee754_exp exp
-#define __ieee754_cosh cosh
-#define __ieee754_fmod fmod
-#define __ieee754_pow pow
-#define __ieee754_lgamma lgamma
-#define __ieee754_gamma gamma
-#define __ieee754_lgamma_r lgamma_r
-#define __ieee754_gamma_r gamma_r
-#define __ieee754_log10 log10
-#define __ieee754_sinh sinh
-#define __ieee754_hypot hypot
-#define __ieee754_j0 j0
-#define __ieee754_j1 j1
-#define __ieee754_y0 y0
-#define __ieee754_y1 y1
-#define __ieee754_jn jn
-#define __ieee754_yn yn
-#define __ieee754_remainder remainder
-#define __ieee754_scalb scalb
-#define __ieee754_sqrtf sqrtf
-#define __ieee754_acosf acosf
-#define __ieee754_acoshf acoshf
-#define __ieee754_logf logf
-#define __ieee754_atanhf atanhf
-#define __ieee754_asinf asinf
-#define __ieee754_atan2f atan2f
-#define __ieee754_expf expf
-#define __ieee754_coshf coshf
-#define __ieee754_fmodf fmodf
-#define __ieee754_powf powf
-#define __ieee754_lgammaf lgammaf
-#define __ieee754_gammaf gammaf
-#define __ieee754_lgammaf_r lgammaf_r
-#define __ieee754_gammaf_r gammaf_r
-#define __ieee754_log10f log10f
-#define __ieee754_log2f log2f
-#define __ieee754_sinhf sinhf
-#define __ieee754_hypotf hypotf
-#define __ieee754_j0f j0f
-#define __ieee754_j1f j1f
-#define __ieee754_y0f y0f
-#define __ieee754_y1f y1f
-#define __ieee754_jnf jnf
-#define __ieee754_ynf ynf
-#define __ieee754_remainderf remainderf
-#define __ieee754_scalbf scalbf
-
/* fdlibm kernel function */
int __kernel_rem_pio2(double*,double*,int,int,int);
diff --git a/libm/upstream-freebsd/lib/msun/src/s_asinh.c b/libm/upstream-freebsd/lib/msun/src/s_asinh.c
index cbb3d46..a1b9169 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_asinh.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_asinh.c
@@ -46,13 +46,13 @@
if(huge+x>one) return x; /* return x inexact except 0 */
}
if(ix>0x41b00000) { /* |x| > 2**28 */
- w = __ieee754_log(fabs(x))+ln2;
+ w = log(fabs(x))+ln2;
} else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */
t = fabs(x);
- w = __ieee754_log(2.0*t+one/(__ieee754_sqrt(x*x+one)+t));
+ w = log(2.0*t+one/(sqrt(x*x+one)+t));
} else { /* 2.0 > |x| > 2**-28 */
t = x*x;
- w =log1p(fabs(x)+t/(one+__ieee754_sqrt(one+t)));
+ w =log1p(fabs(x)+t/(one+sqrt(one+t)));
}
if(hx>0) return w; else return -w;
}
diff --git a/libm/upstream-freebsd/lib/msun/src/s_asinhf.c b/libm/upstream-freebsd/lib/msun/src/s_asinhf.c
index c1620dd..72bcefe 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_asinhf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_asinhf.c
@@ -36,13 +36,13 @@
if(huge+x>one) return x; /* return x inexact except 0 */
}
if(ix>0x4d800000) { /* |x| > 2**28 */
- w = __ieee754_logf(fabsf(x))+ln2;
+ w = logf(fabsf(x))+ln2;
} else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */
t = fabsf(x);
- w = __ieee754_logf((float)2.0*t+one/(__ieee754_sqrtf(x*x+one)+t));
+ w = logf((float)2.0*t+one/(sqrtf(x*x+one)+t));
} else { /* 2.0 > |x| > 2**-28 */
t = x*x;
- w =log1pf(fabsf(x)+t/(one+__ieee754_sqrtf(one+t)));
+ w =log1pf(fabsf(x)+t/(one+sqrtf(one+t)));
}
if(hx>0) return w; else return -w;
}
diff --git a/libm/upstream-freebsd/lib/msun/src/s_carg.c b/libm/upstream-freebsd/lib/msun/src/s_carg.c
index 1611b9d..f203198 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_carg.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_carg.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cargf.c b/libm/upstream-freebsd/lib/msun/src/s_cargf.c
index 71c705d..6ea487c 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cargf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cargf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cargl.c b/libm/upstream-freebsd/lib/msun/src/s_cargl.c
index 96c3336..ba39438 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cargl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cargl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005-2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cbrt.c b/libm/upstream-freebsd/lib/msun/src/s_cbrt.c
index 0e609e1..4353d34 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cbrt.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cbrt.c
@@ -108,7 +108,7 @@
r=x/s; /* error <= 0.5 ulps; |r| < |t| */
w=t+t; /* t+t is exact */
r=(r-t)/(w+r); /* r-t is exact; w+r ~= 3*t */
- t=t+t*r; /* error <= 0.5 + 0.5/3 + epsilon */
+ t=t+t*r; /* error <= (0.5 + 0.5/3) * ulp */
return(t);
}
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cbrtl.c b/libm/upstream-freebsd/lib/msun/src/s_cbrtl.c
index 2236c0f..b15c96e 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cbrtl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cbrtl.c
@@ -136,7 +136,7 @@
r=x/s; /* error <= 0.5 ulps; |r| < |t| */
w=t+t; /* t+t is exact */
r=(r-t)/(w+r); /* r-t is exact; w+r ~= 3*t */
- t=t+t*r; /* error <= 0.5 + 0.5/3 + epsilon */
+ t=t+t*r; /* error <= (0.5 + 0.5/3) * ulp */
t *= v.e;
RETURNI(t);
diff --git a/libm/upstream-freebsd/lib/msun/src/s_ccosh.c b/libm/upstream-freebsd/lib/msun/src/s_ccosh.c
index 7652b3c..0fd9206 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_ccosh.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_ccosh.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_ccoshf.c b/libm/upstream-freebsd/lib/msun/src/s_ccoshf.c
index 5d7a09b..2db8403 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_ccoshf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_ccoshf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cexp.c b/libm/upstream-freebsd/lib/msun/src/s_cexp.c
index a1f853e..8db763d 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cexp.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cexp.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cexpf.c b/libm/upstream-freebsd/lib/msun/src/s_cexpf.c
index d905b74..7247301 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cexpf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cexpf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cimag.c b/libm/upstream-freebsd/lib/msun/src/s_cimag.c
index 1f383cb..0b14fd7 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cimag.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cimag.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cimagf.c b/libm/upstream-freebsd/lib/msun/src/s_cimagf.c
index 86a43c1..42a1efd 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cimagf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cimagf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cimagl.c b/libm/upstream-freebsd/lib/msun/src/s_cimagl.c
index 6d87950..9707bc3 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cimagl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cimagl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_conj.c b/libm/upstream-freebsd/lib/msun/src/s_conj.c
index dc56f48..a83abd8 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_conj.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_conj.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_conjf.c b/libm/upstream-freebsd/lib/msun/src/s_conjf.c
index 3fd8b8f..f9eb146 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_conjf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_conjf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_conjl.c b/libm/upstream-freebsd/lib/msun/src/s_conjl.c
index d2f8d0f..4b86f2e 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_conjl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_conjl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_copysignl.c b/libm/upstream-freebsd/lib/msun/src/s_copysignl.c
index bd67447..666a2ba 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_copysignl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_copysignl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cosl.c b/libm/upstream-freebsd/lib/msun/src/s_cosl.c
index 3d06648..6f0b36f 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cosl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cosl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007 Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cospi.c b/libm/upstream-freebsd/lib/msun/src/s_cospi.c
index 860219e..f97570d 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cospi.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cospi.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2017 Steven G. Kargl
+ * Copyright (c) 2017, 2023 Steven G. Kargl
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -104,20 +104,10 @@
}
if (ix < 0x43300000) { /* 1 <= |x| < 0x1p52 */
- /* Determine integer part of ax. */
- j0 = ((ix >> 20) & 0x7ff) - 0x3ff;
- if (j0 < 20) {
- ix &= ~(0x000fffff >> j0);
- lx = 0;
- } else {
- lx &= ~((uint32_t)0xffffffff >> (j0 - 20));
- }
- INSERT_WORDS(x, ix, lx);
-
+ FFLOOR(x, j0, ix, lx); /* Integer part of ax. */
ax -= x;
EXTRACT_WORDS(ix, lx, ax);
-
if (ix < 0x3fe00000) { /* |x| < 0.5 */
if (ix < 0x3fd00000) /* |x| < 0.25 */
c = ix == 0 ? 1 : __kernel_cospi(ax);
@@ -138,13 +128,16 @@
return (j0 & 1 ? -c : c);
}
- if (ix >= 0x7f800000)
+ /* x = +-inf or nan. */
+ if (ix >= 0x7ff00000)
return (vzero / vzero);
/*
- * |x| >= 0x1p52 is always an even integer, so return 1.
+ * For 0x1p52 <= |x| < 0x1p53 need to determine if x is an even
+ * or odd integer to return +1 or -1.
+ * For |x| >= 0x1p53, it is always an even integer, so return 1.
*/
- return (1);
+ return (ix < 0x43400000 ? ((lx & 1) ? -1 : 1) : 1);
}
#if LDBL_MANT_DIG == 53
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cproj.c b/libm/upstream-freebsd/lib/msun/src/s_cproj.c
index 38e7747..5b0d4ed 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cproj.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cproj.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cprojf.c b/libm/upstream-freebsd/lib/msun/src/s_cprojf.c
index af4c3a8..0d76e75 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cprojf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cprojf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cprojl.c b/libm/upstream-freebsd/lib/msun/src/s_cprojl.c
index 16df514..7fc35d2 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cprojl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cprojl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_creal.c b/libm/upstream-freebsd/lib/msun/src/s_creal.c
index 69a10f2..5c8734e 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_creal.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_creal.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_crealf.c b/libm/upstream-freebsd/lib/msun/src/s_crealf.c
index 83e4d46..a93421f 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_crealf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_crealf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_creall.c b/libm/upstream-freebsd/lib/msun/src/s_creall.c
index 538b7d5..b4eb9ef 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_creall.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_creall.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 Stefan Farfeleder
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_csinh.c b/libm/upstream-freebsd/lib/msun/src/s_csinh.c
index 09b2dcb..b3928ce 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_csinh.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_csinh.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_csinhf.c b/libm/upstream-freebsd/lib/msun/src/s_csinhf.c
index ba1a794..a8d6f2d 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_csinhf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_csinhf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_csqrt.c b/libm/upstream-freebsd/lib/msun/src/s_csqrt.c
index d172efc..d96c344 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_csqrt.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_csqrt.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_csqrtf.c b/libm/upstream-freebsd/lib/msun/src/s_csqrtf.c
index 6836a39..e3ef4d0 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_csqrtf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_csqrtf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_csqrtl.c b/libm/upstream-freebsd/lib/msun/src/s_csqrtl.c
index 40bc59d..d564133 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_csqrtl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_csqrtl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007-2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_ctanh.c b/libm/upstream-freebsd/lib/msun/src/s_ctanh.c
index e5840a1..aa4e10c 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_ctanh.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_ctanh.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011 David Schultz
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_ctanhf.c b/libm/upstream-freebsd/lib/msun/src/s_ctanhf.c
index c46f86d..e9ebe4f 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_ctanhf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_ctanhf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011 David Schultz
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_erf.c b/libm/upstream-freebsd/lib/msun/src/s_erf.c
index 5f22847..ab2dc19 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_erf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_erf.c
@@ -238,7 +238,7 @@
}
z = x;
SET_LOW_WORD(z,0);
- r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
+ r = exp(-z*z-0.5625)*exp((z-x)*(z+x)+R/S);
if(hx>=0) return one-r/x; else return r/x-one;
}
@@ -297,7 +297,7 @@
}
z = x;
SET_LOW_WORD(z,0);
- r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
+ r = exp(-z*z-0.5625)*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;
diff --git a/libm/upstream-freebsd/lib/msun/src/s_exp2.c b/libm/upstream-freebsd/lib/msun/src/s_exp2.c
index bc36e55..1dd9673 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_exp2.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_exp2.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_exp2f.c b/libm/upstream-freebsd/lib/msun/src/s_exp2f.c
index c082924..c5b4c8e 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_exp2f.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_exp2f.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fdim.c b/libm/upstream-freebsd/lib/msun/src/s_fdim.c
index c40c3e9..b81dbac 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fdim.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fdim.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fma.c b/libm/upstream-freebsd/lib/msun/src/s_fma.c
index 95cffd0..2fd7075 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fma.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fma.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005-2011 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fmaf.c b/libm/upstream-freebsd/lib/msun/src/s_fmaf.c
index 4591cc2..ae979cb 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fmaf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fmaf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005-2011 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fmal.c b/libm/upstream-freebsd/lib/msun/src/s_fmal.c
index a379346..a0622a2 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fmal.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fmal.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005-2011 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fmax.c b/libm/upstream-freebsd/lib/msun/src/s_fmax.c
index b53b1e6..42bd11c 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fmax.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fmax.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fmaxf.c b/libm/upstream-freebsd/lib/msun/src/s_fmaxf.c
index 8d3d14f..10667d3 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fmaxf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fmaxf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fmaxl.c b/libm/upstream-freebsd/lib/msun/src/s_fmaxl.c
index c0d7c88..bf42587 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fmaxl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fmaxl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fmin.c b/libm/upstream-freebsd/lib/msun/src/s_fmin.c
index 53f36c1..e79071d 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fmin.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fmin.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fminf.c b/libm/upstream-freebsd/lib/msun/src/s_fminf.c
index 58b6a48..19ffd42 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fminf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fminf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_fminl.c b/libm/upstream-freebsd/lib/msun/src/s_fminl.c
index 97604b3..c906f1d 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_fminl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_fminl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_frexpl.c b/libm/upstream-freebsd/lib/msun/src/s_frexpl.c
index 66e284f..7101615 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_frexpl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_frexpl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_lrint.c b/libm/upstream-freebsd/lib/msun/src/s_lrint.c
index ad9b978..be00cbb 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_lrint.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_lrint.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_lround.c b/libm/upstream-freebsd/lib/msun/src/s_lround.c
index 1dd8e69..00f4b95 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_lround.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_lround.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2005 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_modfl.c b/libm/upstream-freebsd/lib/msun/src/s_modfl.c
index 2d83bbe..8e5c4d3 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_modfl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_modfl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_nan.c b/libm/upstream-freebsd/lib/msun/src/s_nan.c
index 1769244..1345f22 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_nan.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_nan.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007 David Schultz
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_nearbyint.c b/libm/upstream-freebsd/lib/msun/src/s_nearbyint.c
index 796dbaf..ae6ffde 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_nearbyint.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_nearbyint.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_rintl.c b/libm/upstream-freebsd/lib/msun/src/s_rintl.c
index 1e9824d..790edbc 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_rintl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_rintl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_round.c b/libm/upstream-freebsd/lib/msun/src/s_round.c
index ca25f8e..a112bc5 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_round.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_round.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2003, Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_roundf.c b/libm/upstream-freebsd/lib/msun/src/s_roundf.c
index 5bbf6b3..bb6f77c 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_roundf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_roundf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2003, Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_roundl.c b/libm/upstream-freebsd/lib/msun/src/s_roundl.c
index 8d1c02a..9e85423 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_roundl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_roundl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2003, Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_scalbln.c b/libm/upstream-freebsd/lib/msun/src/s_scalbln.c
index c27420c..e8c6377 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_scalbln.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_scalbln.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_significand.c b/libm/upstream-freebsd/lib/msun/src/s_significand.c
index 356e300..eed80ec 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_significand.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_significand.c
@@ -25,5 +25,5 @@
double
significand(double x)
{
- return __ieee754_scalb(x,(double) -ilogb(x));
+ return scalb(x,(double) -ilogb(x));
}
diff --git a/libm/upstream-freebsd/lib/msun/src/s_significandf.c b/libm/upstream-freebsd/lib/msun/src/s_significandf.c
index ad030e2..b33ab7b 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_significandf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_significandf.c
@@ -22,5 +22,5 @@
float
significandf(float x)
{
- return __ieee754_scalbf(x,(float) -ilogbf(x));
+ return scalbf(x,(float) -ilogbf(x));
}
diff --git a/libm/upstream-freebsd/lib/msun/src/s_sinl.c b/libm/upstream-freebsd/lib/msun/src/s_sinl.c
index f1ef84c..c5ee106 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_sinl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_sinl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007 Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_sinpi.c b/libm/upstream-freebsd/lib/msun/src/s_sinpi.c
index 858459a..8b388de 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_sinpi.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_sinpi.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2017 Steven G. Kargl
+ * Copyright (c) 2017, 2023 Steven G. Kargl
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -118,16 +118,7 @@
}
if (ix < 0x43300000) { /* 1 <= |x| < 0x1p52 */
- /* Determine integer part of ax. */
- j0 = ((ix >> 20) & 0x7ff) - 0x3ff;
- if (j0 < 20) {
- ix &= ~(0x000fffff >> j0);
- lx = 0;
- } else {
- lx &= ~((uint32_t)0xffffffff >> (j0 - 20));
- }
- INSERT_WORDS(x, ix, lx);
-
+ FFLOOR(x, j0, ix, lx); /* Integer part of ax. */
ax -= x;
EXTRACT_WORDS(ix, lx, ax);
@@ -155,7 +146,8 @@
return ((hx & 0x80000000) ? -s : s);
}
- if (ix >= 0x7f800000)
+ /* x = +-inf or nan. */
+ if (ix >= 0x7ff00000)
return (vzero / vzero);
/*
diff --git a/libm/upstream-freebsd/lib/msun/src/s_tanl.c b/libm/upstream-freebsd/lib/msun/src/s_tanl.c
index 0c5228e..c21e38d 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_tanl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_tanl.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2007 Steven G. Kargl
* All rights reserved.
diff --git a/libm/upstream-freebsd/lib/msun/src/s_tgammaf.c b/libm/upstream-freebsd/lib/msun/src/s_tgammaf.c
index 1fd46e8..6cbd356 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_tgammaf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_tgammaf.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
diff --git a/linker/Android.bp b/linker/Android.bp
index 020bd7d..0ccd16d 100644
--- a/linker/Android.bp
+++ b/linker/Android.bp
@@ -169,6 +169,7 @@
srcs: [
"dlfcn.cpp",
"linker.cpp",
+ "linker_auxv.cpp",
"linker_block_allocator.cpp",
"linker_dlwarning.cpp",
"linker_cfi.cpp",
diff --git a/linker/NOTICE b/linker/NOTICE
index d61a193..7fd1877 100644
--- a/linker/NOTICE
+++ b/linker/NOTICE
@@ -362,3 +362,31 @@
-------------------------------------------------------------------
+Copyright (C) 2023 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.
+
+-------------------------------------------------------------------
+
diff --git a/linker/arch/riscv64/begin.S b/linker/arch/riscv64/begin.S
index f7509c6..21665cb 100644
--- a/linker/arch/riscv64/begin.S
+++ b/linker/arch/riscv64/begin.S
@@ -33,7 +33,7 @@
.cfi_undefined ra
mv a0, sp
- jal __linker_init
+ call __linker_init
// __linker_init returns the address of the entry point in the main image.
jr a0
diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp
index a3f5246..fee19f4 100644
--- a/linker/dlfcn.cpp
+++ b/linker/dlfcn.cpp
@@ -97,7 +97,7 @@
void* context) __LINKER_PUBLIC__;
}
-static pthread_mutex_t g_dl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+pthread_mutex_t g_dl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static char* __bionic_set_dlerror(char* new_value) {
char* old_value = __get_thread()->current_dlerror;
diff --git a/linker/linker.cpp b/linker/linker.cpp
index ac6d7c5..31abba0 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -27,6 +27,7 @@
*/
#include <android/api-level.h>
+#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
@@ -967,7 +968,7 @@
}
// Check if it is properly stored
- if (entry.method != kCompressStored || (entry.offset % PAGE_SIZE) != 0) {
+ if (entry.method != kCompressStored || (entry.offset % page_size()) != 0) {
close(fd);
return -1;
}
@@ -1191,7 +1192,7 @@
"load_library(ns=%s, task=%s, flags=0x%x, realpath=%s, search_linked_namespaces=%d)",
ns->get_name(), name, rtld_flags, realpath.c_str(), search_linked_namespaces);
- if ((file_offset % PAGE_SIZE) != 0) {
+ if ((file_offset % page_size()) != 0) {
DL_OPEN_ERR("file offset for the library \"%s\" is not page-aligned: %" PRId64, name, file_offset);
return false;
}
diff --git a/linker/linker_auxv.cpp b/linker/linker_auxv.cpp
new file mode 100644
index 0000000..d8e4a3e
--- /dev/null
+++ b/linker/linker_auxv.cpp
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2023 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 "linker_auxv.h"
+
+#include <elf.h>
+#include <stdio.h>
+#include <sys/auxv.h>
+#include <unistd.h>
+
+#include <async_safe/log.h>
+
+static const char* auxv_name(int at) {
+ switch (at) {
+ case AT_NULL: return "AT_NULL";
+ case AT_IGNORE: return "AT_IGNORE";
+ case AT_EXECFD: return "AT_EXECFD";
+ case AT_PHDR: return "AT_PHDR";
+ case AT_PHENT: return "AT_PHENT";
+ case AT_PHNUM: return "AT_PHNUM";
+ case AT_PAGESZ: return "AT_PAGESZ";
+ case AT_BASE: return "AT_BASE";
+ case AT_FLAGS: return "AT_FLAGS";
+ case AT_ENTRY: return "AT_ENTRY";
+ case AT_NOTELF: return "AT_NOTELF";
+ case AT_UID: return "AT_UID";
+ case AT_EUID: return "AT_EUID";
+ case AT_GID: return "AT_GID";
+ case AT_EGID: return "AT_EGID";
+ case AT_PLATFORM: return "AT_PLATFORM";
+ case AT_HWCAP: return "AT_HWCAP";
+ case AT_CLKTCK: return "AT_CLKTCK";
+ case AT_SECURE: return "AT_SECURE";
+ case AT_BASE_PLATFORM: return "AT_BASE_PLATFORM";
+ case AT_RANDOM: return "AT_RANDOM";
+ case AT_HWCAP2: return "AT_HWCAP2";
+ case AT_RSEQ_FEATURE_SIZE: return "AT_RSEQ_FEATURE_SIZE";
+ case AT_RSEQ_ALIGN: return "AT_RSEQ_ALIGN";
+ case AT_EXECFN: return "AT_EXECFN";
+ case AT_SYSINFO_EHDR: return "AT_SYSINFO_EHDR";
+#if defined(AT_MINSIGSTKSZ)
+ case AT_MINSIGSTKSZ: return "AT_MINSIGSTKSZ";
+#endif
+#if defined(AT_SYSINFO)
+ case AT_SYSINFO: return "AT_SYSINFO";
+#endif
+#if defined(AT_L1I_CACHESIZE)
+ case AT_L1I_CACHESIZE: return "AT_L1I_CACHESIZE";
+#endif
+#if defined(AT_L1I_CACHEGEOMETRY)
+ case AT_L1I_CACHEGEOMETRY: return "AT_L1I_CACHEGEOMETRY";
+#endif
+#if defined(AT_L1D_CACHESIZE)
+ case AT_L1D_CACHESIZE: return "AT_L1D_CACHESIZE";
+#endif
+#if defined(AT_L1D_CACHEGEOMETRY)
+ case AT_L1D_CACHEGEOMETRY: return "AT_L1D_CACHEGEOMETRY";
+#endif
+#if defined(AT_L2_CACHESIZE)
+ case AT_L2_CACHESIZE: return "AT_L2_CACHESIZE";
+#endif
+#if defined(AT_L2_CACHEGEOMETRY)
+ case AT_L2_CACHEGEOMETRY: return "AT_L2_CACHEGEOMETRY";
+#endif
+ }
+ static char name[32];
+ snprintf(name, sizeof(name), "AT_??? (%d)", at);
+ return name;
+}
+
+void ld_show_auxv(ElfW(auxv_t)* auxv) {
+ for (ElfW(auxv_t)* v = auxv; v->a_type != AT_NULL; ++v) {
+ const char* name = auxv_name(v->a_type);
+ long value = v->a_un.a_val;
+ switch (v->a_type) {
+ case AT_SYSINFO_EHDR:
+ case AT_PHDR:
+ case AT_BASE:
+ case AT_ENTRY:
+ case AT_RANDOM:
+ async_safe_format_fd(STDOUT_FILENO, "%-20s %#lx\n", name, value);
+ break;
+ case AT_FLAGS:
+ case AT_HWCAP:
+ case AT_HWCAP2:
+ async_safe_format_fd(STDOUT_FILENO, "%-20s %#lb\n", name, value);
+ break;
+ case AT_EXECFN:
+ case AT_PLATFORM:
+ async_safe_format_fd(STDOUT_FILENO, "%-20s \"%s\"\n", name, reinterpret_cast<char*>(value));
+ break;
+ default:
+ async_safe_format_fd(STDOUT_FILENO, "%-20s %ld\n", name, value);
+ break;
+ }
+ }
+}
diff --git a/linker/linker_auxv.h b/linker/linker_auxv.h
new file mode 100644
index 0000000..c093283
--- /dev/null
+++ b/linker/linker_auxv.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+#include <elf.h>
+#include <link.h>
+
+void ld_show_auxv(ElfW(auxv_t)* auxv);
diff --git a/linker/linker_block_allocator.cpp b/linker/linker_block_allocator.cpp
index 60e5e1c..e70e6ae 100644
--- a/linker/linker_block_allocator.cpp
+++ b/linker/linker_block_allocator.cpp
@@ -37,8 +37,9 @@
#include "linker_debug.h"
-static constexpr size_t kAllocateSize = PAGE_SIZE * 100;
-static_assert(kAllocateSize % PAGE_SIZE == 0, "Invalid kAllocateSize.");
+static constexpr size_t kMaxPageSize = 65536;
+static constexpr size_t kAllocateSize = kMaxPageSize * 6;
+static_assert(kAllocateSize % kMaxPageSize == 0, "Invalid kAllocateSize.");
struct LinkerBlockAllocatorPage {
LinkerBlockAllocatorPage* next;
diff --git a/linker/linker_cfi.cpp b/linker/linker_cfi.cpp
index 6bc2615..247a25d 100644
--- a/linker/linker_cfi.cpp
+++ b/linker/linker_cfi.cpp
@@ -50,8 +50,8 @@
ShadowWrite(uint16_t* s, uint16_t* e) {
shadow_start = reinterpret_cast<char*>(s);
shadow_end = reinterpret_cast<char*>(e);
- aligned_start = reinterpret_cast<char*>(PAGE_START(reinterpret_cast<uintptr_t>(shadow_start)));
- aligned_end = reinterpret_cast<char*>(PAGE_END(reinterpret_cast<uintptr_t>(shadow_end)));
+ aligned_start = reinterpret_cast<char*>(page_start(reinterpret_cast<uintptr_t>(shadow_start)));
+ aligned_end = reinterpret_cast<char*>(page_end(reinterpret_cast<uintptr_t>(shadow_end)));
tmp_start =
reinterpret_cast<char*>(mmap(nullptr, aligned_end - aligned_start, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0));
@@ -204,7 +204,7 @@
shadow_start = reinterpret_cast<uintptr_t* (*)(uintptr_t)>(cfi_init)(p);
CHECK(shadow_start != nullptr);
CHECK(*shadow_start == p);
- mprotect(shadow_start, PAGE_SIZE, PROT_READ);
+ mprotect(shadow_start, page_size(), PROT_READ);
return true;
}
diff --git a/linker/linker_globals.h b/linker/linker_globals.h
index 0998629..0cb7ca9 100644
--- a/linker/linker_globals.h
+++ b/linker/linker_globals.h
@@ -104,3 +104,4 @@
};
__LIBC_HIDDEN__ extern bool g_is_ldd;
+__LIBC_HIDDEN__ extern pthread_mutex_t g_dl_mutex;
diff --git a/linker/linker_main.cpp b/linker/linker_main.cpp
index 26e2228..5a33a63 100644
--- a/linker/linker_main.cpp
+++ b/linker/linker_main.cpp
@@ -32,6 +32,7 @@
#include <sys/auxv.h>
#include "linker.h"
+#include "linker_auxv.h"
#include "linker_cfi.h"
#include "linker_debug.h"
#include "linker_debuggerd.h"
@@ -43,10 +44,10 @@
#include "linker_tls.h"
#include "linker_utils.h"
+#include "private/KernelArgumentBlock.h"
#include "private/bionic_call_ifunc_resolver.h"
#include "private/bionic_globals.h"
#include "private/bionic_tls.h"
-#include "private/KernelArgumentBlock.h"
#include "android-base/unique_fd.h"
#include "android-base/strings.h"
@@ -324,12 +325,14 @@
g_linker_logger.ResetState();
- // Get a few environment variables.
+ // Enable debugging logs?
const char* LD_DEBUG = getenv("LD_DEBUG");
if (LD_DEBUG != nullptr) {
g_ld_debug_verbosity = atoi(LD_DEBUG);
}
+ if (getenv("LD_SHOW_AUXV") != nullptr) ld_show_auxv(args.auxv);
+
#if defined(__LP64__)
INFO("[ Android dynamic linker (64-bit) ]");
#else
@@ -580,8 +583,8 @@
}
ElfW(Addr) seg_start = phdr->p_vaddr + si->load_bias;
- ElfW(Addr) seg_page_end = PAGE_END(seg_start + phdr->p_memsz);
- ElfW(Addr) seg_file_end = PAGE_END(seg_start + phdr->p_filesz);
+ ElfW(Addr) seg_page_end = page_end(seg_start + phdr->p_memsz);
+ ElfW(Addr) seg_file_end = page_end(seg_start + phdr->p_filesz);
if (seg_page_end > seg_file_end) {
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME,
@@ -690,6 +693,13 @@
* function, or other GOT reference will generate a segfault.
*/
extern "C" ElfW(Addr) __linker_init(void* raw_args) {
+ // Unlock the loader mutex immediately before transferring to the executable's
+ // entry point. This must happen after destructors are called in this function
+ // (e.g. ~soinfo), so declare this variable very early.
+ struct DlMutexUnlocker {
+ ~DlMutexUnlocker() { pthread_mutex_unlock(&g_dl_mutex); }
+ } unlocker;
+
// Initialize TLS early so system calls and errno work.
KernelArgumentBlock args(raw_args);
bionic_tcb temp_tcb __attribute__((uninitialized));
@@ -752,6 +762,11 @@
// Initialize the linker's static libc's globals
__libc_init_globals();
+ // A constructor could spawn a thread that calls into the loader, so as soon
+ // as we've called a constructor, we need to hold the lock until transferring
+ // to the entry point.
+ pthread_mutex_lock(&g_dl_mutex);
+
// Initialize the linker's own global variables
tmp_linker_so.call_constructors();
diff --git a/linker/linker_mapped_file_fragment.cpp b/linker/linker_mapped_file_fragment.cpp
index cbe5f66..6be1b2b 100644
--- a/linker/linker_mapped_file_fragment.cpp
+++ b/linker/linker_mapped_file_fragment.cpp
@@ -29,6 +29,7 @@
#include "linker_mapped_file_fragment.h"
#include "linker_debug.h"
#include "linker_utils.h"
+#include "platform/bionic/page.h"
#include <inttypes.h>
#include <stdlib.h>
diff --git a/linker/linker_memory.cpp b/linker/linker_memory.cpp
index 456d254..7ce53b8 100644
--- a/linker/linker_memory.cpp
+++ b/linker/linker_memory.cpp
@@ -76,6 +76,10 @@
return get_allocator().memalign(alignment, byte_count);
}
+void* aligned_alloc(size_t alignment, size_t byte_count) {
+ return get_allocator().memalign(alignment, byte_count);
+}
+
void* calloc(size_t item_count, size_t item_size) {
return get_allocator().alloc(item_count*item_size);
}
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index 73cfced..97ae709 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -116,7 +116,7 @@
can only memory-map at page boundaries, this means that the bias is
computed as:
- load_bias = phdr0_load_address - PAGE_START(phdr0->p_vaddr)
+ load_bias = phdr0_load_address - page_start(phdr0->p_vaddr)
(NOTE: The value must be used as a 32-bit unsigned integer, to deal with
possible wrap around UINT32_MAX for possible large p_vaddr values).
@@ -124,11 +124,11 @@
And that the phdr0_load_address must start at a page boundary, with
the segment's real content starting at:
- phdr0_load_address + PAGE_OFFSET(phdr0->p_vaddr)
+ phdr0_load_address + page_offset(phdr0->p_vaddr)
Note that ELF requires the following condition to make the mmap()-ing work:
- PAGE_OFFSET(phdr0->p_vaddr) == PAGE_OFFSET(phdr0->p_offset)
+ page_offset(phdr0->p_vaddr) == page_offset(phdr0->p_offset)
The load_bias must be added to any p_vaddr value read from the ELF file to
determine the corresponding memory address.
@@ -529,8 +529,8 @@
min_vaddr = 0;
}
- min_vaddr = PAGE_START(min_vaddr);
- max_vaddr = PAGE_END(max_vaddr);
+ min_vaddr = page_start(min_vaddr);
+ max_vaddr = page_end(max_vaddr);
if (out_min_vaddr != nullptr) {
*out_min_vaddr = min_vaddr;
@@ -545,7 +545,7 @@
// program header table. Used to determine whether the file should be loaded at
// a specific virtual address alignment for use with huge pages.
size_t phdr_table_get_maximum_alignment(const ElfW(Phdr)* phdr_table, size_t phdr_count) {
- size_t maximum_alignment = PAGE_SIZE;
+ size_t maximum_alignment = page_size();
for (size_t i = 0; i < phdr_count; ++i) {
const ElfW(Phdr)* phdr = &phdr_table[i];
@@ -563,7 +563,7 @@
#if defined(__LP64__)
return maximum_alignment;
#else
- return PAGE_SIZE;
+ return page_size();
#endif
}
@@ -574,7 +574,7 @@
int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS;
// Reserve enough space to properly align the library's start address.
mapping_align = std::max(mapping_align, start_align);
- if (mapping_align == PAGE_SIZE) {
+ if (mapping_align == page_size()) {
void* mmap_ptr = mmap(nullptr, size, PROT_NONE, mmap_flags, -1, 0);
if (mmap_ptr == MAP_FAILED) {
return nullptr;
@@ -593,7 +593,7 @@
constexpr size_t kMaxGapUnits = 32;
// Allocate enough space so that the end of the desired region aligned up is still inside the
// mapping.
- size_t mmap_size = align_up(size, mapping_align) + mapping_align - PAGE_SIZE;
+ size_t mmap_size = align_up(size, mapping_align) + mapping_align - page_size();
uint8_t* mmap_ptr =
reinterpret_cast<uint8_t*>(mmap(nullptr, mmap_size, PROT_NONE, mmap_flags, -1, 0));
if (mmap_ptr == MAP_FAILED) {
@@ -610,7 +610,7 @@
mapping_align = std::max(mapping_align, kGapAlignment);
gap_size =
kGapAlignment * (is_first_stage_init() ? 1 : arc4random_uniform(kMaxGapUnits - 1) + 1);
- mmap_size = align_up(size + gap_size, mapping_align) + mapping_align - PAGE_SIZE;
+ mmap_size = align_up(size + gap_size, mapping_align) + mapping_align - page_size();
mmap_ptr = reinterpret_cast<uint8_t*>(mmap(nullptr, mmap_size, PROT_NONE, mmap_flags, -1, 0));
if (mmap_ptr == MAP_FAILED) {
return nullptr;
@@ -665,12 +665,12 @@
load_size_ - address_space->reserved_size, load_size_, name_.c_str());
return false;
}
- size_t start_alignment = PAGE_SIZE;
+ size_t start_alignment = page_size();
if (get_transparent_hugepages_supported() && get_application_target_sdk_version() >= 31) {
size_t maximum_alignment = phdr_table_get_maximum_alignment(phdr_table_, phdr_num_);
// Limit alignment to PMD size as other alignments reduce the number of
// bits available for ASLR for no benefit.
- start_alignment = maximum_alignment == kPmdSize ? kPmdSize : PAGE_SIZE;
+ start_alignment = maximum_alignment == kPmdSize ? kPmdSize : page_size();
}
start = ReserveWithAlignmentPadding(load_size_, kLibraryAlignment, start_alignment, &gap_start_,
&gap_size_);
@@ -706,8 +706,8 @@
ElfW(Addr) seg_start = phdr->p_vaddr + load_bias_;
ElfW(Addr) seg_end = seg_start + phdr->p_memsz;
- ElfW(Addr) seg_page_start = PAGE_START(seg_start);
- ElfW(Addr) seg_page_end = PAGE_END(seg_end);
+ ElfW(Addr) seg_page_start = page_start(seg_start);
+ ElfW(Addr) seg_page_end = page_end(seg_end);
ElfW(Addr) seg_file_end = seg_start + phdr->p_filesz;
@@ -715,7 +715,7 @@
ElfW(Addr) file_start = phdr->p_offset;
ElfW(Addr) file_end = file_start + phdr->p_filesz;
- ElfW(Addr) file_page_start = PAGE_START(file_start);
+ ElfW(Addr) file_page_start = page_start(file_start);
ElfW(Addr) file_length = file_end - file_page_start;
if (file_size_ <= 0) {
@@ -768,11 +768,11 @@
// if the segment is writable, and does not end on a page boundary,
// zero-fill it until the page limit.
- if ((phdr->p_flags & PF_W) != 0 && PAGE_OFFSET(seg_file_end) > 0) {
- memset(reinterpret_cast<void*>(seg_file_end), 0, PAGE_SIZE - PAGE_OFFSET(seg_file_end));
+ if ((phdr->p_flags & PF_W) != 0 && page_offset(seg_file_end) > 0) {
+ memset(reinterpret_cast<void*>(seg_file_end), 0, page_size() - page_offset(seg_file_end));
}
- seg_file_end = PAGE_END(seg_file_end);
+ seg_file_end = page_end(seg_file_end);
// seg_file_end is now the first page address after the file
// content. If seg_end is larger, we need to zero anything
@@ -811,8 +811,8 @@
continue;
}
- ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr) + load_bias;
- ElfW(Addr) seg_page_end = PAGE_END(phdr->p_vaddr + phdr->p_memsz) + load_bias;
+ ElfW(Addr) seg_page_start = page_start(phdr->p_vaddr) + load_bias;
+ ElfW(Addr) seg_page_end = page_end(phdr->p_vaddr + phdr->p_memsz) + load_bias;
int prot = PFLAGS_TO_PROT(phdr->p_flags) | extra_prot_flags;
if ((prot & PROT_WRITE) != 0) {
@@ -912,8 +912,8 @@
// the program is likely to fail at runtime. So in effect the
// linker must only emit a PT_GNU_RELRO segment if it ensures
// that it starts on a page boundary.
- ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr) + load_bias;
- ElfW(Addr) seg_page_end = PAGE_END(phdr->p_vaddr + phdr->p_memsz) + load_bias;
+ ElfW(Addr) seg_page_start = page_start(phdr->p_vaddr) + load_bias;
+ ElfW(Addr) seg_page_end = page_end(phdr->p_vaddr + phdr->p_memsz) + load_bias;
int ret = mprotect(reinterpret_cast<void*>(seg_page_start),
seg_page_end - seg_page_start,
@@ -972,8 +972,8 @@
continue;
}
- ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr) + load_bias;
- ElfW(Addr) seg_page_end = PAGE_END(phdr->p_vaddr + phdr->p_memsz) + load_bias;
+ ElfW(Addr) seg_page_start = page_start(phdr->p_vaddr) + load_bias;
+ ElfW(Addr) seg_page_end = page_end(phdr->p_vaddr + phdr->p_memsz) + load_bias;
ssize_t size = seg_page_end - seg_page_start;
ssize_t written = TEMP_FAILURE_RETRY(write(fd, reinterpret_cast<void*>(seg_page_start), size));
@@ -1035,8 +1035,8 @@
continue;
}
- ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr) + load_bias;
- ElfW(Addr) seg_page_end = PAGE_END(phdr->p_vaddr + phdr->p_memsz) + load_bias;
+ ElfW(Addr) seg_page_start = page_start(phdr->p_vaddr) + load_bias;
+ ElfW(Addr) seg_page_end = page_end(phdr->p_vaddr + phdr->p_memsz) + load_bias;
char* file_base = static_cast<char*>(temp_mapping) + *file_offset;
char* mem_base = reinterpret_cast<char*>(seg_page_start);
@@ -1053,15 +1053,15 @@
while (match_offset < size) {
// Skip over dissimilar pages.
while (match_offset < size &&
- memcmp(mem_base + match_offset, file_base + match_offset, PAGE_SIZE) != 0) {
- match_offset += PAGE_SIZE;
+ memcmp(mem_base + match_offset, file_base + match_offset, page_size()) != 0) {
+ match_offset += page_size();
}
// Count similar pages.
size_t mismatch_offset = match_offset;
while (mismatch_offset < size &&
- memcmp(mem_base + mismatch_offset, file_base + mismatch_offset, PAGE_SIZE) == 0) {
- mismatch_offset += PAGE_SIZE;
+ memcmp(mem_base + mismatch_offset, file_base + mismatch_offset, page_size()) == 0) {
+ mismatch_offset += page_size();
}
// Map over similar pages.
diff --git a/linker/linker_utils.cpp b/linker/linker_utils.cpp
index 29110ed..cd03eed 100644
--- a/linker/linker_utils.cpp
+++ b/linker/linker_utils.cpp
@@ -169,12 +169,6 @@
return true;
}
-constexpr off64_t kPageMask = ~static_cast<off64_t>(PAGE_SIZE-1);
-
-off64_t page_start(off64_t offset) {
- return offset & kPageMask;
-}
-
bool safe_add(off64_t* out, off64_t a, size_t b) {
CHECK(a >= 0);
if (static_cast<uint64_t>(INT64_MAX - a) < b) {
@@ -185,10 +179,6 @@
return true;
}
-size_t page_offset(off64_t offset) {
- return static_cast<size_t>(offset & (PAGE_SIZE-1));
-}
-
void split_path(const char* path, const char* delimiters,
std::vector<std::string>* paths) {
if (path != nullptr && path[0] != 0) {
diff --git a/linker/linker_utils.h b/linker/linker_utils.h
index 5073b10..3049e53 100644
--- a/linker/linker_utils.h
+++ b/linker/linker_utils.h
@@ -55,7 +55,5 @@
std::string dirname(const char* path);
-off64_t page_start(off64_t offset);
-size_t page_offset(off64_t offset);
bool safe_add(off64_t* out, off64_t a, size_t b);
bool is_first_stage_init();
diff --git a/linker/linker_utils_test.cpp b/linker/linker_utils_test.cpp
index 44907da..0b881d4 100644
--- a/linker/linker_utils_test.cpp
+++ b/linker/linker_utils_test.cpp
@@ -33,6 +33,7 @@
#include <gtest/gtest.h>
#include "linker_utils.h"
+#include "platform/bionic/page.h"
TEST(linker_utils, format_string) {
std::vector<std::pair<std::string, std::string>> params = {{ "LIB", "lib32"}, { "SDKVER", "42"}};
@@ -104,9 +105,9 @@
}
TEST(linker_utils, page_start) {
- ASSERT_EQ(0x0001000, page_start(0x0001000));
- ASSERT_EQ(0x3002000, page_start(0x300222f));
- ASSERT_EQ(0x6001000, page_start(0x6001fff));
+ ASSERT_EQ(0x0001000U, page_start(0x0001000));
+ ASSERT_EQ(0x3002000U, page_start(0x300222f));
+ ASSERT_EQ(0x6001000U, page_start(0x6001fff));
}
TEST(linker_utils, page_offset) {
diff --git a/tests/Android.bp b/tests/Android.bp
index 281e29d..14b4e3e 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -59,6 +59,9 @@
// Needed to test pthread_internal_t layout.
"-Wno-invalid-offsetof",
+ // This warning does not provide any benefit to the tests.
+ "-Wno-reorder-init-list",
+
// For glibc.
"-D__STDC_LIMIT_MACROS",
],
@@ -386,7 +389,6 @@
"bug_26110743_test.cpp",
"byteswap_test.cpp",
"complex_test.cpp",
- "complex_force_long_double_test.cpp",
"ctype_test.cpp",
"dirent_test.cpp",
"elf_test.cpp",
@@ -423,7 +425,6 @@
"malloc_iterate_test.cpp",
"malloc_test.cpp",
"math_test.cpp",
- "math_force_long_double_test.cpp",
"membarrier_test.cpp",
"memtag_stack_test.cpp",
"mntent_test.cpp",
@@ -472,7 +473,9 @@
"struct_layout_test.cpp",
"sstream_test.cpp",
"sys_auxv_test.cpp",
+ "sys_cachectl_test.cpp",
"sys_epoll_test.cpp",
+ "sys_hwprobe_test.cpp",
"sys_mman_test.cpp",
"sys_msg_test.cpp",
"sys_param_test.cpp",
@@ -676,22 +679,6 @@
},
}
-// Ensures that FORTIFY checks aren't run when ASAN is on.
-cc_test {
- name: "bionic-fortify-runtime-asan-test",
- defaults: [
- "bionic_clang_fortify_tests_w_flags",
- ],
- cflags: [
- "-Werror",
- "-D_FORTIFY_SOURCE=2",
- ],
- sanitize: {
- address: true,
- },
- srcs: ["clang_fortify_asan.cpp"],
-}
-
// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
// it can confuse these tools pretty easily. If this builds successfully, then
// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
@@ -867,79 +854,8 @@
],
}
-// -----------------------------------------------------------------------------
-// Tests for the device using bionic's .so. Run with:
-// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
-// adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests
-// -----------------------------------------------------------------------------
cc_defaults {
- name: "bionic_unit_tests_defaults",
- host_supported: false,
- gtest: false,
-
- defaults: [
- "bionic_tests_defaults",
- ],
-
- whole_static_libs: [
- "libBionicTests",
- "libBionicLoaderTests",
- "libBionicElfTlsLoaderTests",
- ],
-
- static_libs: [
- "libtinyxml2",
- "liblog",
- "libbase",
- "libgtest_isolated",
- ],
-
- srcs: [
- // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
- "__cxa_thread_atexit_test.cpp",
- "gtest_globals.cpp",
- "gtest_main.cpp",
- "gwp_asan_test.cpp",
- "thread_local_test.cpp",
- ],
-
- conlyflags: [
- "-fexceptions",
- "-fnon-call-exceptions",
- ],
-
- ldflags: ["-Wl,--export-dynamic"],
-
- include_dirs: ["bionic/libc"],
-
- stl: "libc++_static",
-
- target: {
- android: {
- shared_libs: [
- "ld-android",
- "libdl",
- "libdl_android",
- "libdl_preempt_test_1",
- "libdl_preempt_test_2",
- "libdl_test_df_1_global",
- "libtest_elftls_shared_var",
- "libtest_elftls_tprel",
- ],
- static_libs: [
- // The order of these libraries matters, do not shuffle them.
- "libmeminfo",
- "libziparchive",
- "libz",
- "libutils",
- ],
- ldflags: [
- "-Wl,--rpath,${ORIGIN}/bionic-loader-test-libs",
- "-Wl,--enable-new-dtags",
- ],
- },
- },
-
+ name: "bionic_unit_tests_data",
data_bins: [
"cfi_test_helper",
"cfi_test_helper2",
@@ -967,7 +883,6 @@
"thread_exit_cb_helper",
"tls_properties_helper",
],
-
data_libs: [
"libatest_simple_zip",
"libcfi-test",
@@ -1104,6 +1019,81 @@
],
}
+// -----------------------------------------------------------------------------
+// Tests for the device using bionic's .so. Run with:
+// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
+// adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests
+// -----------------------------------------------------------------------------
+cc_defaults {
+ name: "bionic_unit_tests_defaults",
+ host_supported: false,
+ gtest: false,
+
+ defaults: [
+ "bionic_tests_defaults",
+ "bionic_unit_tests_data",
+ ],
+
+ whole_static_libs: [
+ "libBionicTests",
+ "libBionicLoaderTests",
+ "libBionicElfTlsLoaderTests",
+ ],
+
+ static_libs: [
+ "libtinyxml2",
+ "liblog",
+ "libbase",
+ "libgtest_isolated",
+ ],
+
+ srcs: [
+ // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
+ "__cxa_thread_atexit_test.cpp",
+ "gtest_globals.cpp",
+ "gtest_main.cpp",
+ "gwp_asan_test.cpp",
+ "thread_local_test.cpp",
+ ],
+
+ conlyflags: [
+ "-fexceptions",
+ "-fnon-call-exceptions",
+ ],
+
+ ldflags: ["-Wl,--export-dynamic"],
+
+ include_dirs: ["bionic/libc"],
+
+ stl: "libc++_static",
+
+ target: {
+ android: {
+ shared_libs: [
+ "ld-android",
+ "libdl",
+ "libdl_android",
+ "libdl_preempt_test_1",
+ "libdl_preempt_test_2",
+ "libdl_test_df_1_global",
+ "libtest_elftls_shared_var",
+ "libtest_elftls_tprel",
+ ],
+ static_libs: [
+ // The order of these libraries matters, do not shuffle them.
+ "libmeminfo",
+ "libziparchive",
+ "libz",
+ "libutils",
+ ],
+ ldflags: [
+ "-Wl,--rpath,${ORIGIN}/bionic-loader-test-libs",
+ "-Wl,--enable-new-dtags",
+ ],
+ },
+ },
+}
+
cc_test {
name: "bionic-unit-tests",
defaults: [
diff --git a/tests/async_safe_test.cpp b/tests/async_safe_test.cpp
index dc4db07..cc1b598 100644
--- a/tests/async_safe_test.cpp
+++ b/tests/async_safe_test.cpp
@@ -45,6 +45,15 @@
async_safe_format_buffer(buf, sizeof(buf), "aa%scc", "bb");
EXPECT_STREQ("aabbcc", buf);
+ async_safe_format_buffer(buf, sizeof(buf), "a%bb", 1234);
+ EXPECT_STREQ("a10011010010b", buf);
+
+ async_safe_format_buffer(buf, sizeof(buf), "a%#bb", 1234);
+ EXPECT_STREQ("a0b10011010010b", buf);
+
+ async_safe_format_buffer(buf, sizeof(buf), "a%#Bb", 1234);
+ EXPECT_STREQ("a0B10011010010b", buf);
+
async_safe_format_buffer(buf, sizeof(buf), "a%cc", 'b');
EXPECT_STREQ("abc", buf);
@@ -76,9 +85,15 @@
async_safe_format_buffer(buf, sizeof(buf), "a%xz", 0x12ab);
EXPECT_STREQ("a12abz", buf);
+ async_safe_format_buffer(buf, sizeof(buf), "a%#xz", 0x12ab);
+ EXPECT_STREQ("a0x12abz", buf);
+
async_safe_format_buffer(buf, sizeof(buf), "a%Xz", 0x12ab);
EXPECT_STREQ("a12ABz", buf);
+ async_safe_format_buffer(buf, sizeof(buf), "a%#Xz", 0x12ab);
+ EXPECT_STREQ("a0X12ABz", buf);
+
async_safe_format_buffer(buf, sizeof(buf), "a%08xz", 0x123456);
EXPECT_STREQ("a00123456z", buf);
diff --git a/tests/clang_fortify_asan.cpp b/tests/clang_fortify_asan.cpp
deleted file mode 100644
index 51656eb..0000000
--- a/tests/clang_fortify_asan.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2019 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 test ensures that ensures that FORTIFY's run-time bits aren't enabled with ASAN on. Most
- * ways of getting FORTIFY to break turn into UB unless you get creative. Rather than remaking the
- * entire FORTIFY test-suite with this added constraint, we pick a function with well-defined
- * behavior when a FORTIFY check would fail (umask), and hope that the success of that is indicative
- * of the rest working.
- */
-
-#ifndef __clang__
-#error "Non-clang isn't supported"
-#endif
-
-#ifndef _FORTIFY_SOURCE
-#error "_FORTIFY_SOURCE must be defined"
-#endif
-
-#include <sys/cdefs.h>
-
-#if defined(__BIONIC__) && __has_feature(address_sanitizer)
-#include <sys/stat.h>
-#include <gtest/gtest.h>
-
-TEST(ClangFortifyASAN, NoRuntimeChecksAreEnabled) {
- volatile mode_t unknown = 01000;
- mode_t previous = umask(unknown);
-
- // Not necessary, but polite.
- umask(previous);
-}
-#endif
diff --git a/tests/complex_force_long_double_test.cpp b/tests/complex_force_long_double_test.cpp
deleted file mode 100644
index 2ea7bd4..0000000
--- a/tests/complex_force_long_double_test.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#define __BIONIC_LP32_USE_LONG_DOUBLE
-#include "complex_test.cpp"
diff --git a/tests/complex_test.cpp b/tests/complex_test.cpp
index f015b2c..6a1831f 100644
--- a/tests/complex_test.cpp
+++ b/tests/complex_test.cpp
@@ -14,20 +14,11 @@
* limitations under the License.
*/
-#if defined(__BIONIC_LP32_USE_LONG_DOUBLE)
-#define COMPLEX_TEST complex_h_force_long_double
-#else
-#define COMPLEX_TEST complex_h
-#endif
-
// This file is compiled against both glibc and bionic, and our complex.h
// depends on bionic-specific macros, so hack around that.
#include <sys/cdefs.h>
#if !defined(__INTRODUCED_IN)
#define __INTRODUCED_IN(x)
-#define __INTRODUCED_IN_32(x)
-#define __INTRODUCED_IN_64(x)
-#define __RENAME_LDBL(a,b,c)
#endif
// libc++ actively gets in the way of including <complex.h> from C++, so we
@@ -62,259 +53,259 @@
#include <gtest/gtest.h>
#pragma pop_macro("I")
-TEST(COMPLEX_TEST, cabs) {
+TEST(complex_h, cabs) {
ASSERT_EQ(0.0, cabs(0));
}
-TEST(COMPLEX_TEST, cabsf) {
+TEST(complex_h, cabsf) {
ASSERT_EQ(0.0, cabsf(0));
}
-TEST(COMPLEX_TEST, cabsl) {
+TEST(complex_h, cabsl) {
ASSERT_EQ(0.0, cabsl(0));
}
-TEST(COMPLEX_TEST, cacos) {
+TEST(complex_h, cacos) {
ASSERT_EQ(M_PI_2, cacos(0.0));
}
-TEST(COMPLEX_TEST, cacosf) {
+TEST(complex_h, cacosf) {
ASSERT_EQ(static_cast<float>(M_PI_2), cacosf(0.0));
}
-TEST(COMPLEX_TEST, cacosl) {
+TEST(complex_h, cacosl) {
ASSERT_EQ(M_PI_2l, cacosl(0.0));
}
-TEST(COMPLEX_TEST, cacosh) {
+TEST(complex_h, cacosh) {
ASSERT_EQ(0.0, cacosh(1.0));
}
-TEST(COMPLEX_TEST, cacoshl) {
+TEST(complex_h, cacoshl) {
ASSERT_EQ(0.0, cacoshl(1.0));
}
-TEST(COMPLEX_TEST, cacoshf) {
+TEST(complex_h, cacoshf) {
ASSERT_EQ(0.0, cacoshf(1.0));
}
-TEST(COMPLEX_TEST, carg) {
+TEST(complex_h, carg) {
ASSERT_EQ(0.0, carg(0));
}
-TEST(COMPLEX_TEST, cargf) {
+TEST(complex_h, cargf) {
ASSERT_EQ(0.0, cargf(0));
}
-TEST(COMPLEX_TEST, cargl) {
+TEST(complex_h, cargl) {
ASSERT_EQ(0.0, cargl(0));
}
-TEST(COMPLEX_TEST, casin) {
+TEST(complex_h, casin) {
ASSERT_EQ(0.0, casin(0));
}
-TEST(COMPLEX_TEST, casinf) {
+TEST(complex_h, casinf) {
ASSERT_EQ(0.0, casinf(0));
}
-TEST(COMPLEX_TEST, casinl) {
+TEST(complex_h, casinl) {
ASSERT_EQ(0.0, casinl(0));
}
-TEST(COMPLEX_TEST, casinh) {
+TEST(complex_h, casinh) {
ASSERT_EQ(0.0, casinh(0));
}
-TEST(COMPLEX_TEST, casinhf) {
+TEST(complex_h, casinhf) {
ASSERT_EQ(0.0, casinhf(0));
}
-TEST(COMPLEX_TEST, casinhl) {
+TEST(complex_h, casinhl) {
ASSERT_EQ(0.0, casinhl(0));
}
-TEST(COMPLEX_TEST, catan) {
+TEST(complex_h, catan) {
ASSERT_EQ(0.0, catan(0));
}
-TEST(COMPLEX_TEST, catanf) {
+TEST(complex_h, catanf) {
ASSERT_EQ(0.0, catanf(0));
}
-TEST(COMPLEX_TEST, catanl) {
+TEST(complex_h, catanl) {
ASSERT_EQ(0.0, catanl(0));
}
-TEST(COMPLEX_TEST, catanh) {
+TEST(complex_h, catanh) {
ASSERT_EQ(0.0, catanh(0));
}
-TEST(COMPLEX_TEST, catanhf) {
+TEST(complex_h, catanhf) {
ASSERT_EQ(0.0, catanhf(0));
}
-TEST(COMPLEX_TEST, catanhl) {
+TEST(complex_h, catanhl) {
ASSERT_EQ(0.0, catanhl(0));
}
-TEST(COMPLEX_TEST, ccos) {
+TEST(complex_h, ccos) {
ASSERT_EQ(1.0, ccos(0));
}
-TEST(COMPLEX_TEST, ccosf) {
+TEST(complex_h, ccosf) {
ASSERT_EQ(1.0, ccosf(0));
}
-TEST(COMPLEX_TEST, ccosl) {
+TEST(complex_h, ccosl) {
ASSERT_EQ(1.0, ccosl(0));
}
-TEST(COMPLEX_TEST, ccosh) {
+TEST(complex_h, ccosh) {
ASSERT_EQ(1.0, ccosh(0));
}
-TEST(COMPLEX_TEST, ccoshf) {
+TEST(complex_h, ccoshf) {
ASSERT_EQ(1.0, ccoshf(0));
}
-TEST(COMPLEX_TEST, ccoshl) {
+TEST(complex_h, ccoshl) {
ASSERT_EQ(1.0, ccoshl(0));
}
-TEST(COMPLEX_TEST, cexp) {
+TEST(complex_h, cexp) {
ASSERT_EQ(1.0, cexp(0));
}
-TEST(COMPLEX_TEST, cexpf) {
+TEST(complex_h, cexpf) {
ASSERT_EQ(1.0, cexpf(0));
}
-TEST(COMPLEX_TEST, cexpl) {
+TEST(complex_h, cexpl) {
ASSERT_EQ(1.0, cexpl(0));
}
-TEST(COMPLEX_TEST, cimag) {
+TEST(complex_h, cimag) {
ASSERT_EQ(0.0, cimag(0));
}
-TEST(COMPLEX_TEST, cimagf) {
+TEST(complex_h, cimagf) {
ASSERT_EQ(0.0f, cimagf(0));
}
-TEST(COMPLEX_TEST, cimagl) {
+TEST(complex_h, cimagl) {
ASSERT_EQ(0.0, cimagl(0));
}
-TEST(COMPLEX_TEST, clog) {
+TEST(complex_h, clog) {
ASSERT_EQ(0.0, clog(1.0));
}
-TEST(COMPLEX_TEST, clogf) {
+TEST(complex_h, clogf) {
ASSERT_EQ(0.0f, clogf(1.0f));
}
-TEST(COMPLEX_TEST, clogl) {
+TEST(complex_h, clogl) {
ASSERT_EQ(0.0L, clogl(1.0L));
}
-TEST(COMPLEX_TEST, conj) {
+TEST(complex_h, conj) {
ASSERT_EQ(0.0, conj(0));
}
-TEST(COMPLEX_TEST, conjf) {
+TEST(complex_h, conjf) {
ASSERT_EQ(0.0f, conjf(0));
}
-TEST(COMPLEX_TEST, conjl) {
+TEST(complex_h, conjl) {
ASSERT_EQ(0.0, conjl(0));
}
-TEST(COMPLEX_TEST, cpow) {
+TEST(complex_h, cpow) {
ASSERT_EQ(8.0, cpow(2.0, 3.0));
}
-TEST(COMPLEX_TEST, cpowf) {
+TEST(complex_h, cpowf) {
ASSERT_EQ(8.0f, cpowf(2.0f, 3.0f));
}
-TEST(COMPLEX_TEST, cpowl) {
+TEST(complex_h, cpowl) {
ASSERT_EQ(8.0L, cpowl(2.0L, 3.0L));
}
-TEST(COMPLEX_TEST, cproj) {
+TEST(complex_h, cproj) {
ASSERT_EQ(0.0, cproj(0));
}
-TEST(COMPLEX_TEST, cprojf) {
+TEST(complex_h, cprojf) {
ASSERT_EQ(0.0f, cprojf(0));
}
-TEST(COMPLEX_TEST, cprojl) {
+TEST(complex_h, cprojl) {
ASSERT_EQ(0.0, cprojl(0));
}
-TEST(COMPLEX_TEST, creal) {
+TEST(complex_h, creal) {
ASSERT_EQ(2.0, creal(2.0 + 3.0I));
}
-TEST(COMPLEX_TEST, crealf) {
+TEST(complex_h, crealf) {
ASSERT_EQ(2.0f, crealf(2.0f + 3.0fI));
}
-TEST(COMPLEX_TEST, creall) {
+TEST(complex_h, creall) {
ASSERT_EQ(2.0, creall(2.0L + 3.0LI));
}
-TEST(COMPLEX_TEST, csin) {
+TEST(complex_h, csin) {
ASSERT_EQ(0.0, csin(0));
}
-TEST(COMPLEX_TEST, csinf) {
+TEST(complex_h, csinf) {
ASSERT_EQ(0.0, csinf(0));
}
-TEST(COMPLEX_TEST, csinl) {
+TEST(complex_h, csinl) {
ASSERT_EQ(0.0, csinl(0));
}
-TEST(COMPLEX_TEST, csinh) {
+TEST(complex_h, csinh) {
ASSERT_EQ(0.0, csinh(0));
}
-TEST(COMPLEX_TEST, csinhf) {
+TEST(complex_h, csinhf) {
ASSERT_EQ(0.0, csinhf(0));
}
-TEST(COMPLEX_TEST, csinhl) {
+TEST(complex_h, csinhl) {
ASSERT_EQ(0.0, csinhl(0));
}
-TEST(COMPLEX_TEST, csqrt) {
+TEST(complex_h, csqrt) {
ASSERT_EQ(0.0, csqrt(0));
}
-TEST(COMPLEX_TEST, csqrtf) {
+TEST(complex_h, csqrtf) {
ASSERT_EQ(0.0f, csqrtf(0));
}
-TEST(COMPLEX_TEST, csqrtl) {
+TEST(complex_h, csqrtl) {
ASSERT_EQ(0.0, csqrtl(0));
}
-TEST(COMPLEX_TEST, ctan) {
+TEST(complex_h, ctan) {
ASSERT_EQ(0.0, ctan(0));
}
-TEST(COMPLEX_TEST, ctanf) {
+TEST(complex_h, ctanf) {
ASSERT_EQ(0.0, ctanf(0));
}
-TEST(COMPLEX_TEST, ctanl) {
+TEST(complex_h, ctanl) {
ASSERT_EQ(0.0, ctanl(0));
}
-TEST(COMPLEX_TEST, ctanh) {
+TEST(complex_h, ctanh) {
ASSERT_EQ(0.0, ctanh(0));
double complex z;
@@ -335,7 +326,7 @@
ASSERT_TRUE(isnan(cimag(z)));
}
-TEST(COMPLEX_TEST, ctanhf) {
+TEST(complex_h, ctanhf) {
ASSERT_EQ(0.0f, ctanhf(0.0f));
float complex z;
@@ -356,7 +347,7 @@
ASSERT_TRUE(isnan(cimagf(z)));
}
-TEST(COMPLEX_TEST, ctanhl) {
+TEST(complex_h, ctanhl) {
ASSERT_EQ(0.0L, ctanhl(0.0L));
long double complex z;
diff --git a/tests/elftls_dl_test.cpp b/tests/elftls_dl_test.cpp
index 56736e7..e2fa3a0 100644
--- a/tests/elftls_dl_test.cpp
+++ b/tests/elftls_dl_test.cpp
@@ -154,7 +154,6 @@
}
TEST(elftls_dl, dtv_resize) {
- SKIP_WITH_HWASAN; // TODO(b/271243811): Fix for new toolchain
#if defined(__BIONIC__)
#define LOAD_LIB(soname) ({ \
auto lib = dlopen(soname, RTLD_LOCAL | RTLD_NOW); \
@@ -167,11 +166,12 @@
static_assert(sizeof(TlsDtv) == 3 * sizeof(void*),
"This test assumes that the Dtv has a 3-word header");
- // Initially there are 4 modules:
+ // Initially there are 4 modules (5 w/ hwasan):
// - the main test executable
// - libc
// - libtest_elftls_shared_var
// - libtest_elftls_tprel
+ // - w/ hwasan: libclang_rt.hwasan
// The initial DTV is an empty DTV with no generation and a size of 0.
TlsDtv* zero_dtv = dtv();
@@ -179,25 +179,25 @@
ASSERT_EQ(nullptr, zero_dtv->next);
ASSERT_EQ(kTlsGenerationNone, zero_dtv->generation);
- // Load the fifth module.
+ // Load module 5 (6 w/ hwasan).
auto func1 = LOAD_LIB("libtest_elftls_dynamic_filler_1.so");
ASSERT_EQ(101, func1());
// After loading one module, the DTV should be initialized to the next
// power-of-2 size (including the header).
TlsDtv* initial_dtv = dtv();
- ASSERT_EQ(5u, initial_dtv->count);
+ ASSERT_EQ(running_with_hwasan() ? 13u : 5u, dtv()->count);
ASSERT_EQ(zero_dtv, initial_dtv->next);
ASSERT_LT(0u, initial_dtv->generation);
- // Load module 6.
+ // Load module 6 (7 w/ hwasan).
auto func2 = LOAD_LIB("libtest_elftls_dynamic_filler_2.so");
ASSERT_EQ(102, func1());
#if defined(__aarch64__)
// The arm64 TLSDESC resolver doesn't update the DTV if it is new enough for
// the given access.
- ASSERT_EQ(5u, dtv()->count);
+ ASSERT_EQ(running_with_hwasan() ? 13u : 5u, dtv()->count);
#else
// __tls_get_addr updates the DTV anytime the generation counter changes.
ASSERT_EQ(13u, dtv()->count);
@@ -205,11 +205,13 @@
ASSERT_EQ(201, func2());
TlsDtv* new_dtv = dtv();
- ASSERT_NE(initial_dtv, new_dtv);
- ASSERT_EQ(initial_dtv, new_dtv->next);
+ if (!running_with_hwasan()) {
+ ASSERT_NE(initial_dtv, new_dtv);
+ ASSERT_EQ(initial_dtv, new_dtv->next);
+ }
ASSERT_EQ(13u, new_dtv->count);
- // Load module 7.
+ // Load module 7 (8 w/ hwasan).
auto func3 = LOAD_LIB("libtest_elftls_dynamic_filler_3.so");
ASSERT_EQ(103, func1());
ASSERT_EQ(202, func2());
diff --git a/tests/execinfo_test.cpp b/tests/execinfo_test.cpp
index b8e1325..1a0c51b 100644
--- a/tests/execinfo_test.cpp
+++ b/tests/execinfo_test.cpp
@@ -79,9 +79,13 @@
}
static size_t FindFunction(std::vector<void*>& frames, uintptr_t func_addr) {
+ Dl_info func_info;
+ if (!dladdr(reinterpret_cast<void*>(func_addr), &func_info)) {
+ return 0;
+ }
for (size_t i = 0; i < frames.size(); i++) {
- uintptr_t frame_addr = reinterpret_cast<uintptr_t>(frames[i]);
- if (frame_addr >= func_addr && frame_addr <= func_addr + 0x100) {
+ Dl_info frame_info;
+ if (dladdr(frames[i], &frame_info) && func_info.dli_saddr == frame_info.dli_saddr) {
return i + 1;
}
}
diff --git a/tests/fcntl_test.cpp b/tests/fcntl_test.cpp
index 862f498..c1c586c 100644
--- a/tests/fcntl_test.cpp
+++ b/tests/fcntl_test.cpp
@@ -360,6 +360,6 @@
#endif
}
-TEST(fcntl_DeathTest, fcntl_F_SETFD) {
+TEST_F(fcntl_DeathTest, fcntl_F_SETFD) {
EXPECT_DEATH(fcntl(0, F_SETFD, O_NONBLOCK), "non-FD_CLOEXEC");
}
diff --git a/tests/gwp_asan_test.cpp b/tests/gwp_asan_test.cpp
index c31f48c..709a939 100644
--- a/tests/gwp_asan_test.cpp
+++ b/tests/gwp_asan_test.cpp
@@ -34,12 +34,15 @@
#if defined(__BIONIC__)
#include "android-base/file.h"
+#include "android-base/silent_death_test.h"
#include "android-base/test_utils.h"
#include "gwp_asan/options.h"
#include "platform/bionic/malloc.h"
#include "sys/system_properties.h"
#include "utils.h"
+using gwp_asan_integration_DeathTest = SilentDeathTest;
+
// basename is a mess, use gnu basename explicitly to avoid the need for string
// mutation.
extern "C" const char* __gnu_basename(const char* path);
@@ -133,7 +136,7 @@
}
};
-TEST(gwp_asan_integration, DISABLED_assert_gwp_asan_enabled) {
+TEST_F(gwp_asan_integration_DeathTest, DISABLED_assert_gwp_asan_enabled) {
std::string maps;
EXPECT_TRUE(android::base::ReadFileToString("/proc/self/maps", &maps));
EXPECT_TRUE(maps.find("GWP-ASan") != std::string::npos) << maps;
@@ -173,7 +176,7 @@
__system_property_set((std::string("libc.debug.gwp_asan.max_allocs.") + basename).c_str(),
"40000");
- RunSubtestNoEnv("gwp_asan_integration.DISABLED_assert_gwp_asan_enabled");
+ RunSubtestNoEnv("gwp_asan_integration_DeathTest.DISABLED_assert_gwp_asan_enabled");
}
TEST(gwp_asan_integration, sysprops_persist_program_specific) {
@@ -191,7 +194,7 @@
__system_property_set((std::string("persist.libc.debug.gwp_asan.max_allocs.") + basename).c_str(),
"40000");
- RunSubtestNoEnv("gwp_asan_integration.DISABLED_assert_gwp_asan_enabled");
+ RunSubtestNoEnv("gwp_asan_integration_DeathTest.DISABLED_assert_gwp_asan_enabled");
}
TEST(gwp_asan_integration, sysprops_non_persist_overrides_persist) {
@@ -235,7 +238,7 @@
__system_property_set("libc.debug.gwp_asan.process_sampling.system_default", "0");
__system_property_set("libc.debug.gwp_asan.max_allocs.system_default", "0");
- RunSubtestNoEnv("gwp_asan_integration.DISABLED_assert_gwp_asan_enabled");
+ RunSubtestNoEnv("gwp_asan_integration_DeathTest.DISABLED_assert_gwp_asan_enabled");
}
TEST(gwp_asan_integration, sysprops_can_disable) {
@@ -261,7 +264,7 @@
__system_property_set("libc.debug.gwp_asan.process_sampling.system_default", "0");
__system_property_set("libc.debug.gwp_asan.max_allocs.system_default", "0");
- RunGwpAsanTest("gwp_asan_integration.DISABLED_assert_gwp_asan_enabled");
+ RunGwpAsanTest("gwp_asan_integration_DeathTest.DISABLED_assert_gwp_asan_enabled");
}
#endif // defined(__BIONIC__)
diff --git a/tests/headers/posix/README.md b/tests/headers/posix/README.md
new file mode 100644
index 0000000..e7c171a
--- /dev/null
+++ b/tests/headers/posix/README.md
@@ -0,0 +1,8 @@
+# POSIX header tests
+
+These compile-time tests check that each POSIX header contains _at
+least_ what POSIX says. Every POSIX header file gets a corresponding
+`.c` file in this directory. Every constant, macro, type, struct field,
+and function in the header gets a corresponding assertion in the file.
+
+See `header_checks.h` for the implementation of the assertions.
diff --git a/tests/headers/posix/termios_h.c b/tests/headers/posix/termios_h.c
index 1255c16..0a67eaa 100644
--- a/tests/headers/posix/termios_h.c
+++ b/tests/headers/posix/termios_h.c
@@ -42,6 +42,12 @@
STRUCT_MEMBER(struct termios, tcflag_t, c_lflag);
STRUCT_MEMBER_ARRAY(struct termios, cc_t/*[]*/, c_cc);
+#if !defined(__GLIBC__) // Our glibc is too old.
+ TYPE(struct winsize);
+ STRUCT_MEMBER(struct winsize, unsigned short, ws_row);
+ STRUCT_MEMBER(struct winsize, unsigned short, ws_col);
+#endif
+
MACRO(NCCS);
MACRO(VEOF);
@@ -162,6 +168,12 @@
FUNCTION(tcflush, int (*f)(int, int));
FUNCTION(tcgetattr, int (*f)(int, struct termios*));
FUNCTION(tcgetsid, pid_t (*f)(int));
+#if !defined(__GLIBC__) // Our glibc is too old.
+ FUNCTION(tcgetwinsize, int (*f)(int, struct winsize*));
+#endif
FUNCTION(tcsendbreak, int (*f)(int, int));
FUNCTION(tcsetattr, int (*f)(int, int, const struct termios*));
+#if !defined(__GLIBC__) // Our glibc is too old.
+ FUNCTION(tcsetwinsize, int (*f)(int, const struct winsize*));
+#endif
}
diff --git a/tests/heap_tagging_level_test.cpp b/tests/heap_tagging_level_test.cpp
index 917be37..b88d64a 100644
--- a/tests/heap_tagging_level_test.cpp
+++ b/tests/heap_tagging_level_test.cpp
@@ -19,6 +19,8 @@
#include <malloc.h>
#include <sys/prctl.h>
+#include <android-base/silent_death_test.h>
+
#if defined(__BIONIC__)
#include "gtest_globals.h"
#include "platform/bionic/mte.h"
@@ -44,7 +46,9 @@
}
#endif
-TEST(heap_tagging_level, tagged_pointer_dies) {
+using heap_tagging_level_DeathTest = SilentDeathTest;
+
+TEST_F(heap_tagging_level_DeathTest, tagged_pointer_dies) {
#if defined(__BIONIC__)
if (!KernelSupportsTaggedPointers()) {
GTEST_SKIP() << "Kernel doesn't support tagged pointers.";
@@ -221,6 +225,8 @@
enum class MemtagNote { NONE, ASYNC, SYNC };
class MemtagNoteTest : public testing::TestWithParam<std::tuple<MemtagNote, bool>> {};
+static const char* kNoteSuffix[] = {"disabled", "async", "sync"};
+
TEST_P(MemtagNoteTest, SEGV) {
#if defined(__BIONIC__) && defined(__aarch64__)
SKIP_WITH_NATIVE_BRIDGE; // http://b/242170715
@@ -229,19 +235,13 @@
}
// Note that we do not check running_with_hwasan() - what matters here is whether the test binary
// itself is built with HWASan.
- bool withHWASAN = __has_feature(hwaddress_sanitizer);
bool withMTE = getauxval(AT_HWCAP2) & HWCAP2_MTE;
- const char* kNoteSuffix[] = {"disabled", "async", "sync"};
- const char* kExpectedOutputHWASAN[] = {".*tag-mismatch.*", ".*tag-mismatch.*",
- ".*tag-mismatch.*"};
// Note that we do not check the exact si_code of the "async" variant, as it may be auto-upgraded
// to asymm or even sync.
const char* kExpectedOutputMTE[] = {"normal exit\n", "SEGV_MTE[AS]ERR\n", "SEGV_MTESERR\n"};
const char* kExpectedOutputNonMTE[] = {"normal exit\n", "normal exit\n", "normal exit\n"};
- const char** kExpectedOutput =
- withHWASAN ? kExpectedOutputHWASAN : (withMTE ? kExpectedOutputMTE : kExpectedOutputNonMTE);
- const int kExpectedExitStatus = withHWASAN ? -SIGABRT : 0;
+ const char** kExpectedOutput = withMTE ? kExpectedOutputMTE : kExpectedOutputNonMTE;
MemtagNote note = std::get<0>(GetParam());
bool isStatic = std::get<1>(GetParam());
@@ -251,7 +251,7 @@
chmod(helper.c_str(), 0755);
ExecTestHelper eth;
eth.SetArgs({helper.c_str(), nullptr});
- eth.Run([&]() { execve(helper.c_str(), eth.GetArgs(), eth.GetEnv()); }, kExpectedExitStatus,
+ eth.Run([&]() { execve(helper.c_str(), eth.GetArgs(), eth.GetEnv()); }, 0,
kExpectedOutput[static_cast<int>(note)]);
#else
GTEST_SKIP() << "bionic/arm64 only";
@@ -261,4 +261,10 @@
INSTANTIATE_TEST_SUITE_P(, MemtagNoteTest,
testing::Combine(testing::Values(MemtagNote::NONE, MemtagNote::ASYNC,
MemtagNote::SYNC),
- testing::Bool()));
+ testing::Bool()),
+ [](const ::testing::TestParamInfo<MemtagNoteTest::ParamType>& info) {
+ MemtagNote note = std::get<0>(info.param);
+ std::string s = kNoteSuffix[static_cast<int>(note)];
+ if (std::get<1>(info.param)) s += "_static";
+ return s;
+ });
diff --git a/tests/ifunc_test.cpp b/tests/ifunc_test.cpp
index e3c437e..1fdbf1a 100644
--- a/tests/ifunc_test.cpp
+++ b/tests/ifunc_test.cpp
@@ -60,6 +60,26 @@
return ret42;
}
+#elif defined(__riscv)
+
+#include <sys/hwprobe.h>
+
+static uint64_t g_hwcap;
+
+static riscv_hwprobe g_hwprobes[] = {{.key = RISCV_HWPROBE_KEY_IMA_EXT_0}};
+
+extern "C" fn_ptr_t hwcap_resolver(uint64_t hwcap, void* null) {
+ // Check hwcap like arm32/arm64.
+ g_hwcap = hwcap;
+
+ // For now, the pointer argument is reserved for future expansion.
+ if (null != NULL) abort();
+
+ // Ensure that __riscv_hwprobe() can be called from an ifunc.
+ if (__riscv_hwprobe(g_hwprobes, 1, 0, nullptr, 0) != 0) return nullptr;
+ return ret42;
+}
+
#else
extern "C" fn_ptr_t hwcap_resolver() {
@@ -81,6 +101,12 @@
EXPECT_EQ(getauxval(AT_HWCAP2), g_arg._hwcap2);
#elif defined(__arm__)
EXPECT_EQ(getauxval(AT_HWCAP), g_hwcap);
+#elif defined(__riscv)
+ EXPECT_EQ(getauxval(AT_HWCAP), g_hwcap);
+
+ riscv_hwprobe probes[] = {{.key = RISCV_HWPROBE_KEY_IMA_EXT_0}};
+ ASSERT_EQ(0, __riscv_hwprobe(probes, 1, 0, nullptr, 0));
+ EXPECT_EQ(probes[0].value, g_hwprobes[0].value);
#endif
}
diff --git a/tests/libs/Android.bp b/tests/libs/Android.bp
index a2fbe55..51f5ac6 100644
--- a/tests/libs/Android.bp
+++ b/tests/libs/Android.bp
@@ -1621,6 +1621,7 @@
diag: {
memtag_heap: true,
},
+ hwaddress: false,
},
}
@@ -1633,6 +1634,7 @@
diag: {
memtag_heap: false,
},
+ hwaddress: false,
},
}
@@ -1642,6 +1644,7 @@
srcs: ["heap_tagging_helper.cpp"],
sanitize: {
memtag_heap: false,
+ hwaddress: false,
},
}
@@ -1655,6 +1658,7 @@
diag: {
memtag_heap: true,
},
+ hwaddress: false,
},
}
@@ -1668,6 +1672,7 @@
diag: {
memtag_heap: false,
},
+ hwaddress: false,
},
}
@@ -1678,6 +1683,7 @@
static_executable: true,
sanitize: {
memtag_heap: false,
+ hwaddress: false,
},
}
@@ -1691,6 +1697,7 @@
diag: {
memtag_heap: true,
},
+ hwaddress: false,
},
header_libs: ["bionic_libc_platform_headers"],
cflags: ["-fexceptions"],
@@ -1707,6 +1714,7 @@
diag: {
memtag_heap: true,
},
+ hwaddress: false,
},
header_libs: ["bionic_libc_platform_headers"],
cflags: ["-fexceptions"],
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index 22905f4..aa53450 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -708,6 +708,15 @@
#endif
}
+TEST(malloc, mallopt_log_stats) {
+#if defined(__BIONIC__)
+ SKIP_WITH_HWASAN << "hwasan does not implement mallopt";
+ ASSERT_EQ(1, mallopt(M_LOG_STATS, 0));
+#else
+ GTEST_SKIP() << "bionic-only test";
+#endif
+}
+
// Verify that all of the mallopt values are unique.
TEST(malloc, mallopt_unique_params) {
#if defined(__BIONIC__)
@@ -722,6 +731,7 @@
std::make_pair(M_TSDS_COUNT_MAX, "M_TSDS_COUNT_MAX"),
std::make_pair(M_BIONIC_ZERO_INIT, "M_BIONIC_ZERO_INIT"),
std::make_pair(M_BIONIC_SET_HEAP_TAGGING_LEVEL, "M_BIONIC_SET_HEAP_TAGGING_LEVEL"),
+ std::make_pair(M_LOG_STATS, "M_LOG_STATS"),
};
std::unordered_map<int, std::string> all_params;
@@ -814,7 +824,7 @@
8, 32, 128, 4096, 32768, 131072, 1024000, 10240000, 20480000, 300000000
};
- constexpr static size_t kMaxAllocs = 50;
+ static constexpr size_t kMaxAllocs = 50;
for (size_t size : sizes) {
// If some of these allocations are stuck in a thread cache, then keep
@@ -857,7 +867,7 @@
SKIP_WITH_HWASAN << "hwasan does not implement mallinfo2";
static size_t sizes[] = {8, 32, 128, 4096, 32768, 131072, 1024000, 10240000, 20480000, 300000000};
- constexpr static size_t kMaxAllocs = 50;
+ static constexpr size_t kMaxAllocs = 50;
for (size_t size : sizes) {
// If some of these allocations are stuck in a thread cache, then keep
@@ -1337,45 +1347,44 @@
}
#if defined(__BIONIC__)
-static void* SetAllocationLimit(void* data) {
- std::atomic_bool* go = reinterpret_cast<std::atomic_bool*>(data);
- while (!go->load()) {
- }
- size_t limit = 500 * 1024 * 1024;
- if (android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit))) {
- return reinterpret_cast<void*>(-1);
- }
- return nullptr;
-}
-
static void SetAllocationLimitMultipleThreads() {
- std::atomic_bool go;
- go = false;
-
static constexpr size_t kNumThreads = 4;
- pthread_t threads[kNumThreads];
+ std::atomic_bool start_running = false;
+ std::atomic<size_t> num_running;
+ std::atomic<size_t> num_successful;
+ std::unique_ptr<std::thread> threads[kNumThreads];
for (size_t i = 0; i < kNumThreads; i++) {
- ASSERT_EQ(0, pthread_create(&threads[i], nullptr, SetAllocationLimit, &go));
+ threads[i].reset(new std::thread([&num_running, &start_running, &num_successful] {
+ ++num_running;
+ while (!start_running) {
+ }
+ size_t limit = 500 * 1024 * 1024;
+ if (android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit))) {
+ ++num_successful;
+ }
+ }));
}
- // Let them go all at once.
- go = true;
+ // Wait until all of the threads have started.
+ while (num_running != kNumThreads)
+ ;
+
+ // Now start all of the threads setting the mallopt at once.
+ start_running = true;
+
// Send hardcoded signal (BIONIC_SIGNAL_PROFILER with value 0) to trigger
- // heapprofd handler.
- union sigval signal_value;
- signal_value.sival_int = 0;
+ // heapprofd handler. This will verify that changing the limit while
+ // the allocation handlers are being changed at the same time works,
+ // or that the limit handler is changed first and this also works properly.
+ union sigval signal_value {};
ASSERT_EQ(0, sigqueue(getpid(), BIONIC_SIGNAL_PROFILER, signal_value));
- size_t num_successful = 0;
+ // Wait for all of the threads to finish.
for (size_t i = 0; i < kNumThreads; i++) {
- void* result;
- ASSERT_EQ(0, pthread_join(threads[i], &result));
- if (result != nullptr) {
- num_successful++;
- }
+ threads[i]->join();
}
- ASSERT_EQ(1U, num_successful);
- exit(0);
+ ASSERT_EQ(1U, num_successful) << "Only one thread should be able to set the limit.";
+ _exit(0);
}
#endif
diff --git a/tests/math_force_long_double_test.cpp b/tests/math_force_long_double_test.cpp
deleted file mode 100644
index 432182b..0000000
--- a/tests/math_force_long_double_test.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#define __BIONIC_LP32_USE_LONG_DOUBLE
-#include "math_test.cpp"
diff --git a/tests/math_test.cpp b/tests/math_test.cpp
index 60872f3..493f3af 100644
--- a/tests/math_test.cpp
+++ b/tests/math_test.cpp
@@ -48,12 +48,6 @@
}
}
-#if defined(__BIONIC_LP32_USE_LONG_DOUBLE)
-#define MATH_TEST math_h_force_long_double
-#else
-#define MATH_TEST math_h
-#endif
-
#include "math_data_test.h"
#include <gtest/gtest.h>
@@ -103,7 +97,7 @@
return u.e;
}
-TEST(MATH_TEST, fpclassify) {
+TEST(math_h, fpclassify) {
ASSERT_EQ(FP_INFINITE, fpclassify(INFINITY));
ASSERT_EQ(FP_INFINITE, fpclassify(HUGE_VALF));
ASSERT_EQ(FP_INFINITE, fpclassify(-HUGE_VALF));
@@ -129,7 +123,7 @@
ASSERT_EQ(FP_ZERO, fpclassify(0.0L));
}
-TEST(MATH_TEST, isfinite) {
+TEST(math_h, isfinite) {
ASSERT_TRUE(test_capture_isfinite(123.0f));
ASSERT_TRUE(test_capture_isfinite(123.0));
ASSERT_TRUE(test_capture_isfinite(123.0L));
@@ -141,7 +135,7 @@
ASSERT_FALSE(test_capture_isfinite(-HUGE_VALL));
}
-TEST(MATH_TEST, isinf) {
+TEST(math_h, isinf) {
ASSERT_FALSE(test_capture_isinf(123.0f));
ASSERT_FALSE(test_capture_isinf(123.0));
ASSERT_FALSE(test_capture_isinf(123.0L));
@@ -153,7 +147,7 @@
ASSERT_TRUE(test_capture_isinf(-HUGE_VALL));
}
-TEST(MATH_TEST, isnan) {
+TEST(math_h, isnan) {
ASSERT_FALSE(test_capture_isnan(123.0f));
ASSERT_FALSE(test_capture_isnan(123.0));
ASSERT_FALSE(test_capture_isnan(123.0L));
@@ -162,7 +156,7 @@
ASSERT_TRUE(test_capture_isnan(nanl("")));
}
-TEST(MATH_TEST, isnormal) {
+TEST(math_h, isnormal) {
ASSERT_TRUE(isnormal(123.0f));
ASSERT_TRUE(isnormal(123.0));
ASSERT_TRUE(isnormal(123.0L));
@@ -172,7 +166,7 @@
}
// TODO: isgreater, isgreaterequals, isless, islessequal, islessgreater, isunordered
-TEST(MATH_TEST, signbit) {
+TEST(math_h, signbit) {
ASSERT_EQ(0, test_capture_signbit(0.0f));
ASSERT_EQ(0, test_capture_signbit(0.0));
ASSERT_EQ(0, test_capture_signbit(0.0L));
@@ -192,7 +186,7 @@
extern "C" int __fpclassifyf(float);
extern "C" int __fpclassifyl(long double);
-TEST(MATH_TEST, __fpclassify) {
+TEST(math_h, __fpclassify) {
ASSERT_EQ(FP_INFINITE, __fpclassify(HUGE_VAL));
ASSERT_EQ(FP_INFINITE, __fpclassify(-HUGE_VAL));
ASSERT_EQ(FP_NAN, __fpclassify(nan("")));
@@ -201,7 +195,7 @@
ASSERT_EQ(FP_ZERO, __fpclassify(0.0));
}
-TEST(MATH_TEST, __fpclassifyd) {
+TEST(math_h, __fpclassifyd) {
#if defined(__GLIBC__) || defined(ANDROID_HOST_MUSL)
#define __fpclassifyd __fpclassify
#endif
@@ -213,7 +207,7 @@
ASSERT_EQ(FP_ZERO, __fpclassifyd(0.0));
}
-TEST(MATH_TEST, __fpclassifyf) {
+TEST(math_h, __fpclassifyf) {
ASSERT_EQ(FP_INFINITE, __fpclassifyf(HUGE_VALF));
ASSERT_EQ(FP_INFINITE, __fpclassifyf(-HUGE_VALF));
ASSERT_EQ(FP_NAN, __fpclassifyf(nanf("")));
@@ -222,7 +216,7 @@
ASSERT_EQ(FP_ZERO, __fpclassifyf(0.0f));
}
-TEST(MATH_TEST, __fpclassifyl) {
+TEST(math_h, __fpclassifyl) {
EXPECT_EQ(FP_INFINITE, __fpclassifyl(HUGE_VALL));
EXPECT_EQ(FP_INFINITE, __fpclassifyl(-HUGE_VALL));
EXPECT_EQ(FP_NAN, __fpclassifyl(nanl("")));
@@ -231,7 +225,7 @@
EXPECT_EQ(FP_ZERO, __fpclassifyl(0.0L));
}
-TEST(MATH_TEST, finitef) {
+TEST(math_h, finitef) {
ASSERT_TRUE(finitef(123.0f));
ASSERT_FALSE(finitef(HUGE_VALF));
ASSERT_FALSE(finitef(-HUGE_VALF));
@@ -244,7 +238,7 @@
extern "C" int __isfinitel(long double);
extern "C" int isfinitel(long double);
-TEST(MATH_TEST, __isfinite) {
+TEST(math_h, __isfinite) {
#if defined(__GLIBC__)
#define __isfinite __finite
#elif defined(ANDROID_HOST_MUSL)
@@ -255,7 +249,7 @@
ASSERT_FALSE(__isfinite(-HUGE_VAL));
}
-TEST(MATH_TEST, __isfinitef) {
+TEST(math_h, __isfinitef) {
#if defined(__GLIBC__)
#define __isfinitef __finitef
#elif defined(ANDROID_HOST_MUSL)
@@ -266,7 +260,7 @@
ASSERT_FALSE(__isfinitef(-HUGE_VALF));
}
-TEST(MATH_TEST, isfinitef) {
+TEST(math_h, isfinitef) {
#if defined(__GLIBC__)
#define isfinitef __finitef
#elif defined(ANDROID_HOST_MUSL)
@@ -277,7 +271,7 @@
ASSERT_FALSE(isfinitef(-HUGE_VALF));
}
-TEST(MATH_TEST, __isfinitel) {
+TEST(math_h, __isfinitel) {
#if defined(__GLIBC__)
#define __isfinitel __finitel
#elif defined(ANDROID_HOST_MUSL)
@@ -288,7 +282,7 @@
ASSERT_FALSE(__isfinitel(-HUGE_VALL));
}
-TEST(MATH_TEST, isfinitel) {
+TEST(math_h, isfinitel) {
#if defined(__GLIBC__)
#define isfinitel __finitel
#elif defined(ANDROID_HOST_MUSL)
@@ -299,13 +293,13 @@
ASSERT_FALSE(isfinitel(-HUGE_VALL));
}
-TEST(MATH_TEST, finite) {
+TEST(math_h, finite) {
ASSERT_TRUE(finite(123.0));
ASSERT_FALSE(finite(HUGE_VAL));
ASSERT_FALSE(finite(-HUGE_VAL));
}
-TEST(MATH_TEST, isinf_function) {
+TEST(math_h, isinf_function) {
// The isinf macro deals with all three types; the isinf function is for doubles.
ASSERT_FALSE((isinf)(123.0));
ASSERT_TRUE((isinf)(HUGE_VAL));
@@ -319,7 +313,7 @@
extern "C" int __isinfl(long double);
extern "C" int isinfl(long double);
-TEST(MATH_TEST, __isinf) {
+TEST(math_h, __isinf) {
#if defined(ANDROID_HOST_MUSL)
#define __isinf isinf
#endif
@@ -328,7 +322,7 @@
ASSERT_TRUE(__isinf(-HUGE_VAL));
}
-TEST(MATH_TEST, __isinff) {
+TEST(math_h, __isinff) {
#if defined(ANDROID_HOST_MUSL)
#define __isinff isinf
#endif
@@ -337,7 +331,7 @@
ASSERT_TRUE(__isinff(-HUGE_VALF));
}
-TEST(MATH_TEST, isinff) {
+TEST(math_h, isinff) {
#if defined(ANDROID_HOST_MUSL)
#define isinff isinf
#endif
@@ -346,7 +340,7 @@
ASSERT_TRUE(isinff(-HUGE_VALF));
}
-TEST(MATH_TEST, __isinfl) {
+TEST(math_h, __isinfl) {
#if defined(ANDROID_HOST_MUSL)
#define __isinfl isinf
#endif
@@ -355,7 +349,7 @@
ASSERT_TRUE(__isinfl(-HUGE_VALL));
}
-TEST(MATH_TEST, isinfl) {
+TEST(math_h, isinfl) {
#if defined(ANDROID_HOST_MUSL)
#define isinfl isinf
#endif
@@ -364,7 +358,7 @@
ASSERT_TRUE(isinfl(-HUGE_VALL));
}
-TEST(MATH_TEST, isnan_function) {
+TEST(math_h, isnan_function) {
// The isnan macro deals with all three types; the isnan function is for doubles.
ASSERT_FALSE((isnan)(123.0));
ASSERT_TRUE((isnan)(nan("")));
@@ -377,7 +371,7 @@
extern "C" int __isnanl(long double);
extern "C" int isnanl(long double);
-TEST(MATH_TEST, __isnan) {
+TEST(math_h, __isnan) {
#if defined(ANDROID_HOST_MUSL)
#define __isnan isnan
#endif
@@ -385,7 +379,7 @@
ASSERT_TRUE(__isnan(nan("")));
}
-TEST(MATH_TEST, __isnanf) {
+TEST(math_h, __isnanf) {
#if defined(ANDROID_HOST_MUSL)
#define __isnanf isnan
#endif
@@ -393,7 +387,7 @@
ASSERT_TRUE(__isnanf(nanf("")));
}
-TEST(MATH_TEST, isnanf) {
+TEST(math_h, isnanf) {
#if defined(ANDROID_HOST_MUSL)
#define isnanf isnan
#endif
@@ -401,7 +395,7 @@
ASSERT_TRUE(isnanf(nanf("")));
}
-TEST(MATH_TEST, __isnanl) {
+TEST(math_h, __isnanl) {
#if defined(ANDROID_HOST_MUSL)
#define __isnanl isnan
#endif
@@ -409,7 +403,7 @@
ASSERT_TRUE(__isnanl(nanl("")));
}
-TEST(MATH_TEST, isnanl) {
+TEST(math_h, isnanl) {
#if defined(ANDROID_HOST_MUSL)
#define isnanl isnan
#endif
@@ -424,7 +418,7 @@
extern "C" int __isnormall(long double);
extern "C" int isnormall(long double);
-TEST(MATH_TEST, __isnormal) {
+TEST(math_h, __isnormal) {
#if defined(__BIONIC__)
ASSERT_TRUE(__isnormal(123.0));
ASSERT_FALSE(__isnormal(double_subnormal()));
@@ -433,7 +427,7 @@
#endif // __BIONIC__
}
-TEST(MATH_TEST, __isnormalf) {
+TEST(math_h, __isnormalf) {
#if defined(__BIONIC__)
ASSERT_TRUE(__isnormalf(123.0f));
ASSERT_FALSE(__isnormalf(float_subnormal()));
@@ -442,7 +436,7 @@
#endif // __BIONIC__
}
-TEST(MATH_TEST, isnormalf) {
+TEST(math_h, isnormalf) {
#if defined(__BIONIC__)
ASSERT_TRUE(isnormalf(123.0f));
ASSERT_FALSE(isnormalf(float_subnormal()));
@@ -451,7 +445,7 @@
#endif // __BIONIC__
}
-TEST(MATH_TEST, __isnormall) {
+TEST(math_h, __isnormall) {
#if defined(__BIONIC__)
ASSERT_TRUE(__isnormall(123.0L));
ASSERT_FALSE(__isnormall(ldouble_subnormal()));
@@ -460,7 +454,7 @@
#endif // __BIONIC__
}
-TEST(MATH_TEST, isnormall) {
+TEST(math_h, isnormall) {
#if defined(__BIONIC__)
ASSERT_TRUE(isnormall(123.0L));
ASSERT_FALSE(isnormall(ldouble_subnormal()));
@@ -474,370 +468,370 @@
extern "C" int __signbitf(float);
extern "C" int __signbitl(long double);
-TEST(MATH_TEST, __signbit) {
+TEST(math_h, __signbit) {
ASSERT_EQ(0, __signbit(0.0));
ASSERT_EQ(0, __signbit(1.0));
ASSERT_NE(0, __signbit(-1.0));
}
-TEST(MATH_TEST, __signbitf) {
+TEST(math_h, __signbitf) {
ASSERT_EQ(0, __signbitf(0.0f));
ASSERT_EQ(0, __signbitf(1.0f));
ASSERT_NE(0, __signbitf(-1.0f));
}
-TEST(MATH_TEST, __signbitl) {
+TEST(math_h, __signbitl) {
ASSERT_EQ(0L, __signbitl(0.0L));
ASSERT_EQ(0L, __signbitl(1.0L));
ASSERT_NE(0L, __signbitl(-1.0L));
}
-TEST(MATH_TEST, acos) {
+TEST(math_h, acos) {
ASSERT_DOUBLE_EQ(M_PI/2.0, acos(0.0));
}
-TEST(MATH_TEST, acosf) {
+TEST(math_h, acosf) {
ASSERT_FLOAT_EQ(static_cast<float>(M_PI)/2.0f, acosf(0.0f));
}
-TEST(MATH_TEST, acosl) {
+TEST(math_h, acosl) {
ASSERT_DOUBLE_EQ(M_PI/2.0L, acosl(0.0L));
}
-TEST(MATH_TEST, asin) {
+TEST(math_h, asin) {
ASSERT_DOUBLE_EQ(0.0, asin(0.0));
}
-TEST(MATH_TEST, asinf) {
+TEST(math_h, asinf) {
ASSERT_FLOAT_EQ(0.0f, asinf(0.0f));
}
-TEST(MATH_TEST, asinl) {
+TEST(math_h, asinl) {
ASSERT_DOUBLE_EQ(0.0L, asinl(0.0L));
}
-TEST(MATH_TEST, atan) {
+TEST(math_h, atan) {
ASSERT_DOUBLE_EQ(0.0, atan(0.0));
}
-TEST(MATH_TEST, atanf) {
+TEST(math_h, atanf) {
ASSERT_FLOAT_EQ(0.0f, atanf(0.0f));
}
-TEST(MATH_TEST, atanl) {
+TEST(math_h, atanl) {
ASSERT_DOUBLE_EQ(0.0L, atanl(0.0L));
}
-TEST(MATH_TEST, atan2) {
+TEST(math_h, atan2) {
ASSERT_DOUBLE_EQ(0.0, atan2(0.0, 0.0));
}
-TEST(MATH_TEST, atan2f) {
+TEST(math_h, atan2f) {
ASSERT_FLOAT_EQ(0.0f, atan2f(0.0f, 0.0f));
}
-TEST(MATH_TEST, atan2l) {
+TEST(math_h, atan2l) {
ASSERT_DOUBLE_EQ(0.0L, atan2l(0.0L, 0.0L));
}
-TEST(MATH_TEST, cos) {
+TEST(math_h, cos) {
ASSERT_DOUBLE_EQ(1.0, cos(0.0));
}
-TEST(MATH_TEST, cosf) {
+TEST(math_h, cosf) {
ASSERT_FLOAT_EQ(1.0f, cosf(0.0f));
}
-TEST(MATH_TEST, cosl) {
+TEST(math_h, cosl) {
ASSERT_DOUBLE_EQ(1.0L, cosl(0.0L));
}
-TEST(MATH_TEST, sin) {
+TEST(math_h, sin) {
ASSERT_DOUBLE_EQ(0.0, sin(0.0));
}
-TEST(MATH_TEST, sinf) {
+TEST(math_h, sinf) {
ASSERT_FLOAT_EQ(0.0f, sinf(0.0f));
}
-TEST(MATH_TEST, sinl) {
+TEST(math_h, sinl) {
ASSERT_DOUBLE_EQ(0.0L, sinl(0.0L));
}
-TEST(MATH_TEST, sincos) {
+TEST(math_h, sincos) {
double s, c;
sincos(0.0, &s, &c);
ASSERT_DOUBLE_EQ(0.0, s);
ASSERT_DOUBLE_EQ(1.0, c);
}
-TEST(MATH_TEST, sincosf) {
+TEST(math_h, sincosf) {
float s, c;
sincosf(0.0f, &s, &c);
ASSERT_FLOAT_EQ(0.0f, s);
ASSERT_FLOAT_EQ(1.0f, c);
}
-TEST(MATH_TEST, sincosl) {
+TEST(math_h, sincosl) {
long double s, c;
sincosl(0.0L, &s, &c);
ASSERT_DOUBLE_EQ(0.0L, s);
ASSERT_DOUBLE_EQ(1.0L, c);
}
-TEST(MATH_TEST, tan) {
+TEST(math_h, tan) {
ASSERT_DOUBLE_EQ(0.0, tan(0.0));
}
-TEST(MATH_TEST, tanf) {
+TEST(math_h, tanf) {
ASSERT_FLOAT_EQ(0.0f, tanf(0.0f));
}
-TEST(MATH_TEST, tanl) {
+TEST(math_h, tanl) {
ASSERT_DOUBLE_EQ(0.0L, tanl(0.0L));
}
-TEST(MATH_TEST, acosh) {
+TEST(math_h, acosh) {
ASSERT_DOUBLE_EQ(0.0, acosh(1.0));
}
-TEST(MATH_TEST, acoshf) {
+TEST(math_h, acoshf) {
ASSERT_FLOAT_EQ(0.0f, acoshf(1.0f));
}
-TEST(MATH_TEST, acoshl) {
+TEST(math_h, acoshl) {
ASSERT_DOUBLE_EQ(0.0L, acoshl(1.0L));
}
-TEST(MATH_TEST, asinh) {
+TEST(math_h, asinh) {
ASSERT_DOUBLE_EQ(0.0, asinh(0.0));
}
-TEST(MATH_TEST, asinhf) {
+TEST(math_h, asinhf) {
ASSERT_FLOAT_EQ(0.0f, asinhf(0.0f));
}
-TEST(MATH_TEST, asinhl) {
+TEST(math_h, asinhl) {
ASSERT_DOUBLE_EQ(0.0L, asinhl(0.0L));
}
-TEST(MATH_TEST, atanh) {
+TEST(math_h, atanh) {
ASSERT_DOUBLE_EQ(0.0, atanh(0.0));
}
-TEST(MATH_TEST, atanhf) {
+TEST(math_h, atanhf) {
ASSERT_FLOAT_EQ(0.0f, atanhf(0.0f));
}
-TEST(MATH_TEST, atanhl) {
+TEST(math_h, atanhl) {
ASSERT_DOUBLE_EQ(0.0L, atanhl(0.0L));
}
-TEST(MATH_TEST, cosh) {
+TEST(math_h, cosh) {
ASSERT_DOUBLE_EQ(1.0, cosh(0.0));
}
-TEST(MATH_TEST, coshf) {
+TEST(math_h, coshf) {
ASSERT_FLOAT_EQ(1.0f, coshf(0.0f));
}
-TEST(MATH_TEST, coshl) {
+TEST(math_h, coshl) {
ASSERT_DOUBLE_EQ(1.0L, coshl(0.0L));
}
-TEST(MATH_TEST, sinh) {
+TEST(math_h, sinh) {
ASSERT_DOUBLE_EQ(0.0, sinh(0.0));
}
-TEST(MATH_TEST, sinhf) {
+TEST(math_h, sinhf) {
ASSERT_FLOAT_EQ(0.0f, sinhf(0.0f));
}
-TEST(MATH_TEST, sinhl) {
+TEST(math_h, sinhl) {
ASSERT_DOUBLE_EQ(0.0L, sinhl(0.0L));
}
-TEST(MATH_TEST, tanh) {
+TEST(math_h, tanh) {
ASSERT_DOUBLE_EQ(0.0, tanh(0.0));
}
-TEST(MATH_TEST, tanhf) {
+TEST(math_h, tanhf) {
ASSERT_FLOAT_EQ(0.0f, tanhf(0.0f));
}
-TEST(MATH_TEST, tanhl) {
+TEST(math_h, tanhl) {
ASSERT_DOUBLE_EQ(0.0L, tanhl(0.0L));
}
-TEST(MATH_TEST, log) {
+TEST(math_h, log) {
ASSERT_DOUBLE_EQ(1.0, log(M_E));
}
-TEST(MATH_TEST, logf) {
+TEST(math_h, logf) {
ASSERT_FLOAT_EQ(1.0f, logf(static_cast<float>(M_E)));
}
-TEST(MATH_TEST, logl) {
+TEST(math_h, logl) {
ASSERT_DOUBLE_EQ(1.0L, logl(M_E));
}
-TEST(MATH_TEST, log2) {
+TEST(math_h, log2) {
ASSERT_DOUBLE_EQ(12.0, log2(4096.0));
}
-TEST(MATH_TEST, log2f) {
+TEST(math_h, log2f) {
ASSERT_FLOAT_EQ(12.0f, log2f(4096.0f));
}
-TEST(MATH_TEST, log2l) {
+TEST(math_h, log2l) {
ASSERT_DOUBLE_EQ(12.0L, log2l(4096.0L));
}
-TEST(MATH_TEST, log10) {
+TEST(math_h, log10) {
ASSERT_DOUBLE_EQ(3.0, log10(1000.0));
}
-TEST(MATH_TEST, log10f) {
+TEST(math_h, log10f) {
ASSERT_FLOAT_EQ(3.0f, log10f(1000.0f));
}
-TEST(MATH_TEST, log10l) {
+TEST(math_h, log10l) {
ASSERT_DOUBLE_EQ(3.0L, log10l(1000.0L));
}
-TEST(MATH_TEST, cbrt) {
+TEST(math_h, cbrt) {
ASSERT_DOUBLE_EQ(3.0, cbrt(27.0));
}
-TEST(MATH_TEST, cbrtf) {
+TEST(math_h, cbrtf) {
ASSERT_FLOAT_EQ(3.0f, cbrtf(27.0f));
}
-TEST(MATH_TEST, cbrtl) {
+TEST(math_h, cbrtl) {
ASSERT_DOUBLE_EQ(3.0L, cbrtl(27.0L));
}
-TEST(MATH_TEST, sqrt) {
+TEST(math_h, sqrt) {
ASSERT_DOUBLE_EQ(2.0, sqrt(4.0));
}
-TEST(MATH_TEST, sqrtf) {
+TEST(math_h, sqrtf) {
ASSERT_FLOAT_EQ(2.0f, sqrtf(4.0f));
}
-TEST(MATH_TEST, sqrtl) {
+TEST(math_h, sqrtl) {
ASSERT_DOUBLE_EQ(2.0L, sqrtl(4.0L));
}
-TEST(MATH_TEST, exp) {
+TEST(math_h, exp) {
ASSERT_DOUBLE_EQ(1.0, exp(0.0));
ASSERT_DOUBLE_EQ(M_E, exp(1.0));
}
-TEST(MATH_TEST, expf) {
+TEST(math_h, expf) {
ASSERT_FLOAT_EQ(1.0f, expf(0.0f));
ASSERT_FLOAT_EQ(static_cast<float>(M_E), expf(1.0f));
}
-TEST(MATH_TEST, expl) {
+TEST(math_h, expl) {
ASSERT_DOUBLE_EQ(1.0L, expl(0.0L));
ASSERT_DOUBLE_EQ(M_E, expl(1.0L));
}
-TEST(MATH_TEST, exp2) {
+TEST(math_h, exp2) {
ASSERT_DOUBLE_EQ(8.0, exp2(3.0));
}
-TEST(MATH_TEST, exp2f) {
+TEST(math_h, exp2f) {
ASSERT_FLOAT_EQ(8.0f, exp2f(3.0f));
}
-TEST(MATH_TEST, exp2l) {
+TEST(math_h, exp2l) {
ASSERT_DOUBLE_EQ(8.0L, exp2l(3.0L));
}
-TEST(MATH_TEST, expm1) {
+TEST(math_h, expm1) {
ASSERT_DOUBLE_EQ(M_E - 1.0, expm1(1.0));
}
-TEST(MATH_TEST, expm1f) {
+TEST(math_h, expm1f) {
ASSERT_FLOAT_EQ(static_cast<float>(M_E) - 1.0f, expm1f(1.0f));
}
-TEST(MATH_TEST, expm1l) {
+TEST(math_h, expm1l) {
ASSERT_DOUBLE_EQ(M_E - 1.0L, expm1l(1.0L));
}
-TEST(MATH_TEST, pow) {
+TEST(math_h, pow) {
ASSERT_TRUE(isnan(pow(nan(""), 3.0)));
ASSERT_DOUBLE_EQ(1.0, (pow(1.0, nan(""))));
ASSERT_TRUE(isnan(pow(2.0, nan(""))));
ASSERT_DOUBLE_EQ(8.0, pow(2.0, 3.0));
}
-TEST(MATH_TEST, powf) {
+TEST(math_h, powf) {
ASSERT_TRUE(isnanf(powf(nanf(""), 3.0f)));
ASSERT_FLOAT_EQ(1.0f, (powf(1.0f, nanf(""))));
ASSERT_TRUE(isnanf(powf(2.0f, nanf(""))));
ASSERT_FLOAT_EQ(8.0f, powf(2.0f, 3.0f));
}
-TEST(MATH_TEST, powl) {
+TEST(math_h, powl) {
ASSERT_TRUE(__isnanl(powl(nanl(""), 3.0L)));
ASSERT_DOUBLE_EQ(1.0L, (powl(1.0L, nanl(""))));
ASSERT_TRUE(__isnanl(powl(2.0L, nanl(""))));
ASSERT_DOUBLE_EQ(8.0L, powl(2.0L, 3.0L));
}
-TEST(MATH_TEST, ceil) {
+TEST(math_h, ceil) {
ASSERT_DOUBLE_EQ(1.0, ceil(0.9));
}
-TEST(MATH_TEST, ceilf) {
+TEST(math_h, ceilf) {
ASSERT_FLOAT_EQ(1.0f, ceilf(0.9f));
}
-TEST(MATH_TEST, ceill) {
+TEST(math_h, ceill) {
ASSERT_DOUBLE_EQ(1.0L, ceill(0.9L));
}
-TEST(MATH_TEST, floor) {
+TEST(math_h, floor) {
ASSERT_DOUBLE_EQ(1.0, floor(1.1));
}
-TEST(MATH_TEST, floorf) {
+TEST(math_h, floorf) {
ASSERT_FLOAT_EQ(1.0f, floorf(1.1f));
}
-TEST(MATH_TEST, floorl) {
+TEST(math_h, floorl) {
ASSERT_DOUBLE_EQ(1.0L, floorl(1.1L));
}
-TEST(MATH_TEST, fabs) {
+TEST(math_h, fabs) {
ASSERT_DOUBLE_EQ(1.0, fabs(-1.0));
}
-TEST(MATH_TEST, fabsf) {
+TEST(math_h, fabsf) {
ASSERT_FLOAT_EQ(1.0f, fabsf(-1.0f));
}
-TEST(MATH_TEST, fabsl) {
+TEST(math_h, fabsl) {
ASSERT_DOUBLE_EQ(1.0L, fabsl(-1.0L));
}
-TEST(MATH_TEST, ldexp) {
+TEST(math_h, ldexp) {
ASSERT_DOUBLE_EQ(16.0, ldexp(2.0, 3.0));
}
-TEST(MATH_TEST, ldexpf) {
+TEST(math_h, ldexpf) {
ASSERT_FLOAT_EQ(16.0f, ldexpf(2.0f, 3.0f));
}
-TEST(MATH_TEST, ldexpl) {
+TEST(math_h, ldexpl) {
ASSERT_DOUBLE_EQ(16.0L, ldexpl(2.0L, 3.0));
}
-TEST(MATH_TEST, fmod) {
+TEST(math_h, fmod) {
ASSERT_DOUBLE_EQ(2.0, fmod(12.0, 10.0));
// If x is an infinity, NaN is returned.
@@ -852,7 +846,7 @@
ASSERT_TRUE(isnan(fmod(3.0, 0.0)));
}
-TEST(MATH_TEST, fmodf) {
+TEST(math_h, fmodf) {
ASSERT_FLOAT_EQ(2.0f, fmodf(12.0f, 10.0f));
// If x is an infinity, NaN is returned.
@@ -867,7 +861,7 @@
ASSERT_TRUE(isnanf(fmodf(3.0f, 0.0f)));
}
-TEST(MATH_TEST, fmodl) {
+TEST(math_h, fmodl) {
ASSERT_DOUBLE_EQ(2.0L, fmodl(12.0L, 10.0L));
// If x is an infinity, NaN is returned.
@@ -882,7 +876,7 @@
ASSERT_TRUE(isnanl(fmodl(3.0L, 0.0L)));
}
-TEST(MATH_TEST, remainder) {
+TEST(math_h, remainder) {
ASSERT_DOUBLE_EQ(2.0, remainder(12.0, 10.0));
// If x or y is a NaN, NaN is returned.
@@ -897,7 +891,7 @@
ASSERT_TRUE(isnan(remainder(12.0, 0.0)));
}
-TEST(MATH_TEST, remainderf) {
+TEST(math_h, remainderf) {
ASSERT_FLOAT_EQ(2.0f, remainderf(12.0f, 10.0f));
// If x or y is a NaN, NaN is returned.
@@ -912,7 +906,7 @@
ASSERT_TRUE(isnanf(remainderf(12.0f, 0.0f)));
}
-TEST(MATH_TEST, remainderl) {
+TEST(math_h, remainderl) {
ASSERT_DOUBLE_EQ(2.0L, remainderl(12.0L, 10.0L));
// If x or y is a NaN, NaN is returned.
@@ -927,63 +921,63 @@
ASSERT_TRUE(isnanl(remainderl(12.0L, 0.0L)));
}
-TEST(MATH_TEST, drem) {
+TEST(math_h, drem) {
ASSERT_DOUBLE_EQ(2.0, drem(12.0, 10.0));
}
-TEST(MATH_TEST, dremf) {
+TEST(math_h, dremf) {
ASSERT_FLOAT_EQ(2.0f, dremf(12.0f, 10.0f));
}
-TEST(MATH_TEST, fmax) {
+TEST(math_h, fmax) {
ASSERT_DOUBLE_EQ(12.0, fmax(12.0, 10.0));
ASSERT_DOUBLE_EQ(12.0, fmax(12.0, nan("")));
ASSERT_DOUBLE_EQ(12.0, fmax(nan(""), 12.0));
}
-TEST(MATH_TEST, fmaxf) {
+TEST(math_h, fmaxf) {
ASSERT_FLOAT_EQ(12.0f, fmaxf(12.0f, 10.0f));
ASSERT_FLOAT_EQ(12.0f, fmaxf(12.0f, nanf("")));
ASSERT_FLOAT_EQ(12.0f, fmaxf(nanf(""), 12.0f));
}
-TEST(MATH_TEST, fmaxl) {
+TEST(math_h, fmaxl) {
ASSERT_DOUBLE_EQ(12.0L, fmaxl(12.0L, 10.0L));
ASSERT_DOUBLE_EQ(12.0L, fmaxl(12.0L, nanl("")));
ASSERT_DOUBLE_EQ(12.0L, fmaxl(nanl(""), 12.0L));
}
-TEST(MATH_TEST, fmin) {
+TEST(math_h, fmin) {
ASSERT_DOUBLE_EQ(10.0, fmin(12.0, 10.0));
ASSERT_DOUBLE_EQ(12.0, fmin(12.0, nan("")));
ASSERT_DOUBLE_EQ(12.0, fmin(nan(""), 12.0));
}
-TEST(MATH_TEST, fminf) {
+TEST(math_h, fminf) {
ASSERT_FLOAT_EQ(10.0f, fminf(12.0f, 10.0f));
ASSERT_FLOAT_EQ(12.0f, fminf(12.0f, nanf("")));
ASSERT_FLOAT_EQ(12.0f, fminf(nanf(""), 12.0f));
}
-TEST(MATH_TEST, fminl) {
+TEST(math_h, fminl) {
ASSERT_DOUBLE_EQ(10.0L, fminl(12.0L, 10.0L));
ASSERT_DOUBLE_EQ(12.0L, fminl(12.0L, nanl("")));
ASSERT_DOUBLE_EQ(12.0L, fminl(nanl(""), 12.0L));
}
-TEST(MATH_TEST, fma) {
+TEST(math_h, fma) {
ASSERT_DOUBLE_EQ(10.0, fma(2.0, 3.0, 4.0));
}
-TEST(MATH_TEST, fmaf) {
+TEST(math_h, fmaf) {
ASSERT_FLOAT_EQ(10.0f, fmaf(2.0f, 3.0f, 4.0f));
}
-TEST(MATH_TEST, fmal) {
+TEST(math_h, fmal) {
ASSERT_DOUBLE_EQ(10.0L, fmal(2.0L, 3.0L, 4.0L));
}
-TEST(MATH_TEST, hypot) {
+TEST(math_h, hypot) {
ASSERT_DOUBLE_EQ(5.0, hypot(3.0, 4.0));
// If x or y is an infinity, returns positive infinity.
@@ -997,7 +991,7 @@
ASSERT_TRUE(isnan(hypot(nan(""), 4.0)));
}
-TEST(MATH_TEST, hypotf) {
+TEST(math_h, hypotf) {
ASSERT_FLOAT_EQ(5.0f, hypotf(3.0f, 4.0f));
// If x or y is an infinity, returns positive infinity.
@@ -1011,7 +1005,7 @@
ASSERT_TRUE(isnanf(hypotf(nanf(""), 4.0f)));
}
-TEST(MATH_TEST, hypotl) {
+TEST(math_h, hypotl) {
ASSERT_DOUBLE_EQ(5.0L, hypotl(3.0L, 4.0L));
// If x or y is an infinity, returns positive infinity.
@@ -1025,31 +1019,31 @@
ASSERT_TRUE(isnanl(hypotl(nanl(""), 4.0L)));
}
-TEST(MATH_TEST, erf) {
+TEST(math_h, erf) {
ASSERT_DOUBLE_EQ(0.84270079294971489, erf(1.0));
}
-TEST(MATH_TEST, erff) {
+TEST(math_h, erff) {
ASSERT_FLOAT_EQ(0.84270078f, erff(1.0f));
}
-TEST(MATH_TEST, erfl) {
+TEST(math_h, erfl) {
ASSERT_DOUBLE_EQ(0.84270079294971489L, erfl(1.0L));
}
-TEST(MATH_TEST, erfc) {
+TEST(math_h, erfc) {
ASSERT_DOUBLE_EQ(0.15729920705028513, erfc(1.0));
}
-TEST(MATH_TEST, erfcf) {
+TEST(math_h, erfcf) {
ASSERT_FLOAT_EQ(0.15729921f, erfcf(1.0f));
}
-TEST(MATH_TEST, erfcl) {
+TEST(math_h, erfcl) {
ASSERT_DOUBLE_EQ(0.15729920705028513L, erfcl(1.0L));
}
-TEST(MATH_TEST, lrint) {
+TEST(math_h, lrint) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_UPWARD); // lrint/lrintf/lrintl obey the rounding mode.
@@ -1071,7 +1065,7 @@
EXPECT_EQ(1234L, llrintl(1234.01L));
}
-TEST(MATH_TEST, rint) {
+TEST(math_h, rint) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_UPWARD); // rint/rintf/rintl obey the rounding mode.
@@ -1099,7 +1093,7 @@
ASSERT_EQ(1234.0, rintl(1234.01L));
}
-TEST(MATH_TEST, nearbyint) {
+TEST(math_h, nearbyint) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_UPWARD); // nearbyint/nearbyintf/nearbyintl obey the rounding mode.
feclearexcept(FE_ALL_EXCEPT); // nearbyint/nearbyintf/nearbyintl don't set the FE_INEXACT flag.
@@ -1126,7 +1120,7 @@
ASSERT_EQ(1234.0, nearbyintl(1234.01L));
}
-TEST(MATH_TEST, lround) {
+TEST(math_h, lround) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_UPWARD); // lround ignores the rounding mode.
ASSERT_EQ(1234, lround(1234.01));
@@ -1134,7 +1128,7 @@
ASSERT_EQ(1234, lroundl(1234.01L));
}
-TEST(MATH_TEST, llround) {
+TEST(math_h, llround) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_UPWARD); // llround ignores the rounding mode.
ASSERT_EQ(1234L, llround(1234.01));
@@ -1142,7 +1136,7 @@
ASSERT_EQ(1234L, llroundl(1234.01L));
}
-TEST(MATH_TEST, ilogb) {
+TEST(math_h, ilogb) {
ASSERT_EQ(FP_ILOGB0, ilogb(0.0));
ASSERT_EQ(FP_ILOGBNAN, ilogb(nan("")));
ASSERT_EQ(INT_MAX, ilogb(HUGE_VAL));
@@ -1151,7 +1145,7 @@
ASSERT_EQ(3, ilogb(10.0));
}
-TEST(MATH_TEST, ilogbf) {
+TEST(math_h, ilogbf) {
ASSERT_EQ(FP_ILOGB0, ilogbf(0.0f));
ASSERT_EQ(FP_ILOGBNAN, ilogbf(nanf("")));
ASSERT_EQ(INT_MAX, ilogbf(HUGE_VALF));
@@ -1160,7 +1154,7 @@
ASSERT_EQ(3, ilogbf(10.0f));
}
-TEST(MATH_TEST, ilogbl) {
+TEST(math_h, ilogbl) {
ASSERT_EQ(FP_ILOGB0, ilogbl(0.0L));
ASSERT_EQ(FP_ILOGBNAN, ilogbl(nanl("")));
ASSERT_EQ(INT_MAX, ilogbl(HUGE_VALL));
@@ -1169,7 +1163,7 @@
ASSERT_EQ(3L, ilogbl(10.0L));
}
-TEST(MATH_TEST, logb) {
+TEST(math_h, logb) {
ASSERT_EQ(-HUGE_VAL, logb(0.0));
ASSERT_TRUE(isnan(logb(nan(""))));
ASSERT_TRUE(isinf(logb(HUGE_VAL)));
@@ -1178,7 +1172,7 @@
ASSERT_EQ(3.0, logb(10.0));
}
-TEST(MATH_TEST, logbf) {
+TEST(math_h, logbf) {
ASSERT_EQ(-HUGE_VALF, logbf(0.0f));
ASSERT_TRUE(isnanf(logbf(nanf(""))));
ASSERT_TRUE(isinff(logbf(HUGE_VALF)));
@@ -1187,7 +1181,7 @@
ASSERT_EQ(3.0f, logbf(10.0f));
}
-TEST(MATH_TEST, logbl) {
+TEST(math_h, logbl) {
ASSERT_EQ(-HUGE_VAL, logbl(0.0L));
ASSERT_TRUE(isnan(logbl(nanl(""))));
ASSERT_TRUE(isinf(logbl(HUGE_VALL)));
@@ -1196,7 +1190,7 @@
ASSERT_EQ(3.0L, logbl(10.0L));
}
-TEST(MATH_TEST, log1p) {
+TEST(math_h, log1p) {
ASSERT_EQ(-HUGE_VAL, log1p(-1.0));
ASSERT_TRUE(isnan(log1p(nan(""))));
ASSERT_TRUE(isinf(log1p(HUGE_VAL)));
@@ -1204,7 +1198,7 @@
ASSERT_DOUBLE_EQ(1.0, log1p(M_E - 1.0));
}
-TEST(MATH_TEST, log1pf) {
+TEST(math_h, log1pf) {
ASSERT_EQ(-HUGE_VALF, log1pf(-1.0f));
ASSERT_TRUE(isnanf(log1pf(nanf(""))));
ASSERT_TRUE(isinff(log1pf(HUGE_VALF)));
@@ -1212,7 +1206,7 @@
ASSERT_FLOAT_EQ(1.0f, log1pf(static_cast<float>(M_E) - 1.0f));
}
-TEST(MATH_TEST, log1pl) {
+TEST(math_h, log1pl) {
ASSERT_EQ(-HUGE_VALL, log1pl(-1.0L));
ASSERT_TRUE(isnanl(log1pl(nanl(""))));
ASSERT_TRUE(isinfl(log1pl(HUGE_VALL)));
@@ -1220,25 +1214,25 @@
ASSERT_DOUBLE_EQ(1.0L, log1pl(M_E - 1.0L));
}
-TEST(MATH_TEST, fdim) {
+TEST(math_h, fdim) {
ASSERT_DOUBLE_EQ(0.0, fdim(1.0, 1.0));
ASSERT_DOUBLE_EQ(1.0, fdim(2.0, 1.0));
ASSERT_DOUBLE_EQ(0.0, fdim(1.0, 2.0));
}
-TEST(MATH_TEST, fdimf) {
+TEST(math_h, fdimf) {
ASSERT_FLOAT_EQ(0.0f, fdimf(1.0f, 1.0f));
ASSERT_FLOAT_EQ(1.0f, fdimf(2.0f, 1.0f));
ASSERT_FLOAT_EQ(0.0f, fdimf(1.0f, 2.0f));
}
-TEST(MATH_TEST, fdiml) {
+TEST(math_h, fdiml) {
ASSERT_DOUBLE_EQ(0.0L, fdiml(1.0L, 1.0L));
ASSERT_DOUBLE_EQ(1.0L, fdiml(2.0L, 1.0L));
ASSERT_DOUBLE_EQ(0.0L, fdiml(1.0L, 2.0L));
}
-TEST(MATH_TEST, round) {
+TEST(math_h, round) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_TOWARDZERO); // round ignores the rounding mode and always rounds away from zero.
ASSERT_DOUBLE_EQ(1.0, round(0.5));
@@ -1250,7 +1244,7 @@
ASSERT_DOUBLE_EQ(-HUGE_VAL, round(-HUGE_VAL));
}
-TEST(MATH_TEST, roundf) {
+TEST(math_h, roundf) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_TOWARDZERO); // roundf ignores the rounding mode and always rounds away from zero.
ASSERT_FLOAT_EQ(1.0f, roundf(0.5f));
@@ -1262,7 +1256,7 @@
ASSERT_FLOAT_EQ(-HUGE_VALF, roundf(-HUGE_VALF));
}
-TEST(MATH_TEST, roundl) {
+TEST(math_h, roundl) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_TOWARDZERO); // roundl ignores the rounding mode and always rounds away from zero.
ASSERT_DOUBLE_EQ(1.0L, roundl(0.5L));
@@ -1274,7 +1268,7 @@
ASSERT_DOUBLE_EQ(-HUGE_VALL, roundl(-HUGE_VALL));
}
-TEST(MATH_TEST, trunc) {
+TEST(math_h, trunc) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_UPWARD); // trunc ignores the rounding mode and always rounds toward zero.
ASSERT_DOUBLE_EQ(1.0, trunc(1.5));
@@ -1286,7 +1280,7 @@
ASSERT_DOUBLE_EQ(-HUGE_VAL, trunc(-HUGE_VAL));
}
-TEST(MATH_TEST, truncf) {
+TEST(math_h, truncf) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_UPWARD); // truncf ignores the rounding mode and always rounds toward zero.
ASSERT_FLOAT_EQ(1.0f, truncf(1.5f));
@@ -1298,7 +1292,7 @@
ASSERT_FLOAT_EQ(-HUGE_VALF, truncf(-HUGE_VALF));
}
-TEST(MATH_TEST, truncl) {
+TEST(math_h, truncl) {
auto guard = android::base::make_scope_guard([]() { fesetenv(FE_DFL_ENV); });
fesetround(FE_UPWARD); // truncl ignores the rounding mode and always rounds toward zero.
ASSERT_DOUBLE_EQ(1.0L, truncl(1.5L));
@@ -1310,19 +1304,19 @@
ASSERT_DOUBLE_EQ(-HUGE_VALL, truncl(-HUGE_VALL));
}
-TEST(MATH_TEST, nextafter) {
+TEST(math_h, 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(-4.9406564584124654e-324, nextafter(0.0, -1.0));
}
-TEST(MATH_TEST, nextafterf) {
+TEST(math_h, 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(-1.4012985e-45f, nextafterf(0.0f, -1.0f));
}
-TEST(MATH_TEST, nextafterl) {
+TEST(math_h, nextafterl) {
ASSERT_DOUBLE_EQ(0.0L, nextafterl(0.0L, 0.0L));
// Use a runtime value to accomodate the case when
// sizeof(double) == sizeof(long double)
@@ -1331,19 +1325,19 @@
ASSERT_DOUBLE_EQ(-smallest_positive, nextafterl(0.0L, -1.0L));
}
-TEST(MATH_TEST, nexttoward) {
+TEST(math_h, 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(-4.9406564584124654e-324, nexttoward(0.0, -1.0L));
}
-TEST(MATH_TEST, nexttowardf) {
+TEST(math_h, 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(-1.4012985e-45f, nexttowardf(0.0f, -1.0L));
}
-TEST(MATH_TEST, nexttowardl) {
+TEST(math_h, nexttowardl) {
ASSERT_DOUBLE_EQ(0.0L, nexttowardl(0.0L, 0.0L));
// Use a runtime value to accomodate the case when
// sizeof(double) == sizeof(long double)
@@ -1352,40 +1346,40 @@
ASSERT_DOUBLE_EQ(-smallest_positive, nexttowardl(0.0L, -1.0L));
}
-TEST(MATH_TEST, copysign) {
+TEST(math_h, copysign) {
ASSERT_DOUBLE_EQ(0.0, copysign(0.0, 1.0));
ASSERT_DOUBLE_EQ(-0.0, copysign(0.0, -1.0));
ASSERT_DOUBLE_EQ(2.0, copysign(2.0, 1.0));
ASSERT_DOUBLE_EQ(-2.0, copysign(2.0, -1.0));
}
-TEST(MATH_TEST, copysignf) {
+TEST(math_h, copysignf) {
ASSERT_FLOAT_EQ(0.0f, copysignf(0.0f, 1.0f));
ASSERT_FLOAT_EQ(-0.0f, copysignf(0.0f, -1.0f));
ASSERT_FLOAT_EQ(2.0f, copysignf(2.0f, 1.0f));
ASSERT_FLOAT_EQ(-2.0f, copysignf(2.0f, -1.0f));
}
-TEST(MATH_TEST, copysignl) {
+TEST(math_h, copysignl) {
ASSERT_DOUBLE_EQ(0.0L, copysignl(0.0L, 1.0L));
ASSERT_DOUBLE_EQ(-0.0L, copysignl(0.0L, -1.0L));
ASSERT_DOUBLE_EQ(2.0L, copysignl(2.0L, 1.0L));
ASSERT_DOUBLE_EQ(-2.0L, copysignl(2.0L, -1.0L));
}
-TEST(MATH_TEST, significand) {
+TEST(math_h, significand) {
ASSERT_DOUBLE_EQ(0.0, significand(0.0));
ASSERT_DOUBLE_EQ(1.2, significand(1.2));
ASSERT_DOUBLE_EQ(1.53125, significand(12.25));
}
-TEST(MATH_TEST, significandf) {
+TEST(math_h, significandf) {
ASSERT_FLOAT_EQ(0.0f, significandf(0.0f));
ASSERT_FLOAT_EQ(1.2f, significandf(1.2f));
ASSERT_FLOAT_EQ(1.53125f, significandf(12.25f));
}
-TEST(MATH_TEST, significandl) {
+TEST(math_h, significandl) {
#if !defined(ANDROID_HOST_MUSL)
ASSERT_DOUBLE_EQ(0.0L, significandl(0.0L));
ASSERT_DOUBLE_EQ(1.2L, significandl(1.2L));
@@ -1395,40 +1389,39 @@
#endif
}
-
-TEST(MATH_TEST, scalb) {
+TEST(math_h, scalb) {
ASSERT_DOUBLE_EQ(12.0, scalb(3.0, 2.0));
}
-TEST(MATH_TEST, scalbf) {
+TEST(math_h, scalbf) {
ASSERT_FLOAT_EQ(12.0f, scalbf(3.0f, 2.0f));
}
-TEST(MATH_TEST, scalbln) {
+TEST(math_h, scalbln) {
ASSERT_DOUBLE_EQ(12.0, scalbln(3.0, 2L));
}
-TEST(MATH_TEST, scalblnf) {
+TEST(math_h, scalblnf) {
ASSERT_FLOAT_EQ(12.0f, scalblnf(3.0f, 2L));
}
-TEST(MATH_TEST, scalblnl) {
+TEST(math_h, scalblnl) {
ASSERT_DOUBLE_EQ(12.0L, scalblnl(3.0L, 2L));
}
-TEST(MATH_TEST, scalbn) {
+TEST(math_h, scalbn) {
ASSERT_DOUBLE_EQ(12.0, scalbn(3.0, 2));
}
-TEST(MATH_TEST, scalbnf) {
+TEST(math_h, scalbnf) {
ASSERT_FLOAT_EQ(12.0f, scalbnf(3.0f, 2));
}
-TEST(MATH_TEST, scalbnl) {
+TEST(math_h, scalbnl) {
ASSERT_DOUBLE_EQ(12.0L, scalbnl(3.0L, 2));
}
-TEST(MATH_TEST, gamma) {
+TEST(math_h, gamma) {
#if !defined(ANDROID_HOST_MUSL)
ASSERT_DOUBLE_EQ(log(24.0), gamma(5.0));
#else
@@ -1436,7 +1429,7 @@
#endif
}
-TEST(MATH_TEST, gammaf) {
+TEST(math_h, gammaf) {
#if !defined(ANDROID_HOST_MUSL)
ASSERT_FLOAT_EQ(logf(24.0f), gammaf(5.0f));
#else
@@ -1444,7 +1437,7 @@
#endif
}
-TEST(MATH_TEST, gamma_r) {
+TEST(math_h, gamma_r) {
#if defined(__BIONIC__)
int sign;
ASSERT_DOUBLE_EQ(log(24.0), gamma_r(5.0, &sign));
@@ -1454,7 +1447,7 @@
#endif // __BIONIC__
}
-TEST(MATH_TEST, gammaf_r) {
+TEST(math_h, gammaf_r) {
#if defined(__BIONIC__)
int sign;
ASSERT_FLOAT_EQ(logf(24.0f), gammaf_r(5.0f, &sign));
@@ -1464,25 +1457,25 @@
#endif // __BIONIC__
}
-TEST(MATH_TEST, lgamma) {
+TEST(math_h, lgamma) {
ASSERT_DOUBLE_EQ(log(24.0), lgamma(5.0));
}
-TEST(MATH_TEST, lgammaf) {
+TEST(math_h, lgammaf) {
ASSERT_FLOAT_EQ(logf(24.0f), lgammaf(5.0f));
}
-TEST(MATH_TEST, lgammal) {
+TEST(math_h, lgammal) {
ASSERT_DOUBLE_EQ(logl(24.0L), lgammal(5.0L));
}
-TEST(MATH_TEST, lgamma_r) {
+TEST(math_h, lgamma_r) {
int sign;
ASSERT_DOUBLE_EQ(log(24.0), lgamma_r(5.0, &sign));
ASSERT_EQ(1, sign);
}
-TEST(MATH_TEST, lgamma_r_17471883) {
+TEST(math_h, lgamma_r_17471883) {
int sign;
sign = 0;
@@ -1493,13 +1486,13 @@
ASSERT_EQ(-1, sign);
}
-TEST(MATH_TEST, lgammaf_r) {
+TEST(math_h, lgammaf_r) {
int sign;
ASSERT_FLOAT_EQ(logf(24.0f), lgammaf_r(5.0f, &sign));
ASSERT_EQ(1, sign);
}
-TEST(MATH_TEST, lgammaf_r_17471883) {
+TEST(math_h, lgammaf_r_17471883) {
int sign;
sign = 0;
@@ -1510,13 +1503,13 @@
ASSERT_EQ(-1, sign);
}
-TEST(MATH_TEST, lgammal_r) {
+TEST(math_h, lgammal_r) {
int sign;
ASSERT_DOUBLE_EQ(log(24.0L), lgamma_r(5.0L, &sign));
ASSERT_EQ(1, sign);
}
-TEST(MATH_TEST, lgammal_r_17471883) {
+TEST(math_h, lgammal_r_17471883) {
int sign;
sign = 0;
@@ -1527,142 +1520,142 @@
ASSERT_EQ(-1, sign);
}
-TEST(MATH_TEST, tgamma_NaN) {
+TEST(math_h, tgamma_NaN) {
ASSERT_TRUE(isnan(tgamma(nan(""))));
ASSERT_TRUE(isnanf(tgammaf(nanf(""))));
ASSERT_TRUE(isnanl(tgammal(nanl(""))));
}
-TEST(MATH_TEST, tgamma_inf) {
+TEST(math_h, tgamma_inf) {
ASSERT_TRUE(isinf(tgamma(HUGE_VAL)));
ASSERT_TRUE(isinff(tgammaf(HUGE_VALF)));
ASSERT_TRUE(isinfl(tgammal(HUGE_VALL)));
}
-TEST(MATH_TEST, tgamma_negative) {
+TEST(math_h, tgamma_negative) {
ASSERT_TRUE(isnan(tgamma(-1.0)));
ASSERT_TRUE(isnanf(tgammaf(-1.0f)));
ASSERT_TRUE(isnanl(tgammal(-1.0L)));
}
-TEST(MATH_TEST, tgamma) {
+TEST(math_h, tgamma) {
ASSERT_DOUBLE_EQ(24.0, tgamma(5.0));
ASSERT_DOUBLE_EQ(120.0, tgamma(6.0));
ASSERT_TRUE(isinf(tgamma(172.0)));
}
-TEST(MATH_TEST, tgammaf) {
+TEST(math_h, tgammaf) {
ASSERT_FLOAT_EQ(24.0f, tgammaf(5.0f));
ASSERT_FLOAT_EQ(120.0f, tgammaf(6.0f));
ASSERT_TRUE(isinff(tgammaf(172.0f)));
}
-TEST(MATH_TEST, tgammal) {
+TEST(math_h, tgammal) {
ASSERT_DOUBLE_EQ(24.0L, tgammal(5.0L));
ASSERT_DOUBLE_EQ(120.0L, tgammal(6.0L));
ASSERT_TRUE(isinf(tgammal(172.0L)));
}
-TEST(MATH_TEST, j0) {
+TEST(math_h, j0) {
ASSERT_DOUBLE_EQ(1.0, j0(0.0));
ASSERT_DOUBLE_EQ(0.76519768655796661, j0(1.0));
}
-TEST(MATH_TEST, j0f) {
+TEST(math_h, j0f) {
ASSERT_FLOAT_EQ(1.0f, j0f(0.0f));
ASSERT_FLOAT_EQ(0.76519769f, j0f(1.0f));
}
-TEST(MATH_TEST, j1) {
+TEST(math_h, j1) {
ASSERT_DOUBLE_EQ(0.0, j1(0.0));
ASSERT_DOUBLE_EQ(0.44005058574493355, j1(1.0));
}
-TEST(MATH_TEST, j1f) {
+TEST(math_h, j1f) {
ASSERT_FLOAT_EQ(0.0f, j1f(0.0f));
ASSERT_FLOAT_EQ(0.44005057f, j1f(1.0f));
}
-TEST(MATH_TEST, jn) {
+TEST(math_h, jn) {
ASSERT_DOUBLE_EQ(0.0, jn(4, 0.0));
ASSERT_DOUBLE_EQ(0.0024766389641099553, jn(4, 1.0));
}
-TEST(MATH_TEST, jnf) {
+TEST(math_h, jnf) {
ASSERT_FLOAT_EQ(0.0f, jnf(4, 0.0f));
ASSERT_FLOAT_EQ(0.0024766389f, jnf(4, 1.0f));
}
-TEST(MATH_TEST, y0) {
+TEST(math_h, y0) {
ASSERT_DOUBLE_EQ(-HUGE_VAL, y0(0.0));
ASSERT_DOUBLE_EQ(0.08825696421567697, y0(1.0));
}
-TEST(MATH_TEST, y0f) {
+TEST(math_h, y0f) {
ASSERT_FLOAT_EQ(-HUGE_VALF, y0f(0.0f));
ASSERT_FLOAT_EQ(0.088256963f, y0f(1.0f));
}
-TEST(MATH_TEST, y1) {
+TEST(math_h, y1) {
ASSERT_DOUBLE_EQ(-HUGE_VAL, y1(0.0));
ASSERT_DOUBLE_EQ(-0.78121282130028868, y1(1.0));
}
-TEST(MATH_TEST, y1f) {
+TEST(math_h, y1f) {
ASSERT_FLOAT_EQ(-HUGE_VALF, y1f(0.0f));
ASSERT_FLOAT_EQ(-0.78121281f, y1f(1.0f));
}
-TEST(MATH_TEST, yn) {
+TEST(math_h, yn) {
ASSERT_DOUBLE_EQ(-HUGE_VAL, yn(4, 0.0));
ASSERT_DOUBLE_EQ(-33.278423028972114, yn(4, 1.0));
}
-TEST(MATH_TEST, ynf) {
+TEST(math_h, ynf) {
ASSERT_FLOAT_EQ(-HUGE_VALF, ynf(4, 0.0f));
ASSERT_FLOAT_EQ(-33.278423f, ynf(4, 1.0f));
}
-TEST(MATH_TEST, frexp) {
+TEST(math_h, frexp) {
int exp;
double dr = frexp(1024.0, &exp);
ASSERT_DOUBLE_EQ(1024.0, scalbn(dr, exp));
}
-TEST(MATH_TEST, frexpf) {
+TEST(math_h, frexpf) {
int exp;
float fr = frexpf(1024.0f, &exp);
ASSERT_FLOAT_EQ(1024.0f, scalbnf(fr, exp));
}
-TEST(MATH_TEST, frexpl) {
+TEST(math_h, frexpl) {
int exp;
long double ldr = frexpl(1024.0L, &exp);
ASSERT_DOUBLE_EQ(1024.0L, scalbnl(ldr, exp));
}
-TEST(MATH_TEST, modf) {
+TEST(math_h, modf) {
double di;
double df = modf(123.75, &di);
ASSERT_DOUBLE_EQ(123.0, di);
ASSERT_DOUBLE_EQ(0.75, df);
}
-TEST(MATH_TEST, modff) {
+TEST(math_h, modff) {
float fi;
float ff = modff(123.75f, &fi);
ASSERT_FLOAT_EQ(123.0f, fi);
ASSERT_FLOAT_EQ(0.75f, ff);
}
-TEST(MATH_TEST, modfl) {
+TEST(math_h, modfl) {
long double ldi;
long double ldf = modfl(123.75L, &ldi);
ASSERT_DOUBLE_EQ(123.0L, ldi);
ASSERT_DOUBLE_EQ(0.75L, ldf);
}
-TEST(MATH_TEST, remquo) {
+TEST(math_h, remquo) {
int q;
double d = remquo(13.0, 4.0, &q);
ASSERT_EQ(3, q);
@@ -1680,7 +1673,7 @@
ASSERT_TRUE(isnan(remquo(12.0, 0.0, &q)));
}
-TEST(MATH_TEST, remquof) {
+TEST(math_h, remquof) {
int q;
float f = remquof(13.0f, 4.0f, &q);
ASSERT_EQ(3, q);
@@ -1698,7 +1691,7 @@
ASSERT_TRUE(isnanf(remquof(12.0f, 0.0f, &q)));
}
-TEST(MATH_TEST, remquol) {
+TEST(math_h, remquol) {
int q;
long double ld = remquol(13.0L, 4.0L, &q);
ASSERT_DOUBLE_EQ(3L, q);
@@ -1717,13 +1710,13 @@
}
// https://code.google.com/p/android/issues/detail?id=6697
-TEST(MATH_TEST, frexpf_public_bug_6697) {
+TEST(math_h, frexpf_public_bug_6697) {
int exp;
float fr = frexpf(14.1f, &exp);
ASSERT_FLOAT_EQ(14.1f, scalbnf(fr, exp));
}
-TEST(MATH_TEST, exp2_STRICT_ALIGN_OpenBSD_bug) {
+TEST(math_h, exp2_STRICT_ALIGN_OpenBSD_bug) {
// OpenBSD/x86's libm had a bug here, but it was already fixed in FreeBSD:
// http://svnweb.FreeBSD.org/base/head/lib/msun/src/math_private.h?revision=240827&view=markup
ASSERT_DOUBLE_EQ(5.0, exp2(log2(5)));
@@ -1731,7 +1724,7 @@
ASSERT_DOUBLE_EQ(5.0L, exp2l(log2l(5)));
}
-TEST(MATH_TEST, nextafterl_OpenBSD_bug) {
+TEST(math_h, nextafterl_OpenBSD_bug) {
// OpenBSD/x86's libm had a bug here.
ASSERT_TRUE(nextafter(1.0, 0.0) - 1.0 < 0.0);
ASSERT_TRUE(nextafterf(1.0f, 0.0f) - 1.0f < 0.0f);
@@ -1739,511 +1732,511 @@
}
#include "math_data/acos_intel_data.h"
-TEST(MATH_TEST, acos_intel) {
+TEST(math_h, acos_intel) {
DoMathDataTest<1>(g_acos_intel_data, acos);
}
#include "math_data/acosf_intel_data.h"
-TEST(MATH_TEST, acosf_intel) {
+TEST(math_h, acosf_intel) {
DoMathDataTest<1>(g_acosf_intel_data, acosf);
}
#include "math_data/acosh_intel_data.h"
-TEST(MATH_TEST, acosh_intel) {
+TEST(math_h, acosh_intel) {
DoMathDataTest<2>(g_acosh_intel_data, acosh);
}
#include "math_data/acoshf_intel_data.h"
-TEST(MATH_TEST, acoshf_intel) {
+TEST(math_h, acoshf_intel) {
DoMathDataTest<2>(g_acoshf_intel_data, acoshf);
}
#include "math_data/asin_intel_data.h"
-TEST(MATH_TEST, asin_intel) {
+TEST(math_h, asin_intel) {
DoMathDataTest<1>(g_asin_intel_data, asin);
}
#include "math_data/asinf_intel_data.h"
-TEST(MATH_TEST, asinf_intel) {
+TEST(math_h, asinf_intel) {
DoMathDataTest<1>(g_asinf_intel_data, asinf);
}
#include "math_data/asinh_intel_data.h"
-TEST(MATH_TEST, asinh_intel) {
+TEST(math_h, asinh_intel) {
DoMathDataTest<2>(g_asinh_intel_data, asinh);
}
#include "math_data/asinhf_intel_data.h"
-TEST(MATH_TEST, asinhf_intel) {
+TEST(math_h, asinhf_intel) {
DoMathDataTest<2>(g_asinhf_intel_data, asinhf);
}
#include "math_data/atan2_intel_data.h"
-TEST(MATH_TEST, atan2_intel) {
+TEST(math_h, atan2_intel) {
DoMathDataTest<2>(g_atan2_intel_data, atan2);
}
#include "math_data/atan2f_intel_data.h"
-TEST(MATH_TEST, atan2f_intel) {
+TEST(math_h, atan2f_intel) {
DoMathDataTest<2>(g_atan2f_intel_data, atan2f);
}
#include "math_data/atan_intel_data.h"
-TEST(MATH_TEST, atan_intel) {
+TEST(math_h, atan_intel) {
DoMathDataTest<1>(g_atan_intel_data, atan);
}
#include "math_data/atanf_intel_data.h"
-TEST(MATH_TEST, atanf_intel) {
+TEST(math_h, atanf_intel) {
DoMathDataTest<1>(g_atanf_intel_data, atanf);
}
#include "math_data/atanh_intel_data.h"
-TEST(MATH_TEST, atanh_intel) {
+TEST(math_h, atanh_intel) {
DoMathDataTest<2>(g_atanh_intel_data, atanh);
}
#include "math_data/atanhf_intel_data.h"
-TEST(MATH_TEST, atanhf_intel) {
+TEST(math_h, atanhf_intel) {
DoMathDataTest<2>(g_atanhf_intel_data, atanhf);
}
#include "math_data/cbrt_intel_data.h"
-TEST(MATH_TEST, cbrt_intel) {
+TEST(math_h, cbrt_intel) {
DoMathDataTest<1>(g_cbrt_intel_data, cbrt);
}
#include "math_data/cbrtf_intel_data.h"
-TEST(MATH_TEST, cbrtf_intel) {
+TEST(math_h, cbrtf_intel) {
DoMathDataTest<1>(g_cbrtf_intel_data, cbrtf);
}
#include "math_data/ceil_intel_data.h"
-TEST(MATH_TEST, ceil_intel) {
+TEST(math_h, ceil_intel) {
DoMathDataTest<1>(g_ceil_intel_data, ceil);
}
#include "math_data/ceilf_intel_data.h"
-TEST(MATH_TEST, ceilf_intel) {
+TEST(math_h, ceilf_intel) {
DoMathDataTest<1>(g_ceilf_intel_data, ceilf);
}
#include "math_data/copysign_intel_data.h"
-TEST(MATH_TEST, copysign_intel) {
+TEST(math_h, copysign_intel) {
DoMathDataTest<1>(g_copysign_intel_data, copysign);
}
#include "math_data/copysignf_intel_data.h"
-TEST(MATH_TEST, copysignf_intel) {
+TEST(math_h, copysignf_intel) {
DoMathDataTest<1>(g_copysignf_intel_data, copysignf);
}
#include "math_data/cos_intel_data.h"
-TEST(MATH_TEST, cos_intel) {
+TEST(math_h, cos_intel) {
DoMathDataTest<1>(g_cos_intel_data, cos);
}
#include "math_data/cosf_intel_data.h"
-TEST(MATH_TEST, cosf_intel) {
+TEST(math_h, cosf_intel) {
DoMathDataTest<1>(g_cosf_intel_data, cosf);
}
#include "math_data/cosh_intel_data.h"
-TEST(MATH_TEST, cosh_intel) {
+TEST(math_h, cosh_intel) {
DoMathDataTest<2>(g_cosh_intel_data, cosh);
}
#include "math_data/coshf_intel_data.h"
-TEST(MATH_TEST, coshf_intel) {
+TEST(math_h, coshf_intel) {
DoMathDataTest<2>(g_coshf_intel_data, coshf);
}
#include "math_data/exp_intel_data.h"
-TEST(MATH_TEST, exp_intel) {
+TEST(math_h, exp_intel) {
DoMathDataTest<1>(g_exp_intel_data, exp);
}
#include "math_data/expf_intel_data.h"
-TEST(MATH_TEST, expf_intel) {
+TEST(math_h, expf_intel) {
DoMathDataTest<1>(g_expf_intel_data, expf);
}
#include "math_data/exp2_intel_data.h"
-TEST(MATH_TEST, exp2_intel) {
+TEST(math_h, exp2_intel) {
DoMathDataTest<1>(g_exp2_intel_data, exp2);
}
#include "math_data/exp2f_intel_data.h"
-TEST(MATH_TEST, exp2f_intel) {
+TEST(math_h, exp2f_intel) {
DoMathDataTest<1>(g_exp2f_intel_data, exp2f);
}
#include "math_data/expm1_intel_data.h"
-TEST(MATH_TEST, expm1_intel) {
+TEST(math_h, expm1_intel) {
DoMathDataTest<1>(g_expm1_intel_data, expm1);
}
#include "math_data/expm1f_intel_data.h"
-TEST(MATH_TEST, expm1f_intel) {
+TEST(math_h, expm1f_intel) {
DoMathDataTest<1>(g_expm1f_intel_data, expm1f);
}
#include "math_data/fabs_intel_data.h"
-TEST(MATH_TEST, fabs_intel) {
+TEST(math_h, fabs_intel) {
DoMathDataTest<1>(g_fabs_intel_data, fabs);
}
#include "math_data/fabsf_intel_data.h"
-TEST(MATH_TEST, fabsf_intel) {
+TEST(math_h, fabsf_intel) {
DoMathDataTest<1>(g_fabsf_intel_data, fabsf);
}
#include "math_data/fdim_intel_data.h"
-TEST(MATH_TEST, fdim_intel) {
+TEST(math_h, fdim_intel) {
DoMathDataTest<1>(g_fdim_intel_data, fdim);
}
#include "math_data/fdimf_intel_data.h"
-TEST(MATH_TEST, fdimf_intel) {
+TEST(math_h, fdimf_intel) {
DoMathDataTest<1>(g_fdimf_intel_data, fdimf);
}
#include "math_data/floor_intel_data.h"
-TEST(MATH_TEST, floor_intel) {
+TEST(math_h, floor_intel) {
DoMathDataTest<1>(g_floor_intel_data, floor);
}
#include "math_data/floorf_intel_data.h"
-TEST(MATH_TEST, floorf_intel) {
+TEST(math_h, floorf_intel) {
DoMathDataTest<1>(g_floorf_intel_data, floorf);
}
#include "math_data/fma_intel_data.h"
-TEST(MATH_TEST, fma_intel) {
+TEST(math_h, fma_intel) {
DoMathDataTest<1>(g_fma_intel_data, fma);
}
#include "math_data/fmaf_intel_data.h"
-TEST(MATH_TEST, fmaf_intel) {
+TEST(math_h, fmaf_intel) {
DoMathDataTest<1>(g_fmaf_intel_data, fmaf);
}
#include "math_data/fmax_intel_data.h"
-TEST(MATH_TEST, fmax_intel) {
+TEST(math_h, fmax_intel) {
DoMathDataTest<1>(g_fmax_intel_data, fmax);
}
#include "math_data/fmaxf_intel_data.h"
-TEST(MATH_TEST, fmaxf_intel) {
+TEST(math_h, fmaxf_intel) {
DoMathDataTest<1>(g_fmaxf_intel_data, fmaxf);
}
#include "math_data/fmin_intel_data.h"
-TEST(MATH_TEST, fmin_intel) {
+TEST(math_h, fmin_intel) {
DoMathDataTest<1>(g_fmin_intel_data, fmin);
}
#include "math_data/fminf_intel_data.h"
-TEST(MATH_TEST, fminf_intel) {
+TEST(math_h, fminf_intel) {
DoMathDataTest<1>(g_fminf_intel_data, fminf);
}
#include "math_data/fmod_intel_data.h"
-TEST(MATH_TEST, fmod_intel) {
+TEST(math_h, fmod_intel) {
DoMathDataTest<1>(g_fmod_intel_data, fmod);
}
#include "math_data/fmodf_intel_data.h"
-TEST(MATH_TEST, fmodf_intel) {
+TEST(math_h, fmodf_intel) {
DoMathDataTest<1>(g_fmodf_intel_data, fmodf);
}
#include "math_data/frexp_intel_data.h"
-TEST(MATH_TEST, frexp_intel) {
+TEST(math_h, frexp_intel) {
DoMathDataTest<1>(g_frexp_intel_data, frexp);
}
#include "math_data/frexpf_intel_data.h"
-TEST(MATH_TEST, frexpf_intel) {
+TEST(math_h, frexpf_intel) {
DoMathDataTest<1>(g_frexpf_intel_data, frexpf);
}
#include "math_data/hypot_intel_data.h"
-TEST(MATH_TEST, hypot_intel) {
+TEST(math_h, hypot_intel) {
DoMathDataTest<1>(g_hypot_intel_data, hypot);
}
#include "math_data/hypotf_intel_data.h"
-TEST(MATH_TEST, hypotf_intel) {
+TEST(math_h, hypotf_intel) {
DoMathDataTest<1>(g_hypotf_intel_data, hypotf);
}
#include "math_data/ilogb_intel_data.h"
-TEST(MATH_TEST, ilogb_intel) {
+TEST(math_h, ilogb_intel) {
DoMathDataTest<1>(g_ilogb_intel_data, ilogb);
}
#include "math_data/ilogbf_intel_data.h"
-TEST(MATH_TEST, ilogbf_intel) {
+TEST(math_h, ilogbf_intel) {
DoMathDataTest<1>(g_ilogbf_intel_data, ilogbf);
}
#include "math_data/ldexp_intel_data.h"
-TEST(MATH_TEST, ldexp_intel) {
+TEST(math_h, ldexp_intel) {
DoMathDataTest<1>(g_ldexp_intel_data, ldexp);
}
#include "math_data/ldexpf_intel_data.h"
-TEST(MATH_TEST, ldexpf_intel) {
+TEST(math_h, ldexpf_intel) {
DoMathDataTest<1>(g_ldexpf_intel_data, ldexpf);
}
#include "math_data/llrint_intel_data.h"
-TEST(MATH_TEST, llrint_intel) {
+TEST(math_h, llrint_intel) {
DoMathDataTest<1>(g_llrint_intel_data, llrint);
}
#include "math_data/llrintf_intel_data.h"
-TEST(MATH_TEST, llrintf_intel) {
+TEST(math_h, llrintf_intel) {
DoMathDataTest<1>(g_llrintf_intel_data, llrintf);
}
#include "math_data/log_intel_data.h"
-TEST(MATH_TEST, log_intel) {
+TEST(math_h, log_intel) {
DoMathDataTest<1>(g_log_intel_data, log);
}
#include "math_data/logf_intel_data.h"
-TEST(MATH_TEST, logf_intel) {
+TEST(math_h, logf_intel) {
DoMathDataTest<1>(g_logf_intel_data, logf);
}
#include "math_data/log10_intel_data.h"
-TEST(MATH_TEST, log10_intel) {
+TEST(math_h, log10_intel) {
DoMathDataTest<1>(g_log10_intel_data, log10);
}
#include "math_data/log10f_intel_data.h"
-TEST(MATH_TEST, log10f_intel) {
+TEST(math_h, log10f_intel) {
DoMathDataTest<1>(g_log10f_intel_data, log10f);
}
#include "math_data/log1p_intel_data.h"
-TEST(MATH_TEST, log1p_intel) {
+TEST(math_h, log1p_intel) {
DoMathDataTest<1>(g_log1p_intel_data, log1p);
}
#include "math_data/log1pf_intel_data.h"
-TEST(MATH_TEST, log1pf_intel) {
+TEST(math_h, log1pf_intel) {
DoMathDataTest<1>(g_log1pf_intel_data, log1pf);
}
#include "math_data/log2_intel_data.h"
-TEST(MATH_TEST, log2_intel) {
+TEST(math_h, log2_intel) {
DoMathDataTest<1>(g_log2_intel_data, log2);
}
#include "math_data/log2f_intel_data.h"
-TEST(MATH_TEST, log2f_intel) {
+TEST(math_h, log2f_intel) {
DoMathDataTest<1>(g_log2f_intel_data, log2f);
}
#include "math_data/logb_intel_data.h"
-TEST(MATH_TEST, logb_intel) {
+TEST(math_h, logb_intel) {
DoMathDataTest<1>(g_logb_intel_data, logb);
}
#include "math_data/logbf_intel_data.h"
-TEST(MATH_TEST, logbf_intel) {
+TEST(math_h, logbf_intel) {
DoMathDataTest<1>(g_logbf_intel_data, logbf);
}
#include "math_data/lrint_intel_data.h"
-TEST(MATH_TEST, lrint_intel) {
+TEST(math_h, lrint_intel) {
DoMathDataTest<1>(g_lrint_intel_data, lrint);
}
#include "math_data/lrintf_intel_data.h"
-TEST(MATH_TEST, lrintf_intel) {
+TEST(math_h, lrintf_intel) {
DoMathDataTest<1>(g_lrintf_intel_data, lrintf);
}
#include "math_data/modf_intel_data.h"
-TEST(MATH_TEST, modf_intel) {
+TEST(math_h, modf_intel) {
DoMathDataTest<1>(g_modf_intel_data, modf);
}
#include "math_data/modff_intel_data.h"
-TEST(MATH_TEST, modff_intel) {
+TEST(math_h, modff_intel) {
DoMathDataTest<1>(g_modff_intel_data, modff);
}
#include "math_data/nearbyint_intel_data.h"
-TEST(MATH_TEST, nearbyint_intel) {
+TEST(math_h, nearbyint_intel) {
DoMathDataTest<1>(g_nearbyint_intel_data, nearbyint);
}
#include "math_data/nearbyintf_intel_data.h"
-TEST(MATH_TEST, nearbyintf_intel) {
+TEST(math_h, nearbyintf_intel) {
DoMathDataTest<1>(g_nearbyintf_intel_data, nearbyintf);
}
#include "math_data/nextafter_intel_data.h"
-TEST(MATH_TEST, nextafter_intel) {
+TEST(math_h, nextafter_intel) {
DoMathDataTest<1>(g_nextafter_intel_data, nextafter);
}
#include "math_data/nextafterf_intel_data.h"
-TEST(MATH_TEST, nextafterf_intel) {
+TEST(math_h, nextafterf_intel) {
DoMathDataTest<1>(g_nextafterf_intel_data, nextafterf);
}
#include "math_data/pow_intel_data.h"
-TEST(MATH_TEST, pow_intel) {
+TEST(math_h, pow_intel) {
DoMathDataTest<1>(g_pow_intel_data, pow);
}
#include "math_data/powf_intel_data.h"
-TEST(MATH_TEST, powf_intel) {
+TEST(math_h, powf_intel) {
DoMathDataTest<1>(g_powf_intel_data, powf);
}
#include "math_data/remainder_intel_data.h"
-TEST(MATH_TEST, remainder_intel) {
+TEST(math_h, remainder_intel) {
DoMathDataTest<1>(g_remainder_intel_data, remainder);
}
#include "math_data/remainderf_intel_data.h"
-TEST(MATH_TEST, remainderf_intel) {
+TEST(math_h, remainderf_intel) {
DoMathDataTest<1>(g_remainderf_intel_data, remainderf);
}
#include "math_data/remquo_intel_data.h"
-TEST(MATH_TEST, remquo_intel) {
+TEST(math_h, remquo_intel) {
DoMathDataTest<1>(g_remquo_intel_data, remquo);
}
#include "math_data/remquof_intel_data.h"
-TEST(MATH_TEST, remquof_intel) {
+TEST(math_h, remquof_intel) {
DoMathDataTest<1>(g_remquof_intel_data, remquof);
}
#include "math_data/rint_intel_data.h"
-TEST(MATH_TEST, rint_intel) {
+TEST(math_h, rint_intel) {
DoMathDataTest<1>(g_rint_intel_data, rint);
}
#include "math_data/rintf_intel_data.h"
-TEST(MATH_TEST, rintf_intel) {
+TEST(math_h, rintf_intel) {
DoMathDataTest<1>(g_rintf_intel_data, rintf);
}
#include "math_data/round_intel_data.h"
-TEST(MATH_TEST, round_intel) {
+TEST(math_h, round_intel) {
DoMathDataTest<1>(g_round_intel_data, round);
}
#include "math_data/roundf_intel_data.h"
-TEST(MATH_TEST, roundf_intel) {
+TEST(math_h, roundf_intel) {
DoMathDataTest<1>(g_roundf_intel_data, roundf);
}
#include "math_data/scalb_intel_data.h"
-TEST(MATH_TEST, scalb_intel) {
+TEST(math_h, scalb_intel) {
DoMathDataTest<1>(g_scalb_intel_data, scalb);
}
#include "math_data/scalbf_intel_data.h"
-TEST(MATH_TEST, scalbf_intel) {
+TEST(math_h, scalbf_intel) {
DoMathDataTest<1>(g_scalbf_intel_data, scalbf);
}
#include "math_data/scalbn_intel_data.h"
-TEST(MATH_TEST, scalbn_intel) {
+TEST(math_h, scalbn_intel) {
DoMathDataTest<1>(g_scalbn_intel_data, scalbn);
}
#include "math_data/scalbnf_intel_data.h"
-TEST(MATH_TEST, scalbnf_intel) {
+TEST(math_h, scalbnf_intel) {
DoMathDataTest<1>(g_scalbnf_intel_data, scalbnf);
}
#include "math_data/significand_intel_data.h"
-TEST(MATH_TEST, significand_intel) {
+TEST(math_h, significand_intel) {
DoMathDataTest<1>(g_significand_intel_data, significand);
}
#include "math_data/significandf_intel_data.h"
-TEST(MATH_TEST, significandf_intel) {
+TEST(math_h, significandf_intel) {
DoMathDataTest<1>(g_significandf_intel_data, significandf);
}
#include "math_data/sin_intel_data.h"
-TEST(MATH_TEST, sin_intel) {
+TEST(math_h, sin_intel) {
DoMathDataTest<1>(g_sin_intel_data, sin);
}
#include "math_data/sinf_intel_data.h"
-TEST(MATH_TEST, sinf_intel) {
+TEST(math_h, sinf_intel) {
DoMathDataTest<1>(g_sinf_intel_data, sinf);
}
#include "math_data/sinh_intel_data.h"
-TEST(MATH_TEST, sinh_intel) {
+TEST(math_h, sinh_intel) {
DoMathDataTest<2>(g_sinh_intel_data, sinh);
}
#include "math_data/sinhf_intel_data.h"
-TEST(MATH_TEST, sinhf_intel) {
+TEST(math_h, sinhf_intel) {
DoMathDataTest<2>(g_sinhf_intel_data, sinhf);
}
#include "math_data/sincos_intel_data.h"
-TEST(MATH_TEST, sincos_intel) {
+TEST(math_h, sincos_intel) {
DoMathDataTest<1>(g_sincos_intel_data, sincos);
}
#include "math_data/sincosf_intel_data.h"
-TEST(MATH_TEST, sincosf_intel) {
+TEST(math_h, sincosf_intel) {
DoMathDataTest<1>(g_sincosf_intel_data, sincosf);
}
#include "math_data/sqrt_intel_data.h"
-TEST(MATH_TEST, sqrt_intel) {
+TEST(math_h, sqrt_intel) {
DoMathDataTest<1>(g_sqrt_intel_data, sqrt);
}
#include "math_data/sqrtf_intel_data.h"
-TEST(MATH_TEST, sqrtf_intel) {
+TEST(math_h, sqrtf_intel) {
DoMathDataTest<1>(g_sqrtf_intel_data, sqrtf);
}
#include "math_data/tan_intel_data.h"
-TEST(MATH_TEST, tan_intel) {
+TEST(math_h, tan_intel) {
DoMathDataTest<1>(g_tan_intel_data, tan);
}
#include "math_data/tanf_intel_data.h"
-TEST(MATH_TEST, tanf_intel) {
+TEST(math_h, tanf_intel) {
DoMathDataTest<1>(g_tanf_intel_data, tanf);
}
#include "math_data/tanh_intel_data.h"
-TEST(MATH_TEST, tanh_intel) {
+TEST(math_h, tanh_intel) {
DoMathDataTest<2>(g_tanh_intel_data, tanh);
}
#include "math_data/tanhf_intel_data.h"
-TEST(MATH_TEST, tanhf_intel) {
+TEST(math_h, tanhf_intel) {
DoMathDataTest<2>(g_tanhf_intel_data, tanhf);
}
#include "math_data/trunc_intel_data.h"
-TEST(MATH_TEST, trunc_intel) {
+TEST(math_h, trunc_intel) {
DoMathDataTest<1>(g_trunc_intel_data, trunc);
}
#include "math_data/truncf_intel_data.h"
-TEST(MATH_TEST, truncf_intel) {
+TEST(math_h, truncf_intel) {
DoMathDataTest<1>(g_truncf_intel_data, truncf);
}
diff --git a/tests/run-on-host.sh b/tests/run-on-host.sh
index fe2c25a..19bbacf 100755
--- a/tests/run-on-host.sh
+++ b/tests/run-on-host.sh
@@ -2,9 +2,14 @@
. $(dirname $0)/../build/run-on-host.sh
-if [ "$1" = glibc ]; then
+if [ "$1" = glibc -o "$1" = musl ]; then
+ if [ "$1" = musl ]; then
+ BUILD_ARGS=USE_HOST_MUSL=true
+ else
+ BUILD_ARGS=
+ fi
shift
- m -j bionic-unit-tests-glibc
+ m -j $BUILD_ARGS bionic-unit-tests-glibc
(
cd ${ANDROID_BUILD_TOP}
export ANDROID_DATA=${TARGET_OUT_DATA}
@@ -13,7 +18,7 @@
)
exit 0
elif [ "$1" != 32 -a "$1" != 64 ]; then
- echo "Usage: $0 [ 32 | 64 | glibc ] [gtest flags]"
+ echo "Usage: $0 [ 32 | 64 | glibc | musl ] [gtest flags]"
exit 1
fi
diff --git a/tests/scs_test.cpp b/tests/scs_test.cpp
index 0776a43..3d5ebc1 100644
--- a/tests/scs_test.cpp
+++ b/tests/scs_test.cpp
@@ -16,8 +16,12 @@
#include <gtest/gtest.h>
+#include <android-base/silent_death_test.h>
+
#include "private/bionic_constants.h"
+using scs_DeathTest = SilentDeathTest;
+
int recurse2(int count);
__attribute__((weak, noinline)) int recurse1(int count) {
@@ -30,7 +34,7 @@
return 0;
}
-TEST(scs_test, stack_overflow) {
+TEST_F(scs_DeathTest, stack_overflow) {
#if defined(__aarch64__) || defined(__riscv)
ASSERT_EXIT(recurse1(SCS_SIZE), testing::KilledBySignal(SIGSEGV), "");
#else
diff --git a/tests/signal_test.cpp b/tests/signal_test.cpp
index fa648d2..2e6908c 100644
--- a/tests/signal_test.cpp
+++ b/tests/signal_test.cpp
@@ -530,14 +530,15 @@
#endif
}
-#if defined(__BIONIC__)
+#if defined(__BIONIC__) && !defined(__riscv)
// Not exposed via headers, but the symbols are available if you declare them yourself.
extern "C" int sigblock(int);
extern "C" int sigsetmask(int);
+#define HAVE_SIGBLOCK_SIGSETMASK
#endif
TEST(signal, sigblock_filter) {
-#if defined(__BIONIC__)
+#if defined(HAVE_SIGBLOCK_SIGSETMASK)
TestSignalMaskFunction([]() {
sigblock(~0U);
});
@@ -545,7 +546,7 @@
}
TEST(signal, sigsetmask_filter) {
-#if defined(__BIONIC__)
+#if defined(HAVE_SIGBLOCK_SIGSETMASK)
TestSignalMaskFunction([]() {
sigsetmask(~0U);
});
diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp
index 7b98df2..727af87 100644
--- a/tests/stdatomic_test.cpp
+++ b/tests/stdatomic_test.cpp
@@ -181,7 +181,7 @@
// And a rudimentary test of acquire-release memory ordering:
-constexpr static uint_least32_t BIG = 30'000'000ul; // Assumed even below.
+static constexpr uint_least32_t BIG = 30'000'000ul; // Assumed even below.
struct three_atomics {
atomic_uint_least32_t x;
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index 800732f..b0f59bb 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -99,6 +99,27 @@
ASSERT_EQ(nullptr, fgets(line, sizeof(line), fp)) << "junk at end of file: " << line;
}
+#define EXPECT_SNPRINTF_N(expected, n, fmt, ...) \
+ { \
+ char buf[BUFSIZ]; \
+ int w = snprintf(buf, sizeof(buf), fmt __VA_OPT__(, ) __VA_ARGS__); \
+ EXPECT_EQ(n, w); \
+ EXPECT_STREQ(expected, buf); \
+ }
+
+#define EXPECT_SNPRINTF(expected, fmt, ...) \
+ EXPECT_SNPRINTF_N(expected, static_cast<int>(strlen(expected)), fmt __VA_OPT__(, ) __VA_ARGS__)
+
+#define EXPECT_SWPRINTF_N(expected, n, fmt, ...) \
+ { \
+ wchar_t buf[BUFSIZ]; \
+ int w = swprintf(buf, sizeof(buf), fmt __VA_OPT__(, ) __VA_ARGS__); \
+ EXPECT_EQ(n, w); \
+ EXPECT_EQ(std::wstring(expected), std::wstring(buf, w)); \
+ }
+#define EXPECT_SWPRINTF(expected, fmt, ...) \
+ EXPECT_SWPRINTF_N(expected, static_cast<int>(wcslen(expected)), fmt __VA_OPT__(, ) __VA_ARGS__)
+
TEST(STDIO_TEST, flockfile_18208568_stderr) {
// Check that we have a _recursive_ mutex for flockfile.
flockfile(stderr);
@@ -309,21 +330,23 @@
// error: format '%zd' expects argument of type 'signed size_t',
// but argument 4 has type 'ssize_t {aka long int}' [-Werror=format]
ssize_t v = 1;
- char buf[32];
- snprintf(buf, sizeof(buf), "%zd", v);
+ EXPECT_SNPRINTF("1", "%zd", v);
+ EXPECT_SWPRINTF(L"1", L"%zd", v);
}
// https://code.google.com/p/android/issues/detail?id=64886
TEST(STDIO_TEST, snprintf_a) {
- char buf[BUFSIZ];
- EXPECT_EQ(23, snprintf(buf, sizeof(buf), "<%a>", 9990.235));
- EXPECT_STREQ("<0x1.3831e147ae148p+13>", buf);
+ EXPECT_SNPRINTF("<0x1.3831e147ae148p+13>", "<%a>", 9990.235);
+}
+
+// https://code.google.com/p/android/issues/detail?id=64886
+TEST(STDIO_TEST, swprintf_a) {
+ EXPECT_SWPRINTF(L"<0x1.3831e147ae148p+13>", L"<%a>", 9990.235);
}
// http://b/152588929
TEST(STDIO_TEST, snprintf_La) {
#if defined(__LP64__)
- char buf[BUFSIZ];
union {
uint64_t a[2];
long double v;
@@ -331,59 +354,98 @@
u.a[0] = UINT64_C(0x9b9b9b9b9b9b9b9b);
u.a[1] = UINT64_C(0xdfdfdfdfdfdfdfdf);
- EXPECT_EQ(41, snprintf(buf, sizeof(buf), "<%La>", u.v));
- EXPECT_STREQ("<-0x1.dfdfdfdfdfdf9b9b9b9b9b9b9b9bp+8160>", buf);
+ EXPECT_SNPRINTF("<-0x1.dfdfdfdfdfdf9b9b9b9b9b9b9b9bp+8160>", "<%La>", u.v);
u.a[0] = UINT64_C(0xffffffffffffffff);
u.a[1] = UINT64_C(0x7ffeffffffffffff);
- EXPECT_EQ(41, snprintf(buf, sizeof(buf), "<%La>", u.v));
- EXPECT_STREQ("<0x1.ffffffffffffffffffffffffffffp+16383>", buf);
+ EXPECT_SNPRINTF("<0x1.ffffffffffffffffffffffffffffp+16383>", "<%La>", u.v);
u.a[0] = UINT64_C(0x0000000000000000);
u.a[1] = UINT64_C(0x0000000000000000);
- EXPECT_EQ(8, snprintf(buf, sizeof(buf), "<%La>", u.v));
- EXPECT_STREQ("<0x0p+0>", buf);
+ EXPECT_SNPRINTF("<0x0p+0>", "<%La>", u.v);
+#else
+ GTEST_SKIP() << "no ld128";
+#endif
+}
+
+// http://b/152588929
+TEST(STDIO_TEST, swprintf_La) {
+#if defined(__LP64__)
+ union {
+ uint64_t a[2];
+ long double v;
+ } u;
+
+ u.a[0] = UINT64_C(0x9b9b9b9b9b9b9b9b);
+ u.a[1] = UINT64_C(0xdfdfdfdfdfdfdfdf);
+ EXPECT_SWPRINTF(L"<-0x1.dfdfdfdfdfdf9b9b9b9b9b9b9b9bp+8160>", L"<%La>", u.v);
+
+ u.a[0] = UINT64_C(0xffffffffffffffff);
+ u.a[1] = UINT64_C(0x7ffeffffffffffff);
+ EXPECT_SWPRINTF(L"<0x1.ffffffffffffffffffffffffffffp+16383>", L"<%La>", u.v);
+
+ u.a[0] = UINT64_C(0x0000000000000000);
+ u.a[1] = UINT64_C(0x0000000000000000);
+ EXPECT_SWPRINTF(L"<0x0p+0>", L"<%La>", u.v);
#else
GTEST_SKIP() << "no ld128";
#endif
}
TEST(STDIO_TEST, snprintf_lc) {
- char buf[BUFSIZ];
wint_t wc = L'a';
- EXPECT_EQ(3, snprintf(buf, sizeof(buf), "<%lc>", wc));
- EXPECT_STREQ("<a>", buf);
+ EXPECT_SNPRINTF("<a>", "<%lc>", wc);
}
-TEST(STDIO_TEST, snprintf_C) { // Synonym for %lc.
- char buf[BUFSIZ];
+TEST(STDIO_TEST, swprintf_lc) {
+ wint_t wc = L'a';
+ EXPECT_SWPRINTF(L"<a>", L"<%lc>", wc);
+}
+
+TEST(STDIO_TEST, snprintf_C) { // Synonym for %lc.
wchar_t wc = L'a';
- EXPECT_EQ(3, snprintf(buf, sizeof(buf), "<%C>", wc));
- EXPECT_STREQ("<a>", buf);
+ EXPECT_SNPRINTF("<a>", "<%C>", wc);
+}
+
+TEST(STDIO_TEST, swprintf_C) { // Synonym for %lc.
+ wchar_t wc = L'a';
+ EXPECT_SWPRINTF(L"<a>", L"<%C>", wc);
+}
+
+TEST(STDIO_TEST, snprintf_ls_null) {
+ EXPECT_SNPRINTF("<(null)>", "<%ls>", static_cast<wchar_t*>(nullptr));
+}
+
+TEST(STDIO_TEST, swprintf_ls_null) {
+ EXPECT_SWPRINTF(L"<(null)>", L"<%ls>", static_cast<wchar_t*>(nullptr));
}
TEST(STDIO_TEST, snprintf_ls) {
- char buf[BUFSIZ];
- wchar_t* ws = nullptr;
- EXPECT_EQ(8, snprintf(buf, sizeof(buf), "<%ls>", ws));
- EXPECT_STREQ("<(null)>", buf);
+ static const wchar_t chars[] = L"Hello\u0666 World";
+ EXPECT_SNPRINTF("<Hello\xd9\xa6 World>", "<%ls>", chars);
+}
- wchar_t chars[] = { L'h', L'i', 0 };
- ws = chars;
- EXPECT_EQ(4, snprintf(buf, sizeof(buf), "<%ls>", ws));
- EXPECT_STREQ("<hi>", buf);
+TEST(STDIO_TEST, swprintf_ls) {
+ static const wchar_t chars[] = L"Hello\u0666 World";
+ EXPECT_SWPRINTF(L"<Hello\u0666 World>", L"<%ls>", chars);
+}
+
+TEST(STDIO_TEST, snprintf_S_nullptr) { // Synonym for %ls.
+ EXPECT_SNPRINTF("<(null)>", "<%S>", static_cast<wchar_t*>(nullptr));
+}
+
+TEST(STDIO_TEST, swprintf_S_nullptr) { // Synonym for %ls.
+ EXPECT_SWPRINTF(L"<(null)>", L"<%S>", static_cast<wchar_t*>(nullptr));
}
TEST(STDIO_TEST, snprintf_S) { // Synonym for %ls.
- char buf[BUFSIZ];
- wchar_t* ws = nullptr;
- EXPECT_EQ(8, snprintf(buf, sizeof(buf), "<%S>", ws));
- EXPECT_STREQ("<(null)>", buf);
+ static const wchar_t chars[] = L"Hello\u0666 World";
+ EXPECT_SNPRINTF("<Hello\xd9\xa6 World>", "<%S>", chars);
+}
- wchar_t chars[] = { L'h', L'i', 0 };
- ws = chars;
- EXPECT_EQ(4, snprintf(buf, sizeof(buf), "<%S>", ws));
- EXPECT_STREQ("<hi>", buf);
+TEST(STDIO_TEST, swprintf_S) { // Synonym for %ls.
+ static const wchar_t chars[] = L"Hello\u0666 World";
+ EXPECT_SWPRINTF(L"<Hello\u0666 World>", L"<%S>", chars);
}
TEST_F(STDIO_DEATHTEST, snprintf_n) {
@@ -400,106 +462,111 @@
#endif
}
+TEST_F(STDIO_DEATHTEST, swprintf_n) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat"
+ // http://b/14492135 and http://b/31832608.
+ wchar_t buf[32];
+ int i = 1234;
+ EXPECT_DEATH(swprintf(buf, sizeof(buf), L"a %n b", &i), "%n not allowed on Android");
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "glibc does allow %n";
+#endif
+}
+
TEST(STDIO_TEST, snprintf_measure) {
- char buf[16];
+ char buf[1] = {'x'};
ASSERT_EQ(11, snprintf(buf, 0, "Hello %s", "world"));
+ ASSERT_EQ('x', buf[0]);
+}
+
+// Unlike snprintf(), you *can't* use swprintf() to measure.
+TEST(STDIO_TEST, swprintf_measure) {
+ wchar_t buf[1] = {L'x'};
+ ASSERT_EQ(-1, swprintf(buf, 0, L"Hello %S", L"world"));
+ ASSERT_EQ(L'x', buf[0]);
}
TEST(STDIO_TEST, snprintf_smoke) {
- char buf[BUFSIZ];
+ EXPECT_SNPRINTF("a", "a");
+ EXPECT_SNPRINTF("%", "%%");
+ EXPECT_SNPRINTF("01234", "01234");
+ EXPECT_SNPRINTF("a01234b", "a%sb", "01234");
- snprintf(buf, sizeof(buf), "a");
- EXPECT_STREQ("a", buf);
+ EXPECT_SNPRINTF("a(null)b", "a%sb", static_cast<char*>(nullptr));
+ EXPECT_SNPRINTF("aabbcc", "aa%scc", "bb");
+ EXPECT_SNPRINTF("abc", "a%cc", 'b');
+ EXPECT_SNPRINTF("a1234b", "a%db", 1234);
+ EXPECT_SNPRINTF("a-8123b", "a%db", -8123);
+ EXPECT_SNPRINTF("a16b", "a%hdb", static_cast<short>(0x7fff0010));
+ EXPECT_SNPRINTF("a16b", "a%hhdb", static_cast<char>(0x7fffff10));
+ EXPECT_SNPRINTF("a68719476736b", "a%lldb", 0x1000000000LL);
+ EXPECT_SNPRINTF("a70000b", "a%ldb", 70000L);
+ EXPECT_SNPRINTF("a0xb0001234b", "a%pb", reinterpret_cast<void*>(0xb0001234));
+ EXPECT_SNPRINTF("a12abz", "a%xz", 0x12ab);
+ EXPECT_SNPRINTF("a12ABz", "a%Xz", 0x12ab);
+ EXPECT_SNPRINTF("a00123456z", "a%08xz", 0x123456);
+ EXPECT_SNPRINTF("a 1234z", "a%5dz", 1234);
+ EXPECT_SNPRINTF("a01234z", "a%05dz", 1234);
+ EXPECT_SNPRINTF("a 1234z", "a%8dz", 1234);
+ EXPECT_SNPRINTF("a1234 z", "a%-8dz", 1234);
+ EXPECT_SNPRINTF("Aabcdef Z", "A%-11sZ", "abcdef");
+ EXPECT_SNPRINTF("Ahello:1234Z", "A%s:%dZ", "hello", 1234);
+ EXPECT_SNPRINTF("a005:5:05z", "a%03d:%d:%02dz", 5, 5, 5);
- snprintf(buf, sizeof(buf), "%%");
- EXPECT_STREQ("%", buf);
-
- snprintf(buf, sizeof(buf), "01234");
- EXPECT_STREQ("01234", buf);
-
- snprintf(buf, sizeof(buf), "a%sb", "01234");
- EXPECT_STREQ("a01234b", buf);
-
- char* s = nullptr;
- snprintf(buf, sizeof(buf), "a%sb", s);
- EXPECT_STREQ("a(null)b", buf);
-
- snprintf(buf, sizeof(buf), "aa%scc", "bb");
- EXPECT_STREQ("aabbcc", buf);
-
- snprintf(buf, sizeof(buf), "a%cc", 'b');
- EXPECT_STREQ("abc", buf);
-
- snprintf(buf, sizeof(buf), "a%db", 1234);
- EXPECT_STREQ("a1234b", buf);
-
- snprintf(buf, sizeof(buf), "a%db", -8123);
- EXPECT_STREQ("a-8123b", buf);
-
- snprintf(buf, sizeof(buf), "a%hdb", static_cast<short>(0x7fff0010));
- EXPECT_STREQ("a16b", buf);
-
- snprintf(buf, sizeof(buf), "a%hhdb", static_cast<char>(0x7fffff10));
- EXPECT_STREQ("a16b", buf);
-
- snprintf(buf, sizeof(buf), "a%lldb", 0x1000000000LL);
- EXPECT_STREQ("a68719476736b", buf);
-
- snprintf(buf, sizeof(buf), "a%ldb", 70000L);
- EXPECT_STREQ("a70000b", buf);
-
- snprintf(buf, sizeof(buf), "a%pb", reinterpret_cast<void*>(0xb0001234));
- EXPECT_STREQ("a0xb0001234b", buf);
-
- snprintf(buf, sizeof(buf), "a%xz", 0x12ab);
- EXPECT_STREQ("a12abz", buf);
-
- snprintf(buf, sizeof(buf), "a%Xz", 0x12ab);
- EXPECT_STREQ("a12ABz", buf);
-
- snprintf(buf, sizeof(buf), "a%08xz", 0x123456);
- EXPECT_STREQ("a00123456z", buf);
-
- snprintf(buf, sizeof(buf), "a%5dz", 1234);
- EXPECT_STREQ("a 1234z", buf);
-
- snprintf(buf, sizeof(buf), "a%05dz", 1234);
- EXPECT_STREQ("a01234z", buf);
-
- snprintf(buf, sizeof(buf), "a%8dz", 1234);
- EXPECT_STREQ("a 1234z", buf);
-
- snprintf(buf, sizeof(buf), "a%-8dz", 1234);
- EXPECT_STREQ("a1234 z", buf);
-
- snprintf(buf, sizeof(buf), "A%-11sZ", "abcdef");
- EXPECT_STREQ("Aabcdef Z", buf);
-
- snprintf(buf, sizeof(buf), "A%s:%dZ", "hello", 1234);
- EXPECT_STREQ("Ahello:1234Z", buf);
-
- snprintf(buf, sizeof(buf), "a%03d:%d:%02dz", 5, 5, 5);
- EXPECT_STREQ("a005:5:05z", buf);
-
- void* p = nullptr;
- snprintf(buf, sizeof(buf), "a%d,%pz", 5, p);
#if defined(__BIONIC__)
- EXPECT_STREQ("a5,0x0z", buf);
+ EXPECT_SNPRINTF("a5,0x0z", "a%d,%pz", 5, static_cast<void*>(nullptr));
#else // __BIONIC__
- EXPECT_STREQ("a5,(nil)z", buf);
+ EXPECT_SNPRINTF("a5,(nil)z", "a%d,%pz", 5, static_cast<void*>(nullptr));
#endif // __BIONIC__
- snprintf(buf, sizeof(buf), "a%lld,%d,%d,%dz", 0x1000000000LL, 6, 7, 8);
- EXPECT_STREQ("a68719476736,6,7,8z", buf);
+ EXPECT_SNPRINTF("a68719476736,6,7,8z", "a%lld,%d,%d,%dz", 0x1000000000LL, 6, 7, 8);
- snprintf(buf, sizeof(buf), "a_%f_b", 1.23f);
- EXPECT_STREQ("a_1.230000_b", buf);
+ EXPECT_SNPRINTF("a_1.230000_b", "a_%f_b", 1.23f);
+ EXPECT_SNPRINTF("a_3.14_b", "a_%g_b", 3.14);
+ EXPECT_SNPRINTF("print_me_twice print_me_twice", "%1$s %1$s", "print_me_twice");
+}
- snprintf(buf, sizeof(buf), "a_%g_b", 3.14);
- EXPECT_STREQ("a_3.14_b", buf);
+TEST(STDIO_TEST, swprintf_smoke) {
+ EXPECT_SWPRINTF(L"a", L"a");
+ EXPECT_SWPRINTF(L"%", L"%%");
+ EXPECT_SWPRINTF(L"01234", L"01234");
+ EXPECT_SWPRINTF(L"a01234b", L"a%sb", "01234");
- snprintf(buf, sizeof(buf), "%1$s %1$s", "print_me_twice");
- EXPECT_STREQ("print_me_twice print_me_twice", buf);
+ EXPECT_SWPRINTF(L"a(null)b", L"a%sb", static_cast<char*>(nullptr));
+ EXPECT_SWPRINTF(L"aabbcc", L"aa%scc", "bb");
+ EXPECT_SWPRINTF(L"abc", L"a%cc", 'b');
+ EXPECT_SWPRINTF(L"a1234b", L"a%db", 1234);
+ EXPECT_SWPRINTF(L"a-8123b", L"a%db", -8123);
+ EXPECT_SWPRINTF(L"a16b", L"a%hdb", static_cast<short>(0x7fff0010));
+ EXPECT_SWPRINTF(L"a16b", L"a%hhdb", static_cast<char>(0x7fffff10));
+ EXPECT_SWPRINTF(L"a68719476736b", L"a%lldb", 0x1000000000LL);
+ EXPECT_SWPRINTF(L"a70000b", L"a%ldb", 70000L);
+ EXPECT_SWPRINTF(L"a0xb0001234b", L"a%pb", reinterpret_cast<void*>(0xb0001234));
+ EXPECT_SWPRINTF(L"a12abz", L"a%xz", 0x12ab);
+ EXPECT_SWPRINTF(L"a12ABz", L"a%Xz", 0x12ab);
+ EXPECT_SWPRINTF(L"a00123456z", L"a%08xz", 0x123456);
+ EXPECT_SWPRINTF(L"a 1234z", L"a%5dz", 1234);
+ EXPECT_SWPRINTF(L"a01234z", L"a%05dz", 1234);
+ EXPECT_SWPRINTF(L"a 1234z", L"a%8dz", 1234);
+ EXPECT_SWPRINTF(L"a1234 z", L"a%-8dz", 1234);
+ EXPECT_SWPRINTF(L"Aabcdef Z", L"A%-11sZ", "abcdef");
+ EXPECT_SWPRINTF(L"Ahello:1234Z", L"A%s:%dZ", "hello", 1234);
+ EXPECT_SWPRINTF(L"a005:5:05z", L"a%03d:%d:%02dz", 5, 5, 5);
+
+#if defined(__BIONIC__)
+ EXPECT_SWPRINTF(L"a5,0x0z", L"a%d,%pz", 5, static_cast<void*>(nullptr));
+#else // __BIONIC__
+ EXPECT_SWPRINTF(L"a5,(nil)z", L"a%d,%pz", 5, static_cast<void*>(nullptr));
+#endif // __BIONIC__
+
+ EXPECT_SWPRINTF(L"a68719476736,6,7,8z", L"a%lld,%d,%d,%dz", 0x1000000000LL, 6, 7, 8);
+
+ EXPECT_SWPRINTF(L"a_1.230000_b", L"a_%f_b", 1.23f);
+ EXPECT_SWPRINTF(L"a_3.14_b", L"a_%g_b", 3.14);
+ EXPECT_SWPRINTF(L"print_me_twice print_me_twice", L"%1$s %1$s", "print_me_twice");
}
template <typename T>
@@ -634,227 +701,164 @@
L"[-NAN]", L"[NAN]", L"[+NAN]");
}
-TEST(STDIO_TEST, swprintf) {
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- ASSERT_EQ(2, swprintf(buf, nchars, L"ab")) << strerror(errno);
- ASSERT_EQ(std::wstring(L"ab"), buf);
- ASSERT_EQ(5, swprintf(buf, nchars, L"%s", "abcde"));
- ASSERT_EQ(std::wstring(L"abcde"), buf);
-
- // Unlike swprintf(), swprintf() returns -1 in case of truncation
- // and doesn't necessarily zero-terminate the output!
- ASSERT_EQ(-1, swprintf(buf, 4, L"%s", "abcde"));
-
- const char kString[] = "Hello, World";
- ASSERT_EQ(12, swprintf(buf, nchars, L"%s", kString));
- ASSERT_EQ(std::wstring(L"Hello, World"), buf);
- ASSERT_EQ(12, swprintf(buf, 13, L"%s", kString));
- ASSERT_EQ(std::wstring(L"Hello, World"), buf);
-}
-
-TEST(STDIO_TEST, swprintf_a) {
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- ASSERT_EQ(20, swprintf(buf, nchars, L"%a", 3.1415926535));
- ASSERT_EQ(std::wstring(L"0x1.921fb54411744p+1"), buf);
-}
-
-TEST(STDIO_TEST, swprintf_lc) {
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- wint_t wc = L'a';
- EXPECT_EQ(3, swprintf(buf, nchars, L"<%lc>", wc));
- EXPECT_EQ(std::wstring(L"<a>"), buf);
-}
-
-TEST(STDIO_TEST, swprintf_C) { // Synonym for %lc.
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- wint_t wc = L'a';
- EXPECT_EQ(3, swprintf(buf, nchars, L"<%C>", wc));
- EXPECT_EQ(std::wstring(L"<a>"), buf);
+TEST(STDIO_TEST, snprintf_jd_INTMAX_MAX) {
+ EXPECT_SNPRINTF("9223372036854775807", "%jd", INTMAX_MAX);
}
TEST(STDIO_TEST, swprintf_jd_INTMAX_MAX) {
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- swprintf(buf, nchars, L"%jd", INTMAX_MAX);
- EXPECT_EQ(std::wstring(L"9223372036854775807"), buf);
-}
-
-TEST(STDIO_TEST, swprintf_jd_INTMAX_MIN) {
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- swprintf(buf, nchars, L"%jd", INTMAX_MIN);
- EXPECT_EQ(std::wstring(L"-9223372036854775808"), buf);
-}
-
-TEST(STDIO_TEST, swprintf_ju_UINTMAX_MAX) {
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- swprintf(buf, nchars, L"%ju", UINTMAX_MAX);
- EXPECT_EQ(std::wstring(L"18446744073709551615"), buf);
-}
-
-TEST(STDIO_TEST, swprintf_1$ju_UINTMAX_MAX) {
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- swprintf(buf, nchars, L"%1$ju", UINTMAX_MAX);
- EXPECT_EQ(std::wstring(L"18446744073709551615"), buf);
-}
-
-TEST(STDIO_TEST, swprintf_ls) {
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- static const wchar_t kWideString[] = L"Hello\uff41 World";
- ASSERT_EQ(12, swprintf(buf, nchars, L"%ls", kWideString));
- ASSERT_EQ(std::wstring(kWideString), buf);
- ASSERT_EQ(12, swprintf(buf, 13, L"%ls", kWideString));
- ASSERT_EQ(std::wstring(kWideString), buf);
-}
-
-TEST(STDIO_TEST, swprintf_S) { // Synonym for %ls.
- constexpr size_t nchars = 32;
- wchar_t buf[nchars];
-
- static const wchar_t kWideString[] = L"Hello\uff41 World";
- ASSERT_EQ(12, swprintf(buf, nchars, L"%S", kWideString));
- ASSERT_EQ(std::wstring(kWideString), buf);
- ASSERT_EQ(12, swprintf(buf, 13, L"%S", kWideString));
- ASSERT_EQ(std::wstring(kWideString), buf);
-}
-
-TEST(STDIO_TEST, snprintf_d_INT_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%d", INT_MAX);
- EXPECT_STREQ("2147483647", buf);
-}
-
-TEST(STDIO_TEST, snprintf_d_INT_MIN) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%d", INT_MIN);
- EXPECT_STREQ("-2147483648", buf);
-}
-
-TEST(STDIO_TEST, snprintf_jd_INTMAX_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%jd", INTMAX_MAX);
- EXPECT_STREQ("9223372036854775807", buf);
+ EXPECT_SWPRINTF(L"9223372036854775807", L"%jd", INTMAX_MAX);
}
TEST(STDIO_TEST, snprintf_jd_INTMAX_MIN) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%jd", INTMAX_MIN);
- EXPECT_STREQ("-9223372036854775808", buf);
+ EXPECT_SNPRINTF("-9223372036854775808", "%jd", INTMAX_MIN);
+}
+
+TEST(STDIO_TEST, swprintf_jd_INTMAX_MIN) {
+ EXPECT_SWPRINTF(L"-9223372036854775808", L"%jd", INTMAX_MIN);
}
TEST(STDIO_TEST, snprintf_ju_UINTMAX_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%ju", UINTMAX_MAX);
- EXPECT_STREQ("18446744073709551615", buf);
+ EXPECT_SNPRINTF("18446744073709551615", "%ju", UINTMAX_MAX);
+}
+
+TEST(STDIO_TEST, swprintf_ju_UINTMAX_MAX) {
+ EXPECT_SWPRINTF(L"18446744073709551615", L"%ju", UINTMAX_MAX);
}
TEST(STDIO_TEST, snprintf_1$ju_UINTMAX_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%1$ju", UINTMAX_MAX);
- EXPECT_STREQ("18446744073709551615", buf);
+ EXPECT_SNPRINTF("18446744073709551615", "%1$ju", UINTMAX_MAX);
+}
+
+TEST(STDIO_TEST, swprintf_1$ju_UINTMAX_MAX) {
+ EXPECT_SWPRINTF(L"18446744073709551615", L"%1$ju", UINTMAX_MAX);
+}
+
+TEST(STDIO_TEST, snprintf_d_INT_MAX) {
+ EXPECT_SNPRINTF("2147483647", "%d", INT_MAX);
+}
+
+TEST(STDIO_TEST, swprintf_d_INT_MAX) {
+ EXPECT_SWPRINTF(L"2147483647", L"%d", INT_MAX);
+}
+
+TEST(STDIO_TEST, snprintf_d_INT_MIN) {
+ EXPECT_SNPRINTF("-2147483648", "%d", INT_MIN);
+}
+
+TEST(STDIO_TEST, swprintf_d_INT_MIN) {
+ EXPECT_SWPRINTF(L"-2147483648", L"%d", INT_MIN);
}
TEST(STDIO_TEST, snprintf_ld_LONG_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%ld", LONG_MAX);
#if defined(__LP64__)
- EXPECT_STREQ("9223372036854775807", buf);
+ EXPECT_SNPRINTF("9223372036854775807", "%ld", LONG_MAX);
#else
- EXPECT_STREQ("2147483647", buf);
+ EXPECT_SNPRINTF("2147483647", "%ld", LONG_MAX);
+#endif
+}
+
+TEST(STDIO_TEST, swprintf_ld_LONG_MAX) {
+#if defined(__LP64__)
+ EXPECT_SWPRINTF(L"9223372036854775807", L"%ld", LONG_MAX);
+#else
+ EXPECT_SWPRINTF(L"2147483647", L"%ld", LONG_MAX);
#endif
}
TEST(STDIO_TEST, snprintf_ld_LONG_MIN) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%ld", LONG_MIN);
#if defined(__LP64__)
- EXPECT_STREQ("-9223372036854775808", buf);
+ EXPECT_SNPRINTF("-9223372036854775808", "%ld", LONG_MIN);
#else
- EXPECT_STREQ("-2147483648", buf);
+ EXPECT_SNPRINTF("-2147483648", "%ld", LONG_MIN);
+#endif
+}
+
+TEST(STDIO_TEST, swprintf_ld_LONG_MIN) {
+#if defined(__LP64__)
+ EXPECT_SWPRINTF(L"-9223372036854775808", L"%ld", LONG_MIN);
+#else
+ EXPECT_SWPRINTF(L"-2147483648", L"%ld", LONG_MIN);
#endif
}
TEST(STDIO_TEST, snprintf_lld_LLONG_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%lld", LLONG_MAX);
- EXPECT_STREQ("9223372036854775807", buf);
+ EXPECT_SNPRINTF("9223372036854775807", "%lld", LLONG_MAX);
+}
+
+TEST(STDIO_TEST, swprintf_lld_LLONG_MAX) {
+ EXPECT_SWPRINTF(L"9223372036854775807", L"%lld", LLONG_MAX);
}
TEST(STDIO_TEST, snprintf_lld_LLONG_MIN) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%lld", LLONG_MIN);
- EXPECT_STREQ("-9223372036854775808", buf);
+ EXPECT_SNPRINTF("-9223372036854775808", "%lld", LLONG_MIN);
+}
+
+TEST(STDIO_TEST, swprintf_lld_LLONG_MIN) {
+ EXPECT_SWPRINTF(L"-9223372036854775808", L"%lld", LLONG_MIN);
}
TEST(STDIO_TEST, snprintf_o_UINT_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%o", UINT_MAX);
- EXPECT_STREQ("37777777777", buf);
+ EXPECT_SNPRINTF("37777777777", "%o", UINT_MAX);
+}
+
+TEST(STDIO_TEST, swprintf_o_UINT_MAX) {
+ EXPECT_SWPRINTF(L"37777777777", L"%o", UINT_MAX);
}
TEST(STDIO_TEST, snprintf_u_UINT_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%u", UINT_MAX);
- EXPECT_STREQ("4294967295", buf);
+ EXPECT_SNPRINTF("4294967295", "%u", UINT_MAX);
+}
+
+TEST(STDIO_TEST, swprintf_u_UINT_MAX) {
+ EXPECT_SWPRINTF(L"4294967295", L"%u", UINT_MAX);
}
TEST(STDIO_TEST, snprintf_x_UINT_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%x", UINT_MAX);
- EXPECT_STREQ("ffffffff", buf);
+ EXPECT_SNPRINTF("ffffffff", "%x", UINT_MAX);
+}
+
+TEST(STDIO_TEST, swprintf_x_UINT_MAX) {
+ EXPECT_SWPRINTF(L"ffffffff", L"%x", UINT_MAX);
}
TEST(STDIO_TEST, snprintf_X_UINT_MAX) {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%X", UINT_MAX);
- EXPECT_STREQ("FFFFFFFF", buf);
+ EXPECT_SNPRINTF("FFFFFFFF", "%X", UINT_MAX);
+}
+
+TEST(STDIO_TEST, swprintf_X_UINT_MAX) {
+ EXPECT_SWPRINTF(L"FFFFFFFF", L"%X", UINT_MAX);
}
TEST(STDIO_TEST, snprintf_e) {
- char buf[BUFSIZ];
+ EXPECT_SNPRINTF("1.500000e+00", "%e", 1.5);
+ EXPECT_SNPRINTF("1.500000e+00", "%Le", 1.5L);
+}
- snprintf(buf, sizeof(buf), "%e", 1.5);
- EXPECT_STREQ("1.500000e+00", buf);
-
- snprintf(buf, sizeof(buf), "%Le", 1.5L);
- EXPECT_STREQ("1.500000e+00", buf);
+TEST(STDIO_TEST, swprintf_e) {
+ EXPECT_SWPRINTF(L"1.500000e+00", L"%e", 1.5);
+ EXPECT_SWPRINTF(L"1.500000e+00", L"%Le", 1.5L);
}
TEST(STDIO_TEST, snprintf_negative_zero_5084292) {
- char buf[BUFSIZ];
+ EXPECT_SNPRINTF("-0.000000e+00", "%e", -0.0);
+ EXPECT_SNPRINTF("-0.000000E+00", "%E", -0.0);
+ EXPECT_SNPRINTF("-0.000000", "%f", -0.0);
+ EXPECT_SNPRINTF("-0.000000", "%F", -0.0);
+ EXPECT_SNPRINTF("-0", "%g", -0.0);
+ EXPECT_SNPRINTF("-0", "%G", -0.0);
+ EXPECT_SNPRINTF("-0x0p+0", "%a", -0.0);
+ EXPECT_SNPRINTF("-0X0P+0", "%A", -0.0);
+}
- snprintf(buf, sizeof(buf), "%e", -0.0);
- EXPECT_STREQ("-0.000000e+00", buf);
- snprintf(buf, sizeof(buf), "%E", -0.0);
- EXPECT_STREQ("-0.000000E+00", buf);
- snprintf(buf, sizeof(buf), "%f", -0.0);
- EXPECT_STREQ("-0.000000", buf);
- snprintf(buf, sizeof(buf), "%F", -0.0);
- EXPECT_STREQ("-0.000000", buf);
- snprintf(buf, sizeof(buf), "%g", -0.0);
- EXPECT_STREQ("-0", buf);
- snprintf(buf, sizeof(buf), "%G", -0.0);
- EXPECT_STREQ("-0", buf);
- snprintf(buf, sizeof(buf), "%a", -0.0);
- EXPECT_STREQ("-0x0p+0", buf);
- snprintf(buf, sizeof(buf), "%A", -0.0);
- EXPECT_STREQ("-0X0P+0", buf);
+TEST(STDIO_TEST, swprintf_negative_zero_5084292) {
+ EXPECT_SWPRINTF(L"-0.000000e+00", L"%e", -0.0);
+ EXPECT_SWPRINTF(L"-0.000000E+00", L"%E", -0.0);
+ EXPECT_SWPRINTF(L"-0.000000", L"%f", -0.0);
+ EXPECT_SWPRINTF(L"-0.000000", L"%F", -0.0);
+ EXPECT_SWPRINTF(L"-0", L"%g", -0.0);
+ EXPECT_SWPRINTF(L"-0", L"%G", -0.0);
+ EXPECT_SWPRINTF(L"-0x0p+0", L"%a", -0.0);
+ EXPECT_SWPRINTF(L"-0X0P+0", L"%A", -0.0);
}
TEST(STDIO_TEST, snprintf_utf8_15439554) {
@@ -915,18 +919,36 @@
ASSERT_EQ(ENOMEM, errno);
}
+TEST(STDIO_TEST, swprintf_asterisk_overflow) {
+ wchar_t buf[128];
+ ASSERT_EQ(5, swprintf(buf, sizeof(buf), L"%.*s%c", 4, "hello world", '!'));
+ ASSERT_EQ(12, swprintf(buf, sizeof(buf), L"%.*s%c", INT_MAX / 2, "hello world", '!'));
+ ASSERT_EQ(12, swprintf(buf, sizeof(buf), L"%.*s%c", INT_MAX - 1, "hello world", '!'));
+ ASSERT_EQ(12, swprintf(buf, sizeof(buf), L"%.*s%c", INT_MAX, "hello world", '!'));
+ ASSERT_EQ(12, swprintf(buf, sizeof(buf), L"%.*s%c", -1, "hello world", '!'));
+
+ // INT_MAX-1, INT_MAX, INT_MAX+1.
+ ASSERT_EQ(12, swprintf(buf, sizeof(buf), L"%.2147483646s%c", "hello world", '!'));
+ ASSERT_EQ(12, swprintf(buf, sizeof(buf), L"%.2147483647s%c", "hello world", '!'));
+ ASSERT_EQ(-1, swprintf(buf, sizeof(buf), L"%.2147483648s%c", "hello world", '!'));
+ ASSERT_EQ(ENOMEM, errno);
+}
+
// Inspired by https://github.com/landley/toybox/issues/163.
TEST(STDIO_TEST, printf_NULL) {
- char buf[128];
char* null = nullptr;
- EXPECT_EQ(4, snprintf(buf, sizeof(buf), "<%*.*s>", 2, 2, null));
- EXPECT_STREQ("<(n>", buf);
- EXPECT_EQ(8, snprintf(buf, sizeof(buf), "<%*.*s>", 2, 8, null));
- EXPECT_STREQ("<(null)>", buf);
- EXPECT_EQ(10, snprintf(buf, sizeof(buf), "<%*.*s>", 8, 2, null));
- EXPECT_STREQ("< (n>", buf);
- EXPECT_EQ(10, snprintf(buf, sizeof(buf), "<%*.*s>", 8, 8, null));
- EXPECT_STREQ("< (null)>", buf);
+ EXPECT_SNPRINTF("<(n>", "<%*.*s>", 2, 2, null);
+ EXPECT_SNPRINTF("<(null)>", "<%*.*s>", 2, 8, null);
+ EXPECT_SNPRINTF("< (n>", "<%*.*s>", 8, 2, null);
+ EXPECT_SNPRINTF("< (null)>", "<%*.*s>", 8, 8, null);
+}
+
+TEST(STDIO_TEST, wprintf_NULL) {
+ char* null = nullptr;
+ EXPECT_SWPRINTF(L"<(n>", L"<%*.*s>", 2, 2, null);
+ EXPECT_SWPRINTF(L"<(null)>", L"<%*.*s>", 2, 8, null);
+ EXPECT_SWPRINTF(L"< (n>", L"<%*.*s>", 8, 2, null);
+ EXPECT_SWPRINTF(L"< (null)>", L"<%*.*s>", 8, 8, null);
}
TEST(STDIO_TEST, fprintf) {
@@ -1027,11 +1049,13 @@
}
TEST(STDIO_TEST, popen_return_value_signal) {
- FILE* fp = popen("kill -7 $$", "r");
+ // Use a realtime signal to avoid creating a tombstone when running.
+ std::string cmd = android::base::StringPrintf("kill -%d $$", SIGRTMIN);
+ FILE* fp = popen(cmd.c_str(), "r");
ASSERT_TRUE(fp != nullptr);
int status = pclose(fp);
EXPECT_TRUE(WIFSIGNALED(status));
- EXPECT_EQ(7, WTERMSIG(status));
+ EXPECT_EQ(SIGRTMIN, WTERMSIG(status));
}
TEST(STDIO_TEST, getc) {
@@ -2469,7 +2493,7 @@
}
TEST_F(STDIO_DEATHTEST, snprintf_30445072_unknown_buffer_size) {
- std::string buf = "world";
+ std::string buf = "hello"; // So the compiler doesn't know the buffer size.
ASSERT_EXIT(snprintf(&buf[0], atol("-1"), "hello"),
testing::KilledBySignal(SIGABRT),
"FORTIFY: vsnprintf: size .* > SSIZE_MAX");
@@ -2482,48 +2506,36 @@
}
TEST(STDIO_TEST, printf_m) {
- char buf[BUFSIZ];
errno = 0;
- snprintf(buf, sizeof(buf), "<%m>");
- ASSERT_STREQ("<Success>", buf);
+ EXPECT_SNPRINTF("<Success>", "<%m>");
errno = -1;
- snprintf(buf, sizeof(buf), "<%m>");
- ASSERT_STREQ("<Unknown error -1>", buf);
+ EXPECT_SNPRINTF("<Unknown error -1>", "<%m>");
errno = EINVAL;
- snprintf(buf, sizeof(buf), "<%m>");
- ASSERT_STREQ("<Invalid argument>", buf);
-}
-
-TEST(STDIO_TEST, printf_m_does_not_clobber_strerror) {
- char buf[BUFSIZ];
- const char* m = strerror(-1);
- ASSERT_STREQ("Unknown error -1", m);
- errno = -2;
- snprintf(buf, sizeof(buf), "<%m>");
- ASSERT_STREQ("<Unknown error -2>", buf);
- ASSERT_STREQ("Unknown error -1", m);
+ EXPECT_SNPRINTF("<Invalid argument>", "<%m>");
}
TEST(STDIO_TEST, wprintf_m) {
- wchar_t buf[BUFSIZ];
errno = 0;
- swprintf(buf, sizeof(buf), L"<%m>");
- ASSERT_EQ(std::wstring(L"<Success>"), buf);
+ EXPECT_SWPRINTF(L"<Success>", L"<%m>");
errno = -1;
- swprintf(buf, sizeof(buf), L"<%m>");
- ASSERT_EQ(std::wstring(L"<Unknown error -1>"), buf);
+ EXPECT_SWPRINTF(L"<Unknown error -1>", L"<%m>");
errno = EINVAL;
- swprintf(buf, sizeof(buf), L"<%m>");
- ASSERT_EQ(std::wstring(L"<Invalid argument>"), buf);
+ EXPECT_SWPRINTF(L"<Invalid argument>", L"<%m>");
}
-TEST(STDIO_TEST, wprintf_m_does_not_clobber_strerror) {
- wchar_t buf[BUFSIZ];
+TEST(STDIO_TEST, printf_m_does_not_clobber_strerror) {
const char* m = strerror(-1);
ASSERT_STREQ("Unknown error -1", m);
errno = -2;
- swprintf(buf, sizeof(buf), L"<%m>");
- ASSERT_EQ(std::wstring(L"<Unknown error -2>"), buf);
+ EXPECT_SNPRINTF("<Unknown error -2>", "<%m>");
+ ASSERT_STREQ("Unknown error -1", m);
+}
+
+TEST(STDIO_TEST, wprintf_m_does_not_clobber_strerror) {
+ const char* m = strerror(-1);
+ ASSERT_STREQ("Unknown error -1", m);
+ errno = -2;
+ EXPECT_SWPRINTF(L"<Unknown error -2>", L"<%m>");
ASSERT_STREQ("Unknown error -1", m);
}
@@ -3000,156 +3012,86 @@
#endif
}
-TEST(STDIO_TEST, snprintf_b) {
+TEST(STDIO_TEST, snprintf_b_B) {
#if defined(__BIONIC__)
- char buf[BUFSIZ];
-
uint8_t b = 5;
- EXPECT_EQ(5, snprintf(buf, sizeof(buf), "<%" PRIb8 ">", b));
- EXPECT_STREQ("<101>", buf);
- EXPECT_EQ(10, snprintf(buf, sizeof(buf), "<%08" PRIb8 ">", b));
- EXPECT_STREQ("<00000101>", buf);
+ EXPECT_SNPRINTF("<101>", "<%" PRIb8 ">", b);
+ EXPECT_SNPRINTF("<101>", "<%" PRIB8 ">", b);
+ EXPECT_SNPRINTF("<00000101>", "<%08" PRIb8 ">", b);
+ EXPECT_SNPRINTF("<00000101>", "<%08" PRIB8 ">", b);
uint16_t s = 0xaaaa;
- EXPECT_EQ(18, snprintf(buf, sizeof(buf), "<%" PRIb16 ">", s));
- EXPECT_STREQ("<1010101010101010>", buf);
- EXPECT_EQ(20, snprintf(buf, sizeof(buf), "<%#" PRIb16 ">", s));
- EXPECT_STREQ("<0b1010101010101010>", buf);
+ EXPECT_SNPRINTF("<1010101010101010>", "<%" PRIb16 ">", s);
+ EXPECT_SNPRINTF("<1010101010101010>", "<%" PRIB16 ">", s);
+ EXPECT_SNPRINTF("<0b1010101010101010>", "<%#" PRIb16 ">", s);
+ EXPECT_SNPRINTF("<0B1010101010101010>", "<%#" PRIB16 ">", s);
- EXPECT_EQ(34, snprintf(buf, sizeof(buf), "<%" PRIb32 ">", 0xaaaaaaaa));
- EXPECT_STREQ("<10101010101010101010101010101010>", buf);
- EXPECT_EQ(36, snprintf(buf, sizeof(buf), "<%#" PRIb32 ">", 0xaaaaaaaa));
- EXPECT_STREQ("<0b10101010101010101010101010101010>", buf);
+ EXPECT_SNPRINTF("<10101010101010101010101010101010>", "<%" PRIb32 ">", 0xaaaaaaaa);
+ EXPECT_SNPRINTF("<10101010101010101010101010101010>", "<%" PRIB32 ">", 0xaaaaaaaa);
+ EXPECT_SNPRINTF("<0b10101010101010101010101010101010>", "<%#" PRIb32 ">", 0xaaaaaaaa);
+ EXPECT_SNPRINTF("<0B10101010101010101010101010101010>", "<%#" PRIB32 ">", 0xaaaaaaaa);
// clang doesn't like "%lb" (https://github.com/llvm/llvm-project/issues/62247)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat"
- EXPECT_EQ(66, snprintf(buf, sizeof(buf), "<%" PRIb64 ">", 0xaaaaaaaa'aaaaaaaa));
- EXPECT_STREQ("<1010101010101010101010101010101010101010101010101010101010101010>", buf);
- EXPECT_EQ(68, snprintf(buf, sizeof(buf), "<%#" PRIb64 ">", 0xaaaaaaaa'aaaaaaaa));
- EXPECT_STREQ("<0b1010101010101010101010101010101010101010101010101010101010101010>", buf);
+ EXPECT_SNPRINTF("<1010101010101010101010101010101010101010101010101010101010101010>",
+ "<%" PRIb64 ">", 0xaaaaaaaa'aaaaaaaa);
+ EXPECT_SNPRINTF("<1010101010101010101010101010101010101010101010101010101010101010>",
+ "<%" PRIB64 ">", 0xaaaaaaaa'aaaaaaaa);
+ EXPECT_SNPRINTF("<0b1010101010101010101010101010101010101010101010101010101010101010>",
+ "<%#" PRIb64 ">", 0xaaaaaaaa'aaaaaaaa);
+ EXPECT_SNPRINTF("<0B1010101010101010101010101010101010101010101010101010101010101010>",
+ "<%#" PRIB64 ">", 0xaaaaaaaa'aaaaaaaa);
#pragma clang diagnostic pop
- EXPECT_EQ(3, snprintf(buf, sizeof(buf), "<%#b>", 0));
- EXPECT_STREQ("<0>", buf);
+ EXPECT_SNPRINTF("<0>", "<%#b>", 0);
+ EXPECT_SNPRINTF("<0>", "<%#B>", 0);
#else
GTEST_SKIP() << "no %b in glibc";
#endif
}
-TEST(STDIO_TEST, snprintf_B) {
+TEST(STDIO_TEST, swprintf_b_B) {
#if defined(__BIONIC__)
- char buf[BUFSIZ];
-
uint8_t b = 5;
- EXPECT_EQ(5, snprintf(buf, sizeof(buf), "<%" PRIB8 ">", b));
- EXPECT_STREQ("<101>", buf);
- EXPECT_EQ(10, snprintf(buf, sizeof(buf), "<%08" PRIB8 ">", b));
- EXPECT_STREQ("<00000101>", buf);
+ EXPECT_SWPRINTF(L"<101>", L"<%" PRIb8 ">", b);
+ EXPECT_SWPRINTF(L"<101>", L"<%" PRIB8 ">", b);
+ EXPECT_SWPRINTF(L"<0b101>", L"<%#" PRIb8 ">", b);
+ EXPECT_SWPRINTF(L"<0B101>", L"<%#" PRIB8 ">", b);
+ EXPECT_SWPRINTF(L"<00000101>", L"<%08" PRIb8 ">", b);
+ EXPECT_SWPRINTF(L"<00000101>", L"<%08" PRIB8 ">", b);
uint16_t s = 0xaaaa;
- EXPECT_EQ(18, snprintf(buf, sizeof(buf), "<%" PRIB16 ">", s));
- EXPECT_STREQ("<1010101010101010>", buf);
- EXPECT_EQ(20, snprintf(buf, sizeof(buf), "<%#" PRIB16 ">", s));
- EXPECT_STREQ("<0B1010101010101010>", buf);
+ EXPECT_SWPRINTF(L"<1010101010101010>", L"<%" PRIb16 ">", s);
+ EXPECT_SWPRINTF(L"<1010101010101010>", L"<%" PRIB16 ">", s);
+ EXPECT_SWPRINTF(L"<0b1010101010101010>", L"<%#" PRIb16 ">", s);
+ EXPECT_SWPRINTF(L"<0B1010101010101010>", L"<%#" PRIB16 ">", s);
- EXPECT_EQ(34, snprintf(buf, sizeof(buf), "<%" PRIB32 ">", 0xaaaaaaaa));
- EXPECT_STREQ("<10101010101010101010101010101010>", buf);
- EXPECT_EQ(36, snprintf(buf, sizeof(buf), "<%#" PRIB32 ">", 0xaaaaaaaa));
- EXPECT_STREQ("<0B10101010101010101010101010101010>", buf);
+ EXPECT_SWPRINTF(L"<10101010101010101010101010101010>", L"<%" PRIb32 ">", 0xaaaaaaaa);
+ EXPECT_SWPRINTF(L"<10101010101010101010101010101010>", L"<%" PRIB32 ">", 0xaaaaaaaa);
+ EXPECT_SWPRINTF(L"<0b10101010101010101010101010101010>", L"<%#" PRIb32 ">", 0xaaaaaaaa);
+ EXPECT_SWPRINTF(L"<0B10101010101010101010101010101010>", L"<%#" PRIB32 ">", 0xaaaaaaaa);
- // clang doesn't like "%lB" (https://github.com/llvm/llvm-project/issues/62247)
+ // clang doesn't like "%lb" (https://github.com/llvm/llvm-project/issues/62247)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat"
- EXPECT_EQ(66, snprintf(buf, sizeof(buf), "<%" PRIB64 ">", 0xaaaaaaaa'aaaaaaaa));
- EXPECT_STREQ("<1010101010101010101010101010101010101010101010101010101010101010>", buf);
- EXPECT_EQ(68, snprintf(buf, sizeof(buf), "<%#" PRIB64 ">", 0xaaaaaaaa'aaaaaaaa));
- EXPECT_STREQ("<0B1010101010101010101010101010101010101010101010101010101010101010>", buf);
+ EXPECT_SWPRINTF(L"<1010101010101010101010101010101010101010101010101010101010101010>",
+ L"<%" PRIb64 ">", 0xaaaaaaaa'aaaaaaaa);
+ EXPECT_SWPRINTF(L"<1010101010101010101010101010101010101010101010101010101010101010>",
+ L"<%" PRIB64 ">", 0xaaaaaaaa'aaaaaaaa);
+ EXPECT_SWPRINTF(L"<0b1010101010101010101010101010101010101010101010101010101010101010>",
+ L"<%#" PRIb64 ">", 0xaaaaaaaa'aaaaaaaa);
+ EXPECT_SWPRINTF(L"<0B1010101010101010101010101010101010101010101010101010101010101010>",
+ L"<%#" PRIB64 ">", 0xaaaaaaaa'aaaaaaaa);
#pragma clang diagnostic pop
- EXPECT_EQ(3, snprintf(buf, sizeof(buf), "<%#b>", 0));
- EXPECT_STREQ("<0>", buf);
-#else
- GTEST_SKIP() << "no %B in glibc";
-#endif
-}
-
-TEST(STDIO_TEST, swprintf_b) {
-#if defined(__BIONIC__)
- wchar_t buf[BUFSIZ];
-
- uint8_t b = 5;
- EXPECT_EQ(5, swprintf(buf, sizeof(buf), L"<%" PRIb8 ">", b));
- EXPECT_EQ(std::wstring(L"<101>"), buf);
- EXPECT_EQ(10, swprintf(buf, sizeof(buf), L"<%08" PRIb8 ">", b));
- EXPECT_EQ(std::wstring(L"<00000101>"), buf);
-
- uint16_t s = 0xaaaa;
- EXPECT_EQ(18, swprintf(buf, sizeof(buf), L"<%" PRIb16 ">", s));
- EXPECT_EQ(std::wstring(L"<1010101010101010>"), buf);
- EXPECT_EQ(20, swprintf(buf, sizeof(buf), L"<%#" PRIb16 ">", s));
- EXPECT_EQ(std::wstring(L"<0b1010101010101010>"), buf);
-
- EXPECT_EQ(34, swprintf(buf, sizeof(buf), L"<%" PRIb32 ">", 0xaaaaaaaa));
- EXPECT_EQ(std::wstring(L"<10101010101010101010101010101010>"), buf);
- EXPECT_EQ(36, swprintf(buf, sizeof(buf), L"<%#" PRIb32 ">", 0xaaaaaaaa));
- EXPECT_EQ(std::wstring(L"<0b10101010101010101010101010101010>"), buf);
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wformat" // clang doesn't like "%lb"
- EXPECT_EQ(66, swprintf(buf, sizeof(buf), L"<%" PRIb64 ">", 0xaaaaaaaa'aaaaaaaa));
- EXPECT_EQ(std::wstring(L"<1010101010101010101010101010101010101010101010101010101010101010>"),
- buf);
- EXPECT_EQ(68, swprintf(buf, sizeof(buf), L"<%#" PRIb64 ">", 0xaaaaaaaa'aaaaaaaa));
- EXPECT_EQ(std::wstring(L"<0b1010101010101010101010101010101010101010101010101010101010101010>"),
- buf);
-#pragma clang diagnostic pop
-
- EXPECT_EQ(3, swprintf(buf, sizeof(buf), L"<%#b>", 0));
- EXPECT_EQ(std::wstring(L"<0>"), buf);
+ EXPECT_SWPRINTF(L"<0>", L"<%#b>", 0);
+ EXPECT_SWPRINTF(L"<0>", L"<%#B>", 0);
#else
GTEST_SKIP() << "no %b in glibc";
#endif
}
-TEST(STDIO_TEST, swprintf_B) {
-#if defined(__BIONIC__)
- wchar_t buf[BUFSIZ];
-
- uint8_t b = 5;
- EXPECT_EQ(5, swprintf(buf, sizeof(buf), L"<%" PRIB8 ">", b));
- EXPECT_EQ(std::wstring(L"<101>"), buf);
- EXPECT_EQ(10, swprintf(buf, sizeof(buf), L"<%08" PRIB8 ">", b));
- EXPECT_EQ(std::wstring(L"<00000101>"), buf);
-
- uint16_t s = 0xaaaa;
- EXPECT_EQ(18, swprintf(buf, sizeof(buf), L"<%" PRIB16 ">", s));
- EXPECT_EQ(std::wstring(L"<1010101010101010>"), buf);
- EXPECT_EQ(20, swprintf(buf, sizeof(buf), L"<%#" PRIB16 ">", s));
- EXPECT_EQ(std::wstring(L"<0B1010101010101010>"), buf);
-
- EXPECT_EQ(34, swprintf(buf, sizeof(buf), L"<%" PRIB32 ">", 0xaaaaaaaa));
- EXPECT_EQ(std::wstring(L"<10101010101010101010101010101010>"), buf);
- EXPECT_EQ(36, swprintf(buf, sizeof(buf), L"<%#" PRIB32 ">", 0xaaaaaaaa));
- EXPECT_EQ(std::wstring(L"<0B10101010101010101010101010101010>"), buf);
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wformat" // clang doesn't like "%lb"
- EXPECT_EQ(66, swprintf(buf, sizeof(buf), L"<%" PRIB64 ">", 0xaaaaaaaa'aaaaaaaa));
- EXPECT_EQ(std::wstring(L"<1010101010101010101010101010101010101010101010101010101010101010>"),
- buf);
- EXPECT_EQ(68, swprintf(buf, sizeof(buf), L"<%#" PRIB64 ">", 0xaaaaaaaa'aaaaaaaa));
- EXPECT_EQ(std::wstring(L"<0B1010101010101010101010101010101010101010101010101010101010101010>"),
- buf);
-#pragma clang diagnostic pop
-
- EXPECT_EQ(3, swprintf(buf, sizeof(buf), L"<%#B>", 0));
- EXPECT_EQ(std::wstring(L"<0>"), buf);
-#else
- GTEST_SKIP() << "no %B in glibc";
-#endif
-}
-
TEST(STDIO_TEST, scanf_i_decimal) {
int i;
EXPECT_EQ(1, sscanf("<123789>", "<%i>", &i));
@@ -3281,30 +3223,47 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
#pragma clang diagnostic ignored "-Wconstant-conversion"
- char buf[BUFSIZ];
int8_t a = 0b101;
- snprintf(buf, sizeof(buf), "<%w8b>", a);
- EXPECT_STREQ("<101>", buf);
+ EXPECT_SNPRINTF("<101>", "<%w8b>", a);
int8_t b1 = 0xFF;
- snprintf(buf, sizeof(buf), "<%w8d>", b1);
- EXPECT_STREQ("<-1>", buf);
+ EXPECT_SNPRINTF("<-1>", "<%w8d>", b1);
int8_t b2 = 0x1FF;
- snprintf(buf, sizeof(buf), "<%w8d>", b2);
- EXPECT_STREQ("<-1>", buf);
+ EXPECT_SNPRINTF("<-1>", "<%w8d>", b2);
int16_t c = 0xFFFF;
- snprintf(buf, sizeof(buf), "<%w16i>", c);
- EXPECT_STREQ("<-1>", buf);
+ EXPECT_SNPRINTF("<-1>", "<%w16i>", c);
int32_t d = 021;
- snprintf(buf, sizeof(buf), "<%w32o>", d);
- EXPECT_STREQ("<21>", buf);
+ EXPECT_SNPRINTF("<21>", "<%w32o>", d);
uint32_t e = -1;
- snprintf(buf, sizeof(buf), "<%w32u>", e);
- EXPECT_STREQ("<4294967295>", buf);
+ EXPECT_SNPRINTF("<4294967295>", "<%w32u>", e);
int64_t f = 0x3b;
- snprintf(buf, sizeof(buf), "<%w64x>", f);
- EXPECT_STREQ("<3b>", buf);
- snprintf(buf, sizeof(buf), "<%w64X>", f);
- EXPECT_STREQ("<3B>", buf);
+ EXPECT_SNPRINTF("<3b>", "<%w64x>", f);
+ EXPECT_SNPRINTF("<3B>", "<%w64X>", f);
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %w in glibc";
+#endif
+}
+
+TEST(STDIO_TEST, swprintf_w_base) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+#pragma clang diagnostic ignored "-Wconstant-conversion"
+ int8_t a = 0b101;
+ EXPECT_SWPRINTF(L"<101>", L"<%w8b>", a);
+ int8_t b1 = 0xFF;
+ EXPECT_SWPRINTF(L"<-1>", L"<%w8d>", b1);
+ int8_t b2 = 0x1FF;
+ EXPECT_SWPRINTF(L"<-1>", L"<%w8d>", b2);
+ int16_t c = 0xFFFF;
+ EXPECT_SWPRINTF(L"<-1>", L"<%w16i>", c);
+ int32_t d = 021;
+ EXPECT_SWPRINTF(L"<21>", L"<%w32o>", d);
+ uint32_t e = -1;
+ EXPECT_SWPRINTF(L"<4294967295>", L"<%w32u>", e);
+ int64_t f = 0x3b;
+ EXPECT_SWPRINTF(L"<3b>", L"<%w64x>", f);
+ EXPECT_SWPRINTF(L"<3B>", L"<%w64X>", f);
#pragma clang diagnostic pop
#else
GTEST_SKIP() << "no %w in glibc";
@@ -3316,25 +3275,44 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
#pragma clang diagnostic ignored "-Wformat-extra-args"
- char buf[BUFSIZ];
int32_t a = 0xaaaaaaaa;
int64_t b = 0x11111111'22222222;
int64_t c = 0x33333333'44444444;
int64_t d = 0xaaaaaaaa'aaaaaaaa;
- snprintf(buf, sizeof(buf), "<%2$w32b --- %1$w64x>", c, a);
- EXPECT_STREQ("<10101010101010101010101010101010 --- 3333333344444444>", buf);
- snprintf(buf, sizeof(buf), "<%3$w64b --- %1$w64x --- %2$w64x>", b, c, d);
- EXPECT_STREQ(
+ EXPECT_SNPRINTF("<10101010101010101010101010101010 --- 3333333344444444>",
+ "<%2$w32b --- %1$w64x>", c, a);
+ EXPECT_SNPRINTF(
"<1010101010101010101010101010101010101010101010101010101010101010 --- 1111111122222222 --- "
"3333333344444444>",
- buf);
+ "<%3$w64b --- %1$w64x --- %2$w64x>", b, c, d);
#pragma clang diagnostic pop
#else
GTEST_SKIP() << "no %w in glibc";
#endif
}
-TEST(STDIO_TEST, snprintf_invalid_w_width) {
+TEST(STDIO_TEST, swprintf_w_arguments_reordering) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+#pragma clang diagnostic ignored "-Wformat-extra-args"
+ int32_t a = 0xaaaaaaaa;
+ int64_t b = 0x11111111'22222222;
+ int64_t c = 0x33333333'44444444;
+ int64_t d = 0xaaaaaaaa'aaaaaaaa;
+ EXPECT_SWPRINTF(L"<10101010101010101010101010101010 --- 3333333344444444>",
+ L"<%2$w32b --- %1$w64x>", c, a);
+ EXPECT_SWPRINTF(
+ L"<1010101010101010101010101010101010101010101010101010101010101010 --- 1111111122222222 --- "
+ L"3333333344444444>",
+ L"<%3$w64b --- %1$w64x --- %2$w64x>", b, c, d);
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %w in glibc";
+#endif
+}
+
+TEST_F(STDIO_DEATHTEST, snprintf_invalid_w_width) {
#if defined(__BIONIC__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
@@ -3347,64 +3325,7 @@
#endif
}
-TEST(STDIO_TEST, swprintf_w_base) {
-#if defined(__BIONIC__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
-#pragma clang diagnostic ignored "-Wconstant-conversion"
- wchar_t buf[BUFSIZ];
- int8_t a = 0b101;
- swprintf(buf, sizeof(buf), L"<%w8b>", a);
- EXPECT_EQ(std::wstring(L"<101>"), buf);
- int8_t b1 = 0xFF;
- swprintf(buf, sizeof(buf), L"<%w8d>", b1);
- EXPECT_EQ(std::wstring(L"<-1>"), buf);
- int8_t b2 = 0x1FF;
- swprintf(buf, sizeof(buf), L"<%w8d>", b2);
- EXPECT_EQ(std::wstring(L"<-1>"), buf);
- int16_t c = 0xFFFF;
- swprintf(buf, sizeof(buf), L"<%w16i>", c);
- EXPECT_EQ(std::wstring(L"<-1>"), buf);
- int32_t d = 021;
- swprintf(buf, sizeof(buf), L"<%w32o>", d);
- EXPECT_EQ(std::wstring(L"<21>"), buf);
- uint32_t e = -1;
- swprintf(buf, sizeof(buf), L"<%w32u>", e);
- EXPECT_EQ(std::wstring(L"<4294967295>"), buf);
- int64_t f = 0x3b;
- swprintf(buf, sizeof(buf), L"<%w64x>", f);
- EXPECT_EQ(std::wstring(L"<3b>"), buf);
- swprintf(buf, sizeof(buf), L"<%w64X>", f);
- EXPECT_EQ(std::wstring(L"<3B>"), buf);
-#pragma clang diagnostic pop
-#else
- GTEST_SKIP() << "no %w in glibc";
-#endif
-}
-
-TEST(STDIO_TEST, swprintf_w_arguments_reordering) {
-#if defined(__BIONIC__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
-#pragma clang diagnostic ignored "-Wformat-extra-args"
- wchar_t buf[BUFSIZ];
- int32_t a = 0xaaaaaaaa;
- int64_t b = 0x11111111'22222222;
- int64_t c = 0x33333333'44444444;
- int64_t d = 0xaaaaaaaa'aaaaaaaa;
- swprintf(buf, sizeof(buf), L"<%2$w32b --- %1$w64x>", c, a);
- EXPECT_EQ(std::wstring(L"<10101010101010101010101010101010 --- 3333333344444444>"), buf);
- swprintf(buf, sizeof(buf), L"<%3$w64b --- %1$w64x --- %2$w64x>", b, c, d);
- EXPECT_EQ(std::wstring(L"<1010101010101010101010101010101010101010101010101010101010101010 --- "
- L"1111111122222222 --- 3333333344444444>"),
- buf);
-#pragma clang diagnostic pop
-#else
- GTEST_SKIP() << "no %w in glibc";
-#endif
-}
-
-TEST(STDIO_TEST, swprintf_invalid_w_width) {
+TEST_F(STDIO_DEATHTEST, swprintf_invalid_w_width) {
#if defined(__BIONIC__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
@@ -3423,34 +3344,55 @@
#pragma clang diagnostic ignored "-Wconstant-conversion"
#pragma clang diagnostic ignored "-Wformat"
#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
- char buf[BUFSIZ];
int_fast8_t a = 0b101;
- snprintf(buf, sizeof(buf), "<%wf8b>", a);
- EXPECT_STREQ("<101>", buf);
+ EXPECT_SNPRINTF("<101>", "<%wf8b>", a);
int_fast8_t b = 0x12341234'12341234;
- snprintf(buf, sizeof(buf), "<%wf8x>", b);
- EXPECT_STREQ("<34>", buf);
+ EXPECT_SNPRINTF("<34>", "<%wf8x>", b);
uint_fast16_t c = 0x11111111'22222222;
#if defined(__LP64__)
- snprintf(buf, sizeof(buf), "<%wf16x>", c);
- EXPECT_STREQ("<1111111122222222>", buf);
+ EXPECT_SNPRINTF("<1111111122222222>", "<%wf16x>", c);
#else
- snprintf(buf, sizeof(buf), "<%wf16x>", c);
- EXPECT_STREQ("<22222222>", buf);
+ EXPECT_SNPRINTF("<22222222>", "<%wf16x>", c);
#endif
int_fast32_t d = 0x33333333'44444444;
#if defined(__LP64__)
- snprintf(buf, sizeof(buf), "<%wf32x>", d);
- EXPECT_STREQ("<3333333344444444>", buf);
+ EXPECT_SNPRINTF("<3333333344444444>", "<%wf32x>", d);
#else
- snprintf(buf, sizeof(buf), "<%wf32x>", d);
- EXPECT_STREQ("<44444444>", buf);
+ EXPECT_SNPRINTF("<44444444>", "<%wf32x>", d);
#endif
int_fast64_t e = 0xaaaaaaaa'aaaaaaaa;
- snprintf(buf, sizeof(buf), "<%wf64x>", e);
- EXPECT_STREQ("<aaaaaaaaaaaaaaaa>", buf);
- snprintf(buf, sizeof(buf), "<%wf64X>", e);
- EXPECT_STREQ("<AAAAAAAAAAAAAAAA>", buf);
+ EXPECT_SNPRINTF("<aaaaaaaaaaaaaaaa>", "<%wf64x>", e);
+ EXPECT_SNPRINTF("<AAAAAAAAAAAAAAAA>", "<%wf64X>", e);
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %wf in glibc";
+#endif
+}
+TEST(STDIO_TEST, swprintf_wf_base) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wconstant-conversion"
+#pragma clang diagnostic ignored "-Wformat"
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+ int_fast8_t a = 0b101;
+ EXPECT_SWPRINTF(L"<101>", L"<%wf8b>", a);
+ int_fast8_t b = 0x12341234'12341234;
+ EXPECT_SWPRINTF(L"<34>", L"<%wf8x>", b);
+ uint_fast16_t c = 0x11111111'22222222;
+#if defined(__LP64__)
+ EXPECT_SWPRINTF(L"<1111111122222222>", L"<%wf16x>", c);
+#else
+ EXPECT_SWPRINTF(L"<22222222>", L"<%wf16x>", c);
+#endif
+ int_fast32_t d = 0x33333333'44444444;
+#if defined(__LP64__)
+ EXPECT_SWPRINTF(L"<3333333344444444>", L"<%wf32x>", d);
+#else
+ EXPECT_SWPRINTF(L"<44444444>", L"<%wf32x>", d);
+#endif
+ int_fast64_t e = 0xaaaaaaaa'aaaaaaaa;
+ EXPECT_SWPRINTF(L"<aaaaaaaaaaaaaaaa>", L"<%wf64x>", e);
+ EXPECT_SWPRINTF(L"<AAAAAAAAAAAAAAAA>", L"<%wf64X>", e);
#pragma clang diagnostic pop
#else
GTEST_SKIP() << "no %wf in glibc";
@@ -3464,25 +3406,23 @@
#pragma clang diagnostic ignored "-Wformat"
#pragma clang diagnostic ignored "-Wformat-extra-args"
#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
- char buf[BUFSIZ];
int_fast16_t a = 0x11111111'22222222;
int_fast32_t b = 0x33333333'44444444;
int_fast32_t c = 0xaaaaaaaa'aaaaaaaa;
#if defined(__LP64__)
- snprintf(buf, sizeof(buf), "<%2$wf32x --- %1$wf32b>", c, b);
- EXPECT_STREQ(
+ EXPECT_SNPRINTF(
"<3333333344444444 --- 1010101010101010101010101010101010101010101010101010101010101010>",
- buf);
- snprintf(buf, sizeof(buf), "<%3$wf32b --- %1$wf16x --- %2$wf32x>", a, b, c);
- EXPECT_STREQ(
+ "<%2$wf32x --- %1$wf32b>", c, b);
+
+ EXPECT_SNPRINTF(
"<1010101010101010101010101010101010101010101010101010101010101010 --- 1111111122222222 --- "
"3333333344444444>",
- buf);
+ "<%3$wf32b --- %1$wf16x --- %2$wf32x>", a, b, c);
#else
- snprintf(buf, sizeof(buf), "<%2$wf32x --- %1$wf32b>", c, b);
- EXPECT_STREQ("<44444444 --- 10101010101010101010101010101010>", buf);
- snprintf(buf, sizeof(buf), "<%3$wf32b --- %1$wf16x --- %2$wf32x>", a, b, c);
- EXPECT_STREQ("<10101010101010101010101010101010 --- 22222222 --- 44444444>", buf);
+ EXPECT_SNPRINTF("<44444444 --- 10101010101010101010101010101010>", "<%2$wf32x --- %1$wf32b>", c,
+ b);
+ EXPECT_SNPRINTF("<10101010101010101010101010101010 --- 22222222 --- 44444444>",
+ "<%3$wf32b --- %1$wf16x --- %2$wf32x>", a, b, c);
#endif
#pragma clang diagnostic pop
#else
@@ -3490,7 +3430,38 @@
#endif
}
-TEST(STDIO_TEST, snprintf_invalid_wf_width) {
+TEST(STDIO_TEST, swprintf_wf_arguments_reordering) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wconstant-conversion"
+#pragma clang diagnostic ignored "-Wformat"
+#pragma clang diagnostic ignored "-Wformat-extra-args"
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+ int_fast16_t a = 0x11111111'22222222;
+ int_fast32_t b = 0x33333333'44444444;
+ int_fast32_t c = 0xaaaaaaaa'aaaaaaaa;
+#if defined(__LP64__)
+ EXPECT_SWPRINTF(
+ L"<3333333344444444 --- 1010101010101010101010101010101010101010101010101010101010101010>",
+ L"<%2$wf32x --- %1$wf32b>", c, b);
+
+ EXPECT_SWPRINTF(
+ L"<1010101010101010101010101010101010101010101010101010101010101010 --- 1111111122222222 --- "
+ L"3333333344444444>",
+ L"<%3$wf32b --- %1$wf16x --- %2$wf32x>", a, b, c);
+#else
+ EXPECT_SWPRINTF(L"<44444444 --- 10101010101010101010101010101010>", L"<%2$wf32x --- %1$wf32b>", c,
+ b);
+ EXPECT_SWPRINTF(L"<10101010101010101010101010101010 --- 22222222 --- 44444444>",
+ L"<%3$wf32b --- %1$wf16x --- %2$wf32x>", a, b, c);
+#endif
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %w in glibc";
+#endif
+}
+
+TEST_F(STDIO_DEATHTEST, snprintf_invalid_wf_width) {
#if defined(__BIONIC__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat"
@@ -3504,77 +3475,10 @@
#endif
}
-TEST(STDIO_TEST, swprintf_wf_base) {
+TEST_F(STDIO_DEATHTEST, swprintf_invalid_wf_width) {
#if defined(__BIONIC__)
#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
-#pragma clang diagnostic ignored "-Wconstant-conversion"
- wchar_t buf[BUFSIZ];
- int_fast8_t a = 0b101;
- swprintf(buf, sizeof(buf), L"<%wf8b>", a);
- EXPECT_EQ(std::wstring(L"<101>"), buf);
- int_fast8_t b = 0x12341234'12341234;
- swprintf(buf, sizeof(buf), L"<%wf8x>", b);
- EXPECT_EQ(std::wstring(L"<34>"), buf);
- uint_fast16_t c = 0x11111111'22222222;
-#if defined(__LP64__)
- swprintf(buf, sizeof(buf), L"<%wf16x>", c);
- EXPECT_EQ(std::wstring(L"<1111111122222222>"), buf);
-#else
- swprintf(buf, sizeof(buf), L"<%wf16x>", c);
- EXPECT_EQ(std::wstring(L"<22222222>"), buf);
-#endif
- int_fast32_t d = 0x33333333'44444444;
-#if defined(__LP64__)
- swprintf(buf, sizeof(buf), L"<%wf32x>", d);
- EXPECT_EQ(std::wstring(L"<3333333344444444>"), buf);
-#else
- swprintf(buf, sizeof(buf), L"<%wf32x>", d);
- EXPECT_EQ(std::wstring(L"<44444444>"), buf);
-#endif
- int_fast64_t e = 0xaaaaaaaa'aaaaaaaa;
- swprintf(buf, sizeof(buf), L"<%wf64x>", e);
- EXPECT_EQ(std::wstring(L"<aaaaaaaaaaaaaaaa>"), buf);
- swprintf(buf, sizeof(buf), L"<%wf64X>", e);
- EXPECT_EQ(std::wstring(L"<AAAAAAAAAAAAAAAA>"), buf);
-#else
- GTEST_SKIP() << "no %w in glibc";
-#endif
-}
-
-TEST(STDIO_TEST, swprintf_wf_arguments_reordering) {
-#if defined(__BIONIC__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
-#pragma clang diagnostic ignored "-Wformat-extra-args"
- wchar_t buf[BUFSIZ];
- int_fast16_t a = 0x11111111'22222222;
- int_fast32_t b = 0x33333333'44444444;
- int_fast32_t c = 0xaaaaaaaa'aaaaaaaa;
-#if defined(__LP64__)
- swprintf(buf, sizeof(buf), L"<%2$wf32x --- %1$wf32b>", c, b);
- EXPECT_EQ(std::wstring(L"<3333333344444444 --- "
- L"1010101010101010101010101010101010101010101010101010101010101010>"),
- buf);
- swprintf(buf, sizeof(buf), L"<%3$wf32b --- %1$wf16x --- %2$wf32x>", a, b, c);
- EXPECT_EQ(std::wstring(L"<1010101010101010101010101010101010101010101010101010101010101010 --- "
- L"1111111122222222 --- 3333333344444444>"),
- buf);
-#else
- swprintf(buf, sizeof(buf), L"<%2$wf32x --- %1$wf32b>", c, b);
- EXPECT_EQ(std::wstring(L"<44444444 --- 10101010101010101010101010101010>"), buf);
- swprintf(buf, sizeof(buf), L"<%3$wf32b --- %1$wf16x --- %2$wf32x>", a, b, c);
- EXPECT_EQ(std::wstring(L"<10101010101010101010101010101010 --- 22222222 --- 44444444>"), buf);
-#endif
-#pragma clang diagnostic pop
-#else
- GTEST_SKIP() << "no %w in glibc";
-#endif
-}
-
-TEST(STDIO_TEST, swprintf_invalid_wf_width) {
-#if defined(__BIONIC__)
-#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat"
#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
wchar_t buf[BUFSIZ];
int_fast32_t a = 100;
@@ -3583,4 +3487,211 @@
#else
GTEST_SKIP() << "no %w in glibc";
#endif
-}
\ No newline at end of file
+}
+
+TEST(STDIO_TEST, sscanf_w_or_wf_base) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat"
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+ int8_t a;
+ EXPECT_EQ(1, sscanf("<0b101>", "<%w8b>", &a));
+ EXPECT_EQ(0b101, a);
+ int_fast8_t fast_a;
+ EXPECT_EQ(1, sscanf("<0b101>", "<%wf8b>", &fast_a));
+ EXPECT_EQ(0b101, fast_a);
+ int8_t b1;
+ EXPECT_EQ(1, sscanf("<0xFF>", "<%w8i>", &b1));
+ EXPECT_EQ(-1, b1);
+ int8_t b2;
+ EXPECT_EQ(1, sscanf("<0x1FF>", "<%w8i>", &b2));
+ EXPECT_EQ(-1, b2);
+ int_fast8_t fast_b;
+ EXPECT_EQ(1, sscanf("<0x1234123412341234>", "<%wf8x>", &fast_b));
+ EXPECT_EQ(0x34, fast_b);
+ int16_t c1;
+ EXPECT_EQ(1, sscanf("<0xFFFF>", "<%w16i>", &c1));
+ EXPECT_EQ(-1, c1);
+ uint16_t c2;
+ EXPECT_EQ(1, sscanf("<64>", "<%w16d>", &c2));
+ EXPECT_EQ(64, c2);
+ int_fast16_t fast_c;
+#if defined(__LP64__)
+ EXPECT_EQ(1, sscanf("<0x1111111122222222>", "<%wf16x>", &fast_c));
+ EXPECT_EQ(0x1111111122222222, fast_c);
+#else
+ EXPECT_EQ(1, sscanf("<0x1111111122222222>", "<%wf16x>", &fast_c));
+ EXPECT_EQ(0x22222222, fast_c);
+#endif
+ int32_t d;
+ EXPECT_EQ(1, sscanf("<021>", "<%w32o>", &d));
+ EXPECT_EQ(021, d);
+ int_fast32_t fast_d;
+#if defined(__LP64__)
+ EXPECT_EQ(1, sscanf("<0x3333333344444444>", "<%wf32x>", &fast_d));
+ EXPECT_EQ(0x3333333344444444, fast_d);
+#else
+ EXPECT_EQ(1, sscanf("<0x3333333344444444>", "<%wf32x>", &fast_d));
+ EXPECT_EQ(0x44444444, fast_d);
+#endif
+ uint32_t e;
+ EXPECT_EQ(1, sscanf("<-1>", "<%w32u>", &e));
+ EXPECT_EQ(4294967295, e);
+ int64_t f;
+ EXPECT_EQ(1, sscanf("<0x3b>", "<%w64x>", &f));
+ EXPECT_EQ(0x3b, f);
+ EXPECT_EQ(1, sscanf("<0x3b>", "<%w64X>", &f));
+ EXPECT_EQ(0x3B, f);
+ uint_fast64_t fast_f;
+ EXPECT_EQ(1, sscanf("<0xaaaaaaaa>", "<%wf64x>", &fast_f));
+ EXPECT_EQ(0xaaaaaaaa, fast_f);
+ EXPECT_EQ(1, sscanf("<0xaaaaaaaa>", "<%wf64X>", &fast_f));
+ EXPECT_EQ(0xAAAAAAAA, fast_f);
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %w in glibc";
+#endif
+}
+
+TEST(STDIO_TEST, sscanf_w_combination) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat"
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+#pragma clang diagnostic ignored "-Wformat-extra-args"
+ uint32_t a;
+ int64_t b;
+ char c;
+
+ EXPECT_EQ(3, sscanf("<0b10101010101010101010101010101010 0x3333333344444444 1>",
+ "<%w32b %w64x %c>", &a, &b, &c));
+ EXPECT_EQ(0xaaaaaaaa, a);
+ EXPECT_EQ(0x3333333344444444, b);
+ EXPECT_EQ('1', c);
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %w in glibc";
+#endif
+}
+
+TEST_F(STDIO_DEATHTEST, sscanf_invalid_w_or_wf_width) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat"
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+ int32_t a;
+ EXPECT_DEATH(sscanf("<100>", "<%w20d>", &a), "%w20 is unsupported");
+ int_fast32_t fast_a;
+ EXPECT_DEATH(sscanf("<100>", "<%wf20d>", &fast_a), "%wf20 is unsupported");
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %w in glibc";
+#endif
+}
+
+TEST(STDIO_TEST, swscanf_w_or_wf_base) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat"
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+ int8_t a;
+ EXPECT_EQ(1, swscanf(L"<0b101>", L"<%w8b>", &a));
+ EXPECT_EQ(0b101, a);
+ int_fast8_t fast_a;
+ EXPECT_EQ(1, swscanf(L"<0b101>", L"<%wf8b>", &fast_a));
+ EXPECT_EQ(0b101, fast_a);
+ int8_t b1;
+ EXPECT_EQ(1, swscanf(L"<0xFF>", L"<%w8i>", &b1));
+ EXPECT_EQ(-1, b1);
+ int8_t b2;
+ EXPECT_EQ(1, swscanf(L"<0x1FF>", L"<%w8i>", &b2));
+ EXPECT_EQ(-1, b2);
+ int_fast8_t fast_b;
+ EXPECT_EQ(1, swscanf(L"<0x1234123412341234>", L"<%wf8i>", &fast_b));
+ EXPECT_EQ(0x34, fast_b);
+ int16_t c1;
+ EXPECT_EQ(1, swscanf(L"<0xFFFF>", L"<%w16i>", &c1));
+ EXPECT_EQ(-1, c1);
+ uint16_t c2;
+ EXPECT_EQ(1, swscanf(L"<64>", L"<%w16d>", &c2));
+ EXPECT_EQ(64, c2);
+ int_fast16_t fast_c;
+#if defined(__LP64__)
+ EXPECT_EQ(1, swscanf(L"<0x1111111122222222>", L"<%wf16x>", &fast_c));
+ EXPECT_EQ(0x1111111122222222, fast_c);
+#else
+ EXPECT_EQ(1, swscanf(L"<0x1111111122222222>", L"<%wf16x>", &fast_c));
+ EXPECT_EQ(0x22222222, fast_c);
+#endif
+ int32_t d;
+ EXPECT_EQ(1, swscanf(L"<021>", L"<%w32o>", &d));
+ EXPECT_EQ(021, d);
+ int_fast32_t fast_d;
+#if defined(__LP64__)
+ EXPECT_EQ(1, swscanf(L"<0x3333333344444444>", L"<%wf32x>", &fast_d));
+ EXPECT_EQ(0x3333333344444444, fast_d);
+#else
+ EXPECT_EQ(1, swscanf(L"<0x3333333344444444>", L"<%wf32x>", &fast_d));
+ EXPECT_EQ(0x44444444, fast_d);
+#endif
+ uint32_t e;
+ EXPECT_EQ(1, swscanf(L"<-1>", L"<%w32u>", &e));
+ EXPECT_EQ(4294967295, e);
+ int64_t f;
+ EXPECT_EQ(1, swscanf(L"<0x3b>", L"<%w64x>", &f));
+ EXPECT_EQ(0x3b, f);
+ EXPECT_EQ(1, swscanf(L"<0x3b>", L"<%w64X>", &f));
+ EXPECT_EQ(0x3B, f);
+ uint_fast64_t fast_f;
+ EXPECT_EQ(1, swscanf(L"<0xaaaaaaaa>", L"<%wf64x>", &fast_f));
+ EXPECT_EQ(0xaaaaaaaa, fast_f);
+ EXPECT_EQ(1, swscanf(L"<0xaaaaaaaa>", L"<%wf64X>", &fast_f));
+ EXPECT_EQ(0xAAAAAAAA, fast_f);
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %w in glibc";
+#endif
+}
+
+TEST(STDIO_TEST, swscanf_w_combination) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat"
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+#pragma clang diagnostic ignored "-Wformat-extra-args"
+ uint32_t a;
+ int64_t b;
+ char c;
+
+ EXPECT_EQ(3, swscanf(L"<0b10101010101010101010101010101010 0x3333333344444444 1>",
+ L"<%w32b %w64x %c>", &a, &b, &c));
+ EXPECT_EQ(0xaaaaaaaa, a);
+ EXPECT_EQ(0x3333333344444444, b);
+ EXPECT_EQ('1', c);
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %w in glibc";
+#endif
+}
+
+TEST_F(STDIO_DEATHTEST, swscanf_invalid_w_or_wf_width) {
+#if defined(__BIONIC__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat"
+#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
+ int32_t a;
+ EXPECT_DEATH(swscanf(L"<100>", L"<%w20d>", &a), "%w20 is unsupported");
+ int_fast32_t fast_a;
+ EXPECT_DEATH(swscanf(L"<100>", L"<%wf20d>", &fast_a), "%wf20 is unsupported");
+#pragma clang diagnostic pop
+#else
+ GTEST_SKIP() << "no %w in glibc";
+#endif
+}
+
+TEST(STDIO_TEST, printf_lc_0) {
+ // https://austingroupbugs.net/view.php?id=1647
+ char buf[BUFSIZ];
+ EXPECT_EQ(3, snprintf(buf, sizeof(buf), "<%lc>", L'\0'));
+ EXPECT_TRUE(!memcmp(buf, "<\0>", 3));
+}
diff --git a/tests/struct_layout_test.cpp b/tests/struct_layout_test.cpp
index 10c100a..0123ed9 100644
--- a/tests/struct_layout_test.cpp
+++ b/tests/struct_layout_test.cpp
@@ -30,7 +30,7 @@
#define CHECK_OFFSET(name, field, offset) \
check_offset(#name, #field, offsetof(name, field), offset);
#ifdef __LP64__
- CHECK_SIZE(pthread_internal_t, 784);
+ CHECK_SIZE(pthread_internal_t, 776);
CHECK_OFFSET(pthread_internal_t, next, 0);
CHECK_OFFSET(pthread_internal_t, prev, 8);
CHECK_OFFSET(pthread_internal_t, tid, 16);
@@ -55,7 +55,6 @@
CHECK_OFFSET(pthread_internal_t, dlerror_buffer, 248);
CHECK_OFFSET(pthread_internal_t, bionic_tls, 760);
CHECK_OFFSET(pthread_internal_t, errno_value, 768);
- CHECK_OFFSET(pthread_internal_t, vfork_child_stack_bottom, 776);
CHECK_SIZE(bionic_tls, 12200);
CHECK_OFFSET(bionic_tls, key_data, 0);
CHECK_OFFSET(bionic_tls, locale, 2080);
@@ -73,7 +72,7 @@
CHECK_OFFSET(bionic_tls, bionic_systrace_disabled, 12193);
CHECK_OFFSET(bionic_tls, padding, 12194);
#else
- CHECK_SIZE(pthread_internal_t, 672);
+ CHECK_SIZE(pthread_internal_t, 668);
CHECK_OFFSET(pthread_internal_t, next, 0);
CHECK_OFFSET(pthread_internal_t, prev, 4);
CHECK_OFFSET(pthread_internal_t, tid, 8);
@@ -98,7 +97,6 @@
CHECK_OFFSET(pthread_internal_t, dlerror_buffer, 148);
CHECK_OFFSET(pthread_internal_t, bionic_tls, 660);
CHECK_OFFSET(pthread_internal_t, errno_value, 664);
- CHECK_OFFSET(pthread_internal_t, vfork_child_stack_bottom, 668);
CHECK_SIZE(bionic_tls, 11080);
CHECK_OFFSET(bionic_tls, key_data, 0);
CHECK_OFFSET(bionic_tls, locale, 1040);
diff --git a/tests/sys_cachectl_test.cpp b/tests/sys_cachectl_test.cpp
new file mode 100644
index 0000000..d9ece4f
--- /dev/null
+++ b/tests/sys_cachectl_test.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2023 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 <gtest/gtest.h>
+
+#if __has_include(<sys/cachectl.h>)
+#include <sys/cachectl.h>
+#endif
+
+TEST(sys_cachectl, __riscv_flush_icache) {
+#if defined(__riscv) && __has_include(<sys/cachectl.h>)
+ // As of Linux 6.4, the address range is ignored (so nullptr is fine),
+ // and the flags you actually want are 0 ("all threads"),
+ // but we test the unusual flag just to make sure it works.
+ ASSERT_EQ(0, __riscv_flush_icache(nullptr, nullptr, SYS_RISCV_FLUSH_ICACHE_LOCAL));
+#else
+ GTEST_SKIP() << "__riscv_flush_icache requires riscv64";
+#endif
+}
diff --git a/tests/sys_epoll_test.cpp b/tests/sys_epoll_test.cpp
index fb2a48f..8dee93f 100644
--- a/tests/sys_epoll_test.cpp
+++ b/tests/sys_epoll_test.cpp
@@ -24,29 +24,101 @@
#include "utils.h"
-TEST(sys_epoll, smoke) {
+TEST(sys_epoll, epoll_wait) {
int epoll_fd = epoll_create(1);
- ASSERT_NE(-1, epoll_fd) << strerror(errno);
- epoll_event events[1];
+ ASSERT_NE(-1, epoll_fd);
// Regular epoll_wait.
+ epoll_event events[1] = {};
ASSERT_EQ(0, epoll_wait(epoll_fd, events, 1, 1));
+}
+
+TEST(sys_epoll, epoll_pwait_no_sigset) {
+ int epoll_fd = epoll_create(1);
+ ASSERT_NE(-1, epoll_fd);
// epoll_pwait without a sigset (which is equivalent to epoll_wait).
+ epoll_event events[1] = {};
ASSERT_EQ(0, epoll_pwait(epoll_fd, events, 1, 1, nullptr));
+}
+TEST(sys_epoll, epoll_pwait64_no_sigset) {
#if defined(__BIONIC__)
+ int epoll_fd = epoll_create(1);
+ ASSERT_NE(-1, epoll_fd);
+
// epoll_pwait64 without a sigset (which is equivalent to epoll_wait).
+ epoll_event events[1] = {};
ASSERT_EQ(0, epoll_pwait64(epoll_fd, events, 1, 1, nullptr));
+#else
+ GTEST_SKIP() << "epoll_pwait64 is bionic-only";
#endif
+}
+
+TEST(sys_epoll, epoll_pwait2_no_sigset) {
+#if defined(__BIONIC__)
+ int epoll_fd = epoll_create(1);
+ ASSERT_NE(-1, epoll_fd);
+
+ // epoll_pwait2 without a sigset (which is equivalent to epoll_wait).
+ epoll_event events[1] = {};
+ timespec ts = {.tv_nsec = 500};
+ int rc = epoll_pwait2(epoll_fd, events, 1, &ts, nullptr);
+ if (rc == -1 && errno == ENOSYS) GTEST_SKIP() << "no epoll_pwait2 in this kernel";
+ ASSERT_EQ(0, rc) << strerror(errno);
+#else
+ GTEST_SKIP() << "epoll_pwait2 is only in glibc 2.35+";
+#endif
+}
+
+TEST(sys_epoll, epoll_pwait_with_sigset) {
+ int epoll_fd = epoll_create(1);
+ ASSERT_NE(-1, epoll_fd);
// epoll_pwait with a sigset.
+ epoll_event events[1] = {};
sigset_t ss;
sigemptyset(&ss);
sigaddset(&ss, SIGPIPE);
ASSERT_EQ(0, epoll_pwait(epoll_fd, events, 1, 1, &ss));
}
+TEST(sys_epoll, epoll_pwait2_with_sigset) {
+ int epoll_fd = epoll_create(1);
+ ASSERT_NE(-1, epoll_fd);
+
+#if defined(__BIONIC__)
+ epoll_event events[1] = {};
+ timespec ts = {.tv_nsec = 500};
+ sigset_t ss2;
+ sigemptyset(&ss2);
+ sigaddset(&ss2, SIGPIPE);
+ int rc = epoll_pwait2(epoll_fd, events, 1, &ts, &ss2);
+ if (rc == -1 && errno == ENOSYS) GTEST_SKIP() << "no epoll_pwait2 in this kernel";
+ ASSERT_EQ(0, rc) << strerror(errno);
+#else
+ GTEST_SKIP() << "epoll_pwait2 is only in glibc 2.35+";
+#endif
+}
+
+TEST(sys_epoll, epoll_pwait2_64_with_sigset) {
+ int epoll_fd = epoll_create(1);
+ ASSERT_NE(-1, epoll_fd);
+
+#if defined(__BIONIC__)
+ epoll_event events[1] = {};
+ timespec ts = {.tv_nsec = 500};
+ sigset64_t ss2;
+ sigemptyset64(&ss2);
+ sigaddset64(&ss2, SIGPIPE);
+ int rc = epoll_pwait2_64(epoll_fd, events, 1, &ts, &ss2);
+ if (rc == -1 && errno == ENOSYS) GTEST_SKIP() << "no epoll_pwait2 in this kernel";
+ ASSERT_EQ(0, rc) << strerror(errno);
+#else
+ GTEST_SKIP() << "epoll_pwait2_64 is bionic-only";
+#endif
+}
+
TEST(sys_epoll, epoll_create_invalid_size) {
errno = 0;
ASSERT_EQ(-1, epoll_create(0));
diff --git a/tests/sys_hwprobe_test.cpp b/tests/sys_hwprobe_test.cpp
new file mode 100644
index 0000000..3c8dce2
--- /dev/null
+++ b/tests/sys_hwprobe_test.cpp
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2023 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 <gtest/gtest.h>
+
+#if __has_include(<sys/hwprobe.h>)
+#include <sys/hwprobe.h>
+#include <sys/syscall.h>
+#endif
+
+TEST(sys_hwprobe, __riscv_hwprobe) {
+#if defined(__riscv) && __has_include(<sys/hwprobe.h>)
+ riscv_hwprobe probes[] = {{.key = RISCV_HWPROBE_KEY_IMA_EXT_0},
+ {.key = RISCV_HWPROBE_KEY_CPUPERF_0}};
+ ASSERT_EQ(0, __riscv_hwprobe(probes, 2, 0, nullptr, 0));
+ EXPECT_EQ(RISCV_HWPROBE_KEY_IMA_EXT_0, probes[0].key);
+ EXPECT_TRUE((probes[0].value & RISCV_HWPROBE_IMA_FD) != 0);
+ EXPECT_TRUE((probes[0].value & RISCV_HWPROBE_IMA_C) != 0);
+ // TODO: remove #define when our uapi headers are new enough.
+#define RISCV_HWPROBE_IMA_V (1 << 2)
+ EXPECT_TRUE((probes[0].value & RISCV_HWPROBE_IMA_V) != 0);
+ // TODO: remove #ifs when our kernel is new enough.
+#if defined(RISCV_HWPROBE_EXT_ZBA)
+ EXPECT_TRUE((probes[0].value & RISCV_HWPROBE_EXT_ZBA) != 0);
+#endif
+#if defined(RISCV_HWPROBE_EXT_ZBB)
+ EXPECT_TRUE((probes[0].value & RISCV_HWPROBE_EXT_ZBB) != 0);
+#endif
+#if defined(RISCV_HWPROBE_EXT_ZBS)
+ EXPECT_TRUE((probes[0].value & RISCV_HWPROBE_EXT_ZBS) != 0);
+#endif
+
+ EXPECT_EQ(RISCV_HWPROBE_KEY_CPUPERF_0, probes[1].key);
+ EXPECT_TRUE((probes[1].value & RISCV_HWPROBE_MISALIGNED_MASK) == RISCV_HWPROBE_MISALIGNED_FAST);
+#else
+ GTEST_SKIP() << "__riscv_hwprobe requires riscv64";
+#endif
+}
+
+TEST(sys_hwprobe, __riscv_hwprobe_syscall_vdso) {
+#if defined(__riscv) && __has_include(<sys/hwprobe.h>)
+ riscv_hwprobe probes_vdso[] = {{.key = RISCV_HWPROBE_KEY_IMA_EXT_0},
+ {.key = RISCV_HWPROBE_KEY_CPUPERF_0}};
+ ASSERT_EQ(0, __riscv_hwprobe(probes_vdso, 2, 0, nullptr, 0));
+
+ riscv_hwprobe probes_syscall[] = {{.key = RISCV_HWPROBE_KEY_IMA_EXT_0},
+ {.key = RISCV_HWPROBE_KEY_CPUPERF_0}};
+ ASSERT_EQ(0, syscall(SYS_riscv_hwprobe, probes_syscall, 2, 0, nullptr, 0));
+
+ // Check we got the same answers from the vdso and the syscall.
+ EXPECT_EQ(RISCV_HWPROBE_KEY_IMA_EXT_0, probes_syscall[0].key);
+ EXPECT_EQ(probes_vdso[0].key, probes_syscall[0].key);
+ EXPECT_EQ(probes_vdso[0].value, probes_syscall[0].value);
+ EXPECT_EQ(RISCV_HWPROBE_KEY_CPUPERF_0, probes_syscall[1].key);
+ EXPECT_EQ(probes_vdso[1].key, probes_syscall[1].key);
+ EXPECT_EQ(probes_vdso[1].value, probes_syscall[1].value);
+#else
+ GTEST_SKIP() << "__riscv_hwprobe requires riscv64";
+#endif
+}
+
+TEST(sys_hwprobe, __riscv_hwprobe_fail) {
+#if defined(__riscv) && __has_include(<sys/hwprobe.h>)
+ riscv_hwprobe probes[] = {};
+ ASSERT_EQ(EINVAL, __riscv_hwprobe(probes, 0, 0, nullptr, ~0));
+#else
+ GTEST_SKIP() << "__riscv_hwprobe requires riscv64";
+#endif
+}
diff --git a/tests/sys_mman_test.cpp b/tests/sys_mman_test.cpp
index e403ea5..803852a 100644
--- a/tests/sys_mman_test.cpp
+++ b/tests/sys_mman_test.cpp
@@ -218,7 +218,10 @@
}
TEST(sys_mman, mremap) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
ASSERT_EQ(MAP_FAILED, mremap(nullptr, 0, 0, 0));
+#pragma clang diagnostic pop
}
constexpr size_t kHuge = size_t(PTRDIFF_MAX) + 1;
diff --git a/tests/sys_shm_test.cpp b/tests/sys_shm_test.cpp
index fd5d424..65f9eba 100644
--- a/tests/sys_shm_test.cpp
+++ b/tests/sys_shm_test.cpp
@@ -73,9 +73,12 @@
}
TEST(sys_shm, shmdt_failure) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
errno = 0;
ASSERT_EQ(-1, shmdt(nullptr));
ASSERT_TRUE(errno == EINVAL || errno == ENOSYS);
+#pragma clang diagnostic pop
}
TEST(sys_shm, shmget_failure) {
diff --git a/tests/sys_socket_test.cpp b/tests/sys_socket_test.cpp
index 421a817..422b7f2 100644
--- a/tests/sys_socket_test.cpp
+++ b/tests/sys_socket_test.cpp
@@ -174,8 +174,11 @@
}
TEST(sys_socket, recvmmsg_error) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
ASSERT_EQ(-1, recvmmsg(-1, nullptr, 0, 0, nullptr));
ASSERT_EQ(EBADF, errno);
+#pragma clang diagnostic pop
}
const char* g_SendMsgs[] = {
@@ -232,6 +235,9 @@
}
TEST(sys_socket, sendmmsg_error) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
ASSERT_EQ(-1, sendmmsg(-1, nullptr, 0, 0));
ASSERT_EQ(EBADF, errno);
+#pragma clang diagnostic pop
}
diff --git a/tests/sys_timex_test.cpp b/tests/sys_timex_test.cpp
index 1340ea4..44b73c9 100644
--- a/tests/sys_timex_test.cpp
+++ b/tests/sys_timex_test.cpp
@@ -27,21 +27,9 @@
ASSERT_NE(-1, adjtimex(&t));
}
-TEST(sys_timex, adjtimex_EFAULT) {
- errno = 0;
- ASSERT_EQ(-1, adjtimex(nullptr));
- ASSERT_EQ(EFAULT, errno);
-}
-
TEST(sys_timex, clock_adjtime_smoke) {
timex t;
memset(&t, 0, sizeof(t));
// adjtimex/clock_adjtime return the clock state on success, -1 on failure.
ASSERT_NE(-1, clock_adjtime(CLOCK_REALTIME, &t));
}
-
-TEST(sys_timex, clock_adjtime_EFAULT) {
- errno = 0;
- ASSERT_EQ(-1, clock_adjtime(CLOCK_REALTIME, nullptr));
- ASSERT_EQ(EFAULT, errno);
-}
diff --git a/tests/system_properties_test.cpp b/tests/system_properties_test.cpp
index aa8fef4..b1dfe0b 100644
--- a/tests/system_properties_test.cpp
+++ b/tests/system_properties_test.cpp
@@ -498,7 +498,7 @@
check_with_read_callback(name, value);
}
- constexpr static const char* kExtraLongLegacyError =
+ static constexpr const char* kExtraLongLegacyError =
"Must use __system_property_read_callback() to read";
for (const auto& property : long_properties) {
const std::string& name = property.first;
diff --git a/tests/termios_test.cpp b/tests/termios_test.cpp
index 6290771..a8d5890 100644
--- a/tests/termios_test.cpp
+++ b/tests/termios_test.cpp
@@ -29,6 +29,8 @@
#include <termios.h>
#include <errno.h>
+#include <fcntl.h>
+#include <pty.h>
#include <gtest/gtest.h>
@@ -96,3 +98,49 @@
EXPECT_EQ(1, t.c_cc[VMIN]);
EXPECT_EQ(0, t.c_cc[VTIME]);
}
+
+TEST(termios, tcgetwinsize_tcsetwinsize_invalid) {
+#if !defined(__GLIBC__)
+ winsize ws = {};
+
+ errno = 0;
+ ASSERT_EQ(-1, tcgetwinsize(-1, &ws));
+ ASSERT_EQ(EBADF, errno);
+
+ errno = 0;
+ ASSERT_EQ(-1, tcsetwinsize(-1, &ws));
+ ASSERT_EQ(EBADF, errno);
+#else
+ GTEST_SKIP() << "glibc too old";
+#endif
+}
+
+TEST(termios, tcgetwinsize_tcsetwinsize) {
+#if !defined(__GLIBC__)
+ int pty, tty;
+ winsize ws = {123, 456, 9999, 9999};
+ ASSERT_EQ(0, openpty(&pty, &tty, nullptr, nullptr, &ws));
+
+ winsize actual = {};
+ ASSERT_EQ(0, tcgetwinsize(tty, &actual));
+ EXPECT_EQ(ws.ws_xpixel, actual.ws_xpixel);
+ EXPECT_EQ(ws.ws_ypixel, actual.ws_ypixel);
+ EXPECT_EQ(ws.ws_row, actual.ws_row);
+ EXPECT_EQ(ws.ws_col, actual.ws_col);
+
+ ws = {1, 2, 3, 4};
+ ASSERT_EQ(0, tcsetwinsize(tty, &ws));
+
+ actual = {};
+ ASSERT_EQ(0, tcgetwinsize(tty, &actual));
+ EXPECT_EQ(ws.ws_xpixel, actual.ws_xpixel);
+ EXPECT_EQ(ws.ws_ypixel, actual.ws_ypixel);
+ EXPECT_EQ(ws.ws_row, actual.ws_row);
+ EXPECT_EQ(ws.ws_col, actual.ws_col);
+
+ close(pty);
+ close(tty);
+#else
+ GTEST_SKIP() << "glibc too old";
+#endif
+}
diff --git a/tests/time_test.cpp b/tests/time_test.cpp
index d16600c..ec59aa7 100644
--- a/tests/time_test.cpp
+++ b/tests/time_test.cpp
@@ -28,6 +28,7 @@
#include <atomic>
#include <chrono>
+#include <thread>
#include "SignalUtils.h"
#include "utils.h"
@@ -96,7 +97,7 @@
static void* gmtime_no_stack_overflow_14313703_fn(void*) {
const char* original_tz = getenv("TZ");
- // Ensure we'll actually have to enter tzload by using a time zone that doesn't exist.
+ // Ensure we'll actually have to enter tzload by using a timezone that doesn't exist.
setenv("TZ", "gmtime_stack_overflow_14313703", 1);
tzset();
if (original_tz != nullptr) {
@@ -168,6 +169,8 @@
}
TEST(time, mktime_EOVERFLOW) {
+ setenv("TZ", "UTC", 1);
+
struct tm t;
memset(&t, 0, sizeof(tm));
@@ -321,7 +324,7 @@
// According to C language specification the only tm struct field needed to
// find out replacement for %z and %Z in strftime is tm_isdst. Which is
-// wrong, as time zones change their standard offset and even DST savings.
+// wrong, as timezones change their standard offset and even DST savings.
// tzcode deviates from C language specification and requires tm struct either
// to be output of localtime-like functions or to be modified by mktime call
// before passing to strftime. See tz mailing discussion for more details
@@ -557,7 +560,7 @@
EXPECT_EQ(1, tm.tm_isdst);
EXPECT_EQ(3600, tm.tm_gmtoff);
- // And as long as we're in Europe/Berlin, those are the only time zone
+ // And as long as we're in Europe/Berlin, those are the only timezone
// abbreviations that are recognized.
tm = {};
ASSERT_TRUE(strptime("PDT", "%Z", &tm) == nullptr);
@@ -1115,7 +1118,7 @@
// Actual underlying bug (the code change, not the tzdata upgrade that first exposed the bug):
// http://b/31848040
- // This isn't a great test, because very few time zones were actually affected, and there's
+ // This isn't a great test, because very few timezones were actually affected, and there's
// no real logic to which ones were affected: it was just a coincidence of the data that came
// after them in the tzdata file.
@@ -1156,10 +1159,10 @@
TEST(time, bug_31339449) {
// POSIX says localtime acts as if it calls tzset.
// tzset does two things:
- // 1. it sets the time zone ctime/localtime/mktime/strftime will use.
+ // 1. it sets the timezone ctime/localtime/mktime/strftime will use.
// 2. it sets the global `tzname`.
// POSIX says localtime_r need not set `tzname` (2).
- // Q: should localtime_r set the time zone (1)?
+ // Q: should localtime_r set the timezone (1)?
// Upstream tzcode (and glibc) answer "no", everyone else answers "yes".
// Pick a time, any time...
@@ -1311,3 +1314,150 @@
ASSERT_EQ(1.0, difftime(1, 0));
ASSERT_EQ(-1.0, difftime(0, 1));
}
+
+TEST(time, tzfree_null) {
+#if __BIONIC__
+ tzfree(nullptr);
+#else
+ GTEST_SKIP() << "glibc doesn't have timezone_t";
+#endif
+}
+
+TEST(time, localtime_rz) {
+#if __BIONIC__
+ setenv("TZ", "America/Los_Angeles", 1);
+ tzset();
+
+ auto AssertTmEq = [](const struct tm& rhs, int hour) {
+ ASSERT_EQ(93, rhs.tm_year);
+ ASSERT_EQ(0, rhs.tm_mon);
+ ASSERT_EQ(1, rhs.tm_mday);
+ ASSERT_EQ(hour, rhs.tm_hour);
+ ASSERT_EQ(0, rhs.tm_min);
+ ASSERT_EQ(0, rhs.tm_sec);
+ };
+
+ const time_t t = 725875200;
+
+ // Spam localtime_r() while we use localtime_rz().
+ std::atomic<bool> done = false;
+ std::thread thread{[&] {
+ while (!done) {
+ struct tm tm {};
+ ASSERT_EQ(&tm, localtime_r(&t, &tm));
+ AssertTmEq(tm, 0);
+ }
+ }};
+
+ struct tm tm;
+
+ timezone_t london{tzalloc("Europe/London")};
+ tm = {};
+ ASSERT_EQ(&tm, localtime_rz(london, &t, &tm));
+ AssertTmEq(tm, 8);
+
+ timezone_t seoul{tzalloc("Asia/Seoul")};
+ tm = {};
+ ASSERT_EQ(&tm, localtime_rz(seoul, &t, &tm));
+ AssertTmEq(tm, 17);
+
+ // Just check that mktime()'s timezone didn't change.
+ tm = {};
+ ASSERT_EQ(&tm, localtime_r(&t, &tm));
+ ASSERT_EQ(0, tm.tm_hour);
+ AssertTmEq(tm, 0);
+
+ done = true;
+ thread.join();
+
+ tzfree(london);
+ tzfree(seoul);
+#else
+ GTEST_SKIP() << "glibc doesn't have timezone_t";
+#endif
+}
+
+TEST(time, mktime_z) {
+#if __BIONIC__
+ setenv("TZ", "America/Los_Angeles", 1);
+ tzset();
+
+ // Spam mktime() while we use mktime_z().
+ std::atomic<bool> done = false;
+ std::thread thread{[&done] {
+ while (!done) {
+ struct tm tm {
+ .tm_year = 93, .tm_mday = 1
+ };
+ ASSERT_EQ(725875200, mktime(&tm));
+ }
+ }};
+
+ struct tm tm;
+
+ timezone_t london{tzalloc("Europe/London")};
+ tm = {.tm_year = 93, .tm_mday = 1};
+ ASSERT_EQ(725846400, mktime_z(london, &tm));
+
+ timezone_t seoul{tzalloc("Asia/Seoul")};
+ tm = {.tm_year = 93, .tm_mday = 1};
+ ASSERT_EQ(725814000, mktime_z(seoul, &tm));
+
+ // Just check that mktime()'s timezone didn't change.
+ tm = {.tm_year = 93, .tm_mday = 1};
+ ASSERT_EQ(725875200, mktime(&tm));
+
+ done = true;
+ thread.join();
+
+ tzfree(london);
+ tzfree(seoul);
+#else
+ GTEST_SKIP() << "glibc doesn't have timezone_t";
+#endif
+}
+
+TEST(time, tzalloc_nullptr) {
+#if __BIONIC__
+ // tzalloc(nullptr) returns the system timezone.
+ timezone_t default_tz = tzalloc(nullptr);
+ ASSERT_NE(nullptr, default_tz);
+
+ // Check that mktime_z() with the default timezone matches mktime().
+ // This assumes that the system timezone doesn't change during the test,
+ // but that should be unlikely, and we don't have much choice if we
+ // want to write a test at all.
+ // We unset $TZ before calling mktime() because mktime() honors $TZ.
+ unsetenv("TZ");
+ struct tm tm = {.tm_year = 93, .tm_mday = 1};
+ time_t t = mktime(&tm);
+ ASSERT_EQ(t, mktime_z(default_tz, &tm));
+
+ // Check that changing $TZ doesn't affect the tzalloc() default in
+ // the same way it would the mktime() default.
+ setenv("TZ", "America/Los_Angeles", 1);
+ tzset();
+ ASSERT_EQ(t, mktime_z(default_tz, &tm));
+
+ setenv("TZ", "Europe/London", 1);
+ tzset();
+ ASSERT_EQ(t, mktime_z(default_tz, &tm));
+
+ setenv("TZ", "Asia/Seoul", 1);
+ tzset();
+ ASSERT_EQ(t, mktime_z(default_tz, &tm));
+
+ tzfree(default_tz);
+#else
+ GTEST_SKIP() << "glibc doesn't have timezone_t";
+#endif
+}
+
+TEST(time, tzalloc_unique_ptr) {
+#if __BIONIC__
+ std::unique_ptr<std::remove_pointer_t<timezone_t>, decltype(&tzfree)> tz{tzalloc("Asia/Seoul"),
+ tzfree};
+#else
+ GTEST_SKIP() << "glibc doesn't have timezone_t";
+#endif
+}
diff --git a/tests/uchar_test.cpp b/tests/uchar_test.cpp
index 4dc6314..512f098 100644
--- a/tests/uchar_test.cpp
+++ b/tests/uchar_test.cpp
@@ -24,22 +24,64 @@
#include <locale.h>
#include <stdint.h>
+// Modern versions of UTF-8 (https://datatracker.ietf.org/doc/html/rfc3629 and
+// newer) explicitly disallow code points beyond U+10FFFF, which exclude all 5-
+// and 6-byte sequences. Earlier versions of UTF-8 allowed the wider range:
+// https://datatracker.ietf.org/doc/html/rfc2279.
+//
+// Bionic's unicode implementation was written after the high values were
+// excluded, so it has never supported them. Other implementations (at least
+// as of glibc 2.36), do support those sequences.
+#if defined(__ANDROID__) || defined(ANDROID_HOST_MUSL)
+constexpr bool kLibcRejectsOverLongUtf8Sequences = true;
+#elif defined(__GLIBC__)
+constexpr bool kLibcRejectsOverLongUtf8Sequences = false;
+#else
+#error kLibcRejectsOverLongUtf8Sequences must be configured for this platform
+#endif
+
TEST(uchar, sizeof_uchar_t) {
EXPECT_EQ(2U, sizeof(char16_t));
EXPECT_EQ(4U, sizeof(char32_t));
}
TEST(uchar, start_state) {
+ // C23 does not appear to specify the behavior of the conversion functions if
+ // a state is reused before the character is completed. In the wchar.h section
+ // (7.31.6.3) it says:
+ //
+ // If an mbstate_t object has been altered by any of the functions
+ // described in this subclause, and is then used with a different
+ // multibyte character sequence, or in the other conversion direction, or
+ // with a different LC_CTYPE category setting than on earlier function
+ // calls, the behavior is undefined.
+ //
+ // But "described in this subclause" refers to the wchar.h functions, not the
+ // uchar.h ones.
+ //
+ // Since C has no opinion, we need to make a choice. While no caller should
+ // ever do this (what does it mean to begin decoding a UTF-32 character while
+ // still in the middle of a UTF-8 sequence?), considering that a decoding
+ // error seems the least surprising. Bionic and glibc both have that behavior.
+ // musl ignores the state (it also doesn't make much sense to read the state
+ // when the entire conversion completes in a single call) and decodes the
+ // UTF-32 character.
+#if !defined(ANDROID_HOST_MUSL)
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
char out[MB_LEN_MAX];
mbstate_t ps;
- // Any non-initial state is invalid when calling c32rtomb.
memset(&ps, 0, sizeof(ps));
EXPECT_EQ(static_cast<size_t>(-2), mbrtoc32(nullptr, "\xc2", 1, &ps));
errno = 0;
EXPECT_EQ(static_cast<size_t>(-1), c32rtomb(out, 0x00a2, &ps));
EXPECT_EQ(EILSEQ, errno);
+ // Similarly (but not in compliance with the standard afaict), musl seems to
+ // ignore the state entirely for the UTF-32 functions rather than reset it.
+
// If the first argument to c32rtomb is nullptr or the second is L'\0' the shift
// state should be reset.
memset(&ps, 0, sizeof(ps));
@@ -51,14 +93,21 @@
EXPECT_EQ(static_cast<size_t>(-2), mbrtoc32(nullptr, "\xf0\xa4", 1, &ps));
EXPECT_EQ(1U, c32rtomb(out, L'\0', &ps));
EXPECT_TRUE(mbsinit(&ps));
+#endif
}
TEST(uchar, c16rtomb_null_out) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
EXPECT_EQ(1U, c16rtomb(nullptr, L'\0', nullptr));
EXPECT_EQ(1U, c16rtomb(nullptr, L'h', nullptr));
}
TEST(uchar, c16rtomb_null_char) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
char bytes[MB_LEN_MAX];
EXPECT_EQ(1U, c16rtomb(bytes, L'\0', nullptr));
}
@@ -99,6 +148,9 @@
}
TEST(uchar, c16rtomb_invalid) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
char bytes[MB_LEN_MAX];
memset(bytes, 0, sizeof(bytes));
@@ -109,20 +161,26 @@
}
TEST(uchar, mbrtoc16_null) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
ASSERT_EQ(0U, mbrtoc16(nullptr, nullptr, 0, nullptr));
}
TEST(uchar, mbrtoc16_zero_len) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
char16_t out;
out = L'x';
- ASSERT_EQ(0U, mbrtoc16(&out, "hello", 0, nullptr));
- ASSERT_EQ(L'x', out);
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "hello", 0, nullptr));
+ EXPECT_EQ(L'x', out);
- ASSERT_EQ(0U, mbrtoc16(&out, "hello", 0, nullptr));
- ASSERT_EQ(0U, mbrtoc16(&out, "", 0, nullptr));
- ASSERT_EQ(1U, mbrtoc16(&out, "hello", 1, nullptr));
- ASSERT_EQ(L'h', out);
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "hello", 0, nullptr));
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "", 0, nullptr));
+ EXPECT_EQ(1U, mbrtoc16(&out, "hello", 1, nullptr));
+ EXPECT_EQ(L'h', out);
}
TEST(uchar, mbrtoc16) {
@@ -141,27 +199,60 @@
ASSERT_EQ(3U, mbrtoc16(&out, "\xe2\x82\xac" "def", 6, nullptr));
ASSERT_EQ(static_cast<char16_t>(0x20ac), out);
// 4-byte UTF-8 will be returned as a surrogate pair...
- ASSERT_EQ(static_cast<size_t>(-3),
- mbrtoc16(&out, "\xf4\x8a\xaf\x8d", 6, nullptr));
+ ASSERT_EQ(4U, mbrtoc16(&out, "\xf4\x8a\xaf\x8d", 6, nullptr));
ASSERT_EQ(static_cast<char16_t>(0xdbea), out);
- ASSERT_EQ(4U, mbrtoc16(&out, "\xf4\x8a\xaf\x8d" "ef", 6, nullptr));
+ ASSERT_EQ(static_cast<size_t>(-3), mbrtoc16(&out,
+ "\xf4\x8a\xaf\x8d"
+ "ef",
+ 6, nullptr));
ASSERT_EQ(static_cast<char16_t>(0xdfcd), out);
- // Illegal 5-byte UTF-8.
+}
+
+TEST(uchar, mbrtoc16_long_sequences) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
+ char16_t out = u'\0';
errno = 0;
- ASSERT_EQ(static_cast<size_t>(-1), mbrtoc16(&out, "\xf8\xa1\xa2\xa3\xa4", 5, nullptr));
- ASSERT_EQ(EILSEQ, errno);
+ auto result = mbrtoc16(&out, "\xf8\xa1\xa2\xa3\xa4", 5, nullptr);
+ if (kLibcRejectsOverLongUtf8Sequences) {
+ EXPECT_EQ(static_cast<size_t>(-1), result);
+ EXPECT_EQ(EILSEQ, errno);
+ EXPECT_EQ(u'\0', out);
+ } else {
+ EXPECT_EQ(5U, result);
+ EXPECT_EQ(0, errno);
+ EXPECT_EQ(u'\uf94a', out);
+ }
}
TEST(uchar, mbrtoc16_reserved_range) {
- char16_t out;
- ASSERT_EQ(static_cast<size_t>(-1),
- mbrtoc16(&out, "\xf0\x80\xbf\xbf", 6, nullptr));
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
+ errno = 0;
+ char16_t out = u'\0';
+ EXPECT_EQ(static_cast<size_t>(-1), mbrtoc16(&out, "\xf0\x80\xbf\xbf", 6, nullptr));
+ EXPECT_EQ(u'\0', out);
+ EXPECT_EQ(EILSEQ, errno);
}
TEST(uchar, mbrtoc16_beyond_range) {
- char16_t out;
- ASSERT_EQ(static_cast<size_t>(-1),
- mbrtoc16(&out, "\xf5\x80\x80\x80", 6, nullptr));
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
+ errno = 0;
+ char16_t out = u'\0';
+ auto result = mbrtoc16(&out, "\xf5\x80\x80\x80", 6, nullptr);
+ if (kLibcRejectsOverLongUtf8Sequences) {
+ EXPECT_EQ(static_cast<size_t>(-1), result);
+ EXPECT_EQ(u'\0', out);
+ EXPECT_EQ(EILSEQ, errno);
+ } else {
+ EXPECT_EQ(4U, result);
+ EXPECT_EQ(u'\xdcc0', out);
+ EXPECT_EQ(0, errno);
+ }
}
void test_mbrtoc16_incomplete(mbstate_t* ps) {
@@ -183,9 +274,15 @@
// 4-byte UTF-8.
ASSERT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "\xf4", 1, ps));
ASSERT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "\x8a\xaf", 2, ps));
- ASSERT_EQ(static_cast<size_t>(-3), mbrtoc16(&out, "\x8d" "ef", 3, ps));
+ ASSERT_EQ(1U, mbrtoc16(&out,
+ "\x8d"
+ "ef",
+ 3, ps));
ASSERT_EQ(static_cast<char16_t>(0xdbea), out);
- ASSERT_EQ(1U, mbrtoc16(&out, "\x80" "ef", 3, ps));
+ ASSERT_EQ(static_cast<size_t>(-3), mbrtoc16(&out,
+ "\x80"
+ "ef",
+ 3, ps));
ASSERT_EQ(static_cast<char16_t>(0xdfcd), out);
ASSERT_TRUE(mbsinit(ps));
@@ -197,6 +294,9 @@
}
TEST(uchar, mbrtoc16_incomplete) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
mbstate_t ps;
memset(&ps, 0, sizeof(ps));
@@ -265,55 +365,78 @@
ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
uselocale(LC_GLOBAL_LOCALE);
- char32_t out[8] = {};
+ char32_t out = U'\0';
errno = 0;
- ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(out, "\xf5\x80\x80\x80", 4, nullptr));
- ASSERT_EQ(EILSEQ, errno);
+ auto result = mbrtoc32(&out, "\xf5\x80\x80\x80", 4, nullptr);
+ if (kLibcRejectsOverLongUtf8Sequences) {
+ EXPECT_EQ(static_cast<size_t>(-1), result);
+ EXPECT_EQ(EILSEQ, errno);
+ EXPECT_EQ(U'\0', out);
+ } else {
+ EXPECT_EQ(4U, result);
+ EXPECT_EQ(0, errno);
+ EXPECT_EQ(U'\x140000', out);
+ }
}
TEST(uchar, mbrtoc32) {
char32_t out[8];
out[0] = L'x';
- ASSERT_EQ(0U, mbrtoc32(out, "hello", 0, nullptr));
- ASSERT_EQ(static_cast<char32_t>(L'x'), out[0]);
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtoc32(out, "hello", 0, nullptr));
+ EXPECT_EQ(static_cast<char32_t>(L'x'), out[0]);
- ASSERT_EQ(0U, mbrtoc32(out, "hello", 0, nullptr));
- ASSERT_EQ(0U, mbrtoc32(out, "", 0, nullptr));
- ASSERT_EQ(1U, mbrtoc32(out, "hello", 1, nullptr));
- ASSERT_EQ(static_cast<char32_t>(L'h'), out[0]);
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtoc32(out, "hello", 0, nullptr));
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtoc32(out, "", 0, nullptr));
+ EXPECT_EQ(1U, mbrtoc32(out, "hello", 1, nullptr));
+ EXPECT_EQ(static_cast<char32_t>(L'h'), out[0]);
- ASSERT_EQ(0U, mbrtoc32(nullptr, "hello", 0, nullptr));
- ASSERT_EQ(0U, mbrtoc32(nullptr, "", 0, nullptr));
- ASSERT_EQ(1U, mbrtoc32(nullptr, "hello", 1, nullptr));
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtoc32(nullptr, "hello", 0, nullptr));
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtoc32(nullptr, "", 0, nullptr));
+ EXPECT_EQ(1U, mbrtoc32(nullptr, "hello", 1, nullptr));
- ASSERT_EQ(0U, mbrtoc32(nullptr, nullptr, 0, nullptr));
+ EXPECT_EQ(0U, mbrtoc32(nullptr, nullptr, 0, nullptr));
ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
uselocale(LC_GLOBAL_LOCALE);
// 1-byte UTF-8.
- ASSERT_EQ(1U, mbrtoc32(out, "abcdef", 6, nullptr));
- ASSERT_EQ(static_cast<char32_t>(L'a'), out[0]);
+ EXPECT_EQ(1U, mbrtoc32(out, "abcdef", 6, nullptr));
+ EXPECT_EQ(static_cast<char32_t>(L'a'), out[0]);
// 2-byte UTF-8.
- ASSERT_EQ(2U, mbrtoc32(out, "\xc2\xa2" "cdef", 6, nullptr));
- ASSERT_EQ(static_cast<char32_t>(0x00a2), out[0]);
+ EXPECT_EQ(2U, mbrtoc32(out,
+ "\xc2\xa2"
+ "cdef",
+ 6, nullptr));
+ EXPECT_EQ(static_cast<char32_t>(0x00a2), out[0]);
// 3-byte UTF-8.
- ASSERT_EQ(3U, mbrtoc32(out, "\xe2\x82\xac" "def", 6, nullptr));
- ASSERT_EQ(static_cast<char32_t>(0x20ac), out[0]);
+ EXPECT_EQ(3U, mbrtoc32(out,
+ "\xe2\x82\xac"
+ "def",
+ 6, nullptr));
+ EXPECT_EQ(static_cast<char32_t>(0x20ac), out[0]);
// 4-byte UTF-8.
- ASSERT_EQ(4U, mbrtoc32(out, "\xf0\xa4\xad\xa2" "ef", 6, nullptr));
- ASSERT_EQ(static_cast<char32_t>(0x24b62), out[0]);
+ EXPECT_EQ(4U, mbrtoc32(out,
+ "\xf0\xa4\xad\xa2"
+ "ef",
+ 6, nullptr));
+ EXPECT_EQ(static_cast<char32_t>(0x24b62), out[0]);
#if defined(__BIONIC__) // glibc allows this.
// Illegal 5-byte UTF-8.
errno = 0;
- ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, nullptr));
- ASSERT_EQ(EILSEQ, errno);
+ EXPECT_EQ(static_cast<size_t>(-1), mbrtoc32(out,
+ "\xf8\xa1\xa2\xa3\xa4"
+ "f",
+ 6, nullptr));
+ EXPECT_EQ(EILSEQ, errno);
#endif
// Illegal over-long sequence.
errno = 0;
- ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(out, "\xf0\x82\x82\xac" "ef", 6, nullptr));
- ASSERT_EQ(EILSEQ, errno);
+ EXPECT_EQ(static_cast<size_t>(-1), mbrtoc32(out,
+ "\xf0\x82\x82\xac"
+ "ef",
+ 6, nullptr));
+ EXPECT_EQ(EILSEQ, errno);
}
void test_mbrtoc32_incomplete(mbstate_t* ps) {
@@ -347,6 +470,9 @@
}
TEST(uchar, mbrtoc32_incomplete) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
mbstate_t ps;
memset(&ps, 0, sizeof(ps));
diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp
index 4c21627..ac39f96 100644
--- a/tests/unistd_test.cpp
+++ b/tests/unistd_test.cpp
@@ -1166,6 +1166,30 @@
VERIFY_SYSCONF_UNKNOWN(666);
}
+[[maybe_unused]] static void show_cache(const char* name, long size, long assoc, long line_size) {
+ printf("%s cache size: %ld bytes, line size %ld bytes, ", name, size, line_size);
+ if (assoc == 0) {
+ printf("fully");
+ } else {
+ printf("%ld-way", assoc);
+ }
+ printf(" associative\n");
+}
+
+TEST(UNISTD_TEST, sysconf_cache) {
+#if defined(ANDROID_HOST_MUSL)
+ GTEST_SKIP() << "musl does not have _SC_LEVEL?_?CACHE_SIZE";
+#else
+ // It's not obvious we can _test_ any of these, but we can at least
+ // show the output for humans to inspect.
+ show_cache("L1D", sysconf(_SC_LEVEL1_DCACHE_SIZE), sysconf(_SC_LEVEL1_DCACHE_ASSOC), sysconf(_SC_LEVEL1_DCACHE_LINESIZE));
+ show_cache("L1I", sysconf(_SC_LEVEL1_ICACHE_SIZE), sysconf(_SC_LEVEL1_ICACHE_ASSOC), sysconf(_SC_LEVEL1_ICACHE_LINESIZE));
+ show_cache("L2", sysconf(_SC_LEVEL2_CACHE_SIZE), sysconf(_SC_LEVEL2_CACHE_ASSOC), sysconf(_SC_LEVEL2_CACHE_LINESIZE));
+ show_cache("L3", sysconf(_SC_LEVEL3_CACHE_SIZE), sysconf(_SC_LEVEL3_CACHE_ASSOC), sysconf(_SC_LEVEL3_CACHE_LINESIZE));
+ show_cache("L4", sysconf(_SC_LEVEL4_CACHE_SIZE), sysconf(_SC_LEVEL4_CACHE_ASSOC), sysconf(_SC_LEVEL4_CACHE_LINESIZE));
+#endif
+}
+
TEST(UNISTD_TEST, dup2_same) {
// POSIX says of dup2:
// If fildes2 is already a valid open file descriptor ...
diff --git a/tests/utils.cpp b/tests/utils.cpp
index 92ab145..948d0ec 100644
--- a/tests/utils.cpp
+++ b/tests/utils.cpp
@@ -28,6 +28,7 @@
#include "utils.h"
+#include <syscall.h>
#include <string>
#include <android-base/properties.h>
@@ -63,3 +64,9 @@
(android::base::GetBoolProperty("ro.debuggable", false) &&
android::base::GetBoolProperty("debug.force_low_ram", false));
}
+
+#if defined(__GLIBC__) && __GLIBC_MINOR__ < 30
+pid_t gettid() {
+ return syscall(__NR_gettid);
+}
+#endif
diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp
index 8716810..28c1046 100644
--- a/tests/wchar_test.cpp
+++ b/tests/wchar_test.cpp
@@ -29,6 +29,37 @@
#define NUM_WCHARS(num_bytes) ((num_bytes)/sizeof(wchar_t))
+#ifdef __GLIBC__
+// glibc immediately dereferences the locale passed to all wcsto*_l functions,
+// even if it won't be used, and even if it's LC_GLOBAL_LOCALE, which isn't a
+// pointer to valid memory.
+static locale_t SAFE_LC_GLOBAL_LOCALE = duplocale(LC_GLOBAL_LOCALE);
+#else
+static locale_t SAFE_LC_GLOBAL_LOCALE = LC_GLOBAL_LOCALE;
+#endif
+
+// Modern versions of UTF-8 (https://datatracker.ietf.org/doc/html/rfc3629 and
+// newer) explicitly disallow code points beyond U+10FFFF, which exclude all 5-
+// and 6-byte sequences. Earlier versions of UTF-8 allowed the wider range:
+// https://datatracker.ietf.org/doc/html/rfc2279.
+//
+// Bionic's unicode implementation was written after the high values were
+// excluded, so it has never supported them. Other implementations (at least
+// as of glibc 2.36), do support those sequences.
+#if defined(__ANDROID__) || defined(ANDROID_HOST_MUSL)
+constexpr bool kLibcRejectsOverLongUtf8Sequences = true;
+#elif defined(__GLIBC__)
+constexpr bool kLibcRejectsOverLongUtf8Sequences = false;
+#else
+#error kLibcRejectsOverLongUtf8Sequences must be configured for this platform
+#endif
+
+#if defined(__GLIBC__)
+constexpr bool kLibcSupportsParsingBinaryLiterals = __GLIBC_PREREQ(2, 38);
+#else
+constexpr bool kLibcSupportsParsingBinaryLiterals = true;
+#endif
+
TEST(wchar, sizeof_wchar_t) {
EXPECT_EQ(4U, sizeof(wchar_t));
EXPECT_EQ(4U, sizeof(wint_t));
@@ -36,7 +67,7 @@
TEST(wchar, mbrlen) {
char bytes[] = { 'h', 'e', 'l', 'l', 'o', '\0' };
- EXPECT_EQ(0U, mbrlen(&bytes[0], 0, nullptr));
+ EXPECT_EQ(static_cast<size_t>(-2), mbrlen(&bytes[0], 0, nullptr));
EXPECT_EQ(1U, mbrlen(&bytes[0], 1, nullptr));
EXPECT_EQ(1U, mbrlen(&bytes[4], 1, nullptr));
@@ -95,6 +126,9 @@
}
TEST(wchar, wcrtomb_start_state) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
char out[MB_LEN_MAX];
mbstate_t ps;
@@ -118,6 +152,9 @@
}
TEST(wchar, wcstombs_wcrtombs) {
+ ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ uselocale(LC_GLOBAL_LOCALE);
+
const wchar_t chars[] = { L'h', L'e', L'l', L'l', L'o', 0 };
const wchar_t bad_chars[] = { L'h', L'i', static_cast<wchar_t>(0xffffffff), 0 };
const wchar_t* src;
@@ -255,63 +292,97 @@
TEST(wchar, mbtowc) {
wchar_t out[8];
+ // mbtowc and all the mbrto* APIs behave slightly differently when n is 0:
+ //
+ // mbrtowc returns 0 "if the next n or fewer bytes complete the multibyte
+ // character that corresponds to the null wide character"
+ //
+ // mbrtoc says: "If s is not a null pointer, the mbtowc function either
+ // returns 0 (if s points to the null character)..."
+ //
+ // So mbrtowc will not provide the correct mbtowc return value for "" and
+ // n = 0.
+ //
+ // glibc gets this right, but all the BSDs (including macOS) and bionic (by
+ // way of openbsd) return -1 instead of 0.
+#ifdef __GLIBC__
+ int expected_result_for_zero_length_empty_string = 0;
+#else
+ int expected_result_for_zero_length_empty_string = -1;
+#endif
+
out[0] = 'x';
- ASSERT_EQ(0, mbtowc(out, "hello", 0));
- ASSERT_EQ('x', out[0]);
+ EXPECT_EQ(-1, mbtowc(out, "hello", 0));
+ EXPECT_EQ('x', out[0]);
- ASSERT_EQ(0, mbtowc(out, "hello", 0));
- ASSERT_EQ(0, mbtowc(out, "", 0));
- ASSERT_EQ(1, mbtowc(out, "hello", 1));
- ASSERT_EQ(L'h', out[0]);
+ EXPECT_EQ(-1, mbtowc(out, "hello", 0));
+ EXPECT_EQ(expected_result_for_zero_length_empty_string, mbtowc(out, "", 0));
+ EXPECT_EQ(1, mbtowc(out, "hello", 1));
+ EXPECT_EQ(L'h', out[0]);
- ASSERT_EQ(0, mbtowc(nullptr, "hello", 0));
- ASSERT_EQ(0, mbtowc(nullptr, "", 0));
- ASSERT_EQ(1, mbtowc(nullptr, "hello", 1));
+ EXPECT_EQ(-1, mbtowc(nullptr, "hello", 0));
+ EXPECT_EQ(expected_result_for_zero_length_empty_string, mbtowc(nullptr, "", 0));
+ EXPECT_EQ(1, mbtowc(nullptr, "hello", 1));
- ASSERT_EQ(0, mbtowc(nullptr, nullptr, 0));
+ EXPECT_EQ(0, mbtowc(nullptr, nullptr, 0));
}
TEST(wchar, mbrtowc) {
wchar_t out[8];
out[0] = 'x';
- ASSERT_EQ(0U, mbrtowc(out, "hello", 0, nullptr));
- ASSERT_EQ('x', out[0]);
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtowc(out, "hello", 0, nullptr));
+ EXPECT_EQ('x', out[0]);
- ASSERT_EQ(0U, mbrtowc(out, "hello", 0, nullptr));
- ASSERT_EQ(0U, mbrtowc(out, "", 0, nullptr));
- ASSERT_EQ(1U, mbrtowc(out, "hello", 1, nullptr));
- ASSERT_EQ(L'h', out[0]);
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtowc(out, "hello", 0, nullptr));
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtowc(out, "", 0, nullptr));
+ EXPECT_EQ(1U, mbrtowc(out, "hello", 1, nullptr));
+ EXPECT_EQ(L'h', out[0]);
- ASSERT_EQ(0U, mbrtowc(nullptr, "hello", 0, nullptr));
- ASSERT_EQ(0U, mbrtowc(nullptr, "", 0, nullptr));
- ASSERT_EQ(1U, mbrtowc(nullptr, "hello", 1, nullptr));
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtowc(nullptr, "hello", 0, nullptr));
+ EXPECT_EQ(static_cast<size_t>(-2), mbrtowc(nullptr, "", 0, nullptr));
+ EXPECT_EQ(1U, mbrtowc(nullptr, "hello", 1, nullptr));
- ASSERT_EQ(0U, mbrtowc(nullptr, nullptr, 0, nullptr));
+ EXPECT_EQ(0U, mbrtowc(nullptr, nullptr, 0, nullptr));
- ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+ EXPECT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
uselocale(LC_GLOBAL_LOCALE);
// 1-byte UTF-8.
- ASSERT_EQ(1U, mbrtowc(out, "abcdef", 6, nullptr));
- ASSERT_EQ(L'a', out[0]);
+ EXPECT_EQ(1U, mbrtowc(out, "abcdef", 6, nullptr));
+ EXPECT_EQ(L'a', out[0]);
// 2-byte UTF-8.
- ASSERT_EQ(2U, mbrtowc(out, "\xc2\xa2" "cdef", 6, nullptr));
- ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[0]);
+ EXPECT_EQ(2U, mbrtowc(out,
+ "\xc2\xa2"
+ "cdef",
+ 6, nullptr));
+ EXPECT_EQ(static_cast<wchar_t>(0x00a2), out[0]);
// 3-byte UTF-8.
- ASSERT_EQ(3U, mbrtowc(out, "\xe2\x82\xac" "def", 6, nullptr));
- ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[0]);
+ EXPECT_EQ(3U, mbrtowc(out,
+ "\xe2\x82\xac"
+ "def",
+ 6, nullptr));
+ EXPECT_EQ(static_cast<wchar_t>(0x20ac), out[0]);
// 4-byte UTF-8.
- ASSERT_EQ(4U, mbrtowc(out, "\xf0\xa4\xad\xa2" "ef", 6, nullptr));
- ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[0]);
+ EXPECT_EQ(4U, mbrtowc(out,
+ "\xf0\xa4\xad\xa2"
+ "ef",
+ 6, nullptr));
+ EXPECT_EQ(static_cast<wchar_t>(0x24b62), out[0]);
#if defined(__BIONIC__) // glibc allows this.
// Illegal 5-byte UTF-8.
- ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, nullptr));
- ASSERT_EQ(EILSEQ, errno);
+ EXPECT_EQ(static_cast<size_t>(-1), mbrtowc(out,
+ "\xf8\xa1\xa2\xa3\xa4"
+ "f",
+ 6, nullptr));
+ EXPECT_EQ(EILSEQ, errno);
#endif
// Illegal over-long sequence.
- ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf0\x82\x82\xac" "ef", 6, nullptr));
- ASSERT_EQ(EILSEQ, errno);
+ EXPECT_EQ(static_cast<size_t>(-1), mbrtowc(out,
+ "\xf0\x82\x82\xac"
+ "ef",
+ 6, nullptr));
+ EXPECT_EQ(EILSEQ, errno);
}
TEST(wchar, mbrtowc_valid_non_characters) {
@@ -332,8 +403,14 @@
wchar_t out[8] = {};
errno = 0;
- ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf5\x80\x80\x80", 4, nullptr));
- ASSERT_EQ(EILSEQ, errno);
+ auto result = mbrtowc(out, "\xf5\x80\x80\x80", 4, nullptr);
+ if (kLibcRejectsOverLongUtf8Sequences) {
+ ASSERT_EQ(static_cast<size_t>(-1), result);
+ ASSERT_EQ(EILSEQ, errno);
+ } else {
+ ASSERT_EQ(4U, result);
+ ASSERT_EQ(0, errno);
+ }
}
static void test_mbrtowc_incomplete(mbstate_t* ps) {
@@ -446,8 +523,8 @@
void TestSingleWcsToInt(WcsToIntFn<T> fn, const wchar_t* str, int base,
T expected_value, ptrdiff_t expected_len) {
wchar_t* p;
- ASSERT_EQ(expected_value, fn(str, &p, base));
- ASSERT_EQ(expected_len, p - str) << str;
+ EXPECT_EQ(expected_value, fn(str, &p, base)) << str << " " << base;
+ EXPECT_EQ(expected_len, p - str) << str << " " << base;
}
template <typename T>
@@ -460,7 +537,9 @@
TestSingleWcsToInt(fn, L" 123 45", 0, static_cast<T>(123), 6);
TestSingleWcsToInt(fn, L" -123", 0, static_cast<T>(-123), 6);
TestSingleWcsToInt(fn, L"0x10000", 0, static_cast<T>(65536), 7);
- TestSingleWcsToInt(fn, L"0b1011", 0, static_cast<T>(0b1011), 6);
+ if (kLibcSupportsParsingBinaryLiterals) {
+ TestSingleWcsToInt(fn, L"0b1011", 0, static_cast<T>(0b1011), 6);
+ }
}
template <typename T>
@@ -584,7 +663,7 @@
EXPECT_EQ(24U, wcsftime(buf, sizeof(buf), L"%c", &t));
EXPECT_STREQ(L"Sun Mar 10 00:00:00 2100", buf);
- EXPECT_EQ(24U, wcsftime_l(buf, sizeof(buf), L"%c", &t, LC_GLOBAL_LOCALE));
+ EXPECT_EQ(24U, wcsftime_l(buf, sizeof(buf), L"%c", &t, SAFE_LC_GLOBAL_LOCALE));
EXPECT_STREQ(L"Sun Mar 10 00:00:00 2100", buf);
}
@@ -781,25 +860,25 @@
TEST(wchar, wcstoll_l_EINVAL) {
errno = 0;
- wcstoll_l(L"123", nullptr, -1, LC_GLOBAL_LOCALE);
+ wcstoll_l(L"123", nullptr, -1, SAFE_LC_GLOBAL_LOCALE);
ASSERT_EQ(EINVAL, errno);
errno = 0;
- wcstoll_l(L"123", nullptr, 1, LC_GLOBAL_LOCALE);
+ wcstoll_l(L"123", nullptr, 1, SAFE_LC_GLOBAL_LOCALE);
ASSERT_EQ(EINVAL, errno);
errno = 0;
- wcstoll_l(L"123", nullptr, 37, LC_GLOBAL_LOCALE);
+ wcstoll_l(L"123", nullptr, 37, SAFE_LC_GLOBAL_LOCALE);
ASSERT_EQ(EINVAL, errno);
}
TEST(wchar, wcstoull_l_EINVAL) {
errno = 0;
- wcstoull_l(L"123", nullptr, -1, LC_GLOBAL_LOCALE);
+ wcstoull_l(L"123", nullptr, -1, SAFE_LC_GLOBAL_LOCALE);
ASSERT_EQ(EINVAL, errno);
errno = 0;
- wcstoull_l(L"123", nullptr, 1, LC_GLOBAL_LOCALE);
+ wcstoull_l(L"123", nullptr, 1, SAFE_LC_GLOBAL_LOCALE);
ASSERT_EQ(EINVAL, errno);
errno = 0;
- wcstoull_l(L"123", nullptr, 37, LC_GLOBAL_LOCALE);
+ wcstoull_l(L"123", nullptr, 37, SAFE_LC_GLOBAL_LOCALE);
ASSERT_EQ(EINVAL, errno);
}
@@ -922,7 +1001,7 @@
TEST(wchar, wcstod_l) {
#if !defined(ANDROID_HOST_MUSL)
- EXPECT_EQ(1.23, wcstod_l(L"1.23", nullptr, LC_GLOBAL_LOCALE));
+ EXPECT_EQ(1.23, wcstod_l(L"1.23", nullptr, SAFE_LC_GLOBAL_LOCALE));
#else
GTEST_SKIP() << "musl doesn't have wcstod_l";
#endif
@@ -930,7 +1009,7 @@
TEST(wchar, wcstof_l) {
#if !defined(ANDROID_HOST_MUSL)
- EXPECT_EQ(1.23f, wcstof_l(L"1.23", nullptr, LC_GLOBAL_LOCALE));
+ EXPECT_EQ(1.23f, wcstof_l(L"1.23", nullptr, SAFE_LC_GLOBAL_LOCALE));
#else
GTEST_SKIP() << "musl doesn't have wcstof_l";
#endif
@@ -938,30 +1017,30 @@
TEST(wchar, wcstol_l) {
#if !defined(ANDROID_HOST_MUSL)
- EXPECT_EQ(123L, wcstol_l(L"123", nullptr, 10, LC_GLOBAL_LOCALE));
+ EXPECT_EQ(123L, wcstol_l(L"123", nullptr, 10, SAFE_LC_GLOBAL_LOCALE));
#else
GTEST_SKIP() << "musl doesn't have wcstol_l";
#endif
}
TEST(wchar, wcstold_l) {
- EXPECT_EQ(1.23L, wcstold_l(L"1.23", nullptr, LC_GLOBAL_LOCALE));
+ EXPECT_EQ(1.23L, wcstold_l(L"1.23", nullptr, SAFE_LC_GLOBAL_LOCALE));
}
TEST(wchar, wcstoll_l) {
- EXPECT_EQ(123LL, wcstoll_l(L"123", nullptr, 10, LC_GLOBAL_LOCALE));
+ EXPECT_EQ(123LL, wcstoll_l(L"123", nullptr, 10, SAFE_LC_GLOBAL_LOCALE));
}
TEST(wchar, wcstoul_l) {
#if !defined(ANDROID_HOST_MUSL)
- EXPECT_EQ(123UL, wcstoul_l(L"123", nullptr, 10, LC_GLOBAL_LOCALE));
+ EXPECT_EQ(123UL, wcstoul_l(L"123", nullptr, 10, SAFE_LC_GLOBAL_LOCALE));
#else
GTEST_SKIP() << "musl doesn't have wcstoul_l";
#endif
}
TEST(wchar, wcstoull_l) {
- EXPECT_EQ(123ULL, wcstoull_l(L"123", nullptr, 10, LC_GLOBAL_LOCALE));
+ EXPECT_EQ(123ULL, wcstoull_l(L"123", nullptr, 10, SAFE_LC_GLOBAL_LOCALE));
}
static void AssertWcwidthRange(wchar_t begin, wchar_t end, int expected) {
diff --git a/tools/versioner/src/Preprocessor.cpp b/tools/versioner/src/Preprocessor.cpp
index 14f80d8..47b9017 100644
--- a/tools/versioner/src/Preprocessor.cpp
+++ b/tools/versioner/src/Preprocessor.cpp
@@ -98,7 +98,8 @@
}
for (Arch arch : supported_archs) {
- if (result.arch_availability[arch].introduced <= arch_visibility[arch]) {
+ if (result.arch_availability[arch].introduced <= arch_visibility[arch] ||
+ result.arch_availability[arch].introduced <= arch_min_api[arch]) {
result.arch_availability[arch].introduced = 0;
}
}
@@ -139,9 +140,8 @@
// Logically orred expressions that constitute the macro guard.
std::vector<std::string> expressions;
static const std::vector<std::pair<std::string, std::set<Arch>>> arch_sets = {
- { "", supported_archs },
- { "!defined(__LP64__)", { Arch::arm, Arch::x86 } },
- { "defined(__LP64__)", { Arch::arm64, Arch::riscv64, Arch::x86_64 } },
+ {"!defined(__LP64__)", {Arch::arm, Arch::x86}},
+ {"defined(__LP64__)", {Arch::arm64, Arch::riscv64, Arch::x86_64}},
};
std::map<Arch, std::string> individual_archs = {
{ Arch::arm, "defined(__arm__)" },
@@ -168,6 +168,9 @@
}
if (avail.global_availability.introduced == 0) {
+ // We currently get here for the "__sF" symbol because it's marked __REMOVED_IN(23). This
+ // symbol is the only use of __REMOVED_IN, and it's already guarded manually, so there's no
+ // need to do anything.
fprintf(stderr, "warning: attempted to generate guard with empty availability: %s\n",
to_string(avail).c_str());
return "";
@@ -186,25 +189,35 @@
D(" Checking arch set '%s'\n", arch_expr.c_str());
- int version = avail.arch_availability[*it.second.begin()].introduced;
+ int version = 0;
- // The maximum min_version of the set.
- int max_min_version = 0;
+ // Find the architectures that need to check __ANDROID_API__ and verify that they check against
+ // the same API level.
for (Arch arch : archs) {
- if (arch_min_api[arch] > max_min_version) {
- max_min_version = arch_min_api[arch];
- }
-
- if (avail.arch_availability[arch].introduced != version) {
+ const int arch_version = avail.arch_availability[arch].introduced;
+ if (arch_version == 0) {
+ continue;
+ } else if (version == 0) {
+ version = arch_version;
+ } else if (version != arch_version) {
D(" Skipping arch set, availability for %s doesn't match %s\n",
to_string(*it.second.begin()).c_str(), to_string(arch).c_str());
goto skip;
}
}
- // If all of the archs in the set have a min_api that satifies version, elide the check.
- if (max_min_version >= version) {
- version = 0;
+ // Verify that a non-zero version is acceptable to reuse for other archs with a higher minimum
+ // API, like riscv64. (e.g. It's OK to reuse an (__ANDROID_API__ >= 24) check if the arch's
+ // minimum API is 35.)
+ if (version != 0) {
+ for (Arch arch : archs) {
+ const int arch_version = avail.arch_availability[arch].introduced;
+ if (arch_version == 0 && version > arch_min_api[arch]) {
+ D(" Skipping arch set, availability for %s doesn't match %s\n",
+ to_string(*it.second.begin()).c_str(), to_string(arch).c_str());
+ goto skip;
+ }
+ }
}
expressions.emplace_back(generate_guard(arch_expr, version));
@@ -222,11 +235,7 @@
for (const auto& it : individual_archs) {
const std::string& arch_expr = it.second;
int introduced = avail.arch_availability[it.first].introduced;
- if (introduced == 0) {
- expressions.emplace_back(arch_expr);
- } else {
- expressions.emplace_back(generate_guard(arch_expr, introduced));
- }
+ expressions.emplace_back(generate_guard(arch_expr, introduced));
}
if (expressions.size() == 0) {
diff --git a/tools/versioner/src/versioner.cpp b/tools/versioner/src/versioner.cpp
index c818197..5afa00b 100644
--- a/tools/versioner/src/versioner.cpp
+++ b/tools/versioner/src/versioner.cpp
@@ -284,8 +284,8 @@
// If a function is declared as an inline before a certain version, the inline definition
// should have no version tag.
// 3. Each availability type must only be present globally or on a per-arch basis.
-// (e.g. __INTRODUCED_IN_ARM(9) __INTRODUCED_IN_X86(10) __DEPRECATED_IN(11) is fine,
-// but not __INTRODUCED_IN(9) __INTRODUCED_IN_X86(10))
+// (e.g. __INTRODUCED_IN_32(21) __INTRODUCED_IN_64(22) __DEPRECATED_IN(23) is fine,
+// but not __INTRODUCED_IN(9) __INTRODUCED_IN_32(10))
static bool checkSymbol(const Symbol& symbol) {
std::string cwd = getWorkingDir() + "/";
diff --git a/tools/versioner/tests/preprocessor/expected/foo.h b/tools/versioner/tests/preprocessor/expected/foo.h
index 769c37e..4f74927 100644
--- a/tools/versioner/tests/preprocessor/expected/foo.h
+++ b/tools/versioner/tests/preprocessor/expected/foo.h
@@ -54,21 +54,30 @@
// __INTRODUCED_IN_64(21) should be ignored.
-#if (!defined(__LP64__) && __ANDROID_API__ >= 13) || (defined(__LP64__))
-int multiple_introduced_1() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_X86(13) __INTRODUCED_IN_64(21);
-#endif /* (!defined(__LP64__) && __ANDROID_API__ >= 13) || (defined(__LP64__)) */
+#if (!defined(__LP64__) && __ANDROID_API__ >= 24) || (defined(__LP64__))
+int multiple_introduced_1() __INTRODUCED_IN_32(24) __INTRODUCED_IN_64(21);
+#endif /* (!defined(__LP64__) && __ANDROID_API__ >= 24) || (defined(__LP64__)) */
+
+
+// This needs different guards for 32 vs 64.
+
+#if (!defined(__LP64__) && __ANDROID_API__ >= 24) || (defined(__LP64__) && __ANDROID_API__ >= 26)
+int multiple_introduced_2() __INTRODUCED_IN_32(24) __INTRODUCED_IN_64(26);
+#endif /* (!defined(__LP64__) && __ANDROID_API__ >= 24) || (defined(__LP64__) && __ANDROID_API__ >= 26) */
+
+
+// This produces both an LP64 and a not-LP64 check, but it doesn't need to check for all 64-bit
+// targets separately.
+
+#if (!defined(__LP64__) && __ANDROID_API__ >= 23) || (defined(__LP64__) && __ANDROID_API__ >= 23)
+int multiple_introduced_3() __INTRODUCED_IN_32(23) __INTRODUCED_IN_64(23);
+#endif /* (!defined(__LP64__) && __ANDROID_API__ >= 23) || (defined(__LP64__) && __ANDROID_API__ >= 23) */
-#if (!defined(__LP64__) && __ANDROID_API__ >= 13) || (defined(__LP64__) && __ANDROID_API__ >= 22)
-int multiple_introduced_2() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_X86(13) __INTRODUCED_IN_64(22);
-#endif /* (!defined(__LP64__) && __ANDROID_API__ >= 13) || (defined(__LP64__) && __ANDROID_API__ >= 22) */
-
-
-
-#if (!defined(__LP64__) && __ANDROID_API__ >= 12) || (defined(__LP64__))
-int group_lp32() __INTRODUCED_IN_ARM(12) __INTRODUCED_IN_X86(12);
-#endif /* (!defined(__LP64__) && __ANDROID_API__ >= 12) || (defined(__LP64__)) */
+#if (!defined(__LP64__)) || (defined(__LP64__) && __ANDROID_API__ >= 28)
+int added_to_lp64_late() __INTRODUCED_IN_64(28);
+#endif /* (!defined(__LP64__)) || (defined(__LP64__) && __ANDROID_API__ >= 28) */
#if defined(__cplusplus)
diff --git a/tools/versioner/tests/preprocessor/headers/foo.h b/tools/versioner/tests/preprocessor/headers/foo.h
index 782b44a..b01d8a9 100644
--- a/tools/versioner/tests/preprocessor/headers/foo.h
+++ b/tools/versioner/tests/preprocessor/headers/foo.h
@@ -37,11 +37,16 @@
#endif
// __INTRODUCED_IN_64(21) should be ignored.
-int multiple_introduced_1() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_X86(13) __INTRODUCED_IN_64(21);
+int multiple_introduced_1() __INTRODUCED_IN_32(24) __INTRODUCED_IN_64(21);
-int multiple_introduced_2() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_X86(13) __INTRODUCED_IN_64(22);
+// This needs different guards for 32 vs 64.
+int multiple_introduced_2() __INTRODUCED_IN_32(24) __INTRODUCED_IN_64(26);
-int group_lp32() __INTRODUCED_IN_ARM(12) __INTRODUCED_IN_X86(12);
+// This produces both an LP64 and a not-LP64 check, but it doesn't need to check for all 64-bit
+// targets separately.
+int multiple_introduced_3() __INTRODUCED_IN_32(23) __INTRODUCED_IN_64(23);
+
+int added_to_lp64_late() __INTRODUCED_IN_64(28);
#if defined(__cplusplus)
}
diff --git a/tools/versioner/tests/preprocessor/run.sh b/tools/versioner/tests/preprocessor/run.sh
index 50d9b5c..b039656 100644
--- a/tools/versioner/tests/preprocessor/run.sh
+++ b/tools/versioner/tests/preprocessor/run.sh
@@ -4,7 +4,7 @@
SRC=$1
DST=$2
rm -rf $2
- versioner -a 9 -a 12 -a 13 -a 14 -a 15 $1 -i -o $2
+ versioner -a 9 -a 12 -a 13 -a 14 -a 15 -a 21 -a 23 $1 -i -o $2
diff -q -w -B $2 expected
}