You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
ACPICA: Make acpi_thread_id no longer configurable, always u64
Change definition of acpi_thread_id to always be a u64. This simplifies the code, especially any printf output. u64 is the only common data type for all thread_id types across all operating systems. We now force the OSL to cast the native thread_id type to u64 before returning the value to ACPICA (via acpi_os_get_thread_id). Signed-off-by: Lin Ming <ming.m.lin@intel.com Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
+10
-7
@@ -115,7 +115,6 @@
|
||||
*
|
||||
* ACPI_SIZE 16/32/64-bit unsigned value
|
||||
* ACPI_NATIVE_INT 16/32/64-bit signed value
|
||||
*
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -132,6 +131,16 @@ typedef COMPILER_DEPENDENT_INT64 INT64;
|
||||
|
||||
/*! [End] no source code translation !*/
|
||||
|
||||
/*
|
||||
* Value returned by acpi_os_get_thread_id. There is no standard "thread_id"
|
||||
* across operating systems or even the various UNIX systems. Since ACPICA
|
||||
* only needs the thread ID as a unique thread identifier, we use a u64
|
||||
* as the only common data type - it will accommodate any type of pointer or
|
||||
* any type of integer. It is up to the host-dependent OSL to cast the
|
||||
* native thread ID type to a u64 (in acpi_os_get_thread_id).
|
||||
*/
|
||||
#define acpi_thread_id u64
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Types specific to 64-bit targets
|
||||
@@ -211,12 +220,6 @@ typedef u32 acpi_physical_address;
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/* Value returned by acpi_os_get_thread_id */
|
||||
|
||||
#ifndef acpi_thread_id
|
||||
#define acpi_thread_id acpi_size
|
||||
#endif
|
||||
|
||||
/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */
|
||||
|
||||
#ifndef acpi_cpu_flags
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
#define acpi_cache_t struct kmem_cache
|
||||
#define acpi_spinlock spinlock_t *
|
||||
#define acpi_cpu_flags unsigned long
|
||||
#define acpi_thread_id struct task_struct *
|
||||
|
||||
#else /* !__KERNEL__ */
|
||||
|
||||
@@ -88,7 +87,7 @@
|
||||
/* Host-dependent types and defines for user-space ACPICA */
|
||||
|
||||
#define ACPI_FLUSH_CPU_CACHE()
|
||||
#define acpi_thread_id pthread_t
|
||||
#define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread))
|
||||
|
||||
#if defined(__ia64__) || defined(__x86_64__)
|
||||
#define ACPI_MACHINE_WIDTH 64
|
||||
@@ -113,12 +112,13 @@
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <acpi/actypes.h>
|
||||
/*
|
||||
* Overrides for in-kernel ACPICA
|
||||
*/
|
||||
static inline acpi_thread_id acpi_os_get_thread_id(void)
|
||||
{
|
||||
return current;
|
||||
return (acpi_thread_id)(unsigned long)current;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -127,7 +127,6 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)
|
||||
* However, boot has (system_state != SYSTEM_RUNNING)
|
||||
* to quiet __might_sleep() in kmalloc() and resume does not.
|
||||
*/
|
||||
#include <acpi/actypes.h>
|
||||
static inline void *acpi_os_allocate(acpi_size size)
|
||||
{
|
||||
return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
|
||||
|
||||
Reference in New Issue
Block a user