aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2011-05-02 16:21:12 -0400
committerChris Metcalf <cmetcalf@tilera.com>2011-05-04 14:41:13 -0400
commit5386e735897afd8bcd332caf21a5f68d9e0e81c6 (patch)
tree4149431c393c4aa5631d20790cdb238e718d5347 /arch/tile
parent28d717411badb78df71ecf087a07b93caf418f59 (diff)
arch/tile: kernel-related cleanups from removing static page size
User space code has been able to discover the static page size by including a special <hv/pagesize.h> file. In the current release, that file is now gone, and <asm/page.h> doesn't rely on it. The getpagesize() API is now the only way for userspace to get the page size. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile')
-rw-r--r--arch/tile/include/arch/icache.h11
-rw-r--r--arch/tile/include/asm/page.h10
-rw-r--r--arch/tile/include/hv/hypervisor.h12
-rw-r--r--arch/tile/include/hv/pagesize.h32
4 files changed, 17 insertions, 48 deletions
diff --git a/arch/tile/include/arch/icache.h b/arch/tile/include/arch/icache.h
index 5c87c9016338..762eafa8a11e 100644
--- a/arch/tile/include/arch/icache.h
+++ b/arch/tile/include/arch/icache.h
@@ -16,7 +16,7 @@
16/** 16/**
17 * @file 17 * @file
18 * 18 *
19 * Support for invalidating bytes in the instruction 19 * Support for invalidating bytes in the instruction cache.
20 */ 20 */
21 21
22#ifndef __ARCH_ICACHE_H__ 22#ifndef __ARCH_ICACHE_H__
@@ -30,11 +30,10 @@
30 * 30 *
31 * @param addr The start of memory to be invalidated. 31 * @param addr The start of memory to be invalidated.
32 * @param size The number of bytes to be invalidated. 32 * @param size The number of bytes to be invalidated.
33 * @param page_size The system's page size, typically the PAGE_SIZE constant 33 * @param page_size The system's page size, e.g. getpagesize() in userspace.
34 * in sys/page.h. This value must be a power of two no larger 34 * This value must be a power of two no larger than the page containing
35 * than the page containing the code to be invalidated. If the value 35 * the code to be invalidated. If the value is smaller than the actual page
36 * is smaller than the actual page size, this function will still 36 * size, this function will still work, but may run slower than necessary.
37 * work, but may run slower than necessary.
38 */ 37 */
39static __inline void 38static __inline void
40invalidate_icache(const void* addr, unsigned long size, 39invalidate_icache(const void* addr, unsigned long size,
diff --git a/arch/tile/include/asm/page.h b/arch/tile/include/asm/page.h
index 7105629afa1d..db93518fac03 100644
--- a/arch/tile/include/asm/page.h
+++ b/arch/tile/include/asm/page.h
@@ -16,7 +16,8 @@
16#define _ASM_TILE_PAGE_H 16#define _ASM_TILE_PAGE_H
17 17
18#include <linux/const.h> 18#include <linux/const.h>
19#include <hv/pagesize.h> 19#include <hv/hypervisor.h>
20#include <arch/chip.h>
20 21
21/* PAGE_SHIFT and HPAGE_SHIFT determine the page sizes. */ 22/* PAGE_SHIFT and HPAGE_SHIFT determine the page sizes. */
22#define PAGE_SHIFT HV_LOG2_PAGE_SIZE_SMALL 23#define PAGE_SHIFT HV_LOG2_PAGE_SIZE_SMALL
@@ -28,8 +29,6 @@
28#define PAGE_MASK (~(PAGE_SIZE - 1)) 29#define PAGE_MASK (~(PAGE_SIZE - 1))
29#define HPAGE_MASK (~(HPAGE_SIZE - 1)) 30#define HPAGE_MASK (~(HPAGE_SIZE - 1))
30 31
31#ifdef __KERNEL__
32
33/* 32/*
34 * If the Kconfig doesn't specify, set a maximum zone order that 33 * If the Kconfig doesn't specify, set a maximum zone order that
35 * is enough so that we can create huge pages from small pages given 34 * is enough so that we can create huge pages from small pages given
@@ -39,9 +38,6 @@
39#define CONFIG_FORCE_MAX_ZONEORDER (HPAGE_SHIFT - PAGE_SHIFT + 1) 38#define CONFIG_FORCE_MAX_ZONEORDER (HPAGE_SHIFT - PAGE_SHIFT + 1)
40#endif 39#endif
41 40
42#include <hv/hypervisor.h>
43#include <arch/chip.h>
44
45#ifndef __ASSEMBLY__ 41#ifndef __ASSEMBLY__
46 42
47#include <linux/types.h> 43#include <linux/types.h>
@@ -337,6 +333,4 @@ extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
337 333
338#include <asm-generic/memory_model.h> 334#include <asm-generic/memory_model.h>
339 335
340#endif /* __KERNEL__ */
341
342#endif /* _ASM_TILE_PAGE_H */ 336#endif /* _ASM_TILE_PAGE_H */
diff --git a/arch/tile/include/hv/hypervisor.h b/arch/tile/include/hv/hypervisor.h
index ee41bca4c8c4..72ec1e972f15 100644
--- a/arch/tile/include/hv/hypervisor.h
+++ b/arch/tile/include/hv/hypervisor.h
@@ -22,8 +22,6 @@
22 22
23#include <arch/chip.h> 23#include <arch/chip.h>
24 24
25#include <hv/pagesize.h>
26
27/* Linux builds want unsigned long constants, but assembler wants numbers */ 25/* Linux builds want unsigned long constants, but assembler wants numbers */
28#ifdef __ASSEMBLER__ 26#ifdef __ASSEMBLER__
29/** One, for assembler */ 27/** One, for assembler */
@@ -44,11 +42,21 @@
44 */ 42 */
45#define HV_L1_SPAN (__HV_SIZE_ONE << HV_LOG2_L1_SPAN) 43#define HV_L1_SPAN (__HV_SIZE_ONE << HV_LOG2_L1_SPAN)
46 44
45/** The log2 of the size of small pages, in bytes. This value should
46 * be verified at runtime by calling hv_sysconf(HV_SYSCONF_PAGE_SIZE_SMALL).
47 */
48#define HV_LOG2_PAGE_SIZE_SMALL 16
49
47/** The size of small pages, in bytes. This value should be verified 50/** The size of small pages, in bytes. This value should be verified
48 * at runtime by calling hv_sysconf(HV_SYSCONF_PAGE_SIZE_SMALL). 51 * at runtime by calling hv_sysconf(HV_SYSCONF_PAGE_SIZE_SMALL).
49 */ 52 */
50#define HV_PAGE_SIZE_SMALL (__HV_SIZE_ONE << HV_LOG2_PAGE_SIZE_SMALL) 53#define HV_PAGE_SIZE_SMALL (__HV_SIZE_ONE << HV_LOG2_PAGE_SIZE_SMALL)
51 54
55/** The log2 of the size of large pages, in bytes. This value should be
56 * verified at runtime by calling hv_sysconf(HV_SYSCONF_PAGE_SIZE_LARGE).
57 */
58#define HV_LOG2_PAGE_SIZE_LARGE 24
59
52/** The size of large pages, in bytes. This value should be verified 60/** The size of large pages, in bytes. This value should be verified
53 * at runtime by calling hv_sysconf(HV_SYSCONF_PAGE_SIZE_LARGE). 61 * at runtime by calling hv_sysconf(HV_SYSCONF_PAGE_SIZE_LARGE).
54 */ 62 */
diff --git a/arch/tile/include/hv/pagesize.h b/arch/tile/include/hv/pagesize.h
deleted file mode 100644
index 58bed114fedd..000000000000
--- a/arch/tile/include/hv/pagesize.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15/**
16 * @file pagesize.h
17 */
18
19#ifndef _HV_PAGESIZE_H
20#define _HV_PAGESIZE_H
21
22/** The log2 of the size of small pages, in bytes. This value should
23 * be verified at runtime by calling hv_sysconf(HV_SYSCONF_PAGE_SIZE_SMALL).
24 */
25#define HV_LOG2_PAGE_SIZE_SMALL 16
26
27/** The log2 of the size of large pages, in bytes. This value should be
28 * verified at runtime by calling hv_sysconf(HV_SYSCONF_PAGE_SIZE_LARGE).
29 */
30#define HV_LOG2_PAGE_SIZE_LARGE 24
31
32#endif /* _HV_PAGESIZE_H */