xref: /titanic_44/usr/src/lib/libbc/inc/include/sys/shm.h (revision 5d54f3d8999eac1762fe0a8c7177d20f1f201fae)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*      Copyright (c) 1984 AT&T */
28 /*        All Rights Reserved   */
29 
30 #ifndef _sys_shm_h
31 #define	_sys_shm_h
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 /*
36  *	IPC Shared Memory Facility.
37  */
38 
39 #include <sys/param.h>
40 /* #include <machine/mmu.h> */
41 
42 /*
43  *	Shared Memory Operation Flags.
44  */
45 
46 #define	SHM_RDONLY	010000	/* attach read-only (else read-write) */
47 #define	SHM_RND		020000	/* round attach address to SHMLBA */
48 
49 /*
50  * Shmctl Command Definitions.
51  */
52 
53 #define SHM_LOCK	3	/* Lock segment in core */
54 #define SHM_UNLOCK	4	/* Unlock segment */
55 
56 /*
57  *	Implementation Constants.
58  */
59 #define	SHMLBA	PAGESIZE	/* segment low boundary address multiple */
60 				/* (SHMLBA must be a power of 2) */
61 
62 /*
63  *	Structure Definitions.
64  */
65 
66 /*
67  *	There is a shared mem id data structure for each segment in the system.
68  */
69 
70 struct shmid_ds {
71 	struct ipc_perm	shm_perm;	/* operation permission struct */
72 	uint		shm_segsz;	/* size of segment in bytes */
73 	ushort		shm_lpid;	/* pid of last shmop */
74 	ushort		shm_cpid;	/* pid of creator */
75 	ushort		shm_nattch;	/* number of current attaches */
76 	time_t		shm_atime;	/* last shmat time */
77 	time_t		shm_dtime;	/* last shmdt time */
78 	time_t		shm_ctime;	/* last change time */
79 	struct anon_map	*shm_amp;	/* segment anon_map pointer */
80 };
81 
82 #endif /* !_sys_shm_h */
83