mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 00:24:51 +00:00
acpica: detach MMIO region before re-attaching
This is a follow-up commit for the changes in #5069. Fixes #5083
This commit is contained in:
parent
30e37d90dd
commit
980793970d
@ -232,8 +232,10 @@ class Acpica::Io_mem
|
|||||||
if (ref_dec())
|
if (ref_dec())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!stale())
|
if (!stale()) {
|
||||||
|
Acpica::env().rm().detach(_virt);
|
||||||
Genode::destroy(Acpica::heap(), _io_mem);
|
Genode::destroy(Acpica::heap(), _io_mem);
|
||||||
|
}
|
||||||
|
|
||||||
_phys = _size = 0;
|
_phys = _size = 0;
|
||||||
_virt = nullptr;
|
_virt = nullptr;
|
||||||
@ -298,8 +300,10 @@ class Acpica::Io_mem
|
|||||||
|
|
||||||
Genode::addr_t pre_expand(ACPI_PHYSICAL_ADDRESS p, ACPI_SIZE s)
|
Genode::addr_t pre_expand(ACPI_PHYSICAL_ADDRESS p, ACPI_SIZE s)
|
||||||
{
|
{
|
||||||
if (_io_mem)
|
if (_io_mem) {
|
||||||
|
Acpica::env().rm().detach(_virt);
|
||||||
Genode::destroy(Acpica::heap(), _io_mem);
|
Genode::destroy(Acpica::heap(), _io_mem);
|
||||||
|
}
|
||||||
|
|
||||||
Genode::addr_t xsize = _phys - p + _size;
|
Genode::addr_t xsize = _phys - p + _size;
|
||||||
if (!allocate(p, xsize, _ref))
|
if (!allocate(p, xsize, _ref))
|
||||||
@ -310,8 +314,10 @@ class Acpica::Io_mem
|
|||||||
|
|
||||||
Genode::addr_t post_expand(ACPI_PHYSICAL_ADDRESS p, ACPI_SIZE s)
|
Genode::addr_t post_expand(ACPI_PHYSICAL_ADDRESS p, ACPI_SIZE s)
|
||||||
{
|
{
|
||||||
if (_io_mem)
|
if (_io_mem) {
|
||||||
|
Acpica::env().rm().detach(_virt);
|
||||||
Genode::destroy(Acpica::heap(), _io_mem);
|
Genode::destroy(Acpica::heap(), _io_mem);
|
||||||
|
}
|
||||||
|
|
||||||
ACPI_SIZE xsize = p + s - _phys;
|
ACPI_SIZE xsize = p + s - _phys;
|
||||||
if (!allocate(_phys, xsize, _ref))
|
if (!allocate(_phys, xsize, _ref))
|
||||||
@ -343,6 +349,7 @@ class Acpica::Io_mem
|
|||||||
|
|
||||||
Genode::addr_t virt = reinterpret_cast<Genode::addr_t>(io2._virt);
|
Genode::addr_t virt = reinterpret_cast<Genode::addr_t>(io2._virt);
|
||||||
|
|
||||||
|
Acpica::env().rm().detach(virt);
|
||||||
Acpica::env().rm().attach_at(io_ds, virt, io2._size, off_phys);
|
Acpica::env().rm().attach_at(io_ds, virt, io2._size, off_phys);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user