* kernel arguments directly into the kernel's memory.
*/
virtProxy.writeBlob(CommandLine(),
- (uint8_t*)params()->boot_osflags.c_str(),
- params()->boot_osflags.length()+1);
+ params()->boot_osflags.c_str(),
+ params()->boot_osflags.length() + 1);
/**
* find the address of the est_cycle_freq variable and insert it
else
panic("Unknown int size");
- initVirtMem.writeBlob(memState->getStackMin(), (uint8_t*)&argc, intSize);
+ initVirtMem.writeBlob(memState->getStackMin(), &argc, intSize);
copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
* others do.)
*/
if (consoleSymtab->findAddress("env_booted_osflags", addr)) {
- virtProxy.writeBlob(addr, (uint8_t*)params()->boot_osflags.c_str(),
+ virtProxy.writeBlob(addr, params()->boot_osflags.c_str(),
strlen(params()->boot_osflags.c_str()));
}
uint32_t tlsPtr = process->getSyscallArg(tc, index);
tc->getMemProxy().writeBlob(ArmLinuxProcess32::commPage + 0x0ff0,
- (uint8_t *)&tlsPtr, sizeof(tlsPtr));
+ &tlsPtr, sizeof(tlsPtr));
tc->setMiscReg(MISCREG_TPIDRURO,tlsPtr);
return 0;
}
//Write out the sentry void *
IntType sentry_NULL = 0;
- initVirtMem.writeBlob(sentry_base,
- (uint8_t*)&sentry_NULL, sentry_size);
+ initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
//Fix up the aux vectors which point to other data
for (int i = auxv.size() - 1; i >= 0; i--) {
copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
- initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
+ initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
ThreadContext *tc = system->getThreadContext(contextIds[0]);
//Set the stack pointer register
std::vector<char> buf(len + 1);
buf[len] = '\0';
- physProxy(tc).readBlob(ptr, (uint8_t *)buf.data(), len);
+ physProxy(tc).readBlob(ptr, buf.data(), len);
return std::string(buf.data());
}
if (path_len >= max_len)
return retError(ENOSPC);
- physProxy(tc).writeBlob(
- guest_buf, (const uint8_t *)path, path_len + 1);
+ physProxy(tc).writeBlob(guest_buf, path, path_len + 1);
return retOK(0);
}
if (cmdLine.size() + 1 < argv[2]) {
PortProxy &proxy = physProxy(tc);
ByteOrder endian = ArmISA::byteOrder(tc);
- proxy.writeBlob(
- (Addr)argv[1],
- (const uint8_t *)cmdLine.c_str(), cmdLine.size() + 1);
+ proxy.writeBlob((Addr)argv[1], cmdLine.c_str(), cmdLine.size() + 1);
if (aarch64)
proxy.write<uint64_t>(argv[0] + 1 * 8, cmdLine.size(), endian);
addr = tc->readMiscRegNoEffect(TheISA::CurThreadInfoReg);
PortProxy &p = tc->getPhysProxy();
- p.readBlob(addr, (uint8_t *)&sp, sizeof(Addr));
+ p.readBlob(addr, &sp, sizeof(Addr));
return sp & ~ULL(0x3fff);
}
argc = htog((IntType)argc);
- initVirtMem.writeBlob(memState->getStackMin(), (uint8_t*)&argc, intSize);
+ initVirtMem.writeBlob(memState->getStackMin(), &argc, intSize);
copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
//Write out the sentry void *
uint32_t sentry_NULL = 0;
- initVirtMem.writeBlob(sentry_base,
- (uint8_t*)&sentry_NULL, sentry_size);
+ initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
//Fix up the aux vectors which point to other data
for (int i = auxv.size() - 1; i >= 0; i--) {
copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
- initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
+ initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
ThreadContext *tc = system->getThreadContext(contextIds[0]);
// Write out the sentry void *
uint64_t sentry_NULL = 0;
- initVirtMem.writeBlob(sentry_base,
- (uint8_t*)&sentry_NULL, sentry_size);
+ initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
// Write the file name
initVirtMem.writeString(file_name_base, filename.c_str());
copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
- initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
+ initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
// Set up space for the trap handlers into the processes address space.
// Since the stack grows down and there is reserved address space abov
// Stuff the trap handlers into the process address space
initVirtMem.writeBlob(fillStart,
- (uint8_t*)fillHandler64, sizeof(MachInst) * numFillInsts);
+ fillHandler64, sizeof(MachInst) * numFillInsts);
initVirtMem.writeBlob(spillStart,
- (uint8_t*)spillHandler64, sizeof(MachInst) * numSpillInsts);
+ spillHandler64, sizeof(MachInst) * numSpillInsts);
}
void
// Stuff the trap handlers into the process address space
initVirtMem.writeBlob(fillStart,
- (uint8_t*)fillHandler32, sizeof(MachInst) * numFillInsts);
+ fillHandler32, sizeof(MachInst) * numFillInsts);
initVirtMem.writeBlob(spillStart,
- (uint8_t*)spillHandler32, sizeof(MachInst) * numSpillInsts);
+ spillHandler32, sizeof(MachInst) * numSpillInsts);
}
void Sparc32Process::flushWindows(ThreadContext *tc)
void writeVal(T val, PortProxy& proxy, Addr &addr)
{
T guestVal = htog(val);
- proxy.writeBlob(addr, (uint8_t *)&guestVal, sizeof(T));
+ proxy.writeBlob(addr, &guestVal, sizeof(T));
addr += sizeof(T);
}
uint8_t guestE820Nr = htog(e820Nr);
- proxy.writeBlob(countAddr, (uint8_t *)&guestE820Nr, sizeof(guestE820Nr));
+ proxy.writeBlob(countAddr, &guestE820Nr, sizeof(guestE820Nr));
for (int i = 0; i < e820Nr; i++) {
writeVal(entries[i]->addr, proxy, addr);
writeOutField(PortProxy& proxy, Addr addr, T val)
{
uint64_t guestVal = X86ISA::htog(val);
- proxy.writeBlob(addr, (uint8_t *)(&guestVal), sizeof(T));
+ proxy.writeBlob(addr, &guestVal, sizeof(T));
uint8_t checkSum = 0;
while (guestVal) {
memcpy(cleanedString, str.c_str(), str.length());
memset(cleanedString + str.length(), 0, length - str.length());
}
- proxy.writeBlob(addr, (uint8_t *)(&cleanedString), length);
+ proxy.writeBlob(addr, &cleanedString, length);
uint8_t checkSum = 0;
for (int i = 0; i < length; i++)
uint8_t checkSum = 0;
- proxy.writeBlob(addr, (uint8_t *)signature, 4);
+ proxy.writeBlob(addr, signature, 4);
for (int i = 0; i < 4; i++)
checkSum += signature[i];
{
uint8_t checkSum = 0;
- proxy.writeBlob(addr, (uint8_t *)signature, 4);
+ proxy.writeBlob(addr, signature, 4);
for (int i = 0; i < 4; i++)
checkSum += signature[i];
// Base table length goes here but will be calculated later.
- proxy.writeBlob(addr + 6, (uint8_t *)(&specRev), 1);
+ proxy.writeBlob(addr + 6, &specRev, 1);
checkSum += specRev;
// The checksum goes here but is still being calculated.
checkSum += writeOutField(proxy, addr + 8, featureFlags);
uint32_t reserved = 0;
- proxy.writeBlob(addr + 12, (uint8_t *)(&reserved), 4);
- proxy.writeBlob(addr + 16, (uint8_t *)(&reserved), 4);
+ proxy.writeBlob(addr + 12, &reserved, 4);
+ proxy.writeBlob(addr + 16, &reserved, 4);
return 20;
}
checkSum += writeOutField(proxy, addr + 4, parentBus);
uint32_t reserved = 0;
- proxy.writeBlob(addr + 5, (uint8_t *)(&reserved), 3);
+ proxy.writeBlob(addr + 5, &reserved, 3);
return length;
}
uint16_t
X86ISA::SMBios::SMBiosStructure::writeOut(PortProxy& proxy, Addr addr)
{
- proxy.writeBlob(addr, (uint8_t *)(&type), 1);
+ proxy.writeBlob(addr, &type, 1);
uint8_t length = getLength();
- proxy.writeBlob(addr + 1, (uint8_t *)(&length), 1);
+ proxy.writeBlob(addr + 1, &length, 1);
uint16_t handleGuest = X86ISA::htog(handle);
- proxy.writeBlob(addr + 2, (uint8_t *)(&handleGuest), 2);
+ proxy.writeBlob(addr + 2, &handleGuest, 2);
return length + getStringLength();
}
// If there are string fields but none of them are used, that's a
// special case which is handled by this if.
if (strings.size() == 0 && stringFields) {
- proxy.writeBlob(addr + offset, (uint8_t *)(&nullTerminator), 1);
+ proxy.writeBlob(addr + offset, &nullTerminator, 1);
offset++;
} else {
for (it = strings.begin(); it != strings.end(); it++) {
- proxy.writeBlob(addr + offset,
- (uint8_t *)it->c_str(), it->length() + 1);
+ proxy.writeBlob(addr + offset, it->c_str(), it->length() + 1);
offset += it->length() + 1;
}
}
- proxy.writeBlob(addr + offset, (uint8_t *)(&nullTerminator), 1);
+ proxy.writeBlob(addr + offset, &nullTerminator, 1);
}
int
{
uint8_t size = SMBiosStructure::writeOut(proxy, addr);
- proxy.writeBlob(addr + 0x4, (uint8_t *)(&vendor), 1);
- proxy.writeBlob(addr + 0x5, (uint8_t *)(&version), 1);
+ proxy.writeBlob(addr + 0x4, &vendor, 1);
+ proxy.writeBlob(addr + 0x5, &version, 1);
uint16_t startingAddrSegmentGuest = X86ISA::htog(startingAddrSegment);
- proxy.writeBlob(addr + 0x6, (uint8_t *)(&startingAddrSegmentGuest), 2);
+ proxy.writeBlob(addr + 0x6, &startingAddrSegmentGuest, 2);
- proxy.writeBlob(addr + 0x8, (uint8_t *)(&releaseDate), 1);
- proxy.writeBlob(addr + 0x9, (uint8_t *)(&romSize), 1);
+ proxy.writeBlob(addr + 0x8, &releaseDate, 1);
+ proxy.writeBlob(addr + 0x9, &romSize, 1);
uint64_t characteristicsGuest = X86ISA::htog(characteristics);
- proxy.writeBlob(addr + 0xA, (uint8_t *)(&characteristicsGuest), 8);
+ proxy.writeBlob(addr + 0xA, &characteristicsGuest, 8);
uint16_t characteristicExtBytesGuest =
X86ISA::htog(characteristicExtBytes);
- proxy.writeBlob(addr + 0x12, (uint8_t *)(&characteristicExtBytesGuest), 2);
+ proxy.writeBlob(addr + 0x12, &characteristicExtBytesGuest, 2);
- proxy.writeBlob(addr + 0x14, (uint8_t *)(&majorVer), 1);
- proxy.writeBlob(addr + 0x15, (uint8_t *)(&minorVer), 1);
- proxy.writeBlob(addr + 0x16, (uint8_t *)(&embContFirmwareMajor), 1);
- proxy.writeBlob(addr + 0x17, (uint8_t *)(&embContFirmwareMinor), 1);
+ proxy.writeBlob(addr + 0x14, &majorVer, 1);
+ proxy.writeBlob(addr + 0x15, &minorVer, 1);
+ proxy.writeBlob(addr + 0x16, &embContFirmwareMajor, 1);
+ proxy.writeBlob(addr + 0x17, &embContFirmwareMinor, 1);
writeOutStrings(proxy, addr + getLength());
// The checksum goes here, but we're figuring it out as we go.
- proxy.writeBlob(addr + 0x5,
- (uint8_t *)(&smbiosHeader.entryPointLength), 1);
+ proxy.writeBlob(addr + 0x5, &smbiosHeader.entryPointLength, 1);
mainChecksum += smbiosHeader.entryPointLength;
- proxy.writeBlob(addr + 0x6,
- (uint8_t *)(&smbiosHeader.majorVersion), 1);
+ proxy.writeBlob(addr + 0x6, &smbiosHeader.majorVersion, 1);
mainChecksum += smbiosHeader.majorVersion;
- proxy.writeBlob(addr + 0x7,
- (uint8_t *)(&smbiosHeader.minorVersion), 1);
+ proxy.writeBlob(addr + 0x7, &smbiosHeader.minorVersion, 1);
mainChecksum += smbiosHeader.minorVersion;
// Maximum structure size goes here, but we'll figure it out later.
- proxy.writeBlob(addr + 0xA,
- (uint8_t *)(&smbiosHeader.entryPointRevision), 1);
+ proxy.writeBlob(addr + 0xA, &smbiosHeader.entryPointRevision, 1);
mainChecksum += smbiosHeader.entryPointRevision;
- proxy.writeBlob(addr + 0xB,
- (uint8_t *)(&smbiosHeader.formattedArea), 5);
+ proxy.writeBlob(addr + 0xB, &smbiosHeader.formattedArea, 5);
for (int i = 0; i < 5; i++)
mainChecksum += smbiosHeader.formattedArea[i];
uint8_t intChecksum = 0;
proxy.writeBlob(addr + 0x10,
- (uint8_t *)smbiosHeader.intermediateHeader.anchorString, 5);
+ smbiosHeader.intermediateHeader.anchorString, 5);
for (int i = 0; i < 5; i++)
intChecksum += smbiosHeader.intermediateHeader.anchorString[i];
uint32_t tableAddrGuest =
X86ISA::htog(smbiosHeader.intermediateHeader.tableAddr);
- proxy.writeBlob(addr + 0x18, (uint8_t *)(&tableAddrGuest), 4);
+ proxy.writeBlob(addr + 0x18, &tableAddrGuest, 4);
for (int i = 0; i < 4; i++) {
intChecksum += tableAddrGuest;
tableAddrGuest >>= 8;
}
uint16_t numStructs = X86ISA::gtoh(structures.size());
- proxy.writeBlob(addr + 0x1C, (uint8_t *)(&numStructs), 2);
+ proxy.writeBlob(addr + 0x1C, &numStructs, 2);
for (int i = 0; i < 2; i++) {
intChecksum += numStructs;
numStructs >>= 8;
}
proxy.writeBlob(addr + 0x1E,
- (uint8_t *)(&smbiosHeader.intermediateHeader.smbiosBCDRevision),
- 1);
+ &smbiosHeader.intermediateHeader.smbiosBCDRevision, 1);
intChecksum += smbiosHeader.intermediateHeader.smbiosBCDRevision;
/*
*/
maxSize = X86ISA::htog(maxSize);
- proxy.writeBlob(addr + 0x8, (uint8_t *)(&maxSize), 2);
+ proxy.writeBlob(addr + 0x8, &maxSize, 2);
for (int i = 0; i < 2; i++) {
mainChecksum += maxSize;
maxSize >>= 8;
// Set the checksum
mainChecksum = -mainChecksum;
- proxy.writeBlob(addr + 0x4, (uint8_t *)(&mainChecksum), 1);
+ proxy.writeBlob(addr + 0x4, &mainChecksum, 1);
/*
* Intermediate header
uint16_t tableSize = offset;
tableSize = X86ISA::htog(tableSize);
- proxy.writeBlob(addr + 0x16, (uint8_t *)(&tableSize), 2);
+ proxy.writeBlob(addr + 0x16, &tableSize, 2);
for (int i = 0; i < 2; i++) {
intChecksum += tableSize;
tableSize >>= 8;
}
intChecksum = -intChecksum;
- proxy.writeBlob(addr + 0x15, (uint8_t *)(&intChecksum), 1);
+ proxy.writeBlob(addr + 0x15, &intChecksum, 1);
}
X86ISA::SMBios::BiosInformation *
if (commandLine.length() + 1 > realModeData - commandLineBuff)
panic("Command line \"%s\" is longer than %d characters.\n",
commandLine, realModeData - commandLineBuff - 1);
- physProxy.writeBlob(commandLineBuff, (uint8_t *)commandLine.c_str(),
+ physProxy.writeBlob(commandLineBuff, commandLine.c_str(),
commandLine.length() + 1);
// Generate a pointer of the right size and endianness to put into
// commandLinePointer.
uint32_t guestCommandLineBuff =
X86ISA::htog((uint32_t)commandLineBuff);
- physProxy.writeBlob(commandLinePointer, (uint8_t *)&guestCommandLineBuff,
+ physProxy.writeBlob(commandLinePointer, &guestCommandLineBuff,
sizeof(guestCommandLineBuff));
/*
uint8_t numGDTEntries = 0;
uint64_t nullDescriptor = 0;
physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
- (uint8_t *)(&nullDescriptor), 8);
+ &nullDescriptor, 8);
numGDTEntries++;
SegDescriptor initDesc = 0;
csLowPLDesc.dpl = 0;
uint64_t csLowPLDescVal = csLowPLDesc;
physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
- (uint8_t *)(&csLowPLDescVal), 8);
+ &csLowPLDescVal, 8);
numGDTEntries++;
dsLowPLDesc.dpl = 0;
uint64_t dsLowPLDescVal = dsLowPLDesc;
physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
- (uint8_t *)(&dsLowPLDescVal), 8);
+ &dsLowPLDescVal, 8);
numGDTEntries++;
dsDesc.dpl = 3;
uint64_t dsDescVal = dsDesc;
physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
- (uint8_t *)(&dsDescVal), 8);
+ &dsDescVal, 8);
numGDTEntries++;
csDesc.dpl = 3;
uint64_t csDescVal = csDesc;
physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
- (uint8_t *)(&csDescVal), 8);
+ &csDescVal, 8);
numGDTEntries++;
} tssDescVal = {TSSDescLow, TSSDescHigh};
physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
- (uint8_t *)(&tssDescVal), sizeof(tssDescVal));
+ &tssDescVal, sizeof(tssDescVal));
numGDTEntries++;
tss.RSP1_high = tss.IST1_high;
tss.RSP2_low = tss.IST1_low;
tss.RSP2_high = tss.IST1_high;
- physProxy.writeBlob(tssPhysAddr, (uint8_t *)(&tss), sizeof(tss));
+ physProxy.writeBlob(tssPhysAddr, &tss, sizeof(tss));
/* Setting IDT gates */
GateDescriptorLow PFGateLow = 0;
uint64_t high;
} PFGate = {PFGateLow, PFGateHigh};
- physProxy.writeBlob(idtPhysAddr + 0xE0,
- (uint8_t *)(&PFGate), sizeof(PFGate));
+ physProxy.writeBlob(idtPhysAddr + 0xE0, &PFGate, sizeof(PFGate));
/* System call handler */
uint8_t syscallBlob[] = {
// Write out the sentry void *
IntType sentry_NULL = 0;
- initVirtMem.writeBlob(sentry_base, (uint8_t*)&sentry_NULL, sentry_size);
+ initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
// Write the file name
initVirtMem.writeString(file_name_base, filename.c_str());
copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
- initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
+ initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
ThreadContext *tc = system->getThreadContext(contextIds[0]);
// Set the stack pointer register
int size = 6;
uint64_t is[size];
// reading the interrupt handler stack
- proxy.readBlob(ISTVirtAddr + PageBytes - size*sizeof(uint64_t),
- (uint8_t *)&is, sizeof(is));
+ proxy.readBlob(ISTVirtAddr + PageBytes - size * sizeof(uint64_t),
+ &is, sizeof(is));
panic("Page fault at addr %#x\n\tInterrupt handler stack:\n"
"\tss: %#x\n"
"\trsp: %#x\n"
uint8_t numGDTEntries = 0;
// Place holder at selector 0
uint64_t nullDescriptor = 0;
- physProxy.writeBlob(GDTBase + numGDTEntries * 8,
- (uint8_t *)(&nullDescriptor), 8);
+ physProxy.writeBlob(GDTBase + numGDTEntries * 8, &nullDescriptor, 8);
numGDTEntries++;
SegDescriptor initDesc = 0;
// it's beginning in memory and it's actual data, we'll use an
// intermediary.
uint64_t csDescVal = csDesc;
- physProxy.writeBlob(GDTBase + numGDTEntries * 8,
- (uint8_t *)(&csDescVal), 8);
+ physProxy.writeBlob(GDTBase + numGDTEntries * 8, (&csDescVal), 8);
numGDTEntries++;
// 32 bit data segment
SegDescriptor dsDesc = initDesc;
uint64_t dsDescVal = dsDesc;
- physProxy.writeBlob(GDTBase + numGDTEntries * 8,
- (uint8_t *)(&dsDescVal), 8);
+ physProxy.writeBlob(GDTBase + numGDTEntries * 8, (&dsDescVal), 8);
numGDTEntries++;
SegDescriptor tssDesc = initDesc;
uint64_t tssDescVal = tssDesc;
- physProxy.writeBlob(GDTBase + numGDTEntries * 8,
- (uint8_t *)(&tssDescVal), 8);
+ physProxy.writeBlob(GDTBase + numGDTEntries * 8, (&tssDescVal), 8);
numGDTEntries++;
// read/write, user, not present
uint64_t pml4e = X86ISA::htog(0x6);
for (int offset = 0; offset < (1 << PML4Bits) * 8; offset += 8) {
- physProxy.writeBlob(PageMapLevel4 + offset, (uint8_t *)(&pml4e), 8);
+ physProxy.writeBlob(PageMapLevel4 + offset, (&pml4e), 8);
}
// Point to the only PDPT
pml4e = X86ISA::htog(0x7 | PageDirPtrTable);
- physProxy.writeBlob(PageMapLevel4, (uint8_t *)(&pml4e), 8);
+ physProxy.writeBlob(PageMapLevel4, (&pml4e), 8);
// Page Directory Pointer Table
// read/write, user, not present
uint64_t pdpe = X86ISA::htog(0x6);
- for (int offset = 0; offset < (1 << PDPTBits) * 8; offset += 8) {
- physProxy.writeBlob(PageDirPtrTable + offset,
- (uint8_t *)(&pdpe), 8);
- }
+ for (int offset = 0; offset < (1 << PDPTBits) * 8; offset += 8)
+ physProxy.writeBlob(PageDirPtrTable + offset, &pdpe, 8);
// Point to the PDTs
for (int table = 0; table < NumPDTs; table++) {
pdpe = X86ISA::htog(0x7 | PageDirTable[table]);
- physProxy.writeBlob(PageDirPtrTable + table * 8,
- (uint8_t *)(&pdpe), 8);
+ physProxy.writeBlob(PageDirPtrTable + table * 8, &pdpe, 8);
}
// Page Directory Tables
for (int offset = 0; offset < (1 << PDTBits) * 8; offset += 8) {
// read/write, user, present, 4MB
uint64_t pdte = X86ISA::htog(0x87 | base);
- physProxy.writeBlob(PageDirTable[table] + offset,
- (uint8_t *)(&pdte), 8);
+ physProxy.writeBlob(PageDirTable[table] + offset, &pdte, 8);
base += pageSize;
}
}
parseLine(Line, &MemAddr, &Data);
if (MemAddr != 0) {
// Now, write to memory
- memProxy.writeBlob(MemAddr << 2, (uint8_t *)&Data, sizeof(Data));
+ memProxy.writeBlob(MemAddr << 2, &Data, sizeof(Data));
}
}
return true;
if (FullSystem) {
FSTranslatingPortProxy &proxy = tc->getVirtProxy();
- proxy.readBlob(vaddr, (uint8_t*)data, size);
+ proxy.readBlob(vaddr, data, size);
} else {
SETranslatingPortProxy &proxy = tc->getMemProxy();
- proxy.readBlob(vaddr, (uint8_t*)data, size);
+ proxy.readBlob(vaddr, data, size);
}
#if TRACING_ON
}
if (FullSystem) {
FSTranslatingPortProxy &proxy = tc->getVirtProxy();
- proxy.writeBlob(vaddr, (uint8_t*)data, size);
+ proxy.writeBlob(vaddr, data, size);
} else {
SETranslatingPortProxy &proxy = tc->getMemProxy();
- proxy.writeBlob(vaddr, (uint8_t*)data, size);
+ proxy.writeBlob(vaddr, data, size);
}
return true;
to create an address for the SG page
*/
- tbaMask = ~(((wsm[i] & (ULL(0xfff) << 20)) >> 10) | ULL(0x3ff));
+ tbaMask = ~(((wsm[i] & (ULL(0xfff) << 20)) >> 10) |
+ ULL(0x3ff));
baMask = (wsm[i] & (ULL(0xfff) << 20)) | (ULL(0x7f) << 13);
pteAddr = (tba[i] & tbaMask) | ((busAddr & baMask) >> 10);
- sys->physProxy.readBlob(pteAddr, (uint8_t*)&pteEntry,
+ sys->physProxy.readBlob(pteAddr, &pteEntry,
sizeof(uint64_t));
- dmaAddr = ((pteEntry & ~ULL(0x1)) << 12) | (busAddr & ULL(0x1fff));
+ dmaAddr = ((pteEntry & ~ULL(0x1)) << 12) |
+ (busAddr & ULL(0x1fff));
} else {
baMask = (wsm[i] & (ULL(0xfff) << 20)) | ULL(0xfffff);
uint8_t lpi_config_table[number_lpis];
memProxy->readBlob(lpiPendingTablePtr,
- (uint8_t *) lpi_pending_table,
+ lpi_pending_table,
sizeof(lpi_pending_table));
memProxy->readBlob(lpiConfigurationTablePtr,
- (uint8_t*) lpi_config_table,
+ lpi_config_table,
sizeof(lpi_config_table));
for (int lpi_id = SMALLEST_LPI_ID; lpi_id < largest_lpi_id;
uint8_t lpi_pending_entry;
memProxy->readBlob(lpi_pending_entry_ptr,
- (uint8_t*) &lpi_pending_entry,
+ &lpi_pending_entry,
sizeof(lpi_pending_entry));
return lpi_pending_entry;
Addr lpi_pending_entry_ptr = lpiPendingTablePtr + (lpi_id / 8);
memProxy->writeBlob(lpi_pending_entry_ptr,
- (uint8_t*) &lpi_pending_entry,
+ &lpi_pending_entry,
sizeof(lpi_pending_entry));
}
assert(_index < queue->getSize());
const Addr desc_addr(vq_addr + sizeof(desc) * _index);
vring_desc guest_desc;
- memProxy->readBlob(desc_addr, (uint8_t *)&guest_desc, sizeof(guest_desc));
+ memProxy->readBlob(desc_addr, &guest_desc, sizeof(guest_desc));
desc = vtoh_legacy(guest_desc);
DPRINTF(VIO,
"VirtDescriptor(%i): Addr: 0x%x, Len: %i, Flags: 0x%x, "
if (!isOutgoing())
panic("Trying to write to incoming buffer\n");
- memProxy->writeBlob(desc.addr + offset, const_cast<uint8_t *>(src), size);
+ memProxy->writeBlob(desc.addr + offset, src, size);
}
void
/** Update the ring buffer header with data from the guest. */
void readHeader() {
assert(_base != 0);
- _proxy.readBlob(_base, (uint8_t *)&header, sizeof(header));
+ _proxy.readBlob(_base, &header, sizeof(header));
header.flags = vtoh_legacy(header.flags);
header.index = vtoh_legacy(header.index);
}
assert(_base != 0);
out.flags = htov_legacy(header.flags);
out.index = htov_legacy(header.index);
- _proxy.writeBlob(_base, (uint8_t *)&out, sizeof(out));
+ _proxy.writeBlob(_base, &out, sizeof(out));
}
void read() {
/* Read and byte-swap the elements in the ring */
T temp[ring.size()];
_proxy.readBlob(_base + sizeof(header),
- (uint8_t *)temp, sizeof(T) * ring.size());
+ temp, sizeof(T) * ring.size());
for (int i = 0; i < ring.size(); ++i)
ring[i] = vtoh_legacy(temp[i]);
}
for (int i = 0; i < ring.size(); ++i)
temp[i] = htov_legacy(ring[i]);
_proxy.writeBlob(_base + sizeof(header),
- (uint8_t *)temp, sizeof(T) * ring.size());
+ temp, sizeof(T) * ring.size());
writeHeader();
}
AddrType data_ptr_swap;
for (std::vector<std::string>::size_type i = 0; i < strings.size(); ++i) {
data_ptr_swap = TheISA::htog(data_ptr);
- memProxy.writeBlob(array_ptr, (uint8_t*)&data_ptr_swap,
- sizeof(AddrType));
+ memProxy.writeBlob(array_ptr, &data_ptr_swap, sizeof(AddrType));
memProxy.writeString(data_ptr, strings[i].c_str());
array_ptr += sizeof(AddrType);
data_ptr += strings[i].size() + 1;
// add NULL terminator
data_ptr = 0;
- memProxy.writeBlob(array_ptr, (uint8_t*)&data_ptr, sizeof(AddrType));
+ memProxy.writeBlob(array_ptr, &data_ptr, sizeof(AddrType));
}
#endif
struct iovec hiov[count];
for (size_t i = 0; i < count; ++i) {
prox.readBlob(tiov_base + (i * sizeof(typename OS::tgt_iovec)),
- (uint8_t*)&tiov[i], sizeof(typename OS::tgt_iovec));
+ &tiov[i], sizeof(typename OS::tgt_iovec));
hiov[i].iov_len = TheISA::gtoh(tiov[i].iov_len);
hiov[i].iov_base = new char [hiov[i].iov_len];
}
for (size_t i = 0; i < count; ++i) {
if (result != -1) {
prox.writeBlob(TheISA::htog(tiov[i].iov_base),
- (uint8_t*)hiov[i].iov_base, hiov[i].iov_len);
+ hiov[i].iov_base, hiov[i].iov_len);
}
delete [] (char *)hiov[i].iov_base;
}
typename OS::tgt_iovec tiov;
prox.readBlob(tiov_base + i*sizeof(typename OS::tgt_iovec),
- (uint8_t*)&tiov, sizeof(typename OS::tgt_iovec));
+ &tiov, sizeof(typename OS::tgt_iovec));
hiov[i].iov_len = TheISA::gtoh(tiov.iov_len);
hiov[i].iov_base = new char [hiov[i].iov_len];
- prox.readBlob(TheISA::gtoh(tiov.iov_base), (uint8_t *)hiov[i].iov_base,
+ prox.readBlob(TheISA::gtoh(tiov.iov_base), hiov[i].iov_base,
hiov[i].iov_len);
}
typename OS::time_t t = sec;
t = TheISA::htog(t);
SETranslatingPortProxy &p = tc->getMemProxy();
- p.writeBlob(taddr, (uint8_t*)&t, (int)sizeof(typename OS::time_t));
+ p.writeBlob(taddr, &t, (int)sizeof(typename OS::time_t));
}
return sec;
}