Changeset 84b14e2 in mainline for kernel/generic/src


Ignore:
Timestamp:
2009-12-02T23:33:48Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4924675
Parents:
089d746 (diff), 8d04f709 (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.
Message:

Merge simplified futexes (ticket #154) and fix for arm32 kernel atomic
operations (ticket #153).

Location:
kernel/generic/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/backend_phys.c

    r089d746 r84b14e2  
    4040#include <arch/types.h>
    4141#include <mm/as.h>
     42#include <mm/page.h>
    4243#include <mm/frame.h>
    4344#include <mm/slab.h>
  • kernel/generic/src/proc/task.c

    r089d746 r84b14e2  
    5454#include <func.h>
    5555#include <string.h>
     56#include <memstr.h>
    5657#include <syscall/copy.h>
    5758#include <macros.h>
  • kernel/generic/src/proc/thread.c

    r089d746 r84b14e2  
    812812}
    813813
     814/** Syscall wrapper for sleeping. */
     815unative_t sys_thread_usleep(uint32_t usec)
     816{
     817        thread_usleep(usec);   
     818        return 0;
     819}
     820
    814821/** @}
    815822 */
  • kernel/generic/src/synch/futex.c

    r089d746 r84b14e2  
    9090/** Initialize kernel futex structure.
    9191 *
    92  * @param futex Kernel futex structure.
     92 * @param futex         Kernel futex structure.
    9393 */
    9494void futex_initialize(futex_t *futex)
     
    102102/** Sleep in futex wait queue.
    103103 *
    104  * @param uaddr Userspace address of the futex counter.
    105  * @param usec If non-zero, number of microseconds this thread is willing to
    106  *     sleep.
    107  * @param flags Select mode of operation.
    108  *
    109  * @return One of ESYNCH_TIMEOUT, ESYNCH_OK_ATOMIC and ESYNCH_OK_BLOCKED. See
    110  *     synch.h. If there is no physical mapping for uaddr ENOENT is returned.
    111  */
    112 unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags)
     104 * @param uaddr         Userspace address of the futex counter.
     105 *
     106 * @return              If there is no physical mapping for uaddr ENOENT is
     107 *                      returned. Otherwise returns a wait result as defined in
     108 *                      synch.h.
     109 */
     110unative_t sys_futex_sleep(uintptr_t uaddr)
    113111{
    114112        futex_t *futex;
     
    140138        udebug_stoppable_begin();
    141139#endif
    142         rc = waitq_sleep_timeout(&futex->wq, usec, flags |
    143             SYNCH_FLAGS_INTERRUPTIBLE);
    144 
     140        rc = waitq_sleep_timeout(&futex->wq, 0, SYNCH_FLAGS_INTERRUPTIBLE);
    145141#ifdef CONFIG_UDEBUG
    146142        udebug_stoppable_end();
     
    151147/** Wakeup one thread waiting in futex wait queue.
    152148 *
    153  * @param uaddr Userspace address of the futex counter.
    154  *
    155  * @return ENOENT if there is no physical mapping for uaddr.
     149 * @param uaddr         Userspace address of the futex counter.
     150 *
     151 * @return              ENOENT if there is no physical mapping for uaddr.
    156152 */
    157153unative_t sys_futex_wakeup(uintptr_t uaddr)
     
    190186 * If the structure does not exist already, a new one is created.
    191187 *
    192  * @param paddr Physical address of the userspace futex counter.
    193  *
    194  * @return Address of the kernel futex structure.
     188 * @param paddr         Physical address of the userspace futex counter.
     189 *
     190 * @return              Address of the kernel futex structure.
    195191 */
    196192futex_t *futex_find(uintptr_t paddr)
     
    284280/** Compute hash index into futex hash table.
    285281 *
    286  * @param key Address where the key (i.e. physical address of futex counter) is
    287  *    stored.
    288  *
    289  * @return Index into futex hash table.
     282 * @param key           Address where the key (i.e. physical address of futex
     283 *                      counter) is stored.
     284 *
     285 * @return              Index into futex hash table.
    290286 */
    291287size_t futex_ht_hash(unative_t *key)
     
    296292/** Compare futex hash table item with a key.
    297293 *
    298  * @param key Address where the key (i.e. physical address of futex counter) is
    299  *    stored.
    300  *
    301  * @return True if the item matches the key. False otherwise.
     294 * @param key           Address where the key (i.e. physical address of futex
     295 *                      counter) is stored.
     296 *
     297 * @return              True if the item matches the key. False otherwise.
    302298 */
    303299bool futex_ht_compare(unative_t *key, size_t keys, link_t *item)
     
    313309/** Callback for removal items from futex hash table.
    314310 *
    315  * @param item Item removed from the hash table.
     311 * @param item          Item removed from the hash table.
    316312 */
    317313void futex_ht_remove_callback(link_t *item)
  • kernel/generic/src/syscall/syscall.c

    r089d746 r84b14e2  
    111111        (syshandler_t) sys_thread_exit,
    112112        (syshandler_t) sys_thread_get_id,
     113        (syshandler_t) sys_thread_usleep,
    113114       
    114115        (syshandler_t) sys_task_get_id,
     
    117118       
    118119        /* Synchronization related syscalls. */
    119         (syshandler_t) sys_futex_sleep_timeout,
     120        (syshandler_t) sys_futex_sleep,
    120121        (syshandler_t) sys_futex_wakeup,
    121122        (syshandler_t) sys_smc_coherence,
  • kernel/generic/src/udebug/udebug_ops.c

    r089d746 r84b14e2  
    5050#include <udebug/udebug.h>
    5151#include <udebug/udebug_ops.h>
     52#include <memstr.h>
    5253
    5354/**
Note: See TracChangeset for help on using the changeset viewer.