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 12*f8154d17SIngo Weinhold #include <slab/Slab.h> 13*f8154d17SIngo Weinhold 145c99d639SIngo Weinhold 155c99d639SIngo Weinhold status_t 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 245c99d639SIngo Weinhold VMDeviceCache::Read(off_t offset, const iovec* vecs, size_t count, 254eaa43acSIngo Weinhold uint32 flags, 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 335c99d639SIngo Weinhold VMDeviceCache::Write(off_t offset, const iovec* vecs, size_t count, 342a79a768SIngo Weinhold uint32 flags, 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 } 39*f8154d17SIngo Weinhold 40*f8154d17SIngo Weinhold 41*f8154d17SIngo Weinhold void 42*f8154d17SIngo Weinhold VMDeviceCache::DeleteObject() 43*f8154d17SIngo Weinhold { 44*f8154d17SIngo Weinhold object_cache_delete(gDeviceCacheObjectCache, this); 45*f8154d17SIngo Weinhold } 46