diff options
author | Jes Sorensen <jes@trained-monkey.org> | 2005-06-21 20:15:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 21:46:18 -0400 |
commit | 65ed0b337bd2b47097cf6c772f024772513b7b0d (patch) | |
tree | ade82d2bd373d5f98f84a53f7afc5cec7323e742 | |
parent | f14f75b81187cdbe10cc53a521bf9fdf97b59f8c (diff) |
[PATCH] SN2 XPC build patches
This patch contains the bits to make the XPC code use the uncached
allocator rather than calling into the mspec driver. It also includes the
mspec.h header which is required to build the XPC modules.
Signed-off-by: Jes Sorensen <jes@wildopensource.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/ia64/Kconfig | 2 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/xpc_partition.c | 6 | ||||
-rw-r--r-- | include/asm-ia64/sn/mspec.h | 59 |
3 files changed, 64 insertions, 3 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 295b5abee72f..34e603cc1716 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -227,7 +227,7 @@ config IA64_SGI_SN_SIM | |||
227 | 227 | ||
228 | config IA64_SGI_SN_XP | 228 | config IA64_SGI_SN_XP |
229 | tristate "Support communication between SGI SSIs" | 229 | tristate "Support communication between SGI SSIs" |
230 | depends on MSPEC | 230 | select IA64_UNCACHED_ALLOCATOR |
231 | help | 231 | help |
232 | An SGI machine can be divided into multiple Single System | 232 | An SGI machine can be divided into multiple Single System |
233 | Images which act independently of each other and have | 233 | Images which act independently of each other and have |
diff --git a/arch/ia64/sn/kernel/xpc_partition.c b/arch/ia64/sn/kernel/xpc_partition.c index 2c3c4a8af553..cd7ed73f0e7a 100644 --- a/arch/ia64/sn/kernel/xpc_partition.c +++ b/arch/ia64/sn/kernel/xpc_partition.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/cache.h> | 22 | #include <linux/cache.h> |
23 | #include <linux/mmzone.h> | 23 | #include <linux/mmzone.h> |
24 | #include <linux/nodemask.h> | 24 | #include <linux/nodemask.h> |
25 | #include <asm/uncached.h> | ||
25 | #include <asm/sn/bte.h> | 26 | #include <asm/sn/bte.h> |
26 | #include <asm/sn/intr.h> | 27 | #include <asm/sn/intr.h> |
27 | #include <asm/sn/sn_sal.h> | 28 | #include <asm/sn/sn_sal.h> |
@@ -183,7 +184,7 @@ xpc_rsvd_page_init(void) | |||
183 | * memory protections are never restricted. | 184 | * memory protections are never restricted. |
184 | */ | 185 | */ |
185 | if ((amos_page = xpc_vars->amos_page) == NULL) { | 186 | if ((amos_page = xpc_vars->amos_page) == NULL) { |
186 | amos_page = (AMO_t *) mspec_kalloc_page(0); | 187 | amos_page = (AMO_t *) TO_AMO(uncached_alloc_page(0)); |
187 | if (amos_page == NULL) { | 188 | if (amos_page == NULL) { |
188 | dev_err(xpc_part, "can't allocate page of AMOs\n"); | 189 | dev_err(xpc_part, "can't allocate page of AMOs\n"); |
189 | return NULL; | 190 | return NULL; |
@@ -200,7 +201,8 @@ xpc_rsvd_page_init(void) | |||
200 | if (ret != 0) { | 201 | if (ret != 0) { |
201 | dev_err(xpc_part, "can't change memory " | 202 | dev_err(xpc_part, "can't change memory " |
202 | "protections\n"); | 203 | "protections\n"); |
203 | mspec_kfree_page((unsigned long) amos_page); | 204 | uncached_free_page(__IA64_UNCACHED_OFFSET | |
205 | TO_PHYS((u64) amos_page)); | ||
204 | return NULL; | 206 | return NULL; |
205 | } | 207 | } |
206 | } | 208 | } |
diff --git a/include/asm-ia64/sn/mspec.h b/include/asm-ia64/sn/mspec.h new file mode 100644 index 000000000000..dbe13c6121a8 --- /dev/null +++ b/include/asm-ia64/sn/mspec.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * | ||
3 | * This file is subject to the terms and conditions of the GNU General Public | ||
4 | * License. See the file "COPYING" in the main directory of this archive | ||
5 | * for more details. | ||
6 | * | ||
7 | * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved. | ||
8 | */ | ||
9 | |||
10 | #ifndef _ASM_IA64_SN_MSPEC_H | ||
11 | #define _ASM_IA64_SN_MSPEC_H | ||
12 | |||
13 | #define FETCHOP_VAR_SIZE 64 /* 64 byte per fetchop variable */ | ||
14 | |||
15 | #define FETCHOP_LOAD 0 | ||
16 | #define FETCHOP_INCREMENT 8 | ||
17 | #define FETCHOP_DECREMENT 16 | ||
18 | #define FETCHOP_CLEAR 24 | ||
19 | |||
20 | #define FETCHOP_STORE 0 | ||
21 | #define FETCHOP_AND 24 | ||
22 | #define FETCHOP_OR 32 | ||
23 | |||
24 | #define FETCHOP_CLEAR_CACHE 56 | ||
25 | |||
26 | #define FETCHOP_LOAD_OP(addr, op) ( \ | ||
27 | *(volatile long *)((char*) (addr) + (op))) | ||
28 | |||
29 | #define FETCHOP_STORE_OP(addr, op, x) ( \ | ||
30 | *(volatile long *)((char*) (addr) + (op)) = (long) (x)) | ||
31 | |||
32 | #ifdef __KERNEL__ | ||
33 | |||
34 | /* | ||
35 | * Each Atomic Memory Operation (AMO formerly known as fetchop) | ||
36 | * variable is 64 bytes long. The first 8 bytes are used. The | ||
37 | * remaining 56 bytes are unaddressable due to the operation taking | ||
38 | * that portion of the address. | ||
39 | * | ||
40 | * NOTE: The AMO_t _MUST_ be placed in either the first or second half | ||
41 | * of the cache line. The cache line _MUST NOT_ be used for anything | ||
42 | * other than additional AMO_t entries. This is because there are two | ||
43 | * addresses which reference the same physical cache line. One will | ||
44 | * be a cached entry with the memory type bits all set. This address | ||
45 | * may be loaded into processor cache. The AMO_t will be referenced | ||
46 | * uncached via the memory special memory type. If any portion of the | ||
47 | * cached cache-line is modified, when that line is flushed, it will | ||
48 | * overwrite the uncached value in physical memory and lead to | ||
49 | * inconsistency. | ||
50 | */ | ||
51 | typedef struct { | ||
52 | u64 variable; | ||
53 | u64 unused[7]; | ||
54 | } AMO_t; | ||
55 | |||
56 | |||
57 | #endif /* __KERNEL__ */ | ||
58 | |||
59 | #endif /* _ASM_IA64_SN_MSPEC_H */ | ||