Module Name:    src
Committed By:   martin
Date:           Fri Jan  2 20:29:08 UTC 2015

Modified Files:
        src/sys/arch/evbarm/stand/boot2440 [netbsd-7]: main.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #366):
        sys/arch/evbarm/stand/boot2440/main.c: revision 1.5
Make this work with earm kernels. Not sure the test is realy worth it.
Partially from Greg Willatt


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/arch/evbarm/stand/boot2440/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/stand/boot2440/main.c
diff -u src/sys/arch/evbarm/stand/boot2440/main.c:1.4 src/sys/arch/evbarm/stand/boot2440/main.c:1.4.4.1
--- src/sys/arch/evbarm/stand/boot2440/main.c:1.4	Sun Dec  1 02:52:53 2013
+++ src/sys/arch/evbarm/stand/boot2440/main.c	Fri Jan  2 20:29:08 2015
@@ -112,7 +112,7 @@ main(int argc, char *argv[])
 	int fclk, hclk;
 	int fd;
 	unsigned long marks[MARK_MAX];
-	unsigned char hdr[0x26];
+	unsigned char hdr[0x28];
 	void (*entry)(void*);
 	unsigned elfpriv;
 	char *bootfile;
@@ -236,16 +236,17 @@ main(int argc, char *argv[])
 #endif
 	/*
 	 * ARM ELF header has a distinctive value in "private flags"
-	 * field of offset [0x24:25];
-	 * - NetBSD 02 06
+	 * field of offset [0x24-x027];
+	 * - NetBSD 02 06 (oarm)
 	 * - Linux  02 00 (2.4) or 02 02 (2.6)
+	 * - NetBSD 02 00 00 05 (earm)
 	 */
 	lseek(fd, (off_t)0, SEEK_SET);
 	read(fd, &hdr, sizeof(hdr));
 	memcpy(&elfpriv, &hdr[0x24], sizeof(elfpriv));
 
 	entry = (void *)marks[MARK_ENTRY];
-	if (elfpriv == 0x0602) {
+	if (elfpriv == 0x0602 || elfpriv == 0x5000002) {
 		struct btinfo_symtab bi_syms;
 
 		bi_syms.nsym = marks[MARK_NSYM];

Reply via email to