Dreamcast Architecture-Specific Options and high-level API
More...
|
| file | arch.h |
| | Dreamcast architecture specific options.
|
| |
Dreamcast Architecture-Specific Options and high-level API
◆ _arch_mem_top
| #define _arch_mem_top ((uint32) 0x8d000000) |
◆ ARCH_CODE
ELF machine type code for this architecture.
◆ ARCH_ELFCLASS
ELF class for this architecture.
◆ ARCH_ELFDATA
ELF data encoding for this architecture.
◆ ARCH_NAME
| #define ARCH_NAME "Dreamcast" |
Standard name for this arch.
◆ DBL_MEM
Use this macro to easily determine if system has 32MB of RAM.
- Returns
- Non-zero if console has 32MB of RAM, zero otherwise
◆ ELF_SYM_PREFIX
| #define ELF_SYM_PREFIX "_" |
Global symbol prefix in ELF files.
◆ ELF_SYM_PREFIX_LEN
| #define ELF_SYM_PREFIX_LEN 1 |
Length of global symbol prefix in ELF files.
◆ HW_MEMSIZE
Determine how much memory is installed in current machine.
- Returns
- The total size of system memory in bytes.
◆ page_count
Page count "variable".
The number of pages is static, so we can optimize this quite a bit.
◆ page_phys_base
| #define page_phys_base 0x8c010000 |
Base address of available physical pages.
◆ PAGEMASK
◆ PAGESIZE
◆ PAGESIZE_BITS
◆ THD_SCHED_HZ
Scheduler interrupt frequency.
Timer interrupt frequency for the KOS thread scheduler.
- Note
- This value is what KOS uses initially upon startup, but it can be reconfigured at run-time.
- See also
- thd_get_hz(), thd_set_hz()
◆ arch_abort()
Kernel "abort" point.
- Note
- This function will never return!
◆ arch_exit()
Generic kernel "exit" point.
- Note
- This function will never return!
◆ arch_main()
Kernel C-level entry point.
- Note
- This function will never return!
◆ arch_menu()
Kernel "exit to menu" call.
- Note
- This function will never return!
◆ arch_panic()
| void arch_panic |
( |
const char * | str | ) |
|
Panic function.
This function will cause a kernel panic, printing the specified message.
- Parameters
-
| str | The error message to print. |
- Note
- This function will never return!
◆ arch_reboot()
| void arch_reboot |
( |
void | | ) |
|
Kernel "reboot" call.
- Note
- This function will never return!
◆ arch_return()
| void arch_return |
( |
int | ret_code | ) |
|
Kernel "return" point.
- Note
- This function will never return!
◆ arch_set_exit_path()
| void arch_set_exit_path |
( |
int | path | ) |
|
Set the exit path.
The default, if you don't call this, is ARCH_EXIT_RETURN.
- Parameters
-
- See also
- Exit Paths
◆ arch_sleep()
| static void arch_sleep |
( |
void | | ) |
|
|
inlinestatic |
Dreamcast specific sleep mode function.
◆ arch_valid_address()
| static bool arch_valid_address |
( |
uintptr_t | ptr | ) |
|
|
inlinestatic |
Returns true if the passed address is likely to be valid.
Doesn't have to be exact, just a sort of general idea.
- Returns
- Whether the address is valid or not for normal memory access.
References _arch_mem_top.
◆ arch_valid_text_address()
| static bool arch_valid_text_address |
( |
uintptr_t | ptr | ) |
|
|
inlinestatic |
Returns true if the passed address is in the text section of your program.
- Returns
- Whether the address is valid or not for text memory access.
References _etext, and _executable_start.
◆ hardware_periph_init()
| 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.
- Return values
-
| 0 | On success (no error conditions defined). |
◆ hardware_shutdown()
| 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.
◆ hardware_sys_init()
| 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.
- Return values
-
| 0 | On success (no error conditions defined). |
◆ hardware_sys_mode()
| 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).
- Parameters
-
| 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. |
- Returns
- The console type (one of the Console Types).
- Note
- Do not use before hardware_sys_init() has been called.
◆ HZ()
| static const unsigned HZ |
( |
"Please use the new THD_SCHED_HZ macro." | | ) |
|
|
static |
◆ mm_init()
Initialize the memory management system.
- Return values
-
| 0 | On success (no error conditions defined). |
◆ mm_sbrk()
| void * mm_sbrk |
( |
unsigned long | increment | ) |
|
Request more core memory from the system.
- Parameters
-
| increment | The number of bytes requested. |
- Returns
- A pointer to the memory.
- Note
- This function will panic if no memory is available.
◆ _etext
◆ _executable_start