当前位置:网站首页>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 ;
边栏推荐
- RT thread studio learning (VIII) connecting Alibaba cloud IOT with esp8266
- Leetcode: Sword finger offer 66 Build product array [application of pre and post infix]
- Decoupling in D
- Planning and design of 1000 person medium-sized campus / enterprise network based on ENSP and firewall (with all configuration commands)
- Beginners can't tell the difference between framework and class library
- d的自动无垃集代码.
- Detailed explanation of 8086/8088 system bus (sequence analysis + bus related knowledge)
- [wax chain tour] release a free and open source alien worlds script TLM
- 1. Foundation of MySQL database (1- installation and basic operation)
- Pyhon的第五天
猜你喜欢

1. Foundation of MySQL database (1- installation and basic operation)

Dynamic coordinate transformation in ROS (dynamic parameter adjustment + dynamic coordinate transformation)

6 functions

descheduler 二次调度让 Kubernetes 负载更均衡

Detailed explanation of TF2 command line debugging tool in ROS (parsing + code example + execution logic)

Recommend 17 "wheels" to improve development efficiency

RT thread studio learning (x) mpu9250
![[Li Kou] curriculum series](/img/eb/c46a6b080224a71367d61f512326fd.jpg)
[Li Kou] curriculum series

4 expression

Descscheduler secondary scheduling makes kubernetes load more balanced
随机推荐
【图像去噪】基于偏微分方程(PDE)实现图像去噪附matlab代码
ConVIRT论文详解(医疗图片)
Unable to load bean of class marked with @configuration
leetcode.39 --- 组合总和
Kali与编程:如何快速搭建OWASP网站安全实验靶场?
Circular linked list and bidirectional linked list - practice after class
【图像去噪】基于非局部欧几里德中值 (NLEM) 实现图像去噪附matlab代码
descheduler 二次调度让 Kubernetes 负载更均衡
Day 6 of pyhon
sql server 2019安装出现错误,如何解决
网络丢包问题排查
Scons编译IMGUI
JDE 对象管理工作平台介绍及 From 的使用
【图像检测】基于深度差分和PCANet实现SAR图像变化检测附matlab代码
RT thread studio learning summary
Matlab 6-DOF manipulator forward and inverse motion
Detailed explanation of 14 registers in 8086CPU
Installation and use of eigen under vs2017
PowerDesigner connects to entity database to generate physical model in reverse
esp32 hosted