]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/sh/mm/uncached.c
sh: Fix up NUMA build for 29-bit.
[mirror_ubuntu-bionic-kernel.git] / arch / sh / mm / uncached.c
CommitLineData
9edef286
PM
1#include <linux/init.h>
2#include <asm/sizes.h>
3#include <asm/page.h>
40d1f004 4#include <asm/addrspace.h>
9edef286
PM
5
6/*
7 * This is the offset of the uncached section from its cached alias.
8 *
9 * Legacy platforms handle trivial transitions between cached and
10 * uncached segments by making use of the 1:1 mapping relationship in
11 * 512MB lowmem, others via a special uncached mapping.
12 *
13 * Default value only valid in 29 bit mode, in 32bit mode this will be
14 * updated by the early PMB initialization code.
15 */
16unsigned long cached_to_uncached = SZ_512M;
17unsigned long uncached_size = SZ_512M;
18unsigned long uncached_start, uncached_end;
19
20int virt_addr_uncached(unsigned long kaddr)
21{
22 return (kaddr >= uncached_start) && (kaddr < uncached_end);
23}
24
25void __init uncached_init(void)
26{
40d1f004
PM
27#ifdef CONFIG_29BIT
28 uncached_start = P2SEG;
29#else
9edef286 30 uncached_start = memory_end;
40d1f004 31#endif
9edef286
PM
32 uncached_end = uncached_start + uncached_size;
33}
d01447b3
PM
34
35void __init uncached_resize(unsigned long size)
36{
37 uncached_size = size;
38 uncached_end = uncached_start + uncached_size;
39}