Dual Stack Pointer Mode Transition for Embedded Systems
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current microprocessor designs for embedded systems face challenges in providing high-performance, low-power consumption, and cost-effective solutions with advanced features, particularly in transitioning between privileged and non-privileged modes efficiently.
Innovation Solution
The implementation of a data processing apparatus with two stack pointers (SP0 and SP1) that allows operation in multiple modes, including non-privileged and privileged modes, enabling efficient transfer between modes and reducing the need for large task data on the 'OS' stack, along with mechanisms for initializing stack pointers and handling exceptions and interrupts.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Device complexity
If a single stack is used for both privileged and non-privileged modes, then device complexity is reduced, but reliability decreases due to potential stack corruption and security vulnerabilities
Solution Approach 1:
The patent divides the single stack into two separate stacks: a first stack for privileged mode operations and a second stack for non-privileged mode operations. This segmentation prevents stack corruption between modes and ensures that each mode has its own dedicated stack space, thereby improving reliability and security while maintaining manageable complexity through clear separation of concerns
2Reliability
If mode transition requires saving all task data on the OS stack, then reliability improves through complete state preservation, but device complexity and memory usage increase
Solution Approach 1:
The patent extracts the task data storage function from the OS stack by providing a separate dedicated stack for non-privileged mode. This allows mode transitions to occur without requiring the saving of all task data on the OS stack, as the task data remains safely stored in its own dedicated stack space, thereby reducing complexity while maintaining complete state preservation
3Device complexity
If a single stack pointer is used for all modes, then device complexity is reduced, but productivity decreases due to inefficient mode transitions and stack management
Solution Approach 1:
The patent implements dynamic stack pointer management where the processor automatically selects between a first stack pointer for privileged mode and a second stack pointer for non-privileged mode based on the current operational mode. This dynamic switching enables efficient mode transitions without requiring manual stack pointer manipulation, thereby improving productivity while keeping the management mechanism straightforward through hardware automation
Data Source
AI summary
Embodiments of the invention relate to a data processing apparatus including a processor adapted to operate under control of an executable comprising instructions, and in any of a plurality of operating modes including a non-privileged mode and a privileged mode, the apparatus comprising: means for storing a plurality of stacks; a first stack pointer register for storing a pointer to an address in a first of said stacks; a second stack pointer register for storing a pointer to an address in a second of said stacks, wherein said processing apparatus is adapted to use said second stack pointer when said processor is operating in either the non-privileged mode or the privileged mode; and means for transferring operation of said processor from the non-privileged mode to the privileged mode in response to at least one of said instructions. Embodiments of the invention also relate to a method of operating a data processing apparatus.


