27 #define PAGESIZE_BITS 12
28 #define PAGEMASK (PAGESIZE - 1)
33 #define page_count ((16*1024*1024 - 0x10000) / PAGESIZE)
36 #define page_phys_base 0x8c010000
42 #define THD_STACK_SIZE 32768
45 #define DEFAULT_VID_MODE DM_640x480
48 #define DEFAULT_PIXEL_MODE PM_RGB565
51 #define DEFAULT_SERIAL_BAUD 57600
54 #define DEFAULT_SERIAL_FIFO 1
57 #define ELF_SYM_PREFIX "_"
60 #define ELF_SYM_PREFIX_LEN 1
81 #define ARCH_EXIT_RETURN 1
82 #define ARCH_EXIT_MENU 2
83 #define ARCH_EXIT_REBOOT 3
140 void *
mm_sbrk(
unsigned long increment);
149 #define KOS_INIT_FLAGS(flags) uint32 __kos_init_flags = (flags)
157 #define KOS_INIT_ROMDISK(rd) void * __kos_romdisk = (rd)
163 #define KOS_INIT_ROMDISK_NONE NULL
171 #define INIT_DEFAULT \
172 (INIT_IRQ | INIT_THD_PREEMPT)
174 #define INIT_NONE 0x0000
175 #define INIT_IRQ 0x0001
176 #define INIT_THD_PREEMPT 0x0002
177 #define INIT_NET 0x0004
178 #define INIT_MALLOCSTATS 0x0008
179 #define INIT_QUIET 0x0010
182 #define INIT_OCRAM 0x10000
183 #define INIT_NO_DCLOAD 0x20000
229 #define HW_TYPE_RETAIL 0x0
230 #define HW_TYPE_SET5 0x9
245 #define HW_REGION_UNKNOWN 0x0
246 #define HW_REGION_ASIA 0x1
247 #define HW_REGION_US 0x4
248 #define HW_REGION_EUROPE 0xC
304 #define arch_sleep() do { \
305 __asm__ __volatile__("sleep"); \
312 #define arch_get_ret_addr() ({ \
314 __asm__ __volatile__("sts pr,%0\n" \
329 #define arch_get_fptr() ({ \
331 __asm__ __volatile__("mov r14,%0\n" \
343 #define arch_fptr_ret_addr(fptr) (*((uint32*)fptr))
351 #define arch_fptr_next(fptr) (*((uint32*)(fptr+4)))
359 #define arch_valid_address(ptr) ((ptr_t)(ptr) >= 0x8c010000 && (ptr_t)(ptr) < 0x8d000000)
void arch_menu() __noreturn
Kernel "exit to menu" call.
void arch_dtors()
Call to run all dtors.
const char * kos_get_authors(void)
Retrieve a list of authors and the dates of their contributions.
void arch_return() __noreturn
Kernel "return" point.
int mm_init()
Initialize the memory management system.
void arch_real_exit() __noreturn
Jump back to the bootloader.
void arch_exit() __noreturn
Generic kernel "exit" point.
void arch_abort() __noreturn
Kernel "abort" point.
int hardware_sys_init()
Initialize bare-bones hardware systems.
Functions related to video output.
void hardware_shutdown()
Shut down hardware that was initted.
int arch_main()
Kernel C-level entry point.
void __crtend_pullin()
Hook to ensure linking of crtend.c.
unsigned long uint32
32-bit unsigned integer
Definition: types.h:28
const char * kos_get_banner(void)
Retrieve the banner printed at program initialization.
void arch_ctors()
Call to run all ctors.
int hardware_periph_init()
Initialize some peripheral systems.
void arch_reboot() __noreturn
Kernel "reboot" call.
void panic(const char *str) __noreturn
Panic function.
Potentially useful definitions for C Programs.
void * mm_sbrk(unsigned long increment)
Request more core memory from the system.
#define __noreturn
Identify a function that will never return.
Definition: cdefs.h:37
int hardware_sys_mode(int *region)
Retrieve the system mode of the console in use.
void * __kos_romdisk
Built-in romdisk. Do not modify this directly!
uint32 __kos_init_flags
The init flags. Do not modify this directly!
void arch_set_exit_path(int path)
Set the exit path.
const char * kos_get_license(void)
Retrieve the license information for the compiled copy of KOS.