z80/6502: final (hopefully) alternate magic bytes for relocatables
authorAlan Cox <alan@linux.intel.com>
Sun, 25 Jan 2015 15:57:44 +0000 (15:57 +0000)
committerAlan Cox <alan@linux.intel.com>
Sun, 25 Jan 2015 15:57:44 +0000 (15:57 +0000)
Kernel/cpu-6502/cpu.h
Kernel/cpu-z80/cpu.h

index 66d9e41..3fb7892 100644 (file)
@@ -22,7 +22,11 @@ extern void * __fastcall__ memset(void *, int, size_t);
 extern size_t __fastcall__ strlen(const char *);
 
 #define EMAGIC    0x4C    /* Header of executable (JMP) */
-#define EMAGIC_2  0x18   /* CLC BCC foo */
+#define EMAGIC_2  0x38   /* SEC BCS foo */
+/* We use SEC BCS not CLC BCC because CLC is 0x18 which is the Z80 JR header
+   so the two would be identical - not good! */
+
+
 /* High byte is saved, low byte is a mystery so take worst case. Also allow
    a bit less as C stack is not return stack */
 #define brk_limit() ((udata.u_syscall_sp | 0xFF) - 384)
index d399e1f..c2646ca 100644 (file)
@@ -19,6 +19,7 @@ extern void irqrestore(irqflags_t f);
 
 /* Z80 binaries start with a JP */
 #define EMAGIC    0xc3    /* Header of executable */
+#define EMAGIC_2  0x18   /* JR */
 /* Allow a minimum of 512 bytes gap between stack and top of allocations */
 #define brk_limit() (udata.u_syscall_sp - 512)