/*CONTCOND*/ while (0)'ed macros

This commit is contained in:
perry 2002-11-02 07:40:47 +00:00
parent e6873029ee
commit bbad42171f
5 changed files with 29 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_map.c,v 1.123 2002/10/24 22:22:28 atatat Exp $ */
/* $NetBSD: uvm_map.c,v 1.124 2002/11/02 07:40:47 perry Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.123 2002/10/24 22:22:28 atatat Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.124 2002/11/02 07:40:47 perry Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@ -146,7 +146,7 @@ vaddr_t uvm_maxkaddr;
(entry)->next = (after_where)->next; \
(entry)->prev->next = (entry); \
(entry)->next->prev = (entry); \
} while (0)
} while (/*CONSTCOND*/ 0)
/*
* uvm_map_entry_unlink: remove entry from a map
@ -157,7 +157,7 @@ vaddr_t uvm_maxkaddr;
(map)->nentries--; \
(entry)->next->prev = (entry)->prev; \
(entry)->prev->next = (entry)->next; \
} while (0)
} while (/*CONSTCOND*/ 0)
/*
* SAVE_HINT: saves the specified entry as the hint for future lookups.
@ -169,7 +169,7 @@ vaddr_t uvm_maxkaddr;
if ((map)->hint == (check)) \
(map)->hint = (value); \
simple_unlock(&(map)->hint_lock); \
} while (0)
} while (/*CONSTCOND*/ 0)
/*
* VM_MAP_RANGE_CHECK: check and correct range
@ -184,7 +184,7 @@ vaddr_t uvm_maxkaddr;
end = vm_map_max(map); \
if (start > end) \
start = end; \
} while (0)
} while (/*CONSTCOND*/ 0)
/*
* local prototypes

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_map.h,v 1.32 2002/09/22 07:21:31 chs Exp $ */
/* $NetBSD: uvm_map.h,v 1.33 2002/11/02 07:40:49 perry Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -238,7 +238,7 @@ do { \
simple_lock(&(map)->flags_lock); \
(map)->flags = ((map)->flags | (set)) & ~(clear); \
simple_unlock(&(map)->flags_lock); \
} while (0)
} while (/*CONSTCOND*/ 0)
#endif /* _KERNEL */
/*
@ -399,7 +399,7 @@ do { \
if ((map)->flags & VM_MAP_INTRSAFE) \
panic("vm_map_lock_read: intrsafe Map"); \
(void) lockmgr(&(map)->lock, LK_SHARED, NULL); \
} while (0)
} while (/*CONSTCOND*/ 0)
#else
#define vm_map_lock_read(map) \
(void) lockmgr(&(map)->lock, LK_SHARED, NULL)
@ -411,7 +411,7 @@ do { \
simple_unlock(&(map)->lock.lk_interlock); \
else \
(void) lockmgr(&(map)->lock, LK_RELEASE, NULL); \
} while (0)
} while (/*CONSTCOND*/ 0)
#define vm_map_unlock_read(map) \
(void) lockmgr(&(map)->lock, LK_RELEASE, NULL)
@ -424,7 +424,7 @@ do { \
do { \
if (lockmgr(&(map)->lock, LK_UPGRADE, NULL) != 0) \
panic("vm_map_upgrade: failed to upgrade lock"); \
} while (0)
} while (/*CONSTCOND*/ 0)
#else
#define vm_map_upgrade(map) \
(void) lockmgr(&(map)->lock, LK_UPGRADE, NULL)
@ -435,7 +435,7 @@ do { \
simple_lock(&(map)->flags_lock); \
(map)->flags |= VM_MAP_BUSY; \
simple_unlock(&(map)->flags_lock); \
} while (0)
} while (/*CONSTCOND*/ 0)
#define vm_map_unbusy(map) \
do { \
@ -447,7 +447,7 @@ do { \
simple_unlock(&(map)->flags_lock); \
if (oflags & VM_MAP_WANTLOCK) \
wakeup(&(map)->flags); \
} while (0)
} while (/*CONSTCOND*/ 0)
#endif /* _KERNEL */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_pglist.c,v 1.24 2002/06/27 18:05:29 drochner Exp $ */
/* $NetBSD: uvm_pglist.c,v 1.25 2002/11/02 07:40:49 perry Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.24 2002/06/27 18:05:29 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.25 2002/11/02 07:40:49 perry Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -58,7 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.24 2002/06/27 18:05:29 drochner Exp
printf("%s:%d -- Already 0!\n", __FILE__, __LINE__); \
else \
(v)--; \
} while (0)
} while (/*CONSTCOND*/ 0)
u_long uvm_pglistalloc_npages;
#else
#define STAT_INCR(v)

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_stat.h,v 1.24 2002/03/05 05:45:54 simonb Exp $ */
/* $NetBSD: uvm_stat.h,v 1.25 2002/11/02 07:40:49 perry Exp $ */
/*
*
@ -79,17 +79,17 @@ do { \
uvm_cnt_head = &CNT; \
CNT.name = NAM; \
CNT.p = PRIV; \
} while (0)
} while (/*CONSTCOND*/ 0)
#define UVMCNT_SET(C,V) \
do { \
(C).c = (V); \
} while (0)
} while (/*CONSTCOND*/ 0)
#define UVMCNT_ADD(C,V) \
do { \
(C).c += (V); \
} while (0)
} while (/*CONSTCOND*/ 0)
#define UVMCNT_INCR(C) UVMCNT_ADD(C,1)
#define UVMCNT_DECR(C) UVMCNT_ADD(C,-1)
@ -169,7 +169,7 @@ do { \
M_WAITOK); \
memset((NAME).e, 0, sizeof(struct uvm_history_ent) * (N)); \
LIST_INSERT_HEAD(&uvm_histories, &(NAME), list); \
} while (0)
} while (/*CONSTCOND*/ 0)
#define UVMHIST_INIT_STATIC(NAME,BUF) \
do { \
@ -181,7 +181,7 @@ do { \
(NAME).e = (struct uvm_history_ent *) (BUF); \
memset((NAME).e, 0, sizeof(struct uvm_history_ent) * (NAME).n); \
LIST_INSERT_HEAD(&uvm_histories, &(NAME), list); \
} while (0)
} while (/*CONSTCOND*/ 0)
#if defined(UVMHIST_PRINT)
extern int uvmhist_print_enabled;
@ -191,7 +191,7 @@ do { \
uvmhist_print(E); \
DELAY(100000); \
} \
} while (0)
} while (/*CONSTCOND*/ 0)
#else
#define UVMHIST_PRINTNOW(E) /* nothing */
#endif
@ -216,7 +216,7 @@ do { \
(NAME).e[_i_].v[2] = (u_long)(C); \
(NAME).e[_i_].v[3] = (u_long)(D); \
UVMHIST_PRINTNOW(&((NAME).e[_i_])); \
} while (0)
} while (/*CONSTCOND*/ 0)
#define UVMHIST_CALLED(NAME) \
do { \
@ -228,7 +228,7 @@ do { \
splx(s); \
} \
UVMHIST_LOG(NAME,"called!", 0, 0, 0, 0); \
} while (0)
} while (/*CONSTCOND*/ 0)
#define UVMHIST_FUNC(FNAME) \
static int _uvmhist_cnt = 0; \

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_swap.c,v 1.72 2002/10/27 16:53:20 chs Exp $ */
/* $NetBSD: uvm_swap.c,v 1.73 2002/11/02 07:40:49 perry Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Matthew R. Green
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.72 2002/10/27 16:53:20 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.73 2002/11/02 07:40:49 perry Exp $");
#include "fs_nfs.h"
#include "opt_uvmhist.h"
@ -186,7 +186,7 @@ static struct pool vndbuf_pool;
int s = splbio(); \
vnx = pool_get(&vndxfer_pool, PR_WAITOK); \
splx(s); \
} while (0)
} while (/*CONSTCOND*/ 0)
#define putvndxfer(vnx) { \
pool_put(&vndxfer_pool, (void *)(vnx)); \
@ -196,7 +196,7 @@ static struct pool vndbuf_pool;
int s = splbio(); \
vbp = pool_get(&vndbuf_pool, PR_WAITOK); \
splx(s); \
} while (0)
} while (/*CONSTCOND*/ 0)
#define putvndbuf(vbp) { \
pool_put(&vndbuf_pool, (void *)(vbp)); \