summaryrefslogtreecommitdiff
path: root/firmware/include
AgeCommit message (Collapse)Author
2011-11-29FS#12412 : Delete old buffer allocation code which has been replaced by ↵Boris Gjenero
core_alloc, and move buffer setup code to core_alloc.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31088 a1c6a512-1295-4272-9138-f99709370657
2011-10-22Finish r30818 revertFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30822 a1c6a512-1295-4272-9138-f99709370657
2011-10-21Change lru from double to single linked list. Only the font cache uses LRU ↵Fred Bauer
and it never searches in reverse. Saves 2 bytes per glyph. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30818 a1c6a512-1295-4272-9138-f99709370657
2011-10-16font_cache.c: Optimize and simplify cache search. ~25% font rendering boostFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30763 a1c6a512-1295-4272-9138-f99709370657
2011-10-05core_alloc: Provide a tiny test allocation, which can be freed for debug ↵Thomas Martitz
purposes. This allocation can be freed in the buflib debug menu (select it to free). Doing a another allocation, e.g. by selecting another item in this debug menu will cause compaction (all allocs move). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30719 a1c6a512-1295-4272-9138-f99709370657
2011-09-24FS#12273 - use buflib for font storage. thanks to the testers :)Jonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
2011-09-09Buflib: Stop caching the first unallocated block. It has little benefit but ↵Thomas Martitz
is complicated to keep up-to-date. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30487 a1c6a512-1295-4272-9138-f99709370657
2011-09-07Buflib: Clarification about invalid handlesThomas Martitz
* Enhance allocation function comments to better state the return value and what an invalid value is * Change clients to check for "< 0" instead of "<= 0" or "== 0" * Return -1 or -2 depending on the exact failure in buflib_alloc_ex. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30469 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: 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-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-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
2011-07-18Introduce bsearch() and use it in tagtree.c.Thomas Martitz
bsearch() is a general purpose binary search function for arrays. It's supposedly faster than looping over arrays. The array needs to be sorted in ascending order under the provided comparison function. If the key and array element are of the same kind, then the same compare function can be used for qsort() and bsearch(). Code taken from glibc. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30155 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
2011-06-20Move buffer.h to firmware/include.h to replace a useless malloc header.Thomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30026 a1c6a512-1295-4272-9138-f99709370657
2011-05-24FS#12120. Convert FRACMUL macros into inline functions and fix typecasting ↵Nils Wallménius
for 64 bit platforms so that sims produce the same results as targets. Tweak the cf inline asm to not require an immediate value but add a FORCE_INLINE attribute to one of the cf functions to make sure it gets inlined as that saves both codesize and cycles. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29921 a1c6a512-1295-4272-9138-f99709370657
2011-05-08Fix tabs in .c and .h files in firmware/ Bertrik Sikken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29832 a1c6a512-1295-4272-9138-f99709370657
2011-02-27RaaA: Add initial Pandora supportThomas Jarosch
More information: www.openpandora.org Possible things to implement: - Special button mappings - Battery monitoring - ALSA audio backend - Automate creation of "pnd" (=binary) file git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29451 a1c6a512-1295-4272-9138-f99709370657
2011-02-27iPod Classic CE-ATA Support (Part 1 of 4: Cacheline align some statically ↵Michael Sparmann
allocated sector buffers) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29444 a1c6a512-1295-4272-9138-f99709370657
2011-02-08Initial maemo platform supportThomas Jarosch
Adds Nokia N900, N810 and N800 support. Features: - Introduce maemo specific platform defines - Play audio in silent mode - Stop playback on incoming calls - Battery level readout - Bluetooth headset support - Save CPU by disabling screen updates if the display is off or the app doesn't have input focus - N900: GStreamer audio backend Kudos to kugel for the code review. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29248 a1c6a512-1295-4272-9138-f99709370657
2010-12-29Also PREFIX() other filesystem functions. I hope I got them all now...Frank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28929 a1c6a512-1295-4272-9138-f99709370657
2010-12-23RaaA: Improve tagcache search to make the database built.Thomas Martitz
First, it add the ability to tagcache to walk through multiple search roots. Second, it adds symlinks targets to the search roots if they're are not inside any of the current search roots, otherwise the symlink is ignored (unless it's a file). The default search root is still /, so no search root will be actually added. But the tagcache now isn't trapped by recursive symlinks anymore and successfully builds, and it's prepared for a future music directory setting. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28884 a1c6a512-1295-4272-9138-f99709370657
2010-12-06Get rid of get_user_file_path and do the path handling in wrappers for ↵Thomas Martitz
open() and friends. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 a1c6a512-1295-4272-9138-f99709370657
2010-09-20format() (and its alias vuprintf) return values are uncheck -> voidRafaël Carré
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28119 a1c6a512-1295-4272-9138-f99709370657
2010-09-06Fix sdl application buildThomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28004 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-27Fix checkwps.Thomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27905 a1c6a512-1295-4272-9138-f99709370657
2010-08-27Use system headers a bit more: use host's fcntl.h for O_RDONLY etc.Thomas Martitz
Removes the need to fix up those in the simulator. Also work around some posix-mingw incompatibilities (e.g. getcwd()). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27904 a1c6a512-1295-4272-9138-f99709370657
2010-08-12Move memset6() declaration to string-extra.h, kills a warning compiling for ↵Thomas Martitz
android since it ships a memory.h. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27789 a1c6a512-1295-4272-9138-f99709370657
2010-08-12Introduce NORETURN_ATTR wrapper for __attribute__((noreturn)), using this ↵Thomas Martitz
and a bit further cleanup in main gets rid of a warning when compiling for android. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27788 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-07-25strncpy.c / assert.h : need to include _ansi.hRafaël Carré
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27549 a1c6a512-1295-4272-9138-f99709370657
2010-07-25Move some gcc extensions to new gcc_extensions.h headerRafaël Carré
- Move ATTRIBUTE_PRINTF/ATTRIBUTE_SCANF from _ansi.h They are not related at all to this file, and this broke compilation with Code Sourcery GCC which ships its own _ansi.h - Move LIKELY/UNLIKELY from system.h There is likely a lot more GCC extensions used everywhere in the source, conditionally on __GNUC__ or unconditionally git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27548 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-05-14Make the sim buildable with mingw againFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26037 a1c6a512-1295-4272-9138-f99709370657
2010-05-14Move include/sys along with libc/, so hosted (sim/RaaA) builds use the ↵Frank Gevaerts
proper files for their OS git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26030 a1c6a512-1295-4272-9138-f99709370657
2010-05-14Move math.h to firmware/libc/include/ and fix slight incompatibilities ↵Thomas Martitz
between our and the host's math.h git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26020 a1c6a512-1295-4272-9138-f99709370657
2010-05-07Remove stray function prototype used only for long-ago-removed codec ↵Michael Sevakis
swapping. Function definition was removed when adding internal voice codec. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25868 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Revert r25854 which was bad for the database tool (I forgot it still needs ↵Thomas Martitz
the wrappers from uisimulator/common/io.c). Fix it so it works for both. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25856 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Fix checkwps by using host system's file IO (thanks to r25843/r25844) and by ↵Thomas Martitz
including a work around for systems that try to get intN_t via sys/types.h (which should be wrong, but well). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25854 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Move c/h files implementing/defining standard library stuff into a new libc ↵Thomas Martitz
directory, also standard'ify some parts of the code base (almost entirely #include fixes). This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Make open() posix compliant api-wise. A few calls (those with O_CREAT) need ↵Thomas Martitz
the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Make creat() posix compliant API-wise. Shouldn't affect the core as it's ↵Thomas Martitz
wrapped via a static inline. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
2010-04-07FS#11187 - diacritic.c is in 'drivers' but it does not belong thereTomer Shalev
- Move diacritic.c to firmware/common - The function is_diacritic returns bool now git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25526 a1c6a512-1295-4272-9138-f99709370657