From 34492a4386446fc82220fe0684ff521d760e84bd Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sun, 26 Nov 2023 09:47:21 -0300 Subject: Move the system heap and the framebuffers to their own segments (#1488) * make segments for the systemheap and the framebuffers * define in the makefile * undefined syms * Make segments for the pre boot buffers too * Update spec Co-authored-by: Parker <20159000+jpburnett@users.noreply.github.com> * review * Update spec Co-authored-by: Parker <20159000+jpburnett@users.noreply.github.com> * Update Makefile Co-authored-by: Dragorn421 * comments * comment * move comment about the hardcoded address to buffers.h * rewrite SYSTEM_HEAP_END_ADDR in terms of other symbols * Use `ALIGNED` on all the buffers * Rename SYSTEM_HEAP_END_ADDR to FRAMEBUFFERS_START_ADDR * Put ALIGNED at the right like the rest of the codebase * merge * gLoBuffer * gHiBuffer * Add a static assert to ensure the address of gHiBuffer haven't shifted without the user noticing * smol include cleanup --------- Co-authored-by: Parker <20159000+jpburnett@users.noreply.github.com> Co-authored-by: Dragorn421 --- include/libc/assert.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/libc/assert.h (limited to 'include/libc') diff --git a/include/libc/assert.h b/include/libc/assert.h new file mode 100644 index 000000000..7fee0a815 --- /dev/null +++ b/include/libc/assert.h @@ -0,0 +1,21 @@ +#ifndef LIBC_ASSERT_H +#define LIBC_ASSERT_H + +// Static/compile-time assertions + +#if (__STDC_VERSION__ >= 202311L) +// static_assert is a keyword in C23, do not define it +#elif (__STDC_VERSION__ >= 201112L) +# define static_assert(cond, msg) _Static_assert(cond, msg) +#else +# ifndef GLUE +# define GLUE(a, b) a##b +# endif +# ifndef GLUE2 +# define GLUE2(a, b) GLUE(a, b) +# endif + +# define static_assert(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1] +#endif + +#endif -- cgit v1.2.3