Call stack structure for enabling execution of code outside of a subroutine and between call stack frames
AssigneeMarvell International Ltd.
InventorXinhai Kang
Life of this patent
Estimating the term…
Abstract
In one or more embodiments, system(s), method(s), integrated circuit(s), physical layer(s), apparatus(es), System-on-Chip (SoC), various other hardware, computer-readable and/or executable instructions, and/or technique(s) are described that enable a subroutine to release control of a processing entity when the subroutine is incomplete. By so doing, the processing entity may be used by code outside of the subroutine, such as code that needs attention, and/or more-fully utilize its own processing power by being less idle.
Claims25
One or more non-transitory computer-readable memory devices comprising instructions that, responsive to execution by a processing entity, provide a subroutine having a plurality of functions that are executable in a sequence, one after another, such that:
- at least one of said functions relies on successful completion of a previous one of said functions;
- the previous one of said functions is configured such that control of the processing entity is passable back to a call stack from which the subroutine was called without execution of the at least one of said functions, thereby enabling execution of code outside of the subroutine;
- and
- the call stack includes:
- a first call stack frame having a function portion maintained by the at least one of said functions and a subroutine portion maintained by the subroutine;
- a second call stack frame having another function portion maintained by the previous one of said functions and another subroutine portion maintained by the subroutine;
- and
- at least some of the code outside of the subroutine, the at least some of the code outside of the subroutine located between the first call stack frame and the second call stack frame.
A method comprising:
- executing a preliminary function of a subroutine via a call stack frame having a subroutine portion and a preliminary function portion, the subroutine having multiple constituent functions including the preliminary function and a final function, the call stack frame being part of a call stack that includes calls to code outside of the subroutine;
- producing a sub-result on completion of the preliminary function that is maintained by the preliminary function portion of the call stack frame, the sub-result usable by the final function to provide a result that completes the subroutine;
- executing, after completion of the preliminary function and prior to executing the final function, a first portion of the code outside of the subroutine, the first portion of the code outside of the subroutine called from the call stack;
- executing the final function of the subroutine via another call stack frame having another subroutine portion and a final function portion, the final function executed using the sub-result;
- producing the result that completes the subroutine, the result returned via said another subroutine portion of said another call stack frame;
- and
- executing, after producing the result that completes the subroutine, a second portion of the code outside of the subroutine, the second portion of the code outside of the subroutine called from the call stack.
One or more non-transitory computer-readable memory devices comprising processor-executable instructions that, responsive to execution, perform acts comprising:
- executing, via a processing entity, a preliminary function of a subroutine via a first call stack frame having a subroutine portion and a preliminary function portion, the subroutine having multiple constituent functions including the preliminary function and a final function, the first call stack frame being part of a call stack that includes calls to code outside of the subroutine;
- producing a sub-result on completion of the preliminary function that is maintained by the preliminary function portion of the first call stack frame, the sub-result usable by the final function to provide a result that completes the subroutine;
- releasing, after completion of the preliminary function, control of the processing entity to a first portion of the code outside of the subroutine, the first portion of the code initiated by a first call outside of the subroutine and within the call stack;
- executing, via the processing entity and after completion of the first code outside of the subroutine, the final function via a second call stack frame having another subroutine portion and a final function portion, the final function executed using the sub-result;
- producing the result that completes the subroutine, the result returned via said another subroutine portion of the second call stack frame;
- and
- releasing, after completion of the subroutine, control of the processing entity to a second portion of the code outside of the subroutine, the second portion of the code initiated by a second call outside of the subroutine and within the call stack.
An apparatus comprising:
- one or more processors;
- one or more hardware-based memory devices comprising processor-executable instructions that, responsive to execution by the one or more processors, implement an asynchronous call stack to:
- execute, via the one or more processors, a preliminary function of a subroutine via a first call stack frame having a subroutine portion and a preliminary function portion, the subroutine having multiple constituent functions including the preliminary function and a final function, the asynchronous call stack including calls to code outside of the subroutine;
- provide a sub-result on completion of the preliminary function that is maintained by the preliminary function portion of the first call stack frame, the sub-result usable by the final function of the subroutine to provide a result that completes the subroutine;
- release, after completion of the preliminary function, control of the one or more processors to a first portion of the code outside of the subroutine, the first portion of the code initiated by a first call outside of the subroutine and within the asynchronous call stack;
- execute, via the one or more processors and after completion of the first code outside of the subroutine, the final function of the subroutine via a second call stack frame having another subroutine portion and a final function portion, the final function executed using the sub-result;
- provide the result that completes the subroutine, the result returned via said another subroutine portion of the second call stack frame;
- and
- release, after completion of the subroutine, control of the one or more processors to a second portion of the code outside of the subroutine, the second portion of the code initiated by a second call outside of the subroutine and within the asynchronous call stack.
Dependencies are inferred from the claim text.