some progress
This commit is contained in:
+24
-7
@@ -8,18 +8,35 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if COM_DEF_TARGET == COM_DEF_TARGET_LINUX
|
||||
#include <sys/syscall.h>
|
||||
|
||||
static inline long com_std_syscall(long number, long arg1, long arg2,
|
||||
long arg3) {
|
||||
long ret;
|
||||
__asm__ volatile("syscall"
|
||||
: "=a"(ret)
|
||||
: "a"(number), "D"(arg1), "S"(arg2), "d"(arg3)
|
||||
: "rcx", "r11", "memory");
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* TODO: Remove, use buffer semantics instead. */
|
||||
/* Note: Freeing is done by passing 0 size to pointer. */
|
||||
extern void *com_std_alloc(void *ptr, size_t size);
|
||||
void *com_std_alloc(void *ptr, size_t size);
|
||||
|
||||
/* Note: Functions listed below are only available for dev builds. */
|
||||
/* Trigonometry functions are for reference testing of our own fixed point
|
||||
* implementations. Do not use otherwise. */
|
||||
extern void com_std_assert(bool holds);
|
||||
extern void com_std_printf(char const *fmt, ...);
|
||||
extern double com_std_sqrt(double v);
|
||||
extern double com_std_fabs(double v);
|
||||
extern double com_std_sin(double v);
|
||||
extern double com_std_cos(double v);
|
||||
void com_std_assert(bool holds);
|
||||
void com_std_printf(char const *fmt, ...);
|
||||
void com_std_print_str(char const *str, uint32_t len, bool newline);
|
||||
double com_std_sqrt(double v);
|
||||
double com_std_fabs(double v);
|
||||
double com_std_sin(double v);
|
||||
double com_std_cos(double v);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user