1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __ASM_SPINLOCK_TYPES_H 3 #define __ASM_SPINLOCK_TYPES_H 4 5 #ifndef __LINUX_SPINLOCK_TYPES_RAW_H 6 # error "Please do not include this file directly." 7 #endif 8 9 #define TICKET_SHIFT 16 10 11 typedef struct { 12 union { 13 u32 slock; 14 struct __raw_tickets { 15 #ifdef __ARMEB__ 16 u16 next; 17 u16 owner; 18 #else 19 u16 owner; 20 u16 next; 21 #endif 22 } tickets; 23 }; 24 } arch_spinlock_t; 25 26 #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } } 27 28 typedef struct { 29 u32 lock; 30 } arch_rwlock_t; 31 32 #define __ARCH_RW_LOCK_UNLOCKED { 0 } 33 34 #endif 35