blob: 32c577b8d0dfbb588e470bd093bbffbd2894ec52 [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>
17
18/* >>> #include <gru/grukservices.h> */
19/* >>> uv_gpa() is defined in <gru/grukservices.h> */
20#define uv_gpa(_a) ((unsigned long)_a)
21
Dean Nelson94bd2702008-07-29 22:34:05 -070022#include "xpc.h"
23
Dean Nelson33ba3c72008-07-29 22:34:07 -070024static DECLARE_BITMAP(xpc_heartbeating_to_mask_uv, XP_MAX_NPARTITIONS_UV);
25
Dean Nelson94bd2702008-07-29 22:34:05 -070026static void *xpc_activate_mq;
27
Dean Nelson33ba3c72008-07-29 22:34:07 -070028static void
29xpc_IPI_send_local_activate_uv(struct xpc_partition *part)
30{
31 /*
32 * >>> make our side think that the remote parition sent an activate
33 * >>> message our way. Also do what the activate IRQ handler would
34 * >>> do had one really been sent.
35 */
36}
37
Dean Nelson94bd2702008-07-29 22:34:05 -070038static enum xp_retval
39xpc_rsvd_page_init_uv(struct xpc_rsvd_page *rp)
40{
41 /* >>> need to have established xpc_activate_mq earlier */
42 rp->sn.activate_mq_gpa = uv_gpa(xpc_activate_mq);
43 return xpSuccess;
44}
45
Dean Nelson33ba3c72008-07-29 22:34:07 -070046static void
47xpc_increment_heartbeat_uv(void)
48{
49 /* >>> send heartbeat msg to xpc_heartbeating_to_mask partids */
50}
51
52static void
53xpc_heartbeat_init_uv(void)
54{
55 bitmap_zero(xpc_heartbeating_to_mask_uv, XP_MAX_NPARTITIONS_UV);
56 xpc_heartbeating_to_mask = &xpc_heartbeating_to_mask_uv[0];
57}
58
59static void
60xpc_heartbeat_exit_uv(void)
61{
62 /* >>> send heartbeat_offline msg to xpc_heartbeating_to_mask partids */
63}
64
65static void
66xpc_initiate_partition_activation_uv(struct xpc_rsvd_page *remote_rp,
67 u64 remote_rp_pa, int nasid)
68{
69 short partid = remote_rp->SAL_partid;
70 struct xpc_partition *part = &xpc_partitions[partid];
71
72/*
73 * >>> setup part structure with the bits of info we can glean from the rp
74 * >>> part->remote_rp_pa = remote_rp_pa;
75 * >>> part->sn.uv.activate_mq_gpa = remote_rp->sn.activate_mq_gpa;
76 */
77
78 xpc_IPI_send_local_activate_uv(part);
79}
80
Dean Nelsone17d4162008-07-29 22:34:06 -070081/*
82 * Setup the infrastructure necessary to support XPartition Communication
83 * between the specified remote partition and the local one.
84 */
85static enum xp_retval
86xpc_setup_infrastructure_uv(struct xpc_partition *part)
87{
88 /* >>> this function needs fleshing out */
89 return xpUnsupported;
90}
91
92/*
93 * Teardown the infrastructure necessary to support XPartition Communication
94 * between the specified remote partition and the local one.
95 */
96static void
97xpc_teardown_infrastructure_uv(struct xpc_partition *part)
98{
99 /* >>> this function needs fleshing out */
100 return;
101}
102
103static enum xp_retval
104xpc_make_first_contact_uv(struct xpc_partition *part)
105{
106 /* >>> this function needs fleshing out */
107 return xpUnsupported;
108}
109
110static u64
111xpc_get_IPI_flags_uv(struct xpc_partition *part)
112{
113 /* >>> this function needs fleshing out */
114 return 0UL;
115}
116
117static struct xpc_msg *
118xpc_get_deliverable_msg_uv(struct xpc_channel *ch)
119{
120 /* >>> this function needs fleshing out */
121 return NULL;
122}
123
Dean Nelson94bd2702008-07-29 22:34:05 -0700124void
125xpc_init_uv(void)
126{
127 xpc_rsvd_page_init = xpc_rsvd_page_init_uv;
Dean Nelson33ba3c72008-07-29 22:34:07 -0700128 xpc_increment_heartbeat = xpc_increment_heartbeat_uv;
129 xpc_heartbeat_init = xpc_heartbeat_init_uv;
130 xpc_heartbeat_exit = xpc_heartbeat_exit_uv;
131 xpc_initiate_partition_activation =
132 xpc_initiate_partition_activation_uv;
Dean Nelsone17d4162008-07-29 22:34:06 -0700133 xpc_setup_infrastructure = xpc_setup_infrastructure_uv;
134 xpc_teardown_infrastructure = xpc_teardown_infrastructure_uv;
135 xpc_make_first_contact = xpc_make_first_contact_uv;
136 xpc_get_IPI_flags = xpc_get_IPI_flags_uv;
137 xpc_get_deliverable_msg = xpc_get_deliverable_msg_uv;
Dean Nelson94bd2702008-07-29 22:34:05 -0700138}
139
140void
141xpc_exit_uv(void)
142{
143}