This adds MIPS-specific stat and stat64 structures. They are packed
structures to ensure that the compiler doesn't add unwanted padding
(which is important since these structures are written to the address
space of the simulated program using a simple memset).
diff --git a/src/arch/mips/linux/linux.hh b/src/arch/mips/linux/linux.hh
index a2418cf..1763f8d 100644
--- a/src/arch/mips/linux/linux.hh
+++ b/src/arch/mips/linux/linux.hh
@@ -37,6 +37,51 @@ class MipsLinux : public Linux
{
public:
+ typedef struct {
+ uint32_t st_dev;
+ int32_t st_pad1[3];
+ uint32_t st_ino;
+ uint32_t st_mode;
+ uint32_t st_nlink;
+ uint32_t st_uid;
+ uint32_t st_gid;
+ uint32_t st_rdev;
+ int32_t st_pad2[2];
+ int32_t st_size;
+ int32_t st_pad3;
+ int32_t st_atimeX;
+ int32_t st_atime_nsec;
+ int32_t st_mtimeX;
+ int32_t st_mtime_nsec;
+ int32_t st_ctimeX;
+ int32_t st_ctime_nsec;
+ int32_t st_blksize;
+ int32_t st_blocks;
+ int32_t st_pad4[14];
+ } __attribute((__packed__)) tgt_stat;
+
+ typedef struct {
+ uint32_t st_dev;
+ uint32_t st_pad0[3];
+ uint64_t st_ino;
+ uint32_t st_mode;
+ uint32_t st_nlink;
+ uint32_t st_uid;
+ uint32_t st_gid;
+ uint32_t st_rdev;
+ uint32_t st_pad1[3];
+ int64_t st_size;
+ int32_t st_atimeX;
+ uint32_t st_atime_nsec;
+ int32_t st_mtimeX;
+ uint32_t st_mtime_nsec;
+ int32_t st_ctimeX;
+ uint32_t st_ctime_nsec;
+ uint32_t st_blksize;
+ uint32_t st_pad2;
+ int64_t st_blocks;
+ } __attribute((__packed__)) tgt_stat64;
+
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static OpenFlagTransTable openFlagTable[];
--
Cheers,
Matt
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev