From 0b8cebc1f074626f3c3e43a26152a3034ada7153 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 15 Nov 2021 15:10:35 -0800 Subject: Feat: prototype of self-hosted library This is very much a work in progress. Still ruminating on the structure of the library. It feels right but I want a more "social" presence - namely the ability to link to a libc seemlessly. The solution is most likely weak aliasing that musl uses - but musl itself weak aliases global symbols, e.g malloc. We would have to define weak internal symbols that musl defines as strong links but this knows too much about the internals of musl... --- sys/linux/amd64/bits.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sys/linux/amd64/bits.h (limited to 'sys/linux/amd64/bits.h') diff --git a/sys/linux/amd64/bits.h b/sys/linux/amd64/bits.h new file mode 100644 index 0000000..e72e4e8 --- /dev/null +++ b/sys/linux/amd64/bits.h @@ -0,0 +1,18 @@ +#pragma once + +/* base types */ +#define INT8 char +#define INT16 short +#define INT32 int +#define INT64 long +#define ADDR long + +/* ABI */ +#define PAGESIZE 4096 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#define SIZE_MAX UINT64_MAX +#define LONG_MAX 0x7fffffffffffffffL -- cgit v1.2.1