Register reservation method for fast context switching in microprocessors
First Claim
1. A method of decreasing interrupt handling overhead time in a processor-based system by eliminating context save and context restore operations associated with interrupt handler routines, the system including a processor, the processor having a first register set and a second register set, the method comprising the steps of:
- (a) providing an interrupt handler in a high level programming language;
(b) providing a main program in the high level programming language;
(c) compiling the interrupt handler into interrupt handler assembly code;
(d) post-processing the interrupt handler assembly code by replacing accesses to the first register set with accesses to the second register set;
(e) compiling the interrupt handler assembly code into interrupt handler object code;
(e) compiling the main program into main program object code, the main program compiling step including the substep of invoking a compiler option which commands the compiler not to use the second register set; and
(f) linking the post-processed interrupt handler object code and the main program object code.
7 Assignments
0 Petitions
Accused Products
Abstract
Microprocessor main programs and their interrupt handling routines are written in a high level programming language such as C. Each is compiled separately, and each is compiled invoking a compiler option which commands the compiler to not use a given set of registers in the compiled code. Post-processing is then performed on the compiled interrupt code to replace accesses to a first set of registers with accesses to the given set of registers. The result is that while both the main program and the interrupt handler were written in C, the compiled code for each employs different registers. This allows context switching from the main program to the interrupt handler and back again with almost none of the overhead traditionally associated with context switching register save and restore operations during exception handling.
36 Citations
19 Claims
-
1. A method of decreasing interrupt handling overhead time in a processor-based system by eliminating context save and context restore operations associated with interrupt handler routines, the system including a processor, the processor having a first register set and a second register set, the method comprising the steps of:
-
(a) providing an interrupt handler in a high level programming language; (b) providing a main program in the high level programming language; (c) compiling the interrupt handler into interrupt handler assembly code; (d) post-processing the interrupt handler assembly code by replacing accesses to the first register set with accesses to the second register set; (e) compiling the interrupt handler assembly code into interrupt handler object code; (e) compiling the main program into main program object code, the main program compiling step including the substep of invoking a compiler option which commands the compiler not to use the second register set; and (f) linking the post-processed interrupt handler object code and the main program object code. - View Dependent Claims (2, 3, 4)
-
-
5. A method of decreasing exception handling overhead time in a processor-based system by eliminating context save and context restore operations, the system including a processor having registers comprising a first register set and a second register set, the method comprising the steps of:
-
(a) providing an exception routine in a high level programming language; (b) processing said exception routine to executable exception code such that said executable exception code is prevented from employing registers from the first register set and is permitted to employ registers from the second register set, the executable exception code not performing a context save and a context restore with respect to all of the registers; and (c) providing a main executable program, the main executable program not storing critical data in registers from the second register set when said exception routine is enabled. - View Dependent Claims (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
-
-
18. An electronic system for preparing and executing a processor program which executes interrupt routines and main program at substantially reduced context switching times, the system comprising:
-
a compiler for compiling a source interrupt routine to a compiled interrupt routine; means for post-processing the compiled interrupt routine to prevent the compiled interrupt routine from writing data into registers within a first register set; and means for compiling a source main program such that a resulting compiled main program employs registers from the first register set and does not employ registers from a second register set at an interrupt enabled portion of said compiled main program; and means for executing together said compiled main program and said compiled interrupt routine. - View Dependent Claims (19)
-
Specification