mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
armv7-r/a: fix a4 register use in xxx_invalidate/flush/clean_all.S
Use sub loop instead of add loop Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
committed by
Masayuki Ishikawa
parent
8de07b2ae8
commit
cc8ab23550
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv7-a/cp15_flush_dcache_all.S
|
* arch/arm/src/armv7-a/cp15_clean_dcache_all.S
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
|
|
||||||
.file "cp15_flush_dcache_all.S"
|
.file "cp15_clean_dcache_all.S"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
* Public Symbols
|
* Public Symbols
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl cp15_flush_dcache_all
|
.globl cp15_clean_dcache_all
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@@ -73,10 +73,10 @@
|
|||||||
.text
|
.text
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: cp15_flush_dcache_all
|
* Name: cp15_clean_dcache_all
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Invalidate the entire contents of D cache.
|
* Clean the entire contents of D cache.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* None
|
* None
|
||||||
@@ -86,36 +86,32 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl cp15_flush_dcache_all
|
.globl cp15_clean_dcache_all
|
||||||
.type cp15_flush_dcache_all, function
|
.type cp15_clean_dcache_all, function
|
||||||
|
|
||||||
cp15_flush_dcache_all:
|
cp15_clean_dcache_all:
|
||||||
|
|
||||||
|
mrc CP15_CCSIDR(r1) /* Read the Cache Size Identification Register */
|
||||||
|
|
||||||
mrc CP15_CCSIDR(r0) /* Read the Cache Size Identification Register */
|
|
||||||
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
||||||
and r0, r3, r0, lsr #13 /* r0=NumSets (number of sets - 1) */
|
and r0, r3, r1, lsr #13 /* r0=NumSets (number of sets - 1) */
|
||||||
|
|
||||||
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
||||||
add r4, r3, r0, lsr #3 /* r4=(number of ways - 1) */
|
and r1, r3, r1, lsr #3 /* r1=(number of ways - 1) */
|
||||||
|
|
||||||
mov r1, #0 /* r1 = way loop counter */
|
|
||||||
way_loop:
|
way_loop:
|
||||||
|
mov r3, r0 /* Init Sets */
|
||||||
mov r3, #0 /* r3 = set loop counter */
|
|
||||||
set_loop:
|
set_loop:
|
||||||
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
||||||
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
||||||
mcr CP15_DCCISW(r2) /* Data Cache Invalidate by Set/Way */
|
mcr CP15_DCCSW(r2) /* Data Cache Clean by Set/Way */
|
||||||
add r3, r3, #1 /* Increment set counter */
|
subs r3, r3, #1 /* Subtraction set counter */
|
||||||
cmp r0, r3 /* Last set? */
|
bcs set_loop /* Keep looping if not */
|
||||||
bne set_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
add r1, r1, #1 /* Increment the way counter */
|
subs r1, r1, #1 /* Subtraction the way counter */
|
||||||
cmp r4, r1 /* Last way */
|
bcs way_loop /* Keep looping if not */
|
||||||
bne way_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
dsb
|
dsb
|
||||||
bx lr
|
bx lr
|
||||||
.size cp15_flush_dcache_all, . - cp15_flush_dcache_all
|
.size cp15_clean_dcache_all, . - cp15_clean_dcache_all
|
||||||
.end
|
.end
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv7-a/cp15_clean_dcache_all.S
|
* arch/arm/src/armv7-a/cp15_flush_dcache_all.S
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
|
|
||||||
.file "cp15_clean_dcache_all.S"
|
.file "cp15_flush_dcache_all.S"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
* Public Symbols
|
* Public Symbols
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl cp15_clean_dcache_all
|
.globl cp15_flush_dcache_all
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@@ -73,10 +73,10 @@
|
|||||||
.text
|
.text
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: cp15_clean_dcache_all
|
* Name: cp15_flush_dcache_all
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Invalidate the entire contents of D cache.
|
* Flush the entire contents of D cache.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* None
|
* None
|
||||||
@@ -86,36 +86,32 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl cp15_clean_dcache_all
|
.globl cp15_flush_dcache_all
|
||||||
.type cp15_clean_dcache_all, function
|
.type cp15_flush_dcache_all, function
|
||||||
|
|
||||||
cp15_clean_dcache_all:
|
cp15_flush_dcache_all:
|
||||||
|
|
||||||
|
mrc CP15_CCSIDR(r1) /* Read the Cache Size Identification Register */
|
||||||
|
|
||||||
mrc CP15_CCSIDR(r0) /* Read the Cache Size Identification Register */
|
|
||||||
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
||||||
and r0, r3, r0, lsr #13 /* r0=NumSets (number of sets - 1) */
|
and r0, r3, r1, lsr #13 /* r0=NumSets (number of sets - 1) */
|
||||||
|
|
||||||
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
||||||
add r4, r3, r0, lsr #3 /* r4=(number of ways - 1) */
|
and r1, r3, r1, lsr #3 /* r1=(number of ways - 1) */
|
||||||
|
|
||||||
mov r1, #0 /* r1 = way loop counter */
|
|
||||||
way_loop:
|
way_loop:
|
||||||
|
mov r3, r0 /* Init Sets */
|
||||||
mov r3, #0 /* r3 = set loop counter */
|
|
||||||
set_loop:
|
set_loop:
|
||||||
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
||||||
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
||||||
mcr CP15_DCCSW(r2) /* Data Cache Invalidate by Set/Way */
|
mcr CP15_DCCISW(r2) /* Data Cache Clean and Invalidate by Set/Way */
|
||||||
add r3, r3, #1 /* Increment set counter */
|
subs r3, r3, #1 /* Subtraction set counter */
|
||||||
cmp r0, r3 /* Last set? */
|
bcs set_loop /* Keep looping if not */
|
||||||
bne set_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
add r1, r1, #1 /* Increment the way counter */
|
subs r1, r1, #1 /* Subtraction the way counter */
|
||||||
cmp r4, r1 /* Last way */
|
bcs way_loop /* Keep looping if not */
|
||||||
bne way_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
dsb
|
dsb
|
||||||
bx lr
|
bx lr
|
||||||
.size cp15_clean_dcache_all, . - cp15_clean_dcache_all
|
.size cp15_flush_dcache_all, . - cp15_flush_dcache_all
|
||||||
.end
|
.end
|
||||||
|
|
||||||
|
|||||||
@@ -91,28 +91,25 @@
|
|||||||
|
|
||||||
cp15_invalidate_dcache_all:
|
cp15_invalidate_dcache_all:
|
||||||
|
|
||||||
mrc CP15_CCSIDR(r0) /* Read the Cache Size Identification Register */
|
mrc CP15_CCSIDR(r1) /* Read the Cache Size Identification Register */
|
||||||
|
|
||||||
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
||||||
and r0, r3, r0, lsr #13 /* r0=NumSets (number of sets - 1) */
|
and r0, r3, r1, lsr #13 /* r0=NumSets (number of sets - 1) */
|
||||||
|
|
||||||
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
||||||
add r4, r3, r0, lsr #3 /* r4=(number of ways - 1) */
|
and r1, r3, r1, lsr #3 /* r1=(number of ways - 1) */
|
||||||
|
|
||||||
mov r1, #0 /* r1 = way loop counter */
|
|
||||||
way_loop:
|
way_loop:
|
||||||
|
mov r3, r0 /* Init Sets */
|
||||||
mov r3, #0 /* r3 = set loop counter */
|
|
||||||
set_loop:
|
set_loop:
|
||||||
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
||||||
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
||||||
mcr CP15_DCISW(r2) /* Data Cache Invalidate by Set/Way */
|
mcr CP15_DCISW(r2) /* Data Cache Invalidate by Set/Way */
|
||||||
add r3, r3, #1 /* Increment set counter */
|
subs r3, r3, #1 /* Subtraction set counter */
|
||||||
cmp r0, r3 /* Last set? */
|
bcs set_loop /* Keep looping if not */
|
||||||
bne set_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
add r1, r1, #1 /* Increment the way counter */
|
subs r1, r1, #1 /* Subtraction the way counter */
|
||||||
cmp r4, r1 /* Last way? */
|
bcs way_loop /* Keep looping if not */
|
||||||
bne way_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
dsb
|
dsb
|
||||||
bx lr
|
bx lr
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv7-r/cp15_flush_dcache_all.S
|
* arch/arm/src/armv7-r/cp15_clean_dcache_all.S
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
|
|
||||||
.file "cp15_flush_dcache_all.S"
|
.file "cp15_clean_dcache_all.S"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
* Public Symbols
|
* Public Symbols
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl cp15_flush_dcache_all
|
.globl cp15_clean_dcache_all
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@@ -73,10 +73,10 @@
|
|||||||
.text
|
.text
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: cp15_flush_dcache_all
|
* Name: cp15_clean_dcache_all
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Invalidate the entire contents of D cache.
|
* clean the entire contents of D cache.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* None
|
* None
|
||||||
@@ -86,36 +86,33 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl cp15_flush_dcache_all
|
.globl cp15_clean_dcache_all
|
||||||
.type cp15_flush_dcache_all, function
|
.type cp15_clean_dcache_all, function
|
||||||
|
|
||||||
cp15_flush_dcache_all:
|
cp15_clean_dcache_all:
|
||||||
|
|
||||||
|
mrc CP15_CCSIDR(r1) /* Read the Cache Size Identification Register */
|
||||||
|
|
||||||
mrc CP15_CCSIDR(r0) /* Read the Cache Size Identification Register */
|
|
||||||
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
||||||
and r0, r3, r0, lsr #13 /* r0=NumSets (number of sets - 1) */
|
and r0, r3, r1, lsr #13 /* r0=NumSets (number of sets - 1) */
|
||||||
|
|
||||||
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
||||||
add r4, r3, r0, lsr #3 /* r4=(number of ways - 1) */
|
and r1, r3, r1, lsr #3 /* r1=(number of ways - 1) */
|
||||||
|
|
||||||
mov r1, #0 /* r1 = way loop counter */
|
|
||||||
way_loop:
|
way_loop:
|
||||||
|
mov r3, r0 /* Init Sets */
|
||||||
mov r3, #0 /* r3 = set loop counter */
|
|
||||||
set_loop:
|
set_loop:
|
||||||
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
||||||
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
||||||
mcr CP15_DCCISW(r2) /* Data Cache Invalidate by Set/Way */
|
mcr CP15_DCCSW(r2) /* Data Cache Clean by Set/Way */
|
||||||
add r3, r3, #1 /* Increment set counter */
|
subs r3, r3, #1 /* Subtraction set counter */
|
||||||
cmp r0, r3 /* Last set? */
|
bcs set_loop /* Keep looping if not */
|
||||||
bne set_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
add r1, r1, #1 /* Increment the way counter */
|
subs r1, r1, #1 /* Subtraction the way counter */
|
||||||
cmp r4, r1 /* Last way */
|
bcs way_loop /* Keep looping if not */
|
||||||
bne way_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
dsb
|
dsb
|
||||||
bx lr
|
bx lr
|
||||||
.size cp15_flush_dcache_all, . - cp15_flush_dcache_all
|
.size cp15_clean_dcache_all, . - cp15_clean_dcache_all
|
||||||
.end
|
.end
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv7-r/cp15_clean_dcache_all.S
|
* arch/arm/src/armv7-r/cp15_flush_dcache_all.S
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
#include "cp15.h"
|
#include "cp15.h"
|
||||||
|
|
||||||
.file "cp15_clean_dcache_all.S"
|
.file "cp15_flush_dcache_all.S"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
* Public Symbols
|
* Public Symbols
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl cp15_clean_dcache_all
|
.globl cp15_flush_dcache_all
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@@ -73,10 +73,10 @@
|
|||||||
.text
|
.text
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: cp15_clean_dcache_all
|
* Name: cp15_flush_dcache_all
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Invalidate the entire contents of D cache.
|
* Flush the entire contents of D cache.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* None
|
* None
|
||||||
@@ -86,36 +86,33 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl cp15_clean_dcache_all
|
.globl cp15_flush_dcache_all
|
||||||
.type cp15_clean_dcache_all, function
|
.type cp15_flush_dcache_all, function
|
||||||
|
|
||||||
cp15_clean_dcache_all:
|
cp15_flush_dcache_all:
|
||||||
|
|
||||||
|
mrc CP15_CCSIDR(r1) /* Read the Cache Size Identification Register */
|
||||||
|
|
||||||
mrc CP15_CCSIDR(r0) /* Read the Cache Size Identification Register */
|
|
||||||
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
||||||
and r0, r3, r0, lsr #13 /* r0=NumSets (number of sets - 1) */
|
and r0, r3, r1, lsr #13 /* r0=NumSets (number of sets - 1) */
|
||||||
|
|
||||||
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
||||||
add r4, r3, r0, lsr #3 /* r4=(number of ways - 1) */
|
and r1, r3, r1, lsr #3 /* r1=(number of ways - 1) */
|
||||||
|
|
||||||
mov r1, #0 /* r1 = way loop counter */
|
|
||||||
way_loop:
|
way_loop:
|
||||||
|
mov r3, r0 /* Init Sets */
|
||||||
mov r3, #0 /* r3 = set loop counter */
|
|
||||||
set_loop:
|
set_loop:
|
||||||
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
||||||
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
||||||
mcr CP15_DCCSW(r2) /* Data Cache Invalidate by Set/Way */
|
mcr CP15_DCCISW(r2) /* Data Cache Clean and Invalidate by Set/Way */
|
||||||
add r3, r3, #1 /* Increment set counter */
|
subs r3, r3, #1 /* Subtraction set counter */
|
||||||
cmp r0, r3 /* Last set? */
|
bcs set_loop /* Keep looping if not */
|
||||||
bne set_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
add r1, r1, #1 /* Increment the way counter */
|
subs r1, r1, #1 /* Subtraction the way counter */
|
||||||
cmp r4, r1 /* Last way */
|
bcs way_loop /* Keep looping if not */
|
||||||
bne way_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
dsb
|
dsb
|
||||||
bx lr
|
bx lr
|
||||||
.size cp15_clean_dcache_all, . - cp15_clean_dcache_all
|
.size cp15_flush_dcache_all, . - cp15_flush_dcache_all
|
||||||
.end
|
.end
|
||||||
|
|
||||||
|
|||||||
@@ -91,28 +91,25 @@
|
|||||||
|
|
||||||
cp15_invalidate_dcache_all:
|
cp15_invalidate_dcache_all:
|
||||||
|
|
||||||
mrc CP15_CCSIDR(r0) /* Read the Cache Size Identification Register */
|
mrc CP15_CCSIDR(r1) /* Read the Cache Size Identification Register */
|
||||||
|
|
||||||
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
ldr r3, =0x7fff /* Isolate the NumSets field (bits 13-27) */
|
||||||
and r0, r3, r0, lsr #13 /* r0=NumSets (number of sets - 1) */
|
and r0, r3, r1, lsr #13 /* r0=NumSets (number of sets - 1) */
|
||||||
|
|
||||||
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
ldr r3, =0x3ff /* Isolate the way field (bits 3-12) */
|
||||||
add r4, r3, r0, lsr #3 /* r4=(number of ways - 1) */
|
and r1, r3, r1, lsr #3 /* r1=(number of ways - 1) */
|
||||||
|
|
||||||
mov r1, #0 /* r1 = way loop counter */
|
|
||||||
way_loop:
|
way_loop:
|
||||||
|
mov r3, r0 /* Init Sets */
|
||||||
mov r3, #0 /* r3 = set loop counter */
|
|
||||||
set_loop:
|
set_loop:
|
||||||
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
mov r2, r1, lsl #30 /* r2 = way loop counter << 30 */
|
||||||
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
orr r2, r3, lsl #5 /* r2 = set/way cache operation format */
|
||||||
mcr CP15_DCISW(r2) /* Data Cache Invalidate by Set/Way */
|
mcr CP15_DCISW(r2) /* Data Cache Invalidate by Set/Way */
|
||||||
add r3, r3, #1 /* Increment set counter */
|
subs r3, r3, #1 /* Subtraction set counter */
|
||||||
cmp r0, r3 /* Last set? */
|
bcs set_loop /* Keep looping if not */
|
||||||
bne set_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
add r1, r1, #1 /* Increment the way counter */
|
subs r1, r1, #1 /* Subtraction the way counter */
|
||||||
cmp r4, r1 /* Last way? (four ways assumed) */
|
bcs way_loop /* Keep looping if not */
|
||||||
bne way_loop /* Keep looping if not */
|
|
||||||
|
|
||||||
dsb
|
dsb
|
||||||
bx lr
|
bx lr
|
||||||
|
|||||||
Reference in New Issue
Block a user