/*
- * Copyright (c) 2001-2004 The Regents of The University of Michigan
+ * Copyright (c) 2001-2005 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* @file
+/** @file
* Disk Image Definitions
*/
#include "dev/disk_image.hh"
#include "sim/builder.hh"
#include "sim/sim_exit.hh"
-#include "targetarch/byte_swap.hh"
+#include "sim/byteswap.hh"
using namespace std;
SafeReadSwap(ifstream &stream, T &data)
{
SafeRead(stream, &data, sizeof(data));
- data = htoa(data);
+ data = letoh(data); //is this the proper byte order conversion?
}
bool
void
SafeWriteSwap(ofstream &stream, const T &data)
{
- T swappeddata = htoa(data);
+ T swappeddata = letoh(data); //is this the proper byte order conversion?
SafeWrite(stream, &swappeddata, sizeof(data));
}
void
{
string cowFilename = name() + ".cow";
SERIALIZE_SCALAR(cowFilename);
- save(cowFilename);
+ save(Checkpoint::dir() + "/" + cowFilename);
}
void