当前位置:网站首页>Risc-v-qemu-virt in FreeRTOS_ Lock mechanism analysis of GCC
Risc-v-qemu-virt in FreeRTOS_ Lock mechanism analysis of GCC
2022-07-04 05:28:00 【__ pop_】
List of articles
brief introduction
riscv Provides atomic Instruction extension (A)
freertos Also provided Locking mechanism , Let's see how the two rub together
Related concepts
MUTEX( The mutex ) From the ”MUTual EXclusion
Competitive state
Concurrency will produce race
---
We were https://blog.csdn.net/u011011827/article/details/117690639 We have analyzed linux Competitive state of
Be careful : Soft interrupt , Kernel preemption yes linux A unique concept
freertos I won't support it SMP, So it's single core , There are two reasons for the race of mononuclear
1. interrupt
2. Dispatch
and freertos-riscv There are two scheduling opportunities
1. Active scheduling
2. systick(mtimer) Interrupt function Dispatch
therefore about freertos-riscv Come on , " Close the interrupt " Namely solve Competitive Method
But in fact , freertos Of " Locking mechanism " Essentially Namely " Close the interrupt ", Not used riscv Atomic instructions for
freertos lock API
https://blog.csdn.net/qq_26226375/article/details/123955528
./Source/portable/GCC/RISC-V/portmacro.h
98 /*-----------------------------------------------------------*/
99
100
101 /* Critical section management. */
102 #define portCRITICAL_NESTING_IN_TCB 1
103 extern void vTaskEnterCritical( void );
104 extern void vTaskExitCritical( void );
105
106 #define portSET_INTERRUPT_MASK_FROM_ISR() 0
107 #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue
108 #define portDISABLE_INTERRUPTS() __asm volatile( "csrc mstatus, 8" )
109 #define portENABLE_INTERRUPTS() __asm volatile( "csrs mstatus, 8" )
110 #define portENTER_CRITICAL() vTaskEnterCritical()
111 #define portEXIT_CRITICAL() vTaskExitCritical()
112
113 /*-----------------------------------------------------------*/
Analyze the code implementation , I found it was just off interrupt ( Set up mstatus Medium MIE by 1)
边栏推荐
- Roles of rollup components
- 724. 寻找数组的中心下标
- Appearance of LabVIEW error dialog box
- [paper summary] zero shot semantic segmentation
- 2022g2 power station boiler stoker special operation certificate examination question bank and answers
- Notepad++ -- display related configurations
- Supplement the JS of a video website to decrypt the video
- 2022年R2移动式压力容器充装复训题库及答案
- RSA加密应用常见缺陷的原理与实践
- Enterprise level log analysis system elk (if things backfire, there must be other arrangements)
猜你喜欢
![[技术发展-25]:广播电视网、互联网、电信网、电网四网融合技术](/img/87/e0469e280365ed0261e2b551ebd888.png)
[技术发展-25]:广播电视网、互联网、电信网、电网四网融合技术

Enterprise level log analysis system elk (if things backfire, there must be other arrangements)
![[paper summary] zero shot semantic segmentation](/img/78/ee64118d86a7e43ec4d1cb97191fbe.jpg)
[paper summary] zero shot semantic segmentation

TCP state transition diagram

Zhongke Panyun - module a infrastructure setting and safety reinforcement scoring standard

数据标注是一块肥肉,盯上这块肉的不止中国丨曼孚科技

【兴趣阅读】Adversarial Filtering Modeling on Long-term User Behavior Sequences for Click-Through Rate Pre

Just do it with your hands 7 - * project construction details 2 - hook configuration

Simulink与Arduino串口通信

Build an Internet of things infrared temperature measuring punch in machine with esp32 / rush to work after the Spring Festival? Baa, no matter how hard you work, you must take your temperature first
随机推荐
[MySQL practice of massive data with high concurrency, high performance and high availability -8] - transaction isolation mechanism of InnoDB
Notepad++ -- display related configurations
flink1.13 sql基础语法(二)join操作
力扣 第 300 场周赛
Integer type of C language
Topological sorting and graphical display of critical path
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
总线的基本概念
2022危险化学品经营单位安全管理人员上岗证题库及答案
2022 t elevator repair operation certificate examination question bank and simulation examination
A summary of the 8544 problem that SolidWorks Standard cannot obtain a license
2022年R2移动式压力容器充装复训题库及答案
C language simple student management system (including source code)
Get the ID of the record just inserted from laravel
[matlab] matlab simulation - narrow band Gaussian white noise
Simulink and Arduino serial port communication
Talk about the SQL server version of DTM sub transaction barrier function
Li Kou's 300th weekly match
The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat
【QT】定时器