From 994847a73e30f7989790c86d17a9e85876b855bf Mon Sep 17 00:00:00 2001 From: "Chloe M." Date: Sun, 21 Jun 2026 22:56:27 +0000 Subject: [PATCH] initial commit Signed-off-by: Chloe M. --- .gitignore | 7 ++++ README.md | 4 +++ sdk/head/stdef.h | 90 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 sdk/head/stdef.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e56dfc5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.o +*.d +*.sys +*.iso +*.img +/artifacts +/paw/boot/stand/limine diff --git a/README.md b/README.md new file mode 100644 index 0000000..f77e086 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# SystemPaw3 + +Hewwo !! SystemPaw3 is a wovely continuation of the SystemPaw DR operating system and exists as a system +with a further solidified core. diff --git a/sdk/head/stdef.h b/sdk/head/stdef.h new file mode 100644 index 0000000..c9191e9 --- /dev/null +++ b/sdk/head/stdef.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2026, Chloe M. + * Provided under the BSD-3 clause. + * + * Description: Standard SystemPaw definitions + * Author: Chloe M. + */ + +#ifndef _SDK_STDEF_H_ +#define _SDK_STDEF_H_ 1 + +/* Boolean values */ +#define true 1 +#define false 0 + +#if !defined(__cplusplus) +#define NULL ((void *)0) +#else +#if __cplusplus >= 201103L +#define NULL nullptr +#else +#define NULL ((void *)0) +#endif /* __cplusplus >= 201103L */ +#endif /* __cplusplus */ + +/* Compiler specific definitions */ +#define ASMV __asm__ __volatile__ +#define ATTR(X) __attribute__((X)) +#define SECTION(X) ATTR(section((X))) +#define ALIGN(N) ATTR(aligned((N))) +#define PACKED ATTR(packed) +#define NO_RETURN ATTR(noreturn) +#define ALWAYS_INLINE ATTR(always_inline) +#define BARRIER() ASMV("" ::: "memory") + +/* Pointer offset macros */ +#define PTR_OFFSET(p, off) ((void *)(char *)(p) + (off)) +#define PTR_NOFFSET(p, off) ((void *)(char *)(p) - (off)) + +/* Bit related macros */ +#define BIT(n) (1ULL << (n)) +#define ISSET(v, f) ((v) & (f)) + +/* Align up/down a value */ +#define ALIGN_DOWN(value, align) ((value) & ~((align)-1)) +#define ALIGN_UP(value, align) (((value) + (align)-1) & ~((align)-1)) + +/* Bitmap helper macros */ +#define SETBIT(a, b) ((a)[(b) >> 3] |= BIT(b % 8)) +#define CLRBIT(a, b) ((a)[(b) >> 3] &= ~BIT(b % 8)) +#define TESTBIT(a, b) (ISSET((a)[(b) >> 3], BIT(b % 8))) + +/* Min/max macros */ +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#define MAX(a,b) (((a) > (b)) ? (a) : (b)) + +/* Get number of array elements */ +#define NELEM(a) (sizeof(a) / sizeof(a[0])) + +/* Basic types */ +typedef void VOID; +typedef _Bool BOOLEAN; + +/* Basic signed types */ +typedef char CHAR; +typedef short SHORT; +typedef int LONG; +typedef long long QUAD; +typedef QUAD SSIZE; + +/* Basic unsigned types */ +typedef unsigned char UCHAR; +typedef unsigned short USHORT; +typedef unsigned int ULONG; +typedef unsigned long long UQUAD; +typedef UQUAD USIZE; +typedef UQUAD UPTR; + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST +typedef __builtin_va_list __gnuc_va_list; +#endif /* __GNUC_VA_LIST */ + +typedef __gnuc_va_list va_list; + +#define va_start(ap, last) __builtin_va_start((ap), last) +#define va_end(ap) __builtin_va_end((ap)) +#define va_arg(ap, type) __builtin_va_arg((ap), type) + +#endif /* !_SDK_STDEF_H_ */