Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/shm.h
+++ new/usr/src/uts/common/sys/shm.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 24 * Copyright 2016 Joyent, Inc.
25 25 *
26 26 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
27 27 * Use is subject to license terms.
28 28 */
29 29
30 30 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
31 31 /* All Rights Reserved */
32 32
33 33 /*
34 34 * Portions of this source code were derived from Berkeley 4.3 BSD
35 35 * under license from the Regents of the University of California.
36 36 */
37 37
38 38 #ifndef _SYS_SHM_H
39 39 #define _SYS_SHM_H
40 40
41 41 #include <sys/ipc.h>
42 42
43 43 #ifdef __cplusplus
44 44 extern "C" {
45 45 #endif
46 46
47 47 /*
48 48 * IPC Shared Memory Facility.
49 49 */
50 50
51 51 /*
52 52 * Implementation Constants.
53 53 */
54 54 #if (defined(_KERNEL) || defined(_KMEMUSER))
55 55
56 56 #define SHMLBA PAGESIZE /* segment low boundary address multiple */
57 57 /* (SHMLBA must be a power of 2) */
58 58 #else
59 59 #include <sys/unistd.h> /* needed for _SC_PAGESIZE */
60 60 extern long _sysconf(int); /* System Private interface to sysconf() */
61 61 #define SHMLBA (_sysconf(_SC_PAGESIZE))
62 62 #endif /* defined(_KERNEL) || defined(_KMEMUSER)) */
63 63
64 64 /*
65 65 * Permission Definitions.
66 66 */
67 67 #define SHM_R 0400 /* read permission */
68 68 #define SHM_W 0200 /* write permission */
69 69
70 70 /*
71 71 * Message Operation Flags.
72 72 */
73 73 #define SHM_RDONLY 010000 /* attach read-only (else read-write) */
74 74 #define SHM_RND 020000 /* round attach address to SHMLBA */
75 75 #define SHM_SHARE_MMU 040000 /* share VM resources such as page table */
76 76 #define SHM_PAGEABLE 0100000 /* pageable ISM */
77 77
78 78 /*
79 79 * Valid flags bits for shmat shmflag argument.
80 80 */
81 81 #define SHMAT_VALID_FLAGS_MASK \
82 82 (SHM_R | SHM_W | SHM_RDONLY | SHM_RND | SHM_SHARE_MMU | SHM_PAGEABLE)
83 83
84 84 typedef unsigned long shmatt_t;
85 85
86 86 /*
87 87 * Structure Definitions.
88 88 */
89 89 struct shmid_ds {
90 90 struct ipc_perm shm_perm; /* operation permission struct */
91 91 size_t shm_segsz; /* size of segment in bytes */
92 92 #if defined(_LP64) || defined(_XOPEN_SOURCE)
93 93 void *shm_amp;
94 94 #else
95 95 struct anon_map *shm_amp; /* segment anon_map pointer */
96 96 #endif
97 97 ushort_t shm_lkcnt; /* number of times it is being locked */
98 98 pid_t shm_lpid; /* pid of last shmop */
99 99 pid_t shm_cpid; /* pid of creator */
100 100 shmatt_t shm_nattch; /* number of attaches */
101 101 ulong_t shm_cnattch; /* number of ISM attaches */
102 102 #if defined(_LP64)
103 103 time_t shm_atime; /* last shmat time */
104 104 time_t shm_dtime; /* last shmdt time */
105 105 time_t shm_ctime; /* last change time */
106 106 int64_t shm_pad4[4]; /* reserve area */
107 107 #else /* _LP64 */
108 108 time_t shm_atime; /* last shmat time */
109 109 int32_t shm_pad1; /* reserved for time_t expansion */
110 110 time_t shm_dtime; /* last shmdt time */
111 111 int32_t shm_pad2; /* reserved for time_t expansion */
112 112 time_t shm_ctime; /* last change time */
113 113 int32_t shm_pad3; /* reserved for time_t expansion */
114 114 int32_t shm_pad4[4]; /* reserve area */
115 115 #endif /* _LP64 */
116 116 };
117 117
118 118 /*
119 119 * Shared memory control operations
120 120 */
121 121 #define SHM_LOCK 3 /* Lock segment in core */
122 122 #define SHM_UNLOCK 4 /* Unlock segment */
123 123
124 124 #if defined(_KERNEL)
125 125 #define SHM_RMID 5 /* Private RMID for lx support */
126 126 #endif
127 127
128 128 #if !defined(_KERNEL)
129 129 int shmget(key_t, size_t, int);
130 130 int shmids(int *, uint_t, uint_t *);
131 131 int shmctl(int, int, struct shmid_ds *);
132 132 void *shmat(int, const void *, int);
133 133 #if defined(_XPG4)
134 134 int shmdt(const void *);
135 135 #else
136 136 int shmdt(char *);
137 137 #endif /* defined(_XPG4) */
138 138 #endif /* !defined(_KERNEL) */
139 139
140 140 #ifdef __cplusplus
141 141 }
142 142 #endif
143 143
144 144 #endif /* _SYS_SHM_H */
|
↓ open down ↓ |
144 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX