wrsm_memseg_impl.h revision a83cadce5d3331b64803bfc641036cec23602c74
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _WRSM_MEMSEG_IMPL_H
#define _WRSM_MEMSEG_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* this file is included by the RSM memory segment module
*/
#ifndef _ASM
#include <sys/wrsm_common.h>
#include <sys/wrsm_cmmu.h>
#include <sys/wrsm_transport.h>
#include <sys/wrsm_intr.h>
#endif /* _ASM */
#ifdef __cplusplus
extern "C" {
#endif
#define WRSM_SMPUT_PACKETRING_SIZE 50
#define WRSM_LONG_SIZE (sizeof (long))
#define WRSM_LONG_SHIFT 3
#define WRSM_LONG_MASK (sizeof (long) - 1)
#ifndef _ASM
/*
* Hash for segid to iseginfo pointer mapping.
* Hash for segid to exportseg pointer mapping.
* Hash for segid to importset pointer mapping.
*
* Most likely the segid will be a low integer, so use lower bits
* of dev_t for hash index.
*/
#define WRSM_SEGID_HASH_SHIFT 0
#define WRSM_SEGID_HASH_MASK \
#define WRSM_SEGID_HASH_FUNC(r) \
/*
* choose some middle bits of the pointer for the hash index
*/
#define WRSM_PTR_HASH_SHIFT 7
#define WRSM_PTR_HASH_MASK \
#define WRSM_PTR_HASH_FUNC(r) \
typedef struct __rsm_memseg_export_handle exportseg_t;
typedef struct __rsm_memseg_import_handle importseg_t;
typedef struct iseginfo iseginfo_t;
/*
* list of cmmu entries, all one page size
*/
typedef struct cmmugrp {
unsigned num_tuples; /* number of cmmu tuples */
} cmmugrp_t;
typedef struct mseg_intr_page {
typedef struct barrier_page {
typedef struct mseg_node_export {
/*
* if hardware access protection is used, need to set up
* private cmmu entries for this node
*/
/* flags for cmmu_update_fields() function */
typedef enum {
#define CMMU_UPDATE_STR(a) \
(((a) == memseg_set_valid) ? "memseg_set_valid" : \
((a) == memseg_unset_valid) ? "memseg_unset_valid" : \
((a) == memseg_set_writeable) ? "memseg_set_writeable" : \
((a) == memseg_unset_writeable) ? "memseg_unset_writeable" : \
"unknown")
typedef enum {
memseg_unpublished, /* unpublished */
memseg_wait_for_disconnects, /* unpublishing */
memseg_published /* published */
/*
* an exportseg structure is create for each segment created with
* rsm_create_seg().
*/
struct __rsm_memseg_export_handle {
int num_pages; /* number of 8k pages in segment */
int total_tuples; /* total number of cmmu tuples */
int num_cmmugrps; /* # of cmmugrps */
};
typedef struct import_ncslice {
/*
* each connection to a segment is represented with an importseg structure
*/
struct __rsm_memseg_import_handle {
void *barrier_page; /* user as mapping of barrier page */
void *intr_page; /* user as mapping of interrupt page */
void *cesr_page; /* user as mapping of CESR regs */
void *reroute_page; /* user as mapping of reroutecounters */
};
/*
* if a connection is requested by a kernel RSMPI client, the following
* mappings are automatically set up
*/
typedef struct mseg_kmap {
} mseg_kmap_t;
typedef struct errorpage_t {
/*
* An iseginfo structure is created the first time a segment is imported
* from a remote node through rsm_import_connect_memseg(). It is destroyed
* after the last disconnect, when a session is torn down, or when the
* remote node removes this node's access to the segment.
*/
struct iseginfo {
int kernel_users; /* # kernel connections (imports) */
int errorpages; /* reserved error pages */
int last_transfer_error; /* reason transfer_errors incremented */
};
/*
* local node's RSMPI memory segment information (in network structure)
*/
struct wrsm_memseg {
int last_transfer_error; /* reason transfer_errors incremented */
/* published exportsegs */
};
/*
* remote node info
*/
typedef struct connect_info {
struct connect_info *next;
struct wrsm_node_memseg {
/* segments imported from node */
int last_transfer_error; /* reason transfer_errors incremented */
};
/*
* messages
*/
typedef struct connect_msg {
typedef struct connect_resp {
typedef struct smallputmap_msg {
typedef struct smallputmap_resp {
typedef struct barriermap_msg {
typedef struct barriermap_resp {
typedef struct segmap_msg {
} segmap_msg_t;
/ sizeof (import_ncslice_t))
typedef struct segmap_resp {
typedef struct disconnect_msg {
typedef struct unpublish_msg {
typedef struct unpublish_resp {
int status;
/* status values for unpublish_resp */
#define WC_DISCONNECTED 0x01
#define WC_CONNECTED 0x02
typedef struct access_msg {
} access_msg_t;
/* Support for plugin library for RSMAPI */
int
typedef struct smallput_header {
#define WRSM_SMALLPUT_BODY_SIZE (WRSM_TL_MSG_SIZE - \
sizeof (smallput_header_t))
typedef struct wrsm_smallput_msg {
#endif /* _ASM */
#ifdef __cplusplus
}
#endif
#endif /* _WRSM_MEMSEG_IMPL_H */