Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5fc42ac authored by Bob Moore's avatar Bob Moore Committed by Len Brown
Browse files

ACPICA: misc fixes for new Table Manager:

parent f3d2e786
Loading
Loading
Loading
Loading
+11 −24
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ ACPI_MODULE_NAME("tbinstal")
 *****************************************************************************/
acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc)
{
	u8 checksum;
	acpi_status status;

	ACPI_FUNCTION_TRACE(tb_verify_table);

@@ -84,17 +84,9 @@ acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc)

	/* Always calculate checksum, ignore bad checksum if requested */

	checksum = acpi_tb_checksum(ACPI_CAST_PTR(void, table_desc->pointer),
				    table_desc->length);

#if (ACPI_CHECKSUM_ABORT)

	if (checksum) {
		return_ACPI_STATUS(AE_BAD_CHECKSUM);
	}
#endif

	return_ACPI_STATUS(AE_OK);
	status =
	    acpi_tb_verify_checksum(table_desc->pointer, table_desc->length);
	return_ACPI_STATUS(status);
}

/*******************************************************************************
@@ -188,7 +180,7 @@ acpi_status acpi_tb_resize_root_table_list(void)

	/* allow_resize flag is a parameter to acpi_initialize_tables */

	if (!(acpi_gbl_root_table_list.flags & ACPI_TABLE_FLAGS_ALLOW_RESIZE)) {
	if (!(acpi_gbl_root_table_list.flags & ACPI_ROOT_ALLOW_RESIZE)) {
		ACPI_ERROR((AE_INFO,
			    "Resize of Root Table Array is not allowed"));
		return_ACPI_STATUS(AE_SUPPORT);
@@ -212,18 +204,14 @@ acpi_status acpi_tb_resize_root_table_list(void)
			    acpi_gbl_root_table_list.size *
			    sizeof(struct acpi_table_desc));

		if (acpi_gbl_root_table_list.flags & ACPI_TABLE_ORIGIN_MASK ==
		    ACPI_TABLE_ORIGIN_ALLOCATED) {
		if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
			ACPI_FREE(acpi_gbl_root_table_list.tables);
		}
	}

	acpi_gbl_root_table_list.tables = tables;
	acpi_gbl_root_table_list.size += ACPI_ROOT_TABLE_SIZE_INCREMENT;
	acpi_gbl_root_table_list.flags = (u8) (ACPI_TABLE_ORIGIN_ALLOCATED |
					       (acpi_gbl_root_table_list.
						flags &
						~ACPI_TABLE_ORIGIN_MASK));
	acpi_gbl_root_table_list.flags |= (u8) ACPI_ROOT_ORIGIN_ALLOCATED;

	return_ACPI_STATUS(AE_OK);
}
@@ -348,8 +336,7 @@ void acpi_tb_terminate(void)
	 * Delete the root table array if allocated locally. Array cannot be
	 * mapped, so we don't need to check for that flag.
	 */
	if ((acpi_gbl_root_table_list.flags & ACPI_TABLE_ORIGIN_MASK) ==
	    ACPI_TABLE_ORIGIN_ALLOCATED) {
	if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
		ACPI_FREE(acpi_gbl_root_table_list.tables);
	}

@@ -497,7 +484,7 @@ u8 acpi_tb_is_table_loaded(acpi_native_uint table_index)
	if (table_index < acpi_gbl_root_table_list.count) {
		is_loaded = (u8)
		    (acpi_gbl_root_table_list.tables[table_index].
		     flags & ACPI_TABLE_FLAGS_LOADED);
		     flags & ACPI_TABLE_IS_LOADED);
	}

	(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
@@ -524,10 +511,10 @@ void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded)
	if (table_index < acpi_gbl_root_table_list.count) {
		if (is_loaded) {
			acpi_gbl_root_table_list.tables[table_index].flags |=
			    ACPI_TABLE_FLAGS_LOADED;
			    ACPI_TABLE_IS_LOADED;
		} else {
			acpi_gbl_root_table_list.tables[table_index].flags &=
			    ~ACPI_TABLE_FLAGS_LOADED;
			    ~ACPI_TABLE_IS_LOADED;
		}
	}

+343 −201

File changed.

Preview size limit exceeded, changes collapsed.

+35 −23
Original line number Diff line number Diff line
@@ -82,9 +82,8 @@ acpi_status
acpi_initialize_tables(struct acpi_table_desc *initial_table_array,
		       u32 initial_table_count, u8 allow_resize)
{
	acpi_physical_address address;
	acpi_physical_address rsdp_address;
	acpi_status status;
	struct acpi_table_rsdp *rsdp;

	ACPI_FUNCTION_TRACE(acpi_initialize_tables);

@@ -94,7 +93,7 @@ acpi_initialize_tables(struct acpi_table_desc *initial_table_array,
	 */
	if (!initial_table_array) {
		acpi_gbl_root_table_list.size = initial_table_count;
		acpi_gbl_root_table_list.flags = ACPI_TABLE_FLAGS_ALLOW_RESIZE;
		acpi_gbl_root_table_list.flags = ACPI_ROOT_ALLOW_RESIZE;

		status = acpi_tb_resize_root_table_list();
		if (ACPI_FAILURE(status)) {
@@ -103,37 +102,33 @@ acpi_initialize_tables(struct acpi_table_desc *initial_table_array,
	} else {
		/* Root Table Array has been statically allocated by the host */

		ACPI_MEMSET(initial_table_array,
			    initial_table_count *
			    sizeof(struct acpi_table_desc), 0);

		acpi_gbl_root_table_list.tables = initial_table_array;
		acpi_gbl_root_table_list.size = initial_table_count;
		acpi_gbl_root_table_list.flags = ACPI_TABLE_ORIGIN_UNKNOWN;
		acpi_gbl_root_table_list.flags = ACPI_ROOT_ORIGIN_UNKNOWN;
		if (allow_resize) {
			acpi_gbl_root_table_list.flags =
			    ACPI_TABLE_FLAGS_ALLOW_RESIZE;
			acpi_gbl_root_table_list.flags |=
			    ACPI_ROOT_ALLOW_RESIZE;
		}
	}

	/* Get the RSDP and map it */
	/* Get the address of the RSDP */

	address = acpi_os_get_root_pointer();
	if (!address) {
	rsdp_address = acpi_os_get_root_pointer();
	if (!rsdp_address) {
		return_ACPI_STATUS(AE_NOT_FOUND);
	}

	rsdp = acpi_os_map_memory(address, sizeof(struct acpi_table_rsdp));
	if (!rsdp) {
		return_ACPI_STATUS(AE_NO_MEMORY);
	}

	ACPI_INFO((AE_INFO, "%.8s @ 0x%p",
		   rsdp->signature, ACPI_CAST_PTR(void, address)));

	/*
	 * Get the root table (RSDT or XSDT) and extract all entries to the local
	 * Root Table Array. This array contains the information of the RSDT/XSDT
	 * in a common, more useable format.
	 */
	status = acpi_tb_parse_root_table(rsdp, ACPI_TABLE_ORIGIN_MAPPED);
	acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp));
	status =
	    acpi_tb_parse_root_table(rsdp_address, ACPI_TABLE_ORIGIN_MAPPED);
	return_ACPI_STATUS(status);
}

@@ -164,8 +159,7 @@ acpi_status acpi_reallocate_root_table(void)
	 * Only reallocate the root table if the host provided a static buffer
	 * for the table array in the call to acpi_initialize_tables.
	 */
	if ((acpi_gbl_root_table_list.flags & ACPI_TABLE_ORIGIN_MASK) !=
	    ACPI_TABLE_ORIGIN_UNKNOWN) {
	if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
		return_ACPI_STATUS(AE_SUPPORT);
	}

@@ -185,7 +179,7 @@ acpi_status acpi_reallocate_root_table(void)
	acpi_gbl_root_table_list.size = acpi_gbl_root_table_list.count;
	acpi_gbl_root_table_list.tables = tables;
	acpi_gbl_root_table_list.flags =
	    ACPI_TABLE_ORIGIN_ALLOCATED | ACPI_TABLE_FLAGS_ALLOW_RESIZE;
	    ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE;

	return_ACPI_STATUS(AE_OK);
}
@@ -247,6 +241,12 @@ acpi_get_table_header(char *signature,
	acpi_native_uint i;
	acpi_native_uint j;

	/* Parameter validation */

	if (!signature || !out_table_header) {
		return (AE_BAD_PARAMETER);
	}

	/*
	 * Walk the root table list
	 */
@@ -267,7 +267,7 @@ acpi_get_table_header(char *signature,
				acpi_gbl_root_table_list.tables[i].
				flags & ACPI_TABLE_ORIGIN_MASK);

		if (!out_table_header) {
		if (!(*out_table_header)) {
			return (AE_NO_MEMORY);
		}

@@ -339,6 +339,12 @@ acpi_get_table(char *signature,
	acpi_native_uint j;
	acpi_status status;

	/* Parameter validation */

	if (!signature || !out_table) {
		return (AE_BAD_PARAMETER);
	}

	/*
	 * Walk the root table list
	 */
@@ -387,6 +393,12 @@ acpi_get_table_by_index(acpi_native_uint table_index,

	ACPI_FUNCTION_TRACE(acpi_get_table_by_index);

	/* Parameter validation */

	if (!table) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);

	/* Validate index */
+6 −2
Original line number Diff line number Diff line
@@ -996,9 +996,13 @@ acpi_ut_info(char *module_name, u32 line_number, char *format, ...)
{
	va_list args;

	acpi_os_printf("ACPI (%s-%04d): ", module_name, line_number);
	/*
	 * Removed module_name, line_number, and acpica version, not needed
	 * for info output
	 */
	acpi_os_printf("ACPI: ");

	va_start(args, format);
	acpi_os_vprintf(format, args);
	acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
	acpi_os_printf("\n");
}
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@

/* Current ACPICA subsystem version in YYYYMMDD format */

#define ACPI_CA_VERSION                 0x20060823
#define ACPI_CA_VERSION                 0x20060828

/*
 * OS name, used for the _OS object.  The _OS object is essentially obsolete,
Loading