Javier Almansa Sobrino | 68a593a | 2022-07-25 09:35:32 +0100 | [diff] [blame] | 1 | /* |
| 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 | */ |
AlexeiFedorov | 93f5ec5 | 2023-08-31 14:26:53 +0100 | [diff] [blame] | 14 | #define ROUNDED_NR_CPU_SLOTS (1ULL << (64U - \ |
| 15 | (unsigned int)__builtin_clzll(((unsigned long long)NR_CPU_SLOTS) - 1U))) |
Javier Almansa Sobrino | 68a593a | 2022-07-25 09:35:32 +0100 | [diff] [blame] | 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 Sobrino | e7aa1ab | 2023-03-09 17:38:02 +0000 | [diff] [blame] | 22 | struct xlat_llt_info *get_cached_llt_info(void); |
Javier Almansa Sobrino | 68a593a | 2022-07-25 09:35:32 +0100 | [diff] [blame] | 23 | uintptr_t slot_to_va(enum buffer_slot slot); |
AlexeiFedorov | 4716542 | 2023-09-13 11:47:57 +0100 | [diff] [blame^] | 24 | bool memcpy_ns_read(void *dest, const void *ns_src, size_t size); |
| 25 | bool memcpy_ns_write(void *ns_dest, const void *src, size_t size); |