摘要 |
The present invention discloses a method and an apparatus for recovering abnormal data in an internal memory. The method includes: receiving, by a processor, a data abort signal and an address of an abnormal instruction where abnormal data is located; suspending a current instruction being executed, and recording an address pointed to by a computer pointer; obtaining a program unit currently being executed by the processor; if it is determined that the abnormal instruction belongs to the program unit and that instructions between the first instruction and the current instruction in the program unit are all reversible instructions, invoking a destruction program unit corresponding to the program unit, so as to release resources already applied for by the program unit; and causing the computer pointer to point back to an address of the first instruction in the program unit, and re-executing the program unit. |
主权项 |
1. A method for recovering abnormal data in an internal memory, the method comprising:
receiving, by a processor, a data abort signal and an address of an abnormal instruction where abnormal data is located, wherein the abnormal data is stored in an internal memory; suspending, by the processor, a current instruction being executed, and recording an address pointed to by a computer pointer; obtaining, by the processor according to the address pointed to by the computer pointer, a program unit currently being executed by the processor; determining, by the processor according to the address of the abnormal instruction, whether the abnormal instruction belongs to the program unit; if the abnormal instruction belongs to the program unit, determining, by the processor, whether instructions between a first instruction and the current instruction in the program unit are all reversible instructions, wherein the reversible instructions mean that the instructions comprise no destructive operation; if the instructions between the first instruction and the current instruction in the program unit are all reversible instructions, invoking, by the processor, a destruction program unit corresponding to the program unit, so as to release resources already applied for by the program unit; and causing, by the processor, the computer pointer to point back to an address of the first instruction in the program unit, and re-executing the program unit, so as to recover the abnormal data in the internal memory. |