aboutsummaryrefslogtreecommitdiff
path: root/sys/linux/amd64/bits.h
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-11-15 15:10:35 -0800
committerNicholas <nbnoll@eml.cc>2021-11-15 15:10:35 -0800
commit0b8cebc1f074626f3c3e43a26152a3034ada7153 (patch)
tree8eb1cae101b089680830ad89606ee618357f9bd6 /sys/linux/amd64/bits.h
parente9ff1c6fbbbac9ece2604876ab589ac282360446 (diff)
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...
Diffstat (limited to 'sys/linux/amd64/bits.h')
-rw-r--r--sys/linux/amd64/bits.h18
1 files changed, 18 insertions, 0 deletions
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