Difference between revisions of "KBlockInfo"
(Created page with "Category:Kernel objects Size : 0x8 bytes {| class="wikitable" border="1" |- ! Offset ! Type ! Description |- | 0x0 | | |}") |
(Info on FCRAM page reference counts and how they relate to KBlockInfo) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 11: | Line 11: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | u32 |
− | | | + | | Pointer to memory section start in FCRAM using kernel vmem addresses |
+ | |- | ||
+ | | 0x4 | ||
+ | | u32 | ||
+ | | Page count | ||
|} | |} | ||
+ | |||
+ | KBlockInfo objects start with the FS KProcess on the kernel heap and continue in order. Each KProcess gets 3 or more KBlockInfo objects for (in order) .text pointer and page count, .rodata pointer and page count, and .data pointer and page count. Apps that require more space than is available in a given block will get multiple KBlockInfo objects for each section to split it up into open spaces. | ||
+ | |||
+ | When KBlockInfo data is destroyed, the page for page reference counts for each page in the block are updated. At the beginning of base memory, the first 0x20000 bytes make up 0x8000 words. Each word represents the reference count for 1 page of FCRAM, in order from beginning to end. As the pages are checked for freeing up, each reference count is decremented and the pages with a reference count of 0 are released. |
Latest revision as of 09:58, 8 February 2015
Size : 0x8 bytes
Offset | Type | Description |
---|---|---|
0x0 | u32 | Pointer to memory section start in FCRAM using kernel vmem addresses |
0x4 | u32 | Page count |
KBlockInfo objects start with the FS KProcess on the kernel heap and continue in order. Each KProcess gets 3 or more KBlockInfo objects for (in order) .text pointer and page count, .rodata pointer and page count, and .data pointer and page count. Apps that require more space than is available in a given block will get multiple KBlockInfo objects for each section to split it up into open spaces.
When KBlockInfo data is destroyed, the page for page reference counts for each page in the block are updated. At the beginning of base memory, the first 0x20000 bytes make up 0x8000 words. Each word represents the reference count for 1 page of FCRAM, in order from beginning to end. As the pages are checked for freeing up, each reference count is decremented and the pages with a reference count of 0 are released.