| 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;
|
| 497 |
theseven |
111 |
typeof(renderchar_native) *renderchar_native;
|
| 111 |
theseven |
112 |
typeof(renderchar) *renderchar;
|
| 138 |
theseven |
113 |
typeof(rendertext) *rendertext;
|
|
|
114 |
typeof(get_font_width) *get_font_width;
|
|
|
115 |
typeof(get_font_height) *get_font_height;
|
| 111 |
theseven |
116 |
typeof(execimage) *execimage;
|
|
|
117 |
typeof(ftruncate) *ftruncate;
|
|
|
118 |
typeof(fsync) *fsync;
|
|
|
119 |
typeof(close) *close;
|
|
|
120 |
typeof(write) *write;
|
|
|
121 |
typeof(read) *read;
|
|
|
122 |
typeof(lseek) *lseek;
|
|
|
123 |
typeof(remove) *remove;
|
|
|
124 |
typeof(file_open) *file_open;
|
|
|
125 |
typeof(rename) *rename;
|
|
|
126 |
typeof(file_creat) *file_creat;
|
|
|
127 |
typeof(filesize) *filesize;
|
|
|
128 |
typeof(format) *format;
|
|
|
129 |
typeof(vuprintf) *vuprintf;
|
|
|
130 |
typeof(lcdconsole_putc_noblit) *lcdconsole_putc_noblit;
|
|
|
131 |
typeof(lcdconsole_puts_noblit) *lcdconsole_puts_noblit;
|
|
|
132 |
typeof(lcdconsole_write_noblit) *lcdconsole_write_noblit;
|
|
|
133 |
typeof(lcdconsole_update) *lcdconsole_update;
|
|
|
134 |
typeof(lcdconsole_putc) *lcdconsole_putc;
|
|
|
135 |
typeof(lcdconsole_puts) *lcdconsole_puts;
|
|
|
136 |
typeof(lcdconsole_write) *lcdconsole_write;
|
| 122 |
theseven |
137 |
typeof(lcdconsole_get_current_x) *lcdconsole_get_current_x;
|
|
|
138 |
typeof(lcdconsole_get_current_y) *lcdconsole_get_current_y;
|
|
|
139 |
typeof(lcdconsole_get_lineend_x) *lcdconsole_get_lineend_x;
|
|
|
140 |
typeof(lcdconsole_get_lineend_y) *lcdconsole_get_lineend_y;
|
| 124 |
theseven |
141 |
typeof(lcdconsole_progressbar) *lcdconsole_progressbar;
|
| 122 |
theseven |
142 |
typeof(progressbar_init) *progressbar_init;
|
|
|
143 |
typeof(progressbar_setpos) *progressbar_setpos;
|
| 111 |
theseven |
144 |
typeof(shutdown) *shutdown;
|
| 116 |
theseven |
145 |
typeof(storage_read_sectors_md) *storage_read_sectors_md;
|
|
|
146 |
typeof(storage_write_sectors_md) *storage_write_sectors_md;
|
| 158 |
theseven |
147 |
typeof(storage_get_info) *storage_get_info;
|
| 111 |
theseven |
148 |
typeof(strcasecmp) *strcasecmp;
|
|
|
149 |
typeof(strncasecmp) *strncasecmp;
|
|
|
150 |
typeof(strcasestr) *strcasestr;
|
|
|
151 |
typeof(strlcat) *strlcat;
|
|
|
152 |
typeof(strlcpy) *strlcpy;
|
|
|
153 |
typeof(mutex_init) *mutex_init;
|
|
|
154 |
typeof(mutex_lock) *mutex_lock;
|
|
|
155 |
typeof(mutex_unlock) *mutex_unlock;
|
|
|
156 |
typeof(wakeup_init) *wakeup_init;
|
|
|
157 |
typeof(wakeup_wait) *wakeup_wait;
|
|
|
158 |
typeof(wakeup_signal) *wakeup_signal;
|
|
|
159 |
typeof(sleep) *sleep;
|
|
|
160 |
typeof(thread_create) *thread_create;
|
|
|
161 |
typeof(thread_exit) *thread_exit;
|
|
|
162 |
typeof(thread_suspend) *thread_suspend;
|
|
|
163 |
typeof(thread_resume) *thread_resume;
|
|
|
164 |
typeof(thread_terminate) *thread_terminate;
|
|
|
165 |
typeof(__errno) *__errno;
|
|
|
166 |
typeof(ucl_decompress) *ucl_decompress;
|
|
|
167 |
typeof(bootflash_filesize) *bootflash_filesize;
|
|
|
168 |
typeof(bootflash_attributes) *bootflash_attributes;
|
|
|
169 |
typeof(bootflash_getaddr) *bootflash_getaddr;
|
|
|
170 |
typeof(bootflash_read) *bootflash_read;
|
|
|
171 |
typeof(bootflash_readraw) *bootflash_readraw;
|
|
|
172 |
typeof(bootflash_writeraw) *bootflash_writeraw;
|
|
|
173 |
typeof(bootflash_getrawaddr) *bootflash_getrawaddr;
|
| 138 |
theseven |
174 |
typeof(bootflash_is_memmapped) *bootflash_is_memmapped;
|
| 111 |
theseven |
175 |
typeof(read_native_timer) *read_native_timer;
|
|
|
176 |
typeof(read_usec_timer) *read_usec_timer;
|
|
|
177 |
typeof(i2c_send) *i2c_send;
|
|
|
178 |
typeof(i2c_recv) *i2c_recv;
|
|
|
179 |
typeof(i2c_sendbyte) *i2c_sendbyte;
|
|
|
180 |
typeof(i2c_recvbyte) *i2c_recvbyte;
|
|
|
181 |
typeof(interrupt_enable) *interrupt_enable;
|
|
|
182 |
typeof(interrupt_set_handler) *interrupt_set_handler;
|
|
|
183 |
typeof(int_timer_set_handler) *int_timer_set_handler;
|
|
|
184 |
typeof(displaylcd) *displaylcd;
|
| 492 |
theseven |
185 |
typeof(filllcd) *filllcd;
|
|
|
186 |
typeof(displaylcd_native) *displaylcd_native;
|
|
|
187 |
typeof(filllcd_native) *filllcd_native;
|
| 111 |
theseven |
188 |
typeof(displaylcd_sync) *displaylcd_sync;
|
|
|
189 |
typeof(displaylcd_busy) *displaylcd_busy;
|
|
|
190 |
typeof(displaylcd_safe) *displaylcd_safe;
|
| 116 |
theseven |
191 |
typeof(lcd_get_width) *lcd_get_width;
|
|
|
192 |
typeof(lcd_get_height) *lcd_get_height;
|
|
|
193 |
typeof(lcd_get_bytes_per_pixel) *lcd_get_bytes_per_pixel;
|
| 122 |
theseven |
194 |
typeof(lcd_translate_color) *lcd_translate_color;
|
| 111 |
theseven |
195 |
typeof(clean_dcache) *clean_dcache;
|
|
|
196 |
typeof(invalidate_dcache) *invalidate_dcache;
|
|
|
197 |
typeof(invalidate_icache) *invalidate_icache;
|
|
|
198 |
typeof(power_off) *power_off;
|
|
|
199 |
typeof(charging_state) *charging_state;
|
|
|
200 |
typeof(atoi) *atoi;
|
|
|
201 |
typeof(memchr) *memchr;
|
|
|
202 |
typeof(memcmp) *memcmp;
|
|
|
203 |
typeof(memcpy) *memcpy;
|
|
|
204 |
typeof(memmove) *memmove;
|
|
|
205 |
typeof(memset) *memset;
|
|
|
206 |
typeof(qsort) *qsort;
|
|
|
207 |
typeof(srand) *srand;
|
|
|
208 |
typeof(rand) *rand;
|
|
|
209 |
typeof(snprintf) *snprintf;
|
|
|
210 |
typeof(vsnprintf) *vsnprintf;
|
|
|
211 |
typeof(sscanf) *sscanf;
|
|
|
212 |
typeof(strcat) *strcat;
|
|
|
213 |
typeof(strchr) *strchr;
|
|
|
214 |
typeof(strcmp) *strcmp;
|
|
|
215 |
typeof(strcpy) *strcpy;
|
|
|
216 |
typeof(strlen) *strlen;
|
|
|
217 |
typeof(strncmp) *strncmp;
|
|
|
218 |
typeof(strrchr) *strrchr;
|
|
|
219 |
typeof(strstr) *strstr;
|
|
|
220 |
typeof(strtok_r) *strtok_r;
|
| 117 |
theseven |
221 |
typeof(backlight_on) *backlight_on;
|
|
|
222 |
typeof(backlight_set_fade) *backlight_set_fade;
|
|
|
223 |
typeof(backlight_set_brightness) *backlight_set_brightness;
|
| 118 |
theseven |
224 |
typeof(get_platform_id) *get_platform_id;
|
| 125 |
theseven |
225 |
typeof(tlsf_create) *tlsf_create;
|
|
|
226 |
typeof(tlsf_destroy) *tlsf_destroy;
|
|
|
227 |
typeof(tlsf_malloc) *tlsf_malloc;
|
|
|
228 |
typeof(tlsf_memalign) *tlsf_memalign;
|
|
|
229 |
typeof(tlsf_realloc) *tlsf_realloc;
|
|
|
230 |
typeof(tlsf_free) *tlsf_free;
|
|
|
231 |
typeof(tlsf_walk_heap) *tlsf_walk_heap;
|
|
|
232 |
typeof(tlsf_check_heap) *tlsf_check_heap;
|
|
|
233 |
typeof(tlsf_block_size) *tlsf_block_size;
|
|
|
234 |
typeof(tlsf_overhead) *tlsf_overhead;
|
| 127 |
theseven |
235 |
typeof(execfirmware) *execfirmware;
|
| 130 |
theseven |
236 |
typeof(button_register_handler) *button_register_handler;
|
|
|
237 |
typeof(button_unregister_handler) *button_unregister_handler;
|
| 132 |
theseven |
238 |
typeof(clickwheel_get_state) *clickwheel_get_state;
|
| 138 |
theseven |
239 |
typeof(clockgate_enable) *clockgate_enable;
|
| 143 |
theseven |
240 |
typeof(context_switch) *context_switch;
|
|
|
241 |
typeof(disk_mount) *disk_mount;
|
|
|
242 |
typeof(disk_unmount) *disk_unmount;
|
|
|
243 |
typeof(hwkeyaes) *hwkeyaes;
|
|
|
244 |
typeof(hmacsha1) *hmacsha1;
|
|
|
245 |
typeof(reset) *reset;
|
| 258 |
theseven |
246 |
typeof(int_dma_set_handler) *int_dma_set_handler;
|
| 453 |
theseven |
247 |
typeof(thread_set_name) *thread_set_name;
|
|
|
248 |
typeof(thread_set_priority) *thread_set_priority;
|
| 466 |
theseven |
249 |
typeof(malloc) *malloc;
|
|
|
250 |
typeof(memalign) *memalign;
|
|
|
251 |
typeof(realloc) *realloc;
|
|
|
252 |
typeof(reownalloc) *reownalloc;
|
|
|
253 |
typeof(free) *free;
|
|
|
254 |
typeof(library_unload) *library_unload;
|
|
|
255 |
typeof(get_library) *get_library;
|
|
|
256 |
typeof(get_library_ext) *get_library_ext;
|
|
|
257 |
typeof(release_library) *release_library;
|
|
|
258 |
typeof(release_library_ext) *release_library_ext;
|
| 479 |
theseven |
259 |
typeof(fat_enable_flushing) *fat_enable_flushing;
|
| 489 |
theseven |
260 |
typeof(lcd_get_format) *lcd_get_format;
|
| 491 |
theseven |
261 |
typeof(crc32) *crc32;
|
| 99 |
theseven |
262 |
};
|
|
|
263 |
|
|
|
264 |
|
|
|
265 |
#endif
|