Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/stand/boot2440 Make this work with earm kern...



details:   https://anonhg.NetBSD.org/src/rev/111de906c593
branches:  trunk
changeset: 334050:111de906c593
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Nov 29 08:15:07 2014 +0000

description:
Make this work with earm kernels. Not sure the test is realy worth it.

Partially from Greg Willatt

diffstat:

 sys/arch/evbarm/stand/boot2440/main.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 207599f31eb7 -r 111de906c593 sys/arch/evbarm/stand/boot2440/main.c
--- a/sys/arch/evbarm/stand/boot2440/main.c     Sat Nov 29 03:35:57 2014 +0000
+++ b/sys/arch/evbarm/stand/boot2440/main.c     Sat Nov 29 08:15:07 2014 +0000
@@ -112,7 +112,7 @@
        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 @@
 #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];



Home | Main Index | Thread Index | Old Index