17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate * CDDL HEADER START
37c478bd9Sstevel@tonic-gate *
47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the
5ae115bc7Smrj * Common Development and Distribution License (the "License").
6ae115bc7Smrj * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate *
87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate * and limitations under the License.
127c478bd9Sstevel@tonic-gate *
137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate *
197c478bd9Sstevel@tonic-gate * CDDL HEADER END
207c478bd9Sstevel@tonic-gate */
217c478bd9Sstevel@tonic-gate /*
22*a3114836SGerry Liu * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
237c478bd9Sstevel@tonic-gate * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate */
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gate #include <sys/types.h>
277c478bd9Sstevel@tonic-gate #include <sys/cmn_err.h>
287c478bd9Sstevel@tonic-gate #include <sys/errno.h>
297c478bd9Sstevel@tonic-gate #include <sys/debug.h>
307c478bd9Sstevel@tonic-gate #include <vm/page.h>
317c478bd9Sstevel@tonic-gate #include <sys/mem_config.h>
327c478bd9Sstevel@tonic-gate #include <sys/mem_cage.h>
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gate /* These should be in a platform stubs file. */
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gate int kcage_on;
377c478bd9Sstevel@tonic-gate kthread_id_t kcage_cageout_thread;
387c478bd9Sstevel@tonic-gate pgcnt_t kcage_freemem;
397c478bd9Sstevel@tonic-gate pgcnt_t kcage_throttlefree;
407c478bd9Sstevel@tonic-gate pgcnt_t kcage_minfree;
417c478bd9Sstevel@tonic-gate pgcnt_t kcage_desfree;
427c478bd9Sstevel@tonic-gate pgcnt_t kcage_needfree;
437c478bd9Sstevel@tonic-gate pgcnt_t kcage_lotsfree = 1;
447c478bd9Sstevel@tonic-gate
45*a3114836SGerry Liu #if !defined(__x86) || defined(__xpv)
467c478bd9Sstevel@tonic-gate /*ARGSUSED*/
477c478bd9Sstevel@tonic-gate int
kphysm_setup_func_register(kphysm_setup_vector_t * vec,void * arg)487c478bd9Sstevel@tonic-gate kphysm_setup_func_register(kphysm_setup_vector_t *vec, void *arg)
497c478bd9Sstevel@tonic-gate {
507c478bd9Sstevel@tonic-gate return (0);
517c478bd9Sstevel@tonic-gate }
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gate /*ARGSUSED*/
547c478bd9Sstevel@tonic-gate void
kphysm_setup_func_unregister(kphysm_setup_vector_t * vec,void * arg)557c478bd9Sstevel@tonic-gate kphysm_setup_func_unregister(kphysm_setup_vector_t *vec, void *arg)
567c478bd9Sstevel@tonic-gate {
577c478bd9Sstevel@tonic-gate }
58*a3114836SGerry Liu #endif
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gate /*ARGSUSED*/
617c478bd9Sstevel@tonic-gate int
kcage_create_throttle(pgcnt_t npages,int flags)627c478bd9Sstevel@tonic-gate kcage_create_throttle(pgcnt_t npages, int flags)
637c478bd9Sstevel@tonic-gate {
647c478bd9Sstevel@tonic-gate return (0);
657c478bd9Sstevel@tonic-gate }
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gate void
kcage_cageout_init(void)687c478bd9Sstevel@tonic-gate kcage_cageout_init(void)
697c478bd9Sstevel@tonic-gate {
707c478bd9Sstevel@tonic-gate }
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gate void
kcage_cageout_wakeup()737c478bd9Sstevel@tonic-gate kcage_cageout_wakeup()
747c478bd9Sstevel@tonic-gate {
757c478bd9Sstevel@tonic-gate }
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gate void
kcage_tick()787c478bd9Sstevel@tonic-gate kcage_tick()
797c478bd9Sstevel@tonic-gate {
807c478bd9Sstevel@tonic-gate }
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gate /*ARGSUSED*/
837c478bd9Sstevel@tonic-gate int
kcage_current_pfn(pfn_t * pfn)847c478bd9Sstevel@tonic-gate kcage_current_pfn(pfn_t *pfn)
857c478bd9Sstevel@tonic-gate {
867c478bd9Sstevel@tonic-gate return (0);
877c478bd9Sstevel@tonic-gate }
88