X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=include%2Flinux%2Fshm.h;h=eca6235a46c0b1b89d951a90216b132c6a21cfb7;hb=feaf3848a813a106f163013af6fcf6c4bfec92d9;hp=a2c896ad0befa6819dbae3e1ffd47b1679597346;hpb=6b995751c2e851d2bc9c277b5884d0adb519e31d;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/shm.h b/include/linux/shm.h index a2c896ad0be..eca6235a46c 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h @@ -3,7 +3,11 @@ #include #include +#ifdef __KERNEL__ #include +#else +#include +#endif /* * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can @@ -13,10 +17,16 @@ #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ #define SHMMIN 1 /* min shared seg size (bytes) */ #define SHMMNI 4096 /* max num of segs system wide */ +#ifdef __KERNEL__ #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ +#else +#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16)) +#endif #define SHMSEG SHMMNI /* max shared segs per process */ +#ifdef __KERNEL__ #include +#endif /* Obsolete, used only for backwards compatibility and libc5 compiles */ struct shmid_ds { @@ -77,7 +87,6 @@ struct shmid_kernel /* private to the kernel */ { struct kern_ipc_perm shm_perm; struct file * shm_file; - int id; unsigned long shm_nattch; unsigned long shm_segsz; time_t shm_atim; @@ -96,12 +105,17 @@ struct shmid_kernel /* private to the kernel */ #ifdef CONFIG_SYSVIPC long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); +extern int is_file_shm_hugepages(struct file *file); #else static inline long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr) { return -ENOSYS; } +static inline int is_file_shm_hugepages(struct file *file) +{ + return 0; +} #endif #endif /* __KERNEL__ */