/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1998 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/ddi_impldefs.h>
#include <sys/sysmacros.h>
#include <sys/machsystm.h>
#include <sys/machparam.h>
#include <sys/cpu_module.h>
#include <vm/hat_sfmmu.h>
#include <sys/mem_config.h>
#include <sys/mem_cage.h>
extern ac_err_t ac_kpm_err_cvt(int);
#ifdef DEBUG
static int ac_do_query_check = 0;
#endif /* DEBUG */
int
{
int ret;
int retval;
/*
* Is the specified bank present?
*/
return (EINVAL);
}
/* verify the board is of the correct type */
case CPU_BOARD:
case MEM_BOARD:
break;
default:
return (EINVAL);
}
/*
* Busy could also be set for fhc_bd_busy(ac->board)
* however, this is just advisory information so limit it
* to memory operation in progress.
*/
/*
* Determine the physical location of the selected bank
*/
goto out;
}
#ifdef DEBUG
if (ac_do_query_check) {
/*
* This can happen in normal concurrent
* operation.
*/
"memq.phys_pages != npgs (%ld != %ld)",
}
}
#endif /* DEBUG */
if (!kcage_on)
else
} else
/* Bank is in state Spare */
}
/* return the information to the user */
#ifdef _MULTI_DATAMODEL
case DDI_MODEL_ILP32: {
sizeof (ac_stat32_t), flag) != 0) {
}
break;
}
case DDI_MODEL_NONE:
}
break;
}
#else /* _MULTI_DATAMODEL */
}
#endif /* _MULTI_DATAMODEL */
out:
return (retval);
}
#ifdef DEBUG
static void
{
int done_first_nonreloc;
int all_pop;
pgcnt_t n;
int ret;
memq.phys_pages = 0;
memq.nonrelocatable = 0;
memq.first_nonrelocatable = 0;
memq.last_nonrelocatable = 0;
done_first_nonreloc = 0;
continue;
}
printf("%ld: phys_pages = %ld, expected 1\n",
} else
printf("%ld: phys_pages = %ld, expected 0 or 1\n",
}
printf("%ld: managed = %ld, expected 0 or 1\n",
}
printf("%ld: nonrelocatable = %ld, expected 0 or 1\n",
}
if (amemq.nonrelocatable != 0) {
printf("%ld: first_nonrelocatable = %ld\n",
}
printf("%ld: last_nonrelocatable = %ld\n",
}
if (!done_first_nonreloc) {
done_first_nonreloc = 1;
}
}
}
printf("query phys_pages: %ld != %ld\n",
}
printf("query managed: %ld != %ld\n",
}
printf("query nonrelocatable: %ld != %ld\n",
}
printf("query first_nonrelocatable: %ld != %ld\n",
}
printf("query last_nonrelocatable: %ld != %ld\n",
}
}
#endif /* DEBUG */