From 95819727ebf8fe66ebdf0384f098d6790ecc2cd2 Mon Sep 17 00:00:00 2001 From: Michiel Van Der Kolk Date: Thu, 3 Mar 2005 13:50:09 +0000 Subject: Functions and data into iram mode for iriver, seems faster. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6112 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/rockboy/cpu.c | 2 +- apps/plugins/rockboy/cpu.h | 4 ++-- apps/plugins/rockboy/lcd.c | 2 +- apps/plugins/rockboy/lcd.h | 2 +- apps/plugins/rockboy/rockboy.c | 9 +++++++++ apps/plugins/rockboy/rockmacros.h | 10 ++++++++++ 6 files changed, 24 insertions(+), 5 deletions(-) (limited to 'apps/plugins') diff --git a/apps/plugins/rockboy/cpu.c b/apps/plugins/rockboy/cpu.c index 44a870a6eb..d4831e813f 100644 --- a/apps/plugins/rockboy/cpu.c +++ b/apps/plugins/rockboy/cpu.c @@ -17,7 +17,7 @@ #endif -struct cpu cpu; +struct cpu cpu IDATA_ATTR; diff --git a/apps/plugins/rockboy/cpu.h b/apps/plugins/rockboy/cpu.h index 22d58b0db0..eab4979cc6 100644 --- a/apps/plugins/rockboy/cpu.h +++ b/apps/plugins/rockboy/cpu.h @@ -35,7 +35,7 @@ void timer_advance(int cnt); void lcdc_advance(int cnt); void sound_advance(int cnt); void cpu_timers(int cnt); -int cpu_emulate(int cycles); - +int cpu_emulate(int cycles) ICODE_ATTR; +int cpu_step(int max) ICODE_ATTR; #endif diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c index 6351cb93ed..8cb1b7a319 100644 --- a/apps/plugins/rockboy/lcd.c +++ b/apps/plugins/rockboy/lcd.c @@ -16,7 +16,7 @@ struct lcd lcd; -struct scan scan; +struct scan scan IDATA_ATTR; #define BG (scan.bg) #define WND (scan.wnd) diff --git a/apps/plugins/rockboy/lcd.h b/apps/plugins/rockboy/lcd.h index 9442b56cf0..4911f857de 100644 --- a/apps/plugins/rockboy/lcd.h +++ b/apps/plugins/rockboy/lcd.h @@ -55,7 +55,7 @@ extern struct scan scan; -void updatepatpix(void); +void updatepatpix(void) ICODE_ATTR; void tilebuf(void); void bg_scan(void); void wnd_scan(void); diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index c9788e2438..ca48fc2b1a 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -38,6 +38,12 @@ const struct { }; #endif +#ifdef USE_IRAM +extern char iramcopy[]; +extern char iramstart[]; +extern char iramend[]; +#endif + /* here is a global api struct pointer. while not strictly necessary, it's nice not to have to pass the api pointer in all function calls in the plugin */ @@ -114,6 +120,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) /* if you are using a global api pointer, don't forget to copy it! otherwise you will get lovely "I04: IllInstr" errors... :-) */ rb = api; +#ifdef USE_IRAM + memcpy(iramstart, iramcopy, iramend-iramstart); +#endif shut=0; cleanshut=0; mp3_bufferbase=mp3_bufferpointer=0; diff --git a/apps/plugins/rockboy/rockmacros.h b/apps/plugins/rockboy/rockmacros.h index 63f9b106e9..6cc05237f2 100644 --- a/apps/plugins/rockboy/rockmacros.h +++ b/apps/plugins/rockboy/rockmacros.h @@ -57,12 +57,22 @@ void ev_poll(void); #define open(a,b) rb->sim_open((a),(b)) #undef lseek #define lseek(a,b,c) rb->sim_lseek((a),(b),(c)) +#define ICODE_ATTR +#define IDATA_ATTR #else /* !SIMULATOR */ #define opendir(a) rb->opendir((a)) #define closedir(a) rb->closedir((a)) #define mkdir(a,b) rb->mkdir((a),(b)) #define open(a,b) rb->open((a),(b)) #define lseek(a,b,c) rb->lseek((a),(b),(c)) +#if CONFIG_KEYPAD == IRIVER_H100_PAD +#define ICODE_ATTR __attribute__ ((section(".icode"))) +#define IDATA_ATTR __attribute__ ((section(".idata"))) +#define USE_IRAM 1 +#else +#define ICODE_ATTR +#define IDATA_ATTR +#endif #endif /* !SIMULATOR */ #define strcat(a,b) rb->strcat((a),(b)) -- cgit v1.2.3