allow the use of old console code and update elf_object not to rely on EM_ALPHA value.
authorAli Saidi <saidi@eecs.umich.edu>
Sun, 27 Jun 2004 18:33:55 +0000 (14:33 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Sun, 27 Jun 2004 18:33:55 +0000 (14:33 -0400)
base/loader/elf_object.cc:
    EM_ALPHA value isn't official, so perhaps we shouldn't use it
dev/alpha_console.cc:
dev/alpha_console.hh:
    this change allows the use of old console code

--HG--
extra : convert_revision : cfacd64ae7fd2595158ca1a83ebcdb66ee7e119b

base/loader/elf_object.cc
dev/alpha_console.cc
dev/alpha_console.hh

index b8f46449a0ae9033693309d723c86752b9312ed2..6dfbce28c2f23a276bcae310a62e5a070360a10b 100644 (file)
@@ -74,7 +74,8 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
     else {
         if (ehdr.e_ident[EI_CLASS] == ELFCLASS32)
             panic("32 bit ELF Binary, Not Supported");
-        printf("emachine = %x\n", ehdr.e_machine);
+        /* @todo this emachine value isn't offical yet.
+         *       so we probably shouldn't check it. */
 //        if (ehdr.e_machine != EM_ALPHA)
 //            panic("Non Alpha Binary, Not Supported");
 
index 86851ff8b34dfb83932e2106bc8fe94dd1d908cd..680704b301bdce72ea17a39e2ef416c95b0bbf94 100644 (file)
@@ -122,7 +122,9 @@ AlphaConsole::read(MemReqPtr &req, uint8_t *data)
                     *(uint32_t*)data = alphaAccess->intrClockFrequency;
                     break;
                 default:
-                    panic("Unknown 32bit access, %#x\n", daddr);
+                    // Old console code read in everyting as a 32bit int
+                    *(uint32_t*)data = *(uint32_t*)(consoleData + daddr);
+
             }
             break;
         case sizeof(uint64_t):
index 47afa8f4a333383dbefce65db306e0963b1ccc25..49c3a9f78a688e232b8cd000027541ec85cee212 100644 (file)
@@ -73,7 +73,10 @@ class SimpleDisk;
 class AlphaConsole : public PioDevice
 {
   protected:
+    union {
         AlphaAccess *alphaAccess;
+    uint8_t *consoleData;
+    };
 
     /** the disk must be accessed from the console */
     SimpleDisk *disk;