NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_hwspinlock.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2025 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
13
14#ifndef NEORV32_HWSPINLOCK_H
15#define NEORV32_HWSPINLOCK_H
16
17#include <stdint.h>
18
19
20/**********************************************************************/
25typedef volatile struct __attribute__((packed,aligned(4))) {
26 uint32_t LOCK[32];
27 const uint32_t STATUS;
29
31#define NEORV32_HWSPINLOCK ((neorv32_hwspinlock_t*) (NEORV32_HWSPINLOCK_BASE))
33
34
35/**********************************************************************/
40int neorv32_hwspinlock_acquire(int select);
42void neorv32_hwspinlock_release(int select);
43int neorv32_hwspinlock_probe(int select);
46
47
48#endif // NEORV32_HWSPINLOCK_H
int neorv32_hwspinlock_acquire(int select)
Definition neorv32_hwspinlock.c:39
void neorv32_hwspinlock_release(int select)
Definition neorv32_hwspinlock.c:65
int neorv32_hwspinlock_probe(int select)
Definition neorv32_hwspinlock.c:77
int neorv32_hwspinlock_available(void)
Definition neorv32_hwspinlock.c:22
void neorv32_hwspinlock_clear(void)
Definition neorv32_hwspinlock.c:86
void neorv32_hwspinlock_acquire_blocking(int select)
Definition neorv32_hwspinlock.c:50
Definition neorv32_hwspinlock.h:25
uint32_t LOCK[32]
Definition neorv32_hwspinlock.h:26
const uint32_t STATUS
Definition neorv32_hwspinlock.h:27