summaryrefslogtreecommitdiff
path: root/src/arch/x86/bios
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-10-29 16:40:51 -0700
committerGabe Black <gabeblack@google.com>2019-11-07 11:02:46 +0000
commit5e235694ea78a38e588c1676a262dd1c070c2742 (patch)
treeec36c151f159921f08b0202bb6fe515a0bce801d /src/arch/x86/bios
parentf9517042ae24c10f8953918a26824e3abf991b15 (diff)
downloadgem5-5e235694ea78a38e588c1676a262dd1c070c2742.tar.xz
x86: Replace htog and gtoh with htole and letoh.
We already know what endianness to use from within x86. Change-Id: Ie92568efe8b23fbb7d9edad55fef09c6302cbe62 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22370 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/arch/x86/bios')
-rw-r--r--src/arch/x86/bios/e820.cc4
-rw-r--r--src/arch/x86/bios/intelmp.cc2
-rw-r--r--src/arch/x86/bios/smbios.cc16
3 files changed, 11 insertions, 11 deletions
diff --git a/src/arch/x86/bios/e820.cc b/src/arch/x86/bios/e820.cc
index 6cb16c995..f4bb29866 100644
--- a/src/arch/x86/bios/e820.cc
+++ b/src/arch/x86/bios/e820.cc
@@ -49,7 +49,7 @@ using namespace X86ISA;
template<class T>
void writeVal(T val, PortProxy& proxy, Addr &addr)
{
- T guestVal = htog(val);
+ T guestVal = htole(val);
proxy.writeBlob(addr, &guestVal, sizeof(T));
addr += sizeof(T);
}
@@ -62,7 +62,7 @@ void X86ISA::E820Table::writeTo(PortProxy& proxy, Addr countAddr, Addr addr)
// would be capable of handling.
assert(e820Nr <= 128);
- uint8_t guestE820Nr = htog(e820Nr);
+ uint8_t guestE820Nr = htole(e820Nr);
proxy.writeBlob(countAddr, &guestE820Nr, sizeof(guestE820Nr));
diff --git a/src/arch/x86/bios/intelmp.cc b/src/arch/x86/bios/intelmp.cc
index a9da25a8a..d87e4fc17 100644
--- a/src/arch/x86/bios/intelmp.cc
+++ b/src/arch/x86/bios/intelmp.cc
@@ -73,7 +73,7 @@ template<class T>
uint8_t
writeOutField(PortProxy& proxy, Addr addr, T val)
{
- uint64_t guestVal = X86ISA::htog(val);
+ uint64_t guestVal = htole(val);
proxy.writeBlob(addr, &guestVal, sizeof(T));
uint8_t checkSum = 0;
diff --git a/src/arch/x86/bios/smbios.cc b/src/arch/x86/bios/smbios.cc
index cd91d2d02..b1af8e9a1 100644
--- a/src/arch/x86/bios/smbios.cc
+++ b/src/arch/x86/bios/smbios.cc
@@ -82,7 +82,7 @@ X86ISA::SMBios::SMBiosStructure::writeOut(PortProxy& proxy, Addr addr)
uint8_t length = getLength();
proxy.writeBlob(addr + 1, &length, 1);
- uint16_t handleGuest = X86ISA::htog(handle);
+ uint16_t handleGuest = htole(handle);
proxy.writeBlob(addr + 2, &handleGuest, 2);
return length + getStringLength();
@@ -179,17 +179,17 @@ X86ISA::SMBios::BiosInformation::writeOut(PortProxy& proxy, Addr addr)
proxy.writeBlob(addr + 0x4, &vendor, 1);
proxy.writeBlob(addr + 0x5, &version, 1);
- uint16_t startingAddrSegmentGuest = X86ISA::htog(startingAddrSegment);
+ uint16_t startingAddrSegmentGuest = htole(startingAddrSegment);
proxy.writeBlob(addr + 0x6, &startingAddrSegmentGuest, 2);
proxy.writeBlob(addr + 0x8, &releaseDate, 1);
proxy.writeBlob(addr + 0x9, &romSize, 1);
- uint64_t characteristicsGuest = X86ISA::htog(characteristics);
+ uint64_t characteristicsGuest = htole(characteristics);
proxy.writeBlob(addr + 0xA, &characteristicsGuest, 8);
uint16_t characteristicExtBytesGuest =
- X86ISA::htog(characteristicExtBytes);
+ htole(characteristicExtBytes);
proxy.writeBlob(addr + 0x12, &characteristicExtBytesGuest, 2);
proxy.writeBlob(addr + 0x14, &majorVer, 1);
@@ -257,14 +257,14 @@ X86ISA::SMBios::SMBiosTable::writeOut(PortProxy& proxy, Addr addr,
// Then the length of the structure table which we'll find later
uint32_t tableAddrGuest =
- X86ISA::htog(smbiosHeader.intermediateHeader.tableAddr);
+ htole(smbiosHeader.intermediateHeader.tableAddr);
proxy.writeBlob(addr + 0x18, &tableAddrGuest, 4);
for (int i = 0; i < 4; i++) {
intChecksum += tableAddrGuest;
tableAddrGuest >>= 8;
}
- uint16_t numStructs = X86ISA::gtoh(structures.size());
+ uint16_t numStructs = letoh(structures.size());
proxy.writeBlob(addr + 0x1C, &numStructs, 2);
for (int i = 0; i < 2; i++) {
intChecksum += numStructs;
@@ -296,7 +296,7 @@ X86ISA::SMBios::SMBiosTable::writeOut(PortProxy& proxy, Addr addr,
* Header
*/
- maxSize = X86ISA::htog(maxSize);
+ maxSize = htole(maxSize);
proxy.writeBlob(addr + 0x8, &maxSize, 2);
for (int i = 0; i < 2; i++) {
mainChecksum += maxSize;
@@ -312,7 +312,7 @@ X86ISA::SMBios::SMBiosTable::writeOut(PortProxy& proxy, Addr addr,
*/
uint16_t tableSize = offset;
- tableSize = X86ISA::htog(tableSize);
+ tableSize = htole(tableSize);
proxy.writeBlob(addr + 0x16, &tableSize, 2);
for (int i = 0; i < 2; i++) {
intChecksum += tableSize;