headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / kernel / arch / m68k / paging / M68KPagingStructures.h
blob6904fb6125eade5fb05818a6ca202cb1260b5729
1 /*
2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2005-2009, Axel Dörfler, axeld@pinc-software.de.
4 * Distributed under the terms of the MIT License.
6 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
7 * Distributed under the terms of the NewOS License.
8 */
9 #ifndef KERNEL_ARCH_M68K_PAGING_M68K_PAGING_STRUCTURES_H
10 #define KERNEL_ARCH_M68K_PAGING_M68K_PAGING_STRUCTURES_H
13 #include <SupportDefs.h>
15 #include <heap.h>
17 #include <smp.h>
20 struct M68KPagingStructures : DeferredDeletable {
21 uint32 pgroot_phys;
22 int32 ref_count;
23 CPUSet active_on_cpus;
24 // mask indicating on which CPUs the map is currently used
26 M68KPagingStructures();
27 virtual ~M68KPagingStructures();
29 inline void AddReference();
30 inline void RemoveReference();
32 virtual void Delete() = 0;
36 inline void
37 M68KPagingStructures::AddReference()
39 atomic_add(&ref_count, 1);
43 inline void
44 M68KPagingStructures::RemoveReference()
46 if (atomic_add(&ref_count, -1) == 1)
47 Delete();
51 #endif // KERNEL_ARCH_M68K_PAGING_M68K_PAGING_STRUCTURES_H