summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-07-22 16:22:27 +0000
committeralfred <alfred@FreeBSD.org>2002-07-22 16:22:27 +0000
commitc683b045862bc6109c3e4f60519c7cc15767ca70 (patch)
tree626b9162e442f49c986456446eaa58e1684b1819 /sys
parent2d7017c840494ada23e7b89aca7dbb5329599c91 (diff)
downloadFreeBSD-src-c683b045862bc6109c3e4f60519c7cc15767ca70.zip
FreeBSD-src-c683b045862bc6109c3e4f60519c7cc15767ca70.tar.gz
Change struct vmspace->vm_shm from void * to struct shmmap_state *, this
removes the need for casts in several cases.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sysv_shm.c6
-rw-r--r--sys/vm/vm_map.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c
index f9c3d33..b83234d 100644
--- a/sys/kern/sysv_shm.c
+++ b/sys/kern/sysv_shm.c
@@ -263,7 +263,7 @@ shmdt(td, uap)
if (!jail_sysvipc_allowed && jailed(td->td_ucred))
return (ENOSYS);
mtx_lock(&Giant);
- shmmap_s = (struct shmmap_state *)p->p_vmspace->vm_shm;
+ shmmap_s = p->p_vmspace->vm_shm;
if (shmmap_s == NULL) {
error = EINVAL;
goto done2;
@@ -314,7 +314,7 @@ shmat(td, uap)
if (!jail_sysvipc_allowed && jailed(td->td_ucred))
return (ENOSYS);
mtx_lock(&Giant);
- shmmap_s = (struct shmmap_state *)p->p_vmspace->vm_shm;
+ shmmap_s = p->p_vmspace->vm_shm;
if (shmmap_s == NULL) {
size = shminfo.shmseg * sizeof(struct shmmap_state);
shmmap_s = malloc(size, M_SHM, M_WAITOK);
@@ -774,7 +774,7 @@ shmexit_myhook(p)
GIANT_REQUIRED;
- shmmap_s = (struct shmmap_state *)p->p_vmspace->vm_shm;
+ shmmap_s = p->p_vmspace->vm_shm;
for (i = 0; i < shminfo.shmseg; i++, shmmap_s++)
if (shmmap_s->shmid != -1)
shm_delete_mapping(p, shmmap_s);
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index 2922245..0f9a056 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -205,7 +205,7 @@ struct vmspace {
struct vm_map vm_map; /* VM address map */
struct pmap vm_pmap; /* private physical map */
int vm_refcnt; /* number of references */
- void *vm_shm; /* SYS5 shared memory private data XXX */
+ struct shmmap_state *vm_shm; /* SYS5 shared memory private data XXX */
/* we copy from vm_startcopy to the end of the structure on fork */
#define vm_startcopy vm_rssize
segsz_t vm_rssize; /* current resident set size in pages */
OpenPOWER on IntegriCloud