Subversion Repositories freemyipod

Rev

Go to most recent revision | 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
#include "global.h"
111 theseven 25
#include "syscallapi.h"
99 theseven 26
#include "panic.h"
111 theseven 27
#include "console.h"
28
#include "dir.h"
29
#include "file.h"
30
#include "format.h"
31
#include "lcdconsole.h"
32
#include "storage.h"
33
#include "shutdown.h"
34
#include "thread.h"
35
#include "ucl.h"
36
#include "bootflash.h"
37
#include "timer.h"
38
#include "i2c.h"
39
#include "interrupt.h"
40
#include "lcd.h"
41
#include "mmu.h"
42
#include "nand.h"
43
#include "power.h"
44
#include "execimage.h"
117 theseven 45
#include "backlight.h"
111 theseven 46
#include "libc/include/string.h"
47
#include "libc/include/stdlib.h"
48
#include "libc/include/stdio.h"
99 theseven 49
 
50
 
51
struct embios_syscall_table syscall_table ICONST_ATTR =
52
{
100 theseven 53
    .table_version = EMBIOS_API_VERSION,
54
    .table_minversion = EMBIOS_MIN_API_VERSION,
99 theseven 55
	.panic = panic,
111 theseven 56
    .panicf = panicf,
57
    .cprintf = cprintf,
58
    .cvprintf = cvprintf,
59
    .cputc = cputc,
60
    .cputs = cputs,
61
    .cwrite = cwrite,
62
    .cflush = cflush,
63
    .cgetc = cgetc,
64
    .cread = cread,
65
    .creada = creada,
66
    .format = format,
67
    .vuprintf = vuprintf,
68
    .shutdown = shutdown,
69
    .strcasecmp = strcasecmp,
70
    .strncasecmp = strncasecmp,
71
    .strcasestr = strcasestr,
72
    .strlcat = strlcat,
73
    .strlcpy = strlcpy,
74
    .mutex_init = mutex_init,
75
    .mutex_lock = mutex_lock,
76
    .mutex_unlock = mutex_unlock,
77
    .wakeup_init = wakeup_init,
78
    .wakeup_wait = wakeup_wait,
79
    .wakeup_signal = wakeup_signal,
80
    .sleep = sleep,
81
    .thread_create = thread_create,
82
    .thread_exit = thread_exit,
83
    .thread_suspend = thread_suspend,
84
    .thread_resume = thread_resume,
85
    .thread_terminate = thread_terminate,
86
    .__errno = __errno,
87
    .ucl_decompress = ucl_decompress,
88
    .read_native_timer = read_native_timer,
89
    .read_usec_timer = read_usec_timer,
90
    .i2c_send = i2c_send,
91
    .i2c_recv = i2c_recv,
92
    .i2c_sendbyte = i2c_sendbyte,
93
    .i2c_recvbyte = i2c_recvbyte,
94
    .interrupt_enable = interrupt_enable,
95
    .interrupt_set_handler = interrupt_set_handler,
96
    .int_timer_set_handler = int_timer_set_handler,
97
    .clean_dcache = clean_dcache,
98
    .invalidate_dcache = invalidate_dcache,
99
    .invalidate_icache = invalidate_icache,
100
    .power_off = power_off,
101
    .charging_state = charging_state,
102
    .atoi = atoi,
103
    .memchr = memchr,
104
    .memcmp = memcmp,
105
    .memcpy = memcpy,
106
    .memmove = memmove,
107
    .memset = memset,
108
    .qsort = qsort,
109
    .srand = srand,
110
    .rand = rand,
111
    .snprintf = snprintf,
112
    .vsnprintf = vsnprintf,
113
    .sscanf = sscanf,
114
    .strcat = strcat,
115
    .strchr = strchr,
116
    .strcmp = strcmp,
117
    .strcpy = strcpy,
118
    .strlen = strlen,
119
    .strncmp = strncmp,
120
    .strrchr = strrchr,
121
    .strstr = strstr,
122
    .strtok_r = strtok_r,
123
#ifdef HAVE_STORAGE
124
    .opendir = opendir,
125
    .closedir = closedir,
126
    .readdir = readdir,
127
    .mkdir = mkdir,
128
    .rmdir = rmdir,
129
    .renderbmp = renderbmp,
130
    .renderchar = renderchar,
131
    .execimage = execimage,
132
    .ftruncate = ftruncate,
133
    .fsync = fsync,
134
    .close = close,
135
    .write = write,
136
    .read = read,
137
    .lseek = lseek,
138
    .remove = remove,
139
    .file_open = file_open,
140
    .rename = rename,
141
    .file_creat = file_creat,
142
    .filesize = filesize,
116 theseven 143
    .storage_read_sectors_md = storage_read_sectors_md,
144
    .storage_write_sectors_md = storage_write_sectors_md,
111 theseven 145
#endif
146
#ifdef HAVE_LCD
147
    .lcdconsole_putc_noblit = lcdconsole_putc_noblit,
148
    .lcdconsole_puts_noblit = lcdconsole_puts_noblit,
149
    .lcdconsole_write_noblit = lcdconsole_write_noblit,
150
    .lcdconsole_update = lcdconsole_update,
151
    .lcdconsole_putc = lcdconsole_putc,
152
    .lcdconsole_puts = lcdconsole_puts,
153
    .lcdconsole_write = lcdconsole_write,
154
    .displaylcd = displaylcd,
155
    .displaylcd_sync = displaylcd_sync,
156
    .displaylcd_busy = displaylcd_busy,
157
    .displaylcd_safe = displaylcd_safe,
116 theseven 158
    .lcd_get_width = lcd_get_width,
159
    .lcd_get_height = lcd_get_height,
160
    .lcd_get_bytes_per_pixel = lcd_get_bytes_per_pixel,
111 theseven 161
#endif
117 theseven 162
#ifdef HAVE_BACKLIGHT
163
    .backlight_on = backlight_on,
164
    .backlight_set_fade = backlight_set_fade,
165
    .backlight_set_brightness = backlight_set_brightness,
166
#endif
111 theseven 167
#ifdef HAVE_BOOTFLASH
168
    .bootflash_filesize = bootflash_filesize,
169
    .bootflash_attributes = bootflash_attributes,
170
    .bootflash_getaddr = bootflash_getaddr,
171
    .bootflash_read = bootflash_read,
172
    .bootflash_readraw = bootflash_readraw,
173
    .bootflash_writeraw = bootflash_writeraw,
174
    .bootflash_getrawaddr = bootflash_getrawaddr,
175
#endif
176
#ifdef HAVE_NAND
177
    .nand_read_page = nand_read_page,
178
    .nand_block_erase = nand_block_erase,
179
    .nand_read_page_fast = nand_read_page_fast,
180
    .nand_write_page = nand_write_page,
181
    .nand_write_page_start = nand_write_page_start,
182
    .nand_write_page_collect = nand_write_page_collect,
116 theseven 183
    .nand_get_device_type = nand_get_device_type,
111 theseven 184
#endif
99 theseven 185
};