当前位置:网站首页>Source code learning - [FreeRTOS] privileged_ Understanding of function meaning
Source code learning - [FreeRTOS] privileged_ Understanding of function meaning
2022-06-12 07:10:00 【Wangjinyan】
Here is the custom directory title
introduction
PRIVILEGED_FUNCTION The identifier is in the author's view xTaskNotify when , Found this identifier :
BaseType_t xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue ) PRIVILEGED_FUNCTION;
#define xTaskNotify( xTaskToNotify, ulValue, eAction ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL )
#define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
This PRIVILEGED_FUNCTION What an identifier means , And the impact on the function ?
PRIVILEGED_FUNCTION Macro definition source of
stay mpu_wrappers.h Found in the PRIVILEGED_FUNCTION The macro definition of ():
/* * FreeRTOS Kernel V10.2.1 * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * http://www.FreeRTOS.org * http://aws.amazon.com/freertos * * 1 tab == 4 spaces! */
#ifndef MPU_WRAPPERS_H
#define MPU_WRAPPERS_H
/* This file redefines API functions to be called through a wrapper macro, but only for ports that are using the MPU. */
#ifdef portUSING_MPU_WRAPPERS
/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is included from queue.c or task.c to prevent it from having an effect within those files. */
#ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* * Map standard (non MPU) API functions to equivalents that start * "MPU_". This will cause the application code to call the MPU_ * version, which wraps the non-MPU version with privilege promoting * then demoting code, so the kernel code always runs will full * privileges. */
/* Map standard tasks.h API functions to the MPU equivalents. */
#define xTaskCreate MPU_xTaskCreate
#define xTaskCreateStatic MPU_xTaskCreateStatic
#define xTaskCreateRestricted MPU_xTaskCreateRestricted
#define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
#define vTaskDelete MPU_vTaskDelete
#define vTaskDelay MPU_vTaskDelay
#define vTaskDelayUntil MPU_vTaskDelayUntil
// ..... Macro encapsulation of some functions Omit
#define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
#define xQueueSelectFromSet MPU_xQueueSelectFromSet
#define xQueueGenericReset MPU_xQueueGenericReset
#if( configQUEUE_REGISTRY_SIZE > 0 )
#define vQueueAddToRegistry MPU_vQueueAddToRegistry
#define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
#define pcQueueGetName MPU_pcQueueGetName
#endif
/* Map standard timer.h API functions to the MPU equivalents. */
#define xTimerCreate MPU_xTimerCreate
#define xTimerCreateStatic MPU_xTimerCreateStatic
#define pvTimerGetTimerID MPU_pvTimerGetTimerID
#define vTimerSetTimerID MPU_vTimerSetTimerID
#define xTimerIsTimerActive MPU_xTimerIsTimerActive
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
#define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
#define pcTimerGetName MPU_pcTimerGetName
#define vTimerSetReloadMode MPU_vTimerSetReloadMode
#define xTimerGetPeriod MPU_xTimerGetPeriod
#define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
#define xTimerGenericCommand MPU_xTimerGenericCommand
/* Map standard event_group.h API functions to the MPU equivalents. */
#define xEventGroupCreate MPU_xEventGroupCreate
#define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
#define xEventGroupWaitBits MPU_xEventGroupWaitBits
#define xEventGroupClearBits MPU_xEventGroupClearBits
#define xEventGroupSetBits MPU_xEventGroupSetBits
#define xEventGroupSync MPU_xEventGroupSync
#define vEventGroupDelete MPU_vEventGroupDelete
/* Map standard message/stream_buffer.h API functions to the MPU equivalents. */
#define xStreamBufferSend MPU_xStreamBufferSend
#define xStreamBufferReceive MPU_xStreamBufferReceive
#define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
#define vStreamBufferDelete MPU_vStreamBufferDelete
#define xStreamBufferIsFull MPU_xStreamBufferIsFull
#define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty
#define xStreamBufferReset MPU_xStreamBufferReset
#define xStreamBufferSpacesAvailable MPU_xStreamBufferSpacesAvailable
#define xStreamBufferBytesAvailable MPU_xStreamBufferBytesAvailable
#define xStreamBufferSetTriggerLevel MPU_xStreamBufferSetTriggerLevel
#define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate
#define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic
/* Remove the privileged function macro, but keep the PRIVILEGED_DATA macro so applications can place data in privileged access sections (useful when using statically allocated objects). */
#define PRIVILEGED_FUNCTION
#define PRIVILEGED_DATA __attribute__((section("privileged_data")))
#define FREERTOS_SYSTEM_CALL
#else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
/* Ensure API functions go in the privileged execution section. */
#define PRIVILEGED_FUNCTION __attribute__((section("privileged_functions")))
#define PRIVILEGED_DATA __attribute__((section("privileged_data")))
#define FREERTOS_SYSTEM_CALL __attribute__((section( "freertos_system_calls")))
#endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
#else /* portUSING_MPU_WRAPPERS */
#define PRIVILEGED_FUNCTION
#define PRIVILEGED_DATA
#define FREERTOS_SYSTEM_CALL
#define portUSING_MPU_WRAPPERS 0
#endif /* portUSING_MPU_WRAPPERS */
#endif /* MPU_WRAPPERS_H */
Check out the code above , Find out PRIVILEGED_FUNCTION With the macro definition portUSING_MPU_WRAPPERS and MPU_WRAPPERS_INCLUDED_FROM_API_FILE Different but different :
- Defined portUSING_MPU_WRAPPERS, Undefined MPU_WRAPPERS_INCLUDED_FROM_API_FILE, be #define PRIVILEGED_FUNCTION;
- Both are defined , be PRIVILEGED_FUNCTION _attribute_((section(“privileged_functions”))), This definition will place the modified function named “privileged_functions” In segment space ;
- Undefined portUSING_MPU_WRAPPERS, be #define PRIVILEGED_FUNCTION;
namely , as long as portUSING_MPU_WRAPPERS Undefined ,PRIVILEGED_FUNCTION Meaningless ; Otherwise, a segment space will be specified to store the specified function ;
From the segment space, we can see the process from preprocessing to loading
To be added
Reference material
- FreeRTOS V10.3.1 Source code ;
- 《 Self cultivation of programmers 》—— Yu Jiazi Shifan Pan Aimin ;
边栏推荐
- 基于eNSP加防火墙的千人中型校园/企业网络规划与设计(附所有配置命令)
- 公众号也能带货?
- Esp8266 firmware upgrade method (esp8266-01s module)
- 2 variables and basic types
- Win10 list documents
- 5 statement
- Dynamic coordinate transformation in ROS (dynamic parameter adjustment + dynamic coordinate transformation)
- Redis supports data structure types
- Postman splice replacement parameter loop call interface
- d的自动无垃集代码.
猜你喜欢

应届生苦恼:是去华为拿1万多低薪,还是去互联网拿2万多高薪

The second revolution of reporting tools

【图像检测】基于深度差分和PCANet实现SAR图像变化检测附matlab代码
![[image detection] SAR image change detection based on depth difference and pcanet with matlab code](/img/c7/05bfa88ef1a4a38394b81755966e46.png)
[image detection] SAR image change detection based on depth difference and pcanet with matlab code

最近面了15个人,发现这个测试基础题都答不上来...

TypeScript基础知识全集

新知识:Monkey 改进版之 App Crawler
![Leetcode: Sword finger offer 66 Build product array [application of pre and post infix]](/img/de/cd98d4d86017a13ec4172ba3054e99.png)
Leetcode: Sword finger offer 66 Build product array [application of pre and post infix]

Stm32cubemx learning (I) USB HID bidirectional communication

ROS dynamic parameter configuration: use of dynparam command line tool (example + code)
随机推荐
Planning and design of 1000 person medium-sized campus / enterprise network based on ENSP and firewall (with all configuration commands)
Static coordinate transformation in ROS (analysis + example)
sql server2019安装到这步无法进行下一步了,如何解决?
leetcode:890. Find and replace mode [two dict records set]
(14) The software version number is displayed in the flash window of blender source code analysis
Redis supports data structure types
D
Explain in detail the use of dynamic parameter adjustment and topic communication in ROS (principle + code + example)
【图像去噪】基于偏微分方程(PDE)实现图像去噪附matlab代码
9 Sequence container
Oracle Database
The most understandable explanation of coordinate transformation (push to + diagram)
MySQL group query to obtain the latest data date function of each group
Pyhon的第六天
Detailed explanation of 8086/8088 system bus (sequence analysis + bus related knowledge)
8. form label
Detailed principle of 4.3-inch TFTLCD based on warship V3
openwrt uci c api
2 variables and basic types
5 statement