xref: /haiku/src/system/kernel/vm/VMKernelArea.cpp (revision b289aaf66bbf6e173aa90fa194fc256965f1b34d)
1 /*
2  * Copyright 2009-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the NewOS License.
4  */
5 
6 
7 #include "VMKernelArea.h"
8 
9 #include <heap.h>
10 #include <vm/vm_priv.h>
11 
12 
13 VMKernelArea::VMKernelArea(VMAddressSpace* addressSpace, uint32 wiring,
14 	uint32 protection)
15 	:
16 	VMArea(addressSpace, wiring, protection)
17 {
18 }
19 
20 
21 VMKernelArea::~VMKernelArea()
22 {
23 }
24 
25 
26 /*static*/ VMKernelArea*
27 VMKernelArea::Create(VMAddressSpace* addressSpace, const char* name,
28 	uint32 wiring, uint32 protection, uint32 allocationFlags)
29 {
30 	VMKernelArea* area = new(malloc_flags(allocationFlags)) VMKernelArea(
31 		addressSpace, wiring, protection);
32 	if (area == NULL)
33 		return NULL;
34 
35 	if (area->Init(name, allocationFlags) != B_OK) {
36 		delete area;
37 		return NULL;
38 	}
39 
40 	return area;
41 }
42