build-baremetal: enable parallel build and target selection just like build-userland

The factoring out also led to some small bugs being found and solved ;-)
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-17 00:00:00 +00:00
parent 455d5e191c
commit 635e5e3133
15 changed files with 167 additions and 150 deletions

View File

@@ -36,7 +36,7 @@ cpu1_sleep_forever:
cpu0_only:
/* Only CPU 0 reaches this point. */
#if !defined(GEM5)
#if !LKMC_GEM5
/* Wake up CPU 1 from initial sleep!
* See:https://github.com/cirosantilli/linux-kernel-module-cheat#psci
*/

View File

@@ -1,5 +1,6 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#svc */
#include <assert.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
@@ -57,8 +58,8 @@ int main(void) {
printf("daif 0x%" PRIx32 "\n", lkmc_sysreg_daif_read());
printf("spsel 0x%" PRIx32 "\n", lkmc_sysreg_spsel_read());
printf("vbar_el1 0x%" PRIx64 "\n", lkmc_sysreg_vbar_el1_read());
lkmc_assert(myvar == 0);
assert(myvar == 0);
LKMC_SVC(0x42);
lkmc_assert(myvar == 1);
assert(myvar == 1);
return 0;
}

View File

@@ -5,7 +5,7 @@
int main(void) {
uint32_t cpsr;
uint32_t mvfr1;
/*uint32_t mvfr1;*/
__asm__ ("mrs %0, cpsr" : "=r" (cpsr) : :);
/* TODO this is blowing up an exception, how to I read from it? */
/*__asm__ ("vmrs %0, mvfr1" : "=r" (mvfr1) : :);*/

View File

@@ -19,7 +19,7 @@ cpu1_sleep_forever:
wfe
b cpu1_sleep_forever
cpu0_only:
#if !defined(GEM5)
#if !LKMC_GEM5
/* PSCI CPU_ON. */
ldr r0, =0x84000003
mov r1, #1