50#define __kos_cplusplus 1
52#define __kos_cplusplus 0
55#define __KOS_INIT_FLAGS_0(flags) \
56 const uint32_t __kos_init_flags = (flags); \
57 KOS_INIT_FLAG(flags, INIT_NET, arch_init_net); \
58 KOS_INIT_FLAG(flags, INIT_NET, net_shutdown); \
59 KOS_INIT_FLAG(flags, INIT_NET, bba_la_init); \
60 KOS_INIT_FLAG(flags, INIT_NET, bba_la_shutdown); \
61 KOS_INIT_FLAG(flags, INIT_FS_ROMDISK, fs_romdisk_init); \
62 KOS_INIT_FLAG(flags, INIT_FS_ROMDISK, fs_romdisk_shutdown); \
63 KOS_INIT_FLAG(flags, INIT_FS_NULL, fs_null_init); \
64 KOS_INIT_FLAG(flags, INIT_FS_NULL, fs_null_shutdown); \
65 KOS_INIT_FLAG(flags, INIT_FS_PTY, fs_pty_init); \
66 KOS_INIT_FLAG(flags, INIT_FS_PTY, fs_pty_shutdown); \
67 KOS_INIT_FLAG(flags, INIT_FS_RAMDISK, fs_ramdisk_init); \
68 KOS_INIT_FLAG(flags, INIT_FS_RAMDISK, fs_ramdisk_shutdown); \
69 KOS_INIT_FLAG(flags, INIT_FS_RND, fs_rnd_init); \
70 KOS_INIT_FLAG(flags, INIT_FS_RND, fs_rnd_shutdown); \
71 KOS_INIT_FLAG(flags, INIT_FS_DEV, fs_dev_init); \
72 KOS_INIT_FLAG(flags, INIT_FS_DEV, fs_dev_shutdown); \
73 KOS_INIT_FLAG(flags, INIT_EXPORT, export_init); \
74 KOS_INIT_FLAG(flags, INIT_LIBRARY, library_init); \
75 KOS_INIT_FLAG(flags, INIT_LIBRARY, library_shutdown); \
76 KOS_INIT_FLAG_NONE(flags, INIT_NO_SHUTDOWN, kos_shutdown); \
77 KOS_INIT_FLAGS_ARCH(flags)
79#define __KOS_INIT_FLAGS_1(flags) \
81 __KOS_INIT_FLAGS_0(flags); \
84#define __KOS_INIT_FLAGS(flags, cp) \
85 __KOS_INIT_FLAGS_##cp(flags)
87#define _KOS_INIT_FLAGS(flags, cp) \
88 __KOS_INIT_FLAGS(flags, cp)
90extern const uint32_t __kos_init_flags;
106#define KOS_INIT_FLAGS(flags) \
107 _KOS_INIT_FLAGS(flags, __kos_cplusplus)
110#define KOS_INIT_ROMDISK(rd) \
111 const void *__kos_romdisk = (rd); \
112 extern void fs_romdisk_mount_builtin_legacy(void); \
113 void (*fs_romdisk_mount_builtin_legacy_weak)(void) = fs_romdisk_mount_builtin_legacy
120#define KOS_INIT_ROMDISK_NONE NULL
129#define KOS_INIT_EARLY(func) void (*__kos_init_early_fn)(void) = (func)
143#define INIT_DEFAULT (INIT_IRQ | INIT_THD_PREEMPT | INIT_FS_ALL | \
144 INIT_LIBRARY | INIT_DEFAULT_ARCH)
147#define INIT_FS_DEV (INIT_FS_NULL | INIT_FS_RND)
150#define INIT_FS_ALL (INIT_FS_ROMDISK | INIT_FS_RAMDISK | \
151 INIT_FS_PTY | INIT_FS_DEV)
153#define INIT_NONE 0x00000000
154#define INIT_THD_PREEMPT 0x00000000
155#define INIT_IRQ 0x00000001
156#define INIT_NET 0x00000002
157#define INIT_MALLOCSTATS 0x00000004
158#define INIT_QUIET 0x00000008
159#define INIT_EXPORT 0x00000010
160#define INIT_LIBRARY 0x00000010
162#define INIT_FS_ROMDISK 0x00000020
163#define INIT_FS_RAMDISK 0x00000040
164#define INIT_FS_PTY 0x00000080
165#define INIT_FS_NULL 0x00000100
166#define INIT_FS_RND 0x00000200
168#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.