@@ -196,7 +196,9 @@ int overlaps_crashkernel(unsigned long start, unsigned long size)
196
196
197
197
/* Values we need to export to the second kernel via the device tree. */
198
198
static phys_addr_t kernel_end ;
199
+ static phys_addr_t crashk_base ;
199
200
static phys_addr_t crashk_size ;
201
+ static unsigned long long mem_limit ;
200
202
201
203
static struct property kernel_end_prop = {
202
204
.name = "linux,kernel-end" ,
@@ -207,7 +209,7 @@ static struct property kernel_end_prop = {
207
209
static struct property crashk_base_prop = {
208
210
.name = "linux,crashkernel-base" ,
209
211
.length = sizeof (phys_addr_t ),
210
- .value = & crashk_res . start ,
212
+ .value = & crashk_base
211
213
};
212
214
213
215
static struct property crashk_size_prop = {
@@ -219,9 +221,11 @@ static struct property crashk_size_prop = {
219
221
static struct property memory_limit_prop = {
220
222
.name = "linux,memory-limit" ,
221
223
.length = sizeof (unsigned long long ),
222
- .value = & memory_limit ,
224
+ .value = & mem_limit ,
223
225
};
224
226
227
+ #define cpu_to_be_ulong __PASTE(cpu_to_be, BITS_PER_LONG)
228
+
225
229
static void __init export_crashk_values (struct device_node * node )
226
230
{
227
231
struct property * prop ;
@@ -237,15 +241,17 @@ static void __init export_crashk_values(struct device_node *node)
237
241
of_remove_property (node , prop );
238
242
239
243
if (crashk_res .start != 0 ) {
244
+ crashk_base = cpu_to_be_ulong (crashk_res .start ),
240
245
of_add_property (node , & crashk_base_prop );
241
- crashk_size = resource_size (& crashk_res );
246
+ crashk_size = cpu_to_be_ulong ( resource_size (& crashk_res ) );
242
247
of_add_property (node , & crashk_size_prop );
243
248
}
244
249
245
250
/*
246
251
* memory_limit is required by the kexec-tools to limit the
247
252
* crash regions to the actual memory used.
248
253
*/
254
+ mem_limit = cpu_to_be_ulong (memory_limit );
249
255
of_update_property (node , & memory_limit_prop );
250
256
}
251
257
@@ -264,7 +270,7 @@ static int __init kexec_setup(void)
264
270
of_remove_property (node , prop );
265
271
266
272
/* information needed by userspace when using default_machine_kexec */
267
- kernel_end = __pa (_end );
273
+ kernel_end = cpu_to_be_ulong ( __pa (_end ) );
268
274
of_add_property (node , & kernel_end_prop );
269
275
270
276
export_crashk_values (node );
0 commit comments