Beispiel #1
0
int
acpi_build(struct vmctx *ctx, int ncpu)
{
	int err;
	int i;

	basl_ncpu = ncpu;

	/*
	 * For debug, allow the user to have iasl compiler output sent
	 * to stdout rather than /dev/null
	 */
	if (getenv("ACPI_VERBOSE_IASL"))
		basl_verbose_iasl = 1;

	/*
	 * Allow the user to keep the generated ASL files for debugging
	 * instead of deleting them following use
	 */
	if (getenv("ACPI_KEEPTMPS"))
		basl_keep_temps = 1;

	i = 0;
	err = basl_make_templates();

	/* Check PSDS in SOS, only present PSDS table to UOS when PSDS present in SOS */
	psds_fd = open("/sys/firmware/acpi/tables/PSDS", O_RDONLY);
	if (psds_fd >=0)
		acpi_table_enable(PSDS_ENTRY_NO);

	/*
	 * Run through all the ASL files, compiling them and
	 * copying them into guest memory
	 */
	while (!err && (i < ARRAY_SIZE(basl_ftables))) {
		if ((basl_ftables[i].offset == TPM2_OFFSET) &&
			(ctx->tpm_dev != NULL)) {
				basl_ftables[i].valid = true;
		}

		if (acpi_table_is_valid(i))
			err = basl_compile(ctx, basl_ftables[i].wsect,
					basl_ftables[i].offset);
		i++;
	}

	if (psds_fd >=0)
		close(psds_fd);

	return err;
}
Beispiel #2
0
int
acpi_build(struct vmctx *ctx, int ncpu, int ioapic)
{
	int err;
	int i;

	err = 0;
	basl_ncpu = ncpu;

	if (!ioapic) {
		fprintf(stderr, "ACPI tables require an ioapic\n");
		return (EINVAL);
	}

	/*
	 * For debug, allow the user to have iasl compiler output sent
	 * to stdout rather than /dev/null
	 */
	if (getenv("BHYVE_ACPI_VERBOSE_IASL"))
		basl_verbose_iasl = 1;

	/*
	 * Allow the user to keep the generated ASL files for debugging
	 * instead of deleting them following use
	 */
	if (getenv("BHYVE_ACPI_KEEPTMPS"))
		basl_keep_temps = 1;

	i = 0;
	err = basl_make_templates();

	/*
	 * Run through all the ASL files, compiling them and
	 * copying them into guest memory
	 */
	while (!err && basl_ftables[i].wsect != NULL) {
		err = basl_compile(basl_ftables[i].wsect,
				   basl_ftables[i].offset);
		i++;
	}

	return (err);
}
Beispiel #3
0
int
acpi_build(int ncpu)
{
	int err;
	int i;

	basl_ncpu = ncpu;

	err = xh_vm_get_hpet_capabilities(&hpet_capabilities);
	if (err != 0)
		return (err);

	/*
	 * For debug, allow the user to have iasl compiler output sent
	 * to stdout rather than /dev/null
	 */
	if (getenv("BHYVE_ACPI_VERBOSE_IASL"))
		basl_verbose_iasl = 1;

	/*
	 * Allow the user to keep the generated ASL files for debugging
	 * instead of deleting them following use
	 */
	if (getenv("BHYVE_ACPI_KEEPTMPS"))
		basl_keep_temps = 1;

	i = 0;
	err = basl_make_templates();

	/*
	 * Run through all the ASL files, compiling them and
	 * copying them into guest memory
	 */
	while (!err && basl_ftables[i].wsect != NULL) {
		err = basl_compile(basl_ftables[i].wsect,
				   basl_ftables[i].offset);
		i++;
	}

	return (err);
}