summaryrefslogtreecommitdiffstats
path: root/firmware/load_code.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-02-09 20:27:23 +0000
committerThomas Martitz <kugel@rockbox.org>2011-02-09 20:27:23 +0000
commit86cab2e27a0d9f831b39032fd713945659277903 (patch)
tree0ca92955c766098facfa3fa38007022ff8a550a8 /firmware/load_code.c
parent82eec87dd65442c2a7e134dcb89ffc6d07fe5a4b (diff)
downloadrockbox-86cab2e27a0d9f831b39032fd713945659277903.tar.gz
rockbox-86cab2e27a0d9f831b39032fd713945659277903.tar.bz2
rockbox-86cab2e27a0d9f831b39032fd713945659277903.zip
Disable buffering codecs (and code generally) on RaaA.
It's not useful to do it since you need to write back the code to disk to be able to load it from memory, it also requires writing to an executable directory. Keep it for the simulator for the sake of simulating. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29261 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/load_code.c')
-rw-r--r--firmware/load_code.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/firmware/load_code.c b/firmware/load_code.c
index 2337ee5cad..59eb7ac0f7 100644
--- a/firmware/load_code.c
+++ b/firmware/load_code.c
@@ -134,6 +134,16 @@ void * _lc_open(const _lc_open_char *filename, unsigned char *buf, size_t buf_si
void *lc_open_from_mem(void *addr, size_t blob_size)
{
+#ifndef SIMULATOR
+ (void)addr;
+ (void)blob_size;
+ /* we don't support loading code from memory on application builds,
+ * it doesn't make sense (since it means writing the blob to disk again and
+ * then falling back to load from disk) and requires the ability to write
+ * to an executable directory */
+ return NULL;
+#else
+ /* support it in the sim for the sake of simulating */
int fd, i;
char temp_filename[MAX_PATH];
@@ -143,17 +153,8 @@ void *lc_open_from_mem(void *addr, size_t blob_size)
to find an unused filename */
for (i = 0; i < 10; i++)
{
-#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
- /* we need that path fixed, since _get_user_file_path()
- * gives us the folder on the sdcard where we cannot load libraries
- * from (no exec permissions)
- */
- snprintf(temp_filename, sizeof(temp_filename),
- "/data/data/org.rockbox/app_rockbox/libtemp_binary_%d.so", i);
-#else
snprintf(temp_filename, sizeof(temp_filename),
ROCKBOX_DIR "/libtemp_binary_%d.dll", i);
-#endif
fd = open(temp_filename, O_WRONLY|O_CREAT|O_TRUNC, 0700);
if (fd >= 0)
break; /* Created a file ok */
@@ -175,6 +176,7 @@ void *lc_open_from_mem(void *addr, size_t blob_size)
close(fd);
return lc_open(temp_filename, NULL, 0);
+#endif
}