sysv_shm.c (10428) | sysv_shm.c (10653) |
---|---|
1/* $Id: sysv_shm.c,v 1.7 1995/08/28 09:18:48 julian Exp $ */ | 1/* $Id: sysv_shm.c,v 1.8 1995/08/30 00:33:02 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: --- 33 unchanged lines hidden (view full) --- 43#include <sys/systm.h> 44#include <sys/stat.h> 45 46#include <vm/vm.h> 47#include <vm/vm_map.h> 48#include <vm/vm_map.h> 49#include <vm/vm_kern.h> 50 | 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: --- 33 unchanged lines hidden (view full) --- 43#include <sys/systm.h> 44#include <sys/stat.h> 45 46#include <vm/vm.h> 47#include <vm/vm_map.h> 48#include <vm/vm_map.h> 49#include <vm/vm_kern.h> 50 |
51static void shminit __P((caddr_t)); | 51static void shminit __P((void *)); |
52SYSINIT(sysv_shm, SI_SUB_SYSV_SHM, SI_ORDER_FIRST, shminit, NULL) 53 54int oshmctl(); 55int shmat(), shmctl(), shmdt(), shmget(); 56int (*shmcalls[])() = { shmat, oshmctl, shmdt, shmget, shmctl }; 57 58#define SHMSEG_FREE 0x0200 59#define SHMSEG_REMOVED 0x0400 --- 492 unchanged lines hidden (view full) --- 552 if (shmmap_s->shmid != -1) 553 shm_delete_mapping(p, shmmap_s); 554 free((caddr_t)p->p_vmspace->vm_shm, M_SHM); 555 p->p_vmspace->vm_shm = NULL; 556} 557 558void 559shminit(udata) | 52SYSINIT(sysv_shm, SI_SUB_SYSV_SHM, SI_ORDER_FIRST, shminit, NULL) 53 54int oshmctl(); 55int shmat(), shmctl(), shmdt(), shmget(); 56int (*shmcalls[])() = { shmat, oshmctl, shmdt, shmget, shmctl }; 57 58#define SHMSEG_FREE 0x0200 59#define SHMSEG_REMOVED 0x0400 --- 492 unchanged lines hidden (view full) --- 552 if (shmmap_s->shmid != -1) 553 shm_delete_mapping(p, shmmap_s); 554 free((caddr_t)p->p_vmspace->vm_shm, M_SHM); 555 p->p_vmspace->vm_shm = NULL; 556} 557 558void 559shminit(udata) |
560 caddr_t udata; | 560 void *udata; |
561{ 562 int i; 563 vm_offset_t garbage1, garbage2; 564 565 /* actually this *should* be pageable. SHM_{LOCK,UNLOCK} */ 566 sysvshm_map = kmem_suballoc(kernel_map, &garbage1, &garbage2, 567 shminfo.shmall * NBPG, TRUE); 568 for (i = 0; i < shminfo.shmmni; i++) { 569 shmsegs[i].shm_perm.mode = SHMSEG_FREE; 570 shmsegs[i].shm_perm.seq = 0; 571 } 572 shm_last_free = 0; 573 shm_nused = 0; 574 shm_committed = 0; 575} | 561{ 562 int i; 563 vm_offset_t garbage1, garbage2; 564 565 /* actually this *should* be pageable. SHM_{LOCK,UNLOCK} */ 566 sysvshm_map = kmem_suballoc(kernel_map, &garbage1, &garbage2, 567 shminfo.shmall * NBPG, TRUE); 568 for (i = 0; i < shminfo.shmmni; i++) { 569 shmsegs[i].shm_perm.mode = SHMSEG_FREE; 570 shmsegs[i].shm_perm.seq = 0; 571 } 572 shm_last_free = 0; 573 shm_nused = 0; 574 shm_committed = 0; 575} |