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: don't include lib.h from mm.h

This breaks the include cycle hypervisor.h -> hypercall-x86_32.h -> mm.h
-> lib.h -> gntmap.h -> os.h -> hypervisor.h.

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

Avoids using _hypercall1 in events.c.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
mini-os: headers for ARM

Adds header files for future ARM support.
Based on work by Karim Allah Ahmed.

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

---

Since v5:

Define BUG to cause an undefined instruction fault. This will let
us dump the registers.

Renamed stack to _boot_stack for clarity.
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).

Addressed Julien Grall's comments:
- Added comments explaining the lengths when checking FDT properties.
- Fixed (commented) DEBUG macro.
- Drop check for arm,cortex-a9-gic.
- Get hypercall numbers from xen.h.
- Avoid duplicating the definition of _start's virtual address.
- Added paddr_t type to represent physical addresses.

- Require only minimum property lengths (requested by Ian Campbell).
mini-os: arm: show registers, stack and exception vector on fault

Signed-off-by: Thomas Leonard <talex5@gmail.com>

---

Exit with SHUTDOWN_crash on BUG or fault (suggested by Ian Campbell).