[PATCH] H8/300 support update (4/4)

Yoshinori Sato (ysato@users.sourceforge.jp)
Fri, 02 May 2003 15:18:36 +0900


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-32679-1051856735-0001-2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

include

o binfmt_flat h8300 support.

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

--=_courier-32679-1051856735-0001-2 Content-Type: application/octet-stream; type=patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="linux-2.5.68-h8300-fs.diff"

Index: fs/binfmt_flat.c =================================================================== RCS file: /var/lib/cvs/linux-2.5/fs/binfmt_flat.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fs/binfmt_flat.c 21 Apr 2003 02:22:46 -0000 1.1.1.1 +++ fs/binfmt_flat.c 1 May 2003 13:45:51 -0000 1.2 @@ -42,7 +42,7 @@ #include <asm/unaligned.h> #include <asm/cacheflush.h> -#undef DEBUG +#define DEBUG #ifdef DEBUG #define DBG_FLT(a...) printk(##a) #else @@ -291,9 +291,12 @@ #ifdef DEBUG char *segment[] = { "TEXT", "DATA", "BSS", "*UNKNOWN*" }; #endif +#if !defined(__H8300H__) && !defined(__H8300S__) flat_v2_reloc_t r; +#endif unsigned long *ptr; +#if !defined(__H8300H__) && !defined(__H8300S__) r.value = rl; #if defined(CONFIG_COLDFIRE) ptr = (unsigned long *) (current->mm->start_code + r.reloc.offset); @@ -325,6 +328,14 @@ #ifdef DEBUG printk("Relocation became %x\n", (int)*ptr); #endif +#else + ptr = (unsigned long *)(current->mm->start_code+rl); + if (ptr >= current->mm->end_code) + ptr += 1; + *ptr += current->mm->start_code; + if ((*ptr & 0x00ffffff) >= current->mm->end_code) + *ptr += sizeof(unsigned long); +#endif } @@ -389,7 +400,11 @@ * fix up the flags for the older format, there were all kinds * of endian hacks, this only works for the simple cases */ - if (rev == OLD_FLAT_VERSION && flags) + if (rev == OLD_FLAT_VERSION +#if !defined(__H8300H__) && !defined(__H8300S__) + && flags +#endif + ) flags = FLAT_FLAG_RAM; #ifndef CONFIG_BINFMT_ZFLAT

--=_courier-32679-1051856735-0001-2--