freemyipod r623 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r622‎ | r623 | r624 >
Date:01:48, 17 February 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: Expose a dozen more syscalls
Modified paths:
  • /emcore/trunk/export/syscallapi.h (modified) (history)
  • /emcore/trunk/export/syscallwrappers.h (modified) (history)
  • /emcore/trunk/syscallapi.c (modified) (history)

Diff [purge]

Index: emcore/trunk/export/syscallwrappers.h
@@ -1,209 +1,225 @@
2 -//
3 -//
4 -// Copyright 2010 TheSeven
5 -//
6 -//
7 -// This file is part of emCORE.
8 -//
9 -// emCORE is free software: you can redistribute it and/or
10 -// modify it under the terms of the GNU General Public License as
11 -// published by the Free Software Foundation, either version 2 of the
12 -// License, or (at your option) any later version.
13 -//
14 -// emCORE is distributed in the hope that it will be useful,
15 -// but WITHOUT ANY WARRANTY; without even the implied warranty of
16 -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 -// See the GNU General Public License for more details.
18 -//
19 -// You should have received a copy of the GNU General Public License along
20 -// with emCORE. If not, see <http://www.gnu.org/licenses/>.
21 -//
22 -//
23 -
24 -
25 -#ifndef __SYSCALLWRAPPERS_H__
26 -#define __SYSCALLWRAPPERS_H__
27 -
28 -
29 -#define IN_APPLICATION_CODE
30 -#include "syscallapi.h"
31 -
32 -
33 -extern struct emcore_syscall_table* __emcore_syscall;
34 -
35 -
36 -#define panic __emcore_syscall->panic
37 -#define panicf __emcore_syscall->panicf
38 -#define cprintf __emcore_syscall->cprintf
39 -#define cvprintf __emcore_syscall->cvprintf
40 -#define cputc __emcore_syscall->cputc
41 -#define cputs __emcore_syscall->cputs
42 -#define cwrite __emcore_syscall->cwrite
43 -#define cflush __emcore_syscall->cflush
44 -#define cgetc __emcore_syscall->cgetc
45 -#define cread __emcore_syscall->cread
46 -#define creada __emcore_syscall->creada
47 -#define opendir __emcore_syscall->opendir
48 -#define closedir __emcore_syscall->closedir
49 -#define readdir __emcore_syscall->readdir
50 -#define mkdir __emcore_syscall->mkdir
51 -#define rmdir __emcore_syscall->rmdir
52 -#define renderchar_native __emcore_syscall->renderchar_native
53 -#define renderchar __emcore_syscall->renderchar
54 -#define rendertext __emcore_syscall->rendertext
55 -#define get_font_width __emcore_syscall->get_font_width
56 -#define get_font_height __emcore_syscall->get_font_height
57 -#define execimage __emcore_syscall->execimage
58 -#define ftruncate __emcore_syscall->ftruncate
59 -#define fsync __emcore_syscall->fsync
60 -#define close __emcore_syscall->close
61 -#define write __emcore_syscall->write
62 -#define read __emcore_syscall->read
63 -#define lseek __emcore_syscall->lseek
64 -#define remove __emcore_syscall->remove
65 -#define file_open __emcore_syscall->file_open
66 -#define rename __emcore_syscall->rename
67 -#define file_creat __emcore_syscall->file_creat
68 -#define filesize __emcore_syscall->filesize
69 -#define format __emcore_syscall->format
70 -#define vuprintf __emcore_syscall->vuprintf
71 -#define lcdconsole_putc_noblit __emcore_syscall->lcdconsole_putc_noblit
72 -#define lcdconsole_puts_noblit __emcore_syscall->lcdconsole_puts_noblit
73 -#define lcdconsole_write_noblit __emcore_syscall->lcdconsole_write_noblit
74 -#define lcdconsole_update __emcore_syscall->lcdconsole_update
75 -#define lcdconsole_putc __emcore_syscall->lcdconsole_putc
76 -#define lcdconsole_puts __emcore_syscall->lcdconsole_puts
77 -#define lcdconsole_write __emcore_syscall->lcdconsole_write
78 -#define lcdconsole_get_current_x __emcore_syscall->lcdconsole_get_current_x
79 -#define lcdconsole_get_current_y __emcore_syscall->lcdconsole_get_current_y
80 -#define lcdconsole_get_lineend_x __emcore_syscall->lcdconsole_get_lineend_x
81 -#define lcdconsole_get_lineend_y __emcore_syscall->lcdconsole_get_lineend_y
82 -#define lcdconsole_progressbar __emcore_syscall->lcdconsole_progressbar
83 -#define progressbar_init __emcore_syscall->progressbar_init
84 -#define progressbar_setpos __emcore_syscall->progressbar_setpos
85 -#define shutdown __emcore_syscall->shutdown
86 -#define storage_read_sectors_md __emcore_syscall->storage_read_sectors_md
87 -#define storage_write_sectors_md __emcore_syscall->storage_write_sectors_md
88 -#define storage_get_info __emcore_syscall->storage_get_info
89 -#define strcasecmp __emcore_syscall->strcasecmp
90 -#define strncasecmp __emcore_syscall->strncasecmp
91 -#define strcasestr __emcore_syscall->strcasestr
92 -#define strlcat __emcore_syscall->strlcat
93 -#define strlcpy __emcore_syscall->strlcpy
94 -#define mutex_init __emcore_syscall->mutex_init
95 -#define mutex_lock __emcore_syscall->mutex_lock
96 -#define mutex_unlock __emcore_syscall->mutex_unlock
97 -#define wakeup_init __emcore_syscall->wakeup_init
98 -#define wakeup_wait __emcore_syscall->wakeup_wait
99 -#define wakeup_signal __emcore_syscall->wakeup_signal
100 -#define sleep __emcore_syscall->sleep
101 -#define thread_create __emcore_syscall->thread_create
102 -#define thread_exit __emcore_syscall->thread_exit
103 -#define thread_suspend __emcore_syscall->thread_suspend
104 -#define thread_resume __emcore_syscall->thread_resume
105 -#define thread_terminate __emcore_syscall->thread_terminate
106 -#define __errno __emcore_syscall->__errno
107 -#define ucl_decompress __emcore_syscall->ucl_decompress
108 -#define bootflash_filesize __emcore_syscall->bootflash_filesize
109 -#define bootflash_attributes __emcore_syscall->bootflash_attributes
110 -#define bootflash_getaddr __emcore_syscall->bootflash_getaddr
111 -#define bootflash_read __emcore_syscall->bootflash_read
112 -#define bootflash_readraw __emcore_syscall->bootflash_readraw
113 -#define bootflash_writeraw __emcore_syscall->bootflash_writeraw
114 -#define bootflash_getrawaddr __emcore_syscall->bootflash_getrawaddr
115 -#define bootflash_is_memmapped __emcore_syscall->bootflash_is_memmapped
116 -#define read_native_timer __emcore_syscall->read_native_timer
117 -#define read_usec_timer __emcore_syscall->read_usec_timer
118 -#define i2c_send __emcore_syscall->i2c_send
119 -#define i2c_recv __emcore_syscall->i2c_recv
120 -#define i2c_sendbyte __emcore_syscall->i2c_sendbyte
121 -#define i2c_recvbyte __emcore_syscall->i2c_recvbyte
122 -#define interrupt_enable __emcore_syscall->interrupt_enable
123 -#define interrupt_set_handler __emcore_syscall->interrupt_set_handler
124 -#define int_timer_set_handler __emcore_syscall->int_timer_set_handler
125 -#define displaylcd __emcore_syscall->displaylcd
126 -#define filllcd __emcore_syscall->filllcd
127 -#define displaylcd_native __emcore_syscall->displaylcd_native
128 -#define filllcd_native __emcore_syscall->filllcd_native
129 -#define displaylcd_sync __emcore_syscall->displaylcd_sync
130 -#define displaylcd_busy __emcore_syscall->displaylcd_busy
131 -#define displaylcd_safe __emcore_syscall->displaylcd_safe
132 -#define lcd_get_width __emcore_syscall->lcd_get_width
133 -#define lcd_get_height __emcore_syscall->lcd_get_height
134 -#define lcd_get_bytes_per_pixel __emcore_syscall->lcd_get_bytes_per_pixel
135 -#define lcd_translate_color __emcore_syscall->lcd_translate_color
136 -#define clean_dcache __emcore_syscall->clean_dcache
137 -#define invalidate_dcache __emcore_syscall->invalidate_dcache
138 -#define invalidate_icache __emcore_syscall->invalidate_icache
139 -#define power_off __emcore_syscall->power_off
140 -#define charging_state __emcore_syscall->charging_state
141 -#define atoi __emcore_syscall->atoi
142 -#define memchr __emcore_syscall->memchr
143 -#define memcmp __emcore_syscall->memcmp
144 -#define memcpy __emcore_syscall->memcpy
145 -#define memmove __emcore_syscall->memmove
146 -#define memset __emcore_syscall->memset
147 -#define qsort __emcore_syscall->qsort
148 -#define srand __emcore_syscall->srand
149 -#define rand __emcore_syscall->rand
150 -#define snprintf __emcore_syscall->snprintf
151 -#define vsnprintf __emcore_syscall->vsnprintf
152 -#define isspace __emcore_syscall->isspace
153 -#define isdigit __emcore_syscall->isdigit
154 -#define isxdigit __emcore_syscall->isxdigit
155 -#define sscanf __emcore_syscall->sscanf
156 -#define strcat __emcore_syscall->strcat
157 -#define strchr __emcore_syscall->strchr
158 -#define strcmp __emcore_syscall->strcmp
159 -#define strcpy __emcore_syscall->strcpy
160 -#define strlen __emcore_syscall->strlen
161 -#define strncmp __emcore_syscall->strncmp
162 -#define strrchr __emcore_syscall->strrchr
163 -#define strstr __emcore_syscall->strstr
164 -#define strtok_r __emcore_syscall->strtok_r
165 -#define backlight_on __emcore_syscall->backlight_on
166 -#define backlight_set_fade __emcore_syscall->backlight_set_fade
167 -#define backlight_set_brightness __emcore_syscall->backlight_set_brightness
168 -#define get_platform_id __emcore_syscall->get_platform_id
169 -#define tlsf_create __emcore_syscall->tlsf_create
170 -#define tlsf_destroy __emcore_syscall->tlsf_destroy
171 -#define tlsf_malloc __emcore_syscall->tlsf_malloc
172 -#define tlsf_memalign __emcore_syscall->tlsf_memalign
173 -#define tlsf_realloc __emcore_syscall->tlsf_realloc
174 -#define tlsf_free __emcore_syscall->tlsf_free
175 -#define tlsf_walk_heap __emcore_syscall->tlsf_walk_heap
176 -#define tlsf_check_heap __emcore_syscall->tlsf_check_heap
177 -#define tlsf_block_size __emcore_syscall->tlsf_block_size
178 -#define tlsf_overhead __emcore_syscall->tlsf_overhead
179 -#define execfirmware __emcore_syscall->execfirmware
180 -#define button_register_handler __emcore_syscall->button_register_handler
181 -#define button_unregister_handler __emcore_syscall->button_unregister_handler
182 -#define clickwheel_get_state __emcore_syscall->clickwheel_get_state
183 -#define clockgate_enable __emcore_syscall->clockgate_enable
184 -#define yield __emcore_syscall->yield
185 -#define disk_mount __emcore_syscall->disk_mount
186 -#define disk_unmount __emcore_syscall->disk_unmount
187 -#define hwkeyaes __emcore_syscall->hwkeyaes
188 -#define hmacsha1 __emcore_syscall->hmacsha1
189 -#define reset __emcore_syscall->reset
190 -#define int_dma_set_handler __emcore_syscall->int_dma_set_handler
191 -#define thread_set_name __emcore_syscall->thread_set_name
192 -#define thread_set_priority __emcore_syscall->thread_set_priority
193 -#define malloc __emcore_syscall->malloc
194 -#define memalign __emcore_syscall->memalign
195 -#define realloc __emcore_syscall->realloc
196 -#define reownalloc __emcore_syscall->reownalloc
197 -#define free __emcore_syscall->free
198 -#define library_unload __emcore_syscall->library_unload
199 -#define get_library __emcore_syscall->get_library
200 -#define get_library_ext __emcore_syscall->get_library_ext
201 -#define release_library __emcore_syscall->release_library
202 -#define release_library_ext __emcore_syscall->release_library_ext
203 -#define fat_enable_flushing __emcore_syscall->fat_enable_flushing
204 -#define lcd_get_format __emcore_syscall->lcd_get_format
205 -#define crc32 __emcore_syscall->crc32
206 -#define clockgate_get_state __emcore_syscall->clockgate_get_state
207 -#define malloc_walk __emcore_syscall->malloc_walk
208 -
209 -
210 -#endif
 2+//
 3+//
 4+// Copyright 2010 TheSeven
 5+//
 6+//
 7+// This file is part of emCORE.
 8+//
 9+// emCORE is free software: you can redistribute it and/or
 10+// modify it under the terms of the GNU General Public License as
 11+// published by the Free Software Foundation, either version 2 of the
 12+// License, or (at your option) any later version.
 13+//
 14+// emCORE is distributed in the hope that it will be useful,
 15+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 16+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 17+// See the GNU General Public License for more details.
 18+//
 19+// You should have received a copy of the GNU General Public License along
 20+// with emCORE. If not, see <http://www.gnu.org/licenses/>.
 21+//
 22+//
 23+
 24+
 25+#ifndef __SYSCALLWRAPPERS_H__
 26+#define __SYSCALLWRAPPERS_H__
 27+
 28+
 29+#define IN_APPLICATION_CODE
 30+#include "syscallapi.h"
 31+
 32+
 33+extern struct emcore_syscall_table* __emcore_syscall;
 34+
 35+
 36+#define panic __emcore_syscall->panic
 37+#define panicf __emcore_syscall->panicf
 38+#define cprintf __emcore_syscall->cprintf
 39+#define cvprintf __emcore_syscall->cvprintf
 40+#define cputc __emcore_syscall->cputc
 41+#define cputs __emcore_syscall->cputs
 42+#define cwrite __emcore_syscall->cwrite
 43+#define cflush __emcore_syscall->cflush
 44+#define cgetc __emcore_syscall->cgetc
 45+#define cread __emcore_syscall->cread
 46+#define creada __emcore_syscall->creada
 47+#define opendir __emcore_syscall->opendir
 48+#define closedir __emcore_syscall->closedir
 49+#define readdir __emcore_syscall->readdir
 50+#define mkdir __emcore_syscall->mkdir
 51+#define rmdir __emcore_syscall->rmdir
 52+#define renderchar_native __emcore_syscall->renderchar_native
 53+#define renderchar __emcore_syscall->renderchar
 54+#define rendertext __emcore_syscall->rendertext
 55+#define get_font_width __emcore_syscall->get_font_width
 56+#define get_font_height __emcore_syscall->get_font_height
 57+#define execimage __emcore_syscall->execimage
 58+#define ftruncate __emcore_syscall->ftruncate
 59+#define fsync __emcore_syscall->fsync
 60+#define close __emcore_syscall->close
 61+#define write __emcore_syscall->write
 62+#define read __emcore_syscall->read
 63+#define lseek __emcore_syscall->lseek
 64+#define remove __emcore_syscall->remove
 65+#define file_open __emcore_syscall->file_open
 66+#define rename __emcore_syscall->rename
 67+#define file_creat __emcore_syscall->file_creat
 68+#define filesize __emcore_syscall->filesize
 69+#define format __emcore_syscall->format
 70+#define vuprintf __emcore_syscall->vuprintf
 71+#define lcdconsole_putc_noblit __emcore_syscall->lcdconsole_putc_noblit
 72+#define lcdconsole_puts_noblit __emcore_syscall->lcdconsole_puts_noblit
 73+#define lcdconsole_write_noblit __emcore_syscall->lcdconsole_write_noblit
 74+#define lcdconsole_update __emcore_syscall->lcdconsole_update
 75+#define lcdconsole_putc __emcore_syscall->lcdconsole_putc
 76+#define lcdconsole_puts __emcore_syscall->lcdconsole_puts
 77+#define lcdconsole_write __emcore_syscall->lcdconsole_write
 78+#define lcdconsole_get_current_x __emcore_syscall->lcdconsole_get_current_x
 79+#define lcdconsole_get_current_y __emcore_syscall->lcdconsole_get_current_y
 80+#define lcdconsole_get_lineend_x __emcore_syscall->lcdconsole_get_lineend_x
 81+#define lcdconsole_get_lineend_y __emcore_syscall->lcdconsole_get_lineend_y
 82+#define lcdconsole_progressbar __emcore_syscall->lcdconsole_progressbar
 83+#define progressbar_init __emcore_syscall->progressbar_init
 84+#define progressbar_setpos __emcore_syscall->progressbar_setpos
 85+#define shutdown __emcore_syscall->shutdown
 86+#define storage_read_sectors_md __emcore_syscall->storage_read_sectors_md
 87+#define storage_write_sectors_md __emcore_syscall->storage_write_sectors_md
 88+#define storage_get_info __emcore_syscall->storage_get_info
 89+#define strcasecmp __emcore_syscall->strcasecmp
 90+#define strncasecmp __emcore_syscall->strncasecmp
 91+#define strcasestr __emcore_syscall->strcasestr
 92+#define strlcat __emcore_syscall->strlcat
 93+#define strlcpy __emcore_syscall->strlcpy
 94+#define mutex_init __emcore_syscall->mutex_init
 95+#define mutex_lock __emcore_syscall->mutex_lock
 96+#define mutex_unlock __emcore_syscall->mutex_unlock
 97+#define wakeup_init __emcore_syscall->wakeup_init
 98+#define wakeup_wait __emcore_syscall->wakeup_wait
 99+#define wakeup_signal __emcore_syscall->wakeup_signal
 100+#define sleep __emcore_syscall->sleep
 101+#define thread_create __emcore_syscall->thread_create
 102+#define thread_exit __emcore_syscall->thread_exit
 103+#define thread_suspend __emcore_syscall->thread_suspend
 104+#define thread_resume __emcore_syscall->thread_resume
 105+#define thread_terminate __emcore_syscall->thread_terminate
 106+#define __errno __emcore_syscall->__errno
 107+#define ucl_decompress __emcore_syscall->ucl_decompress
 108+#define bootflash_filesize __emcore_syscall->bootflash_filesize
 109+#define bootflash_attributes __emcore_syscall->bootflash_attributes
 110+#define bootflash_getaddr __emcore_syscall->bootflash_getaddr
 111+#define bootflash_read __emcore_syscall->bootflash_read
 112+#define bootflash_readraw __emcore_syscall->bootflash_readraw
 113+#define bootflash_writeraw __emcore_syscall->bootflash_writeraw
 114+#define bootflash_getrawaddr __emcore_syscall->bootflash_getrawaddr
 115+#define bootflash_is_memmapped __emcore_syscall->bootflash_is_memmapped
 116+#define read_native_timer __emcore_syscall->read_native_timer
 117+#define read_usec_timer __emcore_syscall->read_usec_timer
 118+#define i2c_send __emcore_syscall->i2c_send
 119+#define i2c_recv __emcore_syscall->i2c_recv
 120+#define i2c_sendbyte __emcore_syscall->i2c_sendbyte
 121+#define i2c_recvbyte __emcore_syscall->i2c_recvbyte
 122+#define interrupt_enable __emcore_syscall->interrupt_enable
 123+#define interrupt_set_handler __emcore_syscall->interrupt_set_handler
 124+#define int_timer_set_handler __emcore_syscall->int_timer_set_handler
 125+#define displaylcd __emcore_syscall->displaylcd
 126+#define filllcd __emcore_syscall->filllcd
 127+#define displaylcd_native __emcore_syscall->displaylcd_native
 128+#define filllcd_native __emcore_syscall->filllcd_native
 129+#define displaylcd_sync __emcore_syscall->displaylcd_sync
 130+#define displaylcd_busy __emcore_syscall->displaylcd_busy
 131+#define displaylcd_safe __emcore_syscall->displaylcd_safe
 132+#define lcd_get_width __emcore_syscall->lcd_get_width
 133+#define lcd_get_height __emcore_syscall->lcd_get_height
 134+#define lcd_get_bytes_per_pixel __emcore_syscall->lcd_get_bytes_per_pixel
 135+#define lcd_translate_color __emcore_syscall->lcd_translate_color
 136+#define clean_dcache __emcore_syscall->clean_dcache
 137+#define invalidate_dcache __emcore_syscall->invalidate_dcache
 138+#define invalidate_icache __emcore_syscall->invalidate_icache
 139+#define power_off __emcore_syscall->power_off
 140+#define charging_state __emcore_syscall->charging_state
 141+#define atoi __emcore_syscall->atoi
 142+#define memchr __emcore_syscall->memchr
 143+#define memcmp __emcore_syscall->memcmp
 144+#define memcpy __emcore_syscall->memcpy
 145+#define memmove __emcore_syscall->memmove
 146+#define memset __emcore_syscall->memset
 147+#define qsort __emcore_syscall->qsort
 148+#define srand __emcore_syscall->srand
 149+#define rand __emcore_syscall->rand
 150+#define snprintf __emcore_syscall->snprintf
 151+#define vsnprintf __emcore_syscall->vsnprintf
 152+#define isspace __emcore_syscall->isspace
 153+#define isdigit __emcore_syscall->isdigit
 154+#define isxdigit __emcore_syscall->isxdigit
 155+#define sscanf __emcore_syscall->sscanf
 156+#define strcat __emcore_syscall->strcat
 157+#define strchr __emcore_syscall->strchr
 158+#define strcmp __emcore_syscall->strcmp
 159+#define strcpy __emcore_syscall->strcpy
 160+#define strlen __emcore_syscall->strlen
 161+#define strncmp __emcore_syscall->strncmp
 162+#define strrchr __emcore_syscall->strrchr
 163+#define strstr __emcore_syscall->strstr
 164+#define strtok_r __emcore_syscall->strtok_r
 165+#define backlight_on __emcore_syscall->backlight_on
 166+#define backlight_set_fade __emcore_syscall->backlight_set_fade
 167+#define backlight_set_brightness __emcore_syscall->backlight_set_brightness
 168+#define get_platform_id __emcore_syscall->get_platform_id
 169+#define tlsf_create __emcore_syscall->tlsf_create
 170+#define tlsf_destroy __emcore_syscall->tlsf_destroy
 171+#define tlsf_malloc __emcore_syscall->tlsf_malloc
 172+#define tlsf_memalign __emcore_syscall->tlsf_memalign
 173+#define tlsf_realloc __emcore_syscall->tlsf_realloc
 174+#define tlsf_free __emcore_syscall->tlsf_free
 175+#define tlsf_walk_heap __emcore_syscall->tlsf_walk_heap
 176+#define tlsf_check_heap __emcore_syscall->tlsf_check_heap
 177+#define tlsf_block_size __emcore_syscall->tlsf_block_size
 178+#define tlsf_overhead __emcore_syscall->tlsf_overhead
 179+#define execfirmware __emcore_syscall->execfirmware
 180+#define button_register_handler __emcore_syscall->button_register_handler
 181+#define button_unregister_handler __emcore_syscall->button_unregister_handler
 182+#define clickwheel_get_state __emcore_syscall->clickwheel_get_state
 183+#define clockgate_enable __emcore_syscall->clockgate_enable
 184+#define yield __emcore_syscall->yield
 185+#define disk_mount __emcore_syscall->disk_mount
 186+#define disk_unmount __emcore_syscall->disk_unmount
 187+#define hwkeyaes __emcore_syscall->hwkeyaes
 188+#define hmacsha1 __emcore_syscall->hmacsha1
 189+#define reset __emcore_syscall->reset
 190+#define int_dma_set_handler __emcore_syscall->int_dma_set_handler
 191+#define thread_set_name __emcore_syscall->thread_set_name
 192+#define thread_set_priority __emcore_syscall->thread_set_priority
 193+#define malloc __emcore_syscall->malloc
 194+#define memalign __emcore_syscall->memalign
 195+#define realloc __emcore_syscall->realloc
 196+#define reownalloc __emcore_syscall->reownalloc
 197+#define free __emcore_syscall->free
 198+#define library_unload __emcore_syscall->library_unload
 199+#define get_library __emcore_syscall->get_library
 200+#define get_library_ext __emcore_syscall->get_library_ext
 201+#define release_library __emcore_syscall->release_library
 202+#define release_library_ext __emcore_syscall->release_library_ext
 203+#define fat_enable_flushing __emcore_syscall->fat_enable_flushing
 204+#define lcd_get_format __emcore_syscall->lcd_get_format
 205+#define crc32 __emcore_syscall->crc32
 206+#define clockgate_get_state __emcore_syscall->clockgate_get_state
 207+#define malloc_walk __emcore_syscall->malloc_walk
 208+#define storage_sleep __emcore_syscall->storage_sleep
 209+#define storage_disk_is_active __emcore_syscall->storage_disk_is_active
 210+#define storage_soft_reset __emcore_syscall->storage_soft_reset
 211+#define storage_flush __emcore_syscall->storage_flush
 212+#define storage_spin __emcore_syscall->storage_spin
 213+#define storage_spindown __emcore_syscall->storage_spindown
 214+#define storage_last_disk_activity __emcore_syscall->storage_last_disk_activity
 215+#define storage_num_drives __emcore_syscall->storage_num_drives
 216+#define read_battery_voltage __emcore_syscall->read_battery_voltage
 217+#define read_battery_current __emcore_syscall->read_battery_current
 218+#define read_battery_mwh_design __emcore_syscall->read_battery_mwh_design
 219+#define read_battery_mwh_full __emcore_syscall->read_battery_mwh_full
 220+#define read_battery_mwh_current __emcore_syscall->read_battery_mwh_current
 221+#define read_battery_mw __emcore_syscall->read_battery_mw
 222+#define read_input_mw __emcore_syscall->read_input_mw
 223+#define read_battery_state __emcore_syscall->read_battery_state
 224+
 225+
 226+#endif
Index: emcore/trunk/export/syscallapi.h
@@ -1,268 +1,284 @@
2 -//
3 -//
4 -// Copyright 2010 TheSeven
5 -//
6 -//
7 -// This file is part of emCORE.
8 -//
9 -// emCORE is free software: you can redistribute it and/or
10 -// modify it under the terms of the GNU General Public License as
11 -// published by the Free Software Foundation, either version 2 of the
12 -// License, or (at your option) any later version.
13 -//
14 -// emCORE is distributed in the hope that it will be useful,
15 -// but WITHOUT ANY WARRANTY; without even the implied warranty of
16 -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 -// See the GNU General Public License for more details.
18 -//
19 -// You should have received a copy of the GNU General Public License along
20 -// with emCORE. If not, see <http://www.gnu.org/licenses/>.
21 -//
22 -//
23 -
24 -
25 -#ifndef __SYSCALLAPI_H__
26 -#define __SYSCALLAPI_H__
27 -
28 -
29 -#include "../global.h"
30 -#include "../panic.h"
31 -#include "../console.h"
32 -#include "../disk.h"
33 -#include "../dir.h"
34 -#include "../file.h"
35 -#include "../fat.h"
36 -#include "../format.h"
37 -#include "../drawing.h"
38 -#include "../lcdconsole.h"
39 -#include "../storage.h"
40 -#include "../shutdown.h"
41 -#include "../thread.h"
42 -#include "../contextswitch.h"
43 -#include "../ucl.h"
44 -#include "../bootflash.h"
45 -#include "../timer.h"
46 -#include "../i2c.h"
47 -#include "../interrupt.h"
48 -#include "../lcd.h"
49 -#include "../mmu.h"
50 -#include "../power.h"
51 -#include "../execimage.h"
52 -#include "../backlight.h"
53 -#include "../syscall.h"
54 -#include "../progressbar.h"
55 -#include "../button.h"
56 -#include "../clickwheel.h"
57 -#include "../clockgates.h"
58 -#include "../contextswitch.h"
59 -#include "../hwkeyaes.h"
60 -#include "../hmacsha1.h"
61 -#include "../malloc.h"
62 -#include "../library.h"
63 -#include "../crc32.h"
64 -#include "../libc/include/assert.h"
65 -#include "../libc/include/string.h"
66 -#include "../libc/include/stdlib.h"
67 -#include "../libc/include/stdio.h"
68 -#include "../libc/tlsf/tlsf.h"
69 -
70 -#ifdef ARM_ARCH
71 -#include "../arm/arm-support.h"
72 -#endif
73 -
74 -/* increase this every time the api struct changes */
75 -#define EMCORE_API_VERSION 1
76 -
77 -/* update this to latest version if a change to the api struct breaks
78 - backwards compatibility (and please take the opportunity to sort in any
79 - new function which are "waiting" at the end of the function table) */
80 -#define EMCORE_MIN_API_VERSION 1
81 -
82 -/* NOTE: To support backwards compatibility, only add new functions at
83 - the end of the structure. Every time you add a new function,
84 - remember to increase EMCORE_API_VERSION. If you make changes to the
85 - existing APIs, also update EMCORE_MIN_API_VERSION to current version */
86 -
87 -struct emcore_syscall_table
88 -{
89 - uint32_t table_version;
90 - uint32_t table_minversion;
91 -#ifdef ARM_ARCH
92 - /* DON'T MOVE THESE! If you absolutely need to, adjust export/armhelpers.c */
93 - typeof(__clzsi2) *__clzsi2;
94 - typeof(__aeabi_idivmod) *__aeabi_idivmod;
95 - typeof(__aeabi_uidivmod) *__aeabi_uidivmod;
96 -#endif
97 - typeof(panic) *panic;
98 - typeof(panicf) *panicf;
99 - typeof(cprintf) *cprintf;
100 - typeof(cvprintf) *cvprintf;
101 - typeof(cputc) *cputc;
102 - typeof(cputs) *cputs;
103 - typeof(cwrite) *cwrite;
104 - typeof(cflush) *cflush;
105 - typeof(cgetc) *cgetc;
106 - typeof(cread) *cread;
107 - typeof(creada) *creada;
108 - typeof(opendir) *opendir;
109 - typeof(closedir) *closedir;
110 - typeof(readdir) *readdir;
111 - typeof(mkdir) *mkdir;
112 - typeof(rmdir) *rmdir;
113 - typeof(renderchar_native) *renderchar_native;
114 - typeof(renderchar) *renderchar;
115 - typeof(rendertext) *rendertext;
116 - typeof(get_font_width) *get_font_width;
117 - typeof(get_font_height) *get_font_height;
118 - typeof(execimage) *execimage;
119 - typeof(ftruncate) *ftruncate;
120 - typeof(fsync) *fsync;
121 - typeof(close) *close;
122 - typeof(write) *write;
123 - typeof(read) *read;
124 - typeof(lseek) *lseek;
125 - typeof(remove) *remove;
126 - typeof(file_open) *file_open;
127 - typeof(rename) *rename;
128 - typeof(file_creat) *file_creat;
129 - typeof(filesize) *filesize;
130 - typeof(format) *format;
131 - typeof(vuprintf) *vuprintf;
132 - typeof(lcdconsole_putc_noblit) *lcdconsole_putc_noblit;
133 - typeof(lcdconsole_puts_noblit) *lcdconsole_puts_noblit;
134 - typeof(lcdconsole_write_noblit) *lcdconsole_write_noblit;
135 - typeof(lcdconsole_update) *lcdconsole_update;
136 - typeof(lcdconsole_putc) *lcdconsole_putc;
137 - typeof(lcdconsole_puts) *lcdconsole_puts;
138 - typeof(lcdconsole_write) *lcdconsole_write;
139 - typeof(lcdconsole_get_current_x) *lcdconsole_get_current_x;
140 - typeof(lcdconsole_get_current_y) *lcdconsole_get_current_y;
141 - typeof(lcdconsole_get_lineend_x) *lcdconsole_get_lineend_x;
142 - typeof(lcdconsole_get_lineend_y) *lcdconsole_get_lineend_y;
143 - typeof(lcdconsole_progressbar) *lcdconsole_progressbar;
144 - typeof(progressbar_init) *progressbar_init;
145 - typeof(progressbar_setpos) *progressbar_setpos;
146 - typeof(shutdown) *shutdown;
147 - typeof(storage_read_sectors_md) *storage_read_sectors_md;
148 - typeof(storage_write_sectors_md) *storage_write_sectors_md;
149 - typeof(storage_get_info) *storage_get_info;
150 - typeof(strcasecmp) *strcasecmp;
151 - typeof(strncasecmp) *strncasecmp;
152 - typeof(strcasestr) *strcasestr;
153 - typeof(strlcat) *strlcat;
154 - typeof(strlcpy) *strlcpy;
155 - typeof(mutex_init) *mutex_init;
156 - typeof(mutex_lock) *mutex_lock;
157 - typeof(mutex_unlock) *mutex_unlock;
158 - typeof(wakeup_init) *wakeup_init;
159 - typeof(wakeup_wait) *wakeup_wait;
160 - typeof(wakeup_signal) *wakeup_signal;
161 - typeof(sleep) *sleep;
162 - typeof(thread_create) *thread_create;
163 - typeof(thread_exit) *thread_exit;
164 - typeof(thread_suspend) *thread_suspend;
165 - typeof(thread_resume) *thread_resume;
166 - typeof(thread_terminate) *thread_terminate;
167 - typeof(__errno) *__errno;
168 - typeof(ucl_decompress) *ucl_decompress;
169 - typeof(bootflash_filesize) *bootflash_filesize;
170 - typeof(bootflash_attributes) *bootflash_attributes;
171 - typeof(bootflash_getaddr) *bootflash_getaddr;
172 - typeof(bootflash_read) *bootflash_read;
173 - typeof(bootflash_readraw) *bootflash_readraw;
174 - typeof(bootflash_writeraw) *bootflash_writeraw;
175 - typeof(bootflash_getrawaddr) *bootflash_getrawaddr;
176 - typeof(bootflash_is_memmapped) *bootflash_is_memmapped;
177 - typeof(read_native_timer) *read_native_timer;
178 - typeof(read_usec_timer) *read_usec_timer;
179 - typeof(i2c_send) *i2c_send;
180 - typeof(i2c_recv) *i2c_recv;
181 - typeof(i2c_sendbyte) *i2c_sendbyte;
182 - typeof(i2c_recvbyte) *i2c_recvbyte;
183 - typeof(interrupt_enable) *interrupt_enable;
184 - typeof(interrupt_set_handler) *interrupt_set_handler;
185 - typeof(int_timer_set_handler) *int_timer_set_handler;
186 - typeof(displaylcd) *displaylcd;
187 - typeof(filllcd) *filllcd;
188 - typeof(displaylcd_native) *displaylcd_native;
189 - typeof(filllcd_native) *filllcd_native;
190 - typeof(displaylcd_sync) *displaylcd_sync;
191 - typeof(displaylcd_busy) *displaylcd_busy;
192 - typeof(displaylcd_safe) *displaylcd_safe;
193 - typeof(lcd_get_width) *lcd_get_width;
194 - typeof(lcd_get_height) *lcd_get_height;
195 - typeof(lcd_get_bytes_per_pixel) *lcd_get_bytes_per_pixel;
196 - typeof(lcd_translate_color) *lcd_translate_color;
197 - typeof(clean_dcache) *clean_dcache;
198 - typeof(invalidate_dcache) *invalidate_dcache;
199 - typeof(invalidate_icache) *invalidate_icache;
200 - typeof(power_off) *power_off;
201 - typeof(charging_state) *charging_state;
202 - typeof(atoi) *atoi;
203 - typeof(memchr) *memchr;
204 - typeof(memcmp) *memcmp;
205 - typeof(memcpy) *memcpy;
206 - typeof(memmove) *memmove;
207 - typeof(memset) *memset;
208 - typeof(qsort) *qsort;
209 - typeof(srand) *srand;
210 - typeof(rand) *rand;
211 - typeof(snprintf) *snprintf;
212 - typeof(vsnprintf) *vsnprintf;
213 - typeof(sscanf) *sscanf;
214 - typeof(strcat) *strcat;
215 - typeof(strchr) *strchr;
216 - typeof(strcmp) *strcmp;
217 - typeof(strcpy) *strcpy;
218 - typeof(strlen) *strlen;
219 - typeof(strncmp) *strncmp;
220 - typeof(strrchr) *strrchr;
221 - typeof(strstr) *strstr;
222 - typeof(strtok_r) *strtok_r;
223 - typeof(backlight_on) *backlight_on;
224 - typeof(backlight_set_fade) *backlight_set_fade;
225 - typeof(backlight_set_brightness) *backlight_set_brightness;
226 - typeof(get_platform_id) *get_platform_id;
227 - typeof(tlsf_create) *tlsf_create;
228 - typeof(tlsf_destroy) *tlsf_destroy;
229 - typeof(tlsf_malloc) *tlsf_malloc;
230 - typeof(tlsf_memalign) *tlsf_memalign;
231 - typeof(tlsf_realloc) *tlsf_realloc;
232 - typeof(tlsf_free) *tlsf_free;
233 - typeof(tlsf_walk_heap) *tlsf_walk_heap;
234 - typeof(tlsf_check_heap) *tlsf_check_heap;
235 - typeof(tlsf_block_size) *tlsf_block_size;
236 - typeof(tlsf_overhead) *tlsf_overhead;
237 - typeof(execfirmware) *execfirmware;
238 - typeof(button_register_handler) *button_register_handler;
239 - typeof(button_unregister_handler) *button_unregister_handler;
240 - typeof(clickwheel_get_state) *clickwheel_get_state;
241 - typeof(clockgate_enable) *clockgate_enable;
242 - typeof(yield) *yield;
243 - typeof(disk_mount) *disk_mount;
244 - typeof(disk_unmount) *disk_unmount;
245 - typeof(hwkeyaes) *hwkeyaes;
246 - typeof(hmacsha1) *hmacsha1;
247 - typeof(reset) *reset;
248 - typeof(int_dma_set_handler) *int_dma_set_handler;
249 - typeof(thread_set_name) *thread_set_name;
250 - typeof(thread_set_priority) *thread_set_priority;
251 - typeof(malloc) *malloc;
252 - typeof(memalign) *memalign;
253 - typeof(realloc) *realloc;
254 - typeof(reownalloc) *reownalloc;
255 - typeof(free) *free;
256 - typeof(library_unload) *library_unload;
257 - typeof(get_library) *get_library;
258 - typeof(get_library_ext) *get_library_ext;
259 - typeof(release_library) *release_library;
260 - typeof(release_library_ext) *release_library_ext;
261 - typeof(fat_enable_flushing) *fat_enable_flushing;
262 - typeof(lcd_get_format) *lcd_get_format;
263 - typeof(crc32) *crc32;
264 - typeof(clockgate_get_state) *clockgate_get_state;
265 - typeof(malloc_walk) *malloc_walk;
266 -};
267 -
268 -
269 -#endif
 2+//
 3+//
 4+// Copyright 2010 TheSeven
 5+//
 6+//
 7+// This file is part of emCORE.
 8+//
 9+// emCORE is free software: you can redistribute it and/or
 10+// modify it under the terms of the GNU General Public License as
 11+// published by the Free Software Foundation, either version 2 of the
 12+// License, or (at your option) any later version.
 13+//
 14+// emCORE is distributed in the hope that it will be useful,
 15+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 16+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 17+// See the GNU General Public License for more details.
 18+//
 19+// You should have received a copy of the GNU General Public License along
 20+// with emCORE. If not, see <http://www.gnu.org/licenses/>.
 21+//
 22+//
 23+
 24+
 25+#ifndef __SYSCALLAPI_H__
 26+#define __SYSCALLAPI_H__
 27+
 28+
 29+#include "../global.h"
 30+#include "../panic.h"
 31+#include "../console.h"
 32+#include "../disk.h"
 33+#include "../dir.h"
 34+#include "../file.h"
 35+#include "../fat.h"
 36+#include "../format.h"
 37+#include "../drawing.h"
 38+#include "../lcdconsole.h"
 39+#include "../storage.h"
 40+#include "../shutdown.h"
 41+#include "../thread.h"
 42+#include "../contextswitch.h"
 43+#include "../ucl.h"
 44+#include "../bootflash.h"
 45+#include "../timer.h"
 46+#include "../i2c.h"
 47+#include "../interrupt.h"
 48+#include "../lcd.h"
 49+#include "../mmu.h"
 50+#include "../power.h"
 51+#include "../execimage.h"
 52+#include "../backlight.h"
 53+#include "../syscall.h"
 54+#include "../progressbar.h"
 55+#include "../button.h"
 56+#include "../clickwheel.h"
 57+#include "../clockgates.h"
 58+#include "../contextswitch.h"
 59+#include "../hwkeyaes.h"
 60+#include "../hmacsha1.h"
 61+#include "../malloc.h"
 62+#include "../library.h"
 63+#include "../crc32.h"
 64+#include "../libc/include/assert.h"
 65+#include "../libc/include/string.h"
 66+#include "../libc/include/stdlib.h"
 67+#include "../libc/include/stdio.h"
 68+#include "../libc/tlsf/tlsf.h"
 69+
 70+#ifdef ARM_ARCH
 71+#include "../arm/arm-support.h"
 72+#endif
 73+
 74+/* increase this every time the api struct changes */
 75+#define EMCORE_API_VERSION 1
 76+
 77+/* update this to latest version if a change to the api struct breaks
 78+ backwards compatibility (and please take the opportunity to sort in any
 79+ new function which are "waiting" at the end of the function table) */
 80+#define EMCORE_MIN_API_VERSION 1
 81+
 82+/* NOTE: To support backwards compatibility, only add new functions at
 83+ the end of the structure. Every time you add a new function,
 84+ remember to increase EMCORE_API_VERSION. If you make changes to the
 85+ existing APIs, also update EMCORE_MIN_API_VERSION to current version */
 86+
 87+struct emcore_syscall_table
 88+{
 89+ uint32_t table_version;
 90+ uint32_t table_minversion;
 91+#ifdef ARM_ARCH
 92+ /* DON'T MOVE THESE! If you absolutely need to, adjust export/armhelpers.c */
 93+ typeof(__clzsi2) *__clzsi2;
 94+ typeof(__aeabi_idivmod) *__aeabi_idivmod;
 95+ typeof(__aeabi_uidivmod) *__aeabi_uidivmod;
 96+#endif
 97+ typeof(panic) *panic;
 98+ typeof(panicf) *panicf;
 99+ typeof(cprintf) *cprintf;
 100+ typeof(cvprintf) *cvprintf;
 101+ typeof(cputc) *cputc;
 102+ typeof(cputs) *cputs;
 103+ typeof(cwrite) *cwrite;
 104+ typeof(cflush) *cflush;
 105+ typeof(cgetc) *cgetc;
 106+ typeof(cread) *cread;
 107+ typeof(creada) *creada;
 108+ typeof(opendir) *opendir;
 109+ typeof(closedir) *closedir;
 110+ typeof(readdir) *readdir;
 111+ typeof(mkdir) *mkdir;
 112+ typeof(rmdir) *rmdir;
 113+ typeof(renderchar_native) *renderchar_native;
 114+ typeof(renderchar) *renderchar;
 115+ typeof(rendertext) *rendertext;
 116+ typeof(get_font_width) *get_font_width;
 117+ typeof(get_font_height) *get_font_height;
 118+ typeof(execimage) *execimage;
 119+ typeof(ftruncate) *ftruncate;
 120+ typeof(fsync) *fsync;
 121+ typeof(close) *close;
 122+ typeof(write) *write;
 123+ typeof(read) *read;
 124+ typeof(lseek) *lseek;
 125+ typeof(remove) *remove;
 126+ typeof(file_open) *file_open;
 127+ typeof(rename) *rename;
 128+ typeof(file_creat) *file_creat;
 129+ typeof(filesize) *filesize;
 130+ typeof(format) *format;
 131+ typeof(vuprintf) *vuprintf;
 132+ typeof(lcdconsole_putc_noblit) *lcdconsole_putc_noblit;
 133+ typeof(lcdconsole_puts_noblit) *lcdconsole_puts_noblit;
 134+ typeof(lcdconsole_write_noblit) *lcdconsole_write_noblit;
 135+ typeof(lcdconsole_update) *lcdconsole_update;
 136+ typeof(lcdconsole_putc) *lcdconsole_putc;
 137+ typeof(lcdconsole_puts) *lcdconsole_puts;
 138+ typeof(lcdconsole_write) *lcdconsole_write;
 139+ typeof(lcdconsole_get_current_x) *lcdconsole_get_current_x;
 140+ typeof(lcdconsole_get_current_y) *lcdconsole_get_current_y;
 141+ typeof(lcdconsole_get_lineend_x) *lcdconsole_get_lineend_x;
 142+ typeof(lcdconsole_get_lineend_y) *lcdconsole_get_lineend_y;
 143+ typeof(lcdconsole_progressbar) *lcdconsole_progressbar;
 144+ typeof(progressbar_init) *progressbar_init;
 145+ typeof(progressbar_setpos) *progressbar_setpos;
 146+ typeof(shutdown) *shutdown;
 147+ typeof(storage_read_sectors_md) *storage_read_sectors_md;
 148+ typeof(storage_write_sectors_md) *storage_write_sectors_md;
 149+ typeof(storage_get_info) *storage_get_info;
 150+ typeof(strcasecmp) *strcasecmp;
 151+ typeof(strncasecmp) *strncasecmp;
 152+ typeof(strcasestr) *strcasestr;
 153+ typeof(strlcat) *strlcat;
 154+ typeof(strlcpy) *strlcpy;
 155+ typeof(mutex_init) *mutex_init;
 156+ typeof(mutex_lock) *mutex_lock;
 157+ typeof(mutex_unlock) *mutex_unlock;
 158+ typeof(wakeup_init) *wakeup_init;
 159+ typeof(wakeup_wait) *wakeup_wait;
 160+ typeof(wakeup_signal) *wakeup_signal;
 161+ typeof(sleep) *sleep;
 162+ typeof(thread_create) *thread_create;
 163+ typeof(thread_exit) *thread_exit;
 164+ typeof(thread_suspend) *thread_suspend;
 165+ typeof(thread_resume) *thread_resume;
 166+ typeof(thread_terminate) *thread_terminate;
 167+ typeof(__errno) *__errno;
 168+ typeof(ucl_decompress) *ucl_decompress;
 169+ typeof(bootflash_filesize) *bootflash_filesize;
 170+ typeof(bootflash_attributes) *bootflash_attributes;
 171+ typeof(bootflash_getaddr) *bootflash_getaddr;
 172+ typeof(bootflash_read) *bootflash_read;
 173+ typeof(bootflash_readraw) *bootflash_readraw;
 174+ typeof(bootflash_writeraw) *bootflash_writeraw;
 175+ typeof(bootflash_getrawaddr) *bootflash_getrawaddr;
 176+ typeof(bootflash_is_memmapped) *bootflash_is_memmapped;
 177+ typeof(read_native_timer) *read_native_timer;
 178+ typeof(read_usec_timer) *read_usec_timer;
 179+ typeof(i2c_send) *i2c_send;
 180+ typeof(i2c_recv) *i2c_recv;
 181+ typeof(i2c_sendbyte) *i2c_sendbyte;
 182+ typeof(i2c_recvbyte) *i2c_recvbyte;
 183+ typeof(interrupt_enable) *interrupt_enable;
 184+ typeof(interrupt_set_handler) *interrupt_set_handler;
 185+ typeof(int_timer_set_handler) *int_timer_set_handler;
 186+ typeof(displaylcd) *displaylcd;
 187+ typeof(filllcd) *filllcd;
 188+ typeof(displaylcd_native) *displaylcd_native;
 189+ typeof(filllcd_native) *filllcd_native;
 190+ typeof(displaylcd_sync) *displaylcd_sync;
 191+ typeof(displaylcd_busy) *displaylcd_busy;
 192+ typeof(displaylcd_safe) *displaylcd_safe;
 193+ typeof(lcd_get_width) *lcd_get_width;
 194+ typeof(lcd_get_height) *lcd_get_height;
 195+ typeof(lcd_get_bytes_per_pixel) *lcd_get_bytes_per_pixel;
 196+ typeof(lcd_translate_color) *lcd_translate_color;
 197+ typeof(clean_dcache) *clean_dcache;
 198+ typeof(invalidate_dcache) *invalidate_dcache;
 199+ typeof(invalidate_icache) *invalidate_icache;
 200+ typeof(power_off) *power_off;
 201+ typeof(charging_state) *charging_state;
 202+ typeof(atoi) *atoi;
 203+ typeof(memchr) *memchr;
 204+ typeof(memcmp) *memcmp;
 205+ typeof(memcpy) *memcpy;
 206+ typeof(memmove) *memmove;
 207+ typeof(memset) *memset;
 208+ typeof(qsort) *qsort;
 209+ typeof(srand) *srand;
 210+ typeof(rand) *rand;
 211+ typeof(snprintf) *snprintf;
 212+ typeof(vsnprintf) *vsnprintf;
 213+ typeof(sscanf) *sscanf;
 214+ typeof(strcat) *strcat;
 215+ typeof(strchr) *strchr;
 216+ typeof(strcmp) *strcmp;
 217+ typeof(strcpy) *strcpy;
 218+ typeof(strlen) *strlen;
 219+ typeof(strncmp) *strncmp;
 220+ typeof(strrchr) *strrchr;
 221+ typeof(strstr) *strstr;
 222+ typeof(strtok_r) *strtok_r;
 223+ typeof(backlight_on) *backlight_on;
 224+ typeof(backlight_set_fade) *backlight_set_fade;
 225+ typeof(backlight_set_brightness) *backlight_set_brightness;
 226+ typeof(get_platform_id) *get_platform_id;
 227+ typeof(tlsf_create) *tlsf_create;
 228+ typeof(tlsf_destroy) *tlsf_destroy;
 229+ typeof(tlsf_malloc) *tlsf_malloc;
 230+ typeof(tlsf_memalign) *tlsf_memalign;
 231+ typeof(tlsf_realloc) *tlsf_realloc;
 232+ typeof(tlsf_free) *tlsf_free;
 233+ typeof(tlsf_walk_heap) *tlsf_walk_heap;
 234+ typeof(tlsf_check_heap) *tlsf_check_heap;
 235+ typeof(tlsf_block_size) *tlsf_block_size;
 236+ typeof(tlsf_overhead) *tlsf_overhead;
 237+ typeof(execfirmware) *execfirmware;
 238+ typeof(button_register_handler) *button_register_handler;
 239+ typeof(button_unregister_handler) *button_unregister_handler;
 240+ typeof(clickwheel_get_state) *clickwheel_get_state;
 241+ typeof(clockgate_enable) *clockgate_enable;
 242+ typeof(yield) *yield;
 243+ typeof(disk_mount) *disk_mount;
 244+ typeof(disk_unmount) *disk_unmount;
 245+ typeof(hwkeyaes) *hwkeyaes;
 246+ typeof(hmacsha1) *hmacsha1;
 247+ typeof(reset) *reset;
 248+ typeof(int_dma_set_handler) *int_dma_set_handler;
 249+ typeof(thread_set_name) *thread_set_name;
 250+ typeof(thread_set_priority) *thread_set_priority;
 251+ typeof(malloc) *malloc;
 252+ typeof(memalign) *memalign;
 253+ typeof(realloc) *realloc;
 254+ typeof(reownalloc) *reownalloc;
 255+ typeof(free) *free;
 256+ typeof(library_unload) *library_unload;
 257+ typeof(get_library) *get_library;
 258+ typeof(get_library_ext) *get_library_ext;
 259+ typeof(release_library) *release_library;
 260+ typeof(release_library_ext) *release_library_ext;
 261+ typeof(fat_enable_flushing) *fat_enable_flushing;
 262+ typeof(lcd_get_format) *lcd_get_format;
 263+ typeof(crc32) *crc32;
 264+ typeof(clockgate_get_state) *clockgate_get_state;
 265+ typeof(malloc_walk) *malloc_walk;
 266+ typeof(storage_sleep) *storage_sleep;
 267+ typeof(storage_disk_is_active) *storage_disk_is_active;
 268+ typeof(storage_soft_reset) *storage_soft_reset;
 269+ typeof(storage_flush) *storage_flush;
 270+ typeof(storage_spin) *storage_spin;
 271+ typeof(storage_spindown) *storage_spindown;
 272+ typeof(storage_last_disk_activity) *storage_last_disk_activity;
 273+ typeof(storage_num_drives) *storage_num_drives;
 274+ typeof(read_battery_voltage) *read_battery_voltage;
 275+ typeof(read_battery_current) *read_battery_current;
 276+ typeof(read_battery_mwh_design) *read_battery_mwh_design;
 277+ typeof(read_battery_mwh_full) *read_battery_mwh_full;
 278+ typeof(read_battery_mwh_current) *read_battery_mwh_current;
 279+ typeof(read_battery_mw) *read_battery_mw;
 280+ typeof(read_input_mw) *read_input_mw;
 281+ typeof(read_battery_state) *read_battery_state;
 282+};
 283+
 284+
 285+#endif
Index: emcore/trunk/syscallapi.c
@@ -1,226 +1,246 @@
2 -//
3 -//
4 -// Copyright 2010 TheSeven
5 -//
6 -//
7 -// This file is part of emCORE.
8 -//
9 -// emCORE is free software: you can redistribute it and/or
10 -// modify it under the terms of the GNU General Public License as
11 -// published by the Free Software Foundation, either version 2 of the
12 -// License, or (at your option) any later version.
13 -//
14 -// emCORE is distributed in the hope that it will be useful,
15 -// but WITHOUT ANY WARRANTY; without even the implied warranty of
16 -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 -// See the GNU General Public License for more details.
18 -//
19 -// You should have received a copy of the GNU General Public License along
20 -// with emCORE. If not, see <http://www.gnu.org/licenses/>.
21 -//
22 -//
23 -
24 -
25 -#include "global.h"
26 -#include "syscallapi.h"
27 -
28 -
29 -struct emcore_syscall_table syscall_table ICONST_ATTR =
30 -{
31 - .table_version = EMCORE_API_VERSION,
32 - .table_minversion = EMCORE_MIN_API_VERSION,
33 -#ifdef ARM_ARCH
34 - .__clzsi2 = __clzsi2,
35 - .__aeabi_idivmod = __aeabi_idivmod,
36 - .__aeabi_uidivmod = __aeabi_uidivmod,
37 -#endif
38 - .panic = panic,
39 - .panicf = panicf,
40 - .cprintf = cprintf,
41 - .cvprintf = cvprintf,
42 - .cputc = cputc,
43 - .cputs = cputs,
44 - .cwrite = cwrite,
45 - .cflush = cflush,
46 - .cgetc = cgetc,
47 - .cread = cread,
48 - .creada = creada,
49 - .format = format,
50 - .vuprintf = vuprintf,
51 - .shutdown = shutdown,
52 - .strcasecmp = strcasecmp,
53 - .strncasecmp = strncasecmp,
54 - .strcasestr = strcasestr,
55 - .strlcat = strlcat,
56 - .strlcpy = strlcpy,
57 - .mutex_init = mutex_init,
58 - .mutex_lock = mutex_lock,
59 - .mutex_unlock = mutex_unlock,
60 - .wakeup_init = wakeup_init,
61 - .wakeup_wait = wakeup_wait,
62 - .wakeup_signal = wakeup_signal,
63 - .sleep = sleep,
64 - .thread_create = thread_create,
65 - .thread_exit = thread_exit,
66 - .thread_suspend = thread_suspend,
67 - .thread_resume = thread_resume,
68 - .thread_terminate = thread_terminate,
69 - .__errno = __errno,
70 - .ucl_decompress = ucl_decompress,
71 - .read_native_timer = read_native_timer,
72 - .read_usec_timer = read_usec_timer,
73 - .i2c_send = i2c_send,
74 - .i2c_recv = i2c_recv,
75 - .i2c_sendbyte = i2c_sendbyte,
76 - .i2c_recvbyte = i2c_recvbyte,
77 - .interrupt_enable = interrupt_enable,
78 - .interrupt_set_handler = interrupt_set_handler,
79 - .int_timer_set_handler = int_timer_set_handler,
80 - .clean_dcache = clean_dcache,
81 - .invalidate_dcache = invalidate_dcache,
82 - .invalidate_icache = invalidate_icache,
83 - .power_off = power_off,
84 - .charging_state = charging_state,
85 - .atoi = atoi,
86 - .memchr = memchr,
87 - .memcmp = memcmp,
88 - .memcpy = memcpy,
89 - .memmove = memmove,
90 - .memset = memset,
91 - .qsort = qsort,
92 - .srand = srand,
93 - .rand = rand,
94 - .snprintf = snprintf,
95 - .vsnprintf = vsnprintf,
96 - .sscanf = sscanf,
97 - .strcat = strcat,
98 - .strchr = strchr,
99 - .strcmp = strcmp,
100 - .strcpy = strcpy,
101 - .strlen = strlen,
102 - .strncmp = strncmp,
103 - .strrchr = strrchr,
104 - .strstr = strstr,
105 - .strtok_r = strtok_r,
106 - .get_platform_id = get_platform_id,
107 - .tlsf_create = tlsf_create,
108 - .tlsf_destroy = tlsf_destroy,
109 - .tlsf_malloc = tlsf_malloc,
110 - .tlsf_memalign = tlsf_memalign,
111 - .tlsf_realloc = tlsf_realloc,
112 - .tlsf_free = tlsf_free,
113 - .tlsf_walk_heap = tlsf_walk_heap,
114 - .tlsf_check_heap = tlsf_check_heap,
115 - .tlsf_block_size = tlsf_block_size,
116 - .tlsf_overhead = tlsf_overhead,
117 - .execfirmware = execfirmware,
118 - .clockgate_enable = clockgate_enable,
119 - .yield = yield,
120 - .reset = reset,
121 - .execimage = execimage,
122 -#ifdef HAVE_STORAGE
123 - .opendir = opendir,
124 - .closedir = closedir,
125 - .readdir = readdir,
126 - .mkdir = mkdir,
127 - .rmdir = rmdir,
128 - .ftruncate = ftruncate,
129 - .fsync = fsync,
130 - .close = close,
131 - .write = write,
132 - .read = read,
133 - .lseek = lseek,
134 - .remove = remove,
135 - .file_open = file_open,
136 - .rename = rename,
137 - .file_creat = file_creat,
138 - .filesize = filesize,
139 - .storage_read_sectors_md = storage_read_sectors_md,
140 - .storage_write_sectors_md = storage_write_sectors_md,
141 - .storage_get_info = storage_get_info,
142 -#ifdef HAVE_HOTSWAP
143 - .disk_mount = disk_mount,
144 - .disk_unmount = disk_unmount,
145 -#endif
146 -#endif
147 -#ifdef HAVE_LCD
148 - .lcdconsole_putc_noblit = lcdconsole_putc_noblit,
149 - .lcdconsole_puts_noblit = lcdconsole_puts_noblit,
150 - .lcdconsole_write_noblit = lcdconsole_write_noblit,
151 - .lcdconsole_update = lcdconsole_update,
152 - .lcdconsole_putc = lcdconsole_putc,
153 - .lcdconsole_puts = lcdconsole_puts,
154 - .lcdconsole_write = lcdconsole_write,
155 - .lcdconsole_get_current_x = lcdconsole_get_current_x,
156 - .lcdconsole_get_current_y = lcdconsole_get_current_y,
157 - .lcdconsole_get_lineend_x = lcdconsole_get_lineend_x,
158 - .lcdconsole_get_lineend_y = lcdconsole_get_lineend_y,
159 - .lcdconsole_progressbar = lcdconsole_progressbar,
160 - .progressbar_init = progressbar_init,
161 - .progressbar_setpos = progressbar_setpos,
162 - .displaylcd = displaylcd,
163 - .filllcd = filllcd,
164 - .displaylcd_native = displaylcd_native,
165 - .filllcd_native = filllcd_native,
166 - .displaylcd_sync = displaylcd_sync,
167 - .displaylcd_busy = displaylcd_busy,
168 - .displaylcd_safe = displaylcd_safe,
169 - .lcd_get_width = lcd_get_width,
170 - .lcd_get_height = lcd_get_height,
171 - .lcd_get_bytes_per_pixel = lcd_get_bytes_per_pixel,
172 - .lcd_translate_color = lcd_translate_color,
173 - .renderchar_native = renderchar_native,
174 - .renderchar = renderchar,
175 - .rendertext = rendertext,
176 - .get_font_width = get_font_width,
177 - .get_font_height = get_font_height,
178 -#endif
179 -#ifdef HAVE_BACKLIGHT
180 - .backlight_on = backlight_on,
181 - .backlight_set_fade = backlight_set_fade,
182 - .backlight_set_brightness = backlight_set_brightness,
183 -#endif
184 -#ifdef HAVE_BOOTFLASH
185 - .bootflash_filesize = bootflash_filesize,
186 - .bootflash_attributes = bootflash_attributes,
187 - .bootflash_getaddr = bootflash_getaddr,
188 - .bootflash_read = bootflash_read,
189 - .bootflash_readraw = bootflash_readraw,
190 - .bootflash_writeraw = bootflash_writeraw,
191 - .bootflash_getrawaddr = bootflash_getrawaddr,
192 - .bootflash_is_memmapped = bootflash_is_memmapped,
193 -#endif
194 -#ifdef HAVE_BUTTON
195 - .button_register_handler = button_register_handler,
196 - .button_unregister_handler = button_unregister_handler,
197 -#endif
198 -#ifdef HAVE_CLICKWHEEL
199 - .clickwheel_get_state = clickwheel_get_state,
200 -#endif
201 -#ifdef HAVE_HWKEYAES
202 - .hwkeyaes = hwkeyaes,
203 -#endif
204 -#ifdef HAVE_HMACSHA1
205 - .hmacsha1 = hmacsha1,
206 -#endif
207 - .int_dma_set_handler = int_dma_set_handler,
208 - .thread_set_name = thread_set_name,
209 - .thread_set_priority = thread_set_priority,
210 - .malloc = malloc,
211 - .memalign = memalign,
212 - .realloc = realloc,
213 - .reownalloc = reownalloc,
214 - .free = free,
215 - .library_unload = library_unload,
216 - .get_library = get_library,
217 - .get_library_ext = get_library_ext,
218 - .release_library = release_library,
219 - .release_library_ext = release_library_ext,
220 -#ifdef HAVE_STORAGE
221 - .fat_enable_flushing = fat_enable_flushing,
222 -#endif
223 - .lcd_get_format = lcd_get_format,
224 - .crc32 = crc32,
225 - .clockgate_get_state = clockgate_get_state,
226 - .malloc_walk = malloc_walk
227 -};
 2+//
 3+//
 4+// Copyright 2010 TheSeven
 5+//
 6+//
 7+// This file is part of emCORE.
 8+//
 9+// emCORE is free software: you can redistribute it and/or
 10+// modify it under the terms of the GNU General Public License as
 11+// published by the Free Software Foundation, either version 2 of the
 12+// License, or (at your option) any later version.
 13+//
 14+// emCORE is distributed in the hope that it will be useful,
 15+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 16+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 17+// See the GNU General Public License for more details.
 18+//
 19+// You should have received a copy of the GNU General Public License along
 20+// with emCORE. If not, see <http://www.gnu.org/licenses/>.
 21+//
 22+//
 23+
 24+
 25+#include "global.h"
 26+#include "syscallapi.h"
 27+
 28+
 29+struct emcore_syscall_table syscall_table ICONST_ATTR =
 30+{
 31+ .table_version = EMCORE_API_VERSION,
 32+ .table_minversion = EMCORE_MIN_API_VERSION,
 33+#ifdef ARM_ARCH
 34+ .__clzsi2 = __clzsi2,
 35+ .__aeabi_idivmod = __aeabi_idivmod,
 36+ .__aeabi_uidivmod = __aeabi_uidivmod,
 37+#endif
 38+ .panic = panic,
 39+ .panicf = panicf,
 40+ .cprintf = cprintf,
 41+ .cvprintf = cvprintf,
 42+ .cputc = cputc,
 43+ .cputs = cputs,
 44+ .cwrite = cwrite,
 45+ .cflush = cflush,
 46+ .cgetc = cgetc,
 47+ .cread = cread,
 48+ .creada = creada,
 49+ .format = format,
 50+ .vuprintf = vuprintf,
 51+ .shutdown = shutdown,
 52+ .strcasecmp = strcasecmp,
 53+ .strncasecmp = strncasecmp,
 54+ .strcasestr = strcasestr,
 55+ .strlcat = strlcat,
 56+ .strlcpy = strlcpy,
 57+ .mutex_init = mutex_init,
 58+ .mutex_lock = mutex_lock,
 59+ .mutex_unlock = mutex_unlock,
 60+ .wakeup_init = wakeup_init,
 61+ .wakeup_wait = wakeup_wait,
 62+ .wakeup_signal = wakeup_signal,
 63+ .sleep = sleep,
 64+ .thread_create = thread_create,
 65+ .thread_exit = thread_exit,
 66+ .thread_suspend = thread_suspend,
 67+ .thread_resume = thread_resume,
 68+ .thread_terminate = thread_terminate,
 69+ .__errno = __errno,
 70+ .ucl_decompress = ucl_decompress,
 71+ .read_native_timer = read_native_timer,
 72+ .read_usec_timer = read_usec_timer,
 73+ .i2c_send = i2c_send,
 74+ .i2c_recv = i2c_recv,
 75+ .i2c_sendbyte = i2c_sendbyte,
 76+ .i2c_recvbyte = i2c_recvbyte,
 77+ .interrupt_enable = interrupt_enable,
 78+ .interrupt_set_handler = interrupt_set_handler,
 79+ .int_timer_set_handler = int_timer_set_handler,
 80+ .clean_dcache = clean_dcache,
 81+ .invalidate_dcache = invalidate_dcache,
 82+ .invalidate_icache = invalidate_icache,
 83+ .power_off = power_off,
 84+ .charging_state = charging_state,
 85+ .atoi = atoi,
 86+ .memchr = memchr,
 87+ .memcmp = memcmp,
 88+ .memcpy = memcpy,
 89+ .memmove = memmove,
 90+ .memset = memset,
 91+ .qsort = qsort,
 92+ .srand = srand,
 93+ .rand = rand,
 94+ .snprintf = snprintf,
 95+ .vsnprintf = vsnprintf,
 96+ .sscanf = sscanf,
 97+ .strcat = strcat,
 98+ .strchr = strchr,
 99+ .strcmp = strcmp,
 100+ .strcpy = strcpy,
 101+ .strlen = strlen,
 102+ .strncmp = strncmp,
 103+ .strrchr = strrchr,
 104+ .strstr = strstr,
 105+ .strtok_r = strtok_r,
 106+ .get_platform_id = get_platform_id,
 107+ .tlsf_create = tlsf_create,
 108+ .tlsf_destroy = tlsf_destroy,
 109+ .tlsf_malloc = tlsf_malloc,
 110+ .tlsf_memalign = tlsf_memalign,
 111+ .tlsf_realloc = tlsf_realloc,
 112+ .tlsf_free = tlsf_free,
 113+ .tlsf_walk_heap = tlsf_walk_heap,
 114+ .tlsf_check_heap = tlsf_check_heap,
 115+ .tlsf_block_size = tlsf_block_size,
 116+ .tlsf_overhead = tlsf_overhead,
 117+ .execfirmware = execfirmware,
 118+ .clockgate_enable = clockgate_enable,
 119+ .yield = yield,
 120+ .reset = reset,
 121+ .execimage = execimage,
 122+#ifdef HAVE_STORAGE
 123+ .opendir = opendir,
 124+ .closedir = closedir,
 125+ .readdir = readdir,
 126+ .mkdir = mkdir,
 127+ .rmdir = rmdir,
 128+ .ftruncate = ftruncate,
 129+ .fsync = fsync,
 130+ .close = close,
 131+ .write = write,
 132+ .read = read,
 133+ .lseek = lseek,
 134+ .remove = remove,
 135+ .file_open = file_open,
 136+ .rename = rename,
 137+ .file_creat = file_creat,
 138+ .filesize = filesize,
 139+ .storage_read_sectors_md = storage_read_sectors_md,
 140+ .storage_write_sectors_md = storage_write_sectors_md,
 141+ .storage_get_info = storage_get_info,
 142+#ifdef HAVE_HOTSWAP
 143+ .disk_mount = disk_mount,
 144+ .disk_unmount = disk_unmount,
 145+#endif
 146+#endif
 147+#ifdef HAVE_LCD
 148+ .lcdconsole_putc_noblit = lcdconsole_putc_noblit,
 149+ .lcdconsole_puts_noblit = lcdconsole_puts_noblit,
 150+ .lcdconsole_write_noblit = lcdconsole_write_noblit,
 151+ .lcdconsole_update = lcdconsole_update,
 152+ .lcdconsole_putc = lcdconsole_putc,
 153+ .lcdconsole_puts = lcdconsole_puts,
 154+ .lcdconsole_write = lcdconsole_write,
 155+ .lcdconsole_get_current_x = lcdconsole_get_current_x,
 156+ .lcdconsole_get_current_y = lcdconsole_get_current_y,
 157+ .lcdconsole_get_lineend_x = lcdconsole_get_lineend_x,
 158+ .lcdconsole_get_lineend_y = lcdconsole_get_lineend_y,
 159+ .lcdconsole_progressbar = lcdconsole_progressbar,
 160+ .progressbar_init = progressbar_init,
 161+ .progressbar_setpos = progressbar_setpos,
 162+ .displaylcd = displaylcd,
 163+ .filllcd = filllcd,
 164+ .displaylcd_native = displaylcd_native,
 165+ .filllcd_native = filllcd_native,
 166+ .displaylcd_sync = displaylcd_sync,
 167+ .displaylcd_busy = displaylcd_busy,
 168+ .displaylcd_safe = displaylcd_safe,
 169+ .lcd_get_width = lcd_get_width,
 170+ .lcd_get_height = lcd_get_height,
 171+ .lcd_get_bytes_per_pixel = lcd_get_bytes_per_pixel,
 172+ .lcd_translate_color = lcd_translate_color,
 173+ .renderchar_native = renderchar_native,
 174+ .renderchar = renderchar,
 175+ .rendertext = rendertext,
 176+ .get_font_width = get_font_width,
 177+ .get_font_height = get_font_height,
 178+#endif
 179+#ifdef HAVE_BACKLIGHT
 180+ .backlight_on = backlight_on,
 181+ .backlight_set_fade = backlight_set_fade,
 182+ .backlight_set_brightness = backlight_set_brightness,
 183+#endif
 184+#ifdef HAVE_BOOTFLASH
 185+ .bootflash_filesize = bootflash_filesize,
 186+ .bootflash_attributes = bootflash_attributes,
 187+ .bootflash_getaddr = bootflash_getaddr,
 188+ .bootflash_read = bootflash_read,
 189+ .bootflash_readraw = bootflash_readraw,
 190+ .bootflash_writeraw = bootflash_writeraw,
 191+ .bootflash_getrawaddr = bootflash_getrawaddr,
 192+ .bootflash_is_memmapped = bootflash_is_memmapped,
 193+#endif
 194+#ifdef HAVE_BUTTON
 195+ .button_register_handler = button_register_handler,
 196+ .button_unregister_handler = button_unregister_handler,
 197+#endif
 198+#ifdef HAVE_CLICKWHEEL
 199+ .clickwheel_get_state = clickwheel_get_state,
 200+#endif
 201+#ifdef HAVE_HWKEYAES
 202+ .hwkeyaes = hwkeyaes,
 203+#endif
 204+#ifdef HAVE_HMACSHA1
 205+ .hmacsha1 = hmacsha1,
 206+#endif
 207+ .int_dma_set_handler = int_dma_set_handler,
 208+ .thread_set_name = thread_set_name,
 209+ .thread_set_priority = thread_set_priority,
 210+ .malloc = malloc,
 211+ .memalign = memalign,
 212+ .realloc = realloc,
 213+ .reownalloc = reownalloc,
 214+ .free = free,
 215+ .library_unload = library_unload,
 216+ .get_library = get_library,
 217+ .get_library_ext = get_library_ext,
 218+ .release_library = release_library,
 219+ .release_library_ext = release_library_ext,
 220+#ifdef HAVE_STORAGE
 221+ .fat_enable_flushing = fat_enable_flushing,
 222+#endif
 223+ .lcd_get_format = lcd_get_format,
 224+ .crc32 = crc32,
 225+ .clockgate_get_state = clockgate_get_state,
 226+ .malloc_walk = malloc_walk,
 227+#ifdef HAVE_STORAGE
 228+ .storage_sleep = storage_sleep,
 229+ .storage_disk_is_active = storage_disk_is_active,
 230+ .storage_soft_reset = storage_soft_reset,
 231+#ifdef HAVE_STORAGE_FLUSH
 232+ .storage_flush = storage_flush,
 233+#endif
 234+ .storage_spin = storage_spin,
 235+ .storage_spindown = storage_spindown,
 236+ .storage_last_disk_activity = storage_last_disk_activity,
 237+ .storage_num_drives = storage_num_drives,
 238+#endif
 239+ .read_battery_voltage = read_battery_voltage,
 240+ .read_battery_current = read_battery_current,
 241+ .read_battery_mwh_design = read_battery_mwh_design,
 242+ .read_battery_mwh_full = read_battery_mwh_full,
 243+ .read_battery_mwh_current = read_battery_mwh_current,
 244+ .read_battery_mw = read_battery_mw,
 245+ .read_input_mw = read_input_mw,
 246+ .read_battery_state = read_battery_state
 247+};