btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / system / kernel / vm / VMUserArea.h
blobcd3b766120bb02894698349b52796d77857224ee
1 /*
2 * Copyright 2009-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the NewOS License.
4 */
5 #ifndef VM_USER_AREA_H
6 #define VM_USER_AREA_H
9 #include <vm/VMArea.h>
12 struct VMUserAddressSpace;
15 struct VMUserArea : VMArea {
16 VMUserArea(VMAddressSpace* addressSpace,
17 uint32 wiring, uint32 protection);
18 ~VMUserArea();
20 static VMUserArea* Create(VMAddressSpace* addressSpace,
21 const char* name, uint32 wiring,
22 uint32 protection, uint32 allocationFlags);
23 static VMUserArea* CreateReserved(VMAddressSpace* addressSpace,
24 uint32 flags, uint32 allocationFlags);
26 DoublyLinkedListLink<VMUserArea>& AddressSpaceLink()
27 { return fAddressSpaceLink; }
28 const DoublyLinkedListLink<VMUserArea>& AddressSpaceLink() const
29 { return fAddressSpaceLink; }
31 private:
32 DoublyLinkedListLink<VMUserArea> fAddressSpaceLink;
36 struct VMUserAreaGetLink {
37 inline DoublyLinkedListLink<VMUserArea>* operator()(
38 VMUserArea* area) const
40 return &area->AddressSpaceLink();
43 inline const DoublyLinkedListLink<VMUserArea>* operator()(
44 const VMUserArea* area) const
46 return &area->AddressSpaceLink();
50 typedef DoublyLinkedList<VMUserArea, VMUserAreaGetLink> VMUserAreaList;
53 #endif // VM_USER_AREA_H