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_ALL, fs_init); \
58 KOS_INIT_FLAG(flags, INIT_FS_ALL, fs_shutdown); \
59 KOS_INIT_FLAG(flags, INIT_FS_ROMDISK, fs_romdisk_init); \
60 KOS_INIT_FLAG(flags, INIT_FS_ROMDISK, fs_romdisk_shutdown); \
61 KOS_INIT_FLAG(flags, INIT_FS_NULL, fs_null_init); \
62 KOS_INIT_FLAG(flags, INIT_FS_NULL, fs_null_shutdown); \
63 KOS_INIT_FLAG(flags, INIT_FS_PTY, fs_pty_init); \
64 KOS_INIT_FLAG(flags, INIT_FS_PTY, fs_pty_shutdown); \
65 KOS_INIT_FLAG(flags, INIT_FS_RAMDISK, fs_ramdisk_init); \
66 KOS_INIT_FLAG(flags, INIT_FS_RAMDISK, fs_ramdisk_shutdown); \
67 KOS_INIT_FLAG(flags, INIT_FS_RND, fs_rnd_init); \
68 KOS_INIT_FLAG(flags, INIT_FS_RND, fs_rnd_shutdown); \
69 KOS_INIT_FLAG(flags, INIT_FS_DEV, fs_dev_init); \
70 KOS_INIT_FLAG(flags, INIT_FS_DEV, fs_dev_shutdown); \
71 KOS_INIT_FLAG(flags, INIT_EXPORT, export_init); \
72 KOS_INIT_FLAG(flags, INIT_LIBRARY, library_init); \
73 KOS_INIT_FLAG(flags, INIT_LIBRARY, library_shutdown); \
74 KOS_INIT_FLAG_NONE(flags, INIT_NO_SHUTDOWN, kos_shutdown); \
75 KOS_INIT_FLAGS_ARCH(flags)
77#define __KOS_INIT_FLAGS_1(flags) \
79 __KOS_INIT_FLAGS_0(flags); \
82#define __KOS_INIT_FLAGS(flags, cp) \
83 __KOS_INIT_FLAGS_##cp(flags)
85#define _KOS_INIT_FLAGS(flags, cp) \
86 __KOS_INIT_FLAGS(flags, cp)
88extern const uint32_t __kos_init_flags;
104#define KOS_INIT_FLAGS(flags) \
105 _KOS_INIT_FLAGS(flags, __kos_cplusplus)
108#define KOS_INIT_ROMDISK(rd) \
109 const void *__kos_romdisk = (rd); \
110 extern void fs_romdisk_mount_builtin_legacy(void); \
111 void (*fs_romdisk_mount_builtin_legacy_weak)(void) = fs_romdisk_mount_builtin_legacy
118#define KOS_INIT_ROMDISK_NONE NULL
127#define KOS_INIT_EARLY(func) void (*__kos_init_early_fn)(void) = (func)
141#define INIT_DEFAULT (INIT_IRQ | INIT_THD_PREEMPT | INIT_FS_ALL | \
142 INIT_LIBRARY | INIT_DEFAULT_ARCH)
145#define INIT_FS_DEV (INIT_FS_NULL | INIT_FS_RND)
148#define INIT_FS_ALL (INIT_FS_ROMDISK | INIT_FS_RAMDISK | \
149 INIT_FS_PTY | INIT_FS_DEV)
151#define INIT_NONE 0x00000000
152#define INIT_THD_PREEMPT 0x00000000
153#define INIT_IRQ 0x00000001
154#define INIT_NET 0x00000002
155#define INIT_MALLOCSTATS 0x00000004
156#define INIT_QUIET 0x00000008
157#define INIT_EXPORT 0x00000010
158#define INIT_LIBRARY 0x00000010
160#define INIT_FS_ROMDISK 0x00000020
161#define INIT_FS_RAMDISK 0x00000040
162#define INIT_FS_PTY 0x00000080
163#define INIT_FS_NULL 0x00000100
164#define INIT_FS_RND 0x00000200
166#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.