Commit e637d326 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge back earlier ACPICA material for v4.18.

parents 7b34c0fb c57c0ad4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -82,7 +82,7 @@ ACPI_GLOBAL(u8, acpi_gbl_global_lock_pending);
 * interrupt level
 * interrupt level
 */
 */
ACPI_GLOBAL(acpi_spinlock, acpi_gbl_gpe_lock);	/* For GPE data structs and registers */
ACPI_GLOBAL(acpi_spinlock, acpi_gbl_gpe_lock);	/* For GPE data structs and registers */
ACPI_GLOBAL(acpi_spinlock, acpi_gbl_hardware_lock);	/* For ACPI H/W except GPE registers */
ACPI_GLOBAL(acpi_raw_spinlock, acpi_gbl_hardware_lock);	/* For ACPI H/W except GPE registers */
ACPI_GLOBAL(acpi_spinlock, acpi_gbl_reference_count_lock);
ACPI_GLOBAL(acpi_spinlock, acpi_gbl_reference_count_lock);


/* Mutex for _OSI support */
/* Mutex for _OSI support */
+2 −2
Original line number Original line Diff line number Diff line
@@ -390,14 +390,14 @@ acpi_status acpi_hw_clear_acpi_status(void)
			  ACPI_BITMASK_ALL_FIXED_STATUS,
			  ACPI_BITMASK_ALL_FIXED_STATUS,
			  ACPI_FORMAT_UINT64(acpi_gbl_xpm1a_status.address)));
			  ACPI_FORMAT_UINT64(acpi_gbl_xpm1a_status.address)));


	lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
	lock_flags = acpi_os_acquire_raw_lock(acpi_gbl_hardware_lock);


	/* Clear the fixed events in PM1 A/B */
	/* Clear the fixed events in PM1 A/B */


	status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS,
	status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS,
					ACPI_BITMASK_ALL_FIXED_STATUS);
					ACPI_BITMASK_ALL_FIXED_STATUS);


	acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags);
	acpi_os_release_raw_lock(acpi_gbl_hardware_lock, lock_flags);


	if (ACPI_FAILURE(status)) {
	if (ACPI_FAILURE(status)) {
		goto exit;
		goto exit;
+2 −2
Original line number Original line Diff line number Diff line
@@ -227,7 +227,7 @@ acpi_status acpi_write_bit_register(u32 register_id, u32 value)
		return_ACPI_STATUS(AE_BAD_PARAMETER);
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}
	}


	lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
	lock_flags = acpi_os_acquire_raw_lock(acpi_gbl_hardware_lock);


	/*
	/*
	 * At this point, we know that the parent register is one of the
	 * At this point, we know that the parent register is one of the
@@ -288,7 +288,7 @@ acpi_status acpi_write_bit_register(u32 register_id, u32 value)


unlock_and_exit:
unlock_and_exit:


	acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags);
	acpi_os_release_raw_lock(acpi_gbl_hardware_lock, lock_flags);
	return_ACPI_STATUS(status);
	return_ACPI_STATUS(status);
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -52,7 +52,7 @@ acpi_status acpi_ut_mutex_initialize(void)
		return_ACPI_STATUS (status);
		return_ACPI_STATUS (status);
	}
	}


	status = acpi_os_create_lock (&acpi_gbl_hardware_lock);
	status = acpi_os_create_raw_lock(&acpi_gbl_hardware_lock);
	if (ACPI_FAILURE (status)) {
	if (ACPI_FAILURE (status)) {
		return_ACPI_STATUS (status);
		return_ACPI_STATUS (status);
	}
	}
@@ -109,7 +109,7 @@ void acpi_ut_mutex_terminate(void)
	/* Delete the spinlocks */
	/* Delete the spinlocks */


	acpi_os_delete_lock(acpi_gbl_gpe_lock);
	acpi_os_delete_lock(acpi_gbl_gpe_lock);
	acpi_os_delete_lock(acpi_gbl_hardware_lock);
	acpi_os_delete_raw_lock(acpi_gbl_hardware_lock);
	acpi_os_delete_lock(acpi_gbl_reference_count_lock);
	acpi_os_delete_lock(acpi_gbl_reference_count_lock);


	/* Delete the reader/writer lock */
	/* Delete the reader/writer lock */
+21 −0
Original line number Original line Diff line number Diff line
@@ -97,6 +97,27 @@ acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
#endif
#endif


/*
 * RAW spinlock primitives. If the OS does not provide them, fallback to
 * spinlock primitives
 */
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_raw_lock
# define acpi_os_create_raw_lock(out_handle)	acpi_os_create_lock(out_handle)
#endif

#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_raw_lock
# define acpi_os_delete_raw_lock(handle)	acpi_os_delete_lock(handle)
#endif

#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_raw_lock
# define acpi_os_acquire_raw_lock(handle)	acpi_os_acquire_lock(handle)
#endif

#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_raw_lock
# define acpi_os_release_raw_lock(handle, flags)	\
	acpi_os_release_lock(handle, flags)
#endif

/*
/*
 * Semaphore primitives
 * Semaphore primitives
 */
 */
Loading