A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 206 lines 4.3 kB view raw
1#include "config.h" 2 3ENTRY(start) 4 5#ifdef CPU_COLDFIRE 6OUTPUT_FORMAT(elf32-m68k) 7STARTUP(target/coldfire/crt0.o) 8#elif defined(CPU_PP) 9OUTPUT_FORMAT(elf32-littlearm) 10STARTUP(target/arm/pp/crt0-pp.o) 11#elif defined(CPU_ARM) 12OUTPUT_FORMAT(elf32-littlearm) 13STARTUP(target/arm/crt0.o) 14#else 15#error "Unknown CPU" 16#endif 17 18 19#if MEMORYSIZE >= 32 20#define PLUGINSIZE PLUGIN_BUFFER_SIZE 21#else 22#define PLUGINSIZE 0x8000 23#endif 24 25#ifdef IRIVER_H100_SERIES 26#define CODECSIZE CODEC_SIZE 27#define DRAMORIG 0x31000000 28#define IRAMORIG 0x10000000 29#define IRAMSIZE 0xc000 30#define FLASHORIG 0x00100028 31#define FLASHSIZE 0x000eff80 32#elif defined(IRIVER_H300_SERIES) 33#define CODECSIZE CODEC_SIZE 34#define DRAMORIG 0x31000000 35#define IRAMORIG 0x10000000 36#define IRAMSIZE 0xc000 37#define FLASHORIG 0x00200028 38#define FLASHSIZE 0x001eff80 39#else 40#define DRAMORIG 0x09000000 41#define IRAMORIG 0x0f000000 42#define IRAMSIZE 0x1000 43#define FLASHORIG 0x02000000 + ROM_START 44#define FLASHSIZE 256K - ROM_START 45#endif 46 47#ifdef CODECSIZE 48#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - CODECSIZE 49/* Where the codec buffer ends, and the plugin buffer starts */ 50#define ENDADDR (ENDAUDIOADDR + CODECSIZE) 51#else 52#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE 53/* Where the audio buffer ends, and the plugin buffer starts */ 54#define ENDADDR ENDAUDIOADDR 55#endif 56 57/* End of the audio buffer, where the codec/plugin buffer starts */ 58#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) 59#define CODECORIG ENDAUDIOADDR 60 61MEMORY 62{ 63 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE 64 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE 65 FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE 66} 67 68SECTIONS 69{ 70 .flashheader : 71 { 72 /* place flash link address first, so the plugin can check */ 73 LONG(FLASHORIG); 74 /* followed by the start address, the first vector takes care of this. */ 75 /* If we ever place the table elsewhere, put a constant here. */ 76 } > FLASH 77 78 .vectors : 79 { 80 _datacopy = .; 81 } > FLASH 82 83 .data : AT ( _datacopy ) 84 { 85 loadaddress = .; 86 _loadaddress = .; 87 _datastart = .; 88 KEEP(*(.resetvectors)); 89 KEEP(*(.vectors)); 90 . = ALIGN(0x200); 91#ifdef HAVE_INIT_ATTR 92 *(.initdata*) 93#endif 94 *(.data*) 95 . = ALIGN(0x4); 96 _dataend = .; 97 . = ALIGN(0x10); /* Maintain proper alignment for .text section */ 98 } > DRAM 99 100 /DISCARD/ : 101 { 102 *(.eh_frame) 103 } 104 105 /* TRICK ALERT! Newer versions of the linker don't allow output sections 106 to overlap even if one of them is empty, so advance the location pointer 107 "by hand" */ 108 .text LOADADDR(.data) + SIZEOF(.data) : 109 { 110 *(.init.text) 111 KEEP(*(.startup*)); 112#ifdef HAVE_INIT_ATTR 113 /* all this symbols are set to the same address so .init copy loop 114 will be skiped in crt0.S */ 115 _initstart = .; 116 _initend = .; 117 _initcopy = .; 118 *(.init*) 119#endif 120 *(.text*) 121 . = ALIGN(0x4); 122 } > FLASH 123 124 .rodata : 125 { 126 *(.rodata*) 127 *(.rodata.str1.1) 128 *(.rodata.str1.4) 129 . = ALIGN(0x4); 130 _iramcopy = .; 131 } > FLASH 132 133 .iram IRAMORIG : AT ( _iramcopy ) 134 { 135 _iramstart = .; 136 *(.icode) 137 *(.irodata) 138 *(.idata) 139 _iramend = .; 140 } > IRAM 141 142 .ibss (NOLOAD) : 143 { 144 _iedata = .; 145 *(.ibss) 146 . = ALIGN(0x4); 147 _iend = .; 148 } > IRAM 149 150 .stack : 151 { 152 *(.stack) 153 _stackbegin = .; 154 stackbegin = .; 155 . += 0x2000; 156 _stackend = .; 157 stackend = .; 158#if IRAMSIZE > 0x1000 159 } > IRAM 160#else 161 } > DRAM 162#endif 163 164#ifdef CPU_COLDFIRE 165 .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram): 166#else 167 .bss : 168#endif 169 { 170 _edata = .; 171 *(.bss*) 172 *(COMMON) 173 . = ALIGN(0x4); 174 _end = .; 175 } > DRAM 176 177 .audiobuf ALIGN(4): 178 { 179 _audiobuffer = .; 180 audiobuffer = .; 181 } > DRAM 182 183#ifdef CODECSIZE 184 .audiobufend ENDAUDIOADDR: 185#else 186 .audiobufend ENDADDR: 187#endif 188 { 189 _audiobufend = .; 190 audiobufend = .; 191 } > DRAM 192 193#ifdef CODECSIZE 194 .codec ENDAUDIOADDR: 195 { 196 codecbuf = .; 197 _codecbuf = .; 198 } 199#endif 200 201 .plugin ENDADDR: 202 { 203 _pluginbuf = .; 204 pluginbuf = .; 205 } 206}