Changeset c0d814a in mainline for kernel/generic/include
- Timestamp:
- 2025-04-10T20:02:30Z (9 months ago)
- Children:
- b8b031f
- Parents:
- a92290d (diff), 90dd8aee (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- Wayne Thornton <wmthornton-dev@…> (2025-04-10 20:02:30)
- git-committer:
- GitHub <noreply@…> (2025-04-10 20:02:30)
- Location:
- kernel/generic/include
- Files:
-
- 3 edited
-
console/console.h (modified) (1 diff)
-
synch/condvar.h (modified) (2 diffs)
-
synch/mutex.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/console/console.h
ra92290d rc0d814a 76 76 extern sysarg_t sys_debug_console(void); 77 77 78 extern void console_lock(void); 79 extern void console_unlock(void); 80 78 81 #endif /* KERN_CONSOLE_H_ */ 79 82 -
kernel/generic/include/synch/condvar.h
ra92290d rc0d814a 1 1 /* 2 2 * Copyright (c) 2001-2004 Jakub Jermar 3 * Copyright (c) 2025 Jiří Zárevúcky 3 4 * All rights reserved. 4 5 * … … 53 54 condvar_t name = CONDVAR_INITIALIZER(name) 54 55 55 #ifdef CONFIG_SMP56 #define _condvar_wait_timeout_spinlock(cv, lock, usec, flags) \57 _condvar_wait_timeout_spinlock_impl((cv), (lock), (usec), (flags))58 #else59 #define _condvar_wait_timeout_spinlock(cv, lock, usec, flags) \60 _condvar_wait_timeout_spinlock_impl((cv), NULL, (usec), (flags))61 #endif62 63 56 extern void condvar_initialize(condvar_t *cv); 64 57 extern void condvar_signal(condvar_t *cv); 65 58 extern void condvar_broadcast(condvar_t *cv); 66 59 67 extern errno_t condvar_wait(condvar_t *cv, mutex_t *mtx); 68 extern errno_t condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec); 60 extern errno_t __condvar_wait_mutex(condvar_t *cv, mutex_t *mtx); 61 extern errno_t __condvar_wait_spinlock(condvar_t *cv, spinlock_t *mtx); 62 extern errno_t __condvar_wait_irq_spinlock(condvar_t *cv, irq_spinlock_t *mtx); 63 extern errno_t __condvar_wait_timeout_mutex(condvar_t *cv, mutex_t *mtx, uint32_t usec); 64 extern errno_t __condvar_wait_timeout_spinlock(condvar_t *cv, spinlock_t *mtx, uint32_t usec); 65 extern errno_t __condvar_wait_timeout_irq_spinlock(condvar_t *cv, irq_spinlock_t *mtx, uint32_t usec); 69 66 70 extern errno_t _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock, 71 uint32_t usec, int flags); 72 extern errno_t _condvar_wait_timeout_irq_spinlock(condvar_t *cv, 73 irq_spinlock_t *irq_lock, uint32_t usec, int flags); 67 #define condvar_wait(cv, mtx) (_Generic((mtx), \ 68 mutex_t *: __condvar_wait_mutex, \ 69 spinlock_t *: __condvar_wait_spinlock, \ 70 irq_spinlock_t *: __condvar_wait_irq_spinlock \ 71 )(cv, mtx)) 72 73 #define condvar_wait_timeout(cv, mtx, usec) (_Generic((mtx), \ 74 mutex_t *: __condvar_wait_timeout_mutex, \ 75 spinlock_t *: __condvar_wait_timeout_spinlock, \ 76 irq_spinlock_t *: __condvar_wait_timeout_irq_spinlock \ 77 )(cv, mtx)) 74 78 75 79 #endif -
kernel/generic/include/synch/mutex.h
ra92290d rc0d814a 44 44 MUTEX_PASSIVE, 45 45 MUTEX_RECURSIVE, 46 MUTEX_ACTIVE47 46 } mutex_type_t; 48 47 … … 51 50 typedef struct { 52 51 mutex_type_t type; 52 int nesting; 53 53 semaphore_t sem; 54 struct thread *owner; 55 unsigned nesting; 54 _Atomic(struct thread *) owner; 56 55 } mutex_t; 57 56 58 57 #define MUTEX_INITIALIZER(name, mtype) (mutex_t) { \ 59 58 .type = (mtype), \ 59 .nesting = 0, \ 60 60 .sem = SEMAPHORE_INITIALIZER((name).sem, 1), \ 61 61 .owner = NULL, \ 62 .nesting = 0, \63 62 } 64 63
Note:
See TracChangeset
for help on using the changeset viewer.
