Lazuli
spinlock.c
Go to the documentation of this file.
1 /*
2  * SPDX-License-Identifier: GPL-3.0-only
3  * This file is part of Lazuli.
4  */
5 
14 #include <Lazuli/common.h>
15 #include <Lazuli/config.h>
16 #include <Lazuli/spinlock.h>
17 #include <Lazuli/sys/task.h>
18 
19 void
21 {
23  if (NULL == spinlock) {
24  Task_Abort();
25  }
26  }
27 
28  *spinlock = LZ_SPINLOCK_INIT;
29 }
const bool LZ_CONFIG_CHECK_NULL_PARAMETERS_IN_SPINLOCKS
When 1, always check for NULL functions parameters in spinlocks implementation.
void Task_Abort(void)
Abort the calling task.
void Lz_Spinlock_Unlock(Lz_Spinlock *const spinlock)
Unset the lock and leave region.
Definition: spinlock.c:20
Spinlocks interface.
Include appropriate config file.
volatile uint8_t Lz_Spinlock
Type used to represent a spinlock.
Definition: spinlock.h:26
#define LZ_SPINLOCK_INIT
Define the initialization value for the type Lz_Spinlock.
Definition: spinlock.h:34
#define NULL
NULL pointer.
Definition: common.h:68
Base task definition and context description.
Basic type definitions and useful macros.