Style fixes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35897 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -35,6 +35,7 @@ static struct scan_spots_struct acpi_scan_spots[] = {
|
||||
static acpi_descriptor_header* sAcpiRsdt; // System Description Table
|
||||
static int32 sNumEntries = -1;
|
||||
|
||||
|
||||
static status_t
|
||||
acpi_check_rsdt(acpi_rsdp* rsdp)
|
||||
{
|
||||
@@ -44,8 +45,10 @@ acpi_check_rsdt(acpi_rsdp *rsdp)
|
||||
// map and validate the root system description table
|
||||
acpi_descriptor_header* rsdt
|
||||
= (acpi_descriptor_header*)mmu_map_physical_memory(
|
||||
rsdp->rsdt_address, sizeof(acpi_descriptor_header), kDefaultPageFlags);
|
||||
if (rsdt == NULL || strncmp(rsdt->signature, ACPI_RSDT_SIGNATURE, 4) != 0) {
|
||||
rsdp->rsdt_address, sizeof(acpi_descriptor_header),
|
||||
kDefaultPageFlags);
|
||||
if (rsdt == NULL
|
||||
|| strncmp(rsdt->signature, ACPI_RSDT_SIGNATURE, 4) != 0) {
|
||||
if (rsdt != NULL)
|
||||
mmu_free(rsdt, sizeof(acpi_descriptor_header));
|
||||
TRACE(("acpi: invalid root system description table\n"));
|
||||
@@ -63,8 +66,10 @@ acpi_find_table(const char *signature)
|
||||
if (sAcpiRsdt == NULL)
|
||||
return NULL;
|
||||
|
||||
if (sNumEntries == -1)
|
||||
sNumEntries = (sAcpiRsdt->length - sizeof(acpi_descriptor_header)) / 4;
|
||||
if (sNumEntries == -1) {
|
||||
sNumEntries = (sAcpiRsdt->length
|
||||
- sizeof(acpi_descriptor_header)) / 4;
|
||||
}
|
||||
|
||||
if (sNumEntries <= 0) {
|
||||
TRACE(("acpi: root system description table is empty\n"));
|
||||
@@ -79,14 +84,15 @@ acpi_find_table(const char *signature)
|
||||
|
||||
for (int32 j = 0; j < sNumEntries; j++, pointer++) {
|
||||
acpi_descriptor_header* header = (acpi_descriptor_header*)
|
||||
mmu_map_physical_memory(*pointer, sizeof(acpi_descriptor_header),
|
||||
kDefaultPageFlags);
|
||||
if (header == NULL || strncmp(header->signature, signature, 4) != 0) {
|
||||
mmu_map_physical_memory(*pointer,
|
||||
sizeof(acpi_descriptor_header), kDefaultPageFlags);
|
||||
if (header == NULL
|
||||
|| strncmp(header->signature, signature, 4) != 0) {
|
||||
// not interesting for us
|
||||
if (header != NULL)
|
||||
mmu_free(header, sizeof(acpi_descriptor_header));
|
||||
TRACE(("acpi: Looking for '%.4s'. Skipping '%.4s'\n", signature,
|
||||
header->signature));
|
||||
TRACE(("acpi: Looking for '%.4s'. Skipping '%.4s'\n",
|
||||
signature, header->signature));
|
||||
continue;
|
||||
}
|
||||
TRACE(("acpi: Found '%.4s' @ %p\n", signature, pointer));
|
||||
@@ -99,7 +105,7 @@ acpi_find_table(const char *signature)
|
||||
|
||||
|
||||
void
|
||||
acpi_init(void)
|
||||
acpi_init()
|
||||
{
|
||||
// Try to find the ACPI RSDP.
|
||||
for (int32 i = 0; acpi_scan_spots[i].length > 0; i++) {
|
||||
@@ -111,7 +117,8 @@ acpi_init(void)
|
||||
for (char* pointer = (char*)acpi_scan_spots[i].start;
|
||||
(uint32)pointer < acpi_scan_spots[i].stop; pointer += 16) {
|
||||
if (strncmp(pointer, ACPI_RSDP_SIGNATURE, 8) == 0) {
|
||||
TRACE(("acpi_init: found ACPI RSDP signature at %p\n", pointer));
|
||||
TRACE(("acpi_init: found ACPI RSDP signature at %p\n",
|
||||
pointer));
|
||||
rsdp = (acpi_rsdp*)pointer;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user