or1k: change stack variable naming in libgloss

Before a pointer to the top of the stack was required by sbrk to
determine whether sufficient space is available. Instead we now use
three variables in crt0.S:

 * stack_top: points to top of the stack

 * stack_bottom: points to bottom of the reserved stack

 * stack_size: The size of the stack, set by the define STACK_SIZE

This has the advantage, that we can simply compare to the stack_bottom
can later easily allocate multiple stacks for the different cores and
just point to top and bottom of the reserved area.
or1k: Use extra stack for exception handling

Use an extra stack for the exception handling. Reason: We cannot
simply use the current stack pointer. We therefore reserve an extra
system exception stack, that is only used during exceptions.

The loading of the exception stack address needs an extra (clean)
register. Discussion goes on on how to solve this issue. For the
moment we use address 0x4 in the global memory.
or1k: Use macros in crt0.S and comment it

Use the LOAD_SYMBOL_2_GPR macro for readability and extend documentation.
or1k: Fix missing files in Makefile.am

The or1k-support-* files were missing in Makefile.am, but added in
Makefile.in. Add them to Makefile.am and recreate Makefile.in and
configure.
or1k: Dynamic reentrancy and exception impure data

With the previous implementation there was only one impure data
structure. Problems occur if an exception happens during a library
function. The impure data is then shared and may be corrupted.

This changes this behavior by implementing two different impure data
structures for the normal software execution and for exceptions. The
currently active impure data pointer is stored in an extra variable.
During the exception handler the data pointer is replaced temporarily
and later restored.

Furthermore this enables dynamic reentrancy, meaning there is a
function __getreent() that returns the currently active impure data
pointer. This is not really necessary, but flexible with respect to
the future multicore implementation.
or1k: Update core support in newlib and document

Extend the functionality of the support library in newlib:

 * Add or1k_interrupts_enable, or1k_interrupts_disable and
   or1k_interrupts_restore. Those functions handle the IEE flag in the
   status register.

 * Add the ability to re-configure the timer mode.

 * Add the ability to re-configure the timer handler. Currently only a
   tick counter is integrated by calling init. Keep this behavior for
   compatibility, but it is now possible to set own timer handlers,
   e.g., for scheduling etc.

 * The timer period can be re-configured now.

 * The timer initialization returns an int now which is -1 when the
   timer is not present. This does not break current implementations
   as it returns an int instead of nothing before.

 * Enabling the timer now also involves configuring the pre-set timer
   mode.

 * or1k_timer_disable now returns the TEE flag before the function was
   called. Together with the new or1k_timer_restore it therefore
   simplefies the implementation of atomic sections.

 * or1k_timer_pause pauses the counter. It can be continued by calling
   or1k_timer_enable.

Furthermore the whole support header is documented with doxygen. The
doxygen configuration is also part of this patch. Generate the
documentation in doc/ by running doxygen or1k-support.doxy.
or1k: Add malloc lock to newlib

As malloc may be called during software runtime or during an
exception, it is necessary to lock the access. In single core
environments it is sufficient to disable all interrupts during the
execution of malloc. This patch does this. The implementation also
keeps track of the current lock holder and allows recursion. Actually
both the exception and the software will never try to lock the malloc
while it is locked by the other one, as they are locked out during the
entire duration of the first call to __malloc_lock until the end of
the last call to __malloc_unlock. But this is the generic
implementation that eases extension to multicore.
or1k: Boards in libgloss

 * Adds two functions to a board implementation: _board_init and
   _board_init_early. _board_init is called after the C library is
   initialized before main is called, _board_init_early is called in
   the very beginning before anything happened (not even stack!).

 * Call functions from _start(crt0.S)

 * Empty board templates

 * README.boards for instructions of how to add a new board

Changelog: 2014-05-10  Stefan Wallentowitz  <stefan.wallentowitz@tum.de>
	    * or1k/crt0.S: Add board initialization function calls
	    * or1k/atlys.S: Empty implementation of board initialization functions
	    * or1k/de0_nano.S: ditto
	    * or1k/ml501.S: ditto
	    * or1k/or1ksim-uart.S: ditto
	    * or1k/or1ksim.S: ditto
	    * or1k/ordb1a3pe1500.S: ditto
	    * or1k/ordb2a.S: ditto
	    * or1k/orpsocrefdesign.S: ditto
	    * or1k/board_tmpl.c: New file, C board template
	    * or1k/board_tmpl.S: New file, assembly board template
	    * or1k/README.board: New file, add new board description
or1k: Code formatting and documentation in crt0.S

Follow up on the pull request discussion, this patch:

 * replaces 4 space identation with tabs, tabs for structuring

 * unifies the coding (spaces after commas, ..)

 * documents the coding guideline for this file as it is a rather
   sensible one

 * completes the main part documentation
Merge pull request #7 from wallento/or1k

Significant changes in or1k libgloss and newlib