mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-22 18:40:29 +00:00
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:
parent
9b55dbe417
commit
4a59210008
115 changed files with 699 additions and 422 deletions
|
@ -19,13 +19,13 @@
|
|||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/log/color.internal.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/mem/gc.h"
|
||||
#include "libc/nexgen32e/cpuid4.internal.h"
|
||||
#include "libc/nexgen32e/nexgen32e.h"
|
||||
#include "libc/nexgen32e/rdtscp.h"
|
||||
#include "libc/nexgen32e/x86feature.h"
|
||||
#include "libc/nexgen32e/x86info.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/xasprintf.h"
|
||||
|
|
|
@ -481,17 +481,17 @@ static void *NewBoard(size_t *out_size) {
|
|||
char *p;
|
||||
size_t s, n, k;
|
||||
s = (byn * bxn) >> 3;
|
||||
k = GUARDSIZE + ROUNDUP(s, GUARDSIZE);
|
||||
n = ROUNDUP(k + GUARDSIZE, FRAMESIZE);
|
||||
k = APE_GUARDSIZE + ROUNDUP(s, APE_GUARDSIZE);
|
||||
n = ROUNDUP(k + APE_GUARDSIZE, FRAMESIZE);
|
||||
p = _mapanon(n);
|
||||
mprotect(p, GUARDSIZE, 0);
|
||||
mprotect(p, APE_GUARDSIZE, 0);
|
||||
mprotect(p + k, n - k, 0);
|
||||
if (out_size) *out_size = n;
|
||||
return p + GUARDSIZE;
|
||||
return p + APE_GUARDSIZE;
|
||||
}
|
||||
|
||||
static void FreeBoard(void *p, size_t n) {
|
||||
munmap((char *)p - GUARDSIZE, n);
|
||||
munmap((char *)p - APE_GUARDSIZE, n);
|
||||
}
|
||||
|
||||
static void AllocateBoardsWithHardwareAcceleratedMemorySafety(void) {
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/x/xgetline.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue