Hi.

This patch adds ppc64 support to makedumpfile, and it can run on ppc64.
This patch was created by Sachin Sant.

Thanks
Ken'ichi Ohmichi


* Add support for powerpc platform
* Modified CFLAGS so as to build a 64 bit makedumpfile binary on powerpc

 Signed-off-by : Sachin Sant <[EMAIL PROTECTED]>
---

diff -Naurp makedumpfile-1.0.4/makedumpfile.h 
makedumpfile-1.0.4-new/makedumpfile.h
--- makedumpfile-1.0.4/makedumpfile.h   2006-11-15 15:06:23.000000000 +0530
+++ makedumpfile-1.0.4-new/makedumpfile.h       2006-11-15 18:39:17.000000000 
+0530
@@ -300,6 +300,17 @@ do { \
 #define MAX_ORDER              (11)
 #endif /* x86_64 */
 
+#ifdef __powerpc__
+#define PAGE_OFFSET            (0xc000000000000000)
+#define KERNELBASE             PAGE_OFFSET
+#define VMALLOCBASE            (0xD000000000000000)
+#define MAXMEM                 (-KERNELBASE-VMALLOCBASE)
+#define KVBASE                 (SYMBOL(_stext))
+#define _SECTION_SIZE_BITS     (24)
+#define SIZEOF_NODE_ONLINE_MAP (8)
+#define MAX_ORDER              (9)
+#endif
+
 #ifdef __ia64__ /* ia64 */
 #define MAXMEM                 (0xffffffffffffffff)
 #define REGION_SHIFT           (61)
@@ -346,6 +357,13 @@ off_t vaddr_to_offset_x86_64();
 #define vaddr_to_offset(X, Y)  vaddr_to_offset_x86_64(X, Y)
 #endif /* x86_64 */
 
+#ifdef __powerpc__ /* powerpc */
+int get_machdep_info_ppc64();
+#define get_machdep_info(X)    get_machdep_info_ppc64(X)
+#define get_phys_base(X)       TRUE
+#define vaddr_to_offset(X, Y)  vaddr_to_offset_general(X, Y)
+#endif          /* powerpc */
+
 #ifdef __ia64__ /* ia64 */
 int get_phys_base_ia64();
 int get_machdep_info_ia64();
diff -Naurp makedumpfile-1.0.4/Makefile makedumpfile-1.0.4-new/Makefile
--- makedumpfile-1.0.4/Makefile 2006-11-15 15:06:30.000000000 +0530
+++ makedumpfile-1.0.4-new/Makefile     2006-11-15 17:20:03.000000000 +0530
@@ -14,9 +14,15 @@ ARCH := $(shell uname -m | sed -e s/i.86
                               -e s/ppc64/powerpc/ )
 CFLAGS += -D__$(ARCH)__
 CFLAGS_ARCH += -D__$(ARCH)__
+
+ifeq ($(ARCH), powerpc)
+CFLAGS += -m64
+CFLAGS_ARCH += -m64
+endif
+
 SRC    = makedumpfile.c makedumpfile.h diskdump_mod.h
-SRC_ARCH = x86.c x86_64.c ia64.c
-OBJ_ARCH = x86.o x86_64.o ia64.o
+SRC_ARCH = x86.c x86_64.c ia64.c ppc64.c
+OBJ_ARCH = x86.o x86_64.o ia64.o ppc64.o
 
 all: makedumpfile
 
diff -Naurp makedumpfile-1.0.4/ppc64.c makedumpfile-1.0.4-new/ppc64.c
--- makedumpfile-1.0.4/ppc64.c  1970-01-01 05:30:00.000000000 +0530
+++ makedumpfile-1.0.4-new/ppc64.c      2006-11-15 17:20:03.000000000 +0530
@@ -0,0 +1,33 @@
+/* 
+ * ppc64.c
+ *
+ * Created by: Sachin Sant ([EMAIL PROTECTED])
+ * Copyright (C) IBM Corporation, 2006. All rights reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation (version 2 of the License).
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifdef __powerpc__
+
+#include "makedumpfile.h"
+
+int
+get_machdep_info_ppc64(struct DumpInfo *info)
+{
+       info->section_size_bits = _SECTION_SIZE_BITS;
+
+       return TRUE;
+}
+
+#endif /* powerpc */

_
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to