| version 1.122, 2006/09/03 06:25:19 |
version 1.122.2.1, 2006/09/11 00:12:01 |
|
|
| /* $NetBSD$ */ |
/* $NetBSD$ */ |
| |
|
| /*- |
/*- |
| * Copyright (c) 1997, 1999, 2000 The NetBSD Foundation, Inc. |
* Copyright (c) 1997, 1999, 2000, 2002 The NetBSD Foundation, Inc. |
| * All rights reserved. |
* All rights reserved. |
| * |
* |
| * This code is derived from software contributed to The NetBSD Foundation |
* This code is derived from software contributed to The NetBSD Foundation |
| Line 1135 pool_get(struct pool *pp, int flags) |
|
| Line 1135 pool_get(struct pool *pp, int flags) |
|
| } |
} |
| |
|
| simple_unlock(&pp->pr_slock); |
simple_unlock(&pp->pr_slock); |
| |
KASSERT((((vaddr_t)v + pp->pr_itemoffset) & (pp->pr_align - 1)) == 0); |
| return (v); |
return (v); |
| } |
} |
| |
|
| Line 1371 pool_prime_page(struct pool *pp, caddr_t |
|
| Line 1372 pool_prime_page(struct pool *pp, caddr_t |
|
| { |
{ |
| struct pool_item *pi; |
struct pool_item *pi; |
| caddr_t cp = storage; |
caddr_t cp = storage; |
| unsigned int align = pp->pr_align; |
const unsigned int align = pp->pr_align; |
| unsigned int ioff = pp->pr_itemoffset; |
const unsigned int ioff = pp->pr_itemoffset; |
| int n; |
int n; |
| |
|
| LOCK_ASSERT(simple_lock_held(&pp->pr_slock)); |
LOCK_ASSERT(simple_lock_held(&pp->pr_slock)); |
| Line 1409 pool_prime_page(struct pool *pp, caddr_t |
|
| Line 1410 pool_prime_page(struct pool *pp, caddr_t |
|
| if (ioff != 0) |
if (ioff != 0) |
| cp = (caddr_t)(cp + (align - ioff)); |
cp = (caddr_t)(cp + (align - ioff)); |
| |
|
| |
KASSERT((((vaddr_t)cp + ioff) & (align - 1)) == 0); |
| |
|
| /* |
/* |
| * Insert remaining chunks on the bucket list. |
* Insert remaining chunks on the bucket list. |
| */ |
*/ |
| Line 1436 pool_prime_page(struct pool *pp, caddr_t |
|
| Line 1439 pool_prime_page(struct pool *pp, caddr_t |
|
| pi->pi_magic = PI_MAGIC; |
pi->pi_magic = PI_MAGIC; |
| #endif |
#endif |
| cp = (caddr_t)(cp + pp->pr_size); |
cp = (caddr_t)(cp + pp->pr_size); |
| |
|
| |
KASSERT((((vaddr_t)cp + ioff) & (align - 1)) == 0); |
| } |
} |
| } |
} |
| |
|
| Line 2068 pool_cache_get_paddr(struct pool_cache * |
|
| Line 2073 pool_cache_get_paddr(struct pool_cache * |
|
| return (NULL); |
return (NULL); |
| } |
} |
| } |
} |
| |
KASSERT((((vaddr_t)object + pc->pc_pool->pr_itemoffset) & |
| |
(pc->pc_pool->pr_align - 1)) == 0); |
| if (object != NULL && pap != NULL) { |
if (object != NULL && pap != NULL) { |
| #ifdef POOL_VTOPHYS |
#ifdef POOL_VTOPHYS |
| *pap = POOL_VTOPHYS(object); |
*pap = POOL_VTOPHYS(object); |
| Line 2088 pool_cache_get_paddr(struct pool_cache * |
|
| Line 2095 pool_cache_get_paddr(struct pool_cache * |
|
| } |
} |
| simple_unlock(&pc->pc_slock); |
simple_unlock(&pc->pc_slock); |
| |
|
| |
KASSERT((((vaddr_t)object + pc->pc_pool->pr_itemoffset) & |
| |
(pc->pc_pool->pr_align - 1)) == 0); |
| return (object); |
return (object); |
| } |
} |
| |
|