summaryrefslogtreecommitdiff
path: root/firmware/thread.c (follow)
Commit message (Collapse)AuthorAge
* Add optional (define BUFFER_ALLOC_DEBUG to enable it) code to check for code ↵Frank Gevaerts2010-09-26
| | | | | | | | | overflowing buffer_alloc()-allocated buffers. Also add a panicf() if buffer_alloc() doesn't have enough space left to allocate a requested buffer git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28173 a1c6a512-1295-4272-9138-f99709370657
* Rockbox as an application: Commit current Android port progress.Thomas Martitz2010-08-02
| | | | | | | | | | | | | | | | General state is: Rockbox is usable (plays music, saves configuration, touchscreen works too). Problems: - Playing music in the background (i.e. when switching to another app) doesn't work reliably, but I'm working on that now. - no cabbiev2 (only some preliminary files for it), no other default theme. - screen flickers sometimes if the updates are too frequent - no multi screen apk/package - strange behavior when a phone call comes in The java files (and the eclipse project) resides in android/, which is also supposed to be the build folder. I've put a small README in there for instructions. There are some steps needed after the make part, which are described there, and which eclipse mostly handles. But there ought to be some script/makefile rules which do that instead in the future. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27668 a1c6a512-1295-4272-9138-f99709370657
* For multiprocessor targets, do the thread_exit routine such that we don't ↵Michael Sevakis2010-06-18
| | | | | | need to rely on the compiler's good graces to have stack switching be reliable. Only needs a few asm instructions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26906 a1c6a512-1295-4272-9138-f99709370657
* Fix red. Need 'inline' with 'always_inline'.Michael Sevakis2010-06-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26899 a1c6a512-1295-4272-9138-f99709370657
* Switch iPod 3G to use EABI toolchain. Make necessary threading changes to ↵Michael Sevakis2010-06-17
| | | | | | avoid use of stack after switching to idle stack. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26898 a1c6a512-1295-4272-9138-f99709370657
* Threading: Split processor support code into respective target files. C ↵Michael Sevakis2010-06-02
| | | | | | files from /target/xxx are included into thread.c because of essential inlining and files are code, not declarations. Copyrights in each new file go to whoever implemented the first functional support. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26479 a1c6a512-1295-4272-9138-f99709370657
* i.MX31: Issue some NOP's immediately after MCR WFI to prevent premature ↵Michael Sevakis2010-05-15
| | | | | | execution of subsequent code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26058 a1c6a512-1295-4272-9138-f99709370657
* Move c/h files implementing/defining standard library stuff into a new libc ↵Thomas Martitz2010-05-06
| | | | | | | | 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
* Fix red from r25666 (forgot to use macro to not use core variable on single ↵Michael Sevakis2010-04-18
| | | | | | core), update a comment and remove core check for setting THREAD_SWITCH upon wakeup which is irrelevant to the idea behind the change. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25667 a1c6a512-1295-4272-9138-f99709370657
* Threads of PRIORITY_REALTIME and above are no longer subject to being ↵Michael Sevakis2010-04-18
| | | | | | switched away based upon aging of lower priority threads. Now, recommend a thread switch in wakeup_thread of any thread of higher priority is ready to run. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25666 a1c6a512-1295-4272-9138-f99709370657
* Use API call instead of accessing a global variable for receiving the ↵Thomas Martitz2010-04-16
| | | | | | current thread. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25657 a1c6a512-1295-4272-9138-f99709370657
* Add IO priority handling. Currently all IO has equal priority, except the ↵Frank Gevaerts2010-04-03
| | | | | | | | | | | | dircache scanning thread which is lower. This fixes the slow boot problem for me, with the added benefit that actual audio playback also starts faster. Lots of the changes are due to changing storage_(read|write)sectors() from macros to wrapper functions. This means that they have to be called with IF_MD2(drive,) again. Flyspray: FS#11167 Author: Frank Gevaerts git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25459 a1c6a512-1295-4272-9138-f99709370657
* FS#10756 - Free unused init codeThomas Martitz2010-03-03
| | | | | | | 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
* as3525v2: core_sleep()Rafaël Carré2010-02-22
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24839 a1c6a512-1295-4272-9138-f99709370657
* Fix warning on new gcc for checking value or truth of undefined _WIN32 and MIPS.Andrew Mahone2009-11-20
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23670 a1c6a512-1295-4272-9138-f99709370657
* "Implement" S5L8701 core_sleepMichael Sparmann2009-10-10
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23081 a1c6a512-1295-4272-9138-f99709370657
* * Fix overlooked r12 usage possibility in mpegplayer ARM idct Jens Arnold2009-07-12
| | | | | | | * ARM dualcore: Don't save r12 in switch_thread_core() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21830 a1c6a512-1295-4272-9138-f99709370657
* MIPS: don't save gp register when switching threadsMaurus Cuelenaere2009-05-06
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20863 a1c6a512-1295-4272-9138-f99709370657
* Jz4740:Maurus Cuelenaere2009-04-08
| | | | | | | | * Optimize & cleanup thread handling a bit * Unify exception return and fix a potential bug git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20659 a1c6a512-1295-4272-9138-f99709370657
* s3c2440 can use the generic ARM WFI which is much simpler. If there's any ↵Michael Sevakis2009-02-11
| | | | | | advantage to setting the IDLE bit for power consumption, it's possible to combine its use with the old core_sleep instead of using the loop waiting for idle to kick in. For now, go basic. Let GCC choose the register for MCR instead of forcing it to r0. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19978 a1c6a512-1295-4272-9138-f99709370657
* Make basic cache functions into calls, and get rid of ↵Michael Sevakis2009-02-11
| | | | | | CACHE_FUNCTION_WRAPPERS and CACHE_FUNCTIONS_AS_CALL macros. Rename flush/invalidate_icache to cpucache_flush/invalidate. They're inlined only if an implementation isn't provided by defining HAVE_CPUCACHE_FLUSH/INVALIDATE. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19971 a1c6a512-1295-4272-9138-f99709370657
* Enable sleep() on MIPS targetsMaurus Cuelenaere2008-12-19
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19493 a1c6a512-1295-4272-9138-f99709370657
* Place some LIKELY and UNLIKELY hints in kernel where I can definitively say ↵Michael Sevakis2008-12-14
| | | | | | anything about it and where it could make a small difference. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19433 a1c6a512-1295-4272-9138-f99709370657
* Fix a wrong comment in thread.c and mention an alternative approach to ↵Michael Sevakis2008-12-10
| | | | | | inits. Fix a couple headers' Id fields while at it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19386 a1c6a512-1295-4272-9138-f99709370657
* Use cookies for thread identification instead of pointers directly which ↵Michael Sevakis2008-12-10
| | | | | | gives a buffer against wrongly identifying a thread when the slot is recycled (which has been nagging me for awhile). A slot gets 255 uses before it repeats. Everything gets incompatible so a full update is required. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19377 a1c6a512-1295-4272-9138-f99709370657
* core_sleep(): only write once the same implementation, and add as3525 to the ↵Rafaël Carré2008-11-09
| | | | | | list git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19057 a1c6a512-1295-4272-9138-f99709370657
* Onda VX747:Maurus Cuelenaere2008-11-04
| | | | | | | clean up's, bug fixes and reworks git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19007 a1c6a512-1295-4272-9138-f99709370657
* Fix TABs and get rid of HAVE_BUTTON_HOLDMaurus Cuelenaere2008-10-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18737 a1c6a512-1295-4272-9138-f99709370657
* Commit fs#9404 (iAudio 7 updates by vitja). Also fixes play/pause behaviour ↵Rob Purchase2008-09-16
| | | | | | on D2. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18528 a1c6a512-1295-4272-9138-f99709370657
* Forgot this..Maurus Cuelenaere2008-09-14
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18513 a1c6a512-1295-4272-9138-f99709370657
* Onda VX747:Maurus Cuelenaere2008-09-14
| | | | | | | | | * Get rid of bug when interrupts are enabled * Get threading to work (although with some weirdness) * Other fixes/optimizations git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18512 a1c6a512-1295-4272-9138-f99709370657
* * Add basic (non-working) support for NAND flashMaurus Cuelenaere2008-08-06
| | | | | | | | | * Add panicf() handling * Add not-yet-enabled dma acceleration * Other (minor) fixes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18203 a1c6a512-1295-4272-9138-f99709370657
* 1) Set svn:keywords where they should've been setMaurus Cuelenaere2008-07-17
| | | | | | | 2) Onda VX747 specific changes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18080 a1c6a512-1295-4272-9138-f99709370657
* Add preliminary support for the Onda VX747 (MIPS target)Maurus Cuelenaere2008-07-14
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18032 a1c6a512-1295-4272-9138-f99709370657
* Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg2008-06-28
| | | | | | | | | 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
* Reinstate the awful ATA hack that has no proper reason to exist for iPod ↵Michael Sevakis2008-06-03
| | | | | | 5.5g 60GB and/or 80GB. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17682 a1c6a512-1295-4272-9138-f99709370657
* Actually remove the ata lock hack code for that had been used for iPod Video ↵Michael Sevakis2008-05-17
| | | | | | 60/80. It has been disabled for awhile anyway and the problem that nescessitated it really appears resolved. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17558 a1c6a512-1295-4272-9138-f99709370657
* Disable the ata locking hack since a recent test strongly suggests it has ↵Michael Sevakis2008-05-11
| | | | | | been resolved as of r17426. Leave the code for now just in case. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17468 a1c6a512-1295-4272-9138-f99709370657
* Made source files #include the header file that they implement to make sure ↵Bertrik Sikken2008-05-03
| | | | | | they are in sync. Made some local functions static. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17312 a1c6a512-1295-4272-9138-f99709370657
* Commit whole Creative Zen Vision:M target tree + all related firmware/ Maurus Cuelenaere2008-04-24
| | | | | | | changes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17241 a1c6a512-1295-4272-9138-f99709370657
* Fix freezing of some builds on PP5002. The PP5002 needs the not-sleep-at ↵Jens Arnold2008-04-20
| | | | | | 0xNNNNNNN0-addresses fix everywhere when caching is enabled, not only in core_sleep(). Introduced a pair of inline functions to sleep and wake cores on PP for consistency. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17192 a1c6a512-1295-4272-9138-f99709370657
* iPod Video 30Gig doesn't seem to need the ata locking hack so we'll just ↵Michael Sevakis2008-04-11
| | | | | | attempt to remove it for this one. Works for me on 5.5g. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17071 a1c6a512-1295-4272-9138-f99709370657
* Get device-specific code out of init_threads and add core_thread_init to be ↵Michael Sevakis2008-04-06
| | | | | | implemented for multicore devices. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17000 a1c6a512-1295-4272-9138-f99709370657
* Shorten the uncontended (expected) corelock_(try_)lock return path. Squeeze ↵Michael Sevakis2008-04-06
| | | | | | down corelock_try_lock by a couple instructions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16983 a1c6a512-1295-4272-9138-f99709370657
* Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now ↵Michael Sevakis2008-04-06
| | | | | | with shared variables in DRAM (it seems swp(b) is at least partially broken on all PP or I'm doing something very wrong here :\). For core-shared data use SHAREDBSS/DATA_ATTR. NOCACHEBSS/DATA_ATTR is available whether or not single core is forced for static peripheral-DMA buffer allocation without use of the UNCACHED_ADDR macro in code and is likely useful on a non-PP target with a data cache (although not actually enabled in config.h and the .lds's in this commit). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16981 a1c6a512-1295-4272-9138-f99709370657
* Go back to the ata lock hack for 5g until whatever is going on there is ↵Michael Sevakis2008-03-28
| | | | | | discovered and fixed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16870 a1c6a512-1295-4272-9138-f99709370657
* Do core interrupt masking in a less general fashion and save some ↵Michael Sevakis2008-03-26
| | | | | | instructions to decrease size and speed things up a little bit. Small fix to a few places where interrupts would get enabled again where they shouldn't have been (context switching calls when disabled). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16811 a1c6a512-1295-4272-9138-f99709370657
* Add a complete priority inheritance implementation to the scheduler (all ↵Michael Sevakis2008-03-25
| | | | | | mutex ownership and queue_send calls are inheritable). Priorities are differential so that dispatch depends on the runnable range of priorities. Codec priority can therefore be raised in small steps (pcmbuf updated to enable). Simplify the kernel functions to ease implementation and use the same kernel.c for both sim and target (I'm tired of maintaining two ;_). 1) Not sure if a minor audio break at first buffering issue will exist on large-sector disks (the main mutex speed issue was genuinely resolved earlier). At this point it's best dealt with at the buffering level. It seems a larger filechunk could be used again. 2) Perhaps 64-bit sims will have some minor issues (finicky) but a backroll of the code of concern there is a 5-minute job. All kernel objects become incompatible so a full rebuild and update is needed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16791 a1c6a512-1295-4272-9138-f99709370657
* Implement core_sleep() for TCC780x (single core).Rob Purchase2008-03-22
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16740 a1c6a512-1295-4272-9138-f99709370657
* Fix the PP5002 crash bug affecting iPod 1st, 2nd and 3rd Gen. Yet another of ↵Jens Arnold2008-03-07
| | | | | | those PP5002 quirks... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16547 a1c6a512-1295-4272-9138-f99709370657