AreaKeeper.h: move to headers/private/kernel
Change-Id: I9ae2b9a6243809a618c0520a26e064ce3c5be2b4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2410 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
2930142932
commit
bed01fe356
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Axel Dörfler, [email protected]
|
||||
*/
|
||||
#ifndef AREA_KEEPER_H
|
||||
#define AREA_KEEPER_H
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
#include <OS.h>
|
||||
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
|
||||
class AreaKeeper {
|
||||
public:
|
||||
AreaKeeper();
|
||||
~AreaKeeper();
|
||||
|
||||
area_id Create(const char *name, void **_virtualAddress, uint32 spec,
|
||||
size_t size, uint32 lock, uint32 protection);
|
||||
area_id Map(const char *name, addr_t physicalAddress, size_t numBytes,
|
||||
uint32 spec, uint32 protection, void **_virtualAddress);
|
||||
|
||||
status_t InitCheck() { return fArea < B_OK ? (status_t)fArea : B_OK; }
|
||||
void Detach();
|
||||
|
||||
private:
|
||||
area_id fArea;
|
||||
};
|
||||
|
||||
|
||||
AreaKeeper::AreaKeeper()
|
||||
:
|
||||
fArea(-1)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
AreaKeeper::~AreaKeeper()
|
||||
{
|
||||
if (fArea >= B_OK)
|
||||
delete_area(fArea);
|
||||
}
|
||||
|
||||
|
||||
area_id
|
||||
AreaKeeper::Create(const char *name, void **_virtualAddress, uint32 spec,
|
||||
size_t size, uint32 lock, uint32 protection)
|
||||
{
|
||||
fArea = create_area(name, _virtualAddress, spec, size, lock, protection);
|
||||
return fArea;
|
||||
}
|
||||
|
||||
|
||||
area_id
|
||||
AreaKeeper::Map(const char *name, addr_t physicalAddress, size_t numBytes,
|
||||
uint32 spec, uint32 protection, void **_virtualAddress)
|
||||
{
|
||||
fArea = map_physical_memory(name, physicalAddress, numBytes, spec,
|
||||
protection, _virtualAddress);
|
||||
return fArea;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AreaKeeper::Detach()
|
||||
{
|
||||
fArea = -1;
|
||||
}
|
||||
|
||||
#endif // AREA_KEEPER_H
|
||||
@@ -11,12 +11,12 @@
|
||||
|
||||
#include "intel_extreme.h"
|
||||
|
||||
#include "AreaKeeper.h"
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <AreaKeeper.h>
|
||||
#include <boot_item.h>
|
||||
#include <driver_settings.h>
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "radeon_hd.h"
|
||||
#include "sensors.h"
|
||||
|
||||
#include "AreaKeeper.h"
|
||||
#include "driver.h"
|
||||
#include "utility.h"
|
||||
|
||||
@@ -22,6 +21,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <AreaKeeper.h>
|
||||
#include <boot_item.h>
|
||||
#include <driver_settings.h>
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Axel Dörfler, axeld@pinc-software.de
|
||||
*/
|
||||
#ifndef AREA_KEEPER_H
|
||||
#define AREA_KEEPER_H
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
#include <OS.h>
|
||||
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
|
||||
class AreaKeeper {
|
||||
public:
|
||||
AreaKeeper();
|
||||
~AreaKeeper();
|
||||
|
||||
area_id Create(const char *name, void **_virtualAddress, uint32 spec,
|
||||
size_t size, uint32 lock, uint32 protection);
|
||||
area_id Map(const char *name, phys_addr_t physicalAddress,
|
||||
size_t numBytes, uint32 spec, uint32 protection,
|
||||
void **_virtualAddress);
|
||||
|
||||
status_t InitCheck() { return fArea < B_OK ? (status_t)fArea : B_OK; }
|
||||
void Detach();
|
||||
|
||||
private:
|
||||
area_id fArea;
|
||||
};
|
||||
|
||||
|
||||
AreaKeeper::AreaKeeper()
|
||||
:
|
||||
fArea(-1)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
AreaKeeper::~AreaKeeper()
|
||||
{
|
||||
if (fArea >= B_OK)
|
||||
delete_area(fArea);
|
||||
}
|
||||
|
||||
|
||||
area_id
|
||||
AreaKeeper::Create(const char *name, void **_virtualAddress, uint32 spec,
|
||||
size_t size, uint32 lock, uint32 protection)
|
||||
{
|
||||
fArea = create_area(name, _virtualAddress, spec, size, lock, protection);
|
||||
return fArea;
|
||||
}
|
||||
|
||||
|
||||
area_id
|
||||
AreaKeeper::Map(const char *name, phys_addr_t physicalAddress, size_t numBytes,
|
||||
uint32 spec, uint32 protection, void **_virtualAddress)
|
||||
{
|
||||
fArea = map_physical_memory(name, physicalAddress, numBytes, spec,
|
||||
protection, _virtualAddress);
|
||||
return fArea;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AreaKeeper::Detach()
|
||||
{
|
||||
fArea = -1;
|
||||
}
|
||||
|
||||
#endif // AREA_KEEPER_H
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <AreaKeeper.h>
|
||||
#include <Drivers.h>
|
||||
#include <Errors.h>
|
||||
#include <KernelExport.h>
|
||||
@@ -17,7 +18,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "AreaKeeper.h"
|
||||
#include "pch_thermal.h"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user