FreeNOS
ARM64Cache.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 Ivan Tan
3 * Copyright (C) 2015 Niek Linnenbank
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __LIBARCH_ARM64_ARM64CACHE_H
20#define __LIBARCH_ARM64_ARM64CACHE_H
21
22#include <Types.h>
23#include <Macros.h>
24#include <Cache.h>
25#include "ARM64Control.h"
26
43class ARM64Cache : public Cache
44{
45 private:
46
57
58 public:
59
67 virtual Result invalidate(Type type);
68
80
90
99 virtual Result cleanAddress(Type type, Address addr);
100
110
111 private:
112
120 Result dataFlush(bool clean);
121
127 u32 getCacheLevelId() const;
128
134 u32 getCacheLineSize() const;
135
144 u32 readCacheSize(u32 level, u32 type) const;
145
154 Result flushLevel(u32 level, bool clean);
155
156};
157
158namespace Arch
159{
160 typedef ARM64Cache Cache;
161};
162
169#endif /* __LIBARCH_ARM64_ARM64CACHE_H */
u8 type
Definition IntelACPI.h:0
ARMv7 cache management implementation.
Definition ARM64Cache.h:44
CacheLevelType
Defines the cache level type bits.
Definition ARM64Cache.h:51
@ CacheLevelInstructionData
Definition ARM64Cache.h:54
@ CacheLevelInstruction
Definition ARM64Cache.h:52
@ CacheLevelUnified
Definition ARM64Cache.h:55
virtual Result cleanInvalidateAddress(Type type, Address addr)
Clean and invalidate one memory page.
u32 getCacheLevelId() const
Get cache level identifier.
virtual Result invalidate(Type type)
Invalidate the entire cache.
u32 readCacheSize(u32 level, u32 type) const
Get cache size.
virtual Result cleanInvalidate(Type type)
Clean and invalidate entire cache.
virtual Result cleanAddress(Type type, Address addr)
Clean one memory page.
Result dataFlush(bool clean)
Flush the entire data cache.
Result flushLevel(u32 level, bool clean)
Clean and Invalidate by cache level.
u32 getCacheLineSize() const
Get cache line size in bytes.
virtual Result invalidateAddress(Type type, Address addr)
Invalidate one memory page.
Cache management interface.
Definition Cache.h:36
Result
Result codes.
Definition Cache.h:43
Type
Cache types.
Definition Cache.h:54
unsigned int u32
Unsigned 32-bit number.
Definition Types.h:53
unsigned long Address
A memory address.
Definition Types.h:131
ARMCacheV6 Cache
Definition ARMCacheV6.h:105