Fix byteswap on LP64 (amd64)

kern/linux/linux_system.cc:
    Formatting
sim/host.hh:
    When we say ULL and UL we really just want a 64-bit value, not
    necessarily a long long, so cast the integer to (u)int64_t
    this fixes a problem with byte swapping.

--HG--
extra : convert_revision : ad25ace5a7b92a7c928f2d52e531193c91f3f8c8
This commit is contained in:
Nathan Binkert 2004-07-02 16:40:23 -04:00
parent 0e575e9f26
commit e2c62a13dd
2 changed files with 9 additions and 6 deletions

View file

@ -172,16 +172,19 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param,
/**
* Set the hardware reset parameter block system type and revision information
* to Tsunami.
* Set the hardware reset parameter block system type and revision
* information to Tsunami.
*/
if (consoleSymtab->findAddress("xxm_rpb", addr)) {
Addr paddr = vtophys(physmem, addr);
char *hwprb = (char *)physmem->dma_addr(paddr, sizeof(uint64_t));
if (hwprb) {
*(uint64_t*)(hwprb+0x50) = htoa(ULL(34)); // Tsunami
*(uint64_t*)(hwprb+0x58) = htoa(ULL(1)<<10); // Plain DP264
// Tsunami
*(uint64_t*)(hwprb + 0x50) = htoa(ULL(34));
// Plain DP264
*(uint64_t*)(hwprb + 0x58) = htoa(ULL(1) << 10);
}
else
panic("could not translate hwprb addr to set system type/variation\n");

View file

@ -38,9 +38,9 @@
#include <inttypes.h>
/** uint64_t constant */
#define ULL(N) N##ULL
#define ULL(N) ((uint64_t)N##ULL)
/** int64_t constant */
#define LL(N) N##LL
#define LL(N) (((int64_t)N##LL)
/** Statistics counter type. Not much excuse for not using a 64-bit
* integer here, but if you're desperate and only run short