48#ifdef __KOS_GCC_32MB__
51#pragma message "Outdated toolchain: not patched for 32MB support, limiting "\
52 "KOS to 16MB-only behavior to retain maximum compatibility. Please "\
53 "update your toolchain."
54#define _arch_mem_top ((uint32) 0x8d000000)
62#define PAGESIZE_BITS 12
63#define PAGEMASK (PAGESIZE - 1)
68#define page_count ((_arch_mem_top - page_phys_base) / PAGESIZE)
71#define page_phys_base 0x8c010000
84#define THD_SCHED_HZ 100
96#define THD_STACK_SIZE 32768
99#ifndef THD_KERNEL_STACK_SIZE
101#define THD_KERNEL_STACK_SIZE (64 * 1024)
105#define DEFAULT_VID_MODE DM_640x480
108#define DEFAULT_PIXEL_MODE PM_RGB565
111#define DEFAULT_SERIAL_BAUD 115200
114#define DEFAULT_SERIAL_FIFO 1
117#define ELF_SYM_PREFIX "_"
120#define ELF_SYM_PREFIX_LEN 1
144#define ARCH_EXIT_RETURN 1
145#define ARCH_EXIT_MENU 2
146#define ARCH_EXIT_REBOOT 3
198#define HW_MEM_16 16777216
199#define HW_MEM_32 33554432
207#define HW_MEMSIZE (_arch_mem_top - 0x8c000000)
214#define DBL_MEM (_arch_mem_top - 0x8d000000)
286#define HW_TYPE_RETAIL 0x0
287#define HW_TYPE_SET5 0x9
306#define HW_REGION_UNKNOWN 0x0
307#define HW_REGION_ASIA 0x1
308#define HW_REGION_US 0x4
309#define HW_REGION_EUROPE 0xC
373 __asm__ __volatile__(
"sleep\n");
385 __asm__ __volatile__(
"sts pr,%0\n" :
"=r"(pr));
402 register uintptr_t fp __asm__(
"r14");
415 return *(uintptr_t *)fptr;
Various common macros used throughout the codebase.
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.
void arch_real_exit(int ret_code) __noreturn
Jump back to the bootloader.
const char * get_app_name(void)
Returns the embedded application name.
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:447
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:372
int mm_init(void)
Initialize the memory management system.
static uintptr_t arch_get_fptr(void)
DC specific "function" to get the frame pointer from the current function.
Definition arch.h:401
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:54
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.
static uintptr_t arch_fptr_ret_addr(uintptr_t fptr)
Pass in a frame pointer value to get the return address for the given frame.
Definition arch.h:414
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.
static uintptr_t arch_get_ret_addr(void)
DC specific "function" to get the return address from the current function.
Definition arch.h:382
void arch_panic(const char *str) __noreturn
Panic function.
static uintptr_t arch_fptr_next(uintptr_t fptr)
Pass in a frame pointer value to get the previous frame pointer for the given frame.
Definition arch.h:425
#define THD_SCHED_HZ
Scheduler interrupt frequency.
Definition arch.h:84
static bool arch_valid_address(uintptr_t ptr)
Returns true if the passed address is likely to be valid.
Definition arch.h:436
int hardware_sys_mode(int *region)
Retrieve the system mode of the console in use.
const char * kos_get_license(void)
Retrieve the license information for the compiled copy of KOS.
const char * kos_get_banner(void)
Retrieve the banner printed at program initialization.
const char * kos_get_authors(void)
Retrieve a list of authors and the dates of their contributions.
#define __noreturn
Identify a function that will never return.
Definition cdefs.h:47
unsigned long uint32
32-bit unsigned integer
Definition types.h:33
Initialization-related flags and macros.