2024-05-10 20:16:01 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024, Idan Horowitz <idan.horowitz@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Kernel/Memory/PhysicalAddress.h>
|
|
|
|
#include <Kernel/Memory/VMObject.h>
|
|
|
|
|
|
|
|
namespace Kernel::Memory {
|
|
|
|
|
|
|
|
class MMIOVMObject final : public VMObject {
|
|
|
|
public:
|
|
|
|
static ErrorOr<NonnullLockRefPtr<MMIOVMObject>> try_create_for_physical_range(PhysicalAddress paddr, size_t size);
|
|
|
|
|
|
|
|
virtual ErrorOr<NonnullLockRefPtr<VMObject>> try_clone() override { return ENOTSUP; }
|
|
|
|
|
2024-05-24 23:42:48 +00:00
|
|
|
PhysicalAddress base_address() const { return m_base_address; }
|
|
|
|
|
2024-05-10 20:16:01 +00:00
|
|
|
private:
|
2024-05-11 15:15:51 +00:00
|
|
|
MMIOVMObject(PhysicalAddress, FixedArray<RefPtr<PhysicalRAMPage>>&&);
|
2024-05-10 20:16:01 +00:00
|
|
|
|
|
|
|
virtual StringView class_name() const override { return "MMIOVMObject"sv; }
|
2024-05-24 23:42:48 +00:00
|
|
|
virtual bool is_mmio() const override { return true; }
|
|
|
|
|
|
|
|
PhysicalAddress m_base_address;
|
2024-05-10 20:16:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|