diff --git a/kernel/include/acpica.hpp b/kernel/include/acpica.hpp new file mode 100644 index 00000000..6c3fec1f --- /dev/null +++ b/kernel/include/acpica.hpp @@ -0,0 +1,27 @@ +//======================================================================= +// Copyright Baptiste Wicht 2013-2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +//======================================================================= + +#ifndef THOR_ACPICA_HPP +#define THOR_ACPICA_HPP + +extern "C" { + +#include "thor_acenv.hpp" +#include "thor_acenvex.hpp" + +//ACPICA +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-function" //TODO Does not work +#include "acpi.h" +#pragma GCC diagnostic pop + +} //end of extern "C" + +#include + +#endif diff --git a/kernel/include/thor_acpi.hpp b/kernel/include/thor_acpi.hpp index 8546d267..b87a74b4 100644 --- a/kernel/include/thor_acpi.hpp +++ b/kernel/include/thor_acpi.hpp @@ -9,6 +9,7 @@ #define THOR_ACPI_HPP // This file contains the OS specific layer for ACPICA for thor-os +// It is meant to only be included by thor_acenv #define ACPI_MACHINE_WIDTH 64 //thor works in 64 bits diff --git a/kernel/src/acpi.cpp b/kernel/src/acpi.cpp index 6420e97c..b9502dbb 100644 --- a/kernel/src/acpi.cpp +++ b/kernel/src/acpi.cpp @@ -5,17 +5,7 @@ // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= -//ACPICA -#include "thor_acenv.hpp" //The OS Specific Layer - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-function" //TODO Does not work -#include "acpi.h" -#pragma GCC diagnostic pop - -#include - +#include "acpica.hpp" #include "acpi.hpp" #include "kernel_utils.hpp" #include "timer.hpp" diff --git a/kernel/src/thor_acpi.cpp b/kernel/src/thor_acpi.cpp new file mode 100644 index 00000000..64d7c9d3 --- /dev/null +++ b/kernel/src/thor_acpi.cpp @@ -0,0 +1,26 @@ +//======================================================================= +// Copyright Baptiste Wicht 2013-2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +//======================================================================= + +/* + * This file contains the OS specific layer + */ + +#include "acpica.hpp" + +#include "kalloc.hpp" + +extern "C" { + +void* AcpiOsAllocate(ACPI_SIZE size){ + kalloc::k_malloc(size); +} + +void AcpiOsFree(void* p){ + kalloc::k_free(p); +} + +} //end of extern "C"