Add ACPICA to amd64

The package can compile successfully, but OS interface
remain unimplemented in acpiosl.c
Add CPUID helper for AMD64
LACPI init and cpu map init

TODO: IO-ACPI not init
Extract NUMA info from ACPI table(SRAT)

refer to xv6. The NUMA node structure is
defined in driver/mp.h
setup percpu variable

Percpu variable implementation:
1. CPU0 percpu var allocated in .percpu
2. other cpus' var dynamically allocated
3. percpu var runtime allocation not supported

NOTES:
1. myid(), get id of the current cpu
2. mycpu(), get cpu struct of the current cpu
3. myid() and mycpu() only available after tls_init()
Alloc percpu variable for APs

Now, we allocate AP's percpu variables with alloc_pages()
Should consider NUMA in the future.
IOAPIC init for CPU0

All ext int are redirect to CPU0 only,
TODO: Fix trap.c: irq_enable
Prepare for code freeze(AMD64)

NOTE: some macros maybe undefined for other platform
e.g.
CACHELINE, MAX_XXX
Save/restore GS BASE by invoking 'swapgs'

The user space program may mysteriously change GS BASE in MSR, ruining
per-cpu storage in kernel if not handled. This patch invokes 'swapgs'
at the beginning and end of the trap handler to avoid the issue.

Signed-off-by: Junjie Mao <eternal.n08@gmail.com>
Get rid of PLS-related code in amd64

PLS (Processor Local Storage) is the legacy per-cpu storage implementation
derived from the old supervisor-based multi-core support. Replace them
with the latest per-cpu macros.

Signed-off-by: Junjie Mao <eternal.n08@gmail.com>
Remove src/glue-kern/*** in amd64 code

Signed-off-by: Junjie Mao <eternal.n08@gmail.com>
Get rid of glue_*** under src/kern-ucore/arch

Signed-off-by: Junjie Mao <eternal.n08@gmail.com>
Get rid of glue-*** under kern-ucore

Signed-off-by: Junjie Mao <eternal.n08@gmail.com>
Move amd64 non-generic multi-core code under arch/amd64/mp

Signed-off-by: Junjie Mao <eternal.n08@gmail.com>
Clean up duplicated next_thread()

Signed-off-by: Junjie Mao <eternal.n08@gmail.com>
Merge branch 'mjj/refactor' of github.com:eternalNight/ucore_plus-next into mjj/refactor