xref: /haiku/src/system/kernel/vm/VMDeviceCache.cpp (revision 35ead8815b679605a9b4db8130613ea100f4b14c)
1 /*
2  * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6  * Distributed under the terms of the NewOS License.
7  */
8 
9 #include "VMDeviceCache.h"
10 
11 
12 status_t
13 VMDeviceCache::Init(addr_t baseAddress, uint32 allocationFlags)
14 {
15 	fBaseAddress = baseAddress;
16 	return VMCache::Init(CACHE_TYPE_DEVICE, allocationFlags);
17 }
18 
19 
20 bool
21 VMDeviceCache::HasPage(off_t offset)
22 {
23 	// this should never be called
24 	return false;
25 }
26 
27 
28 status_t
29 VMDeviceCache::Read(off_t offset, const iovec *vecs, size_t count,
30 	uint32 flags, size_t *_numBytes)
31 {
32 	panic("device_store: read called. Invalid!\n");
33 	return B_ERROR;
34 }
35 
36 
37 status_t
38 VMDeviceCache::Write(off_t offset, const iovec *vecs, size_t count,
39 	uint32 flags, size_t *_numBytes)
40 {
41 	// no place to write, this will cause the page daemon to skip this store
42 	return B_OK;
43 }
44 
45 
46 status_t
47 VMDeviceCache::Fault(struct VMAddressSpace* addressSpace, off_t offset)
48 {
49 	return B_BAD_ADDRESS;
50 }
51