xref: /openbmc/linux/arch/arm/common/vlock.h (revision 1802d0be)
11802d0beSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
29762f12dSDave Martin /*
39762f12dSDave Martin  * vlock.h - simple voting lock implementation
49762f12dSDave Martin  *
59762f12dSDave Martin  * Created by:	Dave Martin, 2012-08-16
69762f12dSDave Martin  * Copyright:	(C) 2012-2013  Linaro Limited
79762f12dSDave Martin  */
89762f12dSDave Martin 
99762f12dSDave Martin #ifndef __VLOCK_H
109762f12dSDave Martin #define __VLOCK_H
119762f12dSDave Martin 
129762f12dSDave Martin #include <asm/mcpm.h>
139762f12dSDave Martin 
149762f12dSDave Martin /* Offsets and sizes are rounded to a word (4 bytes) */
159762f12dSDave Martin #define VLOCK_OWNER_OFFSET	0
169762f12dSDave Martin #define VLOCK_VOTING_OFFSET	4
179762f12dSDave Martin #define VLOCK_VOTING_SIZE	((MAX_CPUS_PER_CLUSTER + 3) / 4 * 4)
189762f12dSDave Martin #define VLOCK_SIZE		(VLOCK_VOTING_OFFSET + VLOCK_VOTING_SIZE)
199762f12dSDave Martin #define VLOCK_OWNER_NONE	0
209762f12dSDave Martin 
219762f12dSDave Martin #endif /* ! __VLOCK_H */
22