Пример #1
0
ACPI_STATUS
AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable,
    ACPI_TABLE_HEADER **NewTable)
{
	char modname[] = "acpi_dsdt";
	caddr_t acpi_table;
	ACPI_TABLE_HEADER *hdr;
	size_t sz;

	if (ExistingTable == NULL || NewTable == NULL)
		return (AE_BAD_PARAMETER);

	*NewTable = NULL;
	if (!ACPI_COMPARE_NAME(ExistingTable->Signature, ACPI_SIG_DSDT))
#ifdef notyet
		for (int i = 0; i < ACPI_NAME_SIZE; i++)
			modname[i + 5] = tolower(ExistingTable->Signature[i]);
#else
		return (AE_SUPPORT);
#endif
	acpi_table = preload_search_by_type(modname);
	if (acpi_table == NULL)
		return (AE_NOT_FOUND);
	hdr = preload_fetch_addr(acpi_table);
	sz = preload_fetch_size(acpi_table);
	if (hdr == NULL || sz == 0)
		return (AE_ERROR);
#ifndef notyet
	/* Assume SSDT is installed with DSDT. */
	AcpiGbl_DisableSsdtTableInstall = TRUE;
#endif
	*NewTable = hdr;
	return (AE_OK);
}
Пример #2
0
static int
splash_find_data(splash_decoder_t *decoder)
{
	caddr_t image_module;
	void *ptr;
	size_t sz;

	if (decoder->data_type == NULL)
		return (0);

	image_module = preload_search_by_type(decoder->data_type);
	if (image_module == NULL)
		return (ENOENT);

	ptr = preload_fetch_addr(image_module);
	sz = preload_fetch_size(image_module);
	if (ptr == NULL || sz == 0)
		return (ENOENT);

	if (bootverbose)
		printf("splash: image@%p, size:%zu\n", ptr, sz);

	decoder->data = ptr;
	decoder->data_size = sz;
	return (0);
}
Пример #3
0
int
kobj_read_file_loader(struct _buf *file, char *buf, unsigned size, unsigned off)
{
	char *ptr;

	ptr = preload_fetch_addr(file->ptr);
	if (ptr == NULL)
		return (ENOENT);
	bcopy(ptr + off, buf, size);
	return (0);
}