Prepare the ACPICA OSL

This commit is contained in:
Baptiste Wicht 2016-07-17 19:35:18 +02:00
parent 0899b4dfd4
commit f3c60de9c1
4 changed files with 55 additions and 11 deletions

27
kernel/include/acpica.hpp Normal file
View File

@ -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 <types.hpp>
#endif

View File

@ -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

View File

@ -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 <types.hpp>
#include "acpica.hpp"
#include "acpi.hpp"
#include "kernel_utils.hpp"
#include "timer.hpp"

26
kernel/src/thor_acpi.cpp Normal file
View File

@ -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"