10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 54688Stomee * Common Development and Distribution License (the "License"). 64688Stomee * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*8721SJonathan.Adams@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _KMEM_H 270Sstevel@tonic-gate #define _KMEM_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #include <mdb/mdb_modapi.h> 300Sstevel@tonic-gate 310Sstevel@tonic-gate #ifdef __cplusplus 320Sstevel@tonic-gate extern "C" { 330Sstevel@tonic-gate #endif 340Sstevel@tonic-gate 350Sstevel@tonic-gate extern int kmem_cache_walk_init(mdb_walk_state_t *); 360Sstevel@tonic-gate 370Sstevel@tonic-gate extern int kmem_cpu_cache_walk_init(mdb_walk_state_t *); 380Sstevel@tonic-gate extern int kmem_cpu_cache_walk_step(mdb_walk_state_t *); 390Sstevel@tonic-gate 400Sstevel@tonic-gate extern int kmem_slab_walk_init(mdb_walk_state_t *); 410Sstevel@tonic-gate extern int kmem_slab_walk_partial_init(mdb_walk_state_t *); 420Sstevel@tonic-gate 430Sstevel@tonic-gate extern int kmem_hash_walk_init(mdb_walk_state_t *wsp); 440Sstevel@tonic-gate extern int kmem_hash_walk_step(mdb_walk_state_t *wsp); 450Sstevel@tonic-gate extern void kmem_hash_walk_fini(mdb_walk_state_t *wsp); 460Sstevel@tonic-gate 470Sstevel@tonic-gate extern int kmem_walk_init(mdb_walk_state_t *); 480Sstevel@tonic-gate extern int bufctl_walk_init(mdb_walk_state_t *); 490Sstevel@tonic-gate extern int freemem_walk_init(mdb_walk_state_t *); 500Sstevel@tonic-gate extern int freemem_constructed_walk_init(mdb_walk_state_t *); 510Sstevel@tonic-gate extern int freectl_walk_init(mdb_walk_state_t *); 520Sstevel@tonic-gate extern int freectl_constructed_walk_init(mdb_walk_state_t *); 530Sstevel@tonic-gate 540Sstevel@tonic-gate extern int kmem_walk_step(mdb_walk_state_t *); 550Sstevel@tonic-gate extern void kmem_walk_fini(mdb_walk_state_t *); 560Sstevel@tonic-gate 570Sstevel@tonic-gate extern int bufctl_history_walk_init(mdb_walk_state_t *); 580Sstevel@tonic-gate extern int bufctl_history_walk_step(mdb_walk_state_t *); 590Sstevel@tonic-gate extern void bufctl_history_walk_fini(mdb_walk_state_t *); 600Sstevel@tonic-gate 610Sstevel@tonic-gate extern int kmem_log_walk_init(mdb_walk_state_t *); 620Sstevel@tonic-gate extern int kmem_log_walk_step(mdb_walk_state_t *); 630Sstevel@tonic-gate extern void kmem_log_walk_fini(mdb_walk_state_t *); 640Sstevel@tonic-gate 650Sstevel@tonic-gate extern int allocdby_walk_init(mdb_walk_state_t *); 660Sstevel@tonic-gate extern int allocdby_walk_step(mdb_walk_state_t *); 670Sstevel@tonic-gate extern void allocdby_walk_fini(mdb_walk_state_t *); 680Sstevel@tonic-gate 690Sstevel@tonic-gate extern int freedby_walk_init(mdb_walk_state_t *); 700Sstevel@tonic-gate extern int freedby_walk_step(mdb_walk_state_t *); 710Sstevel@tonic-gate extern void freedby_walk_fini(mdb_walk_state_t *); 720Sstevel@tonic-gate 730Sstevel@tonic-gate extern int vmem_walk_init(mdb_walk_state_t *); 740Sstevel@tonic-gate extern int vmem_walk_step(mdb_walk_state_t *); 750Sstevel@tonic-gate extern void vmem_walk_fini(mdb_walk_state_t *); 760Sstevel@tonic-gate 770Sstevel@tonic-gate extern int vmem_postfix_walk_step(mdb_walk_state_t *); 780Sstevel@tonic-gate 790Sstevel@tonic-gate extern int vmem_seg_walk_init(mdb_walk_state_t *); 800Sstevel@tonic-gate extern int vmem_seg_walk_step(mdb_walk_state_t *); 810Sstevel@tonic-gate extern void vmem_seg_walk_fini(mdb_walk_state_t *); 820Sstevel@tonic-gate 830Sstevel@tonic-gate extern int vmem_span_walk_init(mdb_walk_state_t *); 840Sstevel@tonic-gate extern int vmem_alloc_walk_init(mdb_walk_state_t *); 850Sstevel@tonic-gate extern int vmem_free_walk_init(mdb_walk_state_t *); 860Sstevel@tonic-gate 870Sstevel@tonic-gate extern int kmem_cache(uintptr_t, uint_t, int, const mdb_arg_t *); 884688Stomee extern int kmem_slabs(uintptr_t, uint_t, int, const mdb_arg_t *); 890Sstevel@tonic-gate extern int allocdby(uintptr_t, uint_t, int, const mdb_arg_t *); 900Sstevel@tonic-gate extern int freedby(uintptr_t, uint_t, int, const mdb_arg_t *); 910Sstevel@tonic-gate extern int kmem_log(uintptr_t, uint_t, int, const mdb_arg_t *); 920Sstevel@tonic-gate extern int kmem_debug(uintptr_t, uint_t, int, const mdb_arg_t *); 930Sstevel@tonic-gate extern int bufctl(uintptr_t, uint_t, int, const mdb_arg_t *); 940Sstevel@tonic-gate extern int kmem_verify(uintptr_t, uint_t, int, const mdb_arg_t *); 950Sstevel@tonic-gate extern int kmem_verify_alloc(uintptr_t, uint_t, int, const mdb_arg_t *); 960Sstevel@tonic-gate extern int kmem_verify_free(uintptr_t, uint_t, int, const mdb_arg_t *); 970Sstevel@tonic-gate extern int vmem(uintptr_t, uint_t, int, const mdb_arg_t *); 980Sstevel@tonic-gate extern int vmem_seg(uintptr_t, uint_t, int, const mdb_arg_t *); 990Sstevel@tonic-gate extern int kmalog(uintptr_t, uint_t, int, const mdb_arg_t *); 1000Sstevel@tonic-gate extern int kmausers(uintptr_t, uint_t, int, const mdb_arg_t *); 1016712Stomee extern void kmem_cache_help(void); 1026712Stomee extern void kmem_slabs_help(void); 1030Sstevel@tonic-gate extern void bufctl_help(void); 1040Sstevel@tonic-gate extern void vmem_seg_help(void); 1050Sstevel@tonic-gate extern void kmausers_help(void); 1060Sstevel@tonic-gate 1070Sstevel@tonic-gate extern int whatthread(uintptr_t, uint_t, int, const mdb_arg_t *); 1080Sstevel@tonic-gate 1090Sstevel@tonic-gate /* 1100Sstevel@tonic-gate * utility functions for the rest of genunix 1110Sstevel@tonic-gate */ 1120Sstevel@tonic-gate extern void kmem_init(void); 113*8721SJonathan.Adams@Sun.COM extern void kmem_statechange(void); 1140Sstevel@tonic-gate extern int kmem_get_magsize(const kmem_cache_t *); 1150Sstevel@tonic-gate extern size_t kmem_estimate_allocated(uintptr_t, const kmem_cache_t *); 1160Sstevel@tonic-gate 1170Sstevel@tonic-gate #ifdef __cplusplus 1180Sstevel@tonic-gate } 1190Sstevel@tonic-gate #endif 1200Sstevel@tonic-gate 1210Sstevel@tonic-gate #endif /* _KMEM_H */ 122