Write vsnprintf() implementation

This commit is contained in:
2025-03-18 17:41:16 +01:00
parent 8674d32f77
commit 244b83d370
7 changed files with 138 additions and 27 deletions
+10 -4
View File
@@ -2,15 +2,16 @@
#define _KERNEL_H
// Null definition
#define NULL ((void*)0)
#define NULL ((void*)0)
/*
* Variable arguments
*/
typedef void* va_list;
#define va_start(ap, param) (void)((ap) = (char*)(&(param) + 1))
#define va_end(ap) (void)((ap) = 0)
#define va_arg(ap, type) (((type*)((ap) = ((ap) + sizeof(type))))[-1])
#define __va_align(size) ((size + sizeof(int) - 1) & ~(sizeof(int) - 1))
#define va_start(ap, param) (void)((ap) = (char*)(&(param) + 1))
#define va_end(ap) (void)((ap) = 0)
#define va_arg(ap, type) (*(type*)(((ap) += __va_align(sizeof(type))) - sizeof(type)))
/*
* Utility macros
@@ -67,6 +68,11 @@ typedef int32_t intptr_t;
#define true 1
#define false 0
/*
* Linker defined values
*/
extern uint32_t __kernel_start, __kernel_end;
/*
* Logging and errors
*/