36#if defined(__KOS_GCC_32MB__) || __KOS_GCC_PATCHLEVEL__ >= 2025062800
39#pragma message "Outdated toolchain: not patched for 32MB support, limiting "\
40 "KOS to 16MB-only behavior to retain maximum compatibility. Please "\
41 "update your toolchain."
42#define _arch_mem_top ((uint32) 0x8d000000)
50#define PAGESIZE_BITS 12
51#define PAGEMASK (PAGESIZE - 1)
56#define page_count ((_arch_mem_top - page_phys_base) / PAGESIZE)
59#define page_phys_base 0x8c010000
72#define THD_SCHED_HZ 100
83#define ELF_SYM_PREFIX "_"
86#define ELF_SYM_PREFIX_LEN 1
89#define ARCH_NAME "Dreamcast"
92#define ARCH_ELFCLASS ELFCLASS32
95#define ARCH_ELFDATA ELFDATA2LSB
98#define ARCH_CODE EM_SH
122#define ARCH_EXIT_RETURN 1
123#define ARCH_EXIT_MENU 2
124#define ARCH_EXIT_REBOOT 3
176#define HW_MEM_16 16777216
177#define HW_MEM_32 33554432
185#define HW_MEMSIZE (_arch_mem_top - 0x8c000000)
192#define DBL_MEM (_arch_mem_top - 0x8d000000)
254#define HW_TYPE_RETAIL 0x0
255#define HW_TYPE_SET5 0x9
256#define HW_TYPE_NAOMI 0xa
275#define HW_REGION_UNKNOWN 0x0
276#define HW_REGION_ASIA 0x1
277#define HW_REGION_US 0x4
278#define HW_REGION_EUROPE 0xC
303 __asm__ __volatile__(
"sleep\n");
const char *__pure2 kos_get_banner(void)
const char *__pure2 kos_get_authors(void)
const char *__pure2 kos_get_license(void)
Various common macros used throughout the codebase.
ELF binary loading support.
void arch_return(int ret_code) __noreturn
Kernel "return" point.
void hardware_shutdown(void)
Shut down hardware that was initted.
void arch_reboot(void) __noreturn
Kernel "reboot" call.
static bool arch_valid_text_address(uintptr_t ptr)
Returns true if the passed address is in the text section of your program.
Definition arch.h:324
char _executable_start
Start and End address for .text portion of program.
static void arch_sleep(void)
Dreamcast specific sleep mode function.
Definition arch.h:302
int mm_init(void)
Initialize the memory management system.
void arch_main(void) __noreturn
Kernel C-level entry point.
int hardware_sys_init(void)
Initialize bare-bones hardware systems.
void * mm_sbrk(unsigned long increment)
Request more core memory from the system.
#define _arch_mem_top
Top of memory available, depending on memory size.
Definition arch.h:42
static const unsigned HZ("Please use the new THD_SCHED_HZ macro.")
Legacy symbol for scheduler frequency.
int hardware_periph_init(void)
Initialize some peripheral systems.
void arch_set_exit_path(int path)
Set the exit path.
void arch_exit(void) __noreturn
Generic kernel "exit" point.
void arch_abort(void) __noreturn
Kernel "abort" point.
void arch_menu(void) __noreturn
Kernel "exit to menu" call.
void arch_panic(const char *str) __noreturn
Panic function.
#define THD_SCHED_HZ
Scheduler interrupt frequency.
Definition arch.h:72
static bool arch_valid_address(uintptr_t ptr)
Returns true if the passed address is likely to be valid.
Definition arch.h:313
int hardware_sys_mode(int *region)
Retrieve the system mode of the console in use.
#define __noreturn
Identify a function that will never return.
Definition cdefs.h:49
unsigned long uint32
32-bit unsigned integer
Definition types.h:33
Initialization-related flags and macros.