IP Library Granted Patent US 7,844,962
Granted Patent B2
US 7,844,962 · App. 11/267,927 · Granted Nov 30, 2010

Patching device for a processor

Assignee: STMicroelectronics Belgium NV
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 7,844,962
App. No.
11/267,927
Granted
Nov 30, 2010
Kind
B2
Abstract

A code patching device is provided for use with a processor having a read-only memory which stores instruction code and a further memory for storing patch code. A plurality of patch address registers each store an address, in the read-only memory, at which a patch is to be performed. A comparator compares the address of the read-only memory that is being accessed by the processor with the addresses stored in the registers. A control unit selects between code from the read-only memory or patch code from the further memory depending on the comparison. The code patching device can replace, on-the-fly, erroneous lines of code from the read-only memory by corrected ones. During an initialization process the patch code is loaded into the further memory and the registers are loaded with the addresses which require patching.

Claims (30)

1. A patching device for use with a processor having a first non-volatile memory which stores data and a second memory for storing a plurality of patch data items, wherein each patch data item in the second memory is associated with an indicator indicating whether the patch data item precedes one of the other patch data items in a block of patch data items, the patching device comprising:

a third memory having a plurality of memory locations, one memory location being a patch block memory location, each memory location configured to store an address, in the first memory, at which a patch is to be performed, wherein each address stored in the plurality of memory locations in the third memory is associated with one of the plurality of data items in the second memory;

a comparator which is configured to compare a first address of the first memory that is being accessed by the processor with the addresses stored in the third memory; and

a control unit which is configured to select between data from the first memory or one of the plurality of patch data items from the second memory depending on the comparison, and when the first address of the first memory that is being accessed by the processor matches an address stored in the third memory to:

select the one of the plurality of patch data items that corresponds to the first address of the first memory that is being accessed;

determine whether the indicator associated with the selected one of the plurality of patch data items indicates that the selected one of the plurality of patch data items precedes one of the other patch data items in a block of patch data items, such that a data item at the first address in the first memory is to be patched with a plurality of patch data items in the block of patch data items; and

when the control unit determines that the selected one of the plurality of patch data items precedes one of the other patch data items in a block of patch data items:

store in the patch block memory location a next address in the first memory that is subsequent to the first address of the first memory that is being accessed by the processor; and

associate the next address in the first memory with the one of the other patch data items that the selected one of the plurality of patch data items precedes in the block of patch data items.

2. A patching device according to claim 1 , wherein the third memory comprises a plurality of patch address registers, each memory location being a register.

3. A patching device according to claim 1 , wherein the address of the first memory that is being accessed by the processor is on a bus external to the processor.

4. A patching device according to claim 1 , wherein the comparator is configured to perform the comparison of the address of the first memory that is being accessed by the processor with each of the addresses stored in the plurality of memory locations in the third memory, in parallel.

5. A patching device according to claim 1 which further comprises a store of an address, in the second memory, at which the patch data is stored.

6. A patching device according to claim 5 , wherein the store is configured to store a base address of an area of the second memory where the patch data is stored and an index which points to a respective patch within that area.

7. A patching device according to claim 1 further comprising at least one memory location for storing an indication of whether a patch instruction code is a THUMB mode Branch and Link instruction.

8. A patching device according to claim 1 in the form of an integrated circuit.

9. A method of patching code in a processor which has a first non-volatile memory which stores data and a second memory for storing a plurality of patch data items, wherein each patch data item in the second memory is associated with an indicator indicating whether the patch data item precedes one of the other patch data items in a block of patch data items, the method comprising:

storing, in a plurality of memory locations in a third memory, addresses, in the first memory, at which a patch is to be performed, one memory location being a patch block memory location, wherein each address stored in the plurality of memory locations in the third memory is associated with one of the plurality of data items in the second memory;

comparing a first address of the first memory that is being accessed by the processor with the addresses stored in the third memory;

selecting between data from the first memory or one of the plurality of patch data items from the second memory depending on the comparison, and when the first address of the first memory that is being accessed by the processor matches an address stored in the third memory:

selecting the one of the plurality of patch data items that corresponds to the first address of the first memory that is being accessed;

determining whether the indicator associated with the selected one of the plurality of patch data items indicates that the selected one of the plurality of patch data items precedes one of the other patch data items in a block of patch data items, such that a data item at the first address in the first memory is to be patched with a plurality of patch data items in the block of patch data items; and

when it is determined that the selected one of the plurality of patch data items precedes one of the other patch data items in a block of patch data items:

storing in the patch block memory location a next address in the first memory that is subsequent to the first address of the first memory that is being accessed by the processor; and

associating the next address in the first memory with the one of the other patch data items that the selected one of the plurality of patch data items precedes in the block of patch data items.

10. A method according to claim 9 , wherein the comparing of the address of the first memory that is being accessed by the processor is done on a bus external to the processor.

11. A method according to claim 9 , wherein the comparing of the address of the first memory that is being accessed by the processor with each of the addresses stored in the plurality of memory locations in the third memory, is done in parallel.

12. A method according to claim 9 further comprising storing of an address, in the second memory, at which the patch data is stored.

13. A method according to claim 12 , wherein the storing is of a base address of an area of the second memory where the patch data is stored and of an index which points to a respective patch within that area.

14. A method according to claim 9 further comprising storing an indication of whether a patch instruction code is a THUMB mode Branch and Link instruction.

Assignments (4)
CHANGE OF NAME Recorded Oct 9, 2024
From: PROTON WORLD INTERNATIONAL
To: STMICROELECTRONICS BELGIUM
Reel/Frame 069174/0847 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 30, 2014
From: STMICROELECTRONICS BELGIUM N.V., NOW KNOWN AS ST-ERICSSON BELGIUM N.V.
To: PROTON WORLD INTERNATIONAL N.V.
Reel/Frame 032788/0093 →
CORRECTIVE ASSIGNMENT TO CORRECT THE NAME OF ASSIGNEE AND ADD TWO ASSIGNORS PREVIOUSLY RECORDED ON REEL 017354 FRAME 0117. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Apr 5, 2006
From: ALEXANDRE, RUDOLPH; CHARLIER, VINCENT; RAHAGA, TIANA; VANDERMISSEN, YVES
To: STMICROELECTRONICS BELGIUM NV
Reel/Frame 017420/0839 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 19, 2005
From: ALEXANDRE, RUDOLPH; CHARLIER, VINCENT
To: STMICROELECTRONICS, S.A.
Reel/Frame 017354/0117 →
Priority Claims (1)
GB 0424424.0 · Nov 4, 2004 · national
Continuity (1)
Related Publication 20060107104A1 · May 18, 2006