- Timestamp:
- 2018-11-12T10:36:10Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a43dfcb
- Parents:
- 3ce781f4 (diff), 6874bd2 (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:
- Jakub Jermář <jakub@…> (2018-11-12 10:36:10)
- git-committer:
- GitHub <noreply@…> (2018-11-12 10:36:10)
- Location:
- kernel
- Files:
-
- 1 added
- 1 deleted
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r3ce781f4 raaa3c457 227 227 generic/src/synch/smc.c \ 228 228 generic/src/synch/waitq.c \ 229 generic/src/synch/ futex.c \229 generic/src/synch/syswaitq.c \ 230 230 generic/src/smp/ipi.c \ 231 231 generic/src/smp/smp.c \ -
kernel/generic/include/cap/cap.h
r3ce781f4 raaa3c457 55 55 KOBJECT_TYPE_IRQ, 56 56 KOBJECT_TYPE_PHONE, 57 KOBJECT_TYPE_WAITQ, 57 58 KOBJECT_TYPE_MAX 58 59 } kobject_type_t; … … 63 64 struct irq; 64 65 struct phone; 66 struct waitq; 65 67 66 68 typedef struct kobject_ops { … … 88 90 struct irq *irq; 89 91 struct phone *phone; 92 struct waitq *waitq; 90 93 }; 91 94 } kobject_t; -
kernel/generic/include/proc/task.h
r3ce781f4 raaa3c457 42 42 #include <synch/spinlock.h> 43 43 #include <synch/mutex.h> 44 #include <synch/futex.h>45 44 #include <adt/list.h> 46 45 #include <adt/odict.h> … … 128 127 task_arch_t arch; 129 128 130 /** Serializes access to futex_list.*/131 SPINLOCK_DECLARE(futex_list_lock);132 /** List of all futexes accesses by this task. */133 list_t futex_list;134 135 129 /** Accumulated accounting. */ 136 130 uint64_t ucycles; -
kernel/generic/include/synch/syswaitq.h
r3ce781f4 raaa3c457 1 1 /* 2 * Copyright (c) 20 06Jakub Jermar2 * Copyright (c) 2018 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 33 33 */ 34 34 35 #ifndef KERN_ FUTEX_H_36 #define KERN_ FUTEX_H_35 #ifndef KERN_SYS_WAITQ_H_ 36 #define KERN_SYS_WAITQ_H_ 37 37 38 38 #include <typedefs.h> 39 #include <synch/waitq.h> 40 #include <adt/hash_table.h> 39 #include <abi/cap.h> 41 40 42 /** Kernel-side futex structure. */ 43 typedef struct { 44 /** Physical address of the status variable. */ 45 uintptr_t paddr; 46 /** Wait queue for threads waiting for futex availability. */ 47 waitq_t wq; 48 /** Futex hash table link. */ 49 ht_link_t ht_link; 50 /** Number of tasks that reference this futex. */ 51 size_t refcount; 52 } futex_t; 41 extern void sys_waitq_init(void); 53 42 54 extern void futex_init(void); 55 extern sys_errno_t sys_futex_sleep(uintptr_t, uintptr_t); 56 extern sys_errno_t sys_futex_wakeup(uintptr_t); 43 extern void sys_waitq_task_cleanup(void); 57 44 58 extern void futex_task_cleanup(void); 59 extern void futex_task_init(struct task *); 45 extern sys_errno_t sys_waitq_create(cap_waitq_handle_t *); 46 extern sys_errno_t sys_waitq_sleep(cap_waitq_handle_t, uint32_t, unsigned int); 47 extern sys_errno_t sys_waitq_wakeup(cap_waitq_handle_t); 48 extern sys_errno_t sys_waitq_destroy(cap_waitq_handle_t); 60 49 61 50 #endif -
kernel/generic/include/synch/waitq.h
r3ce781f4 raaa3c457 49 49 * 50 50 */ 51 typedef struct {51 typedef struct waitq { 52 52 /** Lock protecting wait queue structure. 53 53 * -
kernel/generic/src/main/main.c
r3ce781f4 raaa3c457 77 77 #include <mm/reserve.h> 78 78 #include <synch/waitq.h> 79 #include <synch/ futex.h>79 #include <synch/syswaitq.h> 80 80 #include <arch/arch.h> 81 81 #include <arch.h> … … 278 278 task_init(); 279 279 thread_init(); 280 futex_init();280 sys_waitq_init(); 281 281 282 282 sysinfo_set_item_data("boot_args", NULL, bargs, str_size(bargs) + 1); -
kernel/generic/src/proc/task.c
r3ce781f4 raaa3c457 43 43 #include <mm/slab.h> 44 44 #include <atomic.h> 45 #include <synch/futex.h>46 45 #include <synch/spinlock.h> 47 46 #include <synch/waitq.h> … … 251 250 } 252 251 253 futex_task_init(task);254 255 252 irq_spinlock_lock(&tasks_lock, true); 256 253 -
kernel/generic/src/proc/thread.c
r3ce781f4 raaa3c457 48 48 #include <synch/spinlock.h> 49 49 #include <synch/waitq.h> 50 #include <synch/syswaitq.h> 50 51 #include <cpu.h> 51 52 #include <str.h> … … 519 520 */ 520 521 ipc_cleanup(); 521 futex_task_cleanup();522 sys_waitq_task_cleanup(); 522 523 LOG("Cleanup of task %" PRIu64 " completed.", TASK->taskid); 523 524 } -
kernel/generic/src/syscall/syscall.c
r3ce781f4 raaa3c457 46 46 #include <interrupt.h> 47 47 #include <ipc/sysipc.h> 48 #include <synch/futex.h>49 48 #include <synch/smc.h> 49 #include <synch/syswaitq.h> 50 50 #include <ddi/ddi.h> 51 51 #include <ipc/event.h> … … 136 136 137 137 /* Synchronization related syscalls. */ 138 [SYS_FUTEX_SLEEP] = (syshandler_t) sys_futex_sleep, 139 [SYS_FUTEX_WAKEUP] = (syshandler_t) sys_futex_wakeup, 138 [SYS_WAITQ_CREATE] = (syshandler_t) sys_waitq_create, 139 [SYS_WAITQ_SLEEP] = (syshandler_t) sys_waitq_sleep, 140 [SYS_WAITQ_WAKEUP] = (syshandler_t) sys_waitq_wakeup, 141 [SYS_WAITQ_DESTROY] = (syshandler_t) sys_waitq_destroy, 140 142 [SYS_SMC_COHERENCE] = (syshandler_t) sys_smc_coherence, 141 143
Note:
See TracChangeset
for help on using the changeset viewer.