Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ACPI: Centralize acpi_get_cpu_uid() declaration in include/linux/acpi.h

Centralize acpi_get_cpu_uid() in include/linux/acpi.h (global scope) and
remove arch-specific declarations from arm64/loongarch/riscv/x86
asm/acpi.h. This unifies the interface across architectures and
simplifies maintenance by eliminating duplicate prototypes.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20260401081640.26875-6-fengchengwen@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Chengwen Feng and committed by
Rafael J. Wysocki
f652d0a4 3cfe889f

+11 -5
-1
arch/arm64/include/asm/acpi.h
··· 118 118 { 119 119 return acpi_cpu_get_madt_gicc(cpu)->uid; 120 120 } 121 - int acpi_get_cpu_uid(unsigned int cpu, u32 *uid); 122 121 int get_cpu_for_acpi_id(u32 uid); 123 122 124 123 static inline void arch_fix_phys_package_id(int num, u32 slot) { }
-1
arch/loongarch/include/asm/acpi.h
··· 44 44 { 45 45 return acpi_core_pic[cpu_logical_map(cpu)].processor_id; 46 46 } 47 - int acpi_get_cpu_uid(unsigned int cpu, u32 *uid); 48 47 49 48 #endif /* !CONFIG_ACPI */ 50 49
-1
arch/riscv/include/asm/acpi.h
··· 65 65 { 66 66 return acpi_cpu_get_madt_rintc(cpu)->uid; 67 67 } 68 - int acpi_get_cpu_uid(unsigned int cpu, u32 *uid); 69 68 70 69 int acpi_get_riscv_isa(struct acpi_table_header *table, 71 70 unsigned int cpu, const char **isa);
-2
arch/x86/include/asm/acpi.h
··· 157 157 return !!acpi_lapic; 158 158 } 159 159 160 - int acpi_get_cpu_uid(unsigned int cpu, u32 *uid); 161 - 162 160 #define ACPI_HAVE_ARCH_SET_ROOT_POINTER 163 161 static __always_inline void acpi_arch_set_root_pointer(u64 addr) 164 162 {
+11
include/linux/acpi.h
··· 324 324 325 325 acpi_handle acpi_get_processor_handle(int cpu); 326 326 327 + /** 328 + * acpi_get_cpu_uid() - Get ACPI Processor UID of from MADT table 329 + * @cpu: Logical CPU number (0-based) 330 + * @uid: Pointer to store ACPI Processor UID 331 + * 332 + * Return: 0 on success (ACPI Processor ID stored in *uid); 333 + * -EINVAL if CPU number is invalid or out of range; 334 + * -ENODEV if ACPI Processor UID for the CPU is not found. 335 + */ 336 + int acpi_get_cpu_uid(unsigned int cpu, u32 *uid); 337 + 327 338 #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC 328 339 int acpi_get_ioapic_id(acpi_handle handle, u32 gsi_base, u64 *phys_addr); 329 340 #endif