162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * vlock.h - simple voting lock implementation
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Created by:	Dave Martin, 2012-08-16
662306a36Sopenharmony_ci * Copyright:	(C) 2012-2013  Linaro Limited
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef __VLOCK_H
1062306a36Sopenharmony_ci#define __VLOCK_H
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include <asm/mcpm.h>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci/* Offsets and sizes are rounded to a word (4 bytes) */
1562306a36Sopenharmony_ci#define VLOCK_OWNER_OFFSET	0
1662306a36Sopenharmony_ci#define VLOCK_VOTING_OFFSET	4
1762306a36Sopenharmony_ci#define VLOCK_VOTING_SIZE	((MAX_CPUS_PER_CLUSTER + 3) / 4 * 4)
1862306a36Sopenharmony_ci#define VLOCK_SIZE		(VLOCK_VOTING_OFFSET + VLOCK_VOTING_SIZE)
1962306a36Sopenharmony_ci#define VLOCK_OWNER_NONE	0
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci#endif /* ! __VLOCK_H */
22