1 /* 2 * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef __SPINLOCK_H__ 8 #define __SPINLOCK_H__ 9 10 #ifndef __ASSEMBLY__ 11 12 #include <types.h> 13 14 typedef struct spinlock { 15 volatile uint32_t lock; 16 } spinlock_t; 17 18 void spin_lock(spinlock_t *lock); 19 void spin_unlock(spinlock_t *lock); 20 21 #else 22 23 /* Spin lock definitions for use in assembly */ 24 #define SPINLOCK_ASM_ALIGN 2 25 #define SPINLOCK_ASM_SIZE 4 26 27 #endif 28 29 #endif /* __SPINLOCK_H__ */ 30