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
 
184 farthen 28
#include "../libc/include/assert.h"
29
 
111 theseven 30
#include "../global.h"
184 farthen 31
#include "../panic.h"
111 theseven 32
#include "../console.h"
143 theseven 33
#include "../disk.h"
111 theseven 34
#include "../dir.h"
35
#include "../file.h"
479 theseven 36
#include "../fat.h"
111 theseven 37
#include "../format.h"
138 theseven 38
#include "../drawing.h"
111 theseven 39
#include "../lcdconsole.h"
40
#include "../storage.h"
41
#include "../shutdown.h"
42
#include "../thread.h"
43
#include "../ucl.h"
44
#include "../bootflash.h"
45
#include "../timer.h"
46
#include "../i2c.h"
47
#include "../interrupt.h"
48
#include "../lcd.h"
49
#include "../mmu.h"
50
#include "../power.h"
51
#include "../execimage.h"
117 theseven 52
#include "../backlight.h"
118 theseven 53
#include "../syscall.h"
122 theseven 54
#include "../progressbar.h"
130 theseven 55
#include "../button.h"
132 theseven 56
#include "../clickwheel.h"
138 theseven 57
#include "../clockgates.h"
127 theseven 58
#include "../contextswitch.h"
143 theseven 59
#include "../hwkeyaes.h"
60
#include "../hmacsha1.h"
466 theseven 61
#include "../malloc.h"
62
#include "../library.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
 
68
/* increase this every time the api struct changes */
427 farthen 69
#define EMCORE_API_VERSION 1
99 theseven 70
 
71
/* update this to latest version if a change to the api struct breaks
72
   backwards compatibility (and please take the opportunity to sort in any
73
   new function which are "waiting" at the end of the function table) */
453 theseven 74
#define EMCORE_MIN_API_VERSION 1
99 theseven 75
 
76
/* NOTE: To support backwards compatibility, only add new functions at
77
         the end of the structure.  Every time you add a new function,
427 farthen 78
         remember to increase EMCORE_API_VERSION. If you make changes to the
79
         existing APIs, also update EMCORE_MIN_API_VERSION to current version */
99 theseven 80
 
427 farthen 81
struct emcore_syscall_table
99 theseven 82
{
100 theseven 83
    uint32_t table_version;
84
    uint32_t table_minversion;
258 theseven 85
    typeof(panic) *panic;
86
    typeof(panicf) *panicf;
111 theseven 87
    typeof(cprintf) *cprintf;
88
    typeof(cvprintf) *cvprintf;
89
    typeof(cputc) *cputc;
90
    typeof(cputs) *cputs;
91
    typeof(cwrite) *cwrite;
92
    typeof(cflush) *cflush;
93
    typeof(cgetc) *cgetc;
94
    typeof(cread) *cread;
95
    typeof(creada) *creada;
96
    typeof(opendir) *opendir;
97
    typeof(closedir) *closedir;
98
    typeof(readdir) *readdir;
99
    typeof(mkdir) *mkdir;
100
    typeof(rmdir) *rmdir;
101
    typeof(renderbmp) *renderbmp;
102
    typeof(renderchar) *renderchar;
138 theseven 103
    typeof(rendertext) *rendertext;
104
    typeof(renderfillrect) *renderfillrect;
105
    typeof(get_font_width) *get_font_width;
106
    typeof(get_font_height) *get_font_height;
111 theseven 107
    typeof(execimage) *execimage;
108
    typeof(ftruncate) *ftruncate;
109
    typeof(fsync) *fsync;
110
    typeof(close) *close;
111
    typeof(write) *write;
112
    typeof(read) *read;
113
    typeof(lseek) *lseek;
114
    typeof(remove) *remove;
115
    typeof(file_open) *file_open;
116
    typeof(rename) *rename;
117
    typeof(file_creat) *file_creat;
118
    typeof(filesize) *filesize;
119
    typeof(format) *format;
120
    typeof(vuprintf) *vuprintf;
121
    typeof(lcdconsole_putc_noblit) *lcdconsole_putc_noblit;
122
    typeof(lcdconsole_puts_noblit) *lcdconsole_puts_noblit;
123
    typeof(lcdconsole_write_noblit) *lcdconsole_write_noblit;
124
    typeof(lcdconsole_update) *lcdconsole_update;
125
    typeof(lcdconsole_putc) *lcdconsole_putc;
126
    typeof(lcdconsole_puts) *lcdconsole_puts;
127
    typeof(lcdconsole_write) *lcdconsole_write;
122 theseven 128
    typeof(lcdconsole_get_current_x) *lcdconsole_get_current_x;
129
    typeof(lcdconsole_get_current_y) *lcdconsole_get_current_y;
130
    typeof(lcdconsole_get_lineend_x) *lcdconsole_get_lineend_x;
131
    typeof(lcdconsole_get_lineend_y) *lcdconsole_get_lineend_y;
124 theseven 132
    typeof(lcdconsole_progressbar) *lcdconsole_progressbar;
122 theseven 133
    typeof(progressbar_init) *progressbar_init;
134
    typeof(progressbar_setpos) *progressbar_setpos;
111 theseven 135
    typeof(shutdown) *shutdown;
116 theseven 136
    typeof(storage_read_sectors_md) *storage_read_sectors_md;
137
    typeof(storage_write_sectors_md) *storage_write_sectors_md;
158 theseven 138
    typeof(storage_get_info) *storage_get_info;
111 theseven 139
    typeof(strcasecmp) *strcasecmp;
140
    typeof(strncasecmp) *strncasecmp;
141
    typeof(strcasestr) *strcasestr;
142
    typeof(strlcat) *strlcat;
143
    typeof(strlcpy) *strlcpy;
144
    typeof(mutex_init) *mutex_init;
145
    typeof(mutex_lock) *mutex_lock;
146
    typeof(mutex_unlock) *mutex_unlock;
147
    typeof(wakeup_init) *wakeup_init;
148
    typeof(wakeup_wait) *wakeup_wait;
149
    typeof(wakeup_signal) *wakeup_signal;
150
    typeof(sleep) *sleep;
151
    typeof(thread_create) *thread_create;
152
    typeof(thread_exit) *thread_exit;
153
    typeof(thread_suspend) *thread_suspend;
154
    typeof(thread_resume) *thread_resume;
155
    typeof(thread_terminate) *thread_terminate;
156
    typeof(__errno) *__errno;
157
    typeof(ucl_decompress) *ucl_decompress;
158
    typeof(bootflash_filesize) *bootflash_filesize;
159
    typeof(bootflash_attributes) *bootflash_attributes;
160
    typeof(bootflash_getaddr) *bootflash_getaddr;
161
    typeof(bootflash_read) *bootflash_read;
162
    typeof(bootflash_readraw) *bootflash_readraw;
163
    typeof(bootflash_writeraw) *bootflash_writeraw;
164
    typeof(bootflash_getrawaddr) *bootflash_getrawaddr;
138 theseven 165
    typeof(bootflash_is_memmapped) *bootflash_is_memmapped;
111 theseven 166
    typeof(read_native_timer) *read_native_timer;
167
    typeof(read_usec_timer) *read_usec_timer;
168
    typeof(i2c_send) *i2c_send;
169
    typeof(i2c_recv) *i2c_recv;
170
    typeof(i2c_sendbyte) *i2c_sendbyte;
171
    typeof(i2c_recvbyte) *i2c_recvbyte;
172
    typeof(interrupt_enable) *interrupt_enable;
173
    typeof(interrupt_set_handler) *interrupt_set_handler;
174
    typeof(int_timer_set_handler) *int_timer_set_handler;
175
    typeof(displaylcd) *displaylcd;
176
    typeof(displaylcd_sync) *displaylcd_sync;
177
    typeof(displaylcd_busy) *displaylcd_busy;
178
    typeof(displaylcd_safe) *displaylcd_safe;
116 theseven 179
    typeof(lcd_get_width) *lcd_get_width;
180
    typeof(lcd_get_height) *lcd_get_height;
181
    typeof(lcd_get_bytes_per_pixel) *lcd_get_bytes_per_pixel;
122 theseven 182
    typeof(lcd_translate_color) *lcd_translate_color;
111 theseven 183
    typeof(clean_dcache) *clean_dcache;
184
    typeof(invalidate_dcache) *invalidate_dcache;
185
    typeof(invalidate_icache) *invalidate_icache;
186
    typeof(power_off) *power_off;
187
    typeof(charging_state) *charging_state;
188
    typeof(atoi) *atoi;
189
    typeof(memchr) *memchr;
190
    typeof(memcmp) *memcmp;
191
    typeof(memcpy) *memcpy;
192
    typeof(memmove) *memmove;
193
    typeof(memset) *memset;
194
    typeof(qsort) *qsort;
195
    typeof(srand) *srand;
196
    typeof(rand) *rand;
197
    typeof(snprintf) *snprintf;
198
    typeof(vsnprintf) *vsnprintf;
199
    typeof(sscanf) *sscanf;
200
    typeof(strcat) *strcat;
201
    typeof(strchr) *strchr;
202
    typeof(strcmp) *strcmp;
203
    typeof(strcpy) *strcpy;
204
    typeof(strlen) *strlen;
205
    typeof(strncmp) *strncmp;
206
    typeof(strrchr) *strrchr;
207
    typeof(strstr) *strstr;
208
    typeof(strtok_r) *strtok_r;
117 theseven 209
    typeof(backlight_on) *backlight_on;
210
    typeof(backlight_set_fade) *backlight_set_fade;
211
    typeof(backlight_set_brightness) *backlight_set_brightness;
118 theseven 212
    typeof(get_platform_id) *get_platform_id;
125 theseven 213
    typeof(tlsf_create) *tlsf_create;
214
    typeof(tlsf_destroy) *tlsf_destroy;
215
    typeof(tlsf_malloc) *tlsf_malloc;
216
    typeof(tlsf_memalign) *tlsf_memalign;
217
    typeof(tlsf_realloc) *tlsf_realloc;
218
    typeof(tlsf_free) *tlsf_free;
219
    typeof(tlsf_walk_heap) *tlsf_walk_heap;
220
    typeof(tlsf_check_heap) *tlsf_check_heap;
221
    typeof(tlsf_block_size) *tlsf_block_size;
222
    typeof(tlsf_overhead) *tlsf_overhead;
127 theseven 223
    typeof(execfirmware) *execfirmware;
130 theseven 224
    typeof(button_register_handler) *button_register_handler;
225
    typeof(button_unregister_handler) *button_unregister_handler;
132 theseven 226
    typeof(clickwheel_get_state) *clickwheel_get_state;
138 theseven 227
    typeof(clockgate_enable) *clockgate_enable;
143 theseven 228
    typeof(context_switch) *context_switch;
229
    typeof(disk_mount) *disk_mount;
230
    typeof(disk_unmount) *disk_unmount;
231
    typeof(hwkeyaes) *hwkeyaes;
232
    typeof(hmacsha1) *hmacsha1;
233
    typeof(reset) *reset;
258 theseven 234
    typeof(int_dma_set_handler) *int_dma_set_handler;
453 theseven 235
    typeof(thread_set_name) *thread_set_name;
236
    typeof(thread_set_priority) *thread_set_priority;
466 theseven 237
    typeof(malloc) *malloc;
238
    typeof(memalign) *memalign;
239
    typeof(realloc) *realloc;
240
    typeof(reownalloc) *reownalloc;
241
    typeof(free) *free;
242
    typeof(library_unload) *library_unload;
243
    typeof(get_library) *get_library;
244
    typeof(get_library_ext) *get_library_ext;
245
    typeof(release_library) *release_library;
246
    typeof(release_library_ext) *release_library_ext;
479 theseven 247
    typeof(fat_enable_flushing) *fat_enable_flushing;
489 theseven 248
    typeof(lcd_get_format) *lcd_get_format;
99 theseven 249
};
250
 
251
 
252
#endif