summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_page_buffer.cpp
blob: e9830e6d9fb7523a0927634b37ec0ae8b7674f49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#include "common/alignment.h"
#include "common/assert.h"
#include "core/core.h"
#include "core/device_memory.h"
#include "core/hle/kernel/k_page_buffer.h"
#include "core/hle/kernel/memory_types.h"

namespace Kernel {

KPageBuffer* KPageBuffer::FromPhysicalAddress(Core::System& system, KPhysicalAddress phys_addr) {
    ASSERT(Common::IsAligned(GetInteger(phys_addr), PageSize));
    return system.DeviceMemory().GetPointer<KPageBuffer>(phys_addr);
}

} // namespace Kernel