hex_file.cc (5541:bb31ea8583d8) hex_file.cc (5545:d7c7b6752e2c)
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)) {
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 fgets(Line, 64, fp);
68 char *ret = fgets(Line, sizeof(Line), fp);
69 if (!ret)
70 panic("malformed file");
69 parseLine(Line, &MemAddr, &Data);
70 if (MemAddr != 0) {
71 // Now, write to memory
72 memPort->writeBlob(MemAddr << 2, (uint8_t *)&Data, sizeof(Data));
73 }
74 }
75 return true;
76}

--- 60 unchanged lines hidden ---
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 ---