Changeset aaa3c457 in mainline for kernel


Ignore:
Timestamp:
2018-11-12T10:36:10Z (7 years ago)
Author:
GitHub <noreply@…>
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)
Message:

Merge pull request #56 from jermar/futexremoval

Remove kernel support for futexes in favor of waitq kobjects.

Location:
kernel
Files:
1 added
1 deleted
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r3ce781f4 raaa3c457  
    227227        generic/src/synch/smc.c \
    228228        generic/src/synch/waitq.c \
    229         generic/src/synch/futex.c \
     229        generic/src/synch/syswaitq.c \
    230230        generic/src/smp/ipi.c \
    231231        generic/src/smp/smp.c \
  • kernel/generic/include/cap/cap.h

    r3ce781f4 raaa3c457  
    5555        KOBJECT_TYPE_IRQ,
    5656        KOBJECT_TYPE_PHONE,
     57        KOBJECT_TYPE_WAITQ,
    5758        KOBJECT_TYPE_MAX
    5859} kobject_type_t;
     
    6364struct irq;
    6465struct phone;
     66struct waitq;
    6567
    6668typedef struct kobject_ops {
     
    8890                struct irq *irq;
    8991                struct phone *phone;
     92                struct waitq *waitq;
    9093        };
    9194} kobject_t;
  • kernel/generic/include/proc/task.h

    r3ce781f4 raaa3c457  
    4242#include <synch/spinlock.h>
    4343#include <synch/mutex.h>
    44 #include <synch/futex.h>
    4544#include <adt/list.h>
    4645#include <adt/odict.h>
     
    128127        task_arch_t arch;
    129128
    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 
    135129        /** Accumulated accounting. */
    136130        uint64_t ucycles;
  • kernel/generic/include/synch/syswaitq.h

    r3ce781f4 raaa3c457  
    11/*
    2  * Copyright (c) 2006 Jakub Jermar
     2 * Copyright (c) 2018 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #ifndef KERN_FUTEX_H_
    36 #define KERN_FUTEX_H_
     35#ifndef KERN_SYS_WAITQ_H_
     36#define KERN_SYS_WAITQ_H_
    3737
    3838#include <typedefs.h>
    39 #include <synch/waitq.h>
    40 #include <adt/hash_table.h>
     39#include <abi/cap.h>
    4140
    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;
     41extern void sys_waitq_init(void);
    5342
    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);
     43extern void sys_waitq_task_cleanup(void);
    5744
    58 extern void futex_task_cleanup(void);
    59 extern void futex_task_init(struct task *);
     45extern sys_errno_t sys_waitq_create(cap_waitq_handle_t *);
     46extern sys_errno_t sys_waitq_sleep(cap_waitq_handle_t, uint32_t, unsigned int);
     47extern sys_errno_t sys_waitq_wakeup(cap_waitq_handle_t);
     48extern sys_errno_t sys_waitq_destroy(cap_waitq_handle_t);
    6049
    6150#endif
  • kernel/generic/include/synch/waitq.h

    r3ce781f4 raaa3c457  
    4949 *
    5050 */
    51 typedef struct {
     51typedef struct waitq {
    5252        /** Lock protecting wait queue structure.
    5353         *
  • kernel/generic/src/main/main.c

    r3ce781f4 raaa3c457  
    7777#include <mm/reserve.h>
    7878#include <synch/waitq.h>
    79 #include <synch/futex.h>
     79#include <synch/syswaitq.h>
    8080#include <arch/arch.h>
    8181#include <arch.h>
     
    278278        task_init();
    279279        thread_init();
    280         futex_init();
     280        sys_waitq_init();
    281281
    282282        sysinfo_set_item_data("boot_args", NULL, bargs, str_size(bargs) + 1);
  • kernel/generic/src/proc/task.c

    r3ce781f4 raaa3c457  
    4343#include <mm/slab.h>
    4444#include <atomic.h>
    45 #include <synch/futex.h>
    4645#include <synch/spinlock.h>
    4746#include <synch/waitq.h>
     
    251250        }
    252251
    253         futex_task_init(task);
    254 
    255252        irq_spinlock_lock(&tasks_lock, true);
    256253
  • kernel/generic/src/proc/thread.c

    r3ce781f4 raaa3c457  
    4848#include <synch/spinlock.h>
    4949#include <synch/waitq.h>
     50#include <synch/syswaitq.h>
    5051#include <cpu.h>
    5152#include <str.h>
     
    519520                         */
    520521                        ipc_cleanup();
    521                         futex_task_cleanup();
     522                        sys_waitq_task_cleanup();
    522523                        LOG("Cleanup of task %" PRIu64 " completed.", TASK->taskid);
    523524                }
  • kernel/generic/src/syscall/syscall.c

    r3ce781f4 raaa3c457  
    4646#include <interrupt.h>
    4747#include <ipc/sysipc.h>
    48 #include <synch/futex.h>
    4948#include <synch/smc.h>
     49#include <synch/syswaitq.h>
    5050#include <ddi/ddi.h>
    5151#include <ipc/event.h>
     
    136136
    137137        /* 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,
    140142        [SYS_SMC_COHERENCE] = (syshandler_t) sys_smc_coherence,
    141143
Note: See TracChangeset for help on using the changeset viewer.