aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xp.h
diff options
context:
space:
mode:
authorDean Nelson <dcn@sgi.com>2008-07-30 01:34:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-30 12:41:49 -0400
commitbc63d387e4f5dbbe4ea0c5ade862c38073fd7fa3 (patch)
treeebeb9a381224a935fc50697902fcc38b9df47d90 /drivers/misc/sgi-xp/xp.h
parent78ce1bbe446e9b46dcd6c1e60a4768448a8ce355 (diff)
sgi-xp: support runtime selection of xp_max_npartitions
Support runtime selection of the max number of partitions based on the hardware being run on. Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp/xp.h')
-rw-r--r--drivers/misc/sgi-xp/xp.h53
1 files changed, 35 insertions, 18 deletions
diff --git a/drivers/misc/sgi-xp/xp.h b/drivers/misc/sgi-xp/xp.h
index 867fb4863d5a..51087e111887 100644
--- a/drivers/misc/sgi-xp/xp.h
+++ b/drivers/misc/sgi-xp/xp.h
@@ -18,6 +18,9 @@
18#include <linux/mutex.h> 18#include <linux/mutex.h>
19#include <asm/sn/types.h> 19#include <asm/sn/types.h>
20#include <asm/sn/bte.h> 20#include <asm/sn/bte.h>
21#ifdef CONFIG_IA64
22#include <asm/sn/arch.h>
23#endif
21 24
22/* >>> Add this #define to some linux header file some day. */ 25/* >>> Add this #define to some linux header file some day. */
23#define BYTES_PER_WORD sizeof(void *) 26#define BYTES_PER_WORD sizeof(void *)
@@ -45,17 +48,18 @@
45#endif 48#endif
46 49
47/* 50/*
48 * Define the maximum number of logically defined partitions the system 51 * Define the maximum number of partitions the system can possibly support.
49 * can support. It is constrained by the maximum number of hardware 52 * It is based on the maximum number of hardware partitionable regions. The
50 * partitionable regions. The term 'region' in this context refers to the 53 * term 'region' in this context refers to the minimum number of nodes that
51 * minimum number of nodes that can comprise an access protection grouping. 54 * can comprise an access protection grouping. The access protection is in
52 * The access protection is in regards to memory, IPI and IOI. 55 * regards to memory, IPI and IOI.
53 * 56 *
54 * The maximum number of hardware partitionable regions is equal to the 57 * The maximum number of hardware partitionable regions is equal to the
55 * maximum number of nodes in the entire system divided by the minimum number 58 * maximum number of nodes in the entire system divided by the minimum number
56 * of nodes that comprise an access protection grouping. 59 * of nodes that comprise an access protection grouping.
57 */ 60 */
58#define XP_MAX_PARTITIONS 64 61#define XP_MAX_NPARTITIONS_SN2 64
62#define XP_MAX_NPARTITIONS_UV 256
59 63
60/* 64/*
61 * Define the number of u64s required to represent all the C-brick nasids 65 * Define the number of u64s required to represent all the C-brick nasids
@@ -112,24 +116,28 @@ xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification)
112 * other partition that is currently up. Over these channels, kernel-level 116 * other partition that is currently up. Over these channels, kernel-level
113 * `users' can communicate with their counterparts on the other partitions. 117 * `users' can communicate with their counterparts on the other partitions.
114 * 118 *
115 * The maxinum number of channels is limited to eight. For performance reasons, 119>>> The following described limitation of a max of eight channels possible
116 * the internal cross partition structures require sixteen bytes per channel, 120>>> pertains only to ia64-sn2. THIS ISN'T TRUE SINCE I'M PLANNING TO JUST
117 * and eight allows all of this interface-shared info to fit in one cache line. 121>>> TIE INTO THE EXISTING MECHANISM ONCE THE CHANNEL MESSAGES ARE RECEIVED.
122>>> THE 128-BYTE CACHELINE PERFORMANCE ISSUE IS TIED TO IA64-SN2.
118 * 123 *
119 * XPC_NCHANNELS reflects the total number of channels currently defined.
120 * If the need for additional channels arises, one can simply increase 124 * If the need for additional channels arises, one can simply increase
121 * XPC_NCHANNELS accordingly. If the day should come where that number 125 * XPC_MAX_NCHANNELS accordingly. If the day should come where that number
122 * exceeds the MAXIMUM number of channels allowed (eight), then one will need 126 * exceeds the absolute MAXIMUM number of channels possible (eight), then one
123 * to make changes to the XPC code to allow for this. 127 * will need to make changes to the XPC code to accommodate for this.
128 *
129 * The absolute maximum number of channels possible is currently limited to
130 * eight for performance reasons. The internal cross partition structures
131 * require sixteen bytes per channel, and eight allows all of this
132 * interface-shared info to fit in one 128-byte cacheline.
124 */ 133 */
125#define XPC_MEM_CHANNEL 0 /* memory channel number */ 134#define XPC_MEM_CHANNEL 0 /* memory channel number */
126#define XPC_NET_CHANNEL 1 /* network channel number */ 135#define XPC_NET_CHANNEL 1 /* network channel number */
127 136
128#define XPC_NCHANNELS 2 /* #of defined channels */ 137#define XPC_MAX_NCHANNELS 2 /* max #of channels allowed */
129#define XPC_MAX_NCHANNELS 8 /* max #of channels allowed */
130 138
131#if XPC_NCHANNELS > XPC_MAX_NCHANNELS 139#if XPC_MAX_NCHANNELS > 8
132#error XPC_NCHANNELS exceeds MAXIMUM allowed. 140#error XPC_MAX_NCHANNELS exceeds absolute MAXIMUM possible.
133#endif 141#endif
134 142
135/* 143/*
@@ -254,7 +262,8 @@ enum xp_retval {
254 xpBteCopyError, /* 52: bte_copy() returned error */ 262 xpBteCopyError, /* 52: bte_copy() returned error */
255 xpSalError, /* 53: sn SAL error */ 263 xpSalError, /* 53: sn SAL error */
256 264
257 xpUnknownReason /* 54: unknown reason - must be last in enum */ 265 xpUnsupported, /* 54: unsupported functionality or resource */
266 xpUnknownReason /* 55: unknown reason - must be last in enum */
258}; 267};
259 268
260/* 269/*
@@ -397,8 +406,16 @@ xpc_partid_to_nasids(short partid, void *nasids)
397 return xpc_interface.partid_to_nasids(partid, nasids); 406 return xpc_interface.partid_to_nasids(partid, nasids);
398} 407}
399 408
409extern short xp_max_npartitions;
410
400extern u64 xp_nofault_PIOR_target; 411extern u64 xp_nofault_PIOR_target;
401extern int xp_nofault_PIOR(void *); 412extern int xp_nofault_PIOR(void *);
402extern int xp_error_PIOR(void); 413extern int xp_error_PIOR(void);
403 414
415extern struct device *xp;
416extern enum xp_retval xp_init_sn2(void);
417extern enum xp_retval xp_init_uv(void);
418extern void xp_exit_sn2(void);
419extern void xp_exit_uv(void);
420
404#endif /* _DRIVERS_MISC_SGIXP_XP_H */ 421#endif /* _DRIVERS_MISC_SGIXP_XP_H */