diff options
author | Kumar Gala <galak@gate.crashing.org> | 2006-01-11 18:57:13 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-12 04:09:29 -0500 |
commit | cbbcf3401173f11f7e4c03c7ec8955ea29cd83b5 (patch) | |
tree | 3728682606776f026ac120fee00db7d8ddbaa108 | |
parent | ea183a957abea8e05530a4536a9c2db16e9fdd85 (diff) |
[PATCH] powerpc: Fixed memory reserve map layout
powerpc: Fixed memory reserve map layout
The memory reserve map is suppose to be a pair of 64-bit integers
to represent each region. On ppc32 the code was treating the
pair as two 32-bit integers. Additional the prom_init code was
producing the wrong layout on ppc32.
Added a simple check to try to provide backwards compatibility.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/prom.c | 28 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 8 |
2 files changed, 28 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 34ab0daec3a7..02e2115323e4 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -1100,17 +1100,37 @@ static int __init early_init_dt_scan_memory(unsigned long node, | |||
1100 | 1100 | ||
1101 | static void __init early_reserve_mem(void) | 1101 | static void __init early_reserve_mem(void) |
1102 | { | 1102 | { |
1103 | unsigned long base, size; | 1103 | u64 base, size; |
1104 | unsigned long *reserve_map; | 1104 | u64 *reserve_map; |
1105 | 1105 | ||
1106 | reserve_map = (unsigned long *)(((unsigned long)initial_boot_params) + | 1106 | reserve_map = (u64 *)(((unsigned long)initial_boot_params) + |
1107 | initial_boot_params->off_mem_rsvmap); | 1107 | initial_boot_params->off_mem_rsvmap); |
1108 | #ifdef CONFIG_PPC32 | ||
1109 | /* | ||
1110 | * Handle the case where we might be booting from an old kexec | ||
1111 | * image that setup the mem_rsvmap as pairs of 32-bit values | ||
1112 | */ | ||
1113 | if (*reserve_map > 0xffffffffull) { | ||
1114 | u32 base_32, size_32; | ||
1115 | u32 *reserve_map_32 = (u32 *)reserve_map; | ||
1116 | |||
1117 | while (1) { | ||
1118 | base_32 = *(reserve_map_32++); | ||
1119 | size_32 = *(reserve_map_32++); | ||
1120 | if (size_32 == 0) | ||
1121 | break; | ||
1122 | DBG("reserving: %lx -> %lx\n", base_32, size_32); | ||
1123 | lmb_reserve(base_32, size_32); | ||
1124 | } | ||
1125 | return; | ||
1126 | } | ||
1127 | #endif | ||
1108 | while (1) { | 1128 | while (1) { |
1109 | base = *(reserve_map++); | 1129 | base = *(reserve_map++); |
1110 | size = *(reserve_map++); | 1130 | size = *(reserve_map++); |
1111 | if (size == 0) | 1131 | if (size == 0) |
1112 | break; | 1132 | break; |
1113 | DBG("reserving: %lx -> %lx\n", base, size); | 1133 | DBG("reserving: %llx -> %llx\n", base, size); |
1114 | lmb_reserve(base, size); | 1134 | lmb_reserve(base, size); |
1115 | } | 1135 | } |
1116 | 1136 | ||
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index e381f2fc121c..d963a12ec640 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -137,8 +137,8 @@ struct prom_t { | |||
137 | }; | 137 | }; |
138 | 138 | ||
139 | struct mem_map_entry { | 139 | struct mem_map_entry { |
140 | unsigned long base; | 140 | u64 base; |
141 | unsigned long size; | 141 | u64 size; |
142 | }; | 142 | }; |
143 | 143 | ||
144 | typedef u32 cell_t; | 144 | typedef u32 cell_t; |
@@ -897,9 +897,9 @@ static unsigned long __init prom_next_cell(int s, cell_t **cellp) | |||
897 | * If problems seem to show up, it would be a good start to track | 897 | * If problems seem to show up, it would be a good start to track |
898 | * them down. | 898 | * them down. |
899 | */ | 899 | */ |
900 | static void reserve_mem(unsigned long base, unsigned long size) | 900 | static void reserve_mem(u64 base, u64 size) |
901 | { | 901 | { |
902 | unsigned long top = base + size; | 902 | u64 top = base + size; |
903 | unsigned long cnt = RELOC(mem_reserve_cnt); | 903 | unsigned long cnt = RELOC(mem_reserve_cnt); |
904 | 904 | ||
905 | if (size == 0) | 905 | if (size == 0) |