ipc_impl.h revision 824c205f0f8b4a6b02f9096e50cb9e298ddcc0a5
/*
* CDDL HEADER START
*
* 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.
*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _IPC_IMPL_H
#define _IPC_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/ipc_rctl.h>
#include <sys/sysmacros.h>
#include <sys/id_space.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef uint64_t ipc_time_t;
/* For xxxctl64 */
/*
* There are two versions of the userland ipc_perm structure:
* ipc_perm - the version used by user applications and by the kernel
* when the user and kernel data models match (in ipc.h)
* ipc_perm32 - the 64-bit kernel's view of a 32-bit struct ipc_perm
*/
#if defined(_SYSCALL32)
struct ipc_perm32 {
};
#endif /* _SYSCALL32 */
/*
* This is the ipc_perm equivalent used in the xxxid_ds64 structures.
* It, like the structures it is used in, is intended only for use in
* communication between the kernel and user programs, and has the same
* layout across all data models.
*
* The xxxid_ds64 structures rely on ipc_perm64 being a multiple of
* 8 bytes so subsequent fields are 64-bit aligned on x86.
*/
typedef struct ipc_perm64 {
} ipc_perm64_t;
/*
* These are versions of xxxid_ds which are intended only for use in
* communication between the kernel and user programs, and therefore
* have the same layout across all data models. Omitted are all
* implementation-specific fields which would be of no use to user
* programs.
*/
struct shmid_ds64 {
};
struct semid_ds64 {
};
struct msqid_ds64 {
};
#ifdef _KERNEL
/*
* Implementation macros
*/
#define IPC_SEQ_BITS 7
#define IPC_SEQ(x) ((unsigned int)(x) >> IPC_SEQ_SHIFT)
#define IPC_INDEX(x) ((unsigned int)(x) & IPC_INDEX_MASK)
#define IPC_ID_INVAL UINT_MAX
#define IPC_PROJ_USAGE(p, s) \
s->ipcs_rctlofs))
#define IPC_ZONE_USAGE(p, s) \
s->ipcs_rctlofs))
#define IPC_LOCKED(s, o) \
/*
* The kernel's ipc_perm structure.
*/
typedef struct kipc_perm {
} kipc_perm_t;
typedef struct ipc_slot {
} ipc_slot_t;
typedef void(ipc_func_t)(kipc_perm_t *);
typedef struct ipc_service {
int ipcs_atype; /* audit type (see c2/audit.h) */
ipc_perm64_t *);
void ipcs_destroy(ipc_service_t *);
void ipcs_lock(ipc_service_t *);
void ipcs_unlock(ipc_service_t *);
#else /* _KERNEL */
int msgctl64(int, int, struct msqid_ds64 *);
int semctl64(int, int, int, ...);
int shmctl64(int, int, struct shmid_ds64 *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _IPC_IMPL_H */