Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Task stack overflow detection algorithm for SPARC (scalable processor architecture) platform

A technology of overflow detection and detection algorithm, applied in the direction of platform integrity maintenance, machine execution devices, etc., can solve problems such as misjudgment, error, and poor algorithm performance, and achieve high efficiency, accurate algorithm, and improved reliability and security. Effect

Active Publication Date: 2014-06-18
北京神舟航天软件技术股份有限公司
View PDF7 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The performance of this algorithm is poor, and it may be interrupted by a high-priority task before the comparison is completed. When returning again, the usage of the task stack may exceed the current comparison address, resulting in a wrong result; The particularity of the stack frame of each function has at least 0x40 bytes of space to store the contents of the current register window when the register window overflows
In most cases, this segment of space will not be used, and the content is still 0. If this segment of space happens to be at the top of the stack, the task stack has overflowed at this time, but the algorithm will give a wrong judgment

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Task stack overflow detection algorithm for SPARC (scalable processor architecture) platform

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0016] Such as figure 1 As shown, a SPARC platform task stack overflow detection algorithm, the detection algorithm is to maintain a separate variable current_stack_max for each task, record the maximum usage of the current stack, the initial value is 0; the task stack is initialized to 0; A margin of the size of an empty function stack frame is reserved at the top of the task stack. If the stack usage exceeds this margin, it is regarded as overflow.

[0017] In this embodiment, the algorithm steps are as follows:

[0018] 1) First, compare current_stack_max with the stack top TCB_SP of the current function stack frame saved in the task control block, and obtain min(current_stack_max, TCB_SP).

[0019] 2) Starting from stack_top, compare the contents of the [stack_top, min(current_stack_max, TCB_SP)] interval segment memory unit in sequence, and stop comparing when encountering a non-zero memory unit, and the pointer order_search points to this unit.

[0020] 3) Compare stac...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a task stack overflow detection algorithm for an SPARC (scalable processor architecture) platform. The detection algorithm is characterized by comprising the following steps of maintaining an independent variable current_stack_max for each task, and recording the maximum usage of a current stack, wherein an initial value of the maximum usage is 0; initializing a task stack to be 0 during task creation; reserving allowance of which the size is the same as that of an empty function stack frame at the top of the task stack, and determining overflow if the usage of the stack exceeds the allowance. The algorithm is accurate and high in efficiency, an application developer can be effectively helped to reasonably allocate the task stack size, and the reliability and the security of a system are improved.

Description

technical field [0001] The invention belongs to the field of embedded real-time operating system development, and in particular relates to a SPARC platform task stack overflow detection algorithm. Background technique [0002] SPARC is an open source RISC processor architecture technology, which is widely used in the aerospace field in China. At the same time, with the complexity of space missions, embedded real-time operating systems are more and more widely used in the field of spaceflight. In order to ensure the real-time performance and security of the system, the stacks used by the tasks in the embedded real-time operating system are generally allocated statically. For RTOS-based application developers, due to the lack of understanding of the underlying hardware and compiler compilation rules, it is usually difficult to give tasks Allocating an appropriate stack size causes the task stack to overflow, and developers need to spend a lot of time finding the cause. There...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/30G06F21/52
Inventor 卓保特李尚杰程胜许开维
Owner 北京神舟航天软件技术股份有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products