Change struct vmspace->vm_shm from void * to struct shmmap_state *, this

removes the need for casts in several cases.
This commit is contained in:
Alfred Perlstein 2002-07-22 16:22:27 +00:00
parent 2cc593fd8e
commit 8209f090f1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100512
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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 */