--- /dev/null
+/* $OpenBSD: vm_conf.h,v 1.1 1996/03/03 17:45:26 niklas Exp $ */
+/* $NetBSD: vm_conf.h,v 1.1 1996/02/05 01:53:53 christos Exp $ */
+
+/*
+ * Copyright (c) 1995 Christos Zoulas. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Christos Zoulas.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/conf.h>
+
+bdev_decl(sw);
+cdev_decl(sw);
-/* $NetBSD: vm_extern.h,v 1.15 1995/12/09 04:28:16 mycroft Exp $ */
+/* $OpenBSD: vm_extern.h,v 1.4 1996/03/03 17:45:26 niklas Exp $ */
+/* $NetBSD: vm_extern.h,v 1.19 1996/02/10 00:08:05 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
struct vmtotal;
struct mount;
struct vnode;
+struct core;
#ifdef KGDB
void chgkprot __P((caddr_t, int, int));
void kmem_init __P((vm_offset_t, vm_offset_t));
vm_offset_t kmem_malloc __P((vm_map_t, vm_size_t, boolean_t));
vm_map_t kmem_suballoc __P((vm_map_t, vm_offset_t *, vm_offset_t *,
- vm_size_t, boolean_t));
+ vm_size_t, boolean_t));
void loadav __P((struct loadavg *));
void munmapfd __P((struct proc *, int));
int pager_cache __P((vm_object_t, boolean_t));
void sched __P((void));
+void scheduler __P((void));
int svm_allocate __P((struct proc *, void *, int *));
int svm_deallocate __P((struct proc *, void *, int *));
int svm_inherit __P((struct proc *, void *, int *));
void thread_sleep __P((void *, simple_lock_t, boolean_t));
void thread_wakeup __P((void *));
int useracc __P((caddr_t, int, int));
-int vm_allocate __P((vm_map_t,
- vm_offset_t *, vm_size_t, boolean_t));
+int vm_allocate __P((vm_map_t, vm_offset_t *, vm_size_t,
+ boolean_t));
int vm_allocate_with_pager __P((vm_map_t, vm_offset_t *,
vm_size_t, boolean_t, vm_pager_t, vm_offset_t, boolean_t));
+int vm_coredump __P((struct proc *, struct vnode *, struct ucred *,
+ struct core *));
int vm_deallocate __P((vm_map_t, vm_offset_t, vm_size_t));
int vm_fault __P((vm_map_t, vm_offset_t, vm_prot_t, boolean_t));
void vm_fault_copy_entry __P((vm_map_t,
void vnode_pager_umount __P((struct mount *));
boolean_t vnode_pager_uncache __P((struct vnode *));
void vslock __P((caddr_t, u_int));
-void vsunlock __P((caddr_t, u_int, int));
+void vsunlock __P((caddr_t, u_int));
+
+/* Machine dependent portion */
+void vmapbuf __P((struct buf *, vm_size_t));
+void vunmapbuf __P((struct buf *, vm_size_t));
+void remrq __P((struct proc *));
+#ifdef __FORK_BRAINDAMAGE
+int cpu_fork __P((struct proc *, struct proc *));
+#else
+void cpu_fork __P((struct proc *, struct proc *));
+#endif
+
#endif
-/* $NetBSD: vm_fault.c,v 1.16 1994/09/07 20:25:07 mycroft Exp $ */
+/* $OpenBSD: vm_fault.c,v 1.2 1996/03/03 17:45:28 niklas Exp $ */
+/* $NetBSD: vm_fault.c,v 1.17 1996/02/05 01:53:55 christos Exp $ */
/*
* Copyright (c) 1991, 1993
copy_offset = first_offset
- copy_object->shadow_offset;
copy_m = vm_page_lookup(copy_object, copy_offset);
- if (page_exists = (copy_m != NULL)) {
+ if ((page_exists = (copy_m != NULL)) != 0) {
if (copy_m->flags & PG_BUSY) {
#ifdef DOTHREADS
int wait_result;
-/* $NetBSD: vm_glue.c,v 1.48 1995/12/09 04:28:19 mycroft Exp $ */
+/* $OpenBSD: vm_glue.c,v 1.9 1996/03/03 17:45:29 niklas Exp $ */
+/* $NetBSD: vm_glue.c,v 1.52 1996/02/12 21:51:59 christos Exp $ */
/*
* Copyright (c) 1991, 1993
#include <sys/resourcevar.h>
#include <sys/buf.h>
#include <sys/user.h>
+#ifdef SYSVSHM
+#include <sys/shm.h>
+#endif
#include <vm/vm.h>
#include <vm/vm_page.h>
}
void
-vsunlock(addr, len, dirtied)
+vsunlock(addr, len)
caddr_t addr;
u_int len;
- int dirtied;
{
-#ifdef lint
- dirtied++;
-#endif
vm_map_pageable(&curproc->p_vmspace->vm_map, trunc_page(addr),
round_page(addr+len), TRUE);
}
}
#ifdef DEBUG
if (swapdebug & SDB_FOLLOW)
- printf("scheduler: running, procp %x pri %d\n", pp, ppri);
+ printf("scheduler: running, procp %p pri %d\n", pp, ppri);
#endif
/*
* Nothing to do, back to sleep
if (cnt.v_free_count > atop(USPACE)) {
#ifdef DEBUG
if (swapdebug & SDB_SWAPIN)
- printf("swapin: pid %d(%s)@%x, pri %d free %d\n",
+ printf("swapin: pid %d(%s)@%p, pri %d free %d\n",
p->p_pid, p->p_comm, p->p_addr,
ppri, cnt.v_free_count);
#endif
p = outp2;
#ifdef DEBUG
if (swapdebug & SDB_SWAPOUT)
- printf("swapout_threads: no duds, try procp %x\n", p);
+ printf("swapout_threads: no duds, try procp %p\n", p);
#endif
if (p)
swapout(p);
#ifdef DEBUG
if (swapdebug & SDB_SWAPOUT)
- printf("swapout: pid %d(%s)@%x, stat %x pri %d free %d\n",
+ printf("swapout: pid %d(%s)@%p, stat %x pri %d free %d\n",
p->p_pid, p->p_comm, p->p_addr, p->p_stat,
p->p_slptime, cnt.v_free_count);
#endif
-/* $NetBSD: vm_map.c,v 1.21 1995/04/10 16:54:00 mycroft Exp $ */
+/* $OpenBSD: vm_map.c,v 1.2 1996/03/03 17:45:30 niklas Exp $ */
+/* $NetBSD: vm_map.c,v 1.23 1996/02/10 00:08:08 christos Exp $ */
/*
* Copyright (c) 1991, 1993
isspecial = (map == kernel_map || map == kmem_map ||
map == mb_map || map == pager_map);
- if (isspecial && map->entries_pageable ||
- !isspecial && !map->entries_pageable)
+ if ((isspecial && map->entries_pageable) ||
+ (!isspecial && !map->entries_pageable))
panic("vm_map_entry_create: bogus map");
#endif
if (map->entries_pageable) {
MALLOC(entry, vm_map_entry_t, sizeof(struct vm_map_entry),
M_VMMAPENT, M_WAITOK);
} else {
- if (entry = kentry_free)
+ if ((entry = kentry_free) != NULL)
kentry_free = kentry_free->next;
}
if (entry == NULL)
isspecial = (map == kernel_map || map == kmem_map ||
map == mb_map || map == pager_map);
- if (isspecial && map->entries_pageable ||
- !isspecial && !map->entries_pageable)
+ if ((isspecial && map->entries_pageable) ||
+ (!isspecial && !map->entries_pageable))
panic("vm_map_entry_dispose: bogus map");
#endif
if (map->entries_pageable) {
{
register vm_map_entry_t entry;
vm_map_entry_t start_entry;
- register vm_offset_t failed;
+ register vm_offset_t failed = 0;
int rv;
vm_map_lock(map);
* it for all possible accesses.
*/
- if (*wired = (entry->wired_count != 0))
+ if ((*wired = (entry->wired_count != 0)) != 0)
prot = fault_type = entry->protection;
/*
* it down.
*/
- if (su = !entry->is_a_map) {
+ if ((su = !entry->is_a_map) != 0) {
share_map = map;
share_offset = vaddr;
}
register vm_map_t map;
boolean_t full;
{
- extern void _vm_map_print();
-
_vm_map_print(map, full, printf);
}
-/* $NetBSD: vm_meter.c,v 1.17 1995/07/08 03:12:22 cgd Exp $ */
+/* $OpenBSD: vm_meter.c,v 1.2 1996/03/03 17:45:32 niklas Exp $ */
+/* $NetBSD: vm_meter.c,v 1.18 1996/02/05 01:53:59 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
/*
* Attributes associated with virtual memory.
*/
+int
vm_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
int *name;
u_int namelen;
-/* $NetBSD: vm_mmap.c,v 1.43 1995/12/05 22:54:42 pk Exp $ */
+/* $OpenBSD: vm_mmap.c,v 1.4 1996/03/03 17:45:32 niklas Exp $ */
+/* $NetBSD: vm_mmap.c,v 1.45 1996/02/10 00:08:10 christos Exp $ */
/*
* Copyright (c) 1988 University of Utah.
void *v;
register_t *retval;
{
+#if 0
struct sys_sbrk_args /* {
syscallarg(int) incr;
} */ *uap = v;
+#endif
/* Not yet implemented */
return (EOPNOTSUPP);
void *v;
register_t *retval;
{
+#if 0
struct sys_sstk_args /* {
syscallarg(int) incr;
} */ *uap = v;
+#endif
/* Not yet implemented */
return (EOPNOTSUPP);
}
-#if defined(COMPAT_43) || defined(COMPAT_SUNOS) || defined(COMPAT_OSF1) || \
- defined(COMPAT_FREEBSD)
-/* ARGSUSED */
-int
-compat_43_sys_getpagesize(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
-
- *retval = PAGE_SIZE;
- return (0);
-}
-#endif /* COMPAT_43 || COMPAT_SUNOS || COMPAT_OSF1 || COMPAT_FREEBSD */
-
-#if defined(COMPAT_43) || defined(COMPAT_FREEBSD)
-int
-compat_43_sys_mmap(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- register struct compat_43_sys_mmap_args /* {
- syscallarg(caddr_t) addr;
- syscallarg(size_t) len;
- syscallarg(int) prot;
- syscallarg(int) flags;
- syscallarg(int) fd;
- syscallarg(long) pos;
- } */ *uap = v;
- struct sys_mmap_args /* {
- syscallarg(caddr_t) addr;
- syscallarg(size_t) len;
- syscallarg(int) prot;
- syscallarg(int) flags;
- syscallarg(int) fd;
- syscallarg(long) pad;
- syscallarg(off_t) pos;
- } */ nargs;
- static const char cvtbsdprot[8] = {
- 0,
- PROT_EXEC,
- PROT_WRITE,
- PROT_EXEC|PROT_WRITE,
- PROT_READ,
- PROT_EXEC|PROT_READ,
- PROT_WRITE|PROT_READ,
- PROT_EXEC|PROT_WRITE|PROT_READ,
- };
-#define OMAP_ANON 0x0002
-#define OMAP_COPY 0x0020
-#define OMAP_SHARED 0x0010
-#define OMAP_FIXED 0x0100
-#define OMAP_INHERIT 0x0800
-
- SCARG(&nargs, addr) = SCARG(uap, addr);
- SCARG(&nargs, len) = SCARG(uap, len);
- SCARG(&nargs, prot) = cvtbsdprot[SCARG(uap, prot)&0x7];
- SCARG(&nargs, flags) = 0;
- if (SCARG(uap, flags) & OMAP_ANON)
- SCARG(&nargs, flags) |= MAP_ANON;
- if (SCARG(uap, flags) & OMAP_COPY)
- SCARG(&nargs, flags) |= MAP_COPY;
- if (SCARG(uap, flags) & OMAP_SHARED)
- SCARG(&nargs, flags) |= MAP_SHARED;
- else
- SCARG(&nargs, flags) |= MAP_PRIVATE;
- if (SCARG(uap, flags) & OMAP_FIXED)
- SCARG(&nargs, flags) |= MAP_FIXED;
- if (SCARG(uap, flags) & OMAP_INHERIT)
- SCARG(&nargs, flags) |= MAP_INHERIT;
- SCARG(&nargs, fd) = SCARG(uap, fd);
- SCARG(&nargs, pos) = SCARG(uap, pos);
- return (sys_mmap(p, &nargs, retval));
-}
-#endif
/*
* Memory Map (mmap) system call. Note that the file offset
vm_prot_t prot, maxprot;
caddr_t handle;
int fd, flags, error;
+ vm_offset_t vm_min_address = VM_MIN_ADDRESS;
addr = (vm_offset_t) SCARG(uap, addr);
size = (vm_size_t) SCARG(uap, len);
if (addr & PAGE_MASK)
return (EINVAL);
/* Address range must be all in user VM space. */
- if (VM_MAXUSER_ADDRESS > 0 && addr + size > VM_MAXUSER_ADDRESS)
+ if (VM_MAXUSER_ADDRESS > 0 &&
+ addr + size > VM_MAXUSER_ADDRESS)
return (EINVAL);
- if (VM_MIN_ADDRESS > 0 && addr < VM_MIN_ADDRESS)
+ if (vm_min_address > 0 && addr < vm_min_address)
return (EINVAL);
if (addr > addr + size)
return (EINVAL);
vm_offset_t addr;
vm_size_t size, pageoff;
vm_map_t map;
+ vm_offset_t vm_min_address = VM_MIN_ADDRESS;
+
addr = (vm_offset_t) SCARG(uap, addr);
size = (vm_size_t) SCARG(uap, len);
*/
if (VM_MAXUSER_ADDRESS > 0 && addr + size > VM_MAXUSER_ADDRESS)
return (EINVAL);
- if (VM_MIN_ADDRESS > 0 && addr < VM_MIN_ADDRESS)
+ if (vm_min_address > 0 && addr < vm_min_address)
return (EINVAL);
if (addr > addr + size)
return (EINVAL);
void *v;
register_t *retval;
{
+#if 0
struct sys_madvise_args /* {
syscallarg(caddr_t) addr;
syscallarg(size_t) len;
syscallarg(int) behav;
} */ *uap = v;
+#endif
/* Not yet implemented */
return (EOPNOTSUPP);
void *v;
register_t *retval;
{
+#if 0
struct sys_mincore_args /* {
syscallarg(caddr_t) addr;
syscallarg(size_t) len;
syscallarg(char *) vec;
} */ *uap = v;
+#endif
/* Not yet implemented */
return (EOPNOTSUPP);
p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur)
return (EAGAIN);
#else
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return (error);
#endif
return (EINVAL);
#ifndef pmap_wired_count
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return (error);
#endif
(void) pager_cache(object, FALSE);
#ifdef DEBUG
if (mmapdebug & MDB_MAPIT)
- printf("vm_mmap(%d): ANON *addr %x size %x pager %x\n",
+ printf("vm_mmap(%d): ANON *addr %x size %x pager %p\n",
curproc->p_pid, *addr, size, pager);
#endif
}
else {
#ifdef DEBUG
if (object == NULL)
- printf("vm_mmap: no object: vp %x, pager %x\n",
+ printf("vm_mmap: no object: vp %p, pager %p\n",
vp, pager);
#endif
/*
}
#ifdef DEBUG
if (mmapdebug & MDB_MAPIT)
- printf("vm_mmap(%d): FILE *addr %x size %x pager %x\n",
+ printf("vm_mmap(%d): FILE *addr %x size %x pager %p\n",
curproc->p_pid, *addr, size, pager);
#endif
}
-/* $NetBSD: vm_object.c,v 1.31 1995/12/06 00:38:11 pk Exp $ */
+/* $OpenBSD: vm_object.c,v 1.3 1996/03/03 17:45:34 niklas Exp $ */
+/* $NetBSD: vm_object.c,v 1.33 1996/02/10 00:08:11 christos Exp $ */
/*
* Copyright (c) 1991, 1993
boolean_t de_queue;
{
register vm_page_t p;
- int onqueue;
+ int onqueue = 0;
boolean_t noerror = TRUE;
if (object == NULL)
* Loop through the object page list cleaning as necessary.
*/
for (p = object->memq.tqh_first; p != NULL; p = p->listq.tqe_next) {
- if ((start == end || p->offset >= start && p->offset < end) &&
+ if ((start == end || (p->offset >= start && p->offset < end)) &&
!(p->flags & PG_FICTITIOUS)) {
if ((p->flags & PG_CLEAN) &&
pmap_is_modified(VM_PAGE_TO_PHYS(p)))
vm_object_t object;
boolean_t full;
{
- extern void _vm_object_print();
-
_vm_object_print(object, full, printf);
}
-/* $NetBSD: vm_page.c,v 1.26 1995/06/26 14:40:11 leo Exp $ */
+/* $OpenBSD: vm_page.c,v 1.2 1996/03/03 17:45:35 niklas Exp $ */
+/* $NetBSD: vm_page.c,v 1.28 1996/02/05 01:54:05 christos Exp $ */
/*
* Copyright (c) 1991, 1993
* map (they should use their own maps).
*/
- kentry_data_size = MAX_KMAP * sizeof(struct vm_map) +
- MAX_KMAPENT * sizeof(struct vm_map_entry);
- kentry_data_size = round_page(kentry_data_size);
+ kentry_data_size = round_page(MAX_KMAP*sizeof(struct vm_map) +
+ MAX_KMAPENT*sizeof(struct vm_map_entry));
kentry_data = (vm_offset_t) pmap_steal_memory(kentry_data_size);
/*
i = pmap_page_index(paddr) - first_page;
/* Don't trust pmap_page_index()... */
- if (i < 0 || i >= vm_page_count)
+ if (
+#if 0
+ /* Cannot happen; i is unsigned */
+ i < 0 ||
+#endif
+ i >= vm_page_count)
panic("pmap_startup: bad i=0x%x", i);
}
-/* $NetBSD: vm_pageout.c,v 1.22 1995/06/28 02:58:51 cgd Exp $ */
+/* $OpenBSD: vm_pageout.c,v 1.2 1996/03/03 17:45:36 niklas Exp $ */
+/* $NetBSD: vm_pageout.c,v 1.23 1996/02/05 01:54:07 christos Exp $ */
/*
* Copyright (c) 1991, 1993
*/
#include <sys/param.h>
+#include <sys/proc.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
-/* $NetBSD: vm_pager.c,v 1.18 1995/05/07 19:27:30 cgd Exp $ */
+/* $OpenBSD: vm_pager.c,v 1.2 1996/03/03 17:45:37 niklas Exp $ */
+/* $NetBSD: vm_pager.c,v 1.20 1996/02/10 00:08:13 christos Exp $ */
/*
* Copyright (c) 1991, 1993
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
+#include <sys/proc.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
if (m->flags & PG_PAGEROWNED)
m->flags &= ~PG_PAGEROWNED;
else
- printf("vm_pager_unmap_pages: %x(%x/%x) not owned\n",
+ printf("vm_pager_unmap_pages: %p(%x/%x) not owned\n",
m, va, VM_PAGE_TO_PHYS(m));
}
#endif
-/* $NetBSD: vm_swap.c,v 1.31 1995/10/07 06:29:02 mycroft Exp $ */
+/* $OpenBSD: vm_swap.c,v 1.2 1996/03/03 17:45:38 niklas Exp $ */
+/* $NetBSD: vm_swap.c,v 1.32 1996/02/05 01:54:09 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
-#include <sys/conf.h>
#include <sys/proc.h>
#include <sys/namei.h>
#include <sys/dmap.h> /* XXX */
#include <sys/mount.h>
#include <sys/syscallargs.h>
+#include <vm/vm.h>
+#include <vm/vm_conf.h>
+
#include <miscfs/specfs/specdev.h>
/*
int niswap; /* size of interleaved swap area */
#endif
+int swfree __P((struct proc *, int));
+
/*
* Set up swap devices.
* Initialize linked list of free swap
panic("swstrategy");
VHOLD(sp->sw_vp);
if ((bp->b_flags & B_READ) == 0) {
- if (vp = bp->b_vp) {
+ if ((vp = bp->b_vp) != NULL) {
vp->v_numoutput--;
if ((vp->v_flag & VBWAIT) && vp->v_numoutput <= 0) {
vp->v_flag &= ~VBWAIT;
VOP_STRATEGY(bp);
}
+/*ARGSUSED*/
int
-swread(dev, uio)
+swread(dev, uio, ioflag)
dev_t dev;
struct uio *uio;
+ int ioflag;
{
return (physio(swstrategy, NULL, dev, B_READ, minphys, uio));
}
+/*ARGSUSED*/
int
-swwrite(dev, uio)
+swwrite(dev, uio, ioflag)
dev_t dev;
struct uio *uio;
+ int ioflag;
{
return (physio(swstrategy, NULL, dev, B_WRITE, minphys, uio));
int error;
struct nameidata nd;
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, name), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type != VBLK) {
return (EBUSY);
}
sp->sw_vp = vp;
- if (error = swfree(p, sp - swdevt)) {
+ if ((error = swfree(p, sp - swdevt)) != 0) {
vrele(vp);
return (error);
}
vp = sp->sw_vp;
/* If root on swap, then the skip open/close operations. */
if (vp != rootvp) {
- if (error = VOP_OPEN(vp, FREAD|FWRITE, p->p_ucred, p))
+ if ((error = VOP_OPEN(vp, FREAD|FWRITE, p->p_ucred, p)) != 0)
return (error);
}
sp->sw_flags |= SW_FREED;
-/* $NetBSD: vm_unix.c,v 1.18 1995/10/07 06:29:04 mycroft Exp $ */
+/* $OpenBSD: vm_unix.c,v 1.2 1996/03/03 17:45:39 niklas Exp $ */
+/* $NetBSD: vm_unix.c,v 1.19 1996/02/10 00:08:14 christos Exp $ */
/*
* Copyright (c) 1988 University of Utah.
void *v;
register_t *retval;
{
+#if 0
struct sys_ovadvise_args /* {
syscallarg(int) anom;
} */ *uap = v;
+#endif
return (EINVAL);
}
-/* $NetBSD: vnode_pager.c,v 1.16 1994/06/29 06:48:47 cgd Exp $ */
+/* $OpenBSD: vnode_pager.c,v 1.2 1996/03/03 17:45:40 niklas Exp $ */
+/* $NetBSD: vnode_pager.c,v 1.18 1996/02/10 00:08:15 christos Exp $ */
/*
* Copyright (c) 1990 University of Utah.
#ifdef DEBUG
if (vpagerdebug & (VDB_FOLLOW|VDB_ALLOC))
- printf("vnode_pager_alloc(%x, %x, %x)\n", handle, size, prot);
+ printf("vnode_pager_alloc(%p, %x, %x)\n", handle, size, prot);
#endif
/*
* Pageout to vnode, no can do yet.
}
#ifdef DEBUG
if (vpagerdebug & VDB_ALLOC)
- printf("vnode_pager_setup: vp %x sz %x pager %x object %x\n",
+ printf("vnode_pager_setup: vp %p sz %x pager %p object %p\n",
vp, vnp->vnp_size, pager, object);
#endif
return(pager);
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
- printf("vnode_pager_dealloc(%x)\n", pager);
+ printf("vnode_pager_dealloc(%p)\n", pager);
#endif
- if (vp = vnp->vnp_vp) {
+ if ((vp = vnp->vnp_vp) != NULL) {
vp->v_vmdata = NULL;
vp->v_flag &= ~VTEXT;
#if NOTDEF
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
- printf("vnode_pager_getpage(%x, %x, %x, %x)\n",
+ printf("vnode_pager_getpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
#endif
return(vnode_pager_io((vn_pager_t)pager->pg_data,
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
- printf("vnode_pager_putpage(%x, %x, %x, %x)\n",
+ printf("vnode_pager_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
#endif
if (pager == NULL)
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
- printf("vnode_pager_haspage(%x, %x)\n", pager, offset);
+ printf("vnode_pager_haspage(%p, %x)\n", pager, offset);
#endif
/*
VOP_UNLOCK(vnp->vnp_vp);
#ifdef DEBUG
if (vpagerdebug & (VDB_FAIL|VDB_SIZE))
- printf("vnode_pager_haspage: pg %x, off %x, size %x\n",
+ printf("vnode_pager_haspage: pg %p, off %x, size %x\n",
pager, offset, vnp->vnp_size);
#endif
return(FALSE);
if (err) {
#ifdef DEBUG
if (vpagerdebug & VDB_FAIL)
- printf("vnode_pager_haspage: BMAP err %d, pg %x, off %x\n",
+ printf("vnode_pager_haspage: BMAP err %d, pg %p, off %x\n",
err, pager, offset);
#endif
return(TRUE);
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
- printf("vnode_pager_cluster(%x, %x) ", pager, offset);
+ printf("vnode_pager_cluster(%p, %x) ", pager, offset);
#endif
loff = offset;
if (loff >= vnp->vnp_size)
#ifdef DEBUG
if (vpagerdebug & (VDB_FOLLOW|VDB_SIZE))
- printf("vnode_pager_setsize: vp %x obj %x osz %d nsz %d\n",
+ printf("vnode_pager_setsize: vp %p obj %p osz %d nsz %d\n",
vp, object, vnp->vnp_size, nsize);
#endif
/*
#ifdef DEBUG
if (!VOP_ISLOCKED(vp)) {
#ifdef NFSCLIENT
- extern int (**nfsv2_vnodeop_p)();
- extern int (**spec_nfsv2nodeop_p)();
+ extern int (**nfsv2_vnodeop_p) __P((void *));
+ extern int (**spec_nfsv2nodeop_p) __P((void *));
#ifdef FIFO
- extern int (**fifo_nfsv2nodeop_p)();
+ extern int (**fifo_nfsv2nodeop_p) __P((void *));
#endif
if (vp->v_op != nfsv2_vnodeop_p
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
- printf("vnode_pager_io(%x, %x, %c): vnode %x\n",
+ printf("vnode_pager_io(%p, %p, %c): vnode %p\n",
vnp, m, rw == UIO_READ ? 'R' : 'W', vnp->vnp_vp);
#endif
foff = m->offset + m->object->paging_offset;
vm_pager_unmap_pages(kva, npages);
#ifdef DEBUG
if (vpagerdebug & VDB_SIZE)
- printf("vnode_pager_io: vp %x, off %d size %d\n",
+ printf("vnode_pager_io: vp %p, off %d size %d\n",
vnp->vnp_vp, foff, vnp->vnp_size);
#endif
return(VM_PAGER_BAD);
auio.uio_procp = (struct proc *)0;
#ifdef DEBUG
if (vpagerdebug & VDB_IO)
- printf("vnode_pager_io: vp %x kva %x foff %x size %x",
+ printf("vnode_pager_io: vp %p kva %x foff %x size %x",
vnp->vnp_vp, kva, foff, size);
#endif
if (rw == UIO_READ)