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.zip
rockbox-f64ebb1c1f10e8d15fcc4879d781703c86c5fb8b.tar.gz
rockbox-f64ebb1c1f10e8d15fcc4879d781703c86c5fb8b.tar.bz2
rockbox-f64ebb1c1f10e8d15fcc4879d781703c86c5fb8b.tar.xz
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 f8492d3..d5c0b81 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -181,7 +181,6 @@ static bool dbg_list(struct action_callback_info *info)
extern struct thread_entry threads[MAXTHREADS];
-#ifndef SIMULATOR
static char thread_status_char(int status)
{
switch (status)
@@ -256,7 +255,6 @@ static bool dbg_os(void)
info.dbg_getname = threads_getname;
return dbg_list(&info);
}
-#endif /* !SIMULATOR */
#ifdef HAVE_LCD_BITMAP
#if CONFIG_CODEC != SWCODEC
@@ -2270,9 +2268,7 @@ static const struct the_menu_item menuitems[] = {
#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE)
{ "Catch mem accesses", dbg_set_memory_guard },
#endif
-#ifndef SIMULATOR
{ "View OS stacks", dbg_os },
-#endif
#ifdef HAVE_LCD_BITMAP
#ifndef SIMULATOR
{ "View battery", view_battery },
diff --git a/apps/plugin.c b/apps/plugin.c
index 9d46ea4..bdb59e6 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -209,10 +209,10 @@ static const struct plugin_api rockbox_api = {
/* file */
(open_func)PREFIX(open),
close,
- (read_func)read,
+ (read_func)PREFIX(read),
PREFIX(lseek),
(creat_func)PREFIX(creat),
- (write_func)write,
+ (write_func)PREFIX(write),
PREFIX(remove),
PREFIX(rename),
PREFIX(ftruncate),
diff --git a/apps/plugin.h b/apps/plugin.h
index c3e5a5b..2580d43 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -296,10 +296,10 @@ struct plugin_api {
/* file */
int (*PREFIX(open))(const char* pathname, int flags);
int (*close)(int fd);
- ssize_t (*read)(int fd, void* buf, size_t count);
+ ssize_t (*PREFIX(read))(int fd, void* buf, size_t count);
off_t (*PREFIX(lseek))(int fd, off_t offset, int whence);
int (*PREFIX(creat))(const char *pathname);
- ssize_t (*write)(int fd, const void* buf, size_t count);
+ ssize_t (*PREFIX(write))(int fd, const void* buf, size_t count);
int (*PREFIX(remove))(const char* pathname);
int (*PREFIX(rename))(const char* path, const char* newname);
int (*PREFIX(ftruncate))(int fd, off_t length);
diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h
index 1541ef4..b73c965 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 );
#undef open
#undef lseek
#undef filesize
+#undef read
+#undef write
#define open(a,b) rb->sim_open((a),(b))
#define lseek(a,b,c) rb->sim_lseek((a),(b),(c))
#define filesize(a) rb->sim_filesize((a))
+#define read(a,b,c) rb->sim_read((a),(b),(c))
+#define write(a,b,c) rb->sim_write((a),(b),(c))
#else /* !SIMULATOR */
#define open(a,b) my_open((a),(b))
#define close(a) my_close((a))
#define lseek(a,b,c) rb->lseek((a),(b),(c))
#define filesize(a) rb->filesize((a))
+#define read(a,b,c) rb->read((a),(b),(c))
+#define write(a,b,c) rb->write((a),(b),(c))
#endif /* !SIMULATOR */
#define strtok(a,b) my_strtok((a),(b))
#define strcat(a,b) rb->strcat((a),(b))
-#define read(a,b,c) rb->read((a),(b),(c))
-#define write(a,b,c) rb->write((a),(b),(c))
#define memset(a,b,c) rb->memset((a),(b),(c))
#define memmove(a,b,c) rb->memmove((a),(b),(c))
#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 f5223b0..83b5998 100644
--- a/apps/plugins/rockboy/rockmacros.h
+++ b/apps/plugins/rockboy/rockmacros.h
@@ -76,15 +76,19 @@ void dynamic_recompile (struct dynarec_block *newblock);
#define lseek(a,b,c) rb->sim_lseek((a),(b),(c))
#undef close
#define close(a) rb->close((a))
+#undef read
+#define read(a,b,c) rb->sim_read((a),(b),(c))
+#undef write
+#define write(a,b,c) rb->sim_write((a),(b),(c))
#else /* !SIMULATOR */
#define open(a,b) rb->open((a),(b))
#define lseek(a,b,c) rb->lseek((a),(b),(c))
#define close(a) rb->close((a))
+#define read(a,b,c) rb->read((a),(b),(c))
+#define write(a,b,c) rb->write((a),(b),(c))
#endif /* !SIMULATOR */
#define strcat(a,b) rb->strcat((a),(b))
-#define read(a,b,c) rb->read((a),(b),(c))
-#define write(a,b,c) rb->write((a),(b),(c))
#define memset(a,b,c) rb->memset((a),(b),(c))
#define strcpy(a,b) rb->strcpy((a),(b))
#define strncpy(a,b,c) rb->strncpy((a),(b),(c))