Files
mango/arch/user/include/mango/machine/init.h
2026-02-08 12:32:48 +00:00

32 lines
729 B
C

#ifndef MANGO_X86_64_INIT_H_
#define MANGO_X86_64_INIT_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define __X2(x) #x
#define __X(x) __X2(x)
#ifdef __APPLE__
#define __define_initcall(fn, id) \
static initcall_t __initcall_##fn##id __used __section( \
"__DATA,__initcall" __X(id) ".init") \
= (fn)
#else
#define __define_initcall(fn, id) \
static initcall_t __initcall_##fn##id __used __section( \
"initcall" __X(id) "_init") \
= (fn)
#endif
extern int ml_init(uintptr_t arg);
#ifdef __cplusplus
}
#endif
#endif