Platform desciption structure.
More...
#include <platform/platform.hpp>
|
|
constexpr | Platform () noexcept=default |
| | Default c-tor.
|
| constexpr | Platform (const char *const name, const init_t initFunc, const finalize_t finalizeFunc, const shutdown_t shutdownFunc, const reboot_t rebootFunc, const suspend_t suspendFunc, const wakeup_t wakeupFunc) noexcept |
| | C-tor.
|
| auto | name () const noexcept -> const char * |
| | Get platform name.
|
| void | initialize () const noexcept |
| | Initialize platform.
|
| void | finalize () const noexcept |
| | Finalize platform.
|
| void | shutdown () const noexcept |
| | Shutdown platform.
|
| void | reboot () const noexcept |
| | Reboot platform.
|
| void | suspend () const noexcept |
| | Suspend platform.
|
| void | wakeup () const noexcept |
| | Wakeup platform.
|
|
| static constexpr auto | kernelStart () noexcept -> const igros_byte_t * |
| | Get kernel start address.
|
| static constexpr auto | kernelEnd () noexcept -> const igros_byte_t * |
| | Get kernel end address.
|
| static auto | kernelSize () noexcept -> igros_usize_t |
| | Get kernel size.
|
| static constexpr auto | textStart () noexcept -> const igros_byte_t * |
| | Get kernel code start (code: [textStart, rodataStart)).
|
| static constexpr auto | rodataStart () noexcept -> const igros_byte_t * |
| | Get kernel read-only data start (read-only data: [rodataStart, dataStart)).
|
| static constexpr auto | dataStart () noexcept -> const igros_byte_t * |
| | Get kernel writable data start (data and bss: [dataStart, kernelEnd)).
|
| static constexpr auto | stackGuard () noexcept -> const igros_byte_t * |
| | Get boot stack guard page (one page right below boot stack, never mapped).
|
| static auto | kernelOffset () noexcept -> igros_usize_t |
| | Get kernel virtual memory offset (kernel virtual address = physical address + offset).
|
| static constexpr auto | isI386 () noexcept -> bool |
| | Check if i386.
|
| static constexpr auto | isX86_64 () noexcept -> bool |
| | Check if x86_64.
|
| static constexpr auto | isARM32 () noexcept -> bool |
| | Check if arm32.
|
| static constexpr auto | isARM64 () noexcept -> bool |
| | Check if arm64.
|
| static constexpr auto | isAVR () noexcept -> bool |
| | Check if avr.
|
| static auto | current () noexcept -> const Platform & |
| | Get kernel current platform (implemented in corresponding platform file).
|
|
| enum class | ARCH_NAME : igros_dword_t {
UNKNOWN = 0x00000000_u32
, I386 = 0x00000001_u32
, X86_64 = 0x00000002_u32
, ARM = 0x00000004_u32
,
ARM64 = 0x00000008_u32
, AVR = 0x00000010_u32
} |
| | Platform name ID. More...
|
| using | init_t = std::add_pointer_t<void()> |
| | Platform init function pointer type.
|
| using | finalize_t = std::add_pointer_t<void()> |
| | Platform finalize function pointer type.
|
| using | shutdown_t = std::add_pointer_t<void()> |
| | Platform shutdown function pointer type.
|
| using | reboot_t = std::add_pointer_t<void()> |
| | Platform reboot function pointer type.
|
| using | suspend_t = std::add_pointer_t<void()> |
| | Platform suspend function pointer type.
|
| using | wakeup_t = std::add_pointer_t<void()> |
| | Platform wakeup function pointer type.
|
Platform desciption structure.
Definition at line 42 of file platform.hpp.
◆ finalize_t
◆ init_t
◆ reboot_t
◆ shutdown_t
◆ suspend_t
◆ wakeup_t
◆ ARCH_NAME
◆ Platform()
C-tor.
- Parameters
-
| name | Platform name |
| initFunc | Initialization function |
| finalizeFunc | Finalization function |
| shutdownFunc | Shutdown function |
| rebootFunc | Reboot function |
| suspendFunc | Suspend function |
| wakeupFunc | Wakeup function |
Definition at line 200 of file platform.hpp.
◆ current()
| auto igros::platform::Platform::current |
( |
| ) |
->constPlatform & |
|
staticnodiscardnoexcept |
Get kernel current platform (implemented in corresponding platform file).
- Returns
- Platform the kernel runs on
Definition at line 145 of file platform-x86.cpp.
◆ dataStart()
| auto igros::platform::Platform::dataStart |
( |
| ) |
->constigros_byte_t * |
|
staticnodiscardconstexprnoexcept |
Get kernel writable data start (data and bss: [dataStart, kernelEnd)).
Get kernel writable data start.
- Returns
- Kernel writable data start address
Definition at line 332 of file platform.hpp.
◆ finalize()
| void igros::platform::Platform::finalize |
( |
| ) |
const |
|
inlinenoexcept |
◆ initialize()
| void igros::platform::Platform::initialize |
( |
| ) |
const |
|
inlinenoexcept |
◆ isARM32()
| auto igros::platform::Platform::isARM32 |
( |
| ) |
->bool |
|
staticnodiscardconstexprnoexcept |
Check if arm32.
- Returns
- true if kernel is built for ARM32
Definition at line 368 of file platform.hpp.
◆ isARM64()
| auto igros::platform::Platform::isARM64 |
( |
| ) |
->bool |
|
staticnodiscardconstexprnoexcept |
Check if arm64.
- Returns
- true if kernel is built for ARM64
Definition at line 375 of file platform.hpp.
◆ isAVR()
| auto igros::platform::Platform::isAVR |
( |
| ) |
->bool |
|
staticnodiscardconstexprnoexcept |
Check if avr.
- Returns
- true if kernel is built for AVR
Definition at line 382 of file platform.hpp.
◆ isI386()
| auto igros::platform::Platform::isI386 |
( |
| ) |
->bool |
|
staticnodiscardconstexprnoexcept |
◆ isX86_64()
| auto igros::platform::Platform::isX86_64 |
( |
| ) |
->bool |
|
staticnodiscardconstexprnoexcept |
◆ kernelEnd()
| auto igros::platform::Platform::kernelEnd |
( |
| ) |
->constigros_byte_t * |
|
staticnodiscardconstexprnoexcept |
Get kernel end address.
- Returns
- Kernel end address
Definition at line 302 of file platform.hpp.
◆ kernelOffset()
|
|
inlinestaticnodiscardnoexcept |
Get kernel virtual memory offset (kernel virtual address = physical address + offset).
Get kernel virtual memory offset.
- Returns
- Kernel virtual memory offset
Definition at line 346 of file platform.hpp.
◆ kernelSize()
|
|
inlinestaticnodiscardnoexcept |
Get kernel size.
- Returns
- Kernel size in bytes
Definition at line 309 of file platform.hpp.
◆ kernelStart()
| auto igros::platform::Platform::kernelStart |
( |
| ) |
->constigros_byte_t * |
|
staticnodiscardconstexprnoexcept |
Get kernel start address.
- Returns
- Kernel start address
Definition at line 295 of file platform.hpp.
◆ name()
| auto igros::platform::Platform::name |
( |
| ) |
const->constchar * |
|
inlinenodiscardnoexcept |
◆ reboot()
| void igros::platform::Platform::reboot |
( |
| ) |
const |
|
inlinenoexcept |
◆ rodataStart()
| auto igros::platform::Platform::rodataStart |
( |
| ) |
->constigros_byte_t * |
|
staticnodiscardconstexprnoexcept |
Get kernel read-only data start (read-only data: [rodataStart, dataStart)).
Get kernel read-only data start.
- Returns
- Kernel read-only data start address
Definition at line 325 of file platform.hpp.
◆ shutdown()
| void igros::platform::Platform::shutdown |
( |
| ) |
const |
|
inlinenoexcept |
◆ stackGuard()
| auto igros::platform::Platform::stackGuard |
( |
| ) |
->constigros_byte_t * |
|
staticnodiscardconstexprnoexcept |
Get boot stack guard page (one page right below boot stack, never mapped).
Get boot stack guard page.
- Returns
- Boot stack guard page address
Definition at line 339 of file platform.hpp.
◆ suspend()
| void igros::platform::Platform::suspend |
( |
| ) |
const |
|
inlinenoexcept |
◆ textStart()
| auto igros::platform::Platform::textStart |
( |
| ) |
->constigros_byte_t * |
|
staticnodiscardconstexprnoexcept |
Get kernel code start (code: [textStart, rodataStart)).
Get kernel code start.
- Returns
- Kernel code start address
Definition at line 318 of file platform.hpp.
◆ wakeup()
| void igros::platform::Platform::wakeup |
( |
| ) |
const |
|
inlinenoexcept |
◆ mFinalize
| finalize_t igros::platform::Platform::mFinalize {nullptr} |
|
private |
◆ mInit
| init_t igros::platform::Platform::mInit {nullptr} |
|
private |
◆ mName
| const char* const igros::platform::Platform::mName {nullptr} |
|
private |
◆ mReboot
| reboot_t igros::platform::Platform::mReboot {nullptr} |
|
private |
◆ mShutdown
| shutdown_t igros::platform::Platform::mShutdown {nullptr} |
|
private |
◆ mSuspend
| suspend_t igros::platform::Platform::mSuspend {nullptr} |
|
private |
◆ mWakeup
| wakeup_t igros::platform::Platform::mWakeup {nullptr} |
|
private |
◆ PLATFORM_NAME
| auto igros::platform::Platform::PLATFORM_NAME {ARCH_NAME::X86_64} |
|
staticconstexprprivate |
The documentation for this class was generated from the following files: