From 1751d830e6df144acfbdbcf6ba548787e6055c03 Mon Sep 17 00:00:00 2001 From: wiz Date: Thu, 26 Oct 2006 11:16:28 +0000 Subject: [PATCH] Various minor improvements. --- share/man/man9/vmem.9 | 7 +++---- share/man/man9/vmem_alloc.9 | 20 ++++++++++---------- share/man/man9/vmem_create.9 | 18 +++++++++--------- share/man/man9/vmem_destroy.9 | 4 ++-- share/man/man9/vmem_free.9 | 4 ++-- 5 files changed, 26 insertions(+), 27 deletions(-) diff --git a/share/man/man9/vmem.9 b/share/man/man9/vmem.9 index ab687e51388f..ff07f7546405 100644 --- a/share/man/man9/vmem.9 +++ b/share/man/man9/vmem.9 @@ -1,4 +1,4 @@ -.\" $NetBSD: vmem.9,v 1.2 2006/10/23 21:21:49 peter Exp $ +.\" $NetBSD: vmem.9,v 1.3 2006/10/26 11:16:28 wiz Exp $ .\" .\" Copyright (c)2006 YAMAMOTO Takashi, .\" All rights reserved. @@ -37,7 +37,7 @@ The .Nm is a general purpose resource allocator. -Despite of its name, it can be used for arbitrary resources +Despite its name, it can be used for arbitrary resources other than virtual memory. .\" ------------------------------------------------------------ .Sh CODE REFERENCES @@ -45,8 +45,7 @@ This section describes places within the .Nx source tree where actual code implementing the .Nm -subsystem -can be found. +subsystem can be found. All pathnames are relative to .Pa /usr/src . .Pp diff --git a/share/man/man9/vmem_alloc.9 b/share/man/man9/vmem_alloc.9 index 67da83873075..67045b5772e7 100644 --- a/share/man/man9/vmem_alloc.9 +++ b/share/man/man9/vmem_alloc.9 @@ -1,4 +1,4 @@ -.\" $NetBSD: vmem_alloc.9,v 1.1 2006/10/22 11:14:52 yamt Exp $ +.\" $NetBSD: vmem_alloc.9,v 1.2 2006/10/26 11:16:28 wiz Exp $ .\" .\" Copyright (c)2006 YAMAMOTO Takashi, .\" All rights reserved. @@ -42,39 +42,39 @@ .\" ------------------------------------------------------------ .Sh DESCRIPTION .Fn vmem_alloc -allocates resource from the arena. +allocates a resource from the arena. .Pp .Bl -tag -width flags .It Fa vm The arena which we allocate from. .It Fa size -Specify the size of allocation. +Specify the size of the allocation. .It Fa flags A bitwise OR of an allocation strategy and a sleep flag. .Pp The allocation strategy is one of: .Bl -tag -width VM_INSTANTFIT -.It VM_BESTFIT +.It Dv VM_BESTFIT Prefer space efficiency. -.It VM_INSTANTFIT +.It Dv VM_INSTANTFIT Prefer performance. .El .Pp The sleep flag should be one of: .Bl -tag -width VM_NOSLEEP -.It VM_SLEEP -Can sleep until enough resource is available. -.It VM_NOSLEEP +.It Dv VM_SLEEP +Can sleep until enough resources are available. +.It Dv VM_NOSLEEP Don't sleep. Immediately return .Dv VMEM_ADDR_NULL -if there is not enough resource available. +if there are not enough resources available. .El .El .\" ------------------------------------------------------------ .Sh RETURN VALUES .Fn vmem_alloc -return an allocated vmem_addr_t. +returns an allocated vmem_addr_t. Otherwise, it returns .Dv VMEM_ADDR_NULL . .\" ------------------------------------------------------------ diff --git a/share/man/man9/vmem_create.9 b/share/man/man9/vmem_create.9 index 7fe4b13fa32e..3a8072171f3f 100644 --- a/share/man/man9/vmem_create.9 +++ b/share/man/man9/vmem_create.9 @@ -1,4 +1,4 @@ -.\" $NetBSD: vmem_create.9,v 1.1 2006/10/22 11:14:52 yamt Exp $ +.\" $NetBSD: vmem_create.9,v 1.2 2006/10/26 11:16:28 wiz Exp $ .\" .\" Copyright (c)2006 YAMAMOTO Takashi, .\" All rights reserved. @@ -31,7 +31,7 @@ .\" ------------------------------------------------------------ .Sh NAME .Nm vmem_create -.Nd Create a vmem arena +.Nd create a vmem arena .\" ------------------------------------------------------------ .Sh SYNOPSIS .In sys/vmem.h @@ -51,12 +51,12 @@ creates a new vmem arena. .It Fa name The string to describe the vmem. .It Fa base -The start address of initial span. +The start address of the initial span. It can be .Dv VMEM_ADDR_NULL if no initial span is required. .It Fa size -The size of initial span. +The size of the initial span. .It Fa quantum The smallest unit of allocation. .It Fa allocfn @@ -67,17 +67,17 @@ The callback function used to free spans to the backend arena. The backend arena. .It Fa qcache_max The largest size of allocations which can be served by quantum cache. -It's merely a hint and can be ignored. +It is merely a hint and can be ignored. .It Fa flags Either of: .Bl -tag -width VM_NOSLEEP -.It VM_SLEEP -Can sleep until enough resource is available. -.It VM_NOSLEEP +.It Dv VM_SLEEP +Can sleep until enough resources are available. +.It VDv M_NOSLEEP Don't sleep. Immediately return .Dv NULL -if there is not enough resource available. +if there are not enough resources available. .El .El .\" ------------------------------------------------------------ diff --git a/share/man/man9/vmem_destroy.9 b/share/man/man9/vmem_destroy.9 index 4b36b8ac67ef..1b45908e0ea2 100644 --- a/share/man/man9/vmem_destroy.9 +++ b/share/man/man9/vmem_destroy.9 @@ -1,4 +1,4 @@ -.\" $NetBSD: vmem_destroy.9,v 1.2 2006/10/22 11:23:32 yamt Exp $ +.\" $NetBSD: vmem_destroy.9,v 1.3 2006/10/26 11:16:28 wiz Exp $ .\" .\" Copyright (c)2006 YAMAMOTO Takashi, .\" All rights reserved. @@ -31,7 +31,7 @@ .\" ------------------------------------------------------------ .Sh NAME .Nm vmem_create -.Nd Destroy a vmem arena +.Nd destroy a vmem arena .\" ------------------------------------------------------------ .Sh SYNOPSIS .In sys/vmem.h diff --git a/share/man/man9/vmem_free.9 b/share/man/man9/vmem_free.9 index f69ba6788fd5..aec784d96a3a 100644 --- a/share/man/man9/vmem_free.9 +++ b/share/man/man9/vmem_free.9 @@ -1,4 +1,4 @@ -.\" $NetBSD: vmem_free.9,v 1.1 2006/10/22 11:14:52 yamt Exp $ +.\" $NetBSD: vmem_free.9,v 1.2 2006/10/26 11:16:28 wiz Exp $ .\" .\" Copyright (c)2006 YAMAMOTO Takashi, .\" All rights reserved. @@ -31,7 +31,7 @@ .\" ------------------------------------------------------------ .Sh NAME .Nm vmem_free -.Nd Free resource to arena +.Nd free resource to arena .\" ------------------------------------------------------------ .Sh SYNOPSIS .In sys/vmem.h