Skip to contentSkip to conversation

kexec/ppc64: use common architecture fs2dt.c file

PATCH RESEND Applied Laurent Dufour 2 participants 2 messages Nov 15, 2013 – Nov 19, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 kexec/ppc64: use common architecture fs2dt.c file

Following the commit 'b3c2962 fs2dt: Add a generic copy of fs2dt' which introduced a generic fs2dt file, this patch is removing the ppc64 architecture's one.

Tests have been done successfully on Power 7 plateform.

---
 kexec/arch/ppc64/Makefile          |    5 
 kexec/arch/ppc64/crashdump-ppc64.h |    3 
 kexec/arch/ppc64/fs2dt.c           |  738 ------------------------------------
 kexec/arch/ppc64/kexec-elf-ppc64.c |    5 
 kexec/arch/ppc64/kexec-ppc64.h     |   21 -
 5 files changed, 19 insertions(+), 753 deletions(-)
 delete mode 100644 kexec/arch/ppc64/fs2dt.c
kexec/arch/ppc64/Makefile +4 -1
index 7ed0aa9..9a6e475 100644
@@ -3,13 +3,16 @@
 #
 ppc64_KEXEC_SRCS =  kexec/arch/ppc64/kexec-elf-rel-ppc64.c
 ppc64_KEXEC_SRCS += kexec/arch/ppc64/kexec-zImage-ppc64.c
-ppc64_KEXEC_SRCS += kexec/arch/ppc64/fs2dt.c
 ppc64_KEXEC_SRCS += kexec/arch/ppc64/kexec-elf-ppc64.c
 ppc64_KEXEC_SRCS += kexec/arch/ppc64/kexec-ppc64.c
 ppc64_KEXEC_SRCS += kexec/arch/ppc64/crashdump-ppc64.c
 
 ppc64_ARCH_REUSE_INITRD =
 
+ppc64_FS2DT	    = kexec/fs2dt.c
+ppc64_FS2DT_INCLUDE = -include $(srcdir)/kexec/arch/ppc64/crashdump-ppc64.h \
+                      -include $(srcdir)/kexec/arch/ppc64/kexec-ppc64.h
+
 dist += kexec/arch/ppc64/Makefile $(ppc64_KEXEC_SRCS)			\
 	kexec/arch/ppc64/kexec-ppc64.h kexec/arch/ppc64/crashdump-ppc64.h \
 	kexec/arch/ppc64/include/arch/options.h
kexec/arch/ppc64/crashdump-ppc64.h +3 -0
index e9d28c9..001be3a 100644
@@ -1,6 +1,9 @@
 #ifndef CRASHDUMP_PPC64_H
 #define CRASHDUMP_PPC64_H
 
+#include <stdint.h>
+#include <sys/types.h>
+
 struct kexec_info;
 int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
 				uint64_t max_addr, unsigned long min_base);
kexec/arch/ppc64/fs2dt.c deleted +0 -738

738 lines not on this page · raw message

kexec/arch/ppc64/kexec-elf-ppc64.c +5 -0
index cc0531d..3550fc1 100644
@@ -35,6 +35,7 @@
 #include "../../kexec-elf.h"
 #include "../../kexec-syscall.h"
 #include "kexec-ppc64.h"
+#include "../../fs2dt.h"
 #include "crashdump-ppc64.h"
 #include <arch/options.h>
 
@@ -82,8 +83,10 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
 	off_t seg_size = 0;
 	struct mem_phdr *phdr;
 	size_t size;
+#ifdef NEED_RESERVE_DTB
 	uint64_t *rsvmap_ptr;
 	struct bootblock *bb_ptr;
+#endif
 	int i;
 	int result, opt;
 	uint64_t my_kernel, my_dt_offset;
@@ -228,6 +231,7 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
 	my_dt_offset = add_buffer(info, seg_buf, seg_size, seg_size,
 				0, 0, max_addr, -1);
 
+#ifdef NEED_RESERVE_DTB
 	/* patch reserve map address for flattened device-tree
 	 * find last entry (both 0) in the reserve mem list.  Assume DT
 	 * entry is before this one
@@ -240,6 +244,7 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
 	*rsvmap_ptr = my_dt_offset;
 	rsvmap_ptr++;
 	*rsvmap_ptr = bb_ptr->totalsize;
+#endif
 
 	/* Set kernel */
 	elf_rel_set_symbol(&info->rhdr, "kernel", &my_kernel, sizeof(my_kernel));
kexec/arch/ppc64/kexec-ppc64.h +7 -14
index 920ac46..9a0aecf 100644
@@ -6,33 +6,26 @@
 #define CORE_TYPE_ELF32 1
 #define CORE_TYPE_ELF64 2
 
+#define BOOT_BLOCK_VERSION 2
+#define BOOT_BLOCK_LAST_COMP_VERSION 2
+#define NEED_STRUCTURE_BLOCK_EXTRA_PAD
+#define HAVE_DYNAMIC_MEMORY
+#define NEED_RESERVE_DTB
+
 int setup_memory_ranges(unsigned long kexec_flags);
 
 int elf_ppc64_probe(const char *buf, off_t len);
 int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
 	struct kexec_info *info);
 void elf_ppc64_usage(void);
-void reserve(unsigned long long where, unsigned long long length);
 
-int create_flatten_tree(char **, off_t *, char *);
+struct mem_ehdr;
 unsigned long my_r2(const struct mem_ehdr *ehdr);
 
 extern uint64_t initrd_base, initrd_size;
 extern int max_memory_ranges;
 extern unsigned char reuse_initrd;
 
-/* boot block version 2 as defined by the linux kernel */
-struct bootblock {
-	unsigned magic,
-		totalsize,
-		off_dt_struct,
-		off_dt_strings,
-		off_mem_rsvmap,
-		version,
-		last_comp_version,
-		boot_physid;
-};
-
 struct arch_options_t {
 	int core_header_type;
 };

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec