Deleted Added
full compact
sysv_shm.c (11626) sysv_shm.c (12546)
1/* $Id: sysv_shm.c,v 1.9 1995/09/09 18:10:09 davidg Exp $ */
1/* $Id: sysv_shm.c,v 1.10 1995/10/21 19:50:00 bde Exp $ */
2/* $NetBSD: sysv_shm.c,v 1.23 1994/07/04 23:25:12 glass Exp $ */
3
4/*
5 * Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 229 unchanged lines hidden (view full) ---

239 if (uap->shmflg & SHM_RND)
240 attach_va = (vm_offset_t)uap->shmaddr & ~(SHMLBA-1);
241 else if (((vm_offset_t)uap->shmaddr & (SHMLBA-1)) == 0)
242 attach_va = (vm_offset_t)uap->shmaddr;
243 else
244 return EINVAL;
245 } else {
246 /* This is just a hint to vm_mmap() about where to put it. */
2/* $NetBSD: sysv_shm.c,v 1.23 1994/07/04 23:25:12 glass Exp $ */
3
4/*
5 * Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 229 unchanged lines hidden (view full) ---

239 if (uap->shmflg & SHM_RND)
240 attach_va = (vm_offset_t)uap->shmaddr & ~(SHMLBA-1);
241 else if (((vm_offset_t)uap->shmaddr & (SHMLBA-1)) == 0)
242 attach_va = (vm_offset_t)uap->shmaddr;
243 else
244 return EINVAL;
245 } else {
246 /* This is just a hint to vm_mmap() about where to put it. */
247 attach_va = round_page(p->p_vmspace->vm_daddr + MAXDSIZ);
247 attach_va = round_page(p->p_vmspace->vm_taddr + MAXTSIZ + MAXDSIZ);
248 }
249 error = vm_mmap(&p->p_vmspace->vm_map, &attach_va, size, prot,
250 VM_PROT_DEFAULT, flags, (caddr_t) uap->shmid, 0);
251 if (error)
252 return error;
253 shmmap_s->va = attach_va;
254 shmmap_s->shmid = uap->shmid;
255 shmseg->shm_lpid = p->p_pid;

--- 339 unchanged lines hidden ---
248 }
249 error = vm_mmap(&p->p_vmspace->vm_map, &attach_va, size, prot,
250 VM_PROT_DEFAULT, flags, (caddr_t) uap->shmid, 0);
251 if (error)
252 return error;
253 shmmap_s->va = attach_va;
254 shmmap_s->shmid = uap->shmid;
255 shmseg->shm_lpid = p->p_pid;

--- 339 unchanged lines hidden ---