towards multi-arch

This commit is contained in:
Christian Dietrich
2021-08-16 10:59:38 +02:00
parent 39c0e0681e
commit a3fa6ea4ab
19 changed files with 488 additions and 38 deletions

24
lib.c Normal file
View File

@ -0,0 +1,24 @@
#pragma once
#define INLINE __attribute__((always_inline)) inline
#define NOINLINE __attribute__((noinline))
#define __QUOTE(x) #x
#define QUOTE(x) __QUOTE(x)
#define MARKER(str) __asm__ volatile(QUOTE(str) ":" \
: /* no inputs */ \
: /* no outputs */ \
: "memory", ARCH_ASM_CLOBBER_ALL \
)
#ifndef DEBUG
#define MAIN() void os_main(void)
#define PRINT_DEBUG(...)
#else
#include <stdio.h>
#define MARKER(str) printf(QUOTE(str) "\n")
#define DEBUG 1
#define PRINT_DEBUG(...) printf(__VA_ARGS__)
#define MAIN() void main(int argc, char** argv)
#endif