Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163359
b: refs/heads/master
c: 43bc61d
h: refs/heads/master
i:
  163357: 6f0be56
  163355: b1512b8
  163351: b87e29d
  163343: c73622d
  163327: 40cb034
v: v3
  • Loading branch information
Paul Mundt committed Aug 14, 2009
1 parent 0f8d7ac commit 06801da
Show file tree
Hide file tree
Showing 5 changed files with 25 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: 0837f52463583f76670ab2350e0f1541cb0351f5
refs/heads/master: 43bc61d86f8ea6edef2e02d1dc47617883fa9a9c
5 changes: 5 additions & 0 deletions trunk/arch/sh/include/asm/system_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ do { \
})
#endif

static inline reg_size_t register_align(void *val)
{
return (unsigned long)(signed long)val;
}

int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
struct mem_access *ma);

Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/sh/include/asm/system_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ do { \
#define jump_to_uncached() do { } while (0)
#define back_to_cached() do { } while (0)

static inline reg_size_t register_align(void *val)
{
return (unsigned long long)(signed long long)(signed long)val;
}

#endif /* __ASM_SH_SYSTEM_64_H */
2 changes: 2 additions & 0 deletions trunk/arch/sh/include/asm/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

#ifdef CONFIG_SUPERH32
typedef u16 insn_size_t;
typedef u32 reg_size_t;
#else
typedef u32 insn_size_t;
typedef u64 reg_size_t;
#endif

#endif /* __ASSEMBLY__ */
Expand Down
21 changes: 12 additions & 9 deletions trunk/arch/sh/mm/flush-sh4.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
*/
void __weak __flush_wback_region(void *start, int size)
{
unsigned long v, cnt, end;
reg_size_t aligned_start, v, cnt, end;

v = (unsigned long)start & ~(L1_CACHE_BYTES-1);
end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
aligned_start = register_align(start);
v = aligned_start & ~(L1_CACHE_BYTES-1);
end = (aligned_start + size + L1_CACHE_BYTES-1)
& ~(L1_CACHE_BYTES-1);
cnt = (end - v) / L1_CACHE_BYTES;

Expand Down Expand Up @@ -52,10 +53,11 @@ void __weak __flush_wback_region(void *start, int size)
*/
void __weak __flush_purge_region(void *start, int size)
{
unsigned long v, cnt, end;
reg_size_t aligned_start, v, cnt, end;

v = (unsigned long)start & ~(L1_CACHE_BYTES-1);
end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
aligned_start = register_align(start);
v = aligned_start & ~(L1_CACHE_BYTES-1);
end = (aligned_start + size + L1_CACHE_BYTES-1)
& ~(L1_CACHE_BYTES-1);
cnt = (end - v) / L1_CACHE_BYTES;

Expand Down Expand Up @@ -90,10 +92,11 @@ void __weak __flush_purge_region(void *start, int size)
*/
void __weak __flush_invalidate_region(void *start, int size)
{
unsigned long v, cnt, end;
reg_size_t aligned_start, v, cnt, end;

v = (unsigned long)start & ~(L1_CACHE_BYTES-1);
end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
aligned_start = register_align(start);
v = aligned_start & ~(L1_CACHE_BYTES-1);
end = (aligned_start + size + L1_CACHE_BYTES-1)
& ~(L1_CACHE_BYTES-1);
cnt = (end - v) / L1_CACHE_BYTES;

Expand Down

0 comments on commit 06801da

Please sign in to comment.