monitor: Remove some type casts which are no longer needed
All other type casts in calls of cpu_physical_memory_read are used by hardware emulations and will be fixed by separate patches. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
71d2b725e1
commit
b8b79323d0
48
monitor.c
48
monitor.c
@ -2026,7 +2026,7 @@ static void tlb_info_32(Monitor *mon, CPUState *env)
|
|||||||
|
|
||||||
pgd = env->cr[3] & ~0xfff;
|
pgd = env->cr[3] & ~0xfff;
|
||||||
for(l1 = 0; l1 < 1024; l1++) {
|
for(l1 = 0; l1 < 1024; l1++) {
|
||||||
cpu_physical_memory_read(pgd + l1 * 4, (uint8_t *)&pde, 4);
|
cpu_physical_memory_read(pgd + l1 * 4, &pde, 4);
|
||||||
pde = le32_to_cpu(pde);
|
pde = le32_to_cpu(pde);
|
||||||
if (pde & PG_PRESENT_MASK) {
|
if (pde & PG_PRESENT_MASK) {
|
||||||
if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) {
|
if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) {
|
||||||
@ -2034,8 +2034,7 @@ static void tlb_info_32(Monitor *mon, CPUState *env)
|
|||||||
print_pte(mon, (l1 << 22), pde, ~((1 << 21) - 1));
|
print_pte(mon, (l1 << 22), pde, ~((1 << 21) - 1));
|
||||||
} else {
|
} else {
|
||||||
for(l2 = 0; l2 < 1024; l2++) {
|
for(l2 = 0; l2 < 1024; l2++) {
|
||||||
cpu_physical_memory_read((pde & ~0xfff) + l2 * 4,
|
cpu_physical_memory_read((pde & ~0xfff) + l2 * 4, &pte, 4);
|
||||||
(uint8_t *)&pte, 4);
|
|
||||||
pte = le32_to_cpu(pte);
|
pte = le32_to_cpu(pte);
|
||||||
if (pte & PG_PRESENT_MASK) {
|
if (pte & PG_PRESENT_MASK) {
|
||||||
print_pte(mon, (l1 << 22) + (l2 << 12),
|
print_pte(mon, (l1 << 22) + (l2 << 12),
|
||||||
@ -2056,13 +2055,12 @@ static void tlb_info_pae32(Monitor *mon, CPUState *env)
|
|||||||
|
|
||||||
pdp_addr = env->cr[3] & ~0x1f;
|
pdp_addr = env->cr[3] & ~0x1f;
|
||||||
for (l1 = 0; l1 < 4; l1++) {
|
for (l1 = 0; l1 < 4; l1++) {
|
||||||
cpu_physical_memory_read(pdp_addr + l1 * 8, (uint8_t *)&pdpe, 8);
|
cpu_physical_memory_read(pdp_addr + l1 * 8, &pdpe, 8);
|
||||||
pdpe = le64_to_cpu(pdpe);
|
pdpe = le64_to_cpu(pdpe);
|
||||||
if (pdpe & PG_PRESENT_MASK) {
|
if (pdpe & PG_PRESENT_MASK) {
|
||||||
pd_addr = pdpe & 0x3fffffffff000ULL;
|
pd_addr = pdpe & 0x3fffffffff000ULL;
|
||||||
for (l2 = 0; l2 < 512; l2++) {
|
for (l2 = 0; l2 < 512; l2++) {
|
||||||
cpu_physical_memory_read(pd_addr + l2 * 8,
|
cpu_physical_memory_read(pd_addr + l2 * 8, &pde, 8);
|
||||||
(uint8_t *)&pde, 8);
|
|
||||||
pde = le64_to_cpu(pde);
|
pde = le64_to_cpu(pde);
|
||||||
if (pde & PG_PRESENT_MASK) {
|
if (pde & PG_PRESENT_MASK) {
|
||||||
if (pde & PG_PSE_MASK) {
|
if (pde & PG_PSE_MASK) {
|
||||||
@ -2072,8 +2070,7 @@ static void tlb_info_pae32(Monitor *mon, CPUState *env)
|
|||||||
} else {
|
} else {
|
||||||
pt_addr = pde & 0x3fffffffff000ULL;
|
pt_addr = pde & 0x3fffffffff000ULL;
|
||||||
for (l3 = 0; l3 < 512; l3++) {
|
for (l3 = 0; l3 < 512; l3++) {
|
||||||
cpu_physical_memory_read(pt_addr + l3 * 8,
|
cpu_physical_memory_read(pt_addr + l3 * 8, &pte, 8);
|
||||||
(uint8_t *)&pte, 8);
|
|
||||||
pte = le64_to_cpu(pte);
|
pte = le64_to_cpu(pte);
|
||||||
if (pte & PG_PRESENT_MASK) {
|
if (pte & PG_PRESENT_MASK) {
|
||||||
print_pte(mon, (l1 << 30 ) + (l2 << 21)
|
print_pte(mon, (l1 << 30 ) + (l2 << 21)
|
||||||
@ -2098,13 +2095,12 @@ static void tlb_info_64(Monitor *mon, CPUState *env)
|
|||||||
|
|
||||||
pml4_addr = env->cr[3] & 0x3fffffffff000ULL;
|
pml4_addr = env->cr[3] & 0x3fffffffff000ULL;
|
||||||
for (l1 = 0; l1 < 512; l1++) {
|
for (l1 = 0; l1 < 512; l1++) {
|
||||||
cpu_physical_memory_read(pml4_addr + l1 * 8, (uint8_t *)&pml4e, 8);
|
cpu_physical_memory_read(pml4_addr + l1 * 8, &pml4e, 8);
|
||||||
pml4e = le64_to_cpu(pml4e);
|
pml4e = le64_to_cpu(pml4e);
|
||||||
if (pml4e & PG_PRESENT_MASK) {
|
if (pml4e & PG_PRESENT_MASK) {
|
||||||
pdp_addr = pml4e & 0x3fffffffff000ULL;
|
pdp_addr = pml4e & 0x3fffffffff000ULL;
|
||||||
for (l2 = 0; l2 < 512; l2++) {
|
for (l2 = 0; l2 < 512; l2++) {
|
||||||
cpu_physical_memory_read(pdp_addr + l2 * 8, (uint8_t *)&pdpe,
|
cpu_physical_memory_read(pdp_addr + l2 * 8, &pdpe, 8);
|
||||||
8);
|
|
||||||
pdpe = le64_to_cpu(pdpe);
|
pdpe = le64_to_cpu(pdpe);
|
||||||
if (pdpe & PG_PRESENT_MASK) {
|
if (pdpe & PG_PRESENT_MASK) {
|
||||||
if (pdpe & PG_PSE_MASK) {
|
if (pdpe & PG_PSE_MASK) {
|
||||||
@ -2114,8 +2110,7 @@ static void tlb_info_64(Monitor *mon, CPUState *env)
|
|||||||
} else {
|
} else {
|
||||||
pd_addr = pdpe & 0x3fffffffff000ULL;
|
pd_addr = pdpe & 0x3fffffffff000ULL;
|
||||||
for (l3 = 0; l3 < 512; l3++) {
|
for (l3 = 0; l3 < 512; l3++) {
|
||||||
cpu_physical_memory_read(pd_addr + l3 * 8,
|
cpu_physical_memory_read(pd_addr + l3 * 8, &pde, 8);
|
||||||
(uint8_t *)&pde, 8);
|
|
||||||
pde = le64_to_cpu(pde);
|
pde = le64_to_cpu(pde);
|
||||||
if (pde & PG_PRESENT_MASK) {
|
if (pde & PG_PRESENT_MASK) {
|
||||||
if (pde & PG_PSE_MASK) {
|
if (pde & PG_PSE_MASK) {
|
||||||
@ -2128,8 +2123,7 @@ static void tlb_info_64(Monitor *mon, CPUState *env)
|
|||||||
for (l4 = 0; l4 < 512; l4++) {
|
for (l4 = 0; l4 < 512; l4++) {
|
||||||
cpu_physical_memory_read(pt_addr
|
cpu_physical_memory_read(pt_addr
|
||||||
+ l4 * 8,
|
+ l4 * 8,
|
||||||
(uint8_t *)&pte,
|
&pte, 8);
|
||||||
8);
|
|
||||||
pte = le64_to_cpu(pte);
|
pte = le64_to_cpu(pte);
|
||||||
if (pte & PG_PRESENT_MASK) {
|
if (pte & PG_PRESENT_MASK) {
|
||||||
print_pte(mon, (l1 << 39) +
|
print_pte(mon, (l1 << 39) +
|
||||||
@ -2207,7 +2201,7 @@ static void mem_info_32(Monitor *mon, CPUState *env)
|
|||||||
last_prot = 0;
|
last_prot = 0;
|
||||||
start = -1;
|
start = -1;
|
||||||
for(l1 = 0; l1 < 1024; l1++) {
|
for(l1 = 0; l1 < 1024; l1++) {
|
||||||
cpu_physical_memory_read(pgd + l1 * 4, (uint8_t *)&pde, 4);
|
cpu_physical_memory_read(pgd + l1 * 4, &pde, 4);
|
||||||
pde = le32_to_cpu(pde);
|
pde = le32_to_cpu(pde);
|
||||||
end = l1 << 22;
|
end = l1 << 22;
|
||||||
if (pde & PG_PRESENT_MASK) {
|
if (pde & PG_PRESENT_MASK) {
|
||||||
@ -2216,8 +2210,7 @@ static void mem_info_32(Monitor *mon, CPUState *env)
|
|||||||
mem_print(mon, &start, &last_prot, end, prot);
|
mem_print(mon, &start, &last_prot, end, prot);
|
||||||
} else {
|
} else {
|
||||||
for(l2 = 0; l2 < 1024; l2++) {
|
for(l2 = 0; l2 < 1024; l2++) {
|
||||||
cpu_physical_memory_read((pde & ~0xfff) + l2 * 4,
|
cpu_physical_memory_read((pde & ~0xfff) + l2 * 4, &pte, 4);
|
||||||
(uint8_t *)&pte, 4);
|
|
||||||
pte = le32_to_cpu(pte);
|
pte = le32_to_cpu(pte);
|
||||||
end = (l1 << 22) + (l2 << 12);
|
end = (l1 << 22) + (l2 << 12);
|
||||||
if (pte & PG_PRESENT_MASK) {
|
if (pte & PG_PRESENT_MASK) {
|
||||||
@ -2246,14 +2239,13 @@ static void mem_info_pae32(Monitor *mon, CPUState *env)
|
|||||||
last_prot = 0;
|
last_prot = 0;
|
||||||
start = -1;
|
start = -1;
|
||||||
for (l1 = 0; l1 < 4; l1++) {
|
for (l1 = 0; l1 < 4; l1++) {
|
||||||
cpu_physical_memory_read(pdp_addr + l1 * 8, (uint8_t *)&pdpe, 8);
|
cpu_physical_memory_read(pdp_addr + l1 * 8, &pdpe, 8);
|
||||||
pdpe = le64_to_cpu(pdpe);
|
pdpe = le64_to_cpu(pdpe);
|
||||||
end = l1 << 30;
|
end = l1 << 30;
|
||||||
if (pdpe & PG_PRESENT_MASK) {
|
if (pdpe & PG_PRESENT_MASK) {
|
||||||
pd_addr = pdpe & 0x3fffffffff000ULL;
|
pd_addr = pdpe & 0x3fffffffff000ULL;
|
||||||
for (l2 = 0; l2 < 512; l2++) {
|
for (l2 = 0; l2 < 512; l2++) {
|
||||||
cpu_physical_memory_read(pd_addr + l2 * 8,
|
cpu_physical_memory_read(pd_addr + l2 * 8, &pde, 8);
|
||||||
(uint8_t *)&pde, 8);
|
|
||||||
pde = le64_to_cpu(pde);
|
pde = le64_to_cpu(pde);
|
||||||
end = (l1 << 30) + (l2 << 21);
|
end = (l1 << 30) + (l2 << 21);
|
||||||
if (pde & PG_PRESENT_MASK) {
|
if (pde & PG_PRESENT_MASK) {
|
||||||
@ -2264,8 +2256,7 @@ static void mem_info_pae32(Monitor *mon, CPUState *env)
|
|||||||
} else {
|
} else {
|
||||||
pt_addr = pde & 0x3fffffffff000ULL;
|
pt_addr = pde & 0x3fffffffff000ULL;
|
||||||
for (l3 = 0; l3 < 512; l3++) {
|
for (l3 = 0; l3 < 512; l3++) {
|
||||||
cpu_physical_memory_read(pt_addr + l3 * 8,
|
cpu_physical_memory_read(pt_addr + l3 * 8, &pte, 8);
|
||||||
(uint8_t *)&pte, 8);
|
|
||||||
pte = le64_to_cpu(pte);
|
pte = le64_to_cpu(pte);
|
||||||
end = (l1 << 30) + (l2 << 21) + (l3 << 12);
|
end = (l1 << 30) + (l2 << 21) + (l3 << 12);
|
||||||
if (pte & PG_PRESENT_MASK) {
|
if (pte & PG_PRESENT_MASK) {
|
||||||
@ -2302,14 +2293,13 @@ static void mem_info_64(Monitor *mon, CPUState *env)
|
|||||||
last_prot = 0;
|
last_prot = 0;
|
||||||
start = -1;
|
start = -1;
|
||||||
for (l1 = 0; l1 < 512; l1++) {
|
for (l1 = 0; l1 < 512; l1++) {
|
||||||
cpu_physical_memory_read(pml4_addr + l1 * 8, (uint8_t *)&pml4e, 8);
|
cpu_physical_memory_read(pml4_addr + l1 * 8, &pml4e, 8);
|
||||||
pml4e = le64_to_cpu(pml4e);
|
pml4e = le64_to_cpu(pml4e);
|
||||||
end = l1 << 39;
|
end = l1 << 39;
|
||||||
if (pml4e & PG_PRESENT_MASK) {
|
if (pml4e & PG_PRESENT_MASK) {
|
||||||
pdp_addr = pml4e & 0x3fffffffff000ULL;
|
pdp_addr = pml4e & 0x3fffffffff000ULL;
|
||||||
for (l2 = 0; l2 < 512; l2++) {
|
for (l2 = 0; l2 < 512; l2++) {
|
||||||
cpu_physical_memory_read(pdp_addr + l2 * 8, (uint8_t *)&pdpe,
|
cpu_physical_memory_read(pdp_addr + l2 * 8, &pdpe, 8);
|
||||||
8);
|
|
||||||
pdpe = le64_to_cpu(pdpe);
|
pdpe = le64_to_cpu(pdpe);
|
||||||
end = (l1 << 39) + (l2 << 30);
|
end = (l1 << 39) + (l2 << 30);
|
||||||
if (pdpe & PG_PRESENT_MASK) {
|
if (pdpe & PG_PRESENT_MASK) {
|
||||||
@ -2320,8 +2310,7 @@ static void mem_info_64(Monitor *mon, CPUState *env)
|
|||||||
} else {
|
} else {
|
||||||
pd_addr = pdpe & 0x3fffffffff000ULL;
|
pd_addr = pdpe & 0x3fffffffff000ULL;
|
||||||
for (l3 = 0; l3 < 512; l3++) {
|
for (l3 = 0; l3 < 512; l3++) {
|
||||||
cpu_physical_memory_read(pd_addr + l3 * 8,
|
cpu_physical_memory_read(pd_addr + l3 * 8, &pde, 8);
|
||||||
(uint8_t *)&pde, 8);
|
|
||||||
pde = le64_to_cpu(pde);
|
pde = le64_to_cpu(pde);
|
||||||
end = (l1 << 39) + (l2 << 30) + (l3 << 21);
|
end = (l1 << 39) + (l2 << 30) + (l3 << 21);
|
||||||
if (pde & PG_PRESENT_MASK) {
|
if (pde & PG_PRESENT_MASK) {
|
||||||
@ -2334,8 +2323,7 @@ static void mem_info_64(Monitor *mon, CPUState *env)
|
|||||||
for (l4 = 0; l4 < 512; l4++) {
|
for (l4 = 0; l4 < 512; l4++) {
|
||||||
cpu_physical_memory_read(pt_addr
|
cpu_physical_memory_read(pt_addr
|
||||||
+ l4 * 8,
|
+ l4 * 8,
|
||||||
(uint8_t *)&pte,
|
&pte, 8);
|
||||||
8);
|
|
||||||
pte = le64_to_cpu(pte);
|
pte = le64_to_cpu(pte);
|
||||||
end = (l1 << 39) + (l2 << 30) +
|
end = (l1 << 39) + (l2 << 30) +
|
||||||
(l3 << 21) + (l4 << 12);
|
(l3 << 21) + (l4 << 12);
|
||||||
|
Loading…
Reference in New Issue
Block a user