summaryrefslogtreecommitdiff
path: root/apps/codecs/codec_crt0.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/codec_crt0.c')
-rw-r--r--apps/codecs/codec_crt0.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/apps/codecs/codec_crt0.c b/apps/codecs/codec_crt0.c
new file mode 100644
index 0000000000..96dc862fb5
--- /dev/null
+++ b/apps/codecs/codec_crt0.c
@@ -0,0 +1,46 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Tomasz Malesinski
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "config.h"
21#include "codeclib.h"
22
23struct codec_api *ci;
24
25extern unsigned char iramcopy[];
26extern unsigned char iramstart[];
27extern unsigned char iramend[];
28extern unsigned char iedata[];
29extern unsigned char iend[];
30extern unsigned char plugin_bss_start[];
31extern unsigned char plugin_end_addr[];
32
33extern enum codec_status codec_main(void);
34
35enum codec_status codec_start(struct codec_api *api)
36{
37#ifndef SIMULATOR
38#ifdef USE_IRAM
39 api->memcpy(iramstart, iramcopy, iramend - iramstart);
40 api->memset(iedata, 0, iend - iedata);
41#endif
42 api->memset(plugin_bss_start, 0, plugin_end_addr - plugin_bss_start);
43#endif
44 ci = api;
45 return codec_main();
46}