blob: d71f91f5c7bd3a4ee2c9ade1ff8625fe802ac01d [file] [log] [blame]
Javier Almansa Sobrino68a593a2022-07-25 09:35:32 +01001/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 * SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
4 */
5
6#include <buffer.h>
7#include <xlat_tables.h>
8
9/*
10 * The VA space size for the high region, which maps the slot buffers,
11 * needs to be a power of two, so round NR_CPU_SLOTS up to the closest
12 * power of two.
13 */
14#define ROUNDED_NR_CPU_SLOTS (1ULL << (64ULL - \
15 __builtin_clzll((NR_CPU_SLOTS) - 1)))
16
17#define RMM_SLOT_BUF_VA_SIZE ((ROUNDED_NR_CPU_SLOTS) * (GRANULE_SIZE))
18
19#define SLOT_VIRT ((ULL(0xffffffffffffffff) - \
20 RMM_SLOT_BUF_VA_SIZE + ULL(1)))
21
Javier Almansa Sobrinoe7aa1ab2023-03-09 17:38:02 +000022struct xlat_llt_info *get_cached_llt_info(void);
Javier Almansa Sobrino68a593a2022-07-25 09:35:32 +010023uintptr_t slot_to_va(enum buffer_slot slot);