Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push 2024 11 27 #885

Merged
merged 16 commits into from
Nov 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
alignment of 4 is enough for PciHandle API
Change-Id: Ibf7f4d9918a098f1f1070bb7c7e15afd08cb624a
  • Loading branch information
rdementi committed Nov 26, 2024
commit 53a2471d111daa972057b45667d1428f6e57a444
12 changes: 6 additions & 6 deletions src/pci.cpp
Original file line number Diff line number Diff line change
@@ -142,7 +142,7 @@ int32 PciHandle::write32(uint64 offset, uint32 value)

int32 PciHandle::read64(uint64 offset, uint64 * value)
{
warnAlignment<8>("PciHandle::read64", false, offset);
warnAlignment<4>("PciHandle::read64", false, offset);
if (hDriver != INVALID_HANDLE_VALUE)
{
PCICFG_Request req;
@@ -226,7 +226,7 @@ int32 PciHandle::write32(uint64 offset, uint32 value)

int32 PciHandle::read64(uint64 offset, uint64 * value)
{
warnAlignment<8>("PciHandle::read64", false, offset);
warnAlignment<4>("PciHandle::read64", false, offset);
uint32_t pci_address = FORM_PCI_ADDR(bus, device, function, (uint32_t)offset);
return PCIDriver_read64(pci_address, value);
}
@@ -336,7 +336,7 @@ int32 PciHandle::write32(uint64 offset, uint32 value)

int32 PciHandle::read64(uint64 offset, uint64 * value)
{
warnAlignment<8>("PciHandle::read64", false, offset);
warnAlignment<4>("PciHandle::read64", false, offset);
struct pci_io pi;
int32 ret;

@@ -437,7 +437,7 @@ int32 PciHandle::write32(uint64 offset, uint32 value)

int32 PciHandle::read64(uint64 offset, uint64 * value)
{
warnAlignment<8>("PciHandle::read64", false, offset);
warnAlignment<4>("PciHandle::read64", false, offset);
size_t res = ::pread(fd, (void *)value, sizeof(uint64), offset);
if(res != sizeof(uint64))
{
@@ -557,7 +557,7 @@ int32 PciHandleM::write32(uint64 offset, uint32 value)

int32 PciHandleM::read64(uint64 offset, uint64 * value)
{
warnAlignment<8>("PciHandleM::read64", false, offset);
warnAlignment<4>("PciHandleM::read64", false, offset);
return ::pread(fd, (void *)value, sizeof(uint64), offset + base_addr);
}

@@ -714,7 +714,7 @@ int32 PciHandleMM::write32(uint64 offset, uint32 value)

int32 PciHandleMM::read64(uint64 offset, uint64 * value)
{
warnAlignment<8>("PciHandleMM::read64", false, offset);
warnAlignment<4>("PciHandleMM::read64", false, offset);
read32(offset, (uint32 *)value);
read32(offset + sizeof(uint32), ((uint32 *)value) + 1);