summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-09-08 12:20:53 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-09-08 12:20:53 +0000
commitf64ebb1c1f10e8d15fcc4879d781703c86c5fb8b (patch)
tree065072709c699ac6dc3eb640368bd3f4106144e4 /apps
parent69b4654ea28049c7e8637d521327ba10ae405f8b (diff)
downloadrockbox-f64ebb1c1f10e8d15fcc4879d781703c86c5fb8b.tar.gz
rockbox-f64ebb1c1f10e8d15fcc4879d781703c86c5fb8b.zip
Sim I/O and threading that runs more like on target. Tweakable if any genuine slowness imitation is required for any one of them. One point of concern is the sim shutdown on an OS other than Linux just because terminating threads in a manner other than having the do it themselves is kind of dirty IMHO.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14639 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c4
-rw-r--r--apps/plugin.c4
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/plugins/doom/rockmacros.h8
-rw-r--r--apps/plugins/rockboy/rockmacros.h8
5 files changed, 16 insertions, 12 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index f8492d34b6..d5c0b8171d 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -181,7 +181,6 @@ static bool dbg_list(struct action_callback_info *info)
181extern struct thread_entry threads[MAXTHREADS]; 181extern struct thread_entry threads[MAXTHREADS];
182 182
183 183
184#ifndef SIMULATOR
185static char thread_status_char(int status) 184static char thread_status_char(int status)
186{ 185{
187 switch (status) 186 switch (status)
@@ -256,7 +255,6 @@ static bool dbg_os(void)
256 info.dbg_getname = threads_getname; 255 info.dbg_getname = threads_getname;
257 return dbg_list(&info); 256 return dbg_list(&info);
258} 257}
259#endif /* !SIMULATOR */
260 258
261#ifdef HAVE_LCD_BITMAP 259#ifdef HAVE_LCD_BITMAP
262#if CONFIG_CODEC != SWCODEC 260#if CONFIG_CODEC != SWCODEC
@@ -2270,9 +2268,7 @@ static const struct the_menu_item menuitems[] = {
2270#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) 2268#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE)
2271 { "Catch mem accesses", dbg_set_memory_guard }, 2269 { "Catch mem accesses", dbg_set_memory_guard },
2272#endif 2270#endif
2273#ifndef SIMULATOR
2274 { "View OS stacks", dbg_os }, 2271 { "View OS stacks", dbg_os },
2275#endif
2276#ifdef HAVE_LCD_BITMAP 2272#ifdef HAVE_LCD_BITMAP
2277#ifndef SIMULATOR 2273#ifndef SIMULATOR
2278 { "View battery", view_battery }, 2274 { "View battery", view_battery },
diff --git a/apps/plugin.c b/apps/plugin.c
index 9d46ea4510..bdb59e6005 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -209,10 +209,10 @@ static const struct plugin_api rockbox_api = {
209 /* file */ 209 /* file */
210 (open_func)PREFIX(open), 210 (open_func)PREFIX(open),
211 close, 211 close,
212 (read_func)read, 212 (read_func)PREFIX(read),
213 PREFIX(lseek), 213 PREFIX(lseek),
214 (creat_func)PREFIX(creat), 214 (creat_func)PREFIX(creat),
215 (write_func)write, 215 (write_func)PREFIX(write),
216 PREFIX(remove), 216 PREFIX(remove),
217 PREFIX(rename), 217 PREFIX(rename),
218 PREFIX(ftruncate), 218 PREFIX(ftruncate),
diff --git a/apps/plugin.h b/apps/plugin.h
index c3e5a5b714..2580d43eb0 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -296,10 +296,10 @@ struct plugin_api {
296 /* file */ 296 /* file */
297 int (*PREFIX(open))(const char* pathname, int flags); 297 int (*PREFIX(open))(const char* pathname, int flags);
298 int (*close)(int fd); 298 int (*close)(int fd);
299 ssize_t (*read)(int fd, void* buf, size_t count); 299 ssize_t (*PREFIX(read))(int fd, void* buf, size_t count);
300 off_t (*PREFIX(lseek))(int fd, off_t offset, int whence); 300 off_t (*PREFIX(lseek))(int fd, off_t offset, int whence);
301 int (*PREFIX(creat))(const char *pathname); 301 int (*PREFIX(creat))(const char *pathname);
302 ssize_t (*write)(int fd, const void* buf, size_t count); 302 ssize_t (*PREFIX(write))(int fd, const void* buf, size_t count);
303 int (*PREFIX(remove))(const char* pathname); 303 int (*PREFIX(remove))(const char* pathname);
304 int (*PREFIX(rename))(const char* path, const char* newname); 304 int (*PREFIX(rename))(const char* path, const char* newname);
305 int (*PREFIX(ftruncate))(int fd, off_t length); 305 int (*PREFIX(ftruncate))(int fd, off_t length);
diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h
index 1541ef48fd..b73c965c92 100644
--- a/apps/plugins/doom/rockmacros.h
+++ b/apps/plugins/doom/rockmacros.h
@@ -43,20 +43,24 @@ char *my_strtok( char * s, const char * delim );
43#undef open 43#undef open
44#undef lseek 44#undef lseek
45#undef filesize 45#undef filesize
46#undef read
47#undef write
46#define open(a,b) rb->sim_open((a),(b)) 48#define open(a,b) rb->sim_open((a),(b))
47#define lseek(a,b,c) rb->sim_lseek((a),(b),(c)) 49#define lseek(a,b,c) rb->sim_lseek((a),(b),(c))
48#define filesize(a) rb->sim_filesize((a)) 50#define filesize(a) rb->sim_filesize((a))
51#define read(a,b,c) rb->sim_read((a),(b),(c))
52#define write(a,b,c) rb->sim_write((a),(b),(c))
49#else /* !SIMULATOR */ 53#else /* !SIMULATOR */
50#define open(a,b) my_open((a),(b)) 54#define open(a,b) my_open((a),(b))
51#define close(a) my_close((a)) 55#define close(a) my_close((a))
52#define lseek(a,b,c) rb->lseek((a),(b),(c)) 56#define lseek(a,b,c) rb->lseek((a),(b),(c))
53#define filesize(a) rb->filesize((a)) 57#define filesize(a) rb->filesize((a))
58#define read(a,b,c) rb->read((a),(b),(c))
59#define write(a,b,c) rb->write((a),(b),(c))
54#endif /* !SIMULATOR */ 60#endif /* !SIMULATOR */
55 61
56#define strtok(a,b) my_strtok((a),(b)) 62#define strtok(a,b) my_strtok((a),(b))
57#define strcat(a,b) rb->strcat((a),(b)) 63#define strcat(a,b) rb->strcat((a),(b))
58#define read(a,b,c) rb->read((a),(b),(c))
59#define write(a,b,c) rb->write((a),(b),(c))
60#define memset(a,b,c) rb->memset((a),(b),(c)) 64#define memset(a,b,c) rb->memset((a),(b),(c))
61#define memmove(a,b,c) rb->memmove((a),(b),(c)) 65#define memmove(a,b,c) rb->memmove((a),(b),(c))
62#define memcmp(a,b,c) rb->memcmp((a),(b),(c)) 66#define memcmp(a,b,c) rb->memcmp((a),(b),(c))
diff --git a/apps/plugins/rockboy/rockmacros.h b/apps/plugins/rockboy/rockmacros.h
index f5223b01df..83b599897e 100644
--- a/apps/plugins/rockboy/rockmacros.h
+++ b/apps/plugins/rockboy/rockmacros.h
@@ -76,15 +76,19 @@ void dynamic_recompile (struct dynarec_block *newblock);
76#define lseek(a,b,c) rb->sim_lseek((a),(b),(c)) 76#define lseek(a,b,c) rb->sim_lseek((a),(b),(c))
77#undef close 77#undef close
78#define close(a) rb->close((a)) 78#define close(a) rb->close((a))
79#undef read
80#define read(a,b,c) rb->sim_read((a),(b),(c))
81#undef write
82#define write(a,b,c) rb->sim_write((a),(b),(c))
79#else /* !SIMULATOR */ 83#else /* !SIMULATOR */
80#define open(a,b) rb->open((a),(b)) 84#define open(a,b) rb->open((a),(b))
81#define lseek(a,b,c) rb->lseek((a),(b),(c)) 85#define lseek(a,b,c) rb->lseek((a),(b),(c))
82#define close(a) rb->close((a)) 86#define close(a) rb->close((a))
87#define read(a,b,c) rb->read((a),(b),(c))
88#define write(a,b,c) rb->write((a),(b),(c))
83#endif /* !SIMULATOR */ 89#endif /* !SIMULATOR */
84 90
85#define strcat(a,b) rb->strcat((a),(b)) 91#define strcat(a,b) rb->strcat((a),(b))
86#define read(a,b,c) rb->read((a),(b),(c))
87#define write(a,b,c) rb->write((a),(b),(c))
88#define memset(a,b,c) rb->memset((a),(b),(c)) 92#define memset(a,b,c) rb->memset((a),(b),(c))
89#define strcpy(a,b) rb->strcpy((a),(b)) 93#define strcpy(a,b) rb->strcpy((a),(b))
90#define strncpy(a,b,c) rb->strncpy((a),(b),(c)) 94#define strncpy(a,b,c) rb->strncpy((a),(b),(c))