Home
last modified time | relevance | path

Searched refs:guest_regs (Results 1 – 6 of 6) sorted by relevance

/frameworks/libs/binary_translation/guest_state/arm64/
Dget_cpu_state.cc28 NativeBridgeGuestRegs* guest_regs) { in LoadGuestStateRegisters() argument
33 guest_regs->guest_arch = NATIVE_BRIDGE_ARCH_ARM64; in LoadGuestStateRegisters()
34 return GetCpuState(guest_regs, &(static_cast<const ThreadState*>(guest_state_data))->cpu); in LoadGuestStateRegisters()
37 int GetCpuState(NativeBridgeGuestRegs* guest_regs, const CPUState* state) { in GetCpuState() argument
38 if (guest_regs->guest_arch != NATIVE_BRIDGE_ARCH_ARM64) { in GetCpuState()
39 ALOGE("The guest architecture is unmatched: %lu", guest_regs->guest_arch); in GetCpuState()
42 memcpy(&guest_regs->regs_arm64.x, &state->x, sizeof(guest_regs->regs_arm64.x)); in GetCpuState()
43 memcpy(&guest_regs->regs_arm64.sp, &state->sp, sizeof(guest_regs->regs_arm64.sp)); in GetCpuState()
44 memcpy(&guest_regs->regs_arm64.ip, &state->insn_addr, sizeof(guest_regs->regs_arm64.ip)); in GetCpuState()
45 memcpy(&guest_regs->regs_arm64.v, &state->v, sizeof(guest_regs->regs_arm64.v)); in GetCpuState()
Dget_cpu_state_test.cc31 NativeBridgeGuestRegs guest_regs{.guest_arch = NATIVE_BRIDGE_ARCH_ARM64}; in TEST() local
38 EXPECT_EQ(GetCpuState(&guest_regs, &cpu_state), 0); in TEST()
41 EXPECT_EQ(guest_regs.regs_arm64.x[i], cpu_state.x[i]); in TEST()
44 EXPECT_EQ(guest_regs.regs_arm64.v[i], cpu_state.v[i]); in TEST()
46 EXPECT_EQ(guest_regs.regs_arm64.sp, cpu_state.sp); in TEST()
47 EXPECT_EQ(guest_regs.regs_arm64.ip, cpu_state.insn_addr); in TEST()
51 NativeBridgeGuestRegs guest_regs{.guest_arch = NATIVE_BRIDGE_ARCH_ARM64}; in TEST() local
52 int res = LoadGuestStateRegisters(nullptr, sizeof(ThreadState) - 1, &guest_regs); in TEST()
57 NativeBridgeGuestRegs guest_regs{.guest_arch = NATIVE_BRIDGE_ARCH_RISCV64}; in TEST() local
59 int res = GetCpuState(&guest_regs, &cpu_state); in TEST()
/frameworks/libs/binary_translation/guest_state/riscv64/
Dget_cpu_state.cc28 NativeBridgeGuestRegs* guest_regs) { in LoadGuestStateRegisters() argument
33 guest_regs->guest_arch = NATIVE_BRIDGE_ARCH_RISCV64; in LoadGuestStateRegisters()
34 return GetCpuState(guest_regs, &(static_cast<const ThreadState*>(guest_state_data))->cpu); in LoadGuestStateRegisters()
37 int GetCpuState(NativeBridgeGuestRegs* guest_regs, const CPUState* state) { in GetCpuState() argument
38 if (guest_regs->guest_arch != NATIVE_BRIDGE_ARCH_RISCV64) { in GetCpuState()
39 ALOGE("The guest architecture is unmatched: %lu", guest_regs->guest_arch); in GetCpuState()
42 memcpy(&guest_regs->regs_riscv64.x, &state->x, sizeof(guest_regs->regs_riscv64.x)); in GetCpuState()
43 memcpy(&guest_regs->regs_riscv64.f, &state->f, sizeof(guest_regs->regs_riscv64.f)); in GetCpuState()
44 memcpy(&guest_regs->regs_riscv64.v, &state->v, sizeof(guest_regs->regs_riscv64.v)); in GetCpuState()
45 memcpy(&guest_regs->regs_riscv64.ip, &state->insn_addr, sizeof(guest_regs->regs_riscv64.ip)); in GetCpuState()
Dget_cpu_state_test.cc31 NativeBridgeGuestRegs guest_regs{.guest_arch = NATIVE_BRIDGE_ARCH_RISCV64}; in TEST() local
38 EXPECT_EQ(GetCpuState(&guest_regs, &cpu_state), 0); in TEST()
41 EXPECT_EQ(guest_regs.regs_riscv64.x[i], cpu_state.x[i]); in TEST()
44 EXPECT_EQ(guest_regs.regs_riscv64.f[i], cpu_state.f[i]); in TEST()
47 EXPECT_EQ(guest_regs.regs_riscv64.v[i], cpu_state.v[i]); in TEST()
49 EXPECT_EQ(guest_regs.regs_riscv64.ip, cpu_state.insn_addr); in TEST()
53 NativeBridgeGuestRegs guest_regs{.guest_arch = NATIVE_BRIDGE_ARCH_RISCV64}; in TEST() local
54 int res = LoadGuestStateRegisters(nullptr, sizeof(ThreadState) - 1, &guest_regs); in TEST()
59 NativeBridgeGuestRegs guest_regs{.guest_arch = NATIVE_BRIDGE_ARCH_ARM64}; in TEST() local
61 int res = GetCpuState(&guest_regs, &cpu_state); in TEST()
/frameworks/libs/native_bridge_support/guest_state_accessor/
Daccessor_proxy.cc55 NativeBridgeGuestRegs* guest_regs) { in LoadGuestStateRegisters() argument
78 return LoadGuestStateRegistersImpl(guest_state_data, guest_state_data_size, guest_regs); in LoadGuestStateRegisters()
/frameworks/libs/binary_translation/guest_state/include/berberis/guest_state/
Dget_cpu_state_opaque.h25 int GetCpuState(NativeBridgeGuestRegs* guest_regs, const CPUState* state);