Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.1:Update
pmtools
unaligned_acpidump.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File unaligned_acpidump.patch of Package pmtools
--- pmtools-20071116/acpidump/acpidump.c +++ pmtools-20071116/acpidump/acpidump.c @@ -312,7 +312,10 @@ static int acpi_dump_RSDT(int fd, struct num = (sdt->length - sizeof(struct acpi_table_header))/sizeof(u32); offset = (char *)sdt + sizeof(struct acpi_table_header); for (i = 0; i < num; ++i, offset += sizeof(u32)) { - addr = (unsigned long)(*(u32 *)offset); + u32 tmp; + memcpy(&tmp, offset, sizeof(tmp)); + addr = (unsigned long)(tmp); + if (!addr) continue; tbl = acpi_map_table(addr, 0); if (!tbl) continue; @@ -325,7 +328,8 @@ static int acpi_dump_RSDT(int fd, struct } acpi_unmap_table(tbl); if (connect) { - (*(u32*)offset) = lseek(fd, 0, SEEK_CUR); + tmp = lseek(fd, 0, SEEK_CUR); + memcpy(offset, &tmp, sizeof(tmp)); } } addr = (unsigned long)rsdp->rsdt_physical_address; @@ -357,7 +361,9 @@ static int acpi_dump_XSDT(int fd, struct num = (sdt->length - sizeof(struct acpi_table_header))/sizeof(u64); offset = (char *)sdt + sizeof(struct acpi_table_header); for (i = 0; i < num; ++i, offset += sizeof(u64)) { - addr = (unsigned long)(*(u64 *)offset); + u64 tmp; + memcpy(&tmp, offset, sizeof(tmp)); + addr = (unsigned long)tmp; if (!addr) continue; tbl = acpi_map_table(addr, 0); if (!tbl) continue; @@ -370,7 +376,8 @@ static int acpi_dump_XSDT(int fd, struct } acpi_unmap_table(tbl); if (connect) { - (*(u64*)offset) = lseek(fd, 0, SEEK_CUR); + tmp = lseek(fd, 0, SEEK_CUR); + memcpy(offset, &tmp, sizeof(tmp)); } } addr = (unsigned long)rsdp->xsdt_physical_address;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor