mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-13 17:34:12 +00:00
Extract common interface to include/lib/spinlock.h, and invoke the variant implementation of arch. Refine assemble macro code in case that ASSEMBLER defined. Tracked-On: #8803 Signed-off-by: Haoyu Tang <haoyu.tang@intel.com> Reviewed-by: Yifan Liu <yifan1.liu@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
22 lines
441 B
C
22 lines
441 B
C
/*
|
|
* Copyright (C) 2025 Intel Corporation.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
#ifndef EVENT_H
|
|
#define EVENT_H
|
|
#include <spinlock.h>
|
|
|
|
struct sched_event {
|
|
spinlock_t lock;
|
|
bool set;
|
|
struct thread_object* waiting_thread;
|
|
};
|
|
|
|
void init_event(struct sched_event *event);
|
|
void reset_event(struct sched_event *event);
|
|
void wait_event(struct sched_event *event);
|
|
void signal_event(struct sched_event *event);
|
|
|
|
#endif /* EVENT_H */
|