Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * IA64 specific ACPICA environments and implementation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Copyright (C) 2014, Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  *   Author: Lv Zheng <lv.zheng@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #ifndef _ASM_IA64_ACENV_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define _ASM_IA64_ACENV_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <asm/intrinsics.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define COMPILER_DEPENDENT_INT64	long
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define COMPILER_DEPENDENT_UINT64	unsigned long
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /* Asm macros */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ia64_acpi_acquire_global_lock(unsigned int *lock)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 	unsigned int old, new, val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 		old = *lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 		new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 		val = ia64_cmpxchg4_acq(lock, new, old);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 	} while (unlikely (val != old));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	return (new < 3) ? -1 : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ia64_acpi_release_global_lock(unsigned int *lock)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	unsigned int old, new, val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 		old = *lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 		new = old & ~0x3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 		val = ia64_cmpxchg4_acq(lock, new, old);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	} while (unlikely (val != old));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	return old & 0x1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq)				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 	((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq)				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	((Acq) = ia64_acpi_release_global_lock(&facs->global_lock))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #endif /* _ASM_IA64_ACENV_H */