} M5_ATTR_PACKED;
static int
-dumpDmesgEntry(const uint8_t *base, const uint8_t *end, std::ostream &os)
+dumpDmesgEntry(const uint8_t *base, const uint8_t *end, const ByteOrder bo,
+ std::ostream &os)
{
const size_t max_length = end - base;
DmesgEntry de;
}
memcpy(&de, base, sizeof(de));
- de.ts_nsec = TheISA::gtoh(de.ts_nsec);
- de.len = TheISA::gtoh(de.len);
- de.text_len = TheISA::gtoh(de.text_len);
+ de.ts_nsec = gtoh(de.ts_nsec, bo);
+ de.len = gtoh(de.len, bo);
+ de.text_len = gtoh(de.text_len, bo);
if (de.len < sizeof(de) ||
max_length < de.len ||
Linux::dumpDmesg(ThreadContext *tc, std::ostream &os)
{
System *system = tc->getSystemPtr();
+ const ByteOrder bo = system->getGuestByteOrder();
const SymbolTable *symtab = system->kernelSymtab;
PortProxy &proxy = tc->getVirtProxy();
// Print dmesg buffer content
const uint8_t *cur = log_buf.data(), *end = log_buf.data() + length;
while (cur < end) {
- int ret = dumpDmesgEntry(cur, end, os);
+ int ret = dumpDmesgEntry(cur, end, bo, os);
if (ret < 0)
return;
cur += ret;