* Updated Wii port to libogc 1.8.22

git-svn-id: trunk@42216 -
This commit is contained in:
Legolas 2019-06-12 16:35:25 +00:00
parent 73c8861929
commit a9b015911d
13 changed files with 349 additions and 323 deletions

View File

@ -224,304 +224,310 @@ begin
end;
with linkres do
begin
Add('/*');
Add(' * Linkscript for Wii');
Add(' */');
Add('');
Add('OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc");');
Add('OUTPUT_ARCH(powerpc:common);');
Add('EXTERN(_start);');
Add('ENTRY(_start);');
Add('');
Add('PHDRS');
Add('{');
Add(' stub PT_LOAD FLAGS(5);');
Add(' text PT_LOAD FLAGS(5);');
Add(' data PT_LOAD FLAGS(6);');
Add(' bss1 PT_LOAD;');
Add(' bss2 PT_LOAD;');
Add('');
Add('}');
Add('');
Add('SECTIONS');
Add('{');
Add(' /* stub is loaded at physical address 0x00003400 (though both 0x80003400 and 0x00003400 are equivalent for IOS) */');
Add(' /* This can also be used to load an arbitrary standalone stub at an arbitrary address in memory, for any purpose */');
Add(' /* Use -Wl,--section-start,.stub=0xADDRESS to change */');
Add(' . = 0x00003400;');
Add('');
Add(' .stub :');
Add(' {');
Add(' KEEP(*(.stub))');
Add(' } :stub = 0');
Add('');
Add(' /* default base address */');
Add(' /* use -Wl,--section-start,.init=0xADDRESS to change */');
Add(' . = 0x80004000;');
Add('');
Add(' /* Program */');
Add(' .init :');
Add(' {');
Add(' KEEP (*crt0.o(*.init))');
Add(' KEEP (*(.init))');
Add(' } :text = 0');
Add(' .plt : { *(.plt) }');
Add(' .interp : { *(.interp) }');
Add(' .hash : { *(.hash) }');
Add(' .dynsym : { *(.dynsym) }');
Add(' .dynstr : { *(.dynstr) }');
Add(' .gnu.version : { *(.gnu.version) }');
Add(' .gnu.version_d : { *(.gnu.version_d) }');
Add(' .gnu.version_r : { *(.gnu.version_r) }');
Add(' .rel.init : { *(.rel.init) }');
Add(' .rela.init : { *(.rela.init) }');
Add(' .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }');
Add(' .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }');
Add(' .rel.fini : { *(.rel.fini) }');
Add(' .rela.fini : { *(.rela.fini) }');
Add(' .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }');
Add(' .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }');
Add(' .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }');
Add(' .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }');
Add(' .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }');
Add(' .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }');
Add(' .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }');
Add(' .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }');
Add(' .rel.ctors : { *(.rel.ctors) }');
Add(' .rela.ctors : { *(.rela.ctors) }');
Add(' .rel.dtors : { *(.rel.dtors) }');
Add(' .rela.dtors : { *(.rela.dtors) }');
Add(' .rel.got : { *(.rel.got) }');
Add(' .rela.got : { *(.rela.got) }');
Add(' .rela.got1 : { *(.rela.got1) }');
Add(' .rela.got2 : { *(.rela.got2) }');
Add(' .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }');
Add(' .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }');
Add(' .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }');
Add(' .rela.sbss : { *(.rela.sbss .rela.sbss.* .rel.gnu.linkonce.sb.*) }');
Add(' .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }');
Add(' .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }');
Add(' .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }');
Add(' .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }');
Add(' .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }');
Add(' .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }');
Add(' .rel.plt : { *(.rel.plt) }');
Add(' .rela.plt : { *(.rela.plt) }');
Add('');
Add(' .text :');
Add(' {');
Add(' *(.text)');
Add(' *(.text.*)');
Add(' /* .gnu.warning sections are handled specially by elf32.em. */');
Add(' *(.gnu.warning)');
Add(' *(.gnu.linkonce.t.*)');
Add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
Add(' } = 0');
Add('');
Add(' .fini :');
Add(' {');
Add(' KEEP (*(.fini))');
Add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
Add(' } = 0');
Add(' ');
Add(' PROVIDE (__etext = .);');
Add(' PROVIDE (_etext = .);');
Add(' PROVIDE (etext = .);');
Add('');
Add(' .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } :data');
Add(' .rodata1 : { *(.rodata1) }');
Add(' .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }');
Add(' .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }');
Add(' /* Adjust the address for the data segment. We want to adjust up to');
Add(' the same address within the page on the next page up. */');
Add(' /* Ensure the __preinit_array_start label is properly aligned. We');
Add(' could instead move the label definition inside the section, but');
Add(' the linker would then create the section even if it turns out to');
Add(' be empty, which isn''t pretty. */');
Add(' . = ALIGN(32 / 8);');
Add(' PROVIDE (__preinit_array_start = .);');
Add(' .preinit_array : { *(.preinit_array) }');
Add(' PROVIDE (__preinit_array_end = .);');
Add(' PROVIDE (__init_array_start = .);');
Add(' .init_array : { *(.init_array) }');
Add(' PROVIDE (__init_array_end = .);');
Add(' PROVIDE (__fini_array_start = .);');
Add(' .fini_array : { *(.fini_array) }');
Add(' PROVIDE (__fini_array_end = .);');
Add(' .data :');
Add(' {');
Add(' *(.data)');
Add(' *(.data.*)');
Add(' *(.gnu.linkonce.d.*)');
Add(' SORT(CONSTRUCTORS)');
Add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
Add(' }');
Add('');
Add(' .data1 : { *(.data1) }');
Add(' .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }');
Add(' .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }');
Add(' .eh_frame : { KEEP (*(.eh_frame)) }');
Add(' .gcc_except_table : { *(.gcc_except_table) }');
Add(' .fixup : { *(.fixup) }');
Add(' .got1 : { *(.got1) }');
Add(' .got2 : { *(.got2) }');
Add(' .dynamic : { *(.dynamic) }');
Add('');
Add(' .ctors :');
Add(' {');
Add(' /* gcc uses crtbegin.o to find the start of');
Add(' the constructors, so we make sure it is');
Add(' first. Because this is a wildcard, it');
Add(' doesn''t matter if the user does not');
Add(' actually link against crtbegin.o; the');
Add(' linker won''t look for a file to match a');
Add(' wildcard. The wildcard also means that it');
Add(' doesn''t matter which directory crtbegin.o');
Add(' is in. */');
Add('');
Add(' KEEP (*crtbegin.o(.ctors))');
Add('');
Add(' /* We don''t want to include the .ctor section from');
Add(' from the crtend.o file until after the sorted ctors.');
Add(' The .ctor section from the crtend file contains the');
Add(' end of ctors marker and it must be last */');
Add('');
Add(' KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))');
Add(' KEEP (*(SORT(.ctors.*)))');
Add(' KEEP (*(.ctors))');
Add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
Add(' }');
Add('');
Add(' .dtors :');
Add(' {');
Add(' KEEP (*crtbegin.o(.dtors))');
Add(' KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))');
Add(' KEEP (*(SORT(.dtors.*)))');
Add(' KEEP (*(.dtors))');
Add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
Add(' }');
Add('');
Add(' .jcr : { KEEP (*(.jcr)) }');
Add(' .got : { *(.got.plt) *(.got) }');
Add('');
Add('');
Add(' /* We want the small data sections together, so single-instruction offsets');
Add(' can access them all, and initialized data all before uninitialized, so');
Add(' we can shorten the on-disk segment size. */');
Add('');
Add(' .sdata :');
Add(' {');
Add(' *(.sdata)');
Add(' *(.sdata.*)');
Add(' *(.gnu.linkonce.s.*)');
Add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
Add(' }');
Add('');
Add(' _edata = .;');
Add(' PROVIDE (edata = .);');
Add(' ');
Add(' .sbss :');
Add(' {');
Add(' __sbss_start = .;');
Add(' PROVIDE (__sbss_start = .);');
Add(' PROVIDE (___sbss_start = .);');
Add(' *(.dynsbss)');
Add(' *(.sbss)');
Add(' *(.sbss.*)');
Add(' *(.gnu.linkonce.sb.*)');
Add(' *(.scommon)');
Add(' PROVIDE (__sbss_end = .);');
Add(' PROVIDE (___sbss_end = .);');
Add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
Add(' __sbss_end = .;');
Add(' } :bss1');
Add('');
Add(' .bss :');
Add(' {');
Add(' __bss_start = .;');
Add(' PROVIDE (__bss_start = .);');
Add(' *(.dynbss)');
Add(' *(.bss)');
Add(' *(.bss.*)');
Add(' *(.gnu.linkonce.b.*)');
Add(' *(COMMON)');
Add(' /* Align here to ensure that the .bss section occupies space up to');
Add(' _end. Align after .bss to ensure correct alignment even if the');
Add(' .bss section disappears because there are no input sections. */');
Add('');
Add(' . = ALIGN(32);');
Add('');
Add(' PROVIDE (__bss_end = .);');
Add(' __bss_end = .;');
Add(' } :bss2');
Add('');
Add(' _end = .;');
Add(' PROVIDE(end = .);');
Add(' /* Stabs debugging sections. */');
Add(' .stab 0 : { *(.stab) }');
Add(' .stabstr 0 : { *(.stabstr) }');
Add(' .stab.excl 0 : { *(.stab.excl) }');
Add(' .stab.exclstr 0 : { *(.stab.exclstr) }');
Add(' .stab.index 0 : { *(.stab.index) }');
Add(' .stab.indexstr 0 : { *(.stab.indexstr) }');
Add(' .comment 0 : { *(.comment) }');
Add(' /* DWARF debug sections.');
Add(' Symbols in the DWARF debugging sections are relative to the beginning');
Add(' of the section so we begin them at 0. */');
Add(' /* DWARF 1 */');
Add(' .debug 0 : { *(.debug) }');
Add(' .line 0 : { *(.line) }');
Add(' /* GNU DWARF 1 extensions */');
Add(' .debug_srcinfo 0 : { *(.debug_srcinfo) }');
Add(' .debug_sfnames 0 : { *(.debug_sfnames) }');
Add(' /* DWARF 1.1 and DWARF 2 */');
Add(' .debug_aranges 0 : { *(.debug_aranges) }');
Add(' .debug_pubnames 0 : { *(.debug_pubnames) }');
Add(' /* DWARF 2 */');
Add(' .debug_info 0 : { *(.debug_info) }');
Add(' .debug_abbrev 0 : { *(.debug_abbrev) }');
Add(' .debug_line 0 : { *(.debug_line) }');
Add(' .debug_frame 0 : { *(.debug_frame) }');
Add(' .debug_str 0 : { *(.debug_str) }');
Add(' .debug_loc 0 : { *(.debug_loc) }');
Add(' .debug_macinfo 0 : { *(.debug_macinfo) }');
Add(' /* SGI/MIPS DWARF 2 extensions */');
Add(' .debug_weaknames 0 : { *(.debug_weaknames) }');
Add(' .debug_funcnames 0 : { *(.debug_funcnames) }');
Add(' .debug_typenames 0 : { *(.debug_typenames) }');
Add(' .debug_varnames 0 : { *(.debug_varnames) }');
Add(' /* These must appear regardless of . */');
Add('}');
Add('');
Add('__isIPL = 0;');
Add('__stack_addr = (__bss_start + SIZEOF(.bss) + 0x20000 + 7) & (-8);');
Add('__stack_end = (__bss_start + SIZEOF(.bss));');
Add('__intrstack_addr = (__stack_addr + 0x4000);');
Add('__intrstack_end = (__stack_addr);');
Add('__Arena1Lo = (__intrstack_addr + 31) & (-32);');
Add('__Arena1Hi = (0x817FEFF0);');
Add('__Arena2Lo = (0x90002000);');
Add('__Arena2Hi = (0x933E0000);');
Add('');
Add('__gxregs = (__Arena1Hi + 31) & (-32);');
Add('__ipcbufferLo = (0x933e0000);');
Add('__ipcbufferHi = (0x93400000);');
Add('');
Add('/* for backward compatibility with old crt0 */');
Add('PROVIDE (__stack = (0x817FEFF0));');
Add('');
Add('PROVIDE(__isIPL = __isIPL);');
Add('PROVIDE(__stack_addr = __stack_addr);');
Add('PROVIDE(__stack_end = __stack_end);');
Add('PROVIDE(__intrstack_addr = __intrstack_addr);');
Add('PROVIDE(__intrstack_end = __intrstack_end);');
Add('PROVIDE(__Arena1Lo = __Arena1Lo);');
Add('PROVIDE(__Arena1Hi = __Arena1Hi);');
Add('PROVIDE(__Arena2Lo = __Arena2Lo);');
Add('PROVIDE(__Arena2Hi = __Arena2Hi);');
Add('PROVIDE(__ipcbufferLo = __ipcbufferLo);');
Add('PROVIDE(__ipcbufferHi = __ipcbufferHi);');
Add('PROVIDE(__gxregs = __gxregs);');
add('/*');
add(' * Linkscript for Wii');
add(' */');
add('');
add('OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc");');
add('OUTPUT_ARCH(powerpc:common);');
add('EXTERN(_start);');
add('ENTRY(_start);');
add('');
add('PHDRS');
add('{');
add(' stub PT_LOAD FLAGS(5);');
add(' text PT_LOAD FLAGS(5);');
add(' data PT_LOAD FLAGS(6);');
add(' bss1 PT_LOAD;');
add(' bss2 PT_LOAD;');
add('');
add('}');
add('');
add('SECTIONS');
add('{');
add(' /* stub is loaded at physical address 0x00003400 (though both 0x80003400 and 0x00003400 are equivalent for IOS) */');
add(' /* This can also be used to load an arbitrary standalone stub at an arbitrary address in memory, for any purpose */');
add(' /* Use -Wl,--section-start,.stub=0xADDRESS to change */');
add(' . = 0x00003400;');
add('');
add(' .stub :');
add(' {');
add(' KEEP(*(.stub))');
add(' } :stub = 0');
add('');
add(' /* default base address */');
add(' /* use -Wl,--section-start,.init=0xADDRESS to change */');
add(' . = 0x80004000;');
add('');
add(' /* Program */');
add(' .init :');
add(' {');
add(' KEEP (*crt0.o(*.init))');
add(' KEEP (*(.init))');
add(' } :text = 0');
add(' .plt : { *(.plt) }');
add(' .interp : { *(.interp) }');
add(' .hash : { *(.hash) }');
add(' .dynsym : { *(.dynsym) }');
add(' .dynstr : { *(.dynstr) }');
add(' .gnu.version : { *(.gnu.version) }');
add(' .gnu.version_d : { *(.gnu.version_d) }');
add(' .gnu.version_r : { *(.gnu.version_r) }');
add(' .rel.init : { *(.rel.init) }');
add(' .rela.init : { *(.rela.init) }');
add(' .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }');
add(' .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }');
add(' .rel.fini : { *(.rel.fini) }');
add(' .rela.fini : { *(.rela.fini) }');
add(' .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }');
add(' .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }');
add(' .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }');
add(' .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }');
add(' .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }');
add(' .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }');
add(' .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }');
add(' .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }');
add(' .rel.ctors : { *(.rel.ctors) }');
add(' .rela.ctors : { *(.rela.ctors) }');
add(' .rel.dtors : { *(.rel.dtors) }');
add(' .rela.dtors : { *(.rela.dtors) }');
add(' .rel.got : { *(.rel.got) }');
add(' .rela.got : { *(.rela.got) }');
add(' .rela.got1 : { *(.rela.got1) }');
add(' .rela.got2 : { *(.rela.got2) }');
add(' .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }');
add(' .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }');
add(' .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }');
add(' .rela.sbss : { *(.rela.sbss .rela.sbss.* .rel.gnu.linkonce.sb.*) }');
add(' .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }');
add(' .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }');
add(' .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }');
add(' .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }');
add(' .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }');
add(' .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }');
add(' .rel.plt : { *(.rel.plt) }');
add(' .rela.plt : { *(.rela.plt) }');
add('');
add(' .text :');
add(' {');
add(' *(.text)');
add(' *(.text.*)');
add(' /* .gnu.warning sections are handled specially by elf32.em. */');
add(' *(.gnu.warning)');
add(' *(.gnu.linkonce.t.*)');
add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
add(' } = 0');
add('');
add(' .fini :');
add(' {');
add(' KEEP (*(.fini))');
add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
add(' } = 0');
add(' ');
add(' PROVIDE (__etext = .);');
add(' PROVIDE (_etext = .);');
add(' PROVIDE (etext = .);');
add('');
add(' .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } :data');
add(' .rodata1 : { *(.rodata1) }');
add(' .sdata2 : {');
add(' PROVIDE(_SDA2_BASE_ = .);');
add(' *(.sdata2)');
add(' *(.sdata2.*)');
add(' *(.gnu.linkonce.s2.*)');
add(' }');
add(' .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }');
add(' /* Adjust the address for the data segment. We want to adjust up to');
add(' the same address within the page on the next page up. */');
add(' /* Ensure the __preinit_array_start label is properly aligned. We');
add(' could instead move the label definition inside the section, but');
add(' the linker would then create the section even if it turns out to');
add(' be empty, which isn''t pretty. */');
add(' . = ALIGN(32 / 8);');
add(' PROVIDE (__preinit_array_start = .);');
add(' .preinit_array : { *(.preinit_array) }');
add(' PROVIDE (__preinit_array_end = .);');
add(' PROVIDE (__init_array_start = .);');
add(' .init_array : { *(.init_array) }');
add(' PROVIDE (__init_array_end = .);');
add(' PROVIDE (__fini_array_start = .);');
add(' .fini_array : { *(.fini_array) }');
add(' PROVIDE (__fini_array_end = .);');
add(' .data :');
add(' {');
add(' *(.data)');
add(' *(.data.*)');
add(' *(.gnu.linkonce.d.*)');
add(' SORT(CONSTRUCTORS)');
add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
add(' }');
add('');
add(' .data1 : { *(.data1) }');
add(' .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }');
add(' .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }');
add(' .eh_frame : { KEEP (*(.eh_frame)) }');
add(' .gcc_except_table : { *(.gcc_except_table) }');
add(' .fixup : { *(.fixup) }');
add(' .got1 : { *(.got1) }');
add(' .got2 : { *(.got2) }');
add(' .dynamic : { *(.dynamic) }');
add('');
add(' .ctors :');
add(' {');
add(' /* gcc uses crtbegin.o to find the start of');
add(' the constructors, so we make sure it is');
add(' first. Because this is a wildcard, it');
add(' doesn''t matter if the user does not');
add(' actually link against crtbegin.o; the');
add(' linker won''t look for a file to match a');
add(' wildcard. The wildcard also means that it');
add(' doesn''t matter which directory crtbegin.o');
add(' is in. */');
add('');
add(' KEEP (*crtbegin.o(.ctors))');
add('');
add(' /* We don''t want to include the .ctor section from');
add(' from the crtend.o file until after the sorted ctors.');
add(' The .ctor section from the crtend file contains the');
add(' end of ctors marker and it must be last */');
add('');
add(' KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))');
add(' KEEP (*(SORT(.ctors.*)))');
add(' KEEP (*(.ctors))');
add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
add(' }');
add('');
add(' .dtors :');
add(' {');
add(' KEEP (*crtbegin.o(.dtors))');
add(' KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))');
add(' KEEP (*(SORT(.dtors.*)))');
add(' KEEP (*(.dtors))');
add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
add(' }');
add('');
add(' .jcr : { KEEP (*(.jcr)) }');
add(' .got : { *(.got.plt) *(.got) }');
add('');
add('');
add(' /* We want the small data sections together, so single-instruction offsets');
add(' can access them all, and initialized data all before uninitialized, so');
add(' we can shorten the on-disk segment size. */');
add('');
add(' .sdata :');
add(' {');
add(' PROVIDE(_SDA_BASE_ = .);');
add(' *(.sdata)');
add(' *(.sdata.*)');
add(' *(.gnu.linkonce.s.*)');
add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
add(' }');
add('');
add(' _edata = .;');
add(' PROVIDE (edata = .);');
add(' ');
add(' .sbss :');
add(' {');
add(' __sbss_start = .;');
add(' PROVIDE (__sbss_start = .);');
add(' PROVIDE (___sbss_start = .);');
add(' *(.dynsbss)');
add(' *(.sbss)');
add(' *(.sbss.*)');
add(' *(.gnu.linkonce.sb.*)');
add(' *(.scommon)');
add(' PROVIDE (__sbss_end = .);');
add(' PROVIDE (___sbss_end = .);');
add(' . = ALIGN(32); /* REQUIRED. LD is flaky without it. */');
add(' __sbss_end = .;');
add(' } :bss1');
add('');
add(' .bss :');
add(' {');
add(' __bss_start = .;');
add(' PROVIDE (__bss_start = .);');
add(' *(.dynbss)');
add(' *(.bss)');
add(' *(.bss.*)');
add(' *(.gnu.linkonce.b.*)');
add(' *(COMMON)');
add(' /* Align here to ensure that the .bss section occupies space up to');
add(' _end. Align after .bss to ensure correct alignment even if the');
add(' .bss section disappears because there are no input sections. */');
add('');
add(' . = ALIGN(32);');
add('');
add(' PROVIDE (__bss_end = .);');
add(' __bss_end = .;');
add(' } :bss2');
add('');
add(' _end = .;');
add(' PROVIDE(end = .);');
add(' /* Stabs debugging sections. */');
add(' .stab 0 : { *(.stab) }');
add(' .stabstr 0 : { *(.stabstr) }');
add(' .stab.excl 0 : { *(.stab.excl) }');
add(' .stab.exclstr 0 : { *(.stab.exclstr) }');
add(' .stab.index 0 : { *(.stab.index) }');
add(' .stab.indexstr 0 : { *(.stab.indexstr) }');
add(' .comment 0 : { *(.comment) }');
add(' /* DWARF debug sections.');
add(' Symbols in the DWARF debugging sections are relative to the beginning');
add(' of the section so we begin them at 0. */');
add(' /* DWARF 1 */');
add(' .debug 0 : { *(.debug) }');
add(' .line 0 : { *(.line) }');
add(' /* GNU DWARF 1 extensions */');
add(' .debug_srcinfo 0 : { *(.debug_srcinfo) }');
add(' .debug_sfnames 0 : { *(.debug_sfnames) }');
add(' /* DWARF 1.1 and DWARF 2 */');
add(' .debug_aranges 0 : { *(.debug_aranges) }');
add(' .debug_pubnames 0 : { *(.debug_pubnames) }');
add(' /* DWARF 2 */');
add(' .debug_info 0 : { *(.debug_info) }');
add(' .debug_abbrev 0 : { *(.debug_abbrev) }');
add(' .debug_line 0 : { *(.debug_line) }');
add(' .debug_frame 0 : { *(.debug_frame) }');
add(' .debug_str 0 : { *(.debug_str) }');
add(' .debug_loc 0 : { *(.debug_loc) }');
add(' .debug_macinfo 0 : { *(.debug_macinfo) }');
add(' /* SGI/MIPS DWARF 2 extensions */');
add(' .debug_weaknames 0 : { *(.debug_weaknames) }');
add(' .debug_funcnames 0 : { *(.debug_funcnames) }');
add(' .debug_typenames 0 : { *(.debug_typenames) }');
add(' .debug_varnames 0 : { *(.debug_varnames) }');
add(' /* These must appear regardless of . */');
add('}');
add('');
add('__isIPL = 0;');
add('__stack_addr = (__bss_start + SIZEOF(.bss) + 0x20000 + 7) & (-8);');
add('__stack_end = (__bss_start + SIZEOF(.bss));');
add('__intrstack_addr = (__stack_addr + 0x4000);');
add('__intrstack_end = (__stack_addr);');
add('__Arena1Lo = (__intrstack_addr + 31) & (-32);');
add('__Arena1Hi = (0x817FEFF0);');
add('__Arena2Lo = (0x90002000);');
add('__Arena2Hi = (0x933E0000);');
add('');
add('__gxregs = (__Arena1Hi + 31) & (-32);');
add('__ipcbufferLo = (0x933e0000);');
add('__ipcbufferHi = (0x93400000);');
add('');
add('/* for backward compatibility with old crt0 */');
add('PROVIDE (__stack = (0x817FEFF0));');
add('');
add('PROVIDE(__isIPL = __isIPL);');
add('PROVIDE(__stack_addr = __stack_addr);');
add('PROVIDE(__stack_end = __stack_end);');
add('PROVIDE(__intrstack_addr = __intrstack_addr);');
add('PROVIDE(__intrstack_end = __intrstack_end);');
add('PROVIDE(__Arena1Lo = __Arena1Lo);');
add('PROVIDE(__Arena1Hi = __Arena1Hi);');
add('PROVIDE(__Arena2Lo = __Arena2Lo);');
add('PROVIDE(__Arena2Hi = __Arena2Hi);');
add('PROVIDE(__ipcbufferLo = __ipcbufferLo);');
add('PROVIDE(__ipcbufferHi = __ipcbufferHi);');
add('PROVIDE(__gxregs = __gxregs);');
end;

View File

@ -235,9 +235,9 @@ type
function net_init_async(cb: netcallback; usrdata: pointer): cint32; cdecl; external;
function net_get_status: cint32; cdecl; external;
procedure net_wc24cleanup; cdecl; external;
function net_get_mac_address(mac_buf: pointer): cint32; cdecl; external;
{$endif}
function net_get_mac_address(mac_buf: pointer): cint32; cdecl; external;
procedure net_deinit; cdecl; external;
function net_gethostip: cuint32; cdecl; external;
function net_socket(domain, type_, protocol: cuint32): cint32; cdecl; external;

View File

@ -8,6 +8,8 @@ procedure ARQM_Init(arambase: cuint32; len: cint32); cdecl; external;
function ARQM_PushData(buffer: pointer; len: cint32): cuint32; cdecl; external;
procedure ARQM_Pop(); cdecl; external;
function ARQM_GetZeroBuffer: cuint32; cdecl; external;
function ARQM_GetStackPointer: cuint32; cdecl; external;

View File

@ -21,14 +21,17 @@ const
{$ifdef GEKKO}
const
GQR_SCALE_MASK = ($3f shl 8);
procedure __set_gqr(_reg,_val: cint); inline;
procedure CAST_Init(); inline;
procedure CAST_SetGQR2(_type, scale: cuint32); inline;
procedure CAST_SetGQR3(_type, scale: cuint32); inline;
procedure CAST_SetGQR4(_type, scale: cuint32); inline;
procedure CAST_SetGQR5(_type, scale: cuint32); inline;
procedure CAST_SetGQR6(_type, scale: cuint32); inline;
procedure CAST_SetGQR7(_type, scale: cuint32); inline;
procedure CAST_SetGQR2(_type, scale: cint32); inline;
procedure CAST_SetGQR3(_type, scale: cint32); inline;
procedure CAST_SetGQR4(_type, scale: cint32); inline;
procedure CAST_SetGQR5(_type, scale: cint32); inline;
procedure CAST_SetGQR6(_type, scale: cint32); inline;
procedure CAST_SetGQR7(_type, scale: cint32); inline;
function __castu8f32(_in: pcuint8): f32; inline;
function __castu16f32(_in: pcuint16): f32; inline;
function __casts8f32(_in: pcint8): f32; inline
@ -85,7 +88,7 @@ procedure CAST_SetGQR2(_type, scale: cuint32); inline;
var
val: cuint32;
begin
val := (((((scale) shl 8) or (_type)) shl 16) or (((scale) shl 8) or (_type)));
val := ((((((scale) shl 8) and GQR_SCALE_MASK) or (_type)) shl 16) or ((((scale) shl 8) and GQR_SCALE_MASK) or (_type)));
__set_gqr(GQR2,val);
end;
@ -93,7 +96,7 @@ procedure CAST_SetGQR3(_type, scale: cuint32); inline;
var
val: cuint32;
begin
val := (((((scale) shl 8) or (_type)) shl 16) or (((scale) shl 8) or (_type)));
val := ((((((scale) shl 8) and GQR_SCALE_MASK) or (_type)) shl 16) or ((((scale) shl 8) and GQR_SCALE_MASK) or (_type)));
__set_gqr(GQR3,val);
end;
@ -101,7 +104,7 @@ procedure CAST_SetGQR4(_type, scale: cuint32); inline;
var
val: cuint32;
begin
val := (((((scale) shl 8) or (_type)) shl 16) or (((scale) shl 8) or (_type)));
val := ((((((scale) shl 8) and GQR_SCALE_MASK) or (_type)) shl 16) or ((((scale) shl 8) and GQR_SCALE_MASK) or (_type)));
__set_gqr(GQR4,val);
end;
@ -109,7 +112,7 @@ procedure CAST_SetGQR5(_type, scale: cuint32); inline;
var
val: cuint32;
begin
val := (((((scale) shl 8) or (_type)) shl 16) or (((scale) shl 8) or (_type)));
val := ((((((scale) shl 8) and GQR_SCALE_MASK) or (_type)) shl 16) or ((((scale) shl 8) and GQR_SCALE_MASK) or (_type)));
__set_gqr(GQR5,val);
end;
@ -117,7 +120,7 @@ procedure CAST_SetGQR6(_type, scale: cuint32); inline;
var
val: cuint32;
begin
val := (((((scale) shl 8) or (_type)) shl 16) or (((scale) shl 8) or (_type)));
val := ((((((scale) shl 8) and GQR_SCALE_MASK) or (_type)) shl 16) or ((((scale) shl 8) and GQR_SCALE_MASK) or (_type)));
__set_gqr(GQR6,val);
end;
@ -125,7 +128,7 @@ procedure CAST_SetGQR7(_type, scale: cuint32); inline;
var
val: cuint32;
begin
val := (((((scale) shl 8) or (_type)) shl 16) or (((scale) shl 8) or (_type)));
val := ((((((scale) shl 8) and GQR_SCALE_MASK) or (_type)) shl 16) or ((((scale) shl 8) and GQR_SCALE_MASK) or (_type)));
__set_gqr(GQR7,val);
end;

View File

@ -79,6 +79,8 @@ procedure DSP_Halt; cdecl; external;
procedure DSP_Unhalt; cdecl; external;
function DSP_GetDMAStatus(): cuint32; cdecl; external;
function DSP_RegisterCallback(usr_cb: DSPCallback): DSPCallback; cdecl; external;
{$ENDIF}

View File

@ -1030,6 +1030,7 @@ procedure GX_LoadPosMtxIdx(mtxidx: cuint16; pnidx: cuint32); cdecl; external;
procedure GX_LoadNrmMtxImm(mt: Mtx; pnidx: cuint32); cdecl; external;
procedure GX_LoadNrmMtxImm3x3(mt: Mtx33; pnidx: cuint32); cdecl; external;
procedure GX_LoadNrmMtxIdx3x3(mtxidx: cuint16; pnidx: cuint32); cdecl; external;
@ -2300,6 +2301,7 @@ procedure GX_InitTexObjLOD(obj: PGXTexObj; minfilt, magfilt: cuint8;
procedure GX_SetTexCoordScaleManually(texcoord, enable: cuint8; ss, ts: cuint16); cdecl; external;
procedure GX_SetTexCoordCylWrap(texcoord, s_enable, t_enable: cuint8); cdecl; external;
(*!
* \fn void GX_SetTexCoordBias(u8 texcoord,u8 s_enable,u8 t_enable)

View File

@ -22,12 +22,12 @@ type
function ISFS_Initialize: cint32; cdecl; external;
function ISFS_Deinitialize: cint32; cdecl; external;
function ISFS_Format(): cint32; cdecl; external;
function ISFS_FormatAsync(cb: isfscallback; usrdata: pointer): cint32; cdecl; external;
function ISFS_Open(filepath: pcchar; mode: cuint8): cint32; cdecl; external;
function ISFS_OpenAsync(filepath: pcchar; mode: cuint8; cb: isfscallback;
usrdata: pointer): cint32; cdecl; external;

View File

@ -125,12 +125,12 @@ end;
function tick_microsecs(ticks: cuint64): cuint64; inline;
begin
result := (((cuint64(ticks)*8) mod cuint64(TB_TIMER_CLOCK div 125)));
result := (((cuint64(ticks)*8) div cuint64(TB_TIMER_CLOCK div 125)) mod TB_USPERSEC);
end;
function tick_nanosecs(ticks: cuint64): cuint64; inline;
begin
result := (((cuint64(ticks)*8000) mod cuint64(TB_TIMER_CLOCK div 125)));
result := (((cuint64(ticks)*8000) div cuint64(TB_TIMER_CLOCK div 125)) mod TB_NSPERSEC);
end;

View File

@ -66,9 +66,8 @@ type
function SI_Sync: cuint32; cdecl; external;
function SI_Busy: cuint32; cdecl; external;
procedure SI_SetXY(line: cuint16; cnt: cuint8); cdecl; external;
function SI_IsChanBusy(chan: cint32): cuint32; cdecl; external;
procedure SI_EnablePolling(poll: cuint32); cdecl; external;
@ -82,7 +81,7 @@ function SI_GetStatus(chan: cint32): cuint32; cdecl; external;
function SI_GetResponse(chan: cint32; buf: pointer): cuint32; cdecl; external;
function SI_GetResponseRaw(chan: cint32): cuint32; cdecl; external;
procedure SI_SetSamplingRate(samplingrate: cuint32); cdecl; external;
procedure SI_RefreshSamplingRate; cdecl; external;
function SI_Transfer(chan: cint32; out_: pointer; out_len: cuint32;

View File

@ -115,7 +115,7 @@ type
resetcallback = procedure;
resetcallback = procedure(irq: cuint32; ctx: pointer);
powercallback = procedure;
resetfunction = function(_final: cint32): cint32;
@ -139,7 +139,7 @@ procedure SYS_ProtectRange(chan: cuint32; addr: pointer; bytes, cntrl: cuint32);
procedure SYS_StartPMC(mcr0val, mcr1val: cuint32); cdecl; external;
procedure SYS_DumpPMC(); cdecl; external;
procedure SYS_StopPMC(); cdecl; external;
procedure SYS_ResetPMC(); cdecl; external;
function SYS_CreateAlarm(thealarm: psyswd_t): cint32; cdecl; external;

View File

@ -57,7 +57,7 @@ type
praw_device_command = ^raw_device_command;
function USBStorage_Initialize(): cint32; cdecl; external;
procedure USBStorage_Deinitialize(); cdecl; external;
function USBStorage_Open(dev: pusbstorage_handle; device_id: cint32; vid, pid: cuint16): cint32; cdecl; external;
function USBStorage_Close(dev: pusbstorage_handle): cint32; cdecl; external;
function USBStorage_Reset(dev: pusbstorage_handle): cint32; cdecl; external;

View File

@ -31,7 +31,5 @@ const
TB_SECSPERDAY = (TB_SECSPERMIN * TB_MINSPERHR * TB_HRSPERDAY);
TB_SECSPERNYR = (365 * TB_SECSPERDAY);
function time(timer: ptime_t): time_t; cdecl; external;
function nanosleep(tb: ptimespec): cint; cdecl; external;
{$endif OGC_INTERFACE}

View File

@ -17,6 +17,11 @@ const
{$define C_SIZE(drv_no) := (cuint16(((g_CSD[drv_no][6] and $03) shl 10) or (g_CSD[drv_no][7] shl 2) or ((g_CSD[drv_no][8] shr 6) and $03)))}
{$define C_SIZE_MULT(drv_no) := (cuint8((g_CSD[drv_no][9] and $03) shl 1) or ((g_CSD[drv_no][10] shr 7) and $01))}
type
card_addressing_type_t = cuint32;
const
CARD_IO_SECTOR_ADDRESSING: card_addressing_type_t = 0;
CARD_IO_BYTE_ADDRESSING: card_addressing_type_t = 1;
var
g_CSD : array [0..15] of cuint8; external;
@ -40,6 +45,15 @@ function sdgecko_writeSectors(drv_no: cint32; sector_no, num_sectors: cuint32;
function sdgecko_doUnmount(drv_no: cint32): cint32; cdecl; external;
procedure sdgecko_insertedCB(drv_no: cint32); cdecl; external;
procedure sdgecko_ejectedCB(drv_no: cint32); cdecl; external;
procedure sdgecko_setSpeed(freq: cuint32); cdecl; external;
function sdgecko_getPageSize(drv_no: cint32): cuint32; cdecl; external;
function sdgecko_setPageSize(drv_no: cint32; size: cint): cuint32; cdecl; external;
function sdgecko_getAddressingType(drv_no: cint32): card_addressing_type_t; cdecl; external;
{$ENDIF}