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