mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
[kernel] Add new vm_area_fixed
Add a new vm_area type, vm_area_fixed, which is sharable but not allocatable. Useful for mapping things like MMIO to process spaces.
This commit is contained in:
@@ -53,6 +53,17 @@ vm_area_shared::~vm_area_shared()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
vm_area_fixed::vm_area_fixed(size_t size, vm_flags flags) :
|
||||||
|
m_mapper {*this},
|
||||||
|
vm_area {size, flags}
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
vm_area_fixed::~vm_area_fixed()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
vm_area_open::vm_area_open(size_t size, vm_space &space, vm_flags flags) :
|
vm_area_open::vm_area_open(size_t size, vm_space &space, vm_flags flags) :
|
||||||
m_mapper(*this, space),
|
m_mapper(*this, space),
|
||||||
vm_area(size, flags)
|
vm_area(size, flags)
|
||||||
|
|||||||
@@ -108,6 +108,26 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/// A shareable but non-allocatable memory area (like mmio)
|
||||||
|
class vm_area_fixed :
|
||||||
|
public vm_area
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/// Constructor.
|
||||||
|
/// \arg size Initial virtual size of the memory area
|
||||||
|
/// \arg flags Flags for this memory area
|
||||||
|
vm_area_fixed(size_t size, vm_flags flags = vm_flags::none);
|
||||||
|
virtual ~vm_area_fixed();
|
||||||
|
|
||||||
|
virtual bool allowed(uintptr_t offset) const override { return false; }
|
||||||
|
virtual vm_mapper & mapper() override { return m_mapper; }
|
||||||
|
virtual const vm_mapper & mapper() const override { return m_mapper; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
vm_mapper_multi m_mapper;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/// Area that allows open allocation (eg, kernel heap)
|
/// Area that allows open allocation (eg, kernel heap)
|
||||||
class vm_area_open :
|
class vm_area_open :
|
||||||
public vm_area
|
public vm_area
|
||||||
|
|||||||
Reference in New Issue
Block a user