{
#define C(hyp,user) regs->user = vcpu->arch.cpu_info->guest_cpu_user_regs.hyp
ALLREGS;
- if ( is_pv32_domain(vcpu->domain) )
+ if ( is_32bit_domain(vcpu->domain) )
{
ALLREGS32;
}
{
#define C(hyp,user) vcpu->arch.cpu_info->guest_cpu_user_regs.hyp = regs->user
ALLREGS;
- if ( is_pv32_domain(vcpu->domain) )
+ if ( is_32bit_domain(vcpu->domain) )
{
ALLREGS32;
}
switch ( domctl->u.address_size.size )
{
case 32:
- return switch_mode(d, DOMAIN_PV32);
+ return switch_mode(d, DOMAIN_32BIT);
case 64:
- return switch_mode(d, DOMAIN_PV64);
+ return switch_mode(d, DOMAIN_64BIT);
default:
return -EINVAL;
}
int decode_instruction(const struct cpu_user_regs *regs, struct hsr_dabt *dabt)
{
- if ( is_pv32_domain(current->domain) && regs->cpsr & PSR_THUMB )
+ if ( is_32bit_domain(current->domain) && regs->cpsr & PSR_THUMB )
return decode_thumb(regs->pc, dabt);
/* TODO: Handle ARM instruction */
/* Arch timer */
virt_timer_save(p);
- if ( is_pv32_domain(p->domain) && cpu_has_thumbee )
+ if ( is_32bit_domain(p->domain) && cpu_has_thumbee )
{
p->arch.teecr = READ_SYSREG32(TEECR32_EL1);
p->arch.teehbr = READ_SYSREG32(TEEHBR32_EL1);
p->arch.ttbcr = READ_SYSREG(TCR_EL1);
p->arch.ttbr0 = READ_SYSREG64(TTBR0_EL1);
p->arch.ttbr1 = READ_SYSREG64(TTBR1_EL1);
- if ( is_pv32_domain(p->domain) )
+ if ( is_32bit_domain(p->domain) )
p->arch.dacr = READ_SYSREG(DACR32_EL2);
p->arch.par = READ_SYSREG64(PAR_EL1);
#if defined(CONFIG_ARM_32)
p->arch.esr = READ_SYSREG64(ESR_EL1);
#endif
- if ( is_pv32_domain(p->domain) )
+ if ( is_32bit_domain(p->domain) )
p->arch.ifsr = READ_SYSREG(IFSR32_EL2);
p->arch.afsr0 = READ_SYSREG(AFSR0_EL1);
p->arch.afsr1 = READ_SYSREG(AFSR1_EL1);
WRITE_SYSREG64(n->arch.esr, ESR_EL1);
#endif
- if ( is_pv32_domain(n->domain) )
+ if ( is_32bit_domain(n->domain) )
WRITE_SYSREG(n->arch.ifsr, IFSR32_EL2);
WRITE_SYSREG(n->arch.afsr0, AFSR0_EL1);
WRITE_SYSREG(n->arch.afsr1, AFSR1_EL1);
WRITE_SYSREG(n->arch.ttbcr, TCR_EL1);
WRITE_SYSREG64(n->arch.ttbr0, TTBR0_EL1);
WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
- if ( is_pv32_domain(n->domain) )
+ if ( is_32bit_domain(n->domain) )
WRITE_SYSREG(n->arch.dacr, DACR32_EL2);
WRITE_SYSREG64(n->arch.par, PAR_EL1);
#if defined(CONFIG_ARM_32)
WRITE_SYSREG(n->arch.tpidrro_el0, TPIDRRO_EL0);
WRITE_SYSREG(n->arch.tpidr_el1, TPIDR_EL1);
- if ( is_pv32_domain(n->domain) && cpu_has_thumbee )
+ if ( is_32bit_domain(n->domain) && cpu_has_thumbee )
{
WRITE_SYSREG32(n->arch.teecr, TEECR32_EL1);
WRITE_SYSREG32(n->arch.teehbr, TEEHBR32_EL1);
isb();
- if ( is_pv32_domain(n->domain) )
+ if ( is_32bit_domain(n->domain) )
hcr &= ~HCR_RW;
else
hcr |= HCR_RW;
if ( is_idle_vcpu(current) )
reset_stack_and_jump(idle_loop);
- else if is_pv32_domain(current->domain)
+ else if is_32bit_domain(current->domain)
/* check_wakeup_from_wait(); */
reset_stack_and_jump(return_to_new_vcpu32);
else
struct vcpu_guest_context *ctxt = c.nat;
struct vcpu_guest_core_regs *regs = &c.nat->user_regs;
- if ( is_pv32_domain(v->domain) )
+ if ( is_32bit_domain(v->domain) )
{
if ( !is_guest_pv32_psr(regs->cpsr) )
return -EINVAL;
return res;
}
- if ( is_pv64_domain(d) )
+ if ( is_64bit_domain(d) )
{
res = fdt_property_string(fdt, "enable-method", "psci");
if ( res )
p2m_load_VTTBR(d);
#ifdef CONFIG_ARM_64
d->arch.type = kinfo.type;
- if ( is_pv32_domain(d) )
+ if ( is_32bit_domain(d) )
WRITE_SYSREG(READ_SYSREG(HCR_EL2) & ~HCR_RW, HCR_EL2);
else
WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_RW, HCR_EL2);
regs->pc = (register_t)kinfo.entry;
- if ( is_pv32_domain(d) )
+ if ( is_32bit_domain(d) )
{
regs->cpsr = PSR_GUEST32_INIT;
info->entry = info->zimage.load_addr;
info->load = kernel_zimage_load;
- info->type = DOMAIN_PV64;
+ info->type = DOMAIN_64BIT;
return 0;
}
info->load = kernel_zimage_load;
#ifdef CONFIG_ARM_64
- info->type = DOMAIN_PV32;
+ info->type = DOMAIN_32BIT;
#endif
return 0;
#ifdef CONFIG_ARM_64
if ( elf_32bit(&info->elf.elf) )
- info->type = DOMAIN_PV32;
+ info->type = DOMAIN_32BIT;
else if ( elf_64bit(&info->elf.elf) )
- info->type = DOMAIN_PV64;
+ info->type = DOMAIN_64BIT;
else
{
printk("Unknown ELF class\n");
/* Saved PC points to the instruction past the faulting instruction. */
uint32_t return_offset = is_thumb ? 2 : 4;
- BUG_ON( !is_pv32_domain(current->domain) );
+ BUG_ON( !is_32bit_domain(current->domain) );
/* Update processor mode */
cpsr_switch_mode(regs, PSR_MODE_UND);
uint32_t return_offset = is_thumb ? 4 : 0;
register_t fsr;
- BUG_ON( !is_pv32_domain(current->domain) );
+ BUG_ON( !is_32bit_domain(current->domain) );
cpsr_switch_mode(regs, PSR_MODE_ABT);
.ec = HSR_EC_UNKNOWN,
};
- BUG_ON( is_pv32_domain(current->domain) );
+ BUG_ON( is_32bit_domain(current->domain) );
regs->spsr_el1 = regs->cpsr;
regs->elr_el1 = regs->pc;
esr.ec = prefetch
? HSR_EC_INSTR_ABORT_CURR_EL : HSR_EC_DATA_ABORT_CURR_EL;
- BUG_ON( is_pv32_domain(current->domain) );
+ BUG_ON( is_32bit_domain(current->domain) );
regs->spsr_el1 = regs->cpsr;
regs->elr_el1 = regs->pc;
register_t addr,
int instr_len)
{
- if ( is_pv32_domain(current->domain) )
+ if ( is_32bit_domain(current->domain) )
inject_pabt32_exception(regs, addr);
#ifdef CONFIG_ARM_64
else
register_t addr,
int instr_len)
{
- if ( is_pv32_domain(current->domain) )
+ if ( is_32bit_domain(current->domain) )
inject_dabt32_exception(regs, addr);
#ifdef CONFIG_ARM_64
else
if ( guest_mode )
{
- if ( is_pv32_domain(v->domain) )
+ if ( is_32bit_domain(v->domain) )
show_registers_32(regs, ctxt, guest_mode, v);
#ifdef CONFIG_ARM_64
- else if ( is_pv64_domain(v->domain) )
+ else if ( is_64bit_domain(v->domain) )
show_registers_64(regs, ctxt, guest_mode, v);
#endif
}
{
unsigned long it;
- BUG_ON( !is_pv32_domain(current->domain) || !(cpsr&PSR_THUMB) );
+ BUG_ON( !is_32bit_domain(current->domain) || !(cpsr&PSR_THUMB) );
it = ( (cpsr >> (10-2)) & 0xfc) | ((cpsr >> 25) & 0x3 );
unsigned long itbits, cond, cpsr = regs->cpsr;
/* PSR_IT_MASK bits can only be set for 32-bit processors in Thumb mode. */
- BUG_ON( (!is_pv32_domain(current->domain)||!(cpsr&PSR_THUMB))
+ BUG_ON( (!is_32bit_domain(current->domain)||!(cpsr&PSR_THUMB))
&& (cpsr&PSR_IT_MASK) );
- if ( is_pv32_domain(current->domain) && (cpsr&PSR_IT_MASK) )
+ if ( is_32bit_domain(current->domain) && (cpsr&PSR_IT_MASK) )
{
/* The ITSTATE[7:0] block is contained in CPSR[15:10],CPSR[26:25]
*
advance_pc(regs, hsr);
break;
case HSR_EC_CP15_32:
- if ( ! is_pv32_domain(current->domain) )
+ if ( ! is_32bit_domain(current->domain) )
goto bad_trap;
do_cp15_32(regs, hsr);
break;
case HSR_EC_CP15_64:
- if ( ! is_pv32_domain(current->domain) )
+ if ( ! is_32bit_domain(current->domain) )
goto bad_trap;
do_cp15_64(regs, hsr);
break;
inject_undef64_exception(regs, hsr.len);
break;
case HSR_EC_SYSREG:
- if ( is_pv32_domain(current->domain) )
+ if ( is_32bit_domain(current->domain) )
goto bad_trap;
do_sysreg(regs, hsr);
break;
return PSCI_EINVAL;
/* THUMB set is not allowed with 64-bit domain */
- if ( is_pv64_domain(d) && is_thumb )
+ if ( is_64bit_domain(d) && is_thumb )
return PSCI_EINVAL;
if ( (ctxt = alloc_vcpu_guest_context()) == NULL )
ctxt->ttbr0 = 0;
ctxt->ttbr1 = 0;
ctxt->ttbcr = 0; /* Defined Reset Value */
- if ( is_pv32_domain(d) )
+ if ( is_32bit_domain(d) )
ctxt->user_regs.cpsr = PSR_GUEST32_INIT;
#ifdef CONFIG_ARM_64
else
switch (hsr.ec) {
case HSR_EC_CP15_32:
- if ( !is_pv32_domain(current->domain) )
+ if ( !is_32bit_domain(current->domain) )
return 0;
return vtimer_emulate_cp32(regs, hsr);
case HSR_EC_CP15_64:
- if ( !is_pv32_domain(current->domain) )
+ if ( !is_32bit_domain(current->domain) )
return 0;
return vtimer_emulate_cp64(regs, hsr);
#ifdef CONFIG_ARM_64
case HSR_EC_SYSREG:
- if ( is_pv32_domain(current->domain) )
+ if ( is_32bit_domain(current->domain) )
return 0;
return vtimer_emulate_sysreg(regs, hsr);
#endif
#ifdef CONFIG_ARM_64
enum domain_type {
- DOMAIN_PV32,
- DOMAIN_PV64,
+ DOMAIN_32BIT,
+ DOMAIN_64BIT,
};
-#define is_pv32_domain(d) ((d)->arch.type == DOMAIN_PV32)
-#define is_pv64_domain(d) ((d)->arch.type == DOMAIN_PV64)
+#define is_32bit_domain(d) ((d)->arch.type == DOMAIN_32BIT)
+#define is_64bit_domain(d) ((d)->arch.type == DOMAIN_64BIT)
#else
-#define is_pv32_domain(d) (1)
-#define is_pv64_domain(d) (0)
+#define is_32bit_domain(d) (1)
+#define is_64bit_domain(d) (0)
#endif
extern int dom0_11_mapping;