Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57968
b: refs/heads/master
c: ab61f7d
h: refs/heads/master
v: v3
  • Loading branch information
Haavard Skinnemoen committed Jun 23, 2007
1 parent c392593 commit 11bfba5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 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: 75154f402ef18e459ff97ddece25656b6c2b329c
refs/heads/master: ab61f7d21ab7f564fce322c498e4a7d6171140db
14 changes: 5 additions & 9 deletions trunk/arch/avr32/mm/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
void invalidate_dcache_region(void *start, size_t size)
{
unsigned long v, begin, end, linesz, mask;
int flush = 0;

linesz = boot_cpu_data.dcache.linesz;
mask = linesz - 1;
Expand All @@ -32,24 +31,21 @@ void invalidate_dcache_region(void *start, size_t size)
* instead of invalidating ... never discard valid data!
*/
begin = (unsigned long)start;
end = begin + size - 1;
end = begin + size;

if (begin & mask) {
flush_dcache_line(start);
begin += linesz;
flush = 1;
}
if ((end & mask) != mask) {
if (end & mask) {
flush_dcache_line((void *)end);
end -= linesz;
flush = 1;
end &= ~mask;
}

/* remaining cachelines only need invalidation */
for (v = begin; v <= end; v += linesz)
for (v = begin; v < end; v += linesz)
invalidate_dcache_line((void *)v);
if (flush)
flush_write_buffer();
flush_write_buffer();
}

void clean_dcache_region(void *start, size_t size)
Expand Down

0 comments on commit 11bfba5

Please sign in to comment.