IP Library Granted Patent US 11,907,774
Granted Patent B2
US 11,907,774 · App. 17/346,950 · Granted Feb 20, 2024

Stack safety for independently defined operations

Inventors: Nathan B. Elsishans (Hellertown, PA); Francois Carouge (Coopersburg, PA)
Assignee: Lutron Technology Company LLC
G06F9/547G06F9/461G06F9/5016G06F9/544
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,907,774
App. No.
17/346,950
Granted
Feb 20, 2024
Kind
B2
Abstract

Systems and methods are disclosed for swapping or changing between stacks associated with respective applications when one application calls the other.

Claims (57)

1. An apparatus comprising:

memory circuitry; and

processor circuitry communicatively coupled to the memory circuitry, the processor circuitry to:

responsive to a call by an operating system (OS) update application using an operating system (OS) stack to execute a boot function included with a boot loader application using a boot stack:

determine whether the stack pointer register points to the OS stack or points to the boot stack;

responsive to the determination that the stack pointer register points to the OS stack:

copy first data values from the OS stack to the boot stack;

transition the stack pointer register to point from the OS stack to the boot stack; and

execute the boot function using the boot stack and the first data values copied from the OS stack; and

responsive to completion of the boot function:

copy second data values generated by the execution of the boot function using the boot stack from the boot stack to the OS stack;

transition the stack pointer register from the boot stack to point to the OS stack; and

continue execution of the OS update application using the OS stack and the second data values copied from the boot stack.

2. The apparatus of claim 1 , wherein to copy first data values from the OS stack to the boot stack, the processor circuitry to further:

copy an address of an instruction to be executed by the processor circuitry from the OS stack to the boot stack.

3. The apparatus of claim 2 , wherein to copy first data values from the OS stack to the boot stack, the processor circuitry to further:

copy saved scratch register values from the OS stack to the boot stack.

4. The apparatus of claim 3 , wherein to copy second data values generated by the execution of the boot function from the boot stack to the OS stack, the processor circuitry to further:

copy another address of an instruction to be executed by the processor circuitry and scratch register values that were saved to the boot stack from the boot stack to the OS stack.

5. The apparatus of claim 1 , the processor circuitry to further:

prior to transitioning the stack pointer register to point from the OS stack to the boot stack, prohibit a process or thread swap until changing the stack pointer register to point from the boot stack to the OS stack.

6. A method comprising:

responsive to a call by an operating system (OS) update application executed by processor circuitry using a OS stack to execute a boot function included with a boot loader application using a boot stack:

determining, by the processor circuitry, whether the stack pointer register points to the OS stack or points to the boot stack;

copying, by the processor circuitry, first data values from the OS stack to the boot stack responsive to the determination that the stack pointer register points to the OS stack;

transitioning the stack pointer register to point from the OS stack to the boot stack; and executing, by the processor circuitry, the boot function using the boot stack and the first data values copied from the OS stack;

responsive to completion of the boot function;

copying, by the processor circuitry, second data values generated by the execution of the boot function using the boot stack from the boot stack to the OS stack;

transitioning, by the processor circuitry, the stack pointer register from the boot stack to point to the OS stack; and

continuing, by the processor circuitry, execution of the OS update application using the OS stack.

7. The method of claim 6 , wherein copying the first data values located on the OS stack to the boot stack further comprises:

copying, by the processor circuitry, an address of an instruction to be executed by the processor circuitry from the OS stack to the boot stack.

8. The method of claim 7 , wherein copying the first data values located on the OS stack to the boot stack further comprises:

copying, by the processor circuitry, saved scratch register values from the OS stack to the boot stack.

9. The method of claim 8 , wherein copying the second data values generated by the execution of the boot function using the boot stack from the boot stack to the OS stack further comprises:

copy another address of an instruction to be executed by the processor circuitry and saved scratch register values from the boot stack to the OS stack.

10. The method of claim 6 further comprising:

prior to transitioning the stagy k pointer register to point from the OS stack to the boot stack, prohibiting, by the processor circuitry, a process or thread swap until changing the stack pointer register to point from the boot stack to the OS stack.

11. A non-transitory, machine-readable, storage device that includes instructions that, when executed by processor circuitry, causes the processor circuitry to:

responsive to a call by an operating system (OS) update application using a OS stack to execute a boot function included with a boot loader application using a boot stack:

determine whether the stack pointer register points to the OS stack or points to a boot stack associated with the boot loader application;

copy first data values the OS stack to the boot stack responsive to the determination that the stack pointer register points to the OS stack;

transition the stack pointer register to point from the OS stack to the boot stack; and

execute the boot function using the boot stack and the first data values copied from the OS stack; and

responsive to completion of the boot function using the boot stack:

copy second data values generated by the execution of the boot function using the boot stack from the boot stack to the OS stack;

transition the stack pointer register from the boot stack to point to the OS stack;

and

continue execution of the OS update application using the OS stack and the second data values copied from the boot stack.

12. The non-transitory, machine-readable, storage device of claim 11 , wherein the instructions that cause the processor to copy first data values located on the OS stack to the boot stack, further cause the processor circuitry to:

copy an address of an instruction to be executed by the processor circuitry from the OS stack to the boot stack.

13. The non-transitory, machine-readable, storage device of claim 12 , wherein the instructions that cause the processor to copy first data values located on the OS stack to the boot stack, further cause the processor circuitry to:

copy saved scratch register values from the OS stack to the boot stack.

14. The non-transitory, machine-readable, storage device of claim 13 , wherein the instructions that cause the processor to copy second data values generated by the execution of the boot function using the boot stack from the boot stack to the OS stack, further cause the processor circuitry to:

copy another address of an instruction to be executed by the processor circuitry and scratch register values that were saved to the boot stack from the boot stack to the OS stack.

15. The non-transitory, machine-readable, storage device of claim 11 , wherein the instructions, when executed by the processor circuitry, further cause the processor circuitry to:

prior to transitioning the stack pointer register to point from the OS stack to the boot stack, prohibit a process or thread swap until changing the stack pointer register to point from the boot stack to the OS stack.