xref: /OK3568_Linux_fs/kernel/arch/arm/common/vlock.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * vlock.h - simple voting lock implementation
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Created by:	Dave Martin, 2012-08-16
6*4882a593Smuzhiyun  * Copyright:	(C) 2012-2013  Linaro Limited
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #ifndef __VLOCK_H
10*4882a593Smuzhiyun #define __VLOCK_H
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun #include <asm/mcpm.h>
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun /* Offsets and sizes are rounded to a word (4 bytes) */
15*4882a593Smuzhiyun #define VLOCK_OWNER_OFFSET	0
16*4882a593Smuzhiyun #define VLOCK_VOTING_OFFSET	4
17*4882a593Smuzhiyun #define VLOCK_VOTING_SIZE	((MAX_CPUS_PER_CLUSTER + 3) / 4 * 4)
18*4882a593Smuzhiyun #define VLOCK_SIZE		(VLOCK_VOTING_OFFSET + VLOCK_VOTING_SIZE)
19*4882a593Smuzhiyun #define VLOCK_OWNER_NONE	0
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun #endif /* ! __VLOCK_H */
22