7139 Sync mDNS with mDNSResponder-625.41.2
[unleashed.git] / usr / src / man / man3rsm / rsm_memseg_import_map.3rsm
blobb4ad5f22155ff64443858fd8d9939e01866ae8ef
1 '\" te
2 .\"  Copyright (c) 2002 by Sun Microsystems, Inc.  All rights reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" 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]
6 .TH RSM_MEMSEG_IMPORT_MAP 3RSM "Nov 13, 2002"
7 .SH NAME
8 rsm_memseg_import_map, rsm_memseg_import_unmap \- map or unmap imported segment
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag\fR... ] \fIfile\fR... -lrsm [ \fIlibrary\fR... ]
13 #include <rsmapi.h>
15 \fBint\fR \fBrsm_memseg_import_map\fR(\fBrsm_memseg_import_handle_t\fR \fIim_memseg\fR,
16      \fBvoid **\fR\fIaddress\fR, \fBrsm_attribute_t\fR \fIattr\fR,
17      \fBrsm_permission_t\fR \fIperm\fR, \fBoff_t\fR \fIoffset\fR, \fBsize_t\fR \fIlength\fR);
18 .fi
20 .LP
21 .nf
22 \fBint\fR \fBrsm_memseg_import_unmap\fR(\fBrsm_memseg_import_handle_t\fR \fIim_memseg\fR);
23 .fi
25 .SH DESCRIPTION
26 .sp
27 .LP
28 The \fBrsm_memseg_import_map()\fR and \fBrsm_memseg_import_unmap()\fR functions
29 provide for mapping and unmapping operations on imported segments. The mapping
30 operations are only available for native architecture interconnects such as
31 Dolphin-SCI or Sun Fire Link. Mapping a segment allows that segment to be
32 accessed by CPU memory operations, saving the overhead of calling the memory
33 access primitives described on the \fBrsm_memseg_import_get\fR(3RSM) and
34 \fBrsm_memseg_import_put\fR(3RSM) manual pages.
35 .sp
36 .LP
37 The \fBrsm_memseg_import_map()\fR function maps an import segment into caller's
38 address space for the segment to be accessed by CPU memory operations.  The
39 \fIim_memseg\fR argument represents the import segment that is being mapped.
40 The location where the process's address space is mapped to the segment is
41 pointed to by the  \fIaddress\fR argument. The \fIattr\fR argiment can be one
42 fo the following:
43 .sp
44 .ne 2
45 .na
46 \fB\fBRSM_MAP_NONE\fR \fR
47 .ad
48 .RS 18n
49 The system will choose available virtual address to map and return its value in
50 the \fIaddress\fR argument.
51 .RE
53 .sp
54 .ne 2
55 .na
56 \fB\fBRSM_MAP_FIXED\fR \fR
57 .ad
58 .RS 18n
59 The import segment should be mapped at the requested virtual address specified
60 in the  \fIaddress\fR argument.
61 .RE
63 .sp
64 .LP
65 The \fIperm\fR argument determines whether read, write or a combination of
66 accesses are permitted to the data being mapped. It can be either
67 \fBRSM_PERM_READ\fR, \fBRSM_PERM_WRITE\fR, or \fBRSM_PERM_RDWR\fR.
68 .sp
69 .LP
70 The \fIoffset\fR argument is the byte offset location from the base of the
71 segment being mapped to \fIaddress\fR. The \fIlength\fR argument indicates the
72 number of bytes from offset to be mapped.
73 .sp
74 .LP
75 The \fBrsm_memseg_import_unmap()\fR function unmaps a previously mapped import
76 segment.
77 .SH RETURN VALUES
78 .sp
79 .LP
80 Upon successful completion, these functions return 0. Otherwise, an error value
81 is returned to indicate the error.
82 .SH ERRORS
83 .sp
84 .LP
85 The \fBrsm_memseg_import_map()\fR and \fBrsm_memseg_import_unmap()\fR functions
86 can return the following errors:
87 .sp
88 .ne 2
89 .na
90 \fB\fBRSMERR_BAD_SEG_HNDL\fR \fR
91 .ad
92 .RS 24n
93 Invalid segment handle.
94 .RE
96 .sp
97 .LP
98 The \fBrsm_memseg_import_map()\fR function can return the following errors:
99 .sp
100 .ne 2
102 \fB\fBRSMERR_BAD_ADDR\fR \fR
104 .RS 30n
105 Invalid address.
109 .ne 2
111 \fB\fBRSMERR_BAD_LENGTH\fR \fR
113 .RS 30n
114 Invalid length.
118 .ne 2
120 \fB\fBRSMERR_BAD_MEM_ALIGNMENT\fR\fR
122 .RS 30n
123 The address is not aligned on a page boundary.
127 .ne 2
129 \fB\fBRSMERR_BAD_OFFSET\fR \fR
131 .RS 30n
132 Invalid offset.
136 .ne 2
138 \fB\fBRSMERR_BAD_PERMS\fR \fR
140 .RS 30n
141 Invalid permissions.
145 .ne 2
147 \fB\fBRSMERR_CONN_ABORTED\fR \fR
149 .RS 30n
150 Connection aborted.
154 .ne 2
156 \fB\fBRSMERR_MAP_FAILED\fR \fR
158 .RS 30n
159 Map failure.
163 .ne 2
165 \fB\fBRSMERR_SEG_ALREADY_MAPPED\fR \fR
167 .RS 30n
168 Segment already mapped.
172 .ne 2
174 \fB\fBRSMERR_SEG_NOT_CONNECTED\fR \fR
176 .RS 30n
177 Segment not connected.
180 .SH ATTRIBUTES
183 See \fBattributes\fR(5) for descriptions of the following attributes:
188 box;
189 c | c
190 l | l .
191 ATTRIBUTE TYPE  ATTRIBUTE VALUE
193 Interface Stability     Evolving
195 MT-Level        MT-Safe
198 .SH SEE ALSO
201 \fBrsm_memseg_import_connect\fR(3RSM), \fBrsm_memseg_import_get\fR(3RSM),
202 \fBrsm_memseg_import_put\fR(3RSM), \fBrsm_memseg_get_pollfd\fR(3RSM),
203 \fBattributes\fR(5)