If there is an active loader service and it supports obtaining
a new connection, this function will return a new connection.
Change-Id: I58fe4d2450dc656340ed352424ef095ad19227fe
FILE->lock is atomic_int and so should be read using atomic_load.
Previously this wasn't reported, but with a new Clang this is
triggering an error because of -Wtautological-unsigned-zero-compare.
Change-Id: I3fe11f4be356a96d688e90614a9498d3c9eba05e
These are taken verbatim from Linaro's cortex-strings. memset is
from an older version of cortex-strings that does not use NEON. The
current cortex-strings memcpy (also now used in libc) never used NEON.
MG-526 #done
Change-Id: Ic01878a1c702c3677103e5db0c67ce114e201183
These are taken verbatim from Linaro's cortex-strings package.
One mechanical cosmetic change to the assembly was necessary for
it to build with Clang/LLVM's assembler because the Linaro code
was using a GAS variant of the official syntax instead of what
the ARMv8 manual says to use. We can revert that to go back
to verbatim when https://bugs.llvm.org//show_bug.cgi?id=34488 is fixed.
MG-1111 #done
Change-Id: I186ee61b9184f247ba77a27622389eee4bde493c
This makes the code more readable and it makes the functions
doing memory access susceptible to sanitizer instrumentation.
Change-Id: I5bb0c627e82ae2a584f9f00a7d00c2f88b8eab9e
The ASan runtime intercepts memcpy to provide checking on its pointer
arguments, but expects libc's mempcpy to do its own checking. So use
the vanilla C version that will just call the intercepted memcpy.
Change-Id: I06b3d46410d2ea85916b9e8de3507f6e577d1018
This makes the code more readable and it makes the functions
doing memory access susceptible to sanitizer instrumentation.
Change-Id: I846eaa1f7246eea69a2831e6e011248b3eab6db0
Rewrite _dl_start to be more readable and not use a stack array.
It now depends on ld.so being linked with -z combreloc so it can
use optimal code relying on DT_RELACOUNT. Also clear out some
remaining MIPS reloc support and drop the IS_RELATIVE macro.
Change-Id: Ia8e97db9edcd74c6c55351ebbd0fe5f38f0ab317
According to the PCIe Base Spec section 7.2 all PCIe devices
must be compatible with PCI 3.0 configuration accesses. This
change standarizes the ACPI OS abstraction layer to only use PIO
access for ACPI initialization. This results in us not needing
to do any error prone probing and cuts down on assumptions we
need to make around the hardware the system is running on.
As an added bonus, it greatly reduces the complexity of the
abstraction layer between ACPICA and magenta.
Change-Id: I3c30b73058a0c4c6c361f2d17ca8d15a27bda050
Add a few cmdline-tweakable parameters for the jitterentropy entropy
collector. The cmdlines are used to support MG-1022 (optimizing
jitterentropy's parameter values).
Change-Id: I1d78c49738edf498819097b8f0bc85b1803cf445
- use modern standard types
- use ansi C definitions
- regularize type usage
- make buildable in kernel again
Change-Id: I16ba18f8c75dcbc3b9e1403bcb0c7fcfb97b1af0
This constant is used by launchpad to decide how big the initial
stack needs to be (in addition to the bootstrap message size).
So it must be sufficient for all the stack use in the dynamic
linker and libc startup path (not including the bootstrap message
size), up until the point where __libc_start_main switches
stacks. The actual stack size is always rounded up to whole
pages, so it's worthwhile to keep this size smaller than a page
so that when the bootstrap message is small the initial stack
only needs one page.
Current stack usage is comfortably under 3k, but more than 2k.
So with the old size of 2k, a bootstrap message size (modulo page
size, 4k) that is between around 1500 and around 1900 would be
too large to leave enough stack space but too small to push
launchpad's calculation up to using another page of stack.
MG-1038 #done
Change-Id: Ia1aadc39aa4717f8ff75ade0087eccb74cafb6d2
The indirection added to fix the restrict violation reintroduces the
race between the start of the new thread and the side effects
(including writing the out parameter) of the calling thread. It seems
better for the moment to fix thread self detaching, and then invert
the flow of control between thrd_create and pthread_create.
Revert "[musl][threads] Fix a restrict violation between thrd_create and pthread_create"
This reverts commit 0f118a2f01.
Change-Id: Id9bccfa85c2ced24c6916ea8f9de4b7b31ceccf6
Upstream, these always succeed (assuming correct usage). We added some
best-effort error detection. This means we need to return the
thrd_*-style values rather than the errno style values from
thrd_detach.
Change-Id: Ic1b34980b9ee87552a5e18e7db2ed0fed70e2041
After starting the new thread, it may immediately exit and clean up
the thread structure. It's not safe to access the struct after that
call.
Also, write the thrd_t pointer out before starting. Newly C11 threads
synchronize with the end of the thread creation function, so the side
effects must be visible prior to that.
Change-Id: I76ca2563507106dfc2ea2384002606306654ecf5
Create a crypto::entropy::Collector subclass for jitterentropy.
Note: this class is intentionally not used to seed the global PRNG yet.
That will come after we've tested jitterentropy and determined the
right parameters to use.
Change-Id: Ia125b1a3d396c402a44984bd418a490e2f68adbd
Unlocking is not necessary, as our process is moribund. But it's good hygiene,
and removes a warning from static analysis.
Change-Id: I6bbca9585edc039ea91a2a63a76675454de56e75
After much effort, the BoringSSL team managed to get a subset of their
codebase through FIPS-140-2 certification. Unfortunately, they've named
the subset "BoringCrypto". To avoid the kind of confusion that agencies
that care about FIPS are particularly senstive to, this CL renames the
kernel's subset to uboringssl, pronounced 'micro-boringssl' with 'u' as
a stand-in for mu.
Change-Id: I4778a1847acc4451249f6f10f179c10bfb651454
With this, turning on the debug output is mostly just specifying
ENABLE_ACPI_DEBUG=1 while building. Docs coming soon for how to use the ACPICA
debug interfaces.
Change-Id: I14ccdeedad004e3d127861a6b2f2201e499026f4
Previously I had not implemented timeouts, which was causing deadlocks
due to ACPICA's internal locking scheme.
MG-1012 #done
MG-1005 #done
Change-Id: Ib75a41d409cc8e44034d47aee22d10db6e5f137a
Both the 'i' and 'j' suffixes on a floating-point literal to mean
"imaginary" are GNU extensions. But ToT Clang (r310423) has stopped
accepting 'i' in non-GNU -std= modes, while it still accepts 'j'.
Change-Id: If76ce3176f0bd2e38f625657c68417bd9e4708a9
When removing SYS_clone, I unwrapped this particular syscall() macro
wrongly. This extra-bogus return is confusing some test suites.
Change-Id: If5a1e32cd421f1ce79b078194af25e97adbf026e
The LDSO_ARCH name is no longer used.
CRTJMP was used on linux to jump to the entry point. We use a
different mechanism to return a function pointer and argument to _start.
Change-Id: Iad96d518f0664a74f9c780d9064439db68a0f3b9