Add common linked list functions

Forms implemented to a greater or lesser degree at the moment:
ll_*   = singly-linked list
lld_*  = doubly-linked list
lldc_* = doubly-linked circular list

Change-Id: Ieed5af50fc59165c8b14c3513b3b5d0e6f7de9fa
Base scheduler queues off linked lists and do cleanup/consolidation

Abstracts threading from itself a bit, changes the way its queues are
handled and does type hiding for that as well.

Do alot here due to already required major brain surgery.

Threads may now be on a run queue and a wait queue simultaneously so
that the expired timer only has to wake the thread but not remove it
from the wait queue which simplifies the implicit wake handling.

List formats change for wait queues-- doubly-linked, not circular.
Timeout queue is now singly-linked. The run queue is still circular
as before.

Adds a better thread slot allocator that may keep the slot marked as
used regardless of the thread state. Assists in dumping special tasks
that switch_thread was tasked to perform (blocking tasks).

Deletes alot of code yet surprisingly, gets larger than expected.
Well, I'm not not minding that for the time being-- omlettes and break
a few eggs and all that.

Change-Id: I0834d7bb16b2aecb2f63b58886eeda6ae4f29d59
Fix warnings from 6ed0087

Forgot to (void) an unused parameter when priorityless.

usb-drv-rl27xx.c was using a compound init to initialize a semaphore
but the structure changed so that it is no longer correct. Use
designated initializers to avoid having to complete all fields.

Forgot to break compatibility on all plugins and codecs since the
kernel objects are now different. Take care of that too and do the
sort thing.

Change-Id: Ie2ab8da152d40be0c69dc573ced8d697d94b0674
Oops. Broke an egg. Restore wrongly removed code in mutex.c.

Nice colorful diffs reveals some lines that should NOT have been
removed when !defined(HAVE_PRIORITY_SCHEDULING) in mutex_unlock.

Change-Id: I4152ea864b7706217c670e1b99250b09e69c5858
Always unboost at exit

Change-Id: I8b4a2d61a5f4491265888d84c0f2c684bcf38edb
Reviewed-on: http://gerrit.rockbox.org/915
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
thread-unix patchup!

The changed thread code may not wish to save the old context under
certain circumstances but thread-unix.c assumed it would, cached it
and used it unconditionally.

Also, prevent it from leaking away all the jump buffers (old problem).
Creating and removing threads would eventually run it out of buffers
and then it would crash after that. Plugins, like Pictureflow, which
have worker threads could only be started a few times. Implement a
simple O(1) allocator that will reuse them and stays self-contained
to its own types (as it appears the original author intended).

Change-Id: Icf65413c086b346fb79bf827102b725269e2812c
2048: service pack 1 :)
- fixed some bugs
- added 1-bit LCD support

Change-Id: I7bb458d79d799dcd6b11d9d538773404f9a7f97c
Reviewed-on: http://gerrit.rockbox.org/917
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Added Clip/+ to 2048 targets

Change-Id: I9fb5a50f214e9dd87d1f1f62f4324876bdd94fe8
Reviewed-on: http://gerrit.rockbox.org/918
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Make sure load_context is the last thing in switch_thread.

This should fix the android crash issue (fingers crossed).

Change-Id: I9d3f773dbdf7dde60bd76962dcf66a3bad8b0925
Fixed a chip8 bug

Change-Id: Ia28610713461eb02e8911be7fa0d5ad8ec8ba7fe
Reviewed-on: http://gerrit.rockbox.org/919
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
Yellow go bye-bye

Change-Id: I12ce8b7781b4b1ce1c47b2973057586177f90157
Reviewed-on: http://gerrit.rockbox.org/923
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
Hope this works...

Change-Id: I8a94f0be82f63ed1e81433beb41ff2d60a1e6eef
Reviewed-on: http://gerrit.rockbox.org/926
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
One last missing !defined(SIMULATOR) for chip8

Change-Id: Iab2d9150126f6c611604469d105186b936825012
Ukrainian language update

Change-Id: Ie06a1a1ecded66d1efb3beeee1aa7b69656715ef
Reviewed-on: http://gerrit.rockbox.org/921
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Fuze+: fixed brightness settings: previously there were 81 settings for only 26 possible brightnesses, now there are 33 for 33

Change-Id: Idc6e3a635850f3ee54ec23246795af88af960ab0
Reviewed-on: http://gerrit.rockbox.org/916
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
Do a better endian.h setup that isn't as fragile

We redefine the top-level macros to our own in order to maintain
compatibility with compound initializers by wrapping the mid or low
level definitions from the OS header.

This allows, hopefully optimized, macros from the host OS's headers to
be used when building any hosted target obviating the need for
NEED_GENERIC_BYTESWAPS unless the target simply doesn't define its
own optimized versions (MIPS!).

Throw in some 64-bit swaps for completeness' sake; they generate no code
if not yet used anyway.

Change-Id: I21b384b55fea46833d01ea3cad1ad8952ea01a11
panicf doesn't return so why not tell GCC and $AVE :

Change-Id: I6096576f539bfb02b340b82fabc5019f6756b722
Remove unused return value variable in lib/unwarminder/backtrace.c

Stop the Android warning about it

Change-Id: I2f01220004f128befaa5757786b8de174566cbb5
hwpatcher: add framework for CRC computation

Change-Id: Ib78f0fe58db5cec86f043d3e9e1ca14e69297ba0
Reviewed-on: http://gerrit.rockbox.org/911
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Patch up rbendian.h for Win32 cross-compile

MingW doesn't provide that stuff.

Change-Id: Ifa8310ed00f4f79f06adb71db71e58b70e7d2b60