diff options
Diffstat (limited to 'newBoot/Source/MPT')
| -rw-r--r-- | newBoot/Source/MPT/API.cxx | 38 | ||||
| -rw-r--r-- | newBoot/Source/MPT/API.hxx | 6 |
2 files changed, 26 insertions, 18 deletions
diff --git a/newBoot/Source/MPT/API.cxx b/newBoot/Source/MPT/API.cxx index 2cedd73e..b76ac645 100644 --- a/newBoot/Source/MPT/API.cxx +++ b/newBoot/Source/MPT/API.cxx @@ -9,7 +9,7 @@ #include "API.hxx" -struct Files32FileHdr +struct Files32FileHdr final { char Filename[32]; char Ext[3]; @@ -35,7 +35,8 @@ struct Files32FileHdr // @brief Array of unused bits. #define kFilesU { 0x40, 0x80 } -struct Files32FileGroup { +struct Files32FileGroup final +{ Files32FileHdr* fHdr{ nullptr }; Files32FileGroup* fUpper{ nullptr }; @@ -49,23 +50,30 @@ extern "C" void* AllocPtr(long sz); namespace detail { -template <typename Cls> -Cls* new_class() -{ - Cls* cls = (Cls*)AllocPtr(sizeof(Cls)); - *cls = Cls(); + template <typename Cls> + Cls* new_class() + { + Cls* cls = (Cls*)AllocPtr(sizeof(Cls)); + *cls = Cls(); - return cls; -} + return cls; + } } +/* @brief external inits */ +extern "C" int init_ata_mpt(void); +extern "C" int init_mpt(void); + namespace mpt { -bool filesystem_init(void) -{ - kRootGroup = detail::new_class<Files32FileGroup>(); - Assert(kRootGroup != nullptr); + bool filesystem_init(void) noexcept + { + kRootGroup = detail::new_class<Files32FileGroup>(); + Assert(kRootGroup != nullptr); - return true; -} + Assert(init_ata_mpt() == 1); + Assert(init_mpt() == 1); + + return true; + } }
\ No newline at end of file diff --git a/newBoot/Source/MPT/API.hxx b/newBoot/Source/MPT/API.hxx index 42822371..1439c128 100644 --- a/newBoot/Source/MPT/API.hxx +++ b/newBoot/Source/MPT/API.hxx @@ -11,7 +11,7 @@ namespace mpt { -/// initializes the Master Partition Table Files32 filesystem. -/// \return status, assert(fail) is also triggered, use filesystem_hook_error if you want to catch it. -bool filesystem_init(void); + /// initializes the Master Partition Table and the Files32 filesystem. + /// \return status, assert(fail) is also triggered, use filesystem_hook_error if you want to catch it. + bool filesystem_init(void) noexcept; }
\ No newline at end of file |
