1 /** 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * 15 * Description: Provides ported functions related to partitions. 16 */ 17 #ifndef PARTITION_PORTING_H 18 #define PARTITION_PORTING_H 19 20 #include "partition_resource_id.h" 21 #include "errcode.h" 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif /* __cplusplus */ 27 #endif /* __cplusplus */ 28 29 typedef struct { 30 uint32_t item_id; 31 char *file_path; 32 } partition_path_map_t; 33 34 /** 35 * @if Eng 36 * @brief Obtaining the start address of the partition table on the flash memory. 37 * @retval PARTITION_START_ADDRESS. 38 * @else 39 * @brief 获取分区表在flash上的起始地址 40 * @retval PARTITION_START_ADDRESS. 41 * @endif 42 */ 43 uintptr_t partition_get_addr(void); 44 45 /** 46 * @if Eng 47 * @brief Obtaining the mapping information between partition IDs and paths. 48 * @param [out] path_map Used to store the mappings between partition ID and path. 49 * @retval Number of mappings between partition IDs and paths 50 * @else 51 * @brief 获取分区ID和路径的映射关系 52 * @param [out] path_map 用来保存分区ID与路径映射的关系 53 * @retval 分区ID与路径映射的个数 54 * @endif 55 */ 56 uint32_t partition_get_path_map(partition_path_map_t **path_map); 57 58 #ifdef __cplusplus 59 #if __cplusplus 60 } 61 #endif /* __cplusplus */ 62 #endif /* __cplusplus */ 63 64 #endif 65