xref: /haiku/src/system/kernel/vm/VMDeviceCache.cpp (revision 7457ccb4b2f4786525d3b7bda42598487d57ab7d)
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 
10 #include "VMDeviceCache.h"
11 
12 #include <slab/Slab.h>
13 
14 
15 status_t
16 VMDeviceCache::Init(addr_t baseAddress, uint32 allocationFlags)
17 {
18 	fBaseAddress = baseAddress;
19 	return VMCache::Init(CACHE_TYPE_DEVICE, allocationFlags);
20 }
21 
22 
23 status_t
24 VMDeviceCache::Read(off_t offset, const generic_io_vec *vecs, size_t count,
25 	uint32 flags, generic_size_t *_numBytes)
26 {
27 	panic("device_store: read called. Invalid!\n");
28 	return B_ERROR;
29 }
30 
31 
32 status_t
33 VMDeviceCache::Write(off_t offset, const generic_io_vec* vecs, size_t count,
34 	uint32 flags, generic_size_t* _numBytes)
35 {
36 	// no place to write, this will cause the page daemon to skip this store
37 	return B_OK;
38 }
39 
40 
41 void
42 VMDeviceCache::DeleteObject()
43 {
44 	object_cache_delete(gDeviceCacheObjectCache, this);
45 }
46