Skip to content

Commit

Permalink
sh: Fix cached/uncaced address calculation in 29bit mode
Browse files Browse the repository at this point in the history
In the case of 29bit mode, CAC/UNCAC_ADDR does not return a right address.
This revises this problem by using P1SEGADDR and P2SEGADDR in 29bit mode.

Reported-by: Yutaro Ebihara <ebiharaml@si-linux.co.jp>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Simon Horman <horms@verge.net.au>
Cc: stable@kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Nobuhiro Iwamatsu authored and Paul Mundt committed Nov 4, 2011
1 parent 1a67a57 commit dfd3b59
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/sh/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@ typedef struct page *pgtable_t;
#endif /* !__ASSEMBLY__ */

#ifdef CONFIG_UNCACHED_MAPPING
#if defined(CONFIG_29BIT)
#define UNCAC_ADDR(addr) P2SEGADDR(addr)
#define CAC_ADDR(addr) P1SEGADDR(addr)
#else
#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start)
#define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET)
#endif
#else
#define UNCAC_ADDR(addr) ((addr))
#define CAC_ADDR(addr) ((addr))
Expand Down

0 comments on commit dfd3b59

Please sign in to comment.