1/* 2 * Copyright (c) 2007 MIPS Technologies, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 51 unchanged lines hidden (view full) --- 60 61bool 62HexFile::loadSections(Port *memPort) 63{ 64 char Line[64]; 65 Addr MemAddr; 66 uint32_t Data; 67 while (!feof(fp)) { |
68 char *ret = fgets(Line, sizeof(Line), fp); 69 if (!ret) 70 panic("malformed file"); |
71 parseLine(Line, &MemAddr, &Data); 72 if (MemAddr != 0) { 73 // Now, write to memory 74 memPort->writeBlob(MemAddr << 2, (uint8_t *)&Data, sizeof(Data)); 75 } 76 } 77 return true; 78} --- 60 unchanged lines hidden --- |