|
KallistiOS
##version##
|
Dreamcast architecture specific options. More...
Go to the source code of this file.
Macros | |
| #define | PAGESIZE 4096 |
| Page size (for MMU) | |
| #define | PAGESIZE_BITS 12 |
| Bits for page size. | |
| #define | PAGEMASK (PAGESIZE - 1) |
| Mask for page offset. | |
| #define | page_count ((16*1024*1024 - 0x10000) / PAGESIZE) |
| Page count "variable". | |
| #define | page_phys_base 0x8c010000 |
| Base address of available physical pages. | |
| #define | HZ 100 |
| Number of timer ticks per second. | |
| #define | THD_STACK_SIZE 32768 |
| Default thread stack size. | |
| #define | DEFAULT_VID_MODE DM_640x480 |
| Default video mode. | |
| #define | DEFAULT_PIXEL_MODE PM_RGB565 |
| Default pixel mode for video. | |
| #define | DEFAULT_SERIAL_BAUD 57600 |
| Default serial bitrate. | |
| #define | DEFAULT_SERIAL_FIFO 1 |
| Default serial FIFO behavior. | |
| #define | ELF_SYM_PREFIX "_" |
| Global symbol prefix in ELF files. | |
| #define | ELF_SYM_PREFIX_LEN 1 |
| Length of global symbol prefix in ELF files. | |
| #define | ARCH_EXIT_RETURN 1 |
| Return to loader. | |
| #define | ARCH_EXIT_MENU 2 |
| Return to system menu. | |
| #define | ARCH_EXIT_REBOOT 3 |
| Reboot the machine. | |
| #define | KOS_INIT_FLAGS(flags) uint32 __kos_init_flags = (flags) |
| Use this macro to determine the level of initialization you'd like in your program by default. | |
| #define | KOS_INIT_ROMDISK(rd) void * __kos_romdisk = (rd) |
| Define a romdisk for your program, if you'd like one. | |
| #define | KOS_INIT_ROMDISK_NONE NULL |
| State that you don't want a romdisk. | |
| #define | INIT_DEFAULT (INIT_IRQ | INIT_THD_PREEMPT) |
| Default init flags (IRQs on, preemption enabled). | |
| #define | INIT_NONE 0x0000 |
| Don't init optional things. | |
| #define | INIT_IRQ 0x0001 |
| Enable IRQs at startup. | |
| #define | INIT_THD_PREEMPT 0x0002 |
| Enable thread preemption. | |
| #define | INIT_NET 0x0004 |
| Enable built-in networking. | |
| #define | INIT_MALLOCSTATS 0x0008 |
| Enable malloc statistics. | |
| #define | INIT_QUIET 0x0010 |
| Disable dbgio. | |
| #define | INIT_OCRAM 0x10000 |
| Use half of the dcache as RAM. | |
| #define | INIT_NO_DCLOAD 0x20000 |
| Disable dcload. | |
| #define | arch_sleep() |
| Dreamcast specific sleep mode "function". | |
| #define | arch_get_ret_addr() |
| DC specific "function" to get the return address from the current function. | |
| #define | arch_get_fptr() |
| DC specific "function" to get the frame pointer from the current function. | |
| #define | arch_fptr_ret_addr(fptr) (*((uint32*)fptr)) |
| Pass in a frame pointer value to get the return address for the given frame. | |
| #define | arch_fptr_next(fptr) (*((uint32*)(fptr+4))) |
| Pass in a frame pointer value to get the previous frame pointer for the given frame. | |
| #define | arch_valid_address(ptr) ((ptr_t)(ptr) >= 0x8c010000 && (ptr_t)(ptr) < 0x8d000000) |
| Returns true if the passed address is likely to be valid. Doesn't have to be exact, just a sort of general idea. | |
Functions | |
| void | panic (const char *str) __noreturn |
| Panic function. | |
| int | arch_main () |
| Kernel C-level entry point. | |
| void | arch_set_exit_path (int path) |
| Set the exit path. | |
| void | arch_exit () __noreturn |
| Generic kernel "exit" point. | |
| void | arch_return () __noreturn |
| Kernel "return" point. | |
| void | arch_abort () __noreturn |
| Kernel "abort" point. | |
| void | arch_reboot () __noreturn |
| Kernel "reboot" call. | |
| void | arch_menu () __noreturn |
| Kernel "exit to menu" call. | |
| void | arch_ctors () |
| Call to run all ctors. | |
| void | arch_dtors () |
| Call to run all dtors. | |
| void | __crtend_pullin () |
| Hook to ensure linking of crtend.c. | |
| int | mm_init () |
| Initialize the memory management system. | |
| void * | mm_sbrk (unsigned long increment) |
| Request more core memory from the system. | |
| void | arch_real_exit () __noreturn |
| Jump back to the bootloader. | |
| int | hardware_sys_init () |
| Initialize bare-bones hardware systems. | |
| int | hardware_periph_init () |
| Initialize some peripheral systems. | |
| void | hardware_shutdown () |
| Shut down hardware that was initted. | |
Variables | |
| uint32 | __kos_init_flags |
| The init flags. Do not modify this directly! | |
| void * | __kos_romdisk |
| Built-in romdisk. Do not modify this directly! | |
Dreamcast architecture specific options.
This file has various architecture specific options defined in it. Also, any functions that start with arch_ are in here.
| #define arch_fptr_next | ( | fptr | ) | (*((uint32*)(fptr+4))) |
Pass in a frame pointer value to get the previous frame pointer for the given frame.
| fptr | The frame pointer to look at. |
| #define arch_fptr_ret_addr | ( | fptr | ) | (*((uint32*)fptr)) |
Pass in a frame pointer value to get the return address for the given frame.
| fptr | The frame pointer to look at. |
| #define arch_get_fptr | ( | ) |
DC specific "function" to get the frame pointer from the current function.
| #define arch_get_ret_addr | ( | ) |
| #define arch_sleep | ( | ) |
Dreamcast specific sleep mode "function".
| #define arch_valid_address | ( | ptr | ) | ((ptr_t)(ptr) >= 0x8c010000 && (ptr_t)(ptr) < 0x8d000000) |
Returns true if the passed address is likely to be valid. Doesn't have to be exact, just a sort of general idea.
| #define DEFAULT_PIXEL_MODE PM_RGB565 |
Default pixel mode for video.
| #define DEFAULT_SERIAL_BAUD 57600 |
Default serial bitrate.
| #define DEFAULT_SERIAL_FIFO 1 |
Default serial FIFO behavior.
| #define DEFAULT_VID_MODE DM_640x480 |
Default video mode.
| #define ELF_SYM_PREFIX "_" |
Global symbol prefix in ELF files.
| #define ELF_SYM_PREFIX_LEN 1 |
Length of global symbol prefix in ELF files.
| #define HZ 100 |
Number of timer ticks per second.
| #define KOS_INIT_FLAGS | ( | flags | ) | uint32 __kos_init_flags = (flags) |
Use this macro to determine the level of initialization you'd like in your program by default.
The defaults line will be fine for most things.
| flags | Parts of KOS to init. |
| #define KOS_INIT_ROMDISK | ( | rd | ) | void * __kos_romdisk = (rd) |
Define a romdisk for your program, if you'd like one.
| rd | Pointer to the romdisk image in your code. |
| #define KOS_INIT_ROMDISK_NONE NULL |
State that you don't want a romdisk.
| #define page_count ((16*1024*1024 - 0x10000) / PAGESIZE) |
Page count "variable".
The number of pages is static, so we can optimize this quite a bit.
| #define page_phys_base 0x8c010000 |
Base address of available physical pages.
| #define PAGEMASK (PAGESIZE - 1) |
Mask for page offset.
| #define PAGESIZE 4096 |
Page size (for MMU)
| #define PAGESIZE_BITS 12 |
Bits for page size.
| #define THD_STACK_SIZE 32768 |
Default thread stack size.
| void __crtend_pullin | ( | ) |
Hook to ensure linking of crtend.c.
| void arch_abort | ( | ) |
Kernel "abort" point.
| void arch_ctors | ( | ) |
Call to run all ctors.
| void arch_dtors | ( | ) |
Call to run all dtors.
| void arch_exit | ( | ) |
Generic kernel "exit" point.
| int arch_main | ( | ) |
Kernel C-level entry point.
| void arch_menu | ( | ) |
Kernel "exit to menu" call.
| void arch_real_exit | ( | ) |
Jump back to the bootloader.
You generally shouldn't use this function, but rather use arch_exit() or exit() instead.
| void arch_reboot | ( | ) |
Kernel "reboot" call.
| void arch_return | ( | ) |
Kernel "return" point.
| void arch_set_exit_path | ( | int | path | ) |
Set the exit path.
The default, if you don't call this, is ARCH_EXIT_RETURN.
| path | What arch_exit() should do. |
| int hardware_periph_init | ( | ) |
Initialize some peripheral systems.
This will be done automatically for you on start by the default arch_main(), so you shouldn't have to deal with this yourself.
| 0 | On success (no error conditions defined). |
| void hardware_shutdown | ( | ) |
Shut down hardware that was initted.
This function will shut down anything initted with hardware_sys_init() and hardware_periph_init(). This will be done for you automatically by the various exit points, so you shouldn't have to do this yourself.
| int hardware_sys_init | ( | ) |
Initialize bare-bones hardware systems.
This will be done automatically for you on start by the default arch_main(), so you shouldn't have to deal with this yourself.
| 0 | On success (no error conditions defined). |
| int mm_init | ( | ) |
Initialize the memory management system.
| 0 | On success (no error conditions defined). |
| void* mm_sbrk | ( | unsigned long | increment | ) |
Request more core memory from the system.
| increment | The number of bytes requested. |
| void panic | ( | const char * | str | ) |
Panic function.
This function will cause a kernel panic, printing the specified message.
| str | The error message to print. |
| uint32 __kos_init_flags |
The init flags. Do not modify this directly!
| void* __kos_romdisk |
Built-in romdisk. Do not modify this directly!
1.8.1.1