xref: /haiku/src/system/kernel/vm/VMAnonymousNoSwapCache.h (revision 97901ec593ec4dd50ac115c1c35a6d72f6e489a5)
1 /*
2  * Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de.
4  * Distributed under the terms of the MIT License.
5  *
6  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
7  * Distributed under the terms of the NewOS License.
8  */
9 #ifndef _KERNEL_VM_STORE_ANONYMOUS_NO_SWAP_H
10 #define _KERNEL_VM_STORE_ANONYMOUS_NO_SWAP_H
11 
12 
13 #include <vm/VMCache.h>
14 
15 
16 class VMAnonymousNoSwapCache : public VMCache {
17 public:
18 	virtual				~VMAnonymousNoSwapCache();
19 
20 			status_t	Init(bool canOvercommit, int32 numPrecommittedPages,
21 							int32 numGuardPages, uint32 allocationFlags);
22 
23 	virtual	status_t	Commit(off_t size, int priority);
24 	virtual	bool		HasPage(off_t offset);
25 
26 	virtual	status_t	Read(off_t offset, const iovec *vecs, size_t count,
27 							uint32 flags, size_t *_numBytes);
28 	virtual	status_t	Write(off_t offset, const iovec *vecs, size_t count,
29 							uint32 flags, size_t *_numBytes);
30 
31 	virtual	status_t	Fault(struct VMAddressSpace *aspace, off_t offset);
32 
33 	virtual	void		MergeStore(VMCache* source);
34 
35 private:
36 	bool	fCanOvercommit;
37 	bool	fHasPrecommitted;
38 	uint8	fPrecommittedPages;
39 	int32	fGuardedSize;
40 };
41 
42 
43 #endif	/* _KERNEL_VM_STORE_ANONYMOUS_NO_SWAP_H */
44