Intel XScale Core Developer's Manual page 73

Table of Contents

Advertisement

Example 6-4. Creating Data RAM
; R1 contains the virtual address of a region of memory to configure as data RAM,
; which is aligned on a 32-byte boundary.
; MMU is configured so that the memory region is cacheable.
; R0 is the number of 32-byte lines to designate as data RAM. In this example 16
; lines of the data cache are re-configured as data RAM.
; The inner loop is used to initialize the newly allocated lines
; MMU and data cache are enabled prior to this code.
MACRO ALLOCATE Rx
MCR P15, 0, Rx, C7, C2, 5
ENDM
MACRO DRAIN
MCR P15, 0, R0, C7, C10, 4
ENDM
DRAIN
MOV R4, #0x0
MOV R5, #0x0
MOV R2, #0x1
MCR P15,0,R2,C9,C2,0
CPWAIT
MOV R0, #16
LOOP1:
ALLOCATE R1
; initialize 32 bytes of newly allocated line
DRAIN
STRD R4, [R1],#8
STRD R4, [R1],#8
STRD R4, [R1],#8
STRD R4, [R1],#8
SUBS R0, R0, #1
BNE LOOP1
; Turn off data cache locking
DRAIN
MOV R2, #0x0
MCR P15,0,R2,C9,C2,0; Take the data cache out of lock mode.
CPWAIT
Developer's Manual
; drain pending loads and stores
; Put the data cache in lock mode
; Allocate and lock a tag into the data cache at
; address [R1].
;
;
;
;
; Decrement loop count
; Finish all pending operations
January, 2004
Intel XScale® Core Developer's Manual
Data Cache
73

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the XScale Core and is the answer not in the manual?

Table of Contents