Override Fault() method for VM{Device,Null}Cache to prevent vm_soft_fault()
from inserting a clean page, if a fault happens. VMNullCaches are used by the slab's memory manager -- all page faults in slab areas are serious bugs and we want to panic() immediately. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35748 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
e4a0a9c2b4
commit
7263efe581
@ -41,3 +41,10 @@ VMDeviceCache::Write(off_t offset, const iovec *vecs, size_t count,
|
|||||||
// no place to write, this will cause the page daemon to skip this store
|
// no place to write, this will cause the page daemon to skip this store
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
VMDeviceCache::Fault(struct VMAddressSpace* addressSpace, off_t offset)
|
||||||
|
{
|
||||||
|
return B_BAD_ADDRESS;
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
* Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||||
* Copyright 2005-2007, Axel Dörfler, axeld@pinc-software.de.
|
* Copyright 2005-2007, Axel Dörfler, axeld@pinc-software.de.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
@ -24,6 +24,9 @@ public:
|
|||||||
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
||||||
uint32 flags, size_t *_numBytes);
|
uint32 flags, size_t *_numBytes);
|
||||||
|
|
||||||
|
virtual status_t Fault(struct VMAddressSpace* addressSpace,
|
||||||
|
off_t offset);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
addr_t fBaseAddress;
|
addr_t fBaseAddress;
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
|
* Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -11,3 +11,10 @@ VMNullCache::Init(uint32 allocationFlags)
|
|||||||
{
|
{
|
||||||
return VMCache::Init(CACHE_TYPE_NULL, allocationFlags);
|
return VMCache::Init(CACHE_TYPE_NULL, allocationFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
VMNullCache::Fault(struct VMAddressSpace* addressSpace, off_t offset)
|
||||||
|
{
|
||||||
|
return B_BAD_ADDRESS;
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
* Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||||
* Copyright 2005-2007, Axel Dörfler, axeld@pinc-software.de.
|
* Copyright 2005-2007, Axel Dörfler, axeld@pinc-software.de.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
@ -15,7 +15,10 @@
|
|||||||
|
|
||||||
class VMNullCache : public VMCache {
|
class VMNullCache : public VMCache {
|
||||||
public:
|
public:
|
||||||
status_t Init(uint32 allocationFlags);
|
status_t Init(uint32 allocationFlags);
|
||||||
|
|
||||||
|
virtual status_t Fault(struct VMAddressSpace* addressSpace,
|
||||||
|
off_t offset);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user