xref: /openbmc/linux/drivers/misc/sgi-xp/xp.h (revision 1c004004)
145d9ca49SDean Nelson /*
245d9ca49SDean Nelson  * This file is subject to the terms and conditions of the GNU General Public
345d9ca49SDean Nelson  * License.  See the file "COPYING" in the main directory of this archive
445d9ca49SDean Nelson  * for more details.
545d9ca49SDean Nelson  *
645d9ca49SDean Nelson  * Copyright (C) 2004-2008 Silicon Graphics, Inc. All rights reserved.
745d9ca49SDean Nelson  */
845d9ca49SDean Nelson 
945d9ca49SDean Nelson /*
1045d9ca49SDean Nelson  * External Cross Partition (XP) structures and defines.
1145d9ca49SDean Nelson  */
1245d9ca49SDean Nelson 
1345d9ca49SDean Nelson #ifndef _DRIVERS_MISC_SGIXP_XP_H
1445d9ca49SDean Nelson #define _DRIVERS_MISC_SGIXP_XP_H
1545d9ca49SDean Nelson 
1645d9ca49SDean Nelson #include <linux/mutex.h>
1745d9ca49SDean Nelson 
181c004004SDean Nelson #if defined CONFIG_X86_UV || defined CONFIG_IA64_SGI_UV
195b221278SIngo Molnar #include <asm/uv/uv.h>
201c004004SDean Nelson #define is_uv()		is_uv_system()
211c004004SDean Nelson #endif
225b221278SIngo Molnar 
231c004004SDean Nelson #ifndef is_uv
241c004004SDean Nelson #define is_uv()		0
251c004004SDean Nelson #endif
261c004004SDean Nelson 
271c004004SDean Nelson #if defined CONFIG_IA64
28261f3b49SDean Nelson #include <asm/system.h>
29261f3b49SDean Nelson #include <asm/sn/arch.h>	/* defines is_shub1() and is_shub2() */
30261f3b49SDean Nelson #define is_shub()	ia64_platform_is("sn2")
3145d9ca49SDean Nelson #endif
3245d9ca49SDean Nelson 
33355c54d2SDean Nelson #ifndef is_shub1
34355c54d2SDean Nelson #define is_shub1()	0
35355c54d2SDean Nelson #endif
36355c54d2SDean Nelson 
37355c54d2SDean Nelson #ifndef is_shub2
38355c54d2SDean Nelson #define is_shub2()	0
39355c54d2SDean Nelson #endif
40355c54d2SDean Nelson 
41355c54d2SDean Nelson #ifndef is_shub
42261f3b49SDean Nelson #define is_shub()	0
43355c54d2SDean Nelson #endif
44355c54d2SDean Nelson 
45261f3b49SDean Nelson #ifdef USE_DBUG_ON
46261f3b49SDean Nelson #define DBUG_ON(condition)	BUG_ON(condition)
47261f3b49SDean Nelson #else
48261f3b49SDean Nelson #define DBUG_ON(condition)
49261f3b49SDean Nelson #endif
50261f3b49SDean Nelson 
5145d9ca49SDean Nelson /*
52bc63d387SDean Nelson  * Define the maximum number of partitions the system can possibly support.
53bc63d387SDean Nelson  * It is based on the maximum number of hardware partitionable regions. The
54bc63d387SDean Nelson  * term 'region' in this context refers to the minimum number of nodes that
55bc63d387SDean Nelson  * can comprise an access protection grouping. The access protection is in
56bc63d387SDean Nelson  * regards to memory, IPI and IOI.
5745d9ca49SDean Nelson  *
5845d9ca49SDean Nelson  * The maximum number of hardware partitionable regions is equal to the
5945d9ca49SDean Nelson  * maximum number of nodes in the entire system divided by the minimum number
6045d9ca49SDean Nelson  * of nodes that comprise an access protection grouping.
6145d9ca49SDean Nelson  */
62bc63d387SDean Nelson #define XP_MAX_NPARTITIONS_SN2	64
63bc63d387SDean Nelson #define XP_MAX_NPARTITIONS_UV	256
6445d9ca49SDean Nelson 
6545d9ca49SDean Nelson /*
6645d9ca49SDean Nelson  * XPC establishes channel connections between the local partition and any
6745d9ca49SDean Nelson  * other partition that is currently up. Over these channels, kernel-level
6845d9ca49SDean Nelson  * `users' can communicate with their counterparts on the other partitions.
6945d9ca49SDean Nelson  *
7045d9ca49SDean Nelson  * If the need for additional channels arises, one can simply increase
71bc63d387SDean Nelson  * XPC_MAX_NCHANNELS accordingly. If the day should come where that number
72bc63d387SDean Nelson  * exceeds the absolute MAXIMUM number of channels possible (eight), then one
73bc63d387SDean Nelson  * will need to make changes to the XPC code to accommodate for this.
74bc63d387SDean Nelson  *
75ea57f80cSDean Nelson  * The absolute maximum number of channels possible is limited to eight for
76ea57f80cSDean Nelson  * performance reasons on sn2 hardware. The internal cross partition structures
77bc63d387SDean Nelson  * require sixteen bytes per channel, and eight allows all of this
78bc63d387SDean Nelson  * interface-shared info to fit in one 128-byte cacheline.
7945d9ca49SDean Nelson  */
8045d9ca49SDean Nelson #define XPC_MEM_CHANNEL		0	/* memory channel number */
8145d9ca49SDean Nelson #define	XPC_NET_CHANNEL		1	/* network channel number */
8245d9ca49SDean Nelson 
83bc63d387SDean Nelson #define XPC_MAX_NCHANNELS	2	/* max #of channels allowed */
8445d9ca49SDean Nelson 
85bc63d387SDean Nelson #if XPC_MAX_NCHANNELS > 8
86bc63d387SDean Nelson #error	XPC_MAX_NCHANNELS exceeds absolute MAXIMUM possible.
8745d9ca49SDean Nelson #endif
8845d9ca49SDean Nelson 
8945d9ca49SDean Nelson /*
90bd3e64c1SDean Nelson  * Define macro, XPC_MSG_SIZE(), is provided for the user
9145d9ca49SDean Nelson  * that wants to fit as many msg entries as possible in a given memory size
9245d9ca49SDean Nelson  * (e.g. a memory page).
9345d9ca49SDean Nelson  */
94bd3e64c1SDean Nelson #define XPC_MSG_MAX_SIZE	128
95bd3e64c1SDean Nelson #define XPC_MSG_HDR_MAX_SIZE	16
96bd3e64c1SDean Nelson #define XPC_MSG_PAYLOAD_MAX_SIZE (XPC_MSG_MAX_SIZE - XPC_MSG_HDR_MAX_SIZE)
9745d9ca49SDean Nelson 
9845d9ca49SDean Nelson #define XPC_MSG_SIZE(_payload_size) \
99bd3e64c1SDean Nelson 				ALIGN(XPC_MSG_HDR_MAX_SIZE + (_payload_size), \
100bd3e64c1SDean Nelson 				      is_uv() ? 64 : 128)
101bd3e64c1SDean Nelson 
10245d9ca49SDean Nelson 
10345d9ca49SDean Nelson /*
10445d9ca49SDean Nelson  * Define the return values and values passed to user's callout functions.
10545d9ca49SDean Nelson  * (It is important to add new value codes at the end just preceding
10665c17b80SDean Nelson  * xpUnknownReason, which must have the highest numerical value.)
10745d9ca49SDean Nelson  */
10865c17b80SDean Nelson enum xp_retval {
10965c17b80SDean Nelson 	xpSuccess = 0,
11045d9ca49SDean Nelson 
11165c17b80SDean Nelson 	xpNotConnected,		/*  1: channel is not connected */
11265c17b80SDean Nelson 	xpConnected,		/*  2: channel connected (opened) */
11365c17b80SDean Nelson 	xpRETIRED1,		/*  3: (formerly xpDisconnected) */
11445d9ca49SDean Nelson 
11565c17b80SDean Nelson 	xpMsgReceived,		/*  4: message received */
11665c17b80SDean Nelson 	xpMsgDelivered,		/*  5: message delivered and acknowledged */
11745d9ca49SDean Nelson 
11865c17b80SDean Nelson 	xpRETIRED2,		/*  6: (formerly xpTransferFailed) */
11945d9ca49SDean Nelson 
12065c17b80SDean Nelson 	xpNoWait,		/*  7: operation would require wait */
12165c17b80SDean Nelson 	xpRetry,		/*  8: retry operation */
12265c17b80SDean Nelson 	xpTimeout,		/*  9: timeout in xpc_allocate_msg_wait() */
12365c17b80SDean Nelson 	xpInterrupted,		/* 10: interrupted wait */
12445d9ca49SDean Nelson 
12565c17b80SDean Nelson 	xpUnequalMsgSizes,	/* 11: message size disparity between sides */
12665c17b80SDean Nelson 	xpInvalidAddress,	/* 12: invalid address */
12745d9ca49SDean Nelson 
12865c17b80SDean Nelson 	xpNoMemory,		/* 13: no memory available for XPC structures */
12965c17b80SDean Nelson 	xpLackOfResources,	/* 14: insufficient resources for operation */
13065c17b80SDean Nelson 	xpUnregistered,		/* 15: channel is not registered */
13165c17b80SDean Nelson 	xpAlreadyRegistered,	/* 16: channel is already registered */
13245d9ca49SDean Nelson 
13365c17b80SDean Nelson 	xpPartitionDown,	/* 17: remote partition is down */
13465c17b80SDean Nelson 	xpNotLoaded,		/* 18: XPC module is not loaded */
13565c17b80SDean Nelson 	xpUnloading,		/* 19: this side is unloading XPC module */
13645d9ca49SDean Nelson 
13765c17b80SDean Nelson 	xpBadMagic,		/* 20: XPC MAGIC string not found */
13845d9ca49SDean Nelson 
13965c17b80SDean Nelson 	xpReactivating,		/* 21: remote partition was reactivated */
14045d9ca49SDean Nelson 
14165c17b80SDean Nelson 	xpUnregistering,	/* 22: this side is unregistering channel */
14265c17b80SDean Nelson 	xpOtherUnregistering,	/* 23: other side is unregistering channel */
14345d9ca49SDean Nelson 
14465c17b80SDean Nelson 	xpCloneKThread,		/* 24: cloning kernel thread */
14565c17b80SDean Nelson 	xpCloneKThreadFailed,	/* 25: cloning kernel thread failed */
14645d9ca49SDean Nelson 
14765c17b80SDean Nelson 	xpNoHeartbeat,		/* 26: remote partition has no heartbeat */
14845d9ca49SDean Nelson 
14965c17b80SDean Nelson 	xpPioReadError,		/* 27: PIO read error */
15065c17b80SDean Nelson 	xpPhysAddrRegFailed,	/* 28: registration of phys addr range failed */
15145d9ca49SDean Nelson 
15265c17b80SDean Nelson 	xpRETIRED3,		/* 29: (formerly xpBteDirectoryError) */
15365c17b80SDean Nelson 	xpRETIRED4,		/* 30: (formerly xpBtePoisonError) */
15465c17b80SDean Nelson 	xpRETIRED5,		/* 31: (formerly xpBteWriteError) */
15565c17b80SDean Nelson 	xpRETIRED6,		/* 32: (formerly xpBteAccessError) */
15665c17b80SDean Nelson 	xpRETIRED7,		/* 33: (formerly xpBtePWriteError) */
15765c17b80SDean Nelson 	xpRETIRED8,		/* 34: (formerly xpBtePReadError) */
15865c17b80SDean Nelson 	xpRETIRED9,		/* 35: (formerly xpBteTimeOutError) */
15965c17b80SDean Nelson 	xpRETIRED10,		/* 36: (formerly xpBteXtalkError) */
16065c17b80SDean Nelson 	xpRETIRED11,		/* 37: (formerly xpBteNotAvailable) */
16165c17b80SDean Nelson 	xpRETIRED12,		/* 38: (formerly xpBteUnmappedError) */
16245d9ca49SDean Nelson 
16365c17b80SDean Nelson 	xpBadVersion,		/* 39: bad version number */
16465c17b80SDean Nelson 	xpVarsNotSet,		/* 40: the XPC variables are not set up */
16565c17b80SDean Nelson 	xpNoRsvdPageAddr,	/* 41: unable to get rsvd page's phys addr */
16665c17b80SDean Nelson 	xpInvalidPartid,	/* 42: invalid partition ID */
16765c17b80SDean Nelson 	xpLocalPartid,		/* 43: local partition ID */
16845d9ca49SDean Nelson 
16965c17b80SDean Nelson 	xpOtherGoingDown,	/* 44: other side going down, reason unknown */
17065c17b80SDean Nelson 	xpSystemGoingDown,	/* 45: system is going down, reason unknown */
17165c17b80SDean Nelson 	xpSystemHalt,		/* 46: system is being halted */
17265c17b80SDean Nelson 	xpSystemReboot,		/* 47: system is being rebooted */
17365c17b80SDean Nelson 	xpSystemPoweroff,	/* 48: system is being powered off */
17445d9ca49SDean Nelson 
17565c17b80SDean Nelson 	xpDisconnecting,	/* 49: channel disconnecting (closing) */
17645d9ca49SDean Nelson 
17765c17b80SDean Nelson 	xpOpenCloseError,	/* 50: channel open/close protocol error */
17845d9ca49SDean Nelson 
17965c17b80SDean Nelson 	xpDisconnected,		/* 51: channel disconnected (closed) */
18045d9ca49SDean Nelson 
18165c17b80SDean Nelson 	xpBteCopyError,		/* 52: bte_copy() returned error */
182da970525SDean Nelson 	xpSalError,		/* 53: sn SAL error */
18394bd2708SDean Nelson 	xpRsvdPageNotSet,	/* 54: the reserved page is not set up */
18497bf1aa1SDean Nelson 	xpPayloadTooBig,	/* 55: payload too large for message slot */
18545d9ca49SDean Nelson 
18697bf1aa1SDean Nelson 	xpUnsupported,		/* 56: unsupported functionality or resource */
187261f3b49SDean Nelson 	xpNeedMoreInfo,		/* 57: more info is needed by SAL */
188261f3b49SDean Nelson 
189a812dcc3SDean Nelson 	xpGruCopyError,		/* 58: gru_copy_gru() returned error */
1905b8669dfSDean Nelson 	xpGruSendMqError,	/* 59: gru send message queue related error */
191a812dcc3SDean Nelson 
192bd3e64c1SDean Nelson 	xpBadChannelNumber,	/* 60: invalid channel number */
1936c1c325dSDean Nelson 	xpBadMsgType,		/* 61: invalid message type */
1946c1c325dSDean Nelson 	xpBiosError,		/* 62: BIOS error */
195bd3e64c1SDean Nelson 
1966c1c325dSDean Nelson 	xpUnknownReason		/* 63: unknown reason - must be last in enum */
19745d9ca49SDean Nelson };
19845d9ca49SDean Nelson 
19945d9ca49SDean Nelson /*
20065c17b80SDean Nelson  * Define the callout function type used by XPC to update the user on
20165c17b80SDean Nelson  * connection activity and state changes via the user function registered
20265c17b80SDean Nelson  * by xpc_connect().
20345d9ca49SDean Nelson  *
20445d9ca49SDean Nelson  * Arguments:
20545d9ca49SDean Nelson  *
20665c17b80SDean Nelson  *	reason - reason code.
20745d9ca49SDean Nelson  *	partid - partition ID associated with condition.
20845d9ca49SDean Nelson  *	ch_number - channel # associated with condition.
20965c17b80SDean Nelson  *	data - pointer to optional data.
21045d9ca49SDean Nelson  *	key - pointer to optional user-defined value provided as the "key"
21165c17b80SDean Nelson  *	      argument to xpc_connect().
21245d9ca49SDean Nelson  *
21365c17b80SDean Nelson  * A reason code of xpConnected indicates that a connection has been
21465c17b80SDean Nelson  * established to the specified partition on the specified channel. The data
21565c17b80SDean Nelson  * argument indicates the max number of entries allowed in the message queue.
21645d9ca49SDean Nelson  *
21765c17b80SDean Nelson  * A reason code of xpMsgReceived indicates that a XPC message arrived from
21865c17b80SDean Nelson  * the specified partition on the specified channel. The data argument
21965c17b80SDean Nelson  * specifies the address of the message's payload. The user must call
22065c17b80SDean Nelson  * xpc_received() when finished with the payload.
22145d9ca49SDean Nelson  *
22265c17b80SDean Nelson  * All other reason codes indicate failure. The data argmument is NULL.
22365c17b80SDean Nelson  * When a failure reason code is received, one can assume that the channel
22465c17b80SDean Nelson  * is not connected.
22545d9ca49SDean Nelson  */
22664d032baSDean Nelson typedef void (*xpc_channel_func) (enum xp_retval reason, short partid,
22745d9ca49SDean Nelson 				  int ch_number, void *data, void *key);
22845d9ca49SDean Nelson 
22965c17b80SDean Nelson /*
23065c17b80SDean Nelson  * Define the callout function type used by XPC to notify the user of
23165c17b80SDean Nelson  * messages received and delivered via the user function registered by
23265c17b80SDean Nelson  * xpc_send_notify().
23365c17b80SDean Nelson  *
23465c17b80SDean Nelson  * Arguments:
23565c17b80SDean Nelson  *
23665c17b80SDean Nelson  *	reason - reason code.
23765c17b80SDean Nelson  *	partid - partition ID associated with condition.
23865c17b80SDean Nelson  *	ch_number - channel # associated with condition.
23965c17b80SDean Nelson  *	key - pointer to optional user-defined value provided as the "key"
24065c17b80SDean Nelson  *	      argument to xpc_send_notify().
24165c17b80SDean Nelson  *
24265c17b80SDean Nelson  * A reason code of xpMsgDelivered indicates that the message was delivered
24365c17b80SDean Nelson  * to the intended recipient and that they have acknowledged its receipt by
24465c17b80SDean Nelson  * calling xpc_received().
24565c17b80SDean Nelson  *
24665c17b80SDean Nelson  * All other reason codes indicate failure.
247bd3e64c1SDean Nelson  *
248bd3e64c1SDean Nelson  * NOTE: The user defined function must be callable by an interrupt handler
249bd3e64c1SDean Nelson  *       and thus cannot block.
25065c17b80SDean Nelson  */
25164d032baSDean Nelson typedef void (*xpc_notify_func) (enum xp_retval reason, short partid,
25245d9ca49SDean Nelson 				 int ch_number, void *key);
25345d9ca49SDean Nelson 
25445d9ca49SDean Nelson /*
25545d9ca49SDean Nelson  * The following is a registration entry. There is a global array of these,
25645d9ca49SDean Nelson  * one per channel. It is used to record the connection registration made
25745d9ca49SDean Nelson  * by the users of XPC. As long as a registration entry exists, for any
25845d9ca49SDean Nelson  * partition that comes up, XPC will attempt to establish a connection on
25945d9ca49SDean Nelson  * that channel. Notification that a connection has been made will occur via
26045d9ca49SDean Nelson  * the xpc_channel_func function.
26145d9ca49SDean Nelson  *
26245d9ca49SDean Nelson  * The 'func' field points to the function to call when aynchronous
26345d9ca49SDean Nelson  * notification is required for such events as: a connection established/lost,
26445d9ca49SDean Nelson  * or an incoming message received, or an error condition encountered. A
26545d9ca49SDean Nelson  * non-NULL 'func' field indicates that there is an active registration for
26645d9ca49SDean Nelson  * the channel.
26745d9ca49SDean Nelson  */
26845d9ca49SDean Nelson struct xpc_registration {
26945d9ca49SDean Nelson 	struct mutex mutex;
27045d9ca49SDean Nelson 	xpc_channel_func func;	/* function to call */
27145d9ca49SDean Nelson 	void *key;		/* pointer to user's key */
27245d9ca49SDean Nelson 	u16 nentries;		/* #of msg entries in local msg queue */
273bd3e64c1SDean Nelson 	u16 entry_size;		/* message queue's message entry size */
27445d9ca49SDean Nelson 	u32 assigned_limit;	/* limit on #of assigned kthreads */
27545d9ca49SDean Nelson 	u32 idle_limit;		/* limit on #of idle kthreads */
27645d9ca49SDean Nelson } ____cacheline_aligned;
27745d9ca49SDean Nelson 
27845d9ca49SDean Nelson #define XPC_CHANNEL_REGISTERED(_c)	(xpc_registrations[_c].func != NULL)
27945d9ca49SDean Nelson 
28097bf1aa1SDean Nelson /* the following are valid xpc_send() or xpc_send_notify() flags */
28145d9ca49SDean Nelson #define XPC_WAIT	0	/* wait flag */
28245d9ca49SDean Nelson #define XPC_NOWAIT	1	/* no wait flag */
28345d9ca49SDean Nelson 
28445d9ca49SDean Nelson struct xpc_interface {
28545d9ca49SDean Nelson 	void (*connect) (int);
28645d9ca49SDean Nelson 	void (*disconnect) (int);
28797bf1aa1SDean Nelson 	enum xp_retval (*send) (short, int, u32, void *, u16);
28897bf1aa1SDean Nelson 	enum xp_retval (*send_notify) (short, int, u32, void *, u16,
28945d9ca49SDean Nelson 					xpc_notify_func, void *);
29064d032baSDean Nelson 	void (*received) (short, int, void *);
29164d032baSDean Nelson 	enum xp_retval (*partid_to_nasids) (short, void *);
29245d9ca49SDean Nelson };
29345d9ca49SDean Nelson 
29445d9ca49SDean Nelson extern struct xpc_interface xpc_interface;
29545d9ca49SDean Nelson 
29645d9ca49SDean Nelson extern void xpc_set_interface(void (*)(int),
29745d9ca49SDean Nelson 			      void (*)(int),
29897bf1aa1SDean Nelson 			      enum xp_retval (*)(short, int, u32, void *, u16),
29997bf1aa1SDean Nelson 			      enum xp_retval (*)(short, int, u32, void *, u16,
3004a3ad2ddSDean Nelson 						 xpc_notify_func, void *),
30164d032baSDean Nelson 			      void (*)(short, int, void *),
30264d032baSDean Nelson 			      enum xp_retval (*)(short, void *));
30345d9ca49SDean Nelson extern void xpc_clear_interface(void);
30445d9ca49SDean Nelson 
30565c17b80SDean Nelson extern enum xp_retval xpc_connect(int, xpc_channel_func, void *, u16,
30645d9ca49SDean Nelson 				   u16, u32, u32);
30745d9ca49SDean Nelson extern void xpc_disconnect(int);
30845d9ca49SDean Nelson 
30965c17b80SDean Nelson static inline enum xp_retval
31097bf1aa1SDean Nelson xpc_send(short partid, int ch_number, u32 flags, void *payload,
31197bf1aa1SDean Nelson 	 u16 payload_size)
31245d9ca49SDean Nelson {
31397bf1aa1SDean Nelson 	return xpc_interface.send(partid, ch_number, flags, payload,
31497bf1aa1SDean Nelson 				  payload_size);
31545d9ca49SDean Nelson }
31645d9ca49SDean Nelson 
31765c17b80SDean Nelson static inline enum xp_retval
31897bf1aa1SDean Nelson xpc_send_notify(short partid, int ch_number, u32 flags, void *payload,
31997bf1aa1SDean Nelson 		u16 payload_size, xpc_notify_func func, void *key)
32045d9ca49SDean Nelson {
32197bf1aa1SDean Nelson 	return xpc_interface.send_notify(partid, ch_number, flags, payload,
32297bf1aa1SDean Nelson 					 payload_size, func, key);
32345d9ca49SDean Nelson }
32445d9ca49SDean Nelson 
32545d9ca49SDean Nelson static inline void
32664d032baSDean Nelson xpc_received(short partid, int ch_number, void *payload)
32745d9ca49SDean Nelson {
32845d9ca49SDean Nelson 	return xpc_interface.received(partid, ch_number, payload);
32945d9ca49SDean Nelson }
33045d9ca49SDean Nelson 
33165c17b80SDean Nelson static inline enum xp_retval
33264d032baSDean Nelson xpc_partid_to_nasids(short partid, void *nasids)
33345d9ca49SDean Nelson {
33445d9ca49SDean Nelson 	return xpc_interface.partid_to_nasids(partid, nasids);
33545d9ca49SDean Nelson }
33645d9ca49SDean Nelson 
337bc63d387SDean Nelson extern short xp_max_npartitions;
338261f3b49SDean Nelson extern short xp_partition_id;
339261f3b49SDean Nelson extern u8 xp_region_size;
340bc63d387SDean Nelson 
341a812dcc3SDean Nelson extern unsigned long (*xp_pa) (void *);
342a812dcc3SDean Nelson extern enum xp_retval (*xp_remote_memcpy) (unsigned long, const unsigned long,
343a812dcc3SDean Nelson 		       size_t);
344261f3b49SDean Nelson extern int (*xp_cpu_to_nasid) (int);
3456c1c325dSDean Nelson extern enum xp_retval (*xp_expand_memprotect) (unsigned long, unsigned long);
3466c1c325dSDean Nelson extern enum xp_retval (*xp_restrict_memprotect) (unsigned long, unsigned long);
347908787dbSDean Nelson 
34845d9ca49SDean Nelson extern u64 xp_nofault_PIOR_target;
34945d9ca49SDean Nelson extern int xp_nofault_PIOR(void *);
35045d9ca49SDean Nelson extern int xp_error_PIOR(void);
35145d9ca49SDean Nelson 
352bc63d387SDean Nelson extern struct device *xp;
353bc63d387SDean Nelson extern enum xp_retval xp_init_sn2(void);
354bc63d387SDean Nelson extern enum xp_retval xp_init_uv(void);
355bc63d387SDean Nelson extern void xp_exit_sn2(void);
356bc63d387SDean Nelson extern void xp_exit_uv(void);
357bc63d387SDean Nelson 
35845d9ca49SDean Nelson #endif /* _DRIVERS_MISC_SGIXP_XP_H */
359