46#define __kos_cplusplus 1
48#define __kos_cplusplus 0
51#define __KOS_INIT_FLAGS_0(flags) \
52 const uint32_t __kos_init_flags = (flags); \
53 KOS_INIT_FLAG(flags, INIT_NET, arch_init_net); \
54 KOS_INIT_FLAG(flags, INIT_NET, net_shutdown); \
55 KOS_INIT_FLAG(flags, INIT_NET, eth_init); \
56 KOS_INIT_FLAG(flags, INIT_NET, eth_shutdown); \
57 KOS_INIT_FLAG(flags, INIT_FS_ROMDISK, fs_romdisk_init); \
58 KOS_INIT_FLAG(flags, INIT_FS_ROMDISK, fs_romdisk_shutdown); \
59 KOS_INIT_FLAG(flags, INIT_FS_NULL, fs_null_init); \
60 KOS_INIT_FLAG(flags, INIT_FS_NULL, fs_null_shutdown); \
61 KOS_INIT_FLAG(flags, INIT_FS_PTY, fs_pty_init); \
62 KOS_INIT_FLAG(flags, INIT_FS_PTY, fs_pty_shutdown); \
63 KOS_INIT_FLAG(flags, INIT_FS_RAMDISK, fs_ramdisk_init); \
64 KOS_INIT_FLAG(flags, INIT_FS_RAMDISK, fs_ramdisk_shutdown); \
65 KOS_INIT_FLAG(flags, INIT_FS_RND, fs_rnd_init); \
66 KOS_INIT_FLAG(flags, INIT_FS_RND, fs_rnd_shutdown); \
67 KOS_INIT_FLAG(flags, INIT_FS_DEV, fs_dev_init); \
68 KOS_INIT_FLAG(flags, INIT_FS_DEV, fs_dev_shutdown); \
69 KOS_INIT_FLAG(flags, INIT_EXPORT, export_init); \
70 KOS_INIT_FLAG(flags, INIT_LIBRARY, library_init); \
71 KOS_INIT_FLAG(flags, INIT_LIBRARY, library_shutdown); \
72 KOS_INIT_FLAG_NONE(flags, INIT_NO_SHUTDOWN, kos_shutdown); \
73 KOS_INIT_FLAGS_ARCH(flags)
75#define __KOS_INIT_FLAGS_1(flags) \
77 __KOS_INIT_FLAGS_0(flags); \
80#define __KOS_INIT_FLAGS(flags, cp) \
81 __KOS_INIT_FLAGS_##cp(flags)
83#define _KOS_INIT_FLAGS(flags, cp) \
84 __KOS_INIT_FLAGS(flags, cp)
86extern const uint32_t __kos_init_flags;
102#define KOS_INIT_FLAGS(flags) \
103 _KOS_INIT_FLAGS(flags, __kos_cplusplus)
106#define KOS_INIT_ROMDISK(rd) \
107 const void *__kos_romdisk = (rd); \
108 extern void fs_romdisk_mount_builtin_legacy(void); \
109 void (*fs_romdisk_mount_builtin_legacy_weak)(void) = fs_romdisk_mount_builtin_legacy
116#define KOS_INIT_ROMDISK_NONE NULL
125#define KOS_INIT_EARLY(func) void (*__kos_init_early_fn)(void) = (func)
139#define INIT_DEFAULT (INIT_IRQ | INIT_THD_PREEMPT | INIT_FS_ALL | \
140 INIT_LIBRARY | INIT_DEFAULT_ARCH)
143#define INIT_FS_DEV (INIT_FS_NULL | INIT_FS_RND)
146#define INIT_FS_ALL (INIT_FS_ROMDISK | INIT_FS_RAMDISK | \
147 INIT_FS_PTY | INIT_FS_DEV)
149#define INIT_NONE 0x00000000
150#define INIT_THD_PREEMPT 0x00000000
151#define INIT_IRQ 0x00000001
152#define INIT_NET 0x00000002
153#define INIT_MALLOCSTATS 0x00000004
154#define INIT_QUIET 0x00000008
155#define INIT_EXPORT 0x00000010
156#define INIT_LIBRARY 0x00000010
158#define INIT_FS_ROMDISK 0x00000020
159#define INIT_FS_RAMDISK 0x00000040
160#define INIT_FS_PTY 0x00000080
161#define INIT_FS_NULL 0x00000100
162#define INIT_FS_RND 0x00000200
164#define INIT_NO_SHUTDOWN 0x00000400
Various common macros used throughout the codebase.
const void * __kos_romdisk
Built-in romdisk.
Shared initialization macros and utilities.
Dreamcast-specific initialization-related flags and macros.