[LIBS] bitmap: Make DECLARE_BITMAP() linux-like

This patch makes DECLARE_BITMAP() linux-compatible for porting
drivers from linux.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] Fully linux-compatible linux/of.h

This patch adds lot of linux-compatible of_xxx() APIs for ease
in driver porting.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Introduce inline functions to encode error values in pointer

Lot of linux drivers and driver frameworks encode error values in
pointers hence we introduce our version of error-to-pointer encoding
functions.

Linux kernel directly type-cast negative error values into void
pointer but we encode negative error values as void pointer from
range 0x00000000 to 0x00001000. In other words, we encode negative
error values and void pointers higher than NULL pointer. Encoding
error values this way helps us cause fault when such a pointer is
accessed.

All architectures will need to ensure that virtual address range
0x00000000 to 0x00001000 is not used for anything.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Return VMM_EFAIL when ptr==NULL in VMM_PTR_ERR()

A NULL pointer is an error hence we should be returning failure
error code in VMM_PTR_ERR() for ptr==NULL.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] Use IS_ERR(x) to check for errors from clk_get()

We should be using error encoding macros to check for errors from
clk_get() and of_clk_get().

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] More updates to linux compatiblity headers

This patch adds few placeholder linux compatiblity headers and
also updates few headers such as: linux/delay.h, linux/device.h,
linux/gpio.h, linux/kernel.h, linux/list.h, linux/mod_devicetable.h,
linux/module.h, and linux/slab.h

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] Fully linux compatible common clocking framework

Currently, we had implemented common clocking framework with large
changes/adaptaion from linux common clocking framework.

This patch revamps common clocking framework and makes it fully
compatible/similar to linux common clocking framework. Almost all
clocking drivers in Xvisor are unmodified Linux clocking drivers.

The drivers/include/drv/clk.h is the only header shared between
pure Xvisor drivers and linux ported drivers.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic: Enable sunxi_mmc driver for ARMv7

Somehow we skipped the sunxi_mmc driver for generic-v7 hence
this patch.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Don't access FPSID for ARMv5

FPSID access on ARMv5 emulated by QEMU throws undefined exception.

We are anyways not supporting VFP context switching on ARMv5 hence
hence this patch ensures that we don't access FPSID on ARMv5.

Signed-off-by: Anup Patel <anup@brainfault.org>