Signed-off-by: Jérôme Duval <[email protected]>
This commit is contained in:
committed by
Jérôme Duval
parent
ffb788fe58
commit
711d2087c3
@@ -2,6 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers audio ice1712 ;
|
|||||||
|
|
||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
|
|
||||||
|
UsePrivateKernelHeaders ;
|
||||||
UsePrivateHeaders media ;
|
UsePrivateHeaders media ;
|
||||||
|
|
||||||
KernelAddon ice1712 :
|
KernelAddon ice1712 :
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <vm/vm.h>
|
||||||
|
#include <vm/VMAddressSpace.h>
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
static spinlock slock = B_SPINLOCK_INITIALIZER;
|
static spinlock slock = B_SPINLOCK_INITIALIZER;
|
||||||
static uint32 round_to_pagesize(uint32 size);
|
|
||||||
|
|
||||||
cpu_status
|
cpu_status
|
||||||
lock(void)
|
lock(void)
|
||||||
@@ -35,27 +37,24 @@ unlock(cpu_status status)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32
|
|
||||||
round_to_pagesize(uint32 size)
|
|
||||||
{
|
|
||||||
return (size + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
area_id
|
area_id
|
||||||
alloc_mem(physical_entry *phy, addr_t *log, size_t size, const char *name)
|
alloc_mem(physical_entry *phy, addr_t *log, size_t size, const char *name)
|
||||||
{
|
{
|
||||||
void * logadr;
|
void * logadr;
|
||||||
area_id areaid;
|
area_id areaid;
|
||||||
status_t rv;
|
status_t rv;
|
||||||
|
virtual_address_restrictions virtualRestrictions = {};
|
||||||
|
virtualRestrictions.address_specification = B_ANY_KERNEL_ADDRESS;
|
||||||
|
physical_address_restrictions physicalRestrictions = {};
|
||||||
|
physicalRestrictions.high_address = 1 << 28;
|
||||||
|
// ICE1712 chipset can not deal with memory area beyond 256MB
|
||||||
|
|
||||||
ITRACE("Allocating %s: ", name);
|
ITRACE("Allocating %s: ", name);
|
||||||
|
|
||||||
size = round_to_pagesize(size);
|
areaid = vm_create_anonymous_area(B_SYSTEM_TEAM, name, size, B_CONTIGUOUS,
|
||||||
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
B_READ_AREA | B_WRITE_AREA, 0, 0,
|
||||||
B_32_BIT_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
|
&virtualRestrictions, &physicalRestrictions, true, &logadr);
|
||||||
// TODO: The rest of the code doesn't deal correctly with physical
|
|
||||||
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
|
||||||
if (areaid < B_OK) {
|
if (areaid < B_OK) {
|
||||||
ITRACE("couldn't allocate\n");
|
ITRACE("couldn't allocate\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user