summaryrefslogtreecommitdiff
path: root/firmware/kernel.c (follow)
Commit message (Collapse)AuthorAge
* Ged rid of uisimulator/common/io.c for android builds.Thomas Martitz2010-09-01
| | | | | | | | | | | 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
* avoid dereferencing void** to remove warnings when building with -OsRafaël Carré2010-06-10
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26733 a1c6a512-1295-4272-9138-f99709370657
* kernel: the header says queue_peek should always be compiled in but the ↵Amaury Pouly2010-05-21
| | | | | | source put it in the #ifdef HAVE_EXTENDED_MESSAGING_AND_NAME section git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26229 a1c6a512-1295-4272-9138-f99709370657
* Simplify mpegplayer a bit and use array-based lists rather than linked lists ↵Michael Sevakis2010-05-17
| | | | | | for stream management. Move a couple useful functions to handle pointer arrays from kernel.c into general.c; mpeglayer now makes use of them. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26101 a1c6a512-1295-4272-9138-f99709370657
* - Move uisimulator/sdl/*.[ch] into the target tree, under ↵Thomas Martitz2010-05-15
| | | | | | | | | | firmware/target/hosted/sdl, uisdl.c is split up across button-sdl.c and system-sdl.c. - Refactor the program startup. main() is now in main.c like on target, and the implicit application thread will now act as our main thread (previously a separate one was created for this in thread initialization). This is part of Rockbox as an application and is the first step to make an application port from the uisimulator. In a further step the sim bits from the sdl build will be separated out. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26065 a1c6a512-1295-4272-9138-f99709370657
* Use boolean instead of int for keeping track of mutex signalled state and ↵Bertrik Sikken2010-04-18
| | | | | | wakeup signalled state git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25671 a1c6a512-1295-4272-9138-f99709370657
* Add the guard where it should be used. The net effect is zero now but it ↵Alexander Levin2010-04-18
| | | | | | might be not in the future if the definitions are changed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25669 a1c6a512-1295-4272-9138-f99709370657
* Convert macro to inline function and move it into .c file.Thomas Martitz2010-04-16
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25658 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
* Fix further tabsAndree Buschmann2010-01-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24156 a1c6a512-1295-4272-9138-f99709370657
* make tpj1022 bootloader compile again Robert Kukla2009-12-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23892 a1c6a512-1295-4272-9138-f99709370657
* Use wrap-safe TIME_BEFORE/TIME_AFTER macros to compare times with ↵Bertrik Sikken2009-10-18
| | | | | | current_time, instead of comparing them directly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23246 a1c6a512-1295-4272-9138-f99709370657
* Correct Björn's name in various file headers.Nicolas Pennequin2009-03-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20491 a1c6a512-1295-4272-9138-f99709370657
* Remove struct spinlock to cleanup some mess and simplify. It's only used in ↵Michael Sevakis2009-02-03
| | | | | | boosting for multiprocesors and a pure two-corelock heirarchy will do just fine. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19910 a1c6a512-1295-4272-9138-f99709370657
* Unify kernel list management for ticks, registered queues and timeout ↵Michael Sevakis2009-01-21
| | | | | | objects by using NULL-terminated lists of pointers. Redo timeout API a bit to simplify it and integrate it. Should give some small binsize reduction accross the board but more if timeout objects are being included. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19808 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
* 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
* Meg-FX: Enable a real tick in the bootloader. Do cleanups before switching ↵Michael Sevakis2008-12-08
| | | | | | to firmware and cache handling. Put proper main return address in lr. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19368 a1c6a512-1295-4272-9138-f99709370657
* Meg F/X: Radically changing divider settings messed up the fake sleep in the ↵Michael Sevakis2008-12-07
| | | | | | bootloader. They aren't reset even after powering off. Make sure they are always specified. Move that code to target tree as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19358 a1c6a512-1295-4272-9138-f99709370657
* Move kernel tick initialization and handling to the target tree for ones ↵Michael Sevakis2008-10-29
| | | | | | remaining in kernel.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18919 a1c6a512-1295-4272-9138-f99709370657
* Strange little kernel optimization to ease targeting the timer tick and to ↵Michael Sevakis2008-10-27
| | | | | | limit the number of loops in the tick function to the number of tasks added rather than always looping the max number. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18893 a1c6a512-1295-4272-9138-f99709370657
* Remove the event object in the kernel since it's rather extraneous at the ↵Michael Sevakis2008-10-23
| | | | | | moment. This makes the codecs and the plugins incompatible, so update fully. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18867 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
* 1) Use a separate config-<target>.h for Zen Vision(:M) (60GB)Maurus Cuelenaere2008-05-14
| | | | | | | 2) Other unrelated cleanups git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17503 a1c6a512-1295-4272-9138-f99709370657
* Convert the whole codebase to UTF-8, except docs/COMMITTERS and ↵Nicolas Pennequin2008-05-05
| | | | | | tools/creative.c, which need checking. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17369 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
* Serial driver for imx31. Perhaps not 100% but maybe 80-90% (future ↵Michael Sevakis2008-04-11
| | | | | | 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
* 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
* Change a #define constant that conflicts with a mingw definition. Change ↵Michael Sevakis2008-04-01
| | | | | | "WAIT_*" to "OBJ_WAIT_*". git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16906 a1c6a512-1295-4272-9138-f99709370657
* Add a lightweight wakeup object for fast processors.Michael Sevakis2008-03-30
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16885 a1c6a512-1295-4272-9138-f99709370657
* queue_delete should reset the blocker_p member.Michael Sevakis2008-03-28
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16859 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
* Gigabeat S: Interrupt enabled bootloader. Miscellaneous integration changes.Michael Sevakis2008-02-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16243 a1c6a512-1295-4272-9138-f99709370657
* Gigabeat S mixer: Make some progress. Get the tick and core sleep working ↵Michael Sevakis2008-02-05
| | | | | | 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
* 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
* Finally, out goes struct spinlock for anything but mutiprocessor targets ↵Michael Sevakis2008-01-18
| | | | | | where it becomes a reenterable corelock. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16105 a1c6a512-1295-4272-9138-f99709370657
* Fix FS#8052 - kernel.c compilation errors when compiling for debug. Just ↵Michael Sevakis2007-10-30
| | | | | | 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
* Add queue_peek to the kernel (written by Mike Sevakis), and use it to ↵Nicolas Pennequin2007-10-27
| | | | | | improve upon my previous commit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15336 a1c6a512-1295-4272-9138-f99709370657
* Be sure to register a new mutex owner _before_ waking it. Won't be an issue ↵Michael Sevakis2007-10-21
| | | | | | 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
* 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
* Stabilize PP5020 targets - tested on H10 5/20GB and iPod Color. Use no ↵Michael Sevakis2007-10-05
| | | | | | 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
* Enable auto reply for queue messages sent with queue_send. It's only ↵Michael Sevakis2007-09-30
| | | | | | 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
* 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
* Merge the Gigabeat S branch back into trunk. Fingers crossed nothing breaks.Will Robertson2007-09-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14805 a1c6a512-1295-4272-9138-f99709370657
* Add a new timeout API to the kernel. Enable only for e200 right now since ↵Michael Sevakis2007-07-29
| | | | | | 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
* Gigabeat: Add timer functionality. Rework tick timer setup to be exactly ↵Michael Sevakis2007-07-06
| | | | | | 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
* Gigabeat: Use vectored IRQ mode interrupts and add a trap for unhandled ones.Michael Sevakis2007-07-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13792 a1c6a512-1295-4272-9138-f99709370657
* current_tick really does need to be volatile since gcc can optimize away ↵Michael Sevakis2007-06-25
| | | | | | checking the value otherwise - found out the hard way. :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13715 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