From: darcagn <da...@us...> - 2023-08-25 04:01:53
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via f848bf2b1e89a10fc7c5a097e81f28a7ab39ea03 (commit) via e5ed50edcc5e95d2bc94a29fe558d0a9d754dd35 (commit) via d89cf26c3d9b61f0e846e1d27dff3a6f9e747329 (commit) via e3de4ae4b21298bfd7ec6eaa23174cf9e441ec9d (commit) from a3fc2fe314f2ed27e177a2404a071367bb2cb92b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f848bf2b1e89a10fc7c5a097e81f28a7ab39ea03 Merge: d89cf26 e5ed50e Author: Falco Girgis <gyr...@gm...> Date: Thu Aug 24 23:00:49 2023 -0500 Merge pull request #274 from KallistiOS/spinlock-trylock Add spinlock_trylock macro commit e5ed50edcc5e95d2bc94a29fe558d0a9d754dd35 Author: Lawrence Sebald <ljs...@us...> Date: Thu Aug 24 22:05:59 2023 -0400 Add spinlock_trylock macro. commit d89cf26c3d9b61f0e846e1d27dff3a6f9e747329 Merge: a3fc2fe e3de4ae Author: darcagn <da...@pr...> Date: Wed Aug 23 21:27:34 2023 -0500 Merge pull request #273 from KallistiOS/changelog_update Updated CHANGELOG to reflect VMU driver update commit e3de4ae4b21298bfd7ec6eaa23174cf9e441ec9d Author: Falco Girgis <gyr...@gm...> Date: Wed Aug 23 16:39:02 2023 -0500 Updated CHANGELOG to reflect VMU driver update ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 2 ++ kernel/arch/dreamcast/include/arch/spinlock.h | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 203eaed..2d163c9 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -181,6 +181,8 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Implemented posix_memalign() from stdlib.h [FG] - *** Added clock_gettime(), clock_settime(), clock_getres() [FG] - DC Refactored controller API, added capability groups and types [FG] +- DC VMU driver update for date/time, buttons, buzzer, and docs [FG] +- DC Add spinlock_trylock macro [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/kernel/arch/dreamcast/include/arch/spinlock.h b/kernel/arch/dreamcast/include/arch/spinlock.h index 8f87eb3..baee820 100644 --- a/kernel/arch/dreamcast/include/arch/spinlock.h +++ b/kernel/arch/dreamcast/include/arch/spinlock.h @@ -76,6 +76,28 @@ typedef volatile int spinlock_t; } \ } while(0) +/** \brief Try to lock, without spinning. + + This macro will attempt to lock the lock, but will not spin. Instead, it + will return whether the lock was obtained or not. + + \param A A pointer to the spinlock to be locked. + \return 0 if the lock is held by another thread. Non-zero if + the lock was successfully obtained. +*/ +#define spinlock_trylock(A) ({ \ + int __gotlock = 0; \ + do { \ + spinlock_t *__lock = A; \ + __asm__ __volatile__("tas.b @%1\n\t" \ + "movt %0\n\t" \ + : "=r" (__gotlock) \ + : "r" (__lock) \ + : "t", "memory"); \ + } while(0); \ + __gotlock; \ + }) + /** \brief Free a lock. This macro will unlock the lock that is currently held by the calling @@ -100,4 +122,3 @@ typedef volatile int spinlock_t; __END_DECLS #endif /* __ARCH_SPINLOCK_H */ - hooks/post-receive -- A pseudo Operating System for the Dreamcast. |