os: add FlushDataCache

This commit is contained in:
Michael Scire 2021-10-10 00:33:52 -07:00
parent a595c232b9
commit bc96ebb74c
7 changed files with 150 additions and 19 deletions

View file

@ -37,7 +37,7 @@ namespace ams::ncm {
size_t m_peak_total_alloc_size;
size_t m_peak_alloc_size;
public:
explicit ContentMetaMemoryResource(void *heap, size_t heap_size) : m_allocator(heap, heap_size), m_peak_alloc_size(0), m_peak_total_alloc_size(0) { /* ... */ }
explicit ContentMetaMemoryResource(void *heap, size_t heap_size) : m_allocator(heap, heap_size), m_peak_total_alloc_size(0), m_peak_alloc_size(0) { /* ... */ }
mem::StandardAllocator *GetAllocator() { return std::addressof(m_allocator); }
size_t GetPeakTotalAllocationSize() const { return m_peak_total_alloc_size; }

View file

@ -53,3 +53,4 @@
#include <stratosphere/os/os_io_region.hpp>
#include <stratosphere/os/os_multiple_wait.hpp>
#include <stratosphere/os/os_argument.hpp>
#include <stratosphere/os/os_cache.hpp>

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours.hpp>
namespace ams::os {
void FlushDataCache(const void *addr, size_t size);
void FlushEntireDataCache();
}