summaryrefslogtreecommitdiff
path: root/firmware/common/rbpaths.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-12-24 11:56:46 +0000
committerThomas Martitz <kugel@rockbox.org>2011-12-24 11:56:46 +0000
commit249bba03f1051f4984538f66b9e7d36674c61e5c (patch)
treeb9a0d78e05269ed2043521ab0dfdad83aeaf2aff /firmware/common/rbpaths.c
parent567e0ad93ef3048f2266932b10dcdb309b1a77c9 (diff)
downloadrockbox-249bba03f1051f4984538f66b9e7d36674c61e5c.tar.gz
rockbox-249bba03f1051f4984538f66b9e7d36674c61e5c.zip
Initial commit of the Samsung YP-R0 port.
This port is a hybrid native/RaaA port. It runs on a embedded linux system, but is the only application. It therefore can implement lots of stuff that native targets also implement, while leveraging the underlying linux kernel. The port is quite advanced. User interface, audio playback, plugins work mostly fine. Missing is e.g. power mangement and USB (see SamsungYPR0 wiki page). Included in utils/ypr0tools are scripts and programs required to generate a patched firmware. The patched firmware has the rootfs modified to load Rockbox. It includes a early/safe USB mode. This port needs a new toolchain, one that includes glibc headers and libraries. rockboxdev.sh can generate it, but e.g. codesourcey and distro packages may also work. Most of the initial effort is done by Lorenzo Miori and others (on ABI), including reverse engineering and patching of the original firmware, initial drivers, and more. Big thanks to you. Flyspray: FS#12348 Author: Lorenzo Miori, myself Merry christmas to ypr0 owners! :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31415 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common/rbpaths.c')
-rw-r--r--firmware/common/rbpaths.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/firmware/common/rbpaths.c b/firmware/common/rbpaths.c
index ed413eb03e..95bff3341f 100644
--- a/firmware/common/rbpaths.c
+++ b/firmware/common/rbpaths.c
@@ -23,6 +23,7 @@
23#include <stdio.h> /* snprintf */ 23#include <stdio.h> /* snprintf */
24#include <stdlib.h> 24#include <stdlib.h>
25#include <stdarg.h> 25#include <stdarg.h>
26#include "config.h"
26#include "rbpaths.h" 27#include "rbpaths.h"
27#include "file.h" /* MAX_PATH */ 28#include "file.h" /* MAX_PATH */
28#include "logf.h" 29#include "logf.h"
@@ -38,11 +39,17 @@
38#undef mkdir 39#undef mkdir
39#undef rmdir 40#undef rmdir
40 41
42
41#if (CONFIG_PLATFORM & PLATFORM_ANDROID) 43#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
42#include "dir-target.h" 44#include "dir-target.h"
43#define opendir opendir_android 45#define opendir opendir_android
44#define mkdir mkdir_android 46#define mkdir mkdir_android
45#define rmdir rmdir_android 47#define rmdir rmdir_android
48#elif defined(SAMSUNG_YPR0)
49#include "dir-target.h"
50#define opendir opendir_ypr0
51#define mkdir mkdir_ypr0
52#define rmdir rmdir_ypr0
46#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) 53#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
47#define open sim_open 54#define open sim_open
48#define remove sim_remove 55#define remove sim_remove
@@ -59,6 +66,8 @@ extern int sim_rmdir(const char* name);
59const char *rbhome; 66const char *rbhome;
60#endif 67#endif
61 68
69#if !defined(SAMSUNG_YPR0)
70
62/* flags for get_user_file_path() */ 71/* flags for get_user_file_path() */
63/* whether you need write access to that file/dir, especially true 72/* whether you need write access to that file/dir, especially true
64 * for runtime generated files (config.cfg) */ 73 * for runtime generated files (config.cfg) */
@@ -238,3 +247,28 @@ int app_rmdir(const char* name)
238 } 247 }
239 return rmdir(fname); 248 return rmdir(fname);
240} 249}
250
251#else
252
253int app_open(const char *name, int o, ...)
254{
255 if (o & O_CREAT)
256 {
257 int ret;
258 va_list ap;
259 va_start(ap, o);
260 ret = open(name, o, va_arg(ap, mode_t));
261 va_end(ap);
262 return ret;
263 }
264 return open(name, o);
265}
266
267int app_creat(const char* name, mode_t mode) { return creat(name, mode); }
268int app_remove(const char *name) { return remove(name); }
269int app_rename(const char *old, const char *new) { return rename(old,new); }
270DIR *app_opendir(const char *name) { return opendir(name); }
271int app_mkdir(const char* name) { return mkdir(name); }
272int app_rmdir(const char* name) { return rmdir(name); }
273
274#endif