summaryrefslogtreecommitdiff
path: root/firmware/include/dircache.h
AgeCommit message (Collapse)Author
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-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-06-21Try to handle dircache rebuild event properly. Playlist should nowMiika Pekkarinen
cache new pointers to dircache items when dircache goes offline and comes back onlineagain (during tagcache commit). This should prevent wrong filenames to appear in playlist. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30047 a1c6a512-1295-4272-9138-f99709370657
2011-06-20Dircache: Don't expose struct dircache_entry and pointers into the cache, ↵Thomas Martitz
use IDs instead. Only integer IDs are exposed from dircache with this. This way the cache is isolated from other modules. This is needed for my buflib gsoc project. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30038 a1c6a512-1295-4272-9138-f99709370657
2011-06-20Dircache: Move struct maindata declaration to dircache.c and actually check ↵Thomas Martitz
for DIRCACHE_MAGIC when loading from disk. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30037 a1c6a512-1295-4272-9138-f99709370657
2011-06-20Dircache: Change internal cache layout.Thomas Martitz
The dircache_entry structs are now allocated subsequently from the front, allowing to treat them as an array. The d_names are allocated from the back (in reverse order, growing downwards). This allows the cache to be moved around (needed for my buflib gsoc project). It is utilized when loading the cache from disk (on the h100), now the pointer to the cache begin doesn't need to be the same across reboots anymore. This should save a bit memory usage, since there's no need for aligning padding bytes after d_names anymore. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30036 a1c6a512-1295-4272-9138-f99709370657
2011-06-20Dircache: Return the size of the result string in dircache_copy_path() so ↵Thomas Martitz
that callers don't need to call strlen on it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30034 a1c6a512-1295-4272-9138-f99709370657
2011-06-20Dircache: Remove dircache_entry::name_len.Thomas Martitz
It's reduntant, and enlarges the dircache unnecessarily. Saves 4 byte per file in the whole filesystem. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30032 a1c6a512-1295-4272-9138-f99709370657
2010-09-01struct DIR -> DIR, should fix most if not all reds.Thomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27970 a1c6a512-1295-4272-9138-f99709370657
2010-09-01Ged rid of uisimulator/common/io.c for android builds.Thomas Martitz
Use host's functions for file i/o directly (open(), close() ,etc.), not the sim_* variants. Some dir functions need to be wrapped still because we need to cache the parents dir's path (host's dirent doesn't let us know). For the same reason (incompatibility) with host's dirent) detach some members from Rockbox' dirent struct and put it into an extra one, the values can be retrieved via the new dir_get_info(). Get rid of the sim_ prefix for sleep as well and change the signature to unix sleep(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27968 a1c6a512-1295-4272-9138-f99709370657
2010-08-01Rockbox as an application: add get_user_file_path().Thomas Martitz
For RaaA it evaluates user paths at runtime. For everything but codecs/plugins it will give the path under $HOME/.config/rockbox.org if write access is needed or if the file/folder in question exists there (otherwise it gives /usr/local/share/rockbox). This allows for installing themes under $HOME as well as having config.cfg and other important files there while installing the application (and default themes) under /usr/local. On the DAPs it's a no-op, returing /.rockbox directly. Not converted to use get_user_file_path() are plugins themselves, because RaaA doesn't build plugins yet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27656 a1c6a512-1295-4272-9138-f99709370657
2010-06-21Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with ↵Thomas Martitz
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently). The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR). The new define is to (de-)select code to compile on hosted platforms generally. Should be no functional change to targets or the simulator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
2010-03-03FS#10756 - Free unused init codeThomas Martitz
Introduce a new .init section for initialisation code, so that it can be copied to an area which is later overwritten before calling. The stack/bss can then overwrite that code, effectively freeing the code size that the initialisation routines need. Gives a few kB ram usage back. Only implemented for PP and as3525 so far. More targets could be added, as well as more functions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25013 a1c6a512-1295-4272-9138-f99709370657
2010-02-16Remove obsolete comment.Amaury Pouly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24711 a1c6a512-1295-4272-9138-f99709370657
2010-02-16-Cosmetic change in a comparisonAmaury Pouly
-Move fat_dir structure out of dircache stack to RAM. Reduce dircache stack size (max level depth should stay be around 20). This should fix nano2g dircache stkov of FS#10679 -Change the structure returned by readdir_cached to match the one returned by readdir_uncached: remove useless fields to save space and avoid any potential incoherence -Remove one field from the internal structure used by {opend,read,close}dir_cached because it was mostly redundant. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24708 a1c6a512-1295-4272-9138-f99709370657
2008-11-24Added support for configurable rockbox directory. FS#9567 by Alex Bennee.Björn Stenberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19208 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-01-13Always check for deleted files, no matter how slow it might be when DB ↵Miika Pekkarinen
autoupdate is enabled. Also simplified code a bit. Fixed a crash when search is performaed and dircache has been vanished and DB is still exists ram. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16081 a1c6a512-1295-4272-9138-f99709370657
2007-09-02Fix FS#7679 - modifying files with dircahce enabled doesnt change the access ↵Jonathan Gordon
time/date in dircache git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14580 a1c6a512-1295-4272-9138-f99709370657
2007-07-20Makes apps and plugins interract with directories using a posix-like api ↵Kevin Ferrare
instead of calling dircache / simulator functions (no additionnal layer added, only a cosmetic change) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13943 a1c6a512-1295-4272-9138-f99709370657
2006-12-22Try to make sure dircache state file on flashed H1xx targets isMiika Pekkarinen
handled correctly and no old state is never used. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11833 a1c6a512-1295-4272-9138-f99709370657
2006-11-10Support building tagcache db natively on PC using the core of theMiika Pekkarinen
Rockbox tagcache database engine. Only host endian support at the moment and no command line parameters. Mainly for developers for debugging at the moment. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11497 a1c6a512-1295-4272-9138-f99709370657
2006-07-10Tagcache update: Support removal of entries and no longer the need forMiika Pekkarinen
dircache to load tagcache in ram (however, dircache with tagcache is still strongly recommended). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10192 a1c6a512-1295-4272-9138-f99709370657
2006-04-16Commit tagcache in background when possible (at least dircache enabled).Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9686 a1c6a512-1295-4272-9138-f99709370657
2006-03-30Dircache support for simulator also.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9365 a1c6a512-1295-4272-9138-f99709370657
2006-03-29More safety checks to dircache to block updates until cache is ready.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9339 a1c6a512-1295-4272-9138-f99709370657
2006-03-28Boost open() performance on platforms with dircache. Tagcache initialMiika Pekkarinen
scanning now over 50% faster than before. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9306 a1c6a512-1295-4272-9138-f99709370657
2006-02-28Implement . and .. path in dircache to properly support moving filesMiika Pekkarinen
to other directories without absolute destination path provided. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8866 a1c6a512-1295-4272-9138-f99709370657
2006-01-31Now dircache should work on players requiring long aligned memoryMiika Pekkarinen
accesses. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8502 a1c6a512-1295-4272-9138-f99709370657
2005-11-26Fix yellow builds :/Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8073 a1c6a512-1295-4272-9138-f99709370657
2005-11-26Debug menu entry for the dircache.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8071 a1c6a512-1295-4272-9138-f99709370657
2005-11-19User now receives a message if initial directory cache initializationMiika Pekkarinen
fails. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7988 a1c6a512-1295-4272-9138-f99709370657
2005-11-17Added dircache support to playlist. Now playlist filename pointers areMiika Pekkarinen
automatically accuired from dircache. WPS UI response with dircache enabled should be instant. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7931 a1c6a512-1295-4272-9138-f99709370657
2005-10-07Implemented directory caching. No more waiting for disk to spin up whileMiika Pekkarinen
browsing when cache is enabled (system -> disk -> enable directory cache). Cache building on boot is transparent except the first boot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7588 a1c6a512-1295-4272-9138-f99709370657