]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/misc/sgi-xp/xpc.h
Merge branch 'for_rmk' of git://git.mnementh.co.uk/linux-2.6-im into devel
[linux-2.6-omap-h63xx.git] / drivers / misc / sgi-xp / xpc.h
index e194d3140f6806d78bd0f39d4cf42888fe5c1300..619208d618627692c8cbaec3e0448b1d15479577 100644 (file)
 #ifndef _DRIVERS_MISC_SGIXP_XPC_H
 #define _DRIVERS_MISC_SGIXP_XPC_H
 
-#include <linux/interrupt.h>
-#include <linux/sysctl.h>
-#include <linux/device.h>
-#include <linux/mutex.h>
+#include <linux/wait.h>
 #include <linux/completion.h>
-#include <asm/pgtable.h>
-#include <asm/processor.h>
-#include <asm/sn/clksupport.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/mspec.h>
-#include <asm/sn/shub_mmr.h>
+#include <linux/timer.h>
+#include <linux/sched.h>
 #include "xp.h"
 
 /*
@@ -98,8 +91,8 @@ struct xpc_rsvd_page {
        u8 version;
        u8 pad1[3];             /* align to next u64 in 1st 64-byte cacheline */
        union {
-               u64 vars_pa;    /* physical address of struct xpc_vars */
-               u64 activate_mq_gpa;    /* global phys address of activate_mq */
+               unsigned long vars_pa;  /* phys address of struct xpc_vars */
+               unsigned long activate_mq_gpa; /* gru phy addr of activate_mq */
        } sn;
        unsigned long ts_jiffies; /* timestamp when rsvd pg was setup by XPC */
        u64 pad2[10];           /* align to last u64 in 2nd 64-byte cacheline */
@@ -129,8 +122,8 @@ struct xpc_vars_sn2 {
        u64 heartbeat_offline;  /* if 0, heartbeat should be changing */
        int activate_IRQ_nasid;
        int activate_IRQ_phys_cpuid;
-       u64 vars_part_pa;
-       u64 amos_page_pa;       /* paddr of page of amos from MSPEC driver */
+       unsigned long vars_part_pa;
+       unsigned long amos_page_pa;/* paddr of page of amos from MSPEC driver */
        struct amo *amos_page;  /* vaddr of page of amos from MSPEC driver */
 };
 
@@ -149,10 +142,10 @@ struct xpc_vars_sn2 {
 struct xpc_vars_part_sn2 {
        u64 magic;
 
-       u64 openclose_args_pa;  /* physical address of open and close args */
-       u64 GPs_pa;             /* physical address of Get/Put values */
+       unsigned long openclose_args_pa; /* phys addr of open and close args */
+       unsigned long GPs_pa;   /* physical address of Get/Put values */
 
-       u64 chctl_amo_pa;       /* physical address of chctl flags' amo */
+       unsigned long chctl_amo_pa; /* physical address of chctl flags' amo */
 
        int notify_IRQ_nasid;   /* nasid of where to send notify IRQs */
        int notify_IRQ_phys_cpuid;      /* CPUID of where to send notify IRQs */
@@ -171,21 +164,96 @@ struct xpc_vars_part_sn2 {
  * MAGIC2 indicates that this partition has pulled the remote partititions
  * per partition variables that pertain to this partition.
  */
-#define XPC_VP_MAGIC1  0x0053524156435058L   /* 'XPCVARS\0'L (little endian) */
-#define XPC_VP_MAGIC2  0x0073726176435058L   /* 'XPCvars\0'L (little endian) */
+#define XPC_VP_MAGIC1_SN2 0x0053524156435058L /* 'XPCVARS\0'L (little endian) */
+#define XPC_VP_MAGIC2_SN2 0x0073726176435058L /* 'XPCvars\0'L (little endian) */
 
 /* the reserved page sizes and offsets */
 
 #define XPC_RP_HEADER_SIZE     L1_CACHE_ALIGN(sizeof(struct xpc_rsvd_page))
 #define XPC_RP_VARS_SIZE       L1_CACHE_ALIGN(sizeof(struct xpc_vars_sn2))
 
-#define XPC_RP_PART_NASIDS(_rp) ((u64 *)((u8 *)(_rp) + XPC_RP_HEADER_SIZE))
+#define XPC_RP_PART_NASIDS(_rp) ((unsigned long *)((u8 *)(_rp) + \
+                                XPC_RP_HEADER_SIZE))
 #define XPC_RP_MACH_NASIDS(_rp) (XPC_RP_PART_NASIDS(_rp) + \
                                 xpc_nasid_mask_nlongs)
 #define XPC_RP_VARS(_rp)       ((struct xpc_vars_sn2 *) \
                                 (XPC_RP_MACH_NASIDS(_rp) + \
                                  xpc_nasid_mask_nlongs))
 
+/*
+ * The activate_mq is used to send/receive GRU messages that affect XPC's
+ * heartbeat, partition active state, and channel state. This is UV only.
+ */
+struct xpc_activate_mq_msghdr_uv {
+       short partid;           /* sender's partid */
+       u8 act_state;           /* sender's act_state at time msg sent */
+       u8 type;                /* message's type */
+       unsigned long rp_ts_jiffies; /* timestamp of sender's rp setup by XPC */
+};
+
+/* activate_mq defined message types */
+#define XPC_ACTIVATE_MQ_MSG_SYNC_ACT_STATE_UV          0
+#define XPC_ACTIVATE_MQ_MSG_INC_HEARTBEAT_UV           1
+#define XPC_ACTIVATE_MQ_MSG_OFFLINE_HEARTBEAT_UV       2
+#define XPC_ACTIVATE_MQ_MSG_ONLINE_HEARTBEAT_UV                3
+
+#define XPC_ACTIVATE_MQ_MSG_ACTIVATE_REQ_UV            4
+#define XPC_ACTIVATE_MQ_MSG_DEACTIVATE_REQ_UV          5
+
+#define XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREQUEST_UV      6
+#define XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREPLY_UV                7
+#define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREQUEST_UV       8
+#define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREPLY_UV         9
+
+#define XPC_ACTIVATE_MQ_MSG_MARK_ENGAGED_UV            10
+#define XPC_ACTIVATE_MQ_MSG_MARK_DISENGAGED_UV         11
+
+struct xpc_activate_mq_msg_uv {
+       struct xpc_activate_mq_msghdr_uv hdr;
+};
+
+struct xpc_activate_mq_msg_heartbeat_req_uv {
+       struct xpc_activate_mq_msghdr_uv hdr;
+       u64 heartbeat;
+};
+
+struct xpc_activate_mq_msg_activate_req_uv {
+       struct xpc_activate_mq_msghdr_uv hdr;
+       unsigned long rp_gpa;
+       unsigned long activate_mq_gpa;
+};
+
+struct xpc_activate_mq_msg_deactivate_req_uv {
+       struct xpc_activate_mq_msghdr_uv hdr;
+       enum xp_retval reason;
+};
+
+struct xpc_activate_mq_msg_chctl_closerequest_uv {
+       struct xpc_activate_mq_msghdr_uv hdr;
+       short ch_number;
+       enum xp_retval reason;
+};
+
+struct xpc_activate_mq_msg_chctl_closereply_uv {
+       struct xpc_activate_mq_msghdr_uv hdr;
+       short ch_number;
+};
+
+struct xpc_activate_mq_msg_chctl_openrequest_uv {
+       struct xpc_activate_mq_msghdr_uv hdr;
+       short ch_number;
+       short entry_size;       /* size of notify_mq's GRU messages */
+       short local_nentries;   /* ??? Is this needed? What is? */
+};
+
+struct xpc_activate_mq_msg_chctl_openreply_uv {
+       struct xpc_activate_mq_msghdr_uv hdr;
+       short ch_number;
+       short remote_nentries;  /* ??? Is this needed? What is? */
+       short local_nentries;   /* ??? Is this needed? What is? */
+       unsigned long local_notify_mq_gpa;
+};
+
 /*
  * Functions registered by add_timer() or called by kernel_thread() only
  * allow for a single 64-bit argument. The following macros can be used to
@@ -202,13 +270,13 @@ struct xpc_vars_part_sn2 {
 /*
  * Define a Get/Put value pair (pointers) used with a message queue.
  */
-struct xpc_gp {
+struct xpc_gp_sn2 {
        s64 get;                /* Get value */
        s64 put;                /* Put value */
 };
 
 #define XPC_GP_SIZE \
-               L1_CACHE_ALIGN(sizeof(struct xpc_gp) * XPC_MAX_NCHANNELS)
+               L1_CACHE_ALIGN(sizeof(struct xpc_gp_sn2) * XPC_MAX_NCHANNELS)
 
 /*
  * Define a structure that contains arguments associated with opening and
@@ -216,32 +284,89 @@ struct xpc_gp {
  */
 struct xpc_openclose_args {
        u16 reason;             /* reason why channel is closing */
-       u16 msg_size;           /* sizeof each message entry */
+       u16 entry_size;         /* sizeof each message entry */
        u16 remote_nentries;    /* #of message entries in remote msg queue */
        u16 local_nentries;     /* #of message entries in local msg queue */
-       u64 local_msgqueue_pa;  /* physical address of local message queue */
+       unsigned long local_msgqueue_pa; /* phys addr of local message queue */
 };
 
 #define XPC_OPENCLOSE_ARGS_SIZE \
              L1_CACHE_ALIGN(sizeof(struct xpc_openclose_args) * \
              XPC_MAX_NCHANNELS)
 
-/* struct xpc_msg flags */
 
-#define        XPC_M_DONE              0x01    /* msg has been received/consumed */
-#define        XPC_M_READY             0x02    /* msg is ready to be sent */
-#define        XPC_M_INTERRUPT         0x04    /* send interrupt when msg consumed */
+/*
+ * Structures to define a fifo singly-linked list.
+ */
+
+struct xpc_fifo_entry_uv {
+       struct xpc_fifo_entry_uv *next;
+};
+
+struct xpc_fifo_head_uv {
+       struct xpc_fifo_entry_uv *first;
+       struct xpc_fifo_entry_uv *last;
+       spinlock_t lock;
+       int n_entries;
+};
+
+/*
+ * Define a sn2 styled message.
+ *
+ * A user-defined message resides in the payload area. The max size of the
+ * payload is defined by the user via xpc_connect().
+ *
+ * The size of a message entry (within a message queue) must be a 128-byte
+ * cacheline sized multiple in order to facilitate the BTE transfer of messages
+ * from one message queue to another.
+ */
+struct xpc_msg_sn2 {
+       u8 flags;               /* FOR XPC INTERNAL USE ONLY */
+       u8 reserved[7];         /* FOR XPC INTERNAL USE ONLY */
+       s64 number;             /* FOR XPC INTERNAL USE ONLY */
+
+       u64 payload;            /* user defined portion of message */
+};
+
+/* struct xpc_msg_sn2 flags */
 
-#define XPC_MSG_ADDRESS(_payload) \
-               ((struct xpc_msg *)((u8 *)(_payload) - XPC_MSG_PAYLOAD_OFFSET))
+#define        XPC_M_SN2_DONE          0x01    /* msg has been received/consumed */
+#define        XPC_M_SN2_READY         0x02    /* msg is ready to be sent */
+#define        XPC_M_SN2_INTERRUPT     0x04    /* send interrupt when msg consumed */
 
 /*
- * Defines notify entry.
+ * The format of a uv XPC notify_mq GRU message is as follows:
+ *
+ * A user-defined message resides in the payload area. The max size of the
+ * payload is defined by the user via xpc_connect().
+ *
+ * The size of a message (payload and header) sent via the GRU must be either 1
+ * or 2 GRU_CACHE_LINE_BYTES in length.
+ */
+
+struct xpc_notify_mq_msghdr_uv {
+       union {
+               unsigned int gru_msg_hdr;       /* FOR GRU INTERNAL USE ONLY */
+               struct xpc_fifo_entry_uv next;  /* FOR XPC INTERNAL USE ONLY */
+       } u;
+       short partid;           /* FOR XPC INTERNAL USE ONLY */
+       u8 ch_number;           /* FOR XPC INTERNAL USE ONLY */
+       u8 size;                /* FOR XPC INTERNAL USE ONLY */
+       unsigned int msg_slot_number;   /* FOR XPC INTERNAL USE ONLY */
+};
+
+struct xpc_notify_mq_msg_uv {
+       struct xpc_notify_mq_msghdr_uv hdr;
+       unsigned long payload;
+};
+
+/*
+ * Define sn2's notify entry.
  *
  * This is used to notify a message's sender that their message was received
  * and consumed by the intended recipient.
  */
-struct xpc_notify {
+struct xpc_notify_sn2 {
        u8 type;                /* type of notification */
 
        /* the following two fields are only used if type == XPC_N_CALL */
@@ -249,9 +374,20 @@ struct xpc_notify {
        void *key;              /* pointer to user's key */
 };
 
-/* struct xpc_notify type of notification */
+/* struct xpc_notify_sn2 type of notification */
+
+#define        XPC_N_CALL      0x01    /* notify function provided by user */
 
-#define        XPC_N_CALL              0x01    /* notify function provided by user */
+/*
+ * Define uv's version of the notify entry. It additionally is used to allocate
+ * a msg slot on the remote partition into which is copied a sent message.
+ */
+struct xpc_send_msg_slot_uv {
+       struct xpc_fifo_entry_uv next;
+       unsigned int msg_slot_number;
+       xpc_notify_func func;   /* user's notify function */
+       void *key;              /* pointer to user's key */
+};
 
 /*
  * Define the structure that manages all the stuff required by a channel. In
@@ -337,44 +473,55 @@ struct xpc_notify {
  */
 
 struct xpc_channel_sn2 {
+       struct xpc_openclose_args *local_openclose_args; /* args passed on */
+                                            /* opening or closing of channel */
+
+       void *local_msgqueue_base;      /* base address of kmalloc'd space */
+       struct xpc_msg_sn2 *local_msgqueue;     /* local message queue */
+       void *remote_msgqueue_base;     /* base address of kmalloc'd space */
+       struct xpc_msg_sn2 *remote_msgqueue; /* cached copy of remote */
+                                          /* partition's local message queue */
+       unsigned long remote_msgqueue_pa; /* phys addr of remote partition's */
+                                         /* local message queue */
+
+       struct xpc_notify_sn2 *notify_queue;/* notify queue for messages sent */
 
        /* various flavors of local and remote Get/Put values */
 
-       struct xpc_gp *local_GP;        /* local Get/Put values */
-       struct xpc_gp remote_GP;        /* remote Get/Put values */
-       struct xpc_gp w_local_GP;       /* working local Get/Put values */
-       struct xpc_gp w_remote_GP;      /* working remote Get/Put values */
+       struct xpc_gp_sn2 *local_GP;    /* local Get/Put values */
+       struct xpc_gp_sn2 remote_GP;    /* remote Get/Put values */
+       struct xpc_gp_sn2 w_local_GP;   /* working local Get/Put values */
+       struct xpc_gp_sn2 w_remote_GP;  /* working remote Get/Put values */
        s64 next_msg_to_pull;   /* Put value of next msg to pull */
 
        struct mutex msg_to_pull_mutex; /* next msg to pull serialization */
 };
 
 struct xpc_channel_uv {
-       /* !!! code is coming */
+       unsigned long remote_notify_mq_gpa;     /* gru phys address of remote */
+                                               /* partition's notify mq */
+
+       struct xpc_send_msg_slot_uv *send_msg_slots;
+       struct xpc_notify_mq_msg_uv *recv_msg_slots;
+
+       struct xpc_fifo_head_uv msg_slot_free_list;
+       struct xpc_fifo_head_uv recv_msg_list;  /* deliverable payloads */
 };
 
 struct xpc_channel {
        short partid;           /* ID of remote partition connected */
        spinlock_t lock;        /* lock for updating this structure */
-       u32 flags;              /* general flags */
+       unsigned int flags;     /* general flags */
 
        enum xp_retval reason;  /* reason why channel is disconnect'g */
        int reason_line;        /* line# disconnect initiated from */
 
        u16 number;             /* channel # */
 
-       u16 msg_size;           /* sizeof each msg entry */
+       u16 entry_size;         /* sizeof each msg entry */
        u16 local_nentries;     /* #of msg entries in local msg queue */
        u16 remote_nentries;    /* #of msg entries in remote msg queue */
 
-       void *local_msgqueue_base;      /* base address of kmalloc'd space */
-       struct xpc_msg *local_msgqueue; /* local message queue */
-       void *remote_msgqueue_base;     /* base address of kmalloc'd space */
-       struct xpc_msg *remote_msgqueue; /* cached copy of remote partition's */
-                                        /* local message queue */
-       u64 remote_msgqueue_pa; /* phys addr of remote partition's */
-                               /* local message queue */
-
        atomic_t references;    /* #of external references to queues */
 
        atomic_t n_on_msg_allocate_wq;  /* #on msg allocation wait queue */
@@ -383,19 +530,13 @@ struct xpc_channel {
        u8 delayed_chctl_flags; /* chctl flags received, but delayed */
                                /* action until channel disconnected */
 
-       /* queue of msg senders who want to be notified when msg received */
-
        atomic_t n_to_notify;   /* #of msg senders to notify */
-       struct xpc_notify *notify_queue;    /* notify queue for messages sent */
 
        xpc_channel_func func;  /* user's channel function */
        void *key;              /* pointer to user's key */
 
        struct completion wdisconnect_wait;    /* wait for channel disconnect */
 
-       struct xpc_openclose_args *local_openclose_args; /* args passed on */
-                                            /* opening or closing of channel */
-
        /* kthread management related fields */
 
        atomic_t kthreads_assigned;     /* #of kthreads assigned to channel */
@@ -497,23 +638,25 @@ xpc_any_msg_chctl_flags_set(union xpc_channel_ctl_flags *chctl)
  */
 
 struct xpc_partition_sn2 {
-       u64 remote_amos_page_pa;        /* phys addr of partition's amos page */
+       unsigned long remote_amos_page_pa; /* paddr of partition's amos page */
        int activate_IRQ_nasid; /* active partition's act/deact nasid */
        int activate_IRQ_phys_cpuid;    /* active part's act/deact phys cpuid */
 
-       u64 remote_vars_pa;     /* phys addr of partition's vars */
-       u64 remote_vars_part_pa;        /* phys addr of partition's vars part */
+       unsigned long remote_vars_pa;   /* phys addr of partition's vars */
+       unsigned long remote_vars_part_pa; /* paddr of partition's vars part */
        u8 remote_vars_version; /* version# of partition's vars */
 
        void *local_GPs_base;   /* base address of kmalloc'd space */
-       struct xpc_gp *local_GPs;       /* local Get/Put values */
+       struct xpc_gp_sn2 *local_GPs;   /* local Get/Put values */
        void *remote_GPs_base;  /* base address of kmalloc'd space */
-       struct xpc_gp *remote_GPs;      /* copy of remote partition's local */
+       struct xpc_gp_sn2 *remote_GPs;  /* copy of remote partition's local */
                                        /* Get/Put values */
-       u64 remote_GPs_pa;      /* phys address of remote partition's local */
-                               /* Get/Put values */
+       unsigned long remote_GPs_pa; /* phys addr of remote partition's local */
+                                    /* Get/Put values */
 
-       u64 remote_openclose_args_pa;   /* phys addr of remote's args */
+       void *local_openclose_args_base;   /* base address of kmalloc'd space */
+       struct xpc_openclose_args *local_openclose_args;      /* local's args */
+       unsigned long remote_openclose_args_pa; /* phys addr of remote's args */
 
        int notify_IRQ_nasid;   /* nasid of where to send notify IRQs */
        int notify_IRQ_phys_cpuid;      /* CPUID of where to send notify IRQs */
@@ -526,16 +669,34 @@ struct xpc_partition_sn2 {
 };
 
 struct xpc_partition_uv {
-       /* !!! code is coming */
+       unsigned long remote_activate_mq_gpa;   /* gru phys address of remote */
+                                               /* partition's activate mq */
+       spinlock_t flags_lock;  /* protect updating of flags */
+       unsigned int flags;     /* general flags */
+       u8 remote_act_state;    /* remote partition's act_state */
+       u8 act_state_req;       /* act_state request from remote partition */
+       enum xp_retval reason;  /* reason for deactivate act_state request */
+       u64 heartbeat;          /* incremented by remote partition */
 };
 
+/* struct xpc_partition_uv flags */
+
+#define XPC_P_HEARTBEAT_OFFLINE_UV     0x00000001
+#define XPC_P_ENGAGED_UV               0x00000002
+
+/* struct xpc_partition_uv act_state change requests */
+
+#define XPC_P_ASR_ACTIVATE_UV          0x01
+#define XPC_P_ASR_REACTIVATE_UV                0x02
+#define XPC_P_ASR_DEACTIVATE_UV                0x03
+
 struct xpc_partition {
 
        /* XPC HB infrastructure */
 
        u8 remote_rp_version;   /* version# of partition's rsvd pg */
        unsigned long remote_rp_ts_jiffies; /* timestamp when rsvd pg setup */
-       u64 remote_rp_pa;       /* phys addr of partition's rsvd pg */
+       unsigned long remote_rp_pa;     /* phys addr of partition's rsvd pg */
        u64 last_heartbeat;     /* HB at last read */
        u32 activate_IRQ_rcvd;  /* IRQs since activation */
        spinlock_t act_lock;    /* protect updating of act_state */
@@ -562,8 +723,6 @@ struct xpc_partition {
        union xpc_channel_ctl_flags chctl; /* chctl flags yet to be processed */
        spinlock_t chctl_lock;  /* chctl flags lock */
 
-       void *local_openclose_args_base;   /* base address of kmalloc'd space */
-       struct xpc_openclose_args *local_openclose_args;      /* local's args */
        void *remote_openclose_args_base;  /* base address of kmalloc'd space */
        struct xpc_openclose_args *remote_openclose_args; /* copy of remote's */
                                                          /* args */
@@ -582,21 +741,21 @@ struct xpc_partition {
 
 /* struct xpc_partition act_state values (for XPC HB) */
 
-#define        XPC_P_INACTIVE          0x00    /* partition is not active */
-#define XPC_P_ACTIVATION_REQ   0x01    /* created thread to activate */
-#define XPC_P_ACTIVATING       0x02    /* activation thread started */
-#define XPC_P_ACTIVE           0x03    /* xpc_partition_up() was called */
-#define XPC_P_DEACTIVATING     0x04    /* partition deactivation initiated */
+#define        XPC_P_AS_INACTIVE       0x00    /* partition is not active */
+#define XPC_P_AS_ACTIVATION_REQ        0x01    /* created thread to activate */
+#define XPC_P_AS_ACTIVATING    0x02    /* activation thread started */
+#define XPC_P_AS_ACTIVE                0x03    /* xpc_partition_up() was called */
+#define XPC_P_AS_DEACTIVATING  0x04    /* partition deactivation initiated */
 
 #define XPC_DEACTIVATE_PARTITION(_p, _reason) \
                        xpc_deactivate_partition(__LINE__, (_p), (_reason))
 
 /* struct xpc_partition setup_state values */
 
-#define XPC_P_UNSET            0x00    /* infrastructure was never setup */
-#define XPC_P_SETUP            0x01    /* infrastructure is setup */
-#define XPC_P_WTEARDOWN                0x02    /* waiting to teardown infrastructure */
-#define XPC_P_TORNDOWN         0x03    /* infrastructure is torndown */
+#define XPC_P_SS_UNSET         0x00    /* infrastructure was never setup */
+#define XPC_P_SS_SETUP         0x01    /* infrastructure is setup */
+#define XPC_P_SS_WTEARDOWN     0x02    /* waiting to teardown infrastructure */
+#define XPC_P_SS_TORNDOWN      0x03    /* infrastructure is torndown */
 
 /*
  * struct xpc_partition_sn2's dropped notify IRQ timer is set to wait the
@@ -622,37 +781,43 @@ extern struct device *xpc_part;
 extern struct device *xpc_chan;
 extern int xpc_disengage_timelimit;
 extern int xpc_disengage_timedout;
-extern atomic_t xpc_activate_IRQ_rcvd;
+extern int xpc_activate_IRQ_rcvd;
+extern spinlock_t xpc_activate_IRQ_rcvd_lock;
 extern wait_queue_head_t xpc_activate_IRQ_wq;
 extern void *xpc_heartbeating_to_mask;
+extern void *xpc_kzalloc_cacheline_aligned(size_t, gfp_t, void **);
 extern void xpc_activate_partition(struct xpc_partition *);
 extern void xpc_activate_kthreads(struct xpc_channel *, int);
 extern void xpc_create_kthreads(struct xpc_channel *, int, int);
 extern void xpc_disconnect_wait(int);
-extern enum xp_retval (*xpc_rsvd_page_init) (struct xpc_rsvd_page *);
+extern int (*xpc_setup_partitions_sn) (void);
+extern enum xp_retval (*xpc_get_partition_rsvd_page_pa) (void *, u64 *,
+                                                        unsigned long *,
+                                                        size_t *);
+extern int (*xpc_setup_rsvd_page_sn) (struct xpc_rsvd_page *);
 extern void (*xpc_heartbeat_init) (void);
 extern void (*xpc_heartbeat_exit) (void);
 extern void (*xpc_increment_heartbeat) (void);
 extern void (*xpc_offline_heartbeat) (void);
 extern void (*xpc_online_heartbeat) (void);
-extern void (*xpc_check_remote_hb) (void);
+extern enum xp_retval (*xpc_get_remote_heartbeat) (struct xpc_partition *);
 extern enum xp_retval (*xpc_make_first_contact) (struct xpc_partition *);
 extern u64 (*xpc_get_chctl_all_flags) (struct xpc_partition *);
-extern enum xp_retval (*xpc_allocate_msgqueues) (struct xpc_channel *);
-extern void (*xpc_free_msgqueues) (struct xpc_channel *);
+extern enum xp_retval (*xpc_setup_msg_structures) (struct xpc_channel *);
+extern void (*xpc_teardown_msg_structures) (struct xpc_channel *);
 extern void (*xpc_notify_senders_of_disconnect) (struct xpc_channel *);
 extern void (*xpc_process_msg_chctl_flags) (struct xpc_partition *, int);
-extern int (*xpc_n_of_deliverable_msgs) (struct xpc_channel *);
-extern struct xpc_msg *(*xpc_get_deliverable_msg) (struct xpc_channel *);
-extern void (*xpc_request_partition_activation) (struct xpc_rsvd_page *, u64,
-                                                int);
+extern int (*xpc_n_of_deliverable_payloads) (struct xpc_channel *);
+extern void *(*xpc_get_deliverable_payload) (struct xpc_channel *);
+extern void (*xpc_request_partition_activation) (struct xpc_rsvd_page *,
+                                                unsigned long, int);
 extern void (*xpc_request_partition_reactivation) (struct xpc_partition *);
 extern void (*xpc_request_partition_deactivation) (struct xpc_partition *);
 extern void (*xpc_cancel_partition_deactivation_request) (
                                                        struct xpc_partition *);
-extern void (*xpc_process_activate_IRQ_rcvd) (int);
-extern enum xp_retval (*xpc_setup_infrastructure) (struct xpc_partition *);
-extern void (*xpc_teardown_infrastructure) (struct xpc_partition *);
+extern void (*xpc_process_activate_IRQ_rcvd) (void);
+extern enum xp_retval (*xpc_setup_ch_structures_sn) (struct xpc_partition *);
+extern void (*xpc_teardown_ch_structures_sn) (struct xpc_partition *);
 
 extern void (*xpc_indicate_partition_engaged) (struct xpc_partition *);
 extern int (*xpc_partition_engaged) (short);
@@ -668,16 +833,19 @@ extern void (*xpc_send_chctl_openrequest) (struct xpc_channel *,
                                           unsigned long *);
 extern void (*xpc_send_chctl_openreply) (struct xpc_channel *, unsigned long *);
 
-extern enum xp_retval (*xpc_send_msg) (struct xpc_channel *, u32, void *, u16,
-                                      u8, xpc_notify_func, void *);
-extern void (*xpc_received_msg) (struct xpc_channel *, struct xpc_msg *);
+extern void (*xpc_save_remote_msgqueue_pa) (struct xpc_channel *,
+                                           unsigned long);
+
+extern enum xp_retval (*xpc_send_payload) (struct xpc_channel *, u32, void *,
+                                          u16, u8, xpc_notify_func, void *);
+extern void (*xpc_received_payload) (struct xpc_channel *, void *);
 
 /* found in xpc_sn2.c */
 extern int xpc_init_sn2(void);
 extern void xpc_exit_sn2(void);
 
 /* found in xpc_uv.c */
-extern void xpc_init_uv(void);
+extern int xpc_init_uv(void);
 extern void xpc_exit_uv(void);
 
 /* found in xpc_partition.c */
@@ -687,14 +855,16 @@ extern struct xpc_rsvd_page *xpc_rsvd_page;
 extern unsigned long *xpc_mach_nasids;
 extern struct xpc_partition *xpc_partitions;
 extern void *xpc_kmalloc_cacheline_aligned(size_t, gfp_t, void **);
-extern struct xpc_rsvd_page *xpc_setup_rsvd_page(void);
+extern int xpc_setup_rsvd_page(void);
+extern void xpc_teardown_rsvd_page(void);
 extern int xpc_identify_activate_IRQ_sender(void);
 extern int xpc_partition_disengaged(struct xpc_partition *);
 extern enum xp_retval xpc_mark_partition_active(struct xpc_partition *);
 extern void xpc_mark_partition_inactive(struct xpc_partition *);
 extern void xpc_discovery(void);
 extern enum xp_retval xpc_get_remote_rp(int, unsigned long *,
-                                       struct xpc_rsvd_page *, u64 *);
+                                       struct xpc_rsvd_page *,
+                                       unsigned long *);
 extern void xpc_deactivate_partition(const int, struct xpc_partition *,
                                     enum xp_retval);
 extern enum xp_retval xpc_initiate_partid_to_nasids(short, void *);
@@ -709,7 +879,7 @@ extern enum xp_retval xpc_initiate_send_notify(short, int, u32, void *, u16,
 extern void xpc_initiate_received(short, int, void *);
 extern void xpc_process_sent_chctl_flags(struct xpc_partition *);
 extern void xpc_connected_callout(struct xpc_channel *);
-extern void xpc_deliver_msg(struct xpc_channel *);
+extern void xpc_deliver_payload(struct xpc_channel *);
 extern void xpc_disconnect_channel(const int, struct xpc_channel *,
                                   enum xp_retval, unsigned long *);
 extern void xpc_disconnect_callout(struct xpc_channel *, enum xp_retval);
@@ -789,7 +959,7 @@ xpc_part_deref(struct xpc_partition *part)
        s32 refs = atomic_dec_return(&part->references);
 
        DBUG_ON(refs < 0);
-       if (refs == 0 && part->setup_state == XPC_P_WTEARDOWN)
+       if (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN)
                wake_up(&part->teardown_wq);
 }
 
@@ -799,7 +969,7 @@ xpc_part_ref(struct xpc_partition *part)
        int setup;
 
        atomic_inc(&part->references);
-       setup = (part->setup_state == XPC_P_SETUP);
+       setup = (part->setup_state == XPC_P_SS_SETUP);
        if (!setup)
                xpc_part_deref(part);