diff options
Diffstat (limited to 'source/os_specific')
| -rw-r--r-- | source/os_specific/service_layers/osbsdtbl.c | 14 | ||||
| -rw-r--r-- | source/os_specific/service_layers/osefitbl.c | 6 | ||||
| -rw-r--r-- | source/os_specific/service_layers/osefixf.c | 22 | ||||
| -rw-r--r-- | source/os_specific/service_layers/oslinuxtbl.c | 94 | ||||
| -rw-r--r-- | source/os_specific/service_layers/osunixmap.c | 2 | ||||
| -rw-r--r-- | source/os_specific/service_layers/oswintbl.c | 2 |
6 files changed, 73 insertions, 67 deletions
diff --git a/source/os_specific/service_layers/osbsdtbl.c b/source/os_specific/service_layers/osbsdtbl.c index 095d70c61c5a..ef69a6af2e45 100644 --- a/source/os_specific/service_layers/osbsdtbl.c +++ b/source/os_specific/service_layers/osbsdtbl.c @@ -171,7 +171,7 @@ AcpiOsGetTableByAddress ( return (AE_NO_MEMORY); } - ACPI_MEMCPY (LocalTable, MappedTable, MappedTable->Length); + memcpy (LocalTable, MappedTable, MappedTable->Length); AcpiOsUnmapMemory (MappedTable, MappedTable->Length); *Table = LocalTable; @@ -405,7 +405,7 @@ OslTableInitialize ( #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) else if (kenv (KENV_GET, SYSTEM_KENV, Buffer, sizeof (Buffer)) > 0) { - Address = ACPI_STRTOUL (Buffer, NULL, 0); + Address = strtoul (Buffer, NULL, 0); } #endif if (!Address) @@ -443,7 +443,7 @@ OslTableInitialize ( return (AE_ERROR); } - ACPI_MEMCPY (&Gbl_Rsdp, TableAddress, sizeof (Gbl_Rsdp)); + memcpy (&Gbl_Rsdp, TableAddress, sizeof (Gbl_Rsdp)); AcpiOsUnmapMemory (RsdpAddress, RsdpSize); /* Get XSDT from memory */ @@ -468,7 +468,7 @@ OslTableInitialize ( return (AE_NO_MEMORY); } - ACPI_MEMCPY (Gbl_Xsdt, MappedTable, MappedTable->Length); + memcpy (Gbl_Xsdt, MappedTable, MappedTable->Length); AcpiOsUnmapMemory (MappedTable, MappedTable->Length); } @@ -493,7 +493,7 @@ OslTableInitialize ( return (AE_NO_MEMORY); } - ACPI_MEMCPY (Gbl_Rsdt, MappedTable, MappedTable->Length); + memcpy (Gbl_Rsdt, MappedTable, MappedTable->Length); AcpiOsUnmapMemory (MappedTable, MappedTable->Length); } @@ -530,7 +530,7 @@ OslTableInitialize ( return (AE_NO_MEMORY); } - ACPI_MEMCPY (Gbl_Fadt, MappedTable, MappedTable->Length); + memcpy (Gbl_Fadt, MappedTable, MappedTable->Length); AcpiOsUnmapMemory (MappedTable, MappedTable->Length); Gbl_MainTableObtained = TRUE; return (AE_OK); @@ -692,7 +692,7 @@ OslGetTableViaRoot ( return (AE_NO_MEMORY); } - ACPI_MEMCPY (LocalTable, MappedTable, MappedTable->Length); + memcpy (LocalTable, MappedTable, MappedTable->Length); AcpiOsUnmapMemory (MappedTable, MappedTable->Length); *Table = LocalTable; *Address = TableAddress; diff --git a/source/os_specific/service_layers/osefitbl.c b/source/os_specific/service_layers/osefitbl.c index da9d4c659110..a1ad9fee5190 100644 --- a/source/os_specific/service_layers/osefitbl.c +++ b/source/os_specific/service_layers/osefitbl.c @@ -185,7 +185,7 @@ AcpiOsGetTableByAddress ( goto Exit; } - ACPI_MEMCPY (LocalTable, MappedTable, TableLength); + memcpy (LocalTable, MappedTable, TableLength); Exit: OslUnmapTable (MappedTable); @@ -456,7 +456,7 @@ OslLoadRsdp ( Gbl_RsdpAddress = RsdpBase + (ACPI_CAST8 (MappedTable) - RsdpAddress); - ACPI_MEMCPY (&Gbl_Rsdp, MappedTable, sizeof (ACPI_TABLE_RSDP)); + memcpy (&Gbl_Rsdp, MappedTable, sizeof (ACPI_TABLE_RSDP)); AcpiOsUnmapMemory (RsdpAddress, RsdpSize); return (AE_OK); @@ -911,7 +911,7 @@ OslGetTable ( goto Exit; } - ACPI_MEMCPY (LocalTable, MappedTable, TableLength); + memcpy (LocalTable, MappedTable, TableLength); *Address = TableAddress; *Table = LocalTable; diff --git a/source/os_specific/service_layers/osefixf.c b/source/os_specific/service_layers/osefixf.c index b9b85c59aaf5..dd7c8d4c5c11 100644 --- a/source/os_specific/service_layers/osefixf.c +++ b/source/os_specific/service_layers/osefixf.c @@ -91,6 +91,10 @@ AcpiEfiFlushFile ( /* Local variables */ static EFI_FILE_HANDLE AcpiGbl_EfiCurrentVolume = NULL; +EFI_GUID AcpiGbl_LoadedImageProtocol = LOADED_IMAGE_PROTOCOL; +EFI_GUID AcpiGbl_TextInProtocol = SIMPLE_TEXT_INPUT_PROTOCOL; +EFI_GUID AcpiGbl_TextOutProtocol = SIMPLE_TEXT_OUTPUT_PROTOCOL; +EFI_GUID AcpiGbl_FileSystemProtocol = SIMPLE_FILE_SYSTEM_PROTOCOL; /****************************************************************************** @@ -331,7 +335,7 @@ AcpiOsAllocateZeroed ( Mem = AcpiOsAllocate (Size); if (Mem) { - ACPI_MEMSET (Mem, 0, Size); + memset (Mem, 0, Size); } return (Mem); @@ -403,7 +407,7 @@ AcpiOsOpenFile ( /* Allocate path buffer */ - Count = ACPI_STRLEN (Path); + Count = strlen (Path); Path16 = ACPI_ALLOCATE_ZEROED ((Count + 1) * sizeof (CHAR16)); if (!Path16) { @@ -816,14 +820,14 @@ AcpiEfiArgify ( while (*String != '\0') { - while (ACPI_IS_SPACE (*String)) + while (isspace (*String)) { *String++ = '\0'; } Arg = CopyBuffer; while (*String != '\0') { - if (ACPI_IS_SPACE (*String) && + if (isspace (*String) && !IsSingleQuote && !IsDoubleQuote && !IsEscape) { *Arg++ = '\0'; @@ -1032,21 +1036,23 @@ efi_main ( EFI_FILE_IO_INTERFACE *Volume = NULL; - /* Initialize EFI library */ + /* Initialize global variables */ - InitializeLib (Image, SystemTab); + ST = SystemTab; + BS = SystemTab->BootServices; /* Retrieve image information */ EfiStatus = uefi_call_wrapper (BS->HandleProtocol, 3, - Image, &LoadedImageProtocol, ACPI_CAST_PTR (VOID, &Info)); + Image, &AcpiGbl_LoadedImageProtocol, ACPI_CAST_PTR (VOID, &Info)); if (EFI_ERROR (EfiStatus)) { AcpiLogError ("EFI_BOOT_SERVICES->HandleProtocol(LoadedImageProtocol) failure.\n"); return (EfiStatus); } + EfiStatus = uefi_call_wrapper (BS->HandleProtocol, 3, - Info->DeviceHandle, &FileSystemProtocol, (void **) &Volume); + Info->DeviceHandle, &AcpiGbl_FileSystemProtocol, (void **) &Volume); if (EFI_ERROR (EfiStatus)) { AcpiLogError ("EFI_BOOT_SERVICES->HandleProtocol(FileSystemProtocol) failure.\n"); diff --git a/source/os_specific/service_layers/oslinuxtbl.c b/source/os_specific/service_layers/oslinuxtbl.c index e090a3c94559..1ba362beb0d0 100644 --- a/source/os_specific/service_layers/oslinuxtbl.c +++ b/source/os_specific/service_layers/oslinuxtbl.c @@ -268,7 +268,7 @@ AcpiOsGetTableByAddress ( goto Exit; } - ACPI_MEMCPY (LocalTable, MappedTable, TableLength); + memcpy (LocalTable, MappedTable, TableLength); Exit: OslUnmapTable (MappedTable); @@ -624,7 +624,7 @@ OslLoadRsdp ( Gbl_RsdpAddress = RsdpBase + (ACPI_CAST8 (MappedTable) - RsdpAddress); - ACPI_MEMCPY (&Gbl_Rsdp, MappedTable, sizeof (ACPI_TABLE_RSDP)); + memcpy (&Gbl_Rsdp, MappedTable, sizeof (ACPI_TABLE_RSDP)); AcpiOsUnmapMemory (RsdpAddress, RsdpSize); return (AE_OK); @@ -686,68 +686,68 @@ OslTableInitialize ( return (AE_OK); } - /* Get RSDP from memory */ - - Status = OslLoadRsdp (); - if (ACPI_FAILURE (Status)) + if (!Gbl_DumpCustomizedTables) { - return (Status); - } + /* Get RSDP from memory */ - /* Get XSDT from memory */ + Status = OslLoadRsdp (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } - if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt) - { - if (Gbl_Xsdt) + /* Get XSDT from memory */ + + if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt) { - free (Gbl_Xsdt); - Gbl_Xsdt = NULL; + if (Gbl_Xsdt) + { + free (Gbl_Xsdt); + Gbl_Xsdt = NULL; + } + + Gbl_Revision = 2; + Status = OslGetBiosTable (ACPI_SIG_XSDT, 0, + ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address); + if (ACPI_FAILURE (Status)) + { + return (Status); + } } - Gbl_Revision = 2; - Status = OslGetBiosTable (ACPI_SIG_XSDT, 0, - ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address); - if (ACPI_FAILURE (Status)) + /* Get RSDT from memory */ + + if (Gbl_Rsdp.RsdtPhysicalAddress) { - return (Status); + if (Gbl_Rsdt) + { + free (Gbl_Rsdt); + Gbl_Rsdt = NULL; + } + + Status = OslGetBiosTable (ACPI_SIG_RSDT, 0, + ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address); + if (ACPI_FAILURE (Status)) + { + return (Status); + } } - } - /* Get RSDT from memory */ + /* Get FADT from memory */ - if (Gbl_Rsdp.RsdtPhysicalAddress) - { - if (Gbl_Rsdt) + if (Gbl_Fadt) { - free (Gbl_Rsdt); - Gbl_Rsdt = NULL; + free (Gbl_Fadt); + Gbl_Fadt = NULL; } - Status = OslGetBiosTable (ACPI_SIG_RSDT, 0, - ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address); + Status = OslGetBiosTable (ACPI_SIG_FADT, 0, + ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress); if (ACPI_FAILURE (Status)) { return (Status); } - } - - /* Get FADT from memory */ - if (Gbl_Fadt) - { - free (Gbl_Fadt); - Gbl_Fadt = NULL; - } - - Status = OslGetBiosTable (ACPI_SIG_FADT, 0, - ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - if (!Gbl_DumpCustomizedTables) - { /* Add mandatory tables to global table list first */ Status = OslAddTableToList (ACPI_RSDP_NAME, 0); @@ -1102,7 +1102,7 @@ OslGetBiosTable ( goto Exit; } - ACPI_MEMCPY (LocalTable, MappedTable, TableLength); + memcpy (LocalTable, MappedTable, TableLength); *Address = TableAddress; *Table = LocalTable; diff --git a/source/os_specific/service_layers/osunixmap.c b/source/os_specific/service_layers/osunixmap.c index 95993b2667ad..53737bc23d3d 100644 --- a/source/os_specific/service_layers/osunixmap.c +++ b/source/os_specific/service_layers/osunixmap.c @@ -56,7 +56,7 @@ #define O_BINARY 0 #endif -#ifdef _FreeBSD +#if defined(_DragonFly) || defined(_FreeBSD) #define MMAP_FLAGS MAP_SHARED #else #define MMAP_FLAGS MAP_PRIVATE diff --git a/source/os_specific/service_layers/oswintbl.c b/source/os_specific/service_layers/oswintbl.c index fad2ac781cc3..aebafb960a0c 100644 --- a/source/os_specific/service_layers/oswintbl.c +++ b/source/os_specific/service_layers/oswintbl.c @@ -238,7 +238,7 @@ AcpiOsGetTableByName ( while (1) { - ACPI_STRCPY (KeyBuffer, "HARDWARE\\ACPI\\"); + strcpy (KeyBuffer, "HARDWARE\\ACPI\\"); if (AcpiUtSafeStrcat (KeyBuffer, sizeof (KeyBuffer), Signature)) { return (AE_BUFFER_OVERFLOW); |
