Various minor cosmetic changes on acpi.c/h (mainly comments and code format)

This commit is contained in:
Sam Demeulemeester 2022-06-19 16:26:00 +02:00 committed by Sam Demeulemeester
parent a5576974cf
commit 231b389b3c
3 changed files with 12 additions and 10 deletions

View File

@ -37,7 +37,7 @@
#define CPEPSignature ('C' | ('P' << 8) | ('E' << 16) | ('P' << 24)) // Corrected Platform Error Polling Table
#define HESTSignature ('H' | ('E' << 8) | ('S' << 16) | ('T' << 24)) // Hardware Error Source Table
#define SLITSignature ('S' | ('L' << 8) | ('I' << 16) | ('T' << 24)) // System Locality System Information Table (NUMA)
#define SLITSignature ('S' | ('L' << 8) | ('I' << 16) | ('T' << 24)) // System Locality Information Table (NUMA)
#define SRATSignature ('S' | ('R' << 8) | ('A' << 16) | ('T' << 24)) // System Resource Affinity Table (NUMA)
//------------------------------------------------------------------------------
@ -326,20 +326,19 @@ int acpi_checksum(const void *data, int length)
void acpi_init(void)
{
// Find ACPI RDST Table Address
acpi_config.rsdp_addr = find_rsdp();
// Find ACPI MADT Table Address
if (acpi_config.rsdp_addr == 0) {
return;
}
acpi_config.madt_addr = find_acpi_table(MADTSignature);
// Find ACPI FADT Table Address
acpi_config.fadt_addr = find_acpi_table(FADTSignature);
// Parse FADT
if (acpi_config.fadt_addr) {
parse_fadt(acpi_config.fadt_addr);
}
// Find ACPI HPET Table Address
acpi_config.hpet_addr = find_acpi_table(HPETSignature);
}

View File

@ -4,11 +4,11 @@
/**
* \file
*
* Provides support for multi-threaded operation.
* Provides support for ACPI (Find & parse tables)
*
*//*
* Copyright (C) 2020-2022 Martin Whitaker.
* Copyright (C) 2020-2022 Sam Whitaker.
* Copyright (C) 2004-2022 Sam Demeulemeester.
*/
#include <stdbool.h>
@ -49,7 +49,8 @@ extern acpi_t acpi_config;
int acpi_checksum(const void *data, int length);
/**
* Initialises the SMP state and detects the number of available CPU cores.
* Look for specific ACPI Tables Addresses (RSDP, MADT, ...)
* and parse some of the tables
*/
void acpi_init(void);

View File

@ -376,7 +376,9 @@ static bool find_cpus_in_floating_mp_struct(void)
static bool find_cpus_in_madt(void)
{
if(acpi_config.madt_addr == 0) return false;
if (acpi_config.madt_addr == 0) {
return false
}
madt_table_header_t *mpc = (madt_table_header_t *)map_region(acpi_config.madt_addr, sizeof(madt_table_header_t), true);
if (mpc == NULL) return false;