3.2.6. cache_find_way

Returns the way index associated with a specified address in the cache.

Syntax:

int cache_find_way (isInstruction, cacheLevel, addr)
int isInstruction;
int cacheLevel;
ADDRESS addr;

where:

isInstruction

Identifies the type of cache to be searched:

1

Search the instruction cache.

0

Search the data cache.

cacheLevel

The cache level to search.

On the ARM1136 and ARM1156, only level 1 cache is accessible.

On the Cortex-A8 the level 2 cache is also available.

addr

The address to find.

Description

Returns the way index associated with a specified address in the cache. This macro is supported on the following processors:

  • ARM1136 (only when the MMU is disabled)

  • ARM1156

  • Cortex-A8.

Return value

The return value is one of the following:

  • The way index, starting at zero.

  • -1 if the given address is not found.

  • -2 if the operation is not possible.

Example

To search the level 1 data cache on the Cortex-A8 for the way index associated with address S:0x00032F48, enter:

> ce cache_find_way(0, 1, S:0x00032F48)
  Result is: 0  0x00000000

See also

Copyright © 2002-2009 ARM Limited. All rights reserved.ARM DUI 0175K
Non-Confidential