Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510
page_allocator.h
00001 /* 00002 * Copyright (c) 2016, ARM Limited, All Rights Reserved 00003 * SPDX-License-Identifier: Apache-2.0 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); you may 00006 * not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 00013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 #ifndef __UVISOR_API_PAGE_ALLOCATOR_H__ 00018 #define __UVISOR_API_PAGE_ALLOCATOR_H__ 00019 00020 #include "api/inc/uvisor_exports.h" 00021 #include "api/inc/page_allocator_exports.h" 00022 #include "api/inc/api.h" 00023 #include <stdint.h> 00024 00025 UVISOR_EXTERN_C_BEGIN 00026 00027 /* Allocate a number of requested pages with the requested page size. 00028 * @param table.page_size[in] Must be equal to the current page size 00029 * @param table.page_count[in] The number of pages to be allocated 00030 * @param table.page_origins[out] Pointers to the page origins. The table must be large enough to hold page_count entries. 00031 * @returns Non-zero on failure with failure class `UVISOR_ERROR_CLASS_PAGE`. See `UVISOR_ERROR_PAGE_*`. 00032 */ 00033 static UVISOR_FORCEINLINE int uvisor_page_malloc(UvisorPageTable * const table) 00034 { 00035 return uvisor_api.page_malloc(table); 00036 } 00037 00038 /* Free the pages associated with the table, only if it passes validation. 00039 * @returns Non-zero on failure with failure class `UVISOR_ERROR_CLASS_PAGE`. See `UVISOR_ERROR_PAGE_*`. 00040 */ 00041 static UVISOR_FORCEINLINE int uvisor_page_free(const UvisorPageTable * const table) 00042 { 00043 return uvisor_api.page_free(table); 00044 } 00045 00046 /* @returns the active page size for one page. */ 00047 static UVISOR_FORCEINLINE uint32_t uvisor_get_page_size(void) 00048 { 00049 return __uvisor_page_size; 00050 } 00051 00052 UVISOR_EXTERN_C_END 00053 00054 #endif /* __UVISOR_API_PAGE_ALLOCATOR_H__ */
Generated on Tue Jul 12 2022 11:02:49 by
