Philips GoGear SA9200 port. Working bootloader and normal builds, including sound...
[Rockbox.git] / apps / codecs / codec_crt0.c
blob1c61d84b477a158de56e80043434901491b77b59
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 Tomasz Malesinski
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #include "config.h"
21 #include "codeclib.h"
23 struct codec_api *ci;
25 extern unsigned char iramcopy[];
26 extern unsigned char iramstart[];
27 extern unsigned char iramend[];
28 extern unsigned char iedata[];
29 extern unsigned char iend[];
30 extern unsigned char plugin_bss_start[];
31 extern unsigned char plugin_end_addr[];
33 extern enum codec_status codec_main(void);
35 CACHE_FUNCTION_WRAPPERS(ci);
37 enum codec_status codec_start(struct codec_api *api)
39 #ifndef SIMULATOR
40 #ifdef USE_IRAM
41 api->memcpy(iramstart, iramcopy, iramend - iramstart);
42 api->memset(iedata, 0, iend - iedata);
43 #endif
44 api->memset(plugin_bss_start, 0, plugin_end_addr - plugin_bss_start);
45 #endif
46 ci = api;
47 #if NUM_CORES > 1
48 /* writeback cleared iedata and bss areas */
49 flush_icache();
50 #endif
51 return codec_main();