15c99d639SIngo Weinhold /*
25c99d639SIngo Weinhold * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de.
35c99d639SIngo Weinhold * Distributed under the terms of the MIT License.
45c99d639SIngo Weinhold *
55c99d639SIngo Weinhold * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
65c99d639SIngo Weinhold * Distributed under the terms of the NewOS License.
75c99d639SIngo Weinhold */
85c99d639SIngo Weinhold
96e83a6faSIngo Weinhold
105c99d639SIngo Weinhold #include "VMDeviceCache.h"
115c99d639SIngo Weinhold
12f8154d17SIngo Weinhold #include <slab/Slab.h>
13f8154d17SIngo Weinhold
145c99d639SIngo Weinhold
155c99d639SIngo Weinhold status_t
Init(addr_t baseAddress,uint32 allocationFlags)16deee8524SIngo Weinhold VMDeviceCache::Init(addr_t baseAddress, uint32 allocationFlags)
175c99d639SIngo Weinhold {
185c99d639SIngo Weinhold fBaseAddress = baseAddress;
19deee8524SIngo Weinhold return VMCache::Init(CACHE_TYPE_DEVICE, allocationFlags);
205c99d639SIngo Weinhold }
215c99d639SIngo Weinhold
225c99d639SIngo Weinhold
235c99d639SIngo Weinhold status_t
Read(off_t offset,const generic_io_vec * vecs,size_t count,uint32 flags,generic_size_t * _numBytes)24*bf77c152SAugustin Cavalier VMDeviceCache::Read(off_t offset, const generic_io_vec *vecs, size_t count,
25*bf77c152SAugustin Cavalier uint32 flags, generic_size_t *_numBytes)
265c99d639SIngo Weinhold {
275c99d639SIngo Weinhold panic("device_store: read called. Invalid!\n");
285c99d639SIngo Weinhold return B_ERROR;
295c99d639SIngo Weinhold }
305c99d639SIngo Weinhold
315c99d639SIngo Weinhold
325c99d639SIngo Weinhold status_t
Write(off_t offset,const generic_io_vec * vecs,size_t count,uint32 flags,generic_size_t * _numBytes)33*bf77c152SAugustin Cavalier VMDeviceCache::Write(off_t offset, const generic_io_vec* vecs, size_t count,
34*bf77c152SAugustin Cavalier uint32 flags, generic_size_t* _numBytes)
355c99d639SIngo Weinhold {
365c99d639SIngo Weinhold // no place to write, this will cause the page daemon to skip this store
375c99d639SIngo Weinhold return B_OK;
385c99d639SIngo Weinhold }
39f8154d17SIngo Weinhold
40f8154d17SIngo Weinhold
41f8154d17SIngo Weinhold void
DeleteObject()42f8154d17SIngo Weinhold VMDeviceCache::DeleteObject()
43f8154d17SIngo Weinhold {
44f8154d17SIngo Weinhold object_cache_delete(gDeviceCacheObjectCache, this);
45f8154d17SIngo Weinhold }
46