[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/7] SPARC64: introduce a convenience function for g
From: |
Tsuneo Saito |
Subject: |
[Qemu-devel] [PATCH 3/7] SPARC64: introduce a convenience function for getting physical addresses |
Date: |
Fri, 22 Jul 2011 00:16:29 +0900 |
Introduce cpu_sparc_get_phys_page() to be used as a help for splitting
cpu_get_phys_page_debug() from cpu_get_phys_page_nofault().
Signed-off-by: Tsuneo Saito <address@hidden>
---
target-sparc/helper.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/target-sparc/helper.c b/target-sparc/helper.c
index f9b7fe2..9acbcae 100644
--- a/target-sparc/helper.c
+++ b/target-sparc/helper.c
@@ -736,18 +736,26 @@ void dump_mmu(FILE *f, fprintf_function cpu_fprintf,
CPUState *env)
#if !defined(CONFIG_USER_ONLY)
+static int cpu_sparc_get_phys_page(CPUState *env, target_phys_addr_t *phys,
+ target_ulong addr, int rw, int mmu_idx)
+{
+ target_ulong page_size;
+ int prot, access_index;
+
+ return get_physical_address(env, phys, &prot, &access_index, addr, rw,
+ mmu_idx, &page_size);
+}
+
target_phys_addr_t cpu_get_phys_page_nofault(CPUState *env, target_ulong addr,
int mmu_idx)
{
target_phys_addr_t phys_addr;
- target_ulong page_size;
- int prot, access_index;
- if (get_physical_address(env, &phys_addr, &prot, &access_index, addr, 2,
- mmu_idx, &page_size) != 0)
- if (get_physical_address(env, &phys_addr, &prot, &access_index, addr,
- 0, mmu_idx, &page_size) != 0)
+ if (cpu_sparc_get_phys_page(env, &phys_addr, addr, 2, mmu_idx) != 0) {
+ if (cpu_sparc_get_phys_page(env, &phys_addr, addr, 0, mmu_idx) != 0) {
return -1;
+ }
+ }
if (cpu_get_physical_page_desc(phys_addr) == IO_MEM_UNASSIGNED)
return -1;
return phys_addr;
--
1.7.5.4
- [Qemu-devel] [PATCH 0/7] SPARC64: fix nonfaulting load on softmmu, Tsuneo Saito, 2011/07/21
- [Qemu-devel] [PATCH 2/7] SPARC64: SFSR cleanup and fix, Tsuneo Saito, 2011/07/21
- [Qemu-devel] [PATCH 6/7] SPARC64: implement MMU miss traps on nonfaulting loads, Tsuneo Saito, 2011/07/21
- [Qemu-devel] [PATCH 7/7] SPARC64: implement addtional MMU faults related to nonfaulting load, Tsuneo Saito, 2011/07/21
- [Qemu-devel] [PATCH 4/7] SPARC64: split cpu_get_phys_page_debug() from cpu_get_phys_page_nofault(), Tsuneo Saito, 2011/07/21
- [Qemu-devel] [PATCH 5/7] SPARC64: fix fault status overwritten on nonfaulting load, Tsuneo Saito, 2011/07/21
- [Qemu-devel] [PATCH 3/7] SPARC64: introduce a convenience function for getting physical addresses,
Tsuneo Saito <=
- [Qemu-devel] [PATCH 1/7] SPARC64: TTE bits cleanup, Tsuneo Saito, 2011/07/21
- Re: [Qemu-devel] [PATCH 0/7] SPARC64: fix nonfaulting load on softmmu, Blue Swirl, 2011/07/21