summaryrefslogtreecommitdiff
path: root/firmware/export/thread.h (follow)
Commit message (Collapse)AuthorAge
* Introduce NORETURN_ATTR wrapper for __attribute__((noreturn)), using this ↵Thomas Martitz2010-08-12
| | | | | | 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
* 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
* Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with ↵Thomas Martitz2010-06-21
| | | | | | | | | | | #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
* 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
* Clean unused stuff out of thread.h and config.h and reorganize thread-pp.c ↵Michael Sevakis2010-06-10
| | | | | | to simplify the preprocessor blocks. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26743 a1c6a512-1295-4272-9138-f99709370657
* CPU_PP implies CPU_ARM is definedRafaël Carré2010-06-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26690 a1c6a512-1295-4272-9138-f99709370657
* Remove CORELOCK_SWAP (unused since r16981)Rafaël Carré2010-06-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26664 a1c6a512-1295-4272-9138-f99709370657
* SDL Simulator: Get thread shutdown and properly handled and fix a minor ↵Michael Sevakis2010-05-27
| | | | | | memory leak that happens when threads exit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26336 a1c6a512-1295-4272-9138-f99709370657
* Use a more natural guard for the callback definitionAlexander Levin2010-04-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25664 a1c6a512-1295-4272-9138-f99709370657
* Cleanup thread_entry definition a bit. Reorder members so that related ones ↵Thomas Martitz2010-04-16
| | | | | | | | are next to each other and move a pretty hidden define into config.h. Doesn't make a binsize difference (the comment says the order should be optimized for size). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25659 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
* 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
* Unless I'm severely mistaken, we can drop a thread slot now since mpegplayer ↵Michael Sevakis2009-01-05
| | | | | | creates one less thread. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19686 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
* 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 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
* Spelling fixes.Bertrik Sikken2008-05-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17574 a1c6a512-1295-4272-9138-f99709370657
* The presence of the run list corelocks are dependent on core number and not ↵Michael Sevakis2008-05-04
| | | | | | building with priority scheduling. Fix building for multiprocessor without HAVE_PRIORITY_SCHEDULING defined. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17362 a1c6a512-1295-4272-9138-f99709370657
* Add GPIO manager. Get the PMIC interrupt handling working (along with power ↵Michael Sevakis2008-04-12
| | | | | | button and HP detect). Add some reg field defined instead of using raw numbers. Add PMIC info to debug ports screen. Refine PMIC driver ops a little bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17086 a1c6a512-1295-4272-9138-f99709370657
* Just change PRIORITY_BUFFERING to 15. Seems a teeny tiny bit helpful to ↵Michael Sevakis2008-03-29
| | | | | | mpegplayer as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16884 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
* Do some simplification in switch_thread regarding interrupt enabling which ↵Michael Sevakis2008-01-19
| | | | | | 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
* mpegplayer: Make playback engine fully seekable and frame-accurate and split ↵Michael Sevakis2007-12-29
| | | | | | into logical parts. Be sure to have all current features work. Actual UI for seeking will be added soon. Recommended GOP size is about 15-30 frames depending on target or seeking can be slow with really long GOPs (nature of MPEG video). More refined encoding recommendations for a particular player should be posted soon. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15977 a1c6a512-1295-4272-9138-f99709370657
* Make threads responsible for explicit cancellation of their own boosted ↵Michael Sevakis2007-11-20
| | | | | | status. Sleeping and timeouts will no longer cancel it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15709 a1c6a512-1295-4272-9138-f99709370657
* Finally commit Metadata on Buffer!Nicolas Pennequin2007-10-25
| | | | | | | | | buffering.c and buffering.h implement the new buffering API. playback.c is translated to that API. For more information about the whole concept, see http://www.rockbox.org/wiki/MetadataOnBuffer. There should be no major visible changes, but most existing bugs remain (though fixing them should be easier now that playback.c is a bit less complex) and there probably will be new ones. Please report any problem! Next step is to adapt cuesheet support, which is partly disabled here, and of course fix as much bugs as possible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15306 a1c6a512-1295-4272-9138-f99709370657
* Apply Akio Idehara's fix for FS#7972 - Fix ARM's swp (xchg) inline assembly ↵Michael Sevakis2007-10-17
| | | | | | for gcc 4.2. Also avoids UNPREDICTABLE behavior that GCC should have always warned about. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15157 a1c6a512-1295-4272-9138-f99709370657
* Oops made a mistake that messed up test_and_set selection.Michael Sevakis2007-10-16
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15139 a1c6a512-1295-4272-9138-f99709370657
* Finally full multicore support for PortalPlayer 502x targets with an eye ↵Michael Sevakis2007-10-16
| | | | | | towards the possibility of other types. All SVN targets the low-lag code to speed up blocking operations. Most files are modified here simple due to a name change to actually support a real event object and a param change to create_thread. Add some use of new features but just sit on things for a bit and leave full integration for later. Work will continue on to address size on sensitive targets and simplify things if possible. Any PP target having problems with SWP can easily be changed to sw corelocks with one #define change in config.h though only PP5020 has shown an issue and seems to work without any difficulties. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15134 a1c6a512-1295-4272-9138-f99709370657
* Discontinue any use of 'swp(b)' on PP5020. While clocking is stable, some ↵Michael Sevakis2007-10-06
| | | | | | testing revealed this instruction can still cause problems without concurrent access. Make sure mpegplayer is safe while not using spinlock (no longer atomic) between cores to protect the stream byte counters - use nonwrapping head and tail pointers. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15005 a1c6a512-1295-4272-9138-f99709370657
* Commit a subset of the dual core changes that have to do with cache ↵Michael Sevakis2007-09-28
| | | | | | handling, stacks, firmware startup and thread startup. Tested on e200, H10-20GB, iPod Color and 5.5G. Thread function return implemented for all targets. Some changes to plugins to follow shortly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14879 a1c6a512-1295-4272-9138-f99709370657
* Sim I/O and threading that runs more like on target. Tweakable if any ↵Michael Sevakis2007-09-08
| | | | | | genuine slowness imitation is required for any one of them. One point of concern is the sim shutdown on an OS other than Linux just because terminating threads in a manner other than having the do it themselves is kind of dirty IMHO. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14639 a1c6a512-1295-4272-9138-f99709370657
* Atomic mutexes on SH1.Jens Arnold2007-08-01
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14121 a1c6a512-1295-4272-9138-f99709370657
* Messages queues must be guarded on both ends or else it's a race between ↵Michael Sevakis2007-05-12
| | | | | | detecting a message present and missing a wakeup on thread about to wait. Keeping IRQs from interacting with the scheduler would be preferable but this should do at the moment. Add more detailed panic info regarding blocking violations so we know who. Make panicf function well enough on Gigabeat and PortalPlayer targets. Move the core sleep instructions into a CPU-specific inline to keep thing organized. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13374 a1c6a512-1295-4272-9138-f99709370657
* This should fix the remaining compilation issues.Miika Pekkarinen2007-03-26
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12928 a1c6a512-1295-4272-9138-f99709370657
* Make scheduler functions thread safe core wise. A big step towards playback ↵Miika Pekkarinen2007-03-26
| | | | | | running on COP (not yet possible because more protection on file system level is necessary). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12926 a1c6a512-1295-4272-9138-f99709370657
* Fix a hole in the scheduler where collisions between waking blocked threads ↵Michael Sevakis2007-03-26
| | | | | | in mutexes with interrupts waking blocked threads in message queues can occur. Queue posts will put the threads on a separate list that is then added to the running list with IRQs disabled on the next task switch or CPU wakeup. Basically no overhead for other operations. Seems a likely cause of my occasional observation of the backlight fade causing playback threads to stop running and a recently reported blocking violation upon USB plugging. Time will tell but banging the backlight on and off frequently hasn't hiccuped again for me on H120. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12915 a1c6a512-1295-4272-9138-f99709370657
* Update sync queues to use a statically allocated return value in order to ↵Michael Sevakis2007-03-21
| | | | | | facilitate upcoming COP updates. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12881 a1c6a512-1295-4272-9138-f99709370657
* Back to green?Michael Sevakis2007-03-09
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12690 a1c6a512-1295-4272-9138-f99709370657
* Put an end to priority inversion in the ata driver. Gave up trying to have ↵Michael Sevakis2007-03-09
| | | | | | fully atomic dual use mutexes so just replaced the ata driver locking with spins. Maybe I'll have better luck later. Things should run smoothly with database updates and such happening in the background. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12688 a1c6a512-1295-4272-9138-f99709370657
* Fix problem with recording screen creep and bag a bigfoot. Voice clips ↵Michael Sevakis2007-03-06
| | | | | | aren't long enough now to untrigger the thread boost that was supposed to be applied to the codec thread. The voice thread was needlessly boosting the codec thread and leaving it boosted which explains the encoders' ability to flood the output buffer when everything else was stopped in its tracks. Check which thread is calling pcmbuf_under_watermark and only initiate the boost when it's the codec thread. Always return the codec thread to its usual priority in pcmbuf_play_stop. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12649 a1c6a512-1295-4272-9138-f99709370657
* Dual core support for PP502x players (iPod G4 and later, iriver h10, Sansa - ↵Daniel Ankers2007-03-04
| | | | | | iPod G3 will be coming soon.) This allows threads to be run on either core provided that all communications between the cores is done using uncached memory. There should be no significant change in battery life from doing this. Documentation (on the RockboxKernel wiki page) will follow shortly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12601 a1c6a512-1295-4272-9138-f99709370657
* Allow one more thread on swcodec to make mpegplayer work on targets with ↵Jens Arnold2007-01-07
| | | | | | remote LCD and voice file present. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11937 a1c6a512-1295-4272-9138-f99709370657
* Add queue_send synchronous message sending. Right now only for SWCODEC. ↵Michael Sevakis2006-12-16
| | | | | | Actual usage to be added to playback and recording shortly in upcoming commits. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11776 a1c6a512-1295-4272-9138-f99709370657
* Thread API enhancements.Brandon Low2006-11-11
| | | | | | | | 1) block_thread -> block_thread + block_thread_w_tmo -- this call was always used in distinct ways so having one call with a conditional was ugly. 2) enhance Slasheri's scheduler controlled boost concept. now any thread may trigger a boost which will last until that thread next sleeps. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11509 a1c6a512-1295-4272-9138-f99709370657
* Removed the Gmini 120 and Gmini SP code. These ports are dead, unfortunately.Jens Arnold2006-11-10
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11504 a1c6a512-1295-4272-9138-f99709370657
* Big Patch adds primarily: Samplerate and format selection to recording for ↵Michael Sevakis2006-11-06
| | | | | | SWCODEC. Supprort for samplerates changing in playback (just goes with the recording part inseparably). Samplerates to all encoders. Encoders can be configured individually on a menu specific to the encoder in the recording menu. File creation is delayed until flush time to reduce spinups when splitting. Misc: statusbar icons for numbers are individual digits to display any number. Audio buffer was rearranged to maximize memory available to recording and properly reinitialized when trashed. ColdFire PCM stuff moved to target tree to avoid a complicated mess when adding samplerate switching. Some needed API changes and to neaten up growing gap between hardware and software codecs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11452 a1c6a512-1295-4272-9138-f99709370657
* Removed ugly boosting solutions from playback code and let schedulerMiika Pekkarinen2006-10-15
| | | | | | | handle unboosting instead. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11226 a1c6a512-1295-4272-9138-f99709370657
* Include "config.h" to make sure priority stuff is properly included.Miika Pekkarinen2006-09-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10974 a1c6a512-1295-4272-9138-f99709370657