summaryrefslogtreecommitdiff
path: root/firmware/kernel.c
AgeCommit message (Collapse)Author
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-05-141) Use a separate config-<target>.h for Zen Vision(:M) (60GB)Maurus Cuelenaere
2) Other unrelated cleanups git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17503 a1c6a512-1295-4272-9138-f99709370657
2008-05-05Convert the whole codebase to UTF-8, except docs/COMMITTERS and ↵Nicolas Pennequin
tools/creative.c, which need checking. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17369 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-11Serial driver for imx31. Perhaps not 100% but maybe 80-90% (future ↵Michael Sevakis
developments will tell). Factor-out the mc13783 stuff and make that driver a layer above the SPI. TODO: start processing PMIC interrupts. Start a clkctl API for imx31 (we'll see if this sticks around but it seems reasonable here). Misc. stuff for convenience/neatness. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17070 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-04-01Change a #define constant that conflicts with a mingw definition. Change ↵Michael Sevakis
"WAIT_*" to "OBJ_WAIT_*". git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16906 a1c6a512-1295-4272-9138-f99709370657
2008-03-30Add a lightweight wakeup object for fast processors.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16885 a1c6a512-1295-4272-9138-f99709370657
2008-03-28queue_delete should reset the blocker_p member.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16859 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-02-08Gigabeat S: Interrupt enabled bootloader. Miscellaneous integration changes.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16243 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-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
2008-01-18Finally, out goes struct spinlock for anything but mutiprocessor targets ↵Michael Sevakis
where it becomes a reenterable corelock. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16105 a1c6a512-1295-4272-9138-f99709370657
2007-10-30Fix FS#8052 - kernel.c compilation errors when compiling for debug. Just ↵Michael Sevakis
some minor typos that got in with last minute SW corelock changes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15380 a1c6a512-1295-4272-9138-f99709370657
2007-10-27Add queue_peek to the kernel (written by Mike Sevakis), and use it to ↵Nicolas Pennequin
improve upon my previous commit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15336 a1c6a512-1295-4272-9138-f99709370657
2007-10-21Be sure to register a new mutex owner _before_ waking it. Won't be an issue ↵Michael Sevakis
now but would be with mutex recursion on one used for > 1 core where ownership transfer and cs entry/recursion are allowed to run in parallel (by design). TODO: Add true exchange to wakeup_thread but that's not really important for the time being. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15251 a1c6a512-1295-4272-9138-f99709370657
2007-10-16Finally full multicore support for PortalPlayer 502x targets with an eye ↵Michael Sevakis
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
2007-10-05Stabilize PP5020 targets - tested on H10 5/20GB and iPod Color. Use no ↵Michael Sevakis
interrupts on COP but pulse it through the control interface. Don't mess with LCD clocking during clock changes. Give a reset register a name (DEV_OFF_MASK). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14998 a1c6a512-1295-4272-9138-f99709370657
2007-09-30Enable auto reply for queue messages sent with queue_send. It's only ↵Michael Sevakis
nescessary to use queue_reply to return a value other than zero or to return a result before waiting on the queue again. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14923 a1c6a512-1295-4272-9138-f99709370657
2007-09-28Commit a subset of the dual core changes that have to do with cache ↵Michael Sevakis
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
2007-09-21Merge the Gigabeat S branch back into trunk. Fingers crossed nothing breaks.Will Robertson
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14805 a1c6a512-1295-4272-9138-f99709370657
2007-07-29Add a new timeout API to the kernel. Enable only for e200 right now since ↵Michael Sevakis
it's the only user. Use that as the one-shot delay for SD card inserts. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14049 a1c6a512-1295-4272-9138-f99709370657
2007-07-06Gigabeat: Add timer functionality. Rework tick timer setup to be exactly ↵Michael Sevakis
100Hz. Metronome should work now but some pcm changes are needed to have faster tocks work correctly (in the works). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13806 a1c6a512-1295-4272-9138-f99709370657
2007-07-05Gigabeat: Use vectored IRQ mode interrupts and add a trap for unhandled ones.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13792 a1c6a512-1295-4272-9138-f99709370657
2007-06-25current_tick really does need to be volatile since gcc can optimize away ↵Michael Sevakis
checking the value otherwise - found out the hard way. :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13715 a1c6a512-1295-4272-9138-f99709370657
2007-05-12Messages queues must be guarded on both ends or else it's a race between ↵Michael Sevakis
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
2007-04-14Simplification, queue pointers don't wrap (except at INT_MAX, but the ↵Jens Arnold
calculation is still correct in this case). Implemented queue_count() for the simulator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13154 a1c6a512-1295-4272-9138-f99709370657
2007-03-26Make scheduler functions thread safe core wise. A big step towards playback ↵Miika Pekkarinen
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
2007-03-26Fix a hole in the scheduler where collisions between waking blocked threads ↵Michael Sevakis
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
2007-03-24PNX0101 changes:Tomasz Malesinski
Make PNX0101-specific system.c and crt0.S. Add new register names from LPC2880 user manual. Add support for timer. Enable CPU frequency changing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12904 a1c6a512-1295-4272-9138-f99709370657
2007-03-23In reponse to a report of a blocking violation, give sync queues a going ↵Michael Sevakis
over and catch any old, obscure leftover issues. A couple spots needed interrupt stopage where there could be confict if an IRQ post wakes a waiting thread because the queue is overflowing. There does appear to be an issue with wakeup_thread, interrupts and running list modification in general. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12895 a1c6a512-1295-4272-9138-f99709370657
2007-03-21Update sync queues to use a statically allocated return value in order to ↵Michael Sevakis
facilitate upcoming COP updates. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12881 a1c6a512-1295-4272-9138-f99709370657
2007-03-12Disable bootloader messages in the H10 and Sansa bootloaders unless the PLAY ↵Barry Wardell
(on H10) or RIGHT (on Sansa) button is being held. Messages are still displayed if an error occurs. This has already been implemented for iPod bootloaders, but still needs implementing for the other bootloaders. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12742 a1c6a512-1295-4272-9138-f99709370657
2007-03-11Optimized the gui list code performance, including automatic frame dropping ↵Miika Pekkarinen
and cpu boosting when button events are getting queued. Improved scrollwheel acceleration code is needed to notice a real change. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12721 a1c6a512-1295-4272-9138-f99709370657
2007-03-09Put an end to priority inversion in the ata driver. Gave up trying to have ↵Michael Sevakis
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
2007-03-04Dual core support for PP502x players (iPod G4 and later, iriver h10, Sansa - ↵Daniel Ankers
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
2006-12-29merge a big part of the unofficial gigabeat cvs back. Includes working ↵Marcoen Hirschberg
bootloader and rockbox with audio. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11850 a1c6a512-1295-4272-9138-f99709370657
2006-12-19Convert queues to use intptr_t for event data and return values as most of ↵Michael Sevakis
the time pointer are not passed and it should make some things a bit cleaner. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11818 a1c6a512-1295-4272-9138-f99709370657
2006-12-16Add queue_send synchronous message sending. Right now only for SWCODEC. ↵Michael Sevakis
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
2006-11-22Change if CONFIG_CPU==PP50XX to ifdef CPU_PP where appropriateDaniel Ankers
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11569 a1c6a512-1295-4272-9138-f99709370657
2006-11-11Thread API enhancements.Brandon Low
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
2006-11-10Removed the Gmini 120 and Gmini SP code. These ports are dead, unfortunately.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11504 a1c6a512-1295-4272-9138-f99709370657
2006-10-19Patch #6052 - More responsive skip on ArchosLinus Nielsen Feltzing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11273 a1c6a512-1295-4272-9138-f99709370657
2006-09-16New scheduler, with priorities for swcodec platforms. Frequent taskMiika Pekkarinen
switching should be more efficient and tasks are stored in linked lists to eliminate unnecessary task switching to improve performance. Audio should no longer skip on swcodec targets caused by too CPU hungry UI thread or background threads. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10958 a1c6a512-1295-4272-9138-f99709370657
2006-09-01Fixed an off-by-one error in the portalplayer timer handling.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10837 a1c6a512-1295-4272-9138-f99709370657
2006-08-31Initial commit of work for port to the Tatung Elio TPJ-1022 - yet another ↵Dave Chapman
PortalPlayer PP5020 target. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10828 a1c6a512-1295-4272-9138-f99709370657
2006-08-12initial gigabeat bootloader (only test code)Marcoen Hirschberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10536 a1c6a512-1295-4272-9138-f99709370657
2006-08-12update the gigabeat code and move to target_treeMarcoen Hirschberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10535 a1c6a512-1295-4272-9138-f99709370657