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