Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349438
b: refs/heads/master
c: 757be67
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed Jan 22, 2013
1 parent 4c3b212 commit 41acb4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ea494b528ac1b9df9f0c77ba49e3e8ee108d9ec
refs/heads/master: 757be67f565b4336f0d847f3ca9332e050c9ba83
9 changes: 5 additions & 4 deletions trunk/arch/mips/cavium-octeon/executive/cvmx-l2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* measurement, and debugging facilities.
*/

#include <linux/compiler.h>
#include <linux/irqflags.h>
#include <asm/octeon/cvmx.h>
#include <asm/octeon/cvmx-l2c.h>
Expand Down Expand Up @@ -285,22 +286,22 @@ uint64_t cvmx_l2c_read_perf(uint32_t counter)
*/
static void fault_in(uint64_t addr, int len)
{
volatile char *ptr;
volatile char dummy;
char *ptr;

/*
* Adjust addr and length so we get all cache lines even for
* small ranges spanning two cache lines.
*/
len += addr & CVMX_CACHE_LINE_MASK;
addr &= ~CVMX_CACHE_LINE_MASK;
ptr = (volatile char *)cvmx_phys_to_ptr(addr);
ptr = cvmx_phys_to_ptr(addr);
/*
* Invalidate L1 cache to make sure all loads result in data
* being in L2.
*/
CVMX_DCACHE_INVALIDATE;
while (len > 0) {
dummy += *ptr;
ACCESS_ONCE(*ptr);
len -= CVMX_CACHE_LINE_SIZE;
ptr += CVMX_CACHE_LINE_SIZE;
}
Expand Down

0 comments on commit 41acb4c

Please sign in to comment.