fxBoot/src/hypervisor/install.S

36 lines
511 B
ArmAsm

#if 0
.section .hypervisor.text, "ax"
.global _hypervisor_install
.align 2
_hypervisor_install:
/* check if the hypervisor is installed */
stc vbr, r0
mov.l hypervisor_vbr, r1
cmp/eq r1, r0
bf install
rts
mov #-1, r0
install:
/* Block all interrupts by setting IMASK=15 */
mov #0xf, r0
shll2 r0
shll2 r0
stc sr, r2
or r2, r0
ldc r0, sr
/* install the hypervisor */
ldc r1, vbr
/* restore VBR then exit */
ldc r2, sr
rts
xor r0, r0
.align 4
hypervisor_vbr:
.long _hypervisor_vbr
#endif