J-Alves | 6e0abc4 | 2024-12-30 16:51:16 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2024 The Hafnium Authors. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style |
| 5 | * license that can be found in the LICENSE file or at |
| 6 | * https://opensource.org/licenses/BSD-3-Clause. |
| 7 | */ |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "hf/addr.h" |
| 12 | #include "hf/boot_params.h" |
| 13 | #include "hf/types.h" |
| 14 | |
| 15 | /** |
| 16 | * Aggregates all the necessary ranges needed for Hafnium to |
| 17 | * load an SP. |
| 18 | */ |
| 19 | struct partition_pkg { |
| 20 | /* Memory range for the partition manifest. */ |
| 21 | struct mem_range pm; |
| 22 | /* Memory range for the image. */ |
| 23 | struct mem_range img; |
| 24 | /* Memory range for the HOB list. - optional, if absent set to 0. */ |
| 25 | struct mem_range hob; |
| 26 | /* Memory range for the FF-A boot info descriptors. */ |
| 27 | struct mem_range boot_info; |
| 28 | /* Memory range for the totality of the package. */ |
| 29 | struct mem_range total; |
| 30 | }; |
| 31 | |
| 32 | bool partition_pkg_init(struct mm_stage1_locked stage1_locked, |
| 33 | paddr_t pkg_start, struct partition_pkg *pkg, |
| 34 | struct mpool *ppool); |
| 35 | |
| 36 | void partition_pkg_deinit(struct mm_stage1_locked stage1_locked, |
| 37 | struct partition_pkg *pkg, struct mpool *ppool); |