34#ifdef __KOS_GCC_32MB__
37#pragma message "Outdated toolchain: not patched for 32MB support, limiting "\
38 "KOS to 16MB-only behavior to retain maximum compatibility. Please "\
39 "update your toolchain."
40#define _arch_mem_top ((uint32) 0x8d000000)
48#define PAGESIZE_BITS 12
49#define PAGEMASK (PAGESIZE - 1)
54#define page_count ((_arch_mem_top - page_phys_base) / PAGESIZE)
57#define page_phys_base 0x8c010000
70#define THD_SCHED_HZ 100
82#define THD_STACK_SIZE 32768
85#ifndef THD_KERNEL_STACK_SIZE
87#define THD_KERNEL_STACK_SIZE (64 * 1024)
91#define DEFAULT_VID_MODE DM_640x480
94#define DEFAULT_PIXEL_MODE PM_RGB565
97#define DEFAULT_SERIAL_BAUD 115200
100#define DEFAULT_SERIAL_FIFO 1
103#define ELF_SYM_PREFIX "_"
106#define ELF_SYM_PREFIX_LEN 1
130#define ARCH_EXIT_RETURN 1
131#define ARCH_EXIT_MENU 2
132#define ARCH_EXIT_REBOOT 3
184#define HW_MEM_16 16777216
185#define HW_MEM_32 33554432
193#define HW_MEMSIZE (_arch_mem_top - 0x8c000000)
200#define DBL_MEM (_arch_mem_top - 0x8d000000)
272#define HW_TYPE_RETAIL 0x0
273#define HW_TYPE_SET5 0x9
292#define HW_REGION_UNKNOWN 0x0
293#define HW_REGION_ASIA 0x1
294#define HW_REGION_US 0x4
295#define HW_REGION_EUROPE 0xC
358#define arch_sleep() do { \
359 __asm__ __volatile__("sleep"); \
368#define arch_get_ret_addr() ({ \
370 __asm__ __volatile__("sts pr,%0\n" \
387#define arch_get_fptr() ({ \
389 __asm__ __volatile__("mov r14,%0\n" \
402#define arch_fptr_ret_addr(fptr) (*((uint32*)(fptr)))
411#define arch_fptr_next(fptr) (*((uint32*)((fptr)+4)))
420#define arch_valid_address(ptr) ((ptr_t)(ptr) >= 0x8c010000 && (ptr_t)(ptr) < _arch_mem_top)
429#define arch_valid_text_address(ptr) \
430 ((uintptr_t)(ptr) >= (uintptr_t)&_executable_start && (uintptr_t)(ptr) < (uintptr_t)&_etext)
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.
char _executable_start
Start and End address for .text portion of program.
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:40
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:70
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.