ipc.h
3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* Copyright (C) 1998 by the Board of Trustees
* of Leland Stanford Junior University.
* Copyright (C) 1998 Digital Equipment Corporation
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
#ifndef _IPC_H_
#define _IPC_H_
#include "subst.h"
/*
* Structure definitions for supporting System V semaphores and
* shared memory.
*
* Copyright (C) 1993 by Jack E. Veenstra (veenstra@cs.rochester.edu)
*
* This file is part of MINT, a MIPS code interpreter and event generator
* for parallel programs.
*
* MINT is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* MINT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MINT; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include "event.h"
#include "queue.h"
struct sysv_semid_ds {
struct ipc_perm sem_perm;
struct sysv_sem *sem_base;
ushort sem_nsems;
aint_time_t sem_otime;
aint_time_t sem_ctime;
int inuse;
};
struct sysv_sem {
ushort semval;
short sempid;
short semncnt;
short semzcnt;
qnode_t nwait_q;
qnode_t zwait_q;
};
struct sysv_shm {
struct ipc_perm shm_perm;
long addr;
int inuse;
/* ushort real_seg; true if a system V segment was allocated */
int size;
};
#define MAX_SEMASET 1024
#define MAX_SHMSEG 256
struct sysv_semid_ds;
extern SyscallStatus aint_semget ( thread_ptr);
/* Prototype include a typedef name.
It should be moved after the typedef declaration */
extern void semcpin (struct sysv_semid_ds *, struct sysv_semid_ds *);
extern void semcpout (struct sysv_semid_ds *, struct sysv_semid_ds *);
extern SyscallStatus aint_semop ( thread_ptr);
/* Prototype include a typedef name.
It should be moved after the typedef declaration */
extern SyscallStatus aint_semctl ( thread_ptr);
/* Prototype include a typedef name.
It should be moved after the typedef declaration */
extern SyscallStatus aint_shmget ( thread_ptr);
/* Prototype include a typedef name.
It should be moved after the typedef declaration */
extern int is_valid (long);
extern SyscallStatus aint_shmat ( thread_ptr);
/* Prototype include a typedef name.
It should be moved after the typedef declaration */
extern SyscallStatus aint_shmdt ( thread_ptr);
/* Prototype include a typedef name.
It should be moved after the typedef declaration */
extern SyscallStatus aint_shmctl ( thread_ptr);
/* Prototype include a typedef name.
It should be moved after the typedef declaration */
#endif /* _IPC_H_ */