xref: /haiku/src/system/kernel/vm/VMAnonymousNoSwapCache.h (revision b06a48ab8f30b45916a9c157b992827779182163)
1 /*
2  * Copyright 2008, 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 #include <vm_types.h>
13 
14 
15 class VMAnonymousNoSwapCache : public VMCache {
16 public:
17 	virtual				~VMAnonymousNoSwapCache();
18 
19 			status_t	Init(bool canOvercommit, int32 numPrecommittedPages,
20 							int32 numGuardPages);
21 
22 	virtual	status_t	Commit(off_t size);
23 	virtual	bool		HasPage(off_t offset);
24 
25 	virtual	status_t	Read(off_t offset, const iovec *vecs, size_t count,
26 							size_t *_numBytes);
27 	virtual	status_t	Write(off_t offset, const iovec *vecs, size_t count,
28 							size_t *_numBytes);
29 
30 	virtual	status_t	Fault(struct vm_address_space *aspace, off_t offset);
31 
32 	virtual	void		MergeStore(VMCache* source);
33 
34 private:
35 	bool	fCanOvercommit;
36 	bool	fHasPrecommitted;
37 	uint8	fPrecommittedPages;
38 	int32	fGuardedSize;
39 };
40 
41 
42 #endif	/* _KERNEL_VM_STORE_ANONYMOUS_NO_SWAP_H */
43