Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9494
b: refs/heads/master
c: 717463d
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Sep 30, 2005
1 parent 04f7eb6 commit a66d693
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: 4cb29d18129fb425c6202ab535c3fc1856391b99
refs/heads/master: 717463d806a53380a691eeb0136a4b750a9f9ae0
14 changes: 11 additions & 3 deletions trunk/arch/sparc64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <asm/visasm.h>
#include <asm/spitfire.h>
#include <asm/page.h>
#include <asm/cpudata.h>

/* Returning from ptrace is a bit tricky because the syscall return
* low level code assumes any value returned which is negative and
Expand Down Expand Up @@ -132,12 +133,16 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
if ((uaddr ^ (unsigned long) kaddr) & (1UL << 13)) {
unsigned long start = __pa(kaddr);
unsigned long end = start + len;
unsigned long dcache_line_size;

dcache_line_size = local_cpu_data().dcache_line_size;

if (tlb_type == spitfire) {
for (; start < end; start += 32)
for (; start < end; start += dcache_line_size)
spitfire_put_dcache_tag(start & 0x3fe0, 0x0);
} else {
for (; start < end; start += 32)
start &= ~(dcache_line_size - 1);
for (; start < end; start += dcache_line_size)
__asm__ __volatile__(
"stxa %%g0, [%0] %1\n\t"
"membar #Sync"
Expand All @@ -150,8 +155,11 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
if (write && tlb_type == spitfire) {
unsigned long start = (unsigned long) kaddr;
unsigned long end = start + len;
unsigned long icache_line_size;

icache_line_size = local_cpu_data().icache_line_size;

for (; start < end; start += 32)
for (; start < end; start += icache_line_size)
flushi(start);
}
}
Expand Down

0 comments on commit a66d693

Please sign in to comment.