xref: /dpdk/drivers/net/nfp/nfpcore/nfp_mutex.h (revision 4b6c8db9a3365e5023d76f850c748f95ebdba17d)
1*4b6c8db9SChaoyong He /* SPDX-License-Identifier: BSD-3-Clause
2*4b6c8db9SChaoyong He  * Copyright(c) 2023 Corigine, Inc.
3*4b6c8db9SChaoyong He  * All rights reserved.
4*4b6c8db9SChaoyong He  */
5*4b6c8db9SChaoyong He 
6*4b6c8db9SChaoyong He #ifndef __NFP_MUTEX_H__
7*4b6c8db9SChaoyong He #define __NFP_MUTEX_H__
8*4b6c8db9SChaoyong He 
9*4b6c8db9SChaoyong He #include "nfp_cpp.h"
10*4b6c8db9SChaoyong He 
11*4b6c8db9SChaoyong He struct nfp_cpp_mutex;
12*4b6c8db9SChaoyong He 
13*4b6c8db9SChaoyong He int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
14*4b6c8db9SChaoyong He 		uint64_t address, uint32_t key_id);
15*4b6c8db9SChaoyong He 
16*4b6c8db9SChaoyong He struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
17*4b6c8db9SChaoyong He 		uint64_t address, uint32_t key_id);
18*4b6c8db9SChaoyong He 
19*4b6c8db9SChaoyong He void nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex);
20*4b6c8db9SChaoyong He int nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex);
21*4b6c8db9SChaoyong He int nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex);
22*4b6c8db9SChaoyong He int nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex);
23*4b6c8db9SChaoyong He int nfp_cpp_mutex_reclaim(struct nfp_cpp *cpp, int target, uint64_t address);
24*4b6c8db9SChaoyong He 
25*4b6c8db9SChaoyong He #endif /* __NFP_MUTEX_H__ */
26