FIRMWARE STRUCTURING METHOD AND RELATED APPARATUS FOR UNIFYING HANDLING OF EXECUTION RESPONSES OF SUBROUTINES
First Claim
1. A method for controlling a hardware circuit with a processor, the processor used for executing a code to control the hardware circuit, the code comprising:
- a plurality of lower-level subroutines, wherein after the processor executes various lower-level subroutines, the hardware circuit will be controlled to execute various corresponding operations, and each lower-level subroutine will record results, which come from the hardware circuit executing the corresponding operations, in an error code;
wherein each result corresponds to a recovery operation;
a plurality of higher-level subroutines, each higher-level subroutines used for calling at least a lower-level subroutine to control the hardware circuit to execute operations corresponding to the lower-level subroutine according to the called lower-level subroutine when the processor executesthe higher-level subroutine;
a plurality of recovery subroutines, each recovery subroutine corresponding to a recovery operations for controlling the hardware circuit to execute various corresponding recovery operations, after the processor executes various recovery subroutines; and
an error-handling subroutine for calling the recovery subroutines according to the error code;
the method comprising;
after the processor executes the higher-level subroutines, executing the error-handling subroutine to allow the processor to control the hardware circuit to executethe corresponding recovery operations according to the results corresponding to the lower-level subroutines.
1 Assignment
0 Petitions
Accused Products
Abstract
A firmware code structuring method and related apparatus includes a plurality of subroutines to define various operations of the hardware circuit, and the subroutines are grouped in several different levels. A subroutine of a lower level defines a simpler operation of the hardware circuit, and a higher-level subroutine calls a plurality of lower level subroutines to define more complicated operations of the hardware circuit. When the lower level subroutines are executed, they store results of corresponding operations in an error code. If certain operations performed do not achieve expected results, a corresponding recovery operation is performed by the hardware circuit. To control the hardware to perform the required recovery operations, an error-handler is executed to make the hardware circuit perform recovery operations corresponding to lower level subroutines called in a higher level subroutine according to the error code after the higher level subroutine is finished.
104 Citations
26 Claims
-
1. A method for controlling a hardware circuit with a processor, the processor used for executing a code to control the hardware circuit, the code comprising:
-
a plurality of lower-level subroutines, wherein after the processor executes various lower-level subroutines, the hardware circuit will be controlled to execute various corresponding operations, and each lower-level subroutine will record results, which come from the hardware circuit executing the corresponding operations, in an error code;
wherein each result corresponds to a recovery operation;
a plurality of higher-level subroutines, each higher-level subroutines used for calling at least a lower-level subroutine to control the hardware circuit to execute operations corresponding to the lower-level subroutine according to the called lower-level subroutine when the processor executesthe higher-level subroutine;
a plurality of recovery subroutines, each recovery subroutine corresponding to a recovery operations for controlling the hardware circuit to execute various corresponding recovery operations, after the processor executes various recovery subroutines; and
an error-handling subroutine for calling the recovery subroutines according to the error code;
the method comprising;
after the processor executes the higher-level subroutines, executing the error-handling subroutine to allow the processor to control the hardware circuit to executethe corresponding recovery operations according to the results corresponding to the lower-level subroutines. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
-
-
14. An electronic device, comprising:
-
a hardware circuit for achieving operations of the electronic device;
a processor for executing a code to control the hardware circuit;
a storage device for storing the code;
wherein the code comprising;
a plurality of lower-level subroutines, wherein after the processor executes various lower-level subroutines, the hardware circuit will be controlled to execute various corresponding operations, and each lower-level subroutine will record results, which come from the hardware circuit executing the corresponding operations, in an error code;
wherein each result corresponds to a recovery operation;
a plurality of higher-level subroutines, each higher-level subroutines used for calling at least a lower-level subroutine to control the hardware circuit to execute operations corresponding to the lower-level subroutine according to the called lower-level subroutine when the processor executes the higher-level subroutine;
a plurality of recovery subroutines, each recovery subroutine corresponding to a recovery operations for controlling the hardware circuit to execute various corresponding recovery operations, after the processor executes various recovery subroutines; and
an error-handling subroutine for calling the recovery subroutines according to the error code;
wherein after executing the higher-level subroutines, the processor executes the error-handling subroutine to allow the processor to control the hardware circuit to execute the corresponding recovery operations according to the results corresponding to the lower-level subroutines. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)
-
Specification