1 /* SPDX-License-Identifier: GPL-2.0 */ 2 3 #ifndef __ASM_CSKY_SPINLOCK_TYPES_H 4 #define __ASM_CSKY_SPINLOCK_TYPES_H 5 6 #ifndef __LINUX_SPINLOCK_TYPES_H 7 # error "please don't include this file directly" 8 #endif 9 10 #define TICKET_NEXT 16 11 12 typedef struct { 13 union { 14 u32 lock; 15 struct __raw_tickets { 16 /* little endian */ 17 u16 owner; 18 u16 next; 19 } tickets; 20 }; 21 } arch_spinlock_t; 22 23 #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } } 24 25 #ifdef CONFIG_QUEUED_RWLOCKS 26 #include <asm-generic/qrwlock_types.h> 27 28 #else /* CONFIG_NR_CPUS > 2 */ 29 30 typedef struct { 31 u32 lock; 32 } arch_rwlock_t; 33 34 #define __ARCH_RW_LOCK_UNLOCKED { 0 } 35 36 #endif /* CONFIG_QUEUED_RWLOCKS */ 37 #endif /* __ASM_CSKY_SPINLOCK_TYPES_H */ 38