summaryrefslogtreecommitdiff
path: root/firmware/thread.c
AgeCommit message (Collapse)Author
2009-11-20Fix warning on new gcc for checking value or truth of undefined _WIN32 and MIPS.Andrew Mahone
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23670 a1c6a512-1295-4272-9138-f99709370657
2009-10-10"Implement" S5L8701 core_sleepMichael Sparmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23081 a1c6a512-1295-4272-9138-f99709370657
2009-07-12* Fix overlooked r12 usage possibility in mpegplayer ARM idct Jens Arnold
* 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
2009-05-06MIPS: don't save gp register when switching threadsMaurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20863 a1c6a512-1295-4272-9138-f99709370657
2009-04-08Jz4740:Maurus Cuelenaere
* 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
2009-02-11s3c2440 can use the generic ARM WFI which is much simpler. If there's any ↵Michael Sevakis
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
2009-02-11Make basic cache functions into calls, and get rid of ↵Michael Sevakis
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
2008-12-19Enable sleep() on MIPS targetsMaurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19493 a1c6a512-1295-4272-9138-f99709370657
2008-12-14Place some LIKELY and UNLIKELY hints in kernel where I can definitively say ↵Michael Sevakis
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
2008-12-10Fix a wrong comment in thread.c and mention an alternative approach to ↵Michael Sevakis
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
2008-12-10Use cookies for thread identification instead of pointers directly which ↵Michael Sevakis
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
2008-11-09core_sleep(): only write once the same implementation, and add as3525 to the ↵Rafaël Carré
list git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19057 a1c6a512-1295-4272-9138-f99709370657
2008-11-04Onda VX747:Maurus Cuelenaere
clean up's, bug fixes and reworks git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19007 a1c6a512-1295-4272-9138-f99709370657
2008-10-07Fix TABs and get rid of HAVE_BUTTON_HOLDMaurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18737 a1c6a512-1295-4272-9138-f99709370657
2008-09-16Commit fs#9404 (iAudio 7 updates by vitja). Also fixes play/pause behaviour ↵Rob Purchase
on D2. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18528 a1c6a512-1295-4272-9138-f99709370657
2008-09-14Forgot this..Maurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18513 a1c6a512-1295-4272-9138-f99709370657
2008-09-14Onda VX747:Maurus Cuelenaere
* 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
2008-08-06* Add basic (non-working) support for NAND flashMaurus Cuelenaere
* 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
2008-07-171) Set svn:keywords where they should've been setMaurus Cuelenaere
2) Onda VX747 specific changes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18080 a1c6a512-1295-4272-9138-f99709370657
2008-07-14Add preliminary support for the Onda VX747 (MIPS target)Maurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18032 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-06-03Reinstate the awful ATA hack that has no proper reason to exist for iPod ↵Michael Sevakis
5.5g 60GB and/or 80GB. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17682 a1c6a512-1295-4272-9138-f99709370657
2008-05-17Actually remove the ata lock hack code for that had been used for iPod Video ↵Michael Sevakis
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
2008-05-11Disable the ata locking hack since a recent test strongly suggests it has ↵Michael Sevakis
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
2008-05-03Made source files #include the header file that they implement to make sure ↵Bertrik Sikken
they are in sync. Made some local functions static. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17312 a1c6a512-1295-4272-9138-f99709370657
2008-04-24Commit whole Creative Zen Vision:M target tree + all related firmware/ Maurus Cuelenaere
changes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17241 a1c6a512-1295-4272-9138-f99709370657
2008-04-20Fix freezing of some builds on PP5002. The PP5002 needs the not-sleep-at ↵Jens Arnold
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
2008-04-11iPod Video 30Gig doesn't seem to need the ata locking hack so we'll just ↵Michael Sevakis
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
2008-04-06Get device-specific code out of init_threads and add core_thread_init to be ↵Michael Sevakis
implemented for multicore devices. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17000 a1c6a512-1295-4272-9138-f99709370657
2008-04-06Shorten the uncontended (expected) corelock_(try_)lock return path. Squeeze ↵Michael Sevakis
down corelock_try_lock by a couple instructions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16983 a1c6a512-1295-4272-9138-f99709370657
2008-04-06Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now ↵Michael Sevakis
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
2008-03-28Go back to the ata lock hack for 5g until whatever is going on there is ↵Michael Sevakis
discovered and fixed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16870 a1c6a512-1295-4272-9138-f99709370657
2008-03-26Do core interrupt masking in a less general fashion and save some ↵Michael Sevakis
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
2008-03-25Add a complete priority inheritance implementation to the scheduler (all ↵Michael Sevakis
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
2008-03-22Implement core_sleep() for TCC780x (single core).Rob Purchase
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16740 a1c6a512-1295-4272-9138-f99709370657
2008-03-07Fix the PP5002 crash bug affecting iPod 1st, 2nd and 3rd Gen. Yet another of ↵Jens Arnold
those PP5002 quirks... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16547 a1c6a512-1295-4272-9138-f99709370657
2008-02-28Fix a very subtle bug that would cause a yielding thread to be scheduled ↵Michael Sevakis
twice in a row even if others were woken and one of them should be selected. Evaluate next thread _after_ waking checks to keep fairness. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16444 a1c6a512-1295-4272-9138-f99709370657
2008-02-05Oops. Dump some testing stuff that got left in.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16217 a1c6a512-1295-4272-9138-f99709370657
2008-02-05Gigabeat S mixer: Make some progress. Get the tick and core sleep working ↵Michael Sevakis
using the AVIC. Redo the startup code to remap from IRAM and not include the lcd driver frambuffer in the remapping (until it can be moved). Clean up LCD driver. For other misc. changes, see the diffs. Now it progresses to ATA init and fails with -11 but without crashing or hanging. Replace all bootloaders. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16216 a1c6a512-1295-4272-9138-f99709370657
2008-02-02Fix a minor ;) problem that would keep other threads from running during ↵Michael Sevakis
priority_yield calls unless they had aged too much. Basically it operates in the manner of the original implementation. _May_ help 5.5g buffering problems so do test that. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16197 a1c6a512-1295-4272-9138-f99709370657
2008-01-19Fix warnings. Remove a now unneeded parameter macro from run_blocking_ops.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16109 a1c6a512-1295-4272-9138-f99709370657
2008-01-19Do some simplification in switch_thread regarding interrupt enabling which ↵Michael Sevakis
simplifies kernel objects as well. Simply doing unconditional disable/enable should be fine in the firmware. Not sure about the case in the bootloader for all targets and so will evaluate but that should be fine too if everything is masked. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16107 a1c6a512-1295-4272-9138-f99709370657
2007-11-27Enable dualcore for the pp5002 processor by adding the needed cache handling ↵Michael Sevakis
and sleep/wakeup sync to the kernel. Refine some handling of fw/bl startup for all. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15827 a1c6a512-1295-4272-9138-f99709370657
2007-11-20Fix warnings.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15710 a1c6a512-1295-4272-9138-f99709370657
2007-11-20Make threads responsible for explicit cancellation of their own boosted ↵Michael Sevakis
status. Sleeping and timeouts will no longer cancel it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15709 a1c6a512-1295-4272-9138-f99709370657
2007-10-28Initial work on a port to the Logik DAX 1GB MP3/DAB player. The bootloader ↵Dave Chapman
build compiles and runs (but only displays some debugging info), and the LCD and ADC drivers are working. Two different bootloader builds are possible: 1) The default build is just a test application for uploading to the device via tcctool; 2) Adding -DTCCBOOT to EXTRA_DEFINES in the build directory Makefile will compile the bootloader so that it can be appended to the end of the original firmware and installed on the device, dual-booting. This commit also includes some work by Hein-Pieter van Braam on a port to the iAudio 7, but that doesn't build yet. A large part of these ports will be generic to all TCC77x devices - see the TelechipsInfo wiki page for some other devices with this CPU. NOTE: Compiling these builds requires an arm-elf-gcc with armv5 support - the current version of rockboxdev.sh compiles such a gcc. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15339 a1c6a512-1295-4272-9138-f99709370657
2007-10-21The interrupt disable is only relevant on multicore targets.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15241 a1c6a512-1295-4272-9138-f99709370657
2007-10-21Don't keep interrupts disabled when waking a frozen thread. Fixes frozen UI ↵Jens Arnold
on H10 while dircache scan is running in the background. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15239 a1c6a512-1295-4272-9138-f99709370657
2007-10-19Save a little space and only initialize the minimum for initial threads at ↵Michael Sevakis
startup. The BSS sections should already be zereod and if they're mistakenly not, be sure to crash ASAP. ;) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15204 a1c6a512-1295-4272-9138-f99709370657
2007-10-19Reverse some logic with Peterson's algorithm and cut an instruction. Make ↵Michael Sevakis
C-reference reflect it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15199 a1c6a512-1295-4272-9138-f99709370657