mini-os: headers for ARM

Adds header files for future ARM support.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
[talex5@gmail.com: split into multiple patches]
[talex5@gmail.com: include hypervisor.h from os.h, as on x86]
[talex5@gmail.com: implemented bitops for ARM]
[talex5@gmail.com: added arch_endian.h for ARM]
[talex5@gmail.com: removed unused hypercalls and inlines]
[talex5@gmail.com: renamed hypercall-arm32 to just hypercall-arm]
[talex5@gmail.com: moved GIC driver to arm directory]
[talex5@gmail.com: added HYPERVISOR_xsm_op]
[talex5@gmail.com: fixes suggested by Julien Grall:
- Removed old x86 comment from arm/arch_spinlock.h.
- Removed unimplemented _raw_spin_lock_flags.
- Renamed __cli/__sti to local_irq_disable/local_irq_enable.
- Cleaned up interrupt macros.
- Avoid disabling the Asynchronous Abort exception.
- Added memory clobber to barriers.
- Enable barriers on __aarch64__ too.
- Use compiler.h for likely/unlikely macros.
- Replaced dmb with slower but safer dsb for now.]
[talex5@gmail.com: made image relocatable]
[talex5@gmail.com: added mfn_to_pfn and pfn_to_mfn]

Signed-off-by: Thomas Leonard <talex5@gmail.com>
mini-os: import libfdt

Looks like this is revision v1.3.0-47-gbe60268 from
http://git.jdl.com/gitweb/?p=dtc.git

The memmove implementation is from FreeBSD's
contrib/ldns/compat/memmove.c (r246827).

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
[talex5@gmail.com: split out FDT support into a separate patch]
[talex5@gmail.com: fixed "make clean" for FDT]
[talex5@gmail.com: replaced GPL memmove with BSD one]
Signed-off-by: Thomas Leonard <talex5@gmail.com>
mini-os: initial ARM support

Based on an initial patch by Karim Raslan.

On ARM, Mini-OS will boot and display some output on the console.
Tested with:

make XEN_TARGET_ARCH=arm32 CROSS_COMPILE=arm-linux-gnueabihf- \
	CONFIG_TEST=y CONFIG_START_NETWORK=n CONFIG_BLKFRONT=n \
	CONFIG_NETFRONT=n CONFIG_FBFRONT=n CONFIG_KBDFRONT=n \
	CONFIG_CONSFRONT=n CONFIG_XC=n -j4

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>

---

Changes since v5:

- Moved SVC stack to first 16KB of RAM (provides some protection against
  stack overlow corrupting memory).
- Put translation table in second 16KB (simplifies boot code).
- Define physical_address_offset in C, not asm.
- Moved shared_info_page and irqstack to .bss section (smaller image).
mini-os: arm: show registers, stack and exception vector on fault

Signed-off-by: Thomas Leonard <talex5@gmail.com>
mini-os: include kernel.h from arm/os.h

This is for consistency with x86/os.h and is needed to compile with
lwIP.
mini-os: reorganised arch headers

Before, we had:

- include
- include/arm
- include/x86

Where either arm or x86 was added directly to the search path. So
<x86/arch_limits.h> was the same file as <arch_limits.h> on x86.

We now have:

- include
- arch/arm/include
- arch/x86/include

This means that only the second form is now legal. It also simplifies
installation of the headers, since we can now install everything in the
include directory without getting files for other archs.
mini-os: added make install target

This installs libminios.a, the linker script, the headers and a
pkg-config file to locate them.
mini-os: expose gnttab_table, NR_GRANT_FRAMES, etc

Needed by Mirage.
mini-os: make do_hypervisor_callback weak

This is for Mirage, which handles events synchronously by checking for
pending events before blocking.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
mini-os: added stub for printing floats for sprintf, etc

Override the weak __printf_render_float to implement.
mini-os: x86_64: make thread stacks 16-byte aligned

Otherwise, passing doubles to varargs functions causes a crash.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
mini-os: make start_kernel weak

Possibly we should just move it to test.c. It should be up to
applications which features they want to initialise.