forked from DragonMinded/libdragon
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipl3: compress the two stages via shrinkler
This is an experiment that turned out to be too slow. gldemo boot goes from 100ms to 381ms, and that's probably because shrinkler code runs from DMEM in stage0 (and we don't have alternatives in that situation).
- Loading branch information
Showing
17 changed files
with
621 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <stdint.h> | ||
|
||
typedef struct __attribute__((packed)) { | ||
uint32_t pi_dom1_config; | ||
uint32_t clock_rate; | ||
uint32_t boot_address; | ||
uint32_t sdk_version; | ||
uint64_t checksum; | ||
uint64_t reserved1; | ||
char title[20]; | ||
char reserved2[7]; | ||
uint32_t gamecode; | ||
uint8_t rom_version; | ||
} rom_header_t; | ||
|
||
_Static_assert(sizeof(rom_header_t) == 64, "invalid sizeof(rom_header_t)"); | ||
|
||
__attribute__((section(".header"), used)) | ||
const rom_header_t header = { | ||
// Standard PI DOM1 config | ||
.pi_dom1_config = 0x80371240, | ||
// Our IPL3 does not use directly this field. We do set it | ||
// mainly for iQue, so that the special iQue trampoline is run, | ||
// which jumps to our IPL3. | ||
.boot_address = 0x80000400, | ||
// Default title name | ||
.title = "Libdragon ", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
OUTPUT_FORMAT ("elf32-bigmips", "elf32-bigmips", "elf32-littlemips") | ||
OUTPUT_ARCH (mips) | ||
|
||
MEMORY | ||
{ | ||
rom : ORIGIN = 0xB0000000, LENGTH = 65536 | ||
dmem : ORIGIN = 0xA4000000, LENGTH = 4096 | ||
} | ||
|
||
SECTIONS { | ||
.text.prologue 0xB0000000 : { | ||
KEEP(*(.header)) | ||
KEEP(*(.text.boot_trampoline)) | ||
KEEP(*(.text.ique_trampoline)) | ||
} > rom | ||
|
||
.text.stage0 0xA4000040 : AT ( 0xB0001040 ) { | ||
*(.stage0) | ||
} > dmem | ||
|
||
.text.banner : { | ||
*(.banner) | ||
} > dmem | ||
|
||
.text.stage1 : { | ||
*(.stage1bin) | ||
} > dmem | ||
|
||
.text.stage2 : { | ||
*(.stage2bin) | ||
} > dmem | ||
|
||
.text.debug 0xB0003000 : { | ||
*(.debugbin) | ||
} > rom | ||
|
||
/DISCARD/ : { *(.MIPS.abiflags) } | ||
} |
Oops, something went wrong.