[acpica] Move Fuchsia OSL out of //third_party/acpica.
Bug: 79000
Change-Id: Ib6040daa988c7b17ee903fcd4aa8fc7b7e4ffbd7
diff --git a/BUILD.gn b/BUILD.gn
index aa1bb00..6ed83c2 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -3,16 +3,13 @@
# found in the LICENSE file.
import("//src/devices/bus/drivers/pci/pci.gni")
-
-declare_args() {
- # Enable debug output in the ACPI library (used by the ACPI bus driver).
- acpica_debug_output = false
-}
+import("//zircon/system/ulib/acpica/acpica.gni")
group("headers") {
public_configs = [
":headers.config",
":disable_warnings",
+ "//zircon/system/ulib/acpica:acpica-config",
]
}
@@ -64,7 +61,6 @@
cflags = [ "-fno-strict-aliasing" ]
sources = [
- "//zircon/system/ulib/acpica/osfuchsia.cc",
"source/common/ahids.c",
"source/common/ahpredef.c",
"source/common/ahtable.c",
@@ -239,11 +235,7 @@
"source/components/utilities/utxfmutex.c",
]
deps = [
- "//src/devices/pci/lib/pci",
- "//src/lib/ddk",
- "//zircon/system/ulib/bitmap",
- "//zircon/system/ulib/fbl",
- "//zircon/system/ulib/zircon-internal",
+ "//zircon/system/ulib/acpica:acpica-fuchsia",
]
defines = [ "_ALL_SOURCE" ]
if (acpica_debug_output) {
diff --git a/source/include/platform/acfuchsia.h b/source/include/platform/acfuchsia.h
deleted file mode 100644
index 6379cb3..0000000
--- a/source/include/platform/acfuchsia.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <stdbool.h>
-#include <threads.h>
-
-#include <zircon/assert.h>
-#include <zircon/syscalls.h>
-#include <semaphore.h>
-
-/*
- * Settings described in section 7 of
- * https://acpica.org/sites/acpica/files/acpica-reference_17.pdf
- */
-
-
-#if __x86_64__
-#define ACPI_MACHINE_WIDTH 64
-#elif __x86__
-#define ACPI_MACHINE_WIDTH 32
-#define ACPI_USE_NATIVE_DIVIDE
-#else
-#error Unexpected architecture
-#endif
-
-extern zx_handle_t root_resource_handle;
-
-// Make this a no-op. The only codepath we use it for is ACPI poweroff, in
-// which case we don't care about the cache state.
-#define ACPI_FLUSH_CPU_CACHE()
-
-// Use the standard library headers
-#define ACPI_USE_STANDARD_HEADERS
-#define ACPI_USE_SYSTEM_CLIBRARY
-
-// Use the builtin cache implementation
-#define ACPI_USE_LOCAL_CACHE
-
-#define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX
-
-// Specify the types Fuchsia uses for various common objects
-#define ACPI_CPU_FLAGS int
-#define ACPI_SPINLOCK mtx_t*
-#define ACPI_MUTEX mtx_t*
-#define ACPI_SEMAPHORE sem_t*
-
-// Borrowed from aclinuxex.h
-
-// Include the gcc header since we're compiling on gcc
-#include "acgcc.h"
-
-__BEGIN_CDECLS
-bool _acpica_acquire_global_lock(void *FacsPtr);
-bool _acpica_release_global_lock(void *FacsPtr);
-
-void acpica_enable_noncontested_mode(void);
-void acpica_disable_noncontested_mode(void);
-__END_CDECLS
-
-#define ACPI_ACQUIRE_GLOBAL_LOCK(FacsPtr, Acq) Acq = _acpica_acquire_global_lock(FacsPtr)
-#define ACPI_RELEASE_GLOBAL_LOCK(FacsPtr, Pnd) Pnd = _acpica_release_global_lock(FacsPtr)