当前位置:网站首页>Hexagon_V65_Programmers_Reference_Manual (11)
Hexagon_V65_Programmers_Reference_Manual (11)
2022-07-30 05:02:00 【weixin_38498942】
Hexagon_V65_Programmers_Reference_Manual(11)
8. Software stack
The Hexagon processor includes special registers and instructions to support calls
Subroutine execution stack.
The stack structure follows standard C conventions
8.1 stack structure
The stack is defined to grow from a high address to a low address.The stack pointer register SP points to the data element currently at the top of the stack.
Note that the Hexagon processor supports three dedicated stack instructions:
allocframe, deallocframe, and Deallocu_returns (Section 8.5).
For stack instructions, the SP address must always be 8-byte aligned to work properly.
8.2 stack frame
The stack is used to store stack frames, which are data structures that store state
Information about active subroutines in the program (ie those that are called but have
Not yet returned).Each stack frame corresponds to an active subroutine in the program.
The stack frame contains the following elements:
Local variables and data used by subroutines
Return address of subroutine call (pushed from link register LR)
Address of the previous stack frame allocated on the stack (from the frame pointer register FP)
The frame pointer register FP always contains the address of the frame pointer held in the current stack frame.It makes it easy to determine call sequences, function arguments, etc. by allowing the debugger to inspect the stack in memory.
Note: For leaf functions, it is usually not necessary to save FP and LR.In this case, the FP contains the frame pointer of the calling function, not the current function.
8.3 Stack Protection
Hexagon V6x processors support the following features to protect the software stack:
Stack bounds checking
Stack Shatter Protection
8.3.1 Stack Bounds Check
Stack bounds checking prevents stack frames from being allocated beyond the bounds of the lower software stack.
FRAMELIMIT is a 32-bit control register that stores the lower limit of the memory area designated as reserved for the software stack.When the allocframe instruction allocates a new stack frame, it binds the new stack pointer value in SP to the stack bound value in FRAMELIMIT.If SP is less than FRAMELIMIT, the Hexagon processor raises exception 0x27 (Section 7.10).
Note: Stack bounds checking mode is performed when the processor is in user and guest state, but not in monitor mode.
8.3.2 Stack Bounds Check
Stack bounds checking prevents stack frames from being allocated beyond the bounds of the lower software stack.
FRAMELIMIT is a 32-bit control register that stores the lower limit of the memory area designated as reserved for the software stack.When the allocframe instruction allocates a new stack frame, it binds the new stack pointer value in SP to the stack bound value in FRAMELIMIT.If SP is less than FRAMELIMIT, the Hexagon processor raises exception 0x27 (Section 7.10).
Note: Stack bounds checking mode is performed when the processor is in user and guest state, but not in monitor mode.
边栏推荐
猜你喜欢
uni-app realizes cross-end development of mobile phone Bluetooth to receive and send data
nSoftware.PowerShell.Server.2020
[High Performance Computing] openMP
七、自定义配置
Acwing完全数
解决报错SyntaxError: (unicode error) ‘utf-8‘ codec can‘t decode byte 0xb7 in position 0: invalid start b
Simulation problem (middle)
The Complete Go Books - Beginner to Advanced and Web Development
Excellent MySQL interview questions, 99% must ask in preparation for August!I can't pass the interview
Discourse Custom Header Links
随机推荐
Solve the error SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xb7 in position 0: invalid start b
Intermediate - interview questions
(Hexagon_V65_Programmers_Reference_Manual(13)
The Azure developer news 丨 memorabilia in July
SaaS多租户数据隔离的三种解决方案
LeetCode Algorithm 2326. Spiral Matrix IV
模拟问题(上)
DAY17: weak password detection and test
Simulation problem (middle)
Image stitching (registration) case based on OpenCV
Hexagon_V65_Programmers_Reference_Manual (14)
解决go环境编译不了exe
Discourse 自定义头部链接(Custom Header Links)
Hexagon_V65_Programmers_Reference_Manual(11)
[C language] Program environment and preprocessing
webService interface
Dynamically bind href url
Unity stepping on the pit record - the use of GetComponent
动态规划问题(完结篇)
5. View parsing and template engine