|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Dreamcast Architecture-Specific Options and high-level API More...
Topics | |
| Console Types | |
| Byte values returned by hardware_sys_mode() | |
| Exit Paths | |
| Potential exit paths from the kernel on arch_exit() | |
| Memory Capacity | |
| Console memory sizes | |
| Region Codes | |
| Values returned by hardware_sys_mode(); | |
Files | |
| file | arch.h |
| Dreamcast architecture specific options. | |
Macros | |
| #define | _arch_mem_top ((uint32_t) 0x8d000000) |
| Top of memory available, depending on memory size. | |
| #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 ((_arch_mem_top - page_phys_base) / PAGESIZE) |
| Page count "variable". | |
| #define | page_phys_base 0x8c010000 |
| Base address of available physical pages. | |
| #define | THD_SCHED_HZ 100 |
| Scheduler interrupt frequency. | |
| #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_NAME "Dreamcast" |
| Standard name for this arch. | |
| #define | ARCH_ELFCLASS ELFCLASS32 |
| ELF class for this architecture. | |
| #define | ARCH_ELFDATA ELFDATA2LSB |
| ELF data encoding for this architecture. | |
| #define | ARCH_CODE EM_SH |
| ELF machine type code for this architecture. | |
| #define | HW_MEMSIZE (_arch_mem_top - 0x8c000000) |
| Determine how much memory is installed in current machine. | |
| #define | DBL_MEM (_arch_mem_top - 0x8d000000) |
| Use this macro to easily determine if system has 32MB of RAM. | |
Functions | |
| void | arch_panic (const char *str) __noreturn |
| Panic function. | |
| void | arch_main (void) __noreturn |
| Kernel C-level entry point. | |
| void | arch_set_exit_path (int path) |
| Set the exit path. | |
| void | arch_exit (void) __noreturn |
| Generic kernel "exit" point. | |
| void | arch_return (int ret_code) __noreturn |
| Kernel "return" point. | |
| void | arch_abort (void) __noreturn |
| Kernel "abort" point. | |
| void | arch_reboot (void) __noreturn |
| Kernel "reboot" call. | |
| void | arch_menu (void) __noreturn |
| Kernel "exit to menu" call. | |
| int | hardware_sys_init (void) |
| Initialize bare-bones hardware systems. | |
| int | hardware_periph_init (void) |
| Initialize some peripheral systems. | |
| void | hardware_shutdown (void) |
| Shut down hardware that was initted. | |
| int | hardware_sys_mode (int *region) |
| Retrieve the system mode of the console in use. | |
| static void | arch_sleep (void) |
| Dreamcast specific sleep mode function. | |
| static bool | arch_valid_address (uintptr_t ptr) |
| Returns true if the passed address is likely to be valid. | |
| static bool | arch_valid_text_address (uintptr_t ptr) |
| Returns true if the passed address is in the text section of your program. | |
Variables | |
| char | _executable_start |
| Start and End address for .text portion of program. | |
| char | _etext |
| static const unsigned | HZ = THD_SCHED_HZ |
| Legacy symbol for scheduler frequency. | |
Dreamcast Architecture-Specific Options and high-level API
| #define _arch_mem_top ((uint32_t) 0x8d000000) |
Top of memory available, depending on memory size.
Referenced by arch_valid_address(), and main().
| #define ARCH_CODE EM_SH |
ELF machine type code for this architecture.
| #define ARCH_ELFCLASS ELFCLASS32 |
ELF class for this architecture.
| #define ARCH_ELFDATA ELFDATA2LSB |
ELF data encoding for this architecture.
| #define ARCH_NAME "Dreamcast" |
Standard name for this arch.
| #define DBL_MEM (_arch_mem_top - 0x8d000000) |
Use this macro to easily determine if system has 32MB of RAM.
Referenced by main().
| #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 HW_MEMSIZE (_arch_mem_top - 0x8c000000) |
Determine how much memory is installed in current machine.
Referenced by main().
| #define page_count ((_arch_mem_top - page_phys_base) / 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.
Referenced by catchnull(), and main().
| #define THD_SCHED_HZ 100 |
Scheduler interrupt frequency.
Timer interrupt frequency for the KOS thread scheduler.
| void arch_abort | ( | void | ) |
Kernel "abort" point.
| void arch_exit | ( | void | ) |
Generic kernel "exit" point.
| void arch_main | ( | void | ) |
Kernel C-level entry point.
| void arch_menu | ( | void | ) |
Kernel "exit to menu" call.
| void arch_panic | ( | const char * | str | ) |
Panic function.
This function will cause a kernel panic, printing the specified message.
| str | The error message to print. |
| void arch_reboot | ( | void | ) |
Kernel "reboot" call.
| void arch_return | ( | int | ret_code | ) |
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. |
|
inlinestatic |
Dreamcast specific sleep mode function.
|
inlinestatic |
Returns true if the passed address is likely to be valid.
Doesn't have to be exact, just a sort of general idea.
References _arch_mem_top.
|
inlinestatic |
Returns true if the passed address is in the text section of your program.
References _etext, and _executable_start.
| int hardware_periph_init | ( | void | ) |
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 | ( | void | ) |
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 | ( | void | ) |
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 hardware_sys_mode | ( | int * | region | ) |
Retrieve the system mode of the console in use.
This function retrieves the system mode register of the console that is in use. This register details the actual system type in use (and in some system types the region of the device).
| region | On return, the region code (one of the Region Codes) of the device if the console type allows reading it through the system mode register – otherwise, you must retrieve the region from the flashrom. |
|
extern |
Referenced by arch_valid_text_address().
|
extern |
Start and End address for .text portion of program.
Referenced by arch_valid_text_address().
|
static |