Introduce #include <cosmo.h> to toolchain users

This change improves the way internal APIs are being hidden behind the
`COSMO` define. The cosmo.h header will take care of defining that, so
that a separate define statement isn't needed. This change also does a
lot more to define which APIs are standard, and which belong to Cosmo.
This commit is contained in:
Justine Tunney 2023-06-09 18:02:06 -07:00
parent 9b55dbe417
commit 4a59210008
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
115 changed files with 699 additions and 422 deletions

View file

@ -1465,7 +1465,7 @@ static textstartup void __asan_shadow_mapping(struct MemoryIntervals *m,
static textstartup void __asan_shadow_existing_mappings(void) {
__asan_shadow_mapping(&_mmi, 0);
__asan_map_shadow(GetStackAddr(), GetStackSize());
__asan_poison((void *)GetStackAddr(), GUARDSIZE, kAsanStackOverflow);
__asan_poison((void *)GetStackAddr(), APE_GUARDSIZE, kAsanStackOverflow);
}
forceinline ssize_t __write_str(const char *s) {
@ -1492,7 +1492,7 @@ void __asan_init(int argc, char **argv, char **envp, intptr_t *auxv) {
__asan_shadow_existing_mappings();
__asan_map_shadow((uintptr_t)__executable_start, _end - __executable_start);
__asan_map_shadow(0, 4096);
__asan_poison(0, GUARDSIZE, kAsanNullPage);
__asan_poison(0, APE_GUARDSIZE, kAsanNullPage);
if (!IsWindows()) {
sys_mprotect((void *)0x7fff8000, 0x10000, PROT_READ);
}