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
//
6
//    This file is part of emBIOS.
7
//
8
//    emBIOS 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
//    emBIOS 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 emBIOS.  If not, see <http://www.gnu.org/licenses/>.
20
//
21
//
22
 
23
 
24
#ifndef __SYSCALLAPI_H__
25
#define __SYSCALLAPI_H__
26
 
27
 
111 theseven 28
#include "../global.h"
29
#include "../panic.h"  
30
#include "../console.h"
31
#include "../dir.h"
32
#include "../file.h"
33
#include "../format.h"
34
#include "../lcdconsole.h"
35
#include "../storage.h"
36
#include "../shutdown.h"
37
#include "../thread.h"
38
#include "../ucl.h"
39
#include "../bootflash.h"
40
#include "../timer.h"
41
#include "../i2c.h"
42
#include "../interrupt.h"
43
#include "../lcd.h"
44
#include "../mmu.h"
45
#include "../nand.h"
46
#include "../power.h"
47
#include "../execimage.h"
48
#include "../libc/include/string.h"
49
#include "../libc/include/stdlib.h"
50
#include "../libc/include/stdio.h"
99 theseven 51
 
52
/* increase this every time the api struct changes */
53
#define EMBIOS_API_VERSION 0
54
 
55
/* update this to latest version if a change to the api struct breaks
56
   backwards compatibility (and please take the opportunity to sort in any
57
   new function which are "waiting" at the end of the function table) */
58
#define EMBIOS_MIN_API_VERSION 0
59
 
60
/* NOTE: To support backwards compatibility, only add new functions at
61
         the end of the structure.  Every time you add a new function,
62
         remember to increase EMBIOS_API_VERSION. If you make changes to the
63
         existing APIs, also update EMBIOS_MIN_API_VERSION to current version */
64
 
65
struct embios_syscall_table
66
{
100 theseven 67
    uint32_t table_version;
68
    uint32_t table_minversion;
111 theseven 69
	typeof(panic) *panic;
70
	typeof(panicf) *panicf;
71
    typeof(cprintf) *cprintf;
72
    typeof(cvprintf) *cvprintf;
73
    typeof(cputc) *cputc;
74
    typeof(cputs) *cputs;
75
    typeof(cwrite) *cwrite;
76
    typeof(cflush) *cflush;
77
    typeof(cgetc) *cgetc;
78
    typeof(cread) *cread;
79
    typeof(creada) *creada;
80
    typeof(opendir) *opendir;
81
    typeof(closedir) *closedir;
82
    typeof(readdir) *readdir;
83
    typeof(mkdir) *mkdir;
84
    typeof(rmdir) *rmdir;
85
    typeof(renderbmp) *renderbmp;
86
    typeof(renderchar) *renderchar;
87
    typeof(execimage) *execimage;
88
    typeof(ftruncate) *ftruncate;
89
    typeof(fsync) *fsync;
90
    typeof(close) *close;
91
    typeof(write) *write;
92
    typeof(read) *read;
93
    typeof(lseek) *lseek;
94
    typeof(remove) *remove;
95
    typeof(file_open) *file_open;
96
    typeof(rename) *rename;
97
    typeof(file_creat) *file_creat;
98
    typeof(filesize) *filesize;
99
    typeof(format) *format;
100
    typeof(vuprintf) *vuprintf;
101
    typeof(lcdconsole_putc_noblit) *lcdconsole_putc_noblit;
102
    typeof(lcdconsole_puts_noblit) *lcdconsole_puts_noblit;
103
    typeof(lcdconsole_write_noblit) *lcdconsole_write_noblit;
104
    typeof(lcdconsole_update) *lcdconsole_update;
105
    typeof(lcdconsole_putc) *lcdconsole_putc;
106
    typeof(lcdconsole_puts) *lcdconsole_puts;
107
    typeof(lcdconsole_write) *lcdconsole_write;
108
    typeof(shutdown) *shutdown;
116 theseven 109
    typeof(storage_read_sectors_md) *storage_read_sectors_md;
110
    typeof(storage_write_sectors_md) *storage_write_sectors_md;
111 theseven 111
    typeof(strcasecmp) *strcasecmp;
112
    typeof(strncasecmp) *strncasecmp;
113
    typeof(strcasestr) *strcasestr;
114
    typeof(strlcat) *strlcat;
115
    typeof(strlcpy) *strlcpy;
116
    typeof(mutex_init) *mutex_init;
117
    typeof(mutex_lock) *mutex_lock;
118
    typeof(mutex_unlock) *mutex_unlock;
119
    typeof(wakeup_init) *wakeup_init;
120
    typeof(wakeup_wait) *wakeup_wait;
121
    typeof(wakeup_signal) *wakeup_signal;
122
    typeof(sleep) *sleep;
123
    typeof(thread_create) *thread_create;
124
    typeof(thread_exit) *thread_exit;
125
    typeof(thread_suspend) *thread_suspend;
126
    typeof(thread_resume) *thread_resume;
127
    typeof(thread_terminate) *thread_terminate;
128
    typeof(__errno) *__errno;
129
    typeof(ucl_decompress) *ucl_decompress;
130
    typeof(bootflash_filesize) *bootflash_filesize;
131
    typeof(bootflash_attributes) *bootflash_attributes;
132
    typeof(bootflash_getaddr) *bootflash_getaddr;
133
    typeof(bootflash_read) *bootflash_read;
134
    typeof(bootflash_readraw) *bootflash_readraw;
135
    typeof(bootflash_writeraw) *bootflash_writeraw;
136
    typeof(bootflash_getrawaddr) *bootflash_getrawaddr;
137
    typeof(read_native_timer) *read_native_timer;
138
    typeof(read_usec_timer) *read_usec_timer;
139
    typeof(i2c_send) *i2c_send;
140
    typeof(i2c_recv) *i2c_recv;
141
    typeof(i2c_sendbyte) *i2c_sendbyte;
142
    typeof(i2c_recvbyte) *i2c_recvbyte;
143
    typeof(interrupt_enable) *interrupt_enable;
144
    typeof(interrupt_set_handler) *interrupt_set_handler;
145
    typeof(int_timer_set_handler) *int_timer_set_handler;
146
    typeof(displaylcd) *displaylcd;
147
    typeof(displaylcd_sync) *displaylcd_sync;
148
    typeof(displaylcd_busy) *displaylcd_busy;
149
    typeof(displaylcd_safe) *displaylcd_safe;
116 theseven 150
    typeof(lcd_get_width) *lcd_get_width;
151
    typeof(lcd_get_height) *lcd_get_height;
152
    typeof(lcd_get_bytes_per_pixel) *lcd_get_bytes_per_pixel;
111 theseven 153
    typeof(clean_dcache) *clean_dcache;
154
    typeof(invalidate_dcache) *invalidate_dcache;
155
    typeof(invalidate_icache) *invalidate_icache;
156
    typeof(nand_read_page) *nand_read_page;
157
    typeof(nand_block_erase) *nand_block_erase;
158
    typeof(nand_read_page_fast) *nand_read_page_fast;
159
    typeof(nand_write_page) *nand_write_page;
160
    typeof(nand_write_page_start) *nand_write_page_start;
161
    typeof(nand_write_page_collect) *nand_write_page_collect;
162
    typeof(nand_get_device_type) *nand_get_device_type;
163
    typeof(power_off) *power_off;
164
    typeof(charging_state) *charging_state;
165
    typeof(atoi) *atoi;
166
    typeof(memchr) *memchr;
167
    typeof(memcmp) *memcmp;
168
    typeof(memcpy) *memcpy;
169
    typeof(memmove) *memmove;
170
    typeof(memset) *memset;
171
    typeof(qsort) *qsort;
172
    typeof(srand) *srand;
173
    typeof(rand) *rand;
174
    typeof(snprintf) *snprintf;
175
    typeof(vsnprintf) *vsnprintf;
176
    typeof(sscanf) *sscanf;
177
    typeof(strcat) *strcat;
178
    typeof(strchr) *strchr;
179
    typeof(strcmp) *strcmp;
180
    typeof(strcpy) *strcpy;
181
    typeof(strlen) *strlen;
182
    typeof(strncmp) *strncmp;
183
    typeof(strrchr) *strrchr;
184
    typeof(strstr) *strstr;
185
    typeof(strtok_r) *strtok_r;
99 theseven 186
};
187
 
188
 
189
#endif