list: added list_add_tail

Added a list API function to add a list item to the tail of the given
head.

Signed-off-by: Michel Megens <dev@michelmegens.net>
irq: chip: fixed a list_add bug.

The parameter order of list_add is to first pass the new object you want
to add to the list and secondly the list head. The list head is the
object the where the first object will be added after. Consider the
following list:

X - Y - Z

If you now call list_add as follows:
	* list_add(&A, &Y)

The list will look like:

X - Y - A - Z

The list_add in irq_chip_add_irq called list_add in the wrong way (i.e.
the head first and the new object as second parameter). Flipped them to
fix.

Signed-off-by: Michel Megens <dev@michelmegens.net>
simulavr: added exit register

Added an exit register definition for simul avr (SIME (SImulator Exit)).
Writing a value to this register exits the simulator and displays the
value written to the register as error code on the console. Can be used
in tests to exit with error codes.

Signed-off-by: Michel Megens <dev@michelmegens.net>
git: ignore: added an entry for vim swp files.

Vims .swp files can no longer accidently end up in the repository as
there is an entry for them in the .gitignore file now.

Signed-off-by: Michel Megens <dev@michelmegens.net>
usr: tests: added automated tests to usr/

Automated tests can be added to usr/ from now on. These tests can be
designed to run on real hardware or on simulators of real hardware. To
run all tests issue the following command in usr/

`make tests'

To run a specific test, cd into the usr/tests directory and run:

`make <testname>'

Signed-off-by: Michel Megens <dev@michelmegens.net>
avr: timer: implemented the avr sys-clk init.

The AVR system clock is run of the AVR core timer 0, which is an 8 bit
HR timer. The timer is configured to interrupt on overflow, which occurs
at each time the timer hits 125 or 250 (depending on the CPU frequency). The
timer only works for CPU's running on either 8MHz or 16Mhz:

 8Mhz/64/125 = 1000Hz
16Mhz/64/250 = 1000Hz

Signed-off-by: Michel Megens <dev@michelmegens.net>
Merge branch 'master' into irq

* Unit tests in usr/tests
* Bunch of minor fixes

Signed-off-by: Michel Megens <dev@michelmegens.net>

Conflicts:
	arch/avr/include/asm/iom328.h
	kernel/irq/irqchip.c
link: irq: fixed a linking error.

The interrupt vectors are defined from PROGMEM address 0x0 - 0xXXXX.
There was some linking error which placed garbage at the first ~30-ish
bytes of the program memory. Up until now, this wasn't a problem,
however as soon as interrupts come in play it caused a crash because the
right IRQ vector couldn't be found.

Signed-off-by: Michel Megens <dev@michelmegens.net>
test: clock: added a test for the IRQ based clock.

usr/tests/sysclk contains a test to test if the IRQ based clock source
is working.

Signed-off-by: Michel Megens <dev@michelmegens.net>
irq: dbg: added a debug counter to the AVR IRQ.

Added a debugging symbol (unsigned long) to the AVR interrupt sevice
routine for the system clock. This symbol is used by the sysclk unit
test.

Signed-off-by: Michel Megens <dev@michelmegens.net>