Subversion Repositories freemyipod

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
99 theseven 1
//
2
//
3
//    Copyright 2010 TheSeven
4
//
5
//
427 farthen 6
//    This file is part of emCORE.
99 theseven 7
//
427 farthen 8
//    emCORE is free software: you can redistribute it and/or
99 theseven 9
//    modify it under the terms of the GNU General Public License as
10
//    published by the Free Software Foundation, either version 2 of the
11
//    License, or (at your option) any later version.
12
//
427 farthen 13
//    emCORE is distributed in the hope that it will be useful,
99 theseven 14
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
//    See the GNU General Public License for more details.
17
//
18
//    You should have received a copy of the GNU General Public License along
427 farthen 19
//    with emCORE.  If not, see <http://www.gnu.org/licenses/>.
99 theseven 20
//
21
//
22
 
23
 
24
#ifndef __SYSCALLAPI_H__
25
#define __SYSCALLAPI_H__
26
 
27
 
111 theseven 28
#include "../global.h"
184 farthen 29
#include "../panic.h"
111 theseven 30
#include "../console.h"
143 theseven 31
#include "../disk.h"
111 theseven 32
#include "../dir.h"
33
#include "../file.h"
479 theseven 34
#include "../fat.h"
111 theseven 35
#include "../format.h"
138 theseven 36
#include "../drawing.h"
111 theseven 37
#include "../lcdconsole.h"
38
#include "../storage.h"
39
#include "../shutdown.h"
40
#include "../thread.h"
41
#include "../ucl.h"
42
#include "../bootflash.h"
43
#include "../timer.h"
44
#include "../i2c.h"
45
#include "../interrupt.h"
46
#include "../lcd.h"
47
#include "../mmu.h"
48
#include "../power.h"
49
#include "../execimage.h"
117 theseven 50
#include "../backlight.h"
118 theseven 51
#include "../syscall.h"
122 theseven 52
#include "../progressbar.h"
130 theseven 53
#include "../button.h"
132 theseven 54
#include "../clickwheel.h"
138 theseven 55
#include "../clockgates.h"
127 theseven 56
#include "../contextswitch.h"
143 theseven 57
#include "../hwkeyaes.h"
58
#include "../hmacsha1.h"
466 theseven 59
#include "../malloc.h"
60
#include "../library.h"
491 theseven 61
#include "../crc32.h"
62
#include "../libc/include/assert.h"
111 theseven 63
#include "../libc/include/string.h"
64
#include "../libc/include/stdlib.h"
65
#include "../libc/include/stdio.h"
125 theseven 66
#include "../libc/tlsf/tlsf.h"
99 theseven 67
 
491 theseven 68
#ifdef ARM_ARCH
69
#include "../arm/arm-support.h"
70
#endif
71
 
99 theseven 72
/* increase this every time the api struct changes */
427 farthen 73
#define EMCORE_API_VERSION 1
99 theseven 74
 
75
/* update this to latest version if a change to the api struct breaks
76
   backwards compatibility (and please take the opportunity to sort in any
77
   new function which are "waiting" at the end of the function table) */
453 theseven 78
#define EMCORE_MIN_API_VERSION 1
99 theseven 79
 
80
/* NOTE: To support backwards compatibility, only add new functions at
81
         the end of the structure.  Every time you add a new function,
427 farthen 82
         remember to increase EMCORE_API_VERSION. If you make changes to the
83
         existing APIs, also update EMCORE_MIN_API_VERSION to current version */
99 theseven 84
 
427 farthen 85
struct emcore_syscall_table
99 theseven 86
{
100 theseven 87
    uint32_t table_version;
88
    uint32_t table_minversion;
491 theseven 89
#ifdef ARM_ARCH
90
    /* DON'T MOVE THESE! If you absolutely need to, adjust export/armhelpers.c */
91
	typeof(__clzsi2) *__clzsi2;
92
	typeof(__aeabi_idivmod) *__aeabi_idivmod;
93
	typeof(__aeabi_uidivmod) *__aeabi_uidivmod;
94
#endif
258 theseven 95
    typeof(panic) *panic;
96
    typeof(panicf) *panicf;
111 theseven 97
    typeof(cprintf) *cprintf;
98
    typeof(cvprintf) *cvprintf;
99
    typeof(cputc) *cputc;
100
    typeof(cputs) *cputs;
101
    typeof(cwrite) *cwrite;
102
    typeof(cflush) *cflush;
103
    typeof(cgetc) *cgetc;
104
    typeof(cread) *cread;
105
    typeof(creada) *creada;
106
    typeof(opendir) *opendir;
107
    typeof(closedir) *closedir;
108
    typeof(readdir) *readdir;
109
    typeof(mkdir) *mkdir;
110
    typeof(rmdir) *rmdir;
111
    typeof(renderbmp) *renderbmp;
112
    typeof(renderchar) *renderchar;
138 theseven 113
    typeof(rendertext) *rendertext;
114
    typeof(renderfillrect) *renderfillrect;
115
    typeof(get_font_width) *get_font_width;
116
    typeof(get_font_height) *get_font_height;
111 theseven 117
    typeof(execimage) *execimage;
118
    typeof(ftruncate) *ftruncate;
119
    typeof(fsync) *fsync;
120
    typeof(close) *close;
121
    typeof(write) *write;
122
    typeof(read) *read;
123
    typeof(lseek) *lseek;
124
    typeof(remove) *remove;
125
    typeof(file_open) *file_open;
126
    typeof(rename) *rename;
127
    typeof(file_creat) *file_creat;
128
    typeof(filesize) *filesize;
129
    typeof(format) *format;
130
    typeof(vuprintf) *vuprintf;
131
    typeof(lcdconsole_putc_noblit) *lcdconsole_putc_noblit;
132
    typeof(lcdconsole_puts_noblit) *lcdconsole_puts_noblit;
133
    typeof(lcdconsole_write_noblit) *lcdconsole_write_noblit;
134
    typeof(lcdconsole_update) *lcdconsole_update;
135
    typeof(lcdconsole_putc) *lcdconsole_putc;
136
    typeof(lcdconsole_puts) *lcdconsole_puts;
137
    typeof(lcdconsole_write) *lcdconsole_write;
122 theseven 138
    typeof(lcdconsole_get_current_x) *lcdconsole_get_current_x;
139
    typeof(lcdconsole_get_current_y) *lcdconsole_get_current_y;
140
    typeof(lcdconsole_get_lineend_x) *lcdconsole_get_lineend_x;
141
    typeof(lcdconsole_get_lineend_y) *lcdconsole_get_lineend_y;
124 theseven 142
    typeof(lcdconsole_progressbar) *lcdconsole_progressbar;
122 theseven 143
    typeof(progressbar_init) *progressbar_init;
144
    typeof(progressbar_setpos) *progressbar_setpos;
111 theseven 145
    typeof(shutdown) *shutdown;
116 theseven 146
    typeof(storage_read_sectors_md) *storage_read_sectors_md;
147
    typeof(storage_write_sectors_md) *storage_write_sectors_md;
158 theseven 148
    typeof(storage_get_info) *storage_get_info;
111 theseven 149
    typeof(strcasecmp) *strcasecmp;
150
    typeof(strncasecmp) *strncasecmp;
151
    typeof(strcasestr) *strcasestr;
152
    typeof(strlcat) *strlcat;
153
    typeof(strlcpy) *strlcpy;
154
    typeof(mutex_init) *mutex_init;
155
    typeof(mutex_lock) *mutex_lock;
156
    typeof(mutex_unlock) *mutex_unlock;
157
    typeof(wakeup_init) *wakeup_init;
158
    typeof(wakeup_wait) *wakeup_wait;
159
    typeof(wakeup_signal) *wakeup_signal;
160
    typeof(sleep) *sleep;
161
    typeof(thread_create) *thread_create;
162
    typeof(thread_exit) *thread_exit;
163
    typeof(thread_suspend) *thread_suspend;
164
    typeof(thread_resume) *thread_resume;
165
    typeof(thread_terminate) *thread_terminate;
166
    typeof(__errno) *__errno;
167
    typeof(ucl_decompress) *ucl_decompress;
168
    typeof(bootflash_filesize) *bootflash_filesize;
169
    typeof(bootflash_attributes) *bootflash_attributes;
170
    typeof(bootflash_getaddr) *bootflash_getaddr;
171
    typeof(bootflash_read) *bootflash_read;
172
    typeof(bootflash_readraw) *bootflash_readraw;
173
    typeof(bootflash_writeraw) *bootflash_writeraw;
174
    typeof(bootflash_getrawaddr) *bootflash_getrawaddr;
138 theseven 175
    typeof(bootflash_is_memmapped) *bootflash_is_memmapped;
111 theseven 176
    typeof(read_native_timer) *read_native_timer;
177
    typeof(read_usec_timer) *read_usec_timer;
178
    typeof(i2c_send) *i2c_send;
179
    typeof(i2c_recv) *i2c_recv;
180
    typeof(i2c_sendbyte) *i2c_sendbyte;
181
    typeof(i2c_recvbyte) *i2c_recvbyte;
182
    typeof(interrupt_enable) *interrupt_enable;
183
    typeof(interrupt_set_handler) *interrupt_set_handler;
184
    typeof(int_timer_set_handler) *int_timer_set_handler;
185
    typeof(displaylcd) *displaylcd;
492 theseven 186
    typeof(filllcd) *filllcd;
187
    typeof(displaylcd_native) *displaylcd_native;
188
    typeof(filllcd_native) *filllcd_native;
111 theseven 189
    typeof(displaylcd_sync) *displaylcd_sync;
190
    typeof(displaylcd_busy) *displaylcd_busy;
191
    typeof(displaylcd_safe) *displaylcd_safe;
116 theseven 192
    typeof(lcd_get_width) *lcd_get_width;
193
    typeof(lcd_get_height) *lcd_get_height;
194
    typeof(lcd_get_bytes_per_pixel) *lcd_get_bytes_per_pixel;
122 theseven 195
    typeof(lcd_translate_color) *lcd_translate_color;
111 theseven 196
    typeof(clean_dcache) *clean_dcache;
197
    typeof(invalidate_dcache) *invalidate_dcache;
198
    typeof(invalidate_icache) *invalidate_icache;
199
    typeof(power_off) *power_off;
200
    typeof(charging_state) *charging_state;
201
    typeof(atoi) *atoi;
202
    typeof(memchr) *memchr;
203
    typeof(memcmp) *memcmp;
204
    typeof(memcpy) *memcpy;
205
    typeof(memmove) *memmove;
206
    typeof(memset) *memset;
207
    typeof(qsort) *qsort;
208
    typeof(srand) *srand;
209
    typeof(rand) *rand;
210
    typeof(snprintf) *snprintf;
211
    typeof(vsnprintf) *vsnprintf;
212
    typeof(sscanf) *sscanf;
213
    typeof(strcat) *strcat;
214
    typeof(strchr) *strchr;
215
    typeof(strcmp) *strcmp;
216
    typeof(strcpy) *strcpy;
217
    typeof(strlen) *strlen;
218
    typeof(strncmp) *strncmp;
219
    typeof(strrchr) *strrchr;
220
    typeof(strstr) *strstr;
221
    typeof(strtok_r) *strtok_r;
117 theseven 222
    typeof(backlight_on) *backlight_on;
223
    typeof(backlight_set_fade) *backlight_set_fade;
224
    typeof(backlight_set_brightness) *backlight_set_brightness;
118 theseven 225
    typeof(get_platform_id) *get_platform_id;
125 theseven 226
    typeof(tlsf_create) *tlsf_create;
227
    typeof(tlsf_destroy) *tlsf_destroy;
228
    typeof(tlsf_malloc) *tlsf_malloc;
229
    typeof(tlsf_memalign) *tlsf_memalign;
230
    typeof(tlsf_realloc) *tlsf_realloc;
231
    typeof(tlsf_free) *tlsf_free;
232
    typeof(tlsf_walk_heap) *tlsf_walk_heap;
233
    typeof(tlsf_check_heap) *tlsf_check_heap;
234
    typeof(tlsf_block_size) *tlsf_block_size;
235
    typeof(tlsf_overhead) *tlsf_overhead;
127 theseven 236
    typeof(execfirmware) *execfirmware;
130 theseven 237
    typeof(button_register_handler) *button_register_handler;
238
    typeof(button_unregister_handler) *button_unregister_handler;
132 theseven 239
    typeof(clickwheel_get_state) *clickwheel_get_state;
138 theseven 240
    typeof(clockgate_enable) *clockgate_enable;
143 theseven 241
    typeof(context_switch) *context_switch;
242
    typeof(disk_mount) *disk_mount;
243
    typeof(disk_unmount) *disk_unmount;
244
    typeof(hwkeyaes) *hwkeyaes;
245
    typeof(hmacsha1) *hmacsha1;
246
    typeof(reset) *reset;
258 theseven 247
    typeof(int_dma_set_handler) *int_dma_set_handler;
453 theseven 248
    typeof(thread_set_name) *thread_set_name;
249
    typeof(thread_set_priority) *thread_set_priority;
466 theseven 250
    typeof(malloc) *malloc;
251
    typeof(memalign) *memalign;
252
    typeof(realloc) *realloc;
253
    typeof(reownalloc) *reownalloc;
254
    typeof(free) *free;
255
    typeof(library_unload) *library_unload;
256
    typeof(get_library) *get_library;
257
    typeof(get_library_ext) *get_library_ext;
258
    typeof(release_library) *release_library;
259
    typeof(release_library_ext) *release_library_ext;
479 theseven 260
    typeof(fat_enable_flushing) *fat_enable_flushing;
489 theseven 261
    typeof(lcd_get_format) *lcd_get_format;
491 theseven 262
    typeof(crc32) *crc32;
99 theseven 263
};
264
 
265
 
266
#endif