4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
38 typedef struct hment hment_t
;
43 * Remove a page mapping, finds the matching mapping and unlinks it from
44 * the page_t. If it returns a non-NULL pointer, the pointer must be
45 * freed via hment_free() after doing x86_hm_exit().
47 extern hment_t
*hment_remove(page_t
*, htable_t
*ht
, uint_t entry
);
48 extern void hment_free(hment_t
*);
51 * Iterator to walk through all mappings of a page.
53 extern hment_t
*hment_walk(page_t
*, htable_t
**, uint_t
*, hment_t
*);
56 * Prepare a page for a new mapping
58 extern hment_t
*hment_prepare(htable_t
*ht
, uint_t entry
, page_t
*);
61 * Add a mapping to a page's mapping list
63 extern void hment_assign(htable_t
*ht
, uint_t entry
, page_t
*, hment_t
*);
66 * initialize hment data structures
68 extern void hment_init(void);
71 * lock/unlock a page_t's mapping list/pte entry
73 extern void x86_hm_enter(page_t
*);
74 extern void x86_hm_exit(page_t
*);
75 extern int x86_hm_held(page_t
*pp
);
78 * Called to allocate additional hments for reserve.
80 * The hment_reserve_count is exported for use by htable_hment_steal()
82 extern void hment_reserve(uint_t
);
83 extern uint_t hment_reserve_count
;
86 * Used to readjust the hment reserve after the reserve list has been used.
87 * Also called after boot to release left over boot reserves.
89 extern void hment_adjust_reserve(void);
92 * Return the number of mappings of a page_t
94 extern uint_t
hment_mapcnt(page_t
*);
103 #endif /* _VM_HMENT_H */