sdk: Add initial SDK sources

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-03-25 03:04:46 -04:00
parent fb2a2955c8
commit 1d5c22cd8a
3 changed files with 110 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ CFLAGS = \
$(SYS_CFLAGS) \
-D_KERNEL \
-MMD \
-I../../sdk/include/ \
-DPRINTF_DISABLE_SUPPORT_PTRDIFF_T \
-DPRINTF_DISABLE_SUPPORT_FLOAT

14
src/sdk/include/_null.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef _SDK_NULL_H_
#define _SDK_NULL_H_ 1
#if !defined(__cplusplus)
#define NULL ((void *)0)
#else
#if __cplusplus >= 201103L
#define NULL nullptr
#else
#define NULL ((void *)0)
#endif /* __cplusplus >= 201103L */
#endif /* __cplusplus */
#endif /* !_SDK_NULL_H_ */

95
src/sdk/include/stdint.h Normal file
View File

@@ -0,0 +1,95 @@
/*
* Copyright (c) 2026, Mirocom Laboratories
* Provided under the BSD-3 clause
*/
#ifndef _SDK_STDINT_H_
#define _SDK_STDINT_H_ 1
#if defined(_KERNEL) || defined(_M1X_SOURCE)
#include <_null.h>
#ifndef bool
typedef _Bool bool;
#endif /* !bool */
#ifndef true
#define true 1
#endif /* !true */
#ifndef false
#define false 0
#endif /* !false */
#endif /* !_KERNEL || _M1X_SOURCE */
/* Unsigned types */
typedef unsigned char __uint8_t;
typedef unsigned short __uint16_t;
typedef unsigned int __uint32_t;
typedef unsigned long long __uint64_t;
typedef __uint64_t __size_t;
typedef __uint64_t __uintptr_t;
/* Signed types */
typedef int __int8_t;
typedef short __int16_t;
typedef int __int32_t;
typedef long long __int64_t;
typedef __int64_t __ssize_t;
typedef __ssize_t __off_t;
#if defined(_KERNEL) || defined(_M1X_SOURCE)
#ifndef uint8_t
typedef __uint8_t uint8_t;
#endif /* !uint8_t */
#ifndef uint16_t
typedef __uint16_t uint16_t;
#endif /* !uint16_t */
#ifndef uint32_t
typedef __uint32_t uint32_t;
#endif /* !uint32_t */
#ifndef uint64_t
typedef __uint64_t uint64_t;
#endif /* !uint64_t */
#ifndef uintptr_t
typedef __uint64_t uintptr_t;
#endif /* !uintptr_t */
#ifndef size_t
typedef __size_t size_t;
#endif /* !size_t */
#ifndef int8_t
typedef __int8_t int8_t;
#endif /* !int8_t */
#ifndef int16_t
typedef __int16_t int16_t;
#endif /* !int16_t */
#ifndef int16_t
typedef __int32_t int32_t;
#endif /* !int32_t */
#ifndef int64_t
typedef __int64_t int64_t;
#endif /* !int64_t */
#ifndef ssize_t
typedef __ssize_t ssize_t;
#endif /* !ssize_t */
#ifndef intmax_t
typedef __ssize_t intmax_t;
#endif /* !intmax_t */
#endif /* !_KERNEL || _M1X_SOURCE */
typedef int pid_t;
#endif /* !_SDK_STDINT_H_ */