Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef __ASM_GENERIC_SHMBUF_H
0003 #define __ASM_GENERIC_SHMBUF_H
0004 
0005 #include <asm/bitsperlong.h>
0006 #include <asm/ipcbuf.h>
0007 #include <asm/posix_types.h>
0008 
0009 /*
0010  * The shmid64_ds structure for x86 architecture.
0011  * Note extra padding because this structure is passed back and forth
0012  * between kernel and user space.
0013  *
0014  * shmid64_ds was originally meant to be architecture specific, but
0015  * everyone just ended up making identical copies without specific
0016  * optimizations, so we may just as well all use the same one.
0017  *
0018  * 64 bit architectures use a 64-bit long time field here, while
0019  * 32 bit architectures have a pair of unsigned long values.
0020  * On big-endian systems, the lower half is in the wrong place.
0021  *
0022  *
0023  * Pad space is left for:
0024  * - 2 miscellaneous 32-bit values
0025  */
0026 
0027 struct shmid64_ds {
0028     struct ipc64_perm   shm_perm;   /* operation perms */
0029     __kernel_size_t     shm_segsz;  /* size of segment (bytes) */
0030 #if __BITS_PER_LONG == 64
0031     long            shm_atime;  /* last attach time */
0032     long            shm_dtime;  /* last detach time */
0033     long            shm_ctime;  /* last change time */
0034 #else
0035     unsigned long       shm_atime;  /* last attach time */
0036     unsigned long       shm_atime_high;
0037     unsigned long       shm_dtime;  /* last detach time */
0038     unsigned long       shm_dtime_high;
0039     unsigned long       shm_ctime;  /* last change time */
0040     unsigned long       shm_ctime_high;
0041 #endif
0042     __kernel_pid_t      shm_cpid;   /* pid of creator */
0043     __kernel_pid_t      shm_lpid;   /* pid of last operator */
0044     unsigned long       shm_nattch; /* no. of current attaches */
0045     unsigned long       __unused4;
0046     unsigned long       __unused5;
0047 };
0048 
0049 struct shminfo64 {
0050     unsigned long       shmmax;
0051     unsigned long       shmmin;
0052     unsigned long       shmmni;
0053     unsigned long       shmseg;
0054     unsigned long       shmall;
0055     unsigned long       __unused1;
0056     unsigned long       __unused2;
0057     unsigned long       __unused3;
0058     unsigned long       __unused4;
0059 };
0060 
0061 #endif /* __ASM_GENERIC_SHMBUF_H */