blob: c2d4ddd6e9558ecc1a5aaf2818e9503b7b184bf6 [file] [log] [blame]
Dean Nelson94bd2702008-07-29 22:34:05 -07001/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
7 */
8
9/*
10 * Cross Partition Communication (XPC) uv-based functions.
11 *
12 * Architecture specific implementation of common functions.
13 *
14 */
15
16#include <linux/kernel.h>
Dean Nelson261f3b42008-07-29 22:34:16 -070017#include <asm/uv/uv_hub.h>
18#include "../sgi-gru/grukservices.h"
Dean Nelson94bd2702008-07-29 22:34:05 -070019#include "xpc.h"
20
Dean Nelson33ba3c72008-07-29 22:34:07 -070021static DECLARE_BITMAP(xpc_heartbeating_to_mask_uv, XP_MAX_NPARTITIONS_UV);
22
Dean Nelson94bd2702008-07-29 22:34:05 -070023static void *xpc_activate_mq;
24
Dean Nelson33ba3c72008-07-29 22:34:07 -070025static void
Dean Nelson7fb5e592008-07-29 22:34:10 -070026xpc_send_local_activate_IRQ_uv(struct xpc_partition *part)
Dean Nelson33ba3c72008-07-29 22:34:07 -070027{
28 /*
Dean Nelsonea57f802008-07-29 22:34:14 -070029 * !!! Make our side think that the remote parition sent an activate
30 * !!! message our way. Also do what the activate IRQ handler would
31 * !!! do had one really been sent.
Dean Nelson33ba3c72008-07-29 22:34:07 -070032 */
33}
34
Dean Nelson94bd2702008-07-29 22:34:05 -070035static enum xp_retval
36xpc_rsvd_page_init_uv(struct xpc_rsvd_page *rp)
37{
Dean Nelsonea57f802008-07-29 22:34:14 -070038 /* !!! need to have established xpc_activate_mq earlier */
Dean Nelson94bd2702008-07-29 22:34:05 -070039 rp->sn.activate_mq_gpa = uv_gpa(xpc_activate_mq);
40 return xpSuccess;
41}
42
Dean Nelson33ba3c72008-07-29 22:34:07 -070043static void
44xpc_increment_heartbeat_uv(void)
45{
Dean Nelsonea57f802008-07-29 22:34:14 -070046 /* !!! send heartbeat msg to xpc_heartbeating_to_mask partids */
Dean Nelson33ba3c72008-07-29 22:34:07 -070047}
48
49static void
50xpc_heartbeat_init_uv(void)
51{
52 bitmap_zero(xpc_heartbeating_to_mask_uv, XP_MAX_NPARTITIONS_UV);
53 xpc_heartbeating_to_mask = &xpc_heartbeating_to_mask_uv[0];
54}
55
56static void
57xpc_heartbeat_exit_uv(void)
58{
Dean Nelsonea57f802008-07-29 22:34:14 -070059 /* !!! send heartbeat_offline msg to xpc_heartbeating_to_mask partids */
Dean Nelson33ba3c72008-07-29 22:34:07 -070060}
61
62static void
Dean Nelsona47d5da2008-07-29 22:34:09 -070063xpc_request_partition_activation_uv(struct xpc_rsvd_page *remote_rp,
Dean Nelsona812dcc2008-07-29 22:34:16 -070064 unsigned long remote_rp_pa, int nasid)
Dean Nelson33ba3c72008-07-29 22:34:07 -070065{
66 short partid = remote_rp->SAL_partid;
67 struct xpc_partition *part = &xpc_partitions[partid];
68
69/*
Dean Nelsonea57f802008-07-29 22:34:14 -070070 * !!! Setup part structure with the bits of info we can glean from the rp:
71 * !!! part->remote_rp_pa = remote_rp_pa;
72 * !!! part->sn.uv.activate_mq_gpa = remote_rp->sn.activate_mq_gpa;
Dean Nelson33ba3c72008-07-29 22:34:07 -070073 */
74
Dean Nelson7fb5e592008-07-29 22:34:10 -070075 xpc_send_local_activate_IRQ_uv(part);
Dean Nelson33ba3c72008-07-29 22:34:07 -070076}
77
Dean Nelsona47d5da2008-07-29 22:34:09 -070078static void
79xpc_request_partition_reactivation_uv(struct xpc_partition *part)
80{
Dean Nelson7fb5e592008-07-29 22:34:10 -070081 xpc_send_local_activate_IRQ_uv(part);
Dean Nelsona47d5da2008-07-29 22:34:09 -070082}
83
Dean Nelsone17d4162008-07-29 22:34:06 -070084/*
85 * Setup the infrastructure necessary to support XPartition Communication
86 * between the specified remote partition and the local one.
87 */
88static enum xp_retval
89xpc_setup_infrastructure_uv(struct xpc_partition *part)
90{
Dean Nelsonea57f802008-07-29 22:34:14 -070091 /* !!! this function needs fleshing out */
Dean Nelsone17d4162008-07-29 22:34:06 -070092 return xpUnsupported;
93}
94
95/*
96 * Teardown the infrastructure necessary to support XPartition Communication
97 * between the specified remote partition and the local one.
98 */
99static void
100xpc_teardown_infrastructure_uv(struct xpc_partition *part)
101{
Dean Nelsonea57f802008-07-29 22:34:14 -0700102 /* !!! this function needs fleshing out */
Dean Nelsone17d4162008-07-29 22:34:06 -0700103 return;
104}
105
106static enum xp_retval
107xpc_make_first_contact_uv(struct xpc_partition *part)
108{
Dean Nelsonea57f802008-07-29 22:34:14 -0700109 /* !!! this function needs fleshing out */
Dean Nelsone17d4162008-07-29 22:34:06 -0700110 return xpUnsupported;
111}
112
113static u64
Dean Nelson7fb5e592008-07-29 22:34:10 -0700114xpc_get_chctl_all_flags_uv(struct xpc_partition *part)
Dean Nelsone17d4162008-07-29 22:34:06 -0700115{
Dean Nelsonea57f802008-07-29 22:34:14 -0700116 /* !!! this function needs fleshing out */
Dean Nelsone17d4162008-07-29 22:34:06 -0700117 return 0UL;
118}
119
120static struct xpc_msg *
121xpc_get_deliverable_msg_uv(struct xpc_channel *ch)
122{
Dean Nelsonea57f802008-07-29 22:34:14 -0700123 /* !!! this function needs fleshing out */
Dean Nelsone17d4162008-07-29 22:34:06 -0700124 return NULL;
125}
126
Dean Nelson94bd2702008-07-29 22:34:05 -0700127void
128xpc_init_uv(void)
129{
130 xpc_rsvd_page_init = xpc_rsvd_page_init_uv;
Dean Nelson33ba3c72008-07-29 22:34:07 -0700131 xpc_increment_heartbeat = xpc_increment_heartbeat_uv;
132 xpc_heartbeat_init = xpc_heartbeat_init_uv;
133 xpc_heartbeat_exit = xpc_heartbeat_exit_uv;
Dean Nelsona47d5da2008-07-29 22:34:09 -0700134 xpc_request_partition_activation = xpc_request_partition_activation_uv;
135 xpc_request_partition_reactivation =
136 xpc_request_partition_reactivation_uv;
Dean Nelsone17d4162008-07-29 22:34:06 -0700137 xpc_setup_infrastructure = xpc_setup_infrastructure_uv;
138 xpc_teardown_infrastructure = xpc_teardown_infrastructure_uv;
139 xpc_make_first_contact = xpc_make_first_contact_uv;
Dean Nelson7fb5e592008-07-29 22:34:10 -0700140 xpc_get_chctl_all_flags = xpc_get_chctl_all_flags_uv;
Dean Nelsone17d4162008-07-29 22:34:06 -0700141 xpc_get_deliverable_msg = xpc_get_deliverable_msg_uv;
Dean Nelson94bd2702008-07-29 22:34:05 -0700142}
143
144void
145xpc_exit_uv(void)
146{
147}