blob: cf0bb1c1a7adcc9aa933c4e4f374002e2bbda7ae [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 */
AlexeiFedorov93f5ec52023-08-31 14:26:53 +010014#define ROUNDED_NR_CPU_SLOTS (1ULL << (64U - \
15 (unsigned int)__builtin_clzll(((unsigned long long)NR_CPU_SLOTS) - 1U)))
Javier Almansa Sobrino68a593a2022-07-25 09:35:32 +010016
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);
AlexeiFedorov47165422023-09-13 11:47:57 +010024bool memcpy_ns_read(void *dest, const void *ns_src, size_t size);
25bool memcpy_ns_write(void *ns_dest, const void *src, size_t size);