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 Weinholdstatus_t
16deee8524SIngo WeinholdVMDeviceCache::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 Weinholdstatus_t
24bf77c152SAugustin CavalierVMDeviceCache::Read(off_t offset, const generic_io_vec *vecs, size_t count,
25bf77c152SAugustin 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 Weinholdstatus_t
33bf77c152SAugustin CavalierVMDeviceCache::Write(off_t offset, const generic_io_vec* vecs, size_t count,
34bf77c152SAugustin 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 Weinholdvoid
42f8154d17SIngo WeinholdVMDeviceCache::DeleteObject()
43f8154d17SIngo Weinhold{
44f8154d17SIngo Weinhold	object_cache_delete(gDeviceCacheObjectCache, this);
45f8154d17SIngo Weinhold}
46