summaryrefslogtreecommitdiff
path: root/firmware/common
AgeCommit message (Collapse)Author
2014-02-28application(ypr0): Fix mount option selected by the current codepage.Thomas Martitz
A missing comma messed the lookup table up :'( Be aware that the kernel on the ypr0 doesn't support many codepages in which case its default (iso8859) will be used. Change-Id: Iaa4a4b8338fb047d29f6a4e2a80eba5c296d27ce
2014-02-26application: fix opendir() for "/" directory.Thomas Martitz
"/" couldn't be opened. This regression was introduced by 731072d. Trailing slash should not be stripped for the root directory. Change-Id: Idd2d9b1f33e7be789bcf432e586e6715eb4152f4
2014-02-25application: Remove trailing slashes from the input in opendir().Thomas Martitz
This is needed for readdir() and dir_get_info() to work properly because they depend on hash/path matching. Change-Id: Ibd23def10eebabd76cdddac2739a5274159e88a9
2014-02-24application: Speed up dir_get_info() further.Thomas Martitz
It's quite rare that it is called for a symlink to a directory. But it only needs a second syscall to stat() if that happened. Therefore speed up the common case by avoiding an unecessary second syscall. Change-Id: I911105f76631ebccc7696a1540e9cf069a706000
2014-02-24hosted/multidrive: Speed up readdir()/get_dir_info().Thomas Martitz
The two functions need to check whether they are called for a specific path to implement the virtual mount point for the external storage. This is statistically rare and a hit on the common case. Therefore speed up the common case by performing integer comparision first, and only expensive string construction and comparision if that succeeds. Change-Id: I3c41fe073e1f4f8eb62d2b8556a36937c9cb8290
2014-02-23samsungypr0: Support or mounting the microsdThomas Martitz
A thread polls the appropriate GPIO pin for sd card presence and mounts using the mount system call. Change-Id: I31ab41c4120f4af64eb6998b7e7b6f9051585efb
2014-02-23RaaA: Move directory related stuff from filesystem-unix.c into rbpaths.c.Thomas Martitz
Part of this change is to align sdlapp builds to other application targets in that the sim_* wrappers are not used anymore (except for sim_read/write). Path mangling is now done in rbpaths.c as well. Change-Id: I9726da73b50a83d9e1a1840288de16ec01ea029d
2014-02-23codepages: Translate to linux codepage names for use on APPLICATION.Thomas Martitz
The iocharset mount option names the codepages slightly differently and must be translated properly. Change-Id: I147a256e3453136282244201c27225a30cdfdca0
2014-02-05Samsung YP-R1 target portLorenzo Miori
This is the basic port to the new target Samsung YP-R1, which runs on a similar platform as YP-R0. Port is usable, although there are still some optimizations that have to be done. Change-Id: If83a8e386369e413581753780c159026d9e41f04
2014-01-16buflib: Add crc field protecting buflib cookie integrityMarcin Bukat
This should catch the case of buffer misuse which results in corrupted cookie of next allocation. The check is performed on move_block() so it may be a bit late. There is buflib_check_valid() provided which checks the integrity of all cookies for given context. On DEBUG build with --sdl-thread this check is carried out for core_ctx on every context switch to catch problems earlier. Change-Id: I999d4576084592394e3dbd3bdf0f32935ff5f601 Reviewed-on: http://gerrit.rockbox.org/711 Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2013-11-20Introduce volume_{present,removable} and fix invalid calls in apps/Amaury Pouly
The code was trying to probe for volume presence by calling drive layer with volume index. It is a miracle it get unnoticed so far. Introduce proper volume probing using the vol->drive map in the disk layer. Change-Id: I463a5bcc8170f007cad049536094207d2ba3c6fc Reviewed-on: http://gerrit.rockbox.org/669 Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-08-17Cleanup MV/MD macros a little.Michael Sevakis
When using variadic macros there's no need for IF_MD2/IF_MV2 to deal with function parameters. IF_MD/IF_MV are enough. Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0 if not. Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
2013-06-27Move load_firmware() to separate fileMarcin Bukat
The idea is to share loading code between bootloaders and rolo(). Change-Id: I1656ed91946d7a05cb7c9fa7a16793c3c862a5cd Reviewed-on: http://gerrit.rockbox.org/190 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-01-15fix yellow on simulator + multivolumeAmaury Pouly
Change-Id: Idc6d0e2e8fb06c2df4cac13ad7253b0b8628c308
2012-07-31Fix database tool.Thomas Martitz
It was also broken functionally, probably since a while.So restore the functionality. Run it on the dap, the tcd files will be placed into .rockbox folder. Change-Id: Id7a6ce4389dfaf99799258902be80d630af0601c
2012-05-19Add support for cp1252 (Western European) codepage.Dominik Riebeling
In Europe Windows defaults to its own codepage cp1252 (also known as "WinLatin" or "Windows-1252"). cp1252 adds some characters to ISO-8859-1. Some mp3 tagging software on Windows uses cp1252 instead of ISO-8859-1. This violates the ID3 specification, which requires tags to be ISO-8859-1 or Unicode. However, similar violations are made for other codepages and supported by Rockbox using the "Default Codepage" setting. Add support for cp1252 to enable people using such broken tools to override the correct decoding to get their tags displayed properly. Change-Id: I9f2ec478afe2503e99ee8e6609416c92b0f453e0 Reviewed-on: http://gerrit.rockbox.org/209 Reviewed-by: Jens Arnold <amiconn@rockbox.org> Tested-by: Jens Arnold <amiconn@rockbox.org>
2012-04-12Calculate day-of-week after reading time from RTC. Should fix FS#11814Bertrik Sikken
Change-Id: I31dc0b0db5272d16ae55790252e3963e1a91d5bb
2012-03-04Add RKW firmware file format loaderMarcin Bukat
Change-Id: I5283fdcdb8d263fd9375a6d29396f82650aeb686
2012-03-03Disable some more sim_ and app_ redirection for __PCTOOL__.Frank Gevaerts
This makes checkwps build again for apps Change-Id: I6fcd299076bd201053012d09e208a0845c2145e2
2012-02-10checkwps: Fix buildall.sh and some RaaA/ypr0 versions.Thomas Martitz
Change-Id: I5889743e94ed568c8f7dcc50de0b03b8421969f7
2012-01-22Move optimized ffs to firmware/asm, using the new automatic-asm-picking ↵Thomas Martitz
infrastructure. Change-Id: I5e7bdc8be7de50ef604c16078857fff1b84650dc
2012-01-22Move optimized memcpy and friends and strlen to firmware/asm,Thomas Martitz
using the new automatic-asm-picking infrastructure.
2012-01-21android/ypr0: Merge fs-*.c to generic filesystem-unix.c.Thomas Martitz
Change-Id: I52e2c29346baf0d282243880477cd149311ce3d1
2011-12-25rbpaths: Add new special dir HOME_DIR for RaaA.Thomas Martitz
HOME_DIR is intended for not-so-advanced files which shall be user visible, and thus not in /.rockbox. Therefore HOME_DIR is translated to $HOME on RaaA, /sdcard on android, the internal memory on ypr0 and "/" on native targets. ROCKBOX_DIR ("/.rockbox") already existed as special and is translated to whatever the real rockbox dir is on the target (e.g. /sdcard/rockbox on android), but it's not suitable for some files we generate (e.g. battery-bench.txt). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31430 a1c6a512-1295-4272-9138-f99709370657
2011-12-24Initial commit of the Samsung YP-R0 port.Thomas Martitz
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
2011-12-19disk: fix sector multiplier init, also remove a test which has became obsoleteAmaury Pouly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31356 a1c6a512-1295-4272-9138-f99709370657
2011-12-16Remove USB time sync code when there's no RTC.Boris Gjenero
Without an RTC, Rockbox doesn't keep time. In that situation, USB time sync previously did nothing but reported success. After this change, the USB time sync request won't be recognized on those targets. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31319 a1c6a512-1295-4272-9138-f99709370657
2011-12-15Remove conditional added around set_day_of_week in r31301.Boris Gjenero
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31305 a1c6a512-1295-4272-9138-f99709370657
2011-12-15Add conditionals around functions that are only needed when RTC is present.Boris Gjenero
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31301 a1c6a512-1295-4272-9138-f99709370657
2011-12-15Really fix redAmaury Pouly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31273 a1c6a512-1295-4272-9138-f99709370657
2011-12-15Fix redAmaury Pouly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31272 a1c6a512-1295-4272-9138-f99709370657
2011-12-15Add support for for per-drive logical sector size. This allows targets to ↵Amaury Pouly
have a different logical sector size for the internal storage and the sd card, like on the fuze+ for example. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31270 a1c6a512-1295-4272-9138-f99709370657
2011-12-05Try $RBROOT before $HOME when looking for the sdl apps rockbox root dirJonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31151 a1c6a512-1295-4272-9138-f99709370657
2011-12-04Compile fix for mingw-w64Rafaël Carré
Don't build str(n)casecmp as functions if they are already defined by preprocessor git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31147 a1c6a512-1295-4272-9138-f99709370657
2011-11-19Update some missed pointers when moving the dircache allocationFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31028 a1c6a512-1295-4272-9138-f99709370657
2011-11-17Simulate usb plugging on the sim better using sim_tasks.Thomas Martitz
Now all threads need to ack the connection like on real target, dircache is unloaded and playback stops accordingly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31009 a1c6a512-1295-4272-9138-f99709370657
2011-10-28Fix FS#12325 - screen corruption on early usb.Thomas Martitz
When booting with USB inserted, the dircache build can get interrupted by the usb connection, in which case the dircache buffer is freed. Due to a bug the re-creation of dircache used the old freed buffer and overwrite new allocs (causing screen corruption). Set allocated_size to 0 to make it not take the code path that assumes an existing buffer, and bring that and freeing together in the code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30845 a1c6a512-1295-4272-9138-f99709370657
2011-10-21fix sign errorFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30812 a1c6a512-1295-4272-9138-f99709370657
2011-10-02revert r30566 and r30567 to fix FS#12294 (superfloppy not mounting)Robert Kukla
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30632 a1c6a512-1295-4272-9138-f99709370657
2011-09-17Also remove the fat_partition_types array.Torne Wuff
If we aren't going to check for the partition type, we don't need the array of known FAT partition types. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30567 a1c6a512-1295-4272-9138-f99709370657
2011-09-17Allow any partition type, not just known FAT types.Torne Wuff
Instead of only mounting partitions with a FAT partition type, try any partition that isn't type 0 (unallocated) or 5 (extended). This makes it easier to reformat SDXC cards which have the exFAT partition type, and also brings us in line with pretty much every other OS at this point. Anything with a valid-looking FAT superblock will get mounted. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30566 a1c6a512-1295-4272-9138-f99709370657
2011-08-30Dircache: Allow dircache to be enabled without reboot.Thomas Martitz
Also add two dircache function, one of which does what dircache_disable() did previously as this now also frees the dircache buffer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30393 a1c6a512-1295-4272-9138-f99709370657
2011-08-30GSoC/Buflib: Enable compaction in buflib.Thomas Martitz
This enables the ability to allocate (and free) memory dynamically without fragmentation, through compaction. This means allocations can move and fragmentation be reduced. Most changes are preparing Rockbox for this, which many times means adding a move callback which can temporarily disable movement when the corresponding code is in a critical section. For now, the audio buffer allocation has a central role, because it's the one having allocated most. This buffer is able to shrink itself, for which it needs to stop playback for a very short moment. For this, audio_buffer_available() returns the size of the audio buffer which can possibly be used by other allocations because the audio buffer can shrink. lastfm scrobbling and timestretch can now be toggled at runtime without requiring a reboot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30381 a1c6a512-1295-4272-9138-f99709370657
2011-08-30GSoC/Buflib: Add buflib memory alocator to the core.Thomas Martitz
The buflib memory allocator is handle based and can free and compact, move or resize memory on demand. This allows to effeciently allocate memory dynamically without an MMU, by avoiding fragmentation through memory compaction. This patch adds the buflib library to the core, along with convinience wrappers to omit the context parameter. Compaction is not yet enabled, but will be in a later patch. Therefore, this acts as a replacement for buffer_alloc/buffer_get_buffer() with the benifit of a debug menu. See buflib.h for some API documentation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30380 a1c6a512-1295-4272-9138-f99709370657
2011-08-16Dircache: Fix memory leak (and recently panic).Thomas Martitz
If the dircache was interrupted during generation (e.g. through USB insertion), then the allocated buffer was leaked and a new one was allocated for the second cache generation. This causes a panic since r30308 since playback holds the control over the audiobuffer at that time. The fix is to simply check allocated_size instead of dircache_size which is reset to 0 upon cancellation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30321 a1c6a512-1295-4272-9138-f99709370657
2011-08-15Dircache: Fix bug introduced in r30308.Thomas Martitz
dircache_root wasn't initialized at all and the giving allocated_size passed to buffer_release_buffer() didn't account for alignment padding. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30318 a1c6a512-1295-4272-9138-f99709370657
2011-08-14GSoC/Buflib: Replace all direct accesses to audiobuf with buffer API functions.Thomas Martitz
Namely, introduce buffer_get_buffer() and buffer_release_buffer(). buffer_get_buffer() aquires all available and grabs a lock, attempting to call buffer_alloc() or buffer_get_buffer() while this lock is locked will cause a panicf() (doesn't actually happen, but is for debugging purpose). buffer_release_buffer() unlocks that lock and can additionally increment the audiobuf buffer to make an allocation. Pass 0 to only unlock if buffer was used temporarily only. buffer_available() is a replacement function to query audiobuflen, i.e. what's left in the buffer. Buffer init is moved up in the init chain and handles ipodvideo64mb internally. Further changes happened to mp3data.c and talk.c as to not call the above API functions, but get the buffer from callers. The caller is the audio system which has the buffer lock while mp3data.c and talk mess with the buffer. mpeg.c now implements some buffer related functions of playback.h, especially audio_get_buffer(), allowing to reduce #ifdef hell a tiny bit. audiobuf and audiobufend are local to buffer.c now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30308 a1c6a512-1295-4272-9138-f99709370657
2011-08-04format/*printf: Add simple support for %p format specifier.Thomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30249 a1c6a512-1295-4272-9138-f99709370657
2011-07-30Dircache: Fix 2 nasty bugs introduced with the reworks starting with r30032.Thomas Martitz
The first is an off-by-one that leads to miscalculation of the dircache size. The format string size was used but dircache size was incremented by the snprintf() result which is smaller. The other forgot to update the location of the "." and ".." strings upon compaction, so that new folders got assigned orphaned pointers for those directory entires. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30224 a1c6a512-1295-4272-9138-f99709370657
2011-07-18Revert "Introduce bsearch() and use it in tagtree.c."Thomas Martitz
It was committed by accident (it's on FS still). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30157 a1c6a512-1295-4272-9138-f99709370657