OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [shm.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _LINUX_SHM_H_
2
#define _LINUX_SHM_H_
3
 
4
#include <linux/ipc.h>
5
 
6
#include <asm/shmparam.h>
7
 
8
#ifndef NO_MM
9
 
10
struct shmid_ds {
11
        struct ipc_perm shm_perm;       /* operation perms */
12
        int     shm_segsz;              /* size of segment (bytes) */
13
        time_t  shm_atime;              /* last attach time */
14
        time_t  shm_dtime;              /* last detach time */
15
        time_t  shm_ctime;              /* last change time */
16
        unsigned short  shm_cpid;       /* pid of creator */
17
        unsigned short  shm_lpid;       /* pid of last operator */
18
        short   shm_nattch;             /* no. of current attaches */
19
        /* the following are private */
20
        unsigned short   shm_npages;    /* size of segment (pages) */
21
        unsigned long   *shm_pages;     /* array of ptrs to frames -> SHMMAX */
22
        struct vm_area_struct *attaches; /* descriptors for attaches */
23
};
24
 
25
/* permission flag for shmget */
26
#define SHM_R           0400    /* or S_IRUGO from <linux/stat.h> */
27
#define SHM_W           0200    /* or S_IWUGO from <linux/stat.h> */
28
 
29
/* mode for attach */
30
#define SHM_RDONLY      010000  /* read-only access */
31
#define SHM_RND         020000  /* round attach address to SHMLBA boundary */
32
#define SHM_REMAP       040000  /* take-over region on attach */
33
 
34
/* super user shmctl commands */
35
#define SHM_LOCK        11
36
#define SHM_UNLOCK      12
37
 
38
struct  shminfo {
39
    int shmmax;
40
    int shmmin;
41
    int shmmni;
42
    int shmseg;
43
    int shmall;
44
};
45
 
46
#ifdef __KERNEL__
47
 
48
/* shm_mode upper byte flags */
49
#define SHM_DEST        01000   /* segment will be destroyed on last detach */
50
#define SHM_LOCKED      02000   /* segment will not be swapped */
51
 
52
/* ipcs ctl commands */
53
#define SHM_STAT        13
54
#define SHM_INFO        14
55
struct shm_info {
56
        int   used_ids;
57
        ulong shm_tot; /* total allocated shm */
58
        ulong shm_rss; /* total resident shm */
59
        ulong shm_swp; /* total swapped shm */
60
        ulong swap_attempts;
61
        ulong swap_successes;
62
};
63
 
64
asmlinkage int sys_shmget (key_t key, int size, int flag);
65
asmlinkage int sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *addr);
66
asmlinkage int sys_shmdt (char *shmaddr);
67
asmlinkage int sys_shmctl (int shmid, int cmd, struct shmid_ds *buf);
68
extern void shm_unuse(unsigned int type);
69
 
70
#endif /* __KERNEL__ */
71
 
72
#else /* NO_MM */
73
 
74
struct shmid_ds;
75
 
76
#ifdef __KERNEL__
77
 
78
/* These compile to stubs */
79
 
80
asmlinkage int sys_shmget (key_t key, int size, int flag);
81
asmlinkage int sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *addr);
82
asmlinkage int sys_shmdt (char *shmaddr);
83
asmlinkage int sys_shmctl (int shmid, int cmd, struct shmid_ds *buf);
84
 
85
#endif /* __KERNEL__ */
86
 
87
#endif /* NO_MM */
88
 
89
#endif /* _LINUX_SHM_H_ */
90
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.