diff options
| author | 2015-05-08 21:20:37 -0400 | |
|---|---|---|
| committer | 2015-05-08 21:20:37 -0400 | |
| commit | 917ac23dfcab37c65e11e3413e397863bd4bc000 (patch) | |
| tree | 956ca5d1a4aad3383c4a3bfc9103476abe3f1987 /src/core/loader/ncch.h | |
| parent | Merge pull request #728 from lioncash/vars (diff) | |
| parent | Kernel: Remove unused g_main_thread variable (diff) | |
| download | yuzu-917ac23dfcab37c65e11e3413e397863bd4bc000.tar.gz yuzu-917ac23dfcab37c65e11e3413e397863bd4bc000.tar.xz yuzu-917ac23dfcab37c65e11e3413e397863bd4bc000.zip | |
Merge pull request #731 from yuriks/app-info
Kernel: Process class and ExHeader caps parsing
Diffstat (limited to 'src/core/loader/ncch.h')
| -rw-r--r-- | src/core/loader/ncch.h | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index 44c72a4e2..29e39d2c0 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h | |||
| @@ -6,7 +6,9 @@ | |||
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | 8 | ||
| 9 | #include "common/bit_field.h" | ||
| 9 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "common/swap.h" | ||
| 10 | 12 | ||
| 11 | #include "core/loader/loader.h" | 13 | #include "core/loader/loader.h" |
| 12 | 14 | ||
| @@ -65,13 +67,13 @@ struct ExeFs_Header { | |||
| 65 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 67 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 66 | // ExHeader (executable file system header) headers | 68 | // ExHeader (executable file system header) headers |
| 67 | 69 | ||
| 68 | struct ExHeader_SystemInfoFlags{ | 70 | struct ExHeader_SystemInfoFlags { |
| 69 | u8 reserved[5]; | 71 | u8 reserved[5]; |
| 70 | u8 flag; | 72 | u8 flag; |
| 71 | u8 remaster_version[2]; | 73 | u8 remaster_version[2]; |
| 72 | }; | 74 | }; |
| 73 | 75 | ||
| 74 | struct ExHeader_CodeSegmentInfo{ | 76 | struct ExHeader_CodeSegmentInfo { |
| 75 | u32 address; | 77 | u32 address; |
| 76 | u32 num_max_pages; | 78 | u32 num_max_pages; |
| 77 | u32 code_size; | 79 | u32 code_size; |
| @@ -88,17 +90,17 @@ struct ExHeader_CodeSetInfo { | |||
| 88 | u32 bss_size; | 90 | u32 bss_size; |
| 89 | }; | 91 | }; |
| 90 | 92 | ||
| 91 | struct ExHeader_DependencyList{ | 93 | struct ExHeader_DependencyList { |
| 92 | u8 program_id[0x30][8]; | 94 | u8 program_id[0x30][8]; |
| 93 | }; | 95 | }; |
| 94 | 96 | ||
| 95 | struct ExHeader_SystemInfo{ | 97 | struct ExHeader_SystemInfo { |
| 96 | u64 save_data_size; | 98 | u64 save_data_size; |
| 97 | u8 jump_id[8]; | 99 | u8 jump_id[8]; |
| 98 | u8 reserved_2[0x30]; | 100 | u8 reserved_2[0x30]; |
| 99 | }; | 101 | }; |
| 100 | 102 | ||
| 101 | struct ExHeader_StorageInfo{ | 103 | struct ExHeader_StorageInfo { |
| 102 | u8 ext_save_data_id[8]; | 104 | u8 ext_save_data_id[8]; |
| 103 | u8 system_save_data_id[8]; | 105 | u8 system_save_data_id[8]; |
| 104 | u8 reserved[8]; | 106 | u8 reserved[8]; |
| @@ -106,10 +108,16 @@ struct ExHeader_StorageInfo{ | |||
| 106 | u8 other_attributes; | 108 | u8 other_attributes; |
| 107 | }; | 109 | }; |
| 108 | 110 | ||
| 109 | struct ExHeader_ARM11_SystemLocalCaps{ | 111 | struct ExHeader_ARM11_SystemLocalCaps { |
| 110 | u8 program_id[8]; | 112 | u8 program_id[8]; |
| 111 | u32 core_version; | 113 | u32 core_version; |
| 112 | u8 flags[3]; | 114 | u8 reserved_flags[2]; |
| 115 | union { | ||
| 116 | u8 flags0; | ||
| 117 | BitField<0, 2, u8> ideal_processor; | ||
| 118 | BitField<2, 2, u8> affinity_mask; | ||
| 119 | BitField<4, 4, u8> system_mode; | ||
| 120 | }; | ||
| 113 | u8 priority; | 121 | u8 priority; |
| 114 | u8 resource_limit_descriptor[0x10][2]; | 122 | u8 resource_limit_descriptor[0x10][2]; |
| 115 | ExHeader_StorageInfo storage_info; | 123 | ExHeader_StorageInfo storage_info; |
| @@ -119,17 +127,17 @@ struct ExHeader_ARM11_SystemLocalCaps{ | |||
| 119 | u8 resource_limit_category; | 127 | u8 resource_limit_category; |
| 120 | }; | 128 | }; |
| 121 | 129 | ||
| 122 | struct ExHeader_ARM11_KernelCaps{ | 130 | struct ExHeader_ARM11_KernelCaps { |
| 123 | u8 descriptors[28][4]; | 131 | u32_le descriptors[28]; |
| 124 | u8 reserved[0x10]; | 132 | u8 reserved[0x10]; |
| 125 | }; | 133 | }; |
| 126 | 134 | ||
| 127 | struct ExHeader_ARM9_AccessControl{ | 135 | struct ExHeader_ARM9_AccessControl { |
| 128 | u8 descriptors[15]; | 136 | u8 descriptors[15]; |
| 129 | u8 descversion; | 137 | u8 descversion; |
| 130 | }; | 138 | }; |
| 131 | 139 | ||
| 132 | struct ExHeader_Header{ | 140 | struct ExHeader_Header { |
| 133 | ExHeader_CodeSetInfo codeset_info; | 141 | ExHeader_CodeSetInfo codeset_info; |
| 134 | ExHeader_DependencyList dependency_list; | 142 | ExHeader_DependencyList dependency_list; |
| 135 | ExHeader_SystemInfo system_info; | 143 | ExHeader_SystemInfo system_info; |
| @@ -205,12 +213,6 @@ public: | |||
| 205 | */ | 213 | */ |
| 206 | ResultStatus ReadRomFS(std::vector<u8>& buffer) const override; | 214 | ResultStatus ReadRomFS(std::vector<u8>& buffer) const override; |
| 207 | 215 | ||
| 208 | /* | ||
| 209 | * Gets the program id from the NCCH header | ||
| 210 | * @return u64 Program id | ||
| 211 | */ | ||
| 212 | u64 GetProgramId() const; | ||
| 213 | |||
| 214 | private: | 216 | private: |
| 215 | 217 | ||
| 216 | /** | 218 | /** |