libc: add minimal support for AArch64

this contains still prototyped code, which if reached either
hangs (setjmp, longjmp), aborts (all that requires mmu::),
or implements differently (allocating with malloc instead of mmap)
This is enough libc AArch64 support for reaching the end of premain.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
bsd/aarch64: improve inline assembly for atomic and endian ops

use %wn when referring to the non-extended register n,
and %n when referring to the extended register n,
emit the right memory barrier instructions, get the
semantics of atomic_store_rel hopefully right.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
bsd: implement virt_to_phys for AArch64 as nop

virt_to_phys just returns the virtual address again
for AArch64 for now.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
arch.hh: introduce arch::halt_no_interrupts

rename processor::halt_no_interrupts to cli_hlt, which
logically matches existing processor::sti_hlt.

Make use of arch::halt_no_interrupts in core/power.cc,
enclose x64-specific code in ifdefs, as well as putting
code on AArch64.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
arch/aarch64: first implementation

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
drivers: move debug-console to arch-specific dir

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
include/api/aarch64: first implementation

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
debug: add debug_early functionality

the functions debug_early, debug_early_u64 and
debug_early_entry can be used very early, before premain.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
drivers/console: allowing building for AArch64

stub console_init for AArch64.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
include/osv/trace.hh: protect x64-specific code in ifdef

protect x64 machine code in #ifdef __x86_64__

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
elf: ifdef x64-specific code, add AArch64 dynamic rels

implementation includes only for the few rels that are actually
encountered during elf::get_init().

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
fs: add minimal stubs for AArch64

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
include: remove unused include file

include/api/x64/atomic.h is not used anywhere.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
core: add AArch64 stubs for mempool and mmio.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
core: add AArch64 stubs for sched.cc

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
loader, runtime: add stubs for AArch64

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
build.mk: enable first AArch64 stubbed support

This should build and reach end of premain.

See PORTING for some initial build instructions.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>