于 2011/6/4 15:22, David Gibson 写道: > Uh, you need the -u option to diff. Plain-style diffs are more or > less unusable as patches. > Thanks you! Here is a new patch with -u option:
diff -ruN libhugetlbfs-2.12-x86/ld.hugetlbfs libhugetlbfs-2.12-mips/ld.hugetlbfs --- libhugetlbfs-2.12-x86/ld.hugetlbfs 2011-04-02 04:39:44.000000000 +0800 +++ libhugetlbfs-2.12-mips/ld.hugetlbfs 2011-06-10 06:55:26.000000000 +0800 @@ -73,6 +73,7 @@ MB=$((1024*1024)) case "$EMU" in elf32ppclinux|elf64ppc) HPAGE_SIZE=$((16*$MB)) SLICE_SIZE=$((256*$MB)) ;; +elf32ltmips|elf64ltmips) HPAGE_SIZE=$((32*$MB)) SLICE_SIZE=$((32*$MB));; elf_i386|elf_x86_64) HPAGE_SIZE=$((4*$MB)) SLICE_SIZE=$HPAGE_SIZE ;; esac diff -ruN libhugetlbfs-2.12-x86/ldscripts/elf32ltmips.xB libhugetlbfs-2.12-mips/ldscripts/elf32ltmips.xB --- libhugetlbfs-2.12-x86/ldscripts/elf32ltmips.xB 1970-01-01 08:00:00.000000000 +0800 +++ libhugetlbfs-2.12-mips/ldscripts/elf32ltmips.xB 2011-06-10 06:30:12.000000000 +0800 @@ -0,0 +1 @@ + diff -ruN libhugetlbfs-2.12-x86/ldscripts/elf32ltmips.xBDT libhugetlbfs-2.12-mips/ldscripts/elf32ltmips.xBDT --- libhugetlbfs-2.12-x86/ldscripts/elf32ltmips.xBDT 1970-01-01 08:00:00.000000000 +0800 +++ libhugetlbfs-2.12-mips/ldscripts/elf32ltmips.xBDT 2011-06-10 06:30:42.000000000 +0800 @@ -0,0 +1 @@ + diff -ruN libhugetlbfs-2.12-x86/ldscripts/elf64ltmips.xB libhugetlbfs-2.12-mips/ldscripts/elf64ltmips.xB --- libhugetlbfs-2.12-x86/ldscripts/elf64ltmips.xB 1970-01-01 08:00:00.000000000 +0800 +++ libhugetlbfs-2.12-mips/ldscripts/elf64ltmips.xB 2011-06-10 06:30:26.000000000 +0800 @@ -0,0 +1 @@ + diff -ruN libhugetlbfs-2.12-x86/ldscripts/elf64ltmips.xBDT libhugetlbfs-2.12-mips/ldscripts/elf64ltmips.xBDT --- libhugetlbfs-2.12-x86/ldscripts/elf64ltmips.xBDT 1970-01-01 08:00:00.000000000 +0800 +++ libhugetlbfs-2.12-mips/ldscripts/elf64ltmips.xBDT 2011-06-10 06:30:37.000000000 +0800 @@ -0,0 +1 @@ + diff -ruN libhugetlbfs-2.12-x86/Makefile libhugetlbfs-2.12-mips/Makefile --- libhugetlbfs-2.12-x86/Makefile 2011-04-02 04:39:44.000000000 +0800 +++ libhugetlbfs-2.12-mips/Makefile 2011-06-10 06:55:51.000000000 +0800 @@ -17,7 +17,7 @@ INSTALL_MAN7 = libhugetlbfs.7 INSTALL_MAN8 = hugectl.8 hugeedit.8 hugeadm.8 cpupcstat.8 LDSCRIPT_TYPES = B BDT -LDSCRIPT_DIST_ELF = elf32ppclinux elf64ppc elf_i386 elf_x86_64 +LDSCRIPT_DIST_ELF = elf32ppclinux elf64ppc elf_i386 elf_x86_64 elf32ltmips INSTALL_OBJSCRIPT = ld.hugetlbfs VERSION=version.h SOURCE = $(shell find . -maxdepth 1 ! -name version.h -a -name '*.[h]') @@ -80,6 +80,13 @@ TMPLIB32 = lib CFLAGS += -DNO_ELFLINK else +ifeq ($(ARCH),mips64) +CC64 = gcc +CC32 = gcc +TMPLIB64 = lib64 +ELF32= elf32ltmips +ELF64= elf64ltmips +else $(error "Unrecognized architecture ($(ARCH))") endif endif @@ -88,6 +95,7 @@ endif endif endif +endif ifdef CC32 OBJDIRS += obj32 @@ -187,7 +195,11 @@ export LIBDIR32 export LIBDIR64 +ifeq ($(ARCH),mips64) +all: libs tools +else all: libs tests tools +endif .PHONY: tests libs diff -ruN libhugetlbfs-2.12-x86/sys-elf32ltmips.S libhugetlbfs-2.12-mips/sys-elf32ltmips.S --- libhugetlbfs-2.12-x86/sys-elf32ltmips.S 1970-01-01 08:00:00.000000000 +0800 +++ libhugetlbfs-2.12-mips/sys-elf32ltmips.S 2011-06-10 08:36:59.000000000 +0800 @@ -0,0 +1,72 @@ +/* +.text +.globl direct_syscall +direct_syscall: +syscall +j $ra +*/ + +/* code port from + * glibc-2.1.3.tar.gz/glibc-2.1.3/sysdeps/mach/mips/syscall.S + */ + + +#define zero $0 /* wired zero */ +#define AT $1 /* assembler temp - uppercase because of ".set at" + */ +#define v0 $2 /* return value */ +#define v1 $3 +#define a0 $4 /* argument registers */ +#define a1 $5 +#define a2 $6 +#define a3 $7 +#define t0 $8 /* caller saved */ +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#define s0 $16 /* callee saved */ +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 /* caller saved */ +#define t9 $25 +#define jp $25 /* PIC jump register */ +#define k0 $26 /* kernel scratch */ +#define k1 $27 +#define gp $28 /* global pointer */ +#define sp $29 /* stack pointer */ +#define fp $30 /* frame pointer */ +#define s8 $30 /* same like fp! */ +#define ra $31 /* return address + */ + + +.text +.globl direct_syscall + +direct_syscall: +move v0, a0 /* Load system call number from first arg. */ +move a0, a1 /* Move the next three args up a register. */ +move a1, a2 +move a2, a3 + +/* Load the remaining possible args (up to 11) from the stack. */ + +ld t0,4*8(sp) +ld t1,5*8(sp) +ld t2,6*8(sp) +ld t3,7*8(sp) +ld t4,8*8(sp) +ld t5,9*8(sp) +ld t6,10*8(sp) +syscall /* Do the system call. */ +j ra /* Return to caller. */ + diff -ruN libhugetlbfs-2.12-x86/sys-elf64ltmips.S libhugetlbfs-2.12-mips/sys-elf64ltmips.S --- libhugetlbfs-2.12-x86/sys-elf64ltmips.S 1970-01-01 08:00:00.000000000 +0800 +++ libhugetlbfs-2.12-mips/sys-elf64ltmips.S 2011-06-10 08:37:16.000000000 +0800 @@ -0,0 +1,5 @@ +.text +.globl direct_syscall +direct_syscall: + syscall + j $ra -- 余璜 中科院计算所高性能中心1009C ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel