Subversion Repositories freemyipod

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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