36#ifdef __KOS_GCC_32MB__
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
84#define THD_STACK_SIZE 32768
87#ifndef THD_KERNEL_STACK_SIZE
89#define THD_KERNEL_STACK_SIZE (64 * 1024)
93#define DEFAULT_VID_MODE DM_640x480
96#define DEFAULT_PIXEL_MODE PM_RGB565
99#define DEFAULT_SERIAL_BAUD 115200
102#define DEFAULT_SERIAL_FIFO 1
105#define ELF_SYM_PREFIX "_"
108#define ELF_SYM_PREFIX_LEN 1
132#define ARCH_EXIT_RETURN 1
133#define ARCH_EXIT_MENU 2
134#define ARCH_EXIT_REBOOT 3
186#define HW_MEM_16 16777216
187#define HW_MEM_32 33554432
195#define HW_MEMSIZE (_arch_mem_top - 0x8c000000)
202#define DBL_MEM (_arch_mem_top - 0x8d000000)
274#define HW_TYPE_RETAIL 0x0
275#define HW_TYPE_SET5 0x9
294#define HW_REGION_UNKNOWN 0x0
295#define HW_REGION_ASIA 0x1
296#define HW_REGION_US 0x4
297#define HW_REGION_EUROPE 0xC
361 __asm__ __volatile__(
"sleep\n");
373 __asm__ __volatile__(
"sts pr,%0\n" :
"=r"(pr));
390 register uintptr_t fp __asm__(
"r14");
403 return *(uintptr_t *)fptr;
Definitions for builtin attributes and compiler directives.
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.
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:435
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:360
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:389
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
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:402
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:370
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:413
#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:424
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 __depr(m)
Mark something as deprecated, with an informative message.
Definition cdefs.h:119
#define __noreturn
Identify a function that will never return.
Definition cdefs.h:45
unsigned long uint32
32-bit unsigned integer
Definition types.h:33
Initialization-related flags and macros.