Changeset fbcfc4da in mainline for kernel/generic/src


Ignore:
Timestamp:
2009-12-03T19:25:17Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9510be2
Parents:
cb3d641a (diff), 22e6802 (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 mainline changes.

Location:
kernel/generic/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/console.c

    rcb3d641a rfbcfc4da  
    319319       
    320320        if (size > PAGE_SIZE)
    321                 return ELIMIT;
     321                return (unative_t) ELIMIT;
    322322       
    323323        if (size > 0) {
    324324                data = (char *) malloc(size + 1, 0);
    325325                if (!data)
    326                         return ENOMEM;
     326                        return (unative_t) ENOMEM;
    327327               
    328328                rc = copy_from_uspace(data, buf, size);
    329329                if (rc) {
    330330                        free(data);
    331                         return rc;
     331                        return (unative_t) rc;
    332332                }
    333333                data[size] = 0;
  • kernel/generic/src/console/kconsole.c

    rcb3d641a rfbcfc4da  
    289289                       
    290290                        char tmp[STR_BOUNDS(MAX_CMDLINE)];
    291                         wstr_nstr(tmp, current + beg, position - beg + 1);
     291                        wstr_to_str(tmp, position - beg + 1, current + beg);
    292292                       
    293293                        int found;
     
    665665               
    666666                char cmdline[STR_BOUNDS(MAX_CMDLINE)];
    667                 wstr_nstr(cmdline, tmp, STR_BOUNDS(MAX_CMDLINE));
     667                wstr_to_str(cmdline, STR_BOUNDS(MAX_CMDLINE), tmp);
    668668               
    669669                if ((!kcon) && (len == 4) && (str_lcmp(cmdline, "exit", 4) == 0))
  • kernel/generic/src/ipc/ipc.c

    rcb3d641a rfbcfc4da  
    6262
    6363static slab_cache_t *ipc_call_slab;
     64static slab_cache_t *ipc_answerbox_slab;
    6465
    6566/** Initialize a call structure.
     
    9697}
    9798
    98 /** Initialize a statically allocated call structure.
    99  *
    100  * @param call          Statically allocated kernel call structure to be
    101  *                      initialized.
    102  */
    103 void ipc_call_static_init(call_t *call)
    104 {
    105         _ipc_call_init(call);
    106         call->flags |= IPC_CALL_STATIC_ALLOC;
    107 }
    108 
    10999/** Deallocate a call structure.
    110100 *
     
    113103void ipc_call_free(call_t *call)
    114104{
    115         ASSERT(!(call->flags & IPC_CALL_STATIC_ALLOC));
    116105        /* Check to see if we have data in the IPC_M_DATA_SEND buffer. */
    117106        if (call->buffer)
     
    130119        spinlock_initialize(&box->irq_lock, "ipc_box_irqlock");
    131120        waitq_initialize(&box->wq);
     121        link_initialize(&box->sync_box_link);
    132122        list_initialize(&box->connected_phones);
    133123        list_initialize(&box->calls);
     
    179169int ipc_call_sync(phone_t *phone, call_t *request)
    180170{
    181         answerbox_t sync_box;
    182 
    183         ipc_answerbox_init(&sync_box, TASK);
     171        answerbox_t *sync_box;
     172        ipl_t ipl;
     173
     174        sync_box = slab_alloc(ipc_answerbox_slab, 0);
     175        ipc_answerbox_init(sync_box, TASK);
     176
     177        /*
     178         * Put the answerbox on the TASK's list of synchronous answerboxes so
     179         * that it can be cleaned up if the call is interrupted.
     180         */
     181        ipl = interrupts_disable();
     182        spinlock_lock(&TASK->lock);
     183        list_append(&sync_box->sync_box_link, &TASK->sync_box_head);
     184        spinlock_unlock(&TASK->lock);
     185        interrupts_restore(ipl);
    184186
    185187        /* We will receive data in a special box. */
    186         request->callerbox = &sync_box;
     188        request->callerbox = sync_box;
    187189
    188190        ipc_call(phone, request);
    189         if (!ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT,
    190             SYNCH_FLAGS_INTERRUPTIBLE))
     191        if (!ipc_wait_for_call(sync_box, SYNCH_NO_TIMEOUT,
     192            SYNCH_FLAGS_INTERRUPTIBLE)) {
     193                /* The answerbox and the call will be freed by ipc_cleanup(). */
    191194                return EINTR;
     195        }
     196
     197        /*
     198         * The answer arrived without interruption so we can remove the
     199         * answerbox from the TASK's list of synchronous answerboxes.
     200         */
     201        (void) interrupts_disable();
     202        spinlock_lock(&TASK->lock);
     203        list_remove(&sync_box->sync_box_link);
     204        spinlock_unlock(&TASK->lock);
     205        interrupts_restore(ipl);
     206
     207        slab_free(ipc_answerbox_slab, sync_box);
    192208        return EOK;
    193209}
     
    520536        int i;
    521537        call_t *call;
     538        ipl_t ipl;
    522539
    523540        /* Disconnect all our phones ('ipc_phone_hangup') */
     
    545562        spinlock_unlock(&TASK->answerbox.lock);
    546563       
    547         /* Wait for all async answers to arrive */
     564        /* Wait for all answers to interrupted synchronous calls to arrive */
     565        ipl = interrupts_disable();
     566        while (!list_empty(&TASK->sync_box_head)) {
     567                answerbox_t *box = list_get_instance(TASK->sync_box_head.next,
     568                    answerbox_t, sync_box_link);
     569
     570                list_remove(&box->sync_box_link);
     571                call = ipc_wait_for_call(box, SYNCH_NO_TIMEOUT,
     572                    SYNCH_FLAGS_NONE);
     573                ipc_call_free(call);
     574                slab_free(ipc_answerbox_slab, box);
     575        }
     576        interrupts_restore(ipl);
     577
     578        /* Wait for all answers to asynchronous calls to arrive */
    548579        while (1) {
    549580                /* Go through all phones, until all are FREE... */
     
    552583                for (i = 0; i < IPC_MAX_PHONES; i++) {
    553584                        if (TASK->phones[i].state == IPC_PHONE_HUNGUP &&
    554                             atomic_get(&TASK->phones[i].active_calls) == 0)
     585                            atomic_get(&TASK->phones[i].active_calls) == 0) {
    555586                                TASK->phones[i].state = IPC_PHONE_FREE;
     587                                TASK->phones[i].callee = NULL;
     588                        }
    556589                       
    557590                        /* Just for sure, we might have had some
     
    574607                ASSERT((call->flags & IPC_CALL_ANSWERED) ||
    575608                    (call->flags & IPC_CALL_NOTIF));
    576                 ASSERT(!(call->flags & IPC_CALL_STATIC_ALLOC));
    577609               
    578610                /*
     
    593625        ipc_call_slab = slab_cache_create("ipc_call", sizeof(call_t), 0, NULL,
    594626            NULL, 0);
     627        ipc_answerbox_slab = slab_cache_create("ipc_answerbox",
     628            sizeof(answerbox_t), 0, NULL, NULL, 0);
    595629}
    596630
  • kernel/generic/src/ipc/irq.c

    rcb3d641a rfbcfc4da  
    418418                case CMD_ACCEPT:
    419419                        return IRQ_ACCEPT;
    420                         break;
    421420                case CMD_DECLINE:
    422421                default:
  • kernel/generic/src/ipc/sysipc.c

    rcb3d641a rfbcfc4da  
    6161{ \
    6262        if (phoneid > IPC_MAX_PHONES) { \
    63                 err; \
     63                err \
    6464        } \
    6565        phone = &TASK->phones[phoneid]; \
     
    122122        case IPC_M_DATA_READ:
    123123                return 1;
    124                 break;
    125124        default:
    126125                return 0;
     
    376375                phone_t *cloned_phone;
    377376                GET_CHECK_PHONE(cloned_phone, IPC_GET_ARG1(call->data),
    378                     return ENOENT);
     377                    return ENOENT;);
    379378                phones_lock(cloned_phone, phone);
    380379                if ((cloned_phone->state != IPC_PHONE_CONNECTED) ||
     
    531530    unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data)
    532531{
    533         call_t call;
     532        call_t *call;
    534533        phone_t *phone;
    535534        int res;
    536535        int rc;
    537536       
    538         GET_CHECK_PHONE(phone, phoneid, return ENOENT);
    539 
    540         ipc_call_static_init(&call);
    541         IPC_SET_METHOD(call.data, method);
    542         IPC_SET_ARG1(call.data, arg1);
    543         IPC_SET_ARG2(call.data, arg2);
    544         IPC_SET_ARG3(call.data, arg3);
     537        GET_CHECK_PHONE(phone, phoneid, return ENOENT;);
     538
     539        call = ipc_call_alloc(0);
     540        IPC_SET_METHOD(call->data, method);
     541        IPC_SET_ARG1(call->data, arg1);
     542        IPC_SET_ARG2(call->data, arg2);
     543        IPC_SET_ARG3(call->data, arg3);
    545544        /*
    546545         * To achieve deterministic behavior, zero out arguments that are beyond
    547546         * the limits of the fast version.
    548547         */
    549         IPC_SET_ARG4(call.data, 0);
    550         IPC_SET_ARG5(call.data, 0);
    551 
    552         if (!(res = request_preprocess(&call, phone))) {
     548        IPC_SET_ARG4(call->data, 0);
     549        IPC_SET_ARG5(call->data, 0);
     550
     551        if (!(res = request_preprocess(call, phone))) {
    553552#ifdef CONFIG_UDEBUG
    554553                udebug_stoppable_begin();
    555554#endif
    556                 rc = ipc_call_sync(phone, &call);
     555                rc = ipc_call_sync(phone, call);
    557556#ifdef CONFIG_UDEBUG
    558557                udebug_stoppable_end();
    559558#endif
    560                 if (rc != EOK)
     559                if (rc != EOK) {
     560                        /* The call will be freed by ipc_cleanup(). */
    561561                        return rc;
    562                 process_answer(&call);
     562                }
     563                process_answer(call);
    563564
    564565        } else {
    565                 IPC_SET_RETVAL(call.data, res);
    566         }
    567         rc = STRUCT_TO_USPACE(&data->args, &call.data.args);
     566                IPC_SET_RETVAL(call->data, res);
     567        }
     568        rc = STRUCT_TO_USPACE(&data->args, &call->data.args);
     569        ipc_call_free(call);
    568570        if (rc != 0)
    569571                return rc;
     
    584586    ipc_data_t *reply)
    585587{
    586         call_t call;
     588        call_t *call;
    587589        phone_t *phone;
    588590        int res;
    589591        int rc;
    590592
    591         ipc_call_static_init(&call);
    592         rc = copy_from_uspace(&call.data.args, &question->args,
    593             sizeof(call.data.args));
    594         if (rc != 0)
     593        GET_CHECK_PHONE(phone, phoneid, return ENOENT;);
     594
     595        call = ipc_call_alloc(0);
     596        rc = copy_from_uspace(&call->data.args, &question->args,
     597            sizeof(call->data.args));
     598        if (rc != 0) {
     599                ipc_call_free(call);
    595600                return (unative_t) rc;
    596 
    597         GET_CHECK_PHONE(phone, phoneid, return ENOENT);
    598 
    599         if (!(res = request_preprocess(&call, phone))) {
     601        }
     602
     603
     604        if (!(res = request_preprocess(call, phone))) {
    600605#ifdef CONFIG_UDEBUG
    601606                udebug_stoppable_begin();
    602607#endif
    603                 rc = ipc_call_sync(phone, &call);
     608                rc = ipc_call_sync(phone, call);
    604609#ifdef CONFIG_UDEBUG
    605610                udebug_stoppable_end();
    606611#endif
    607                 if (rc != EOK)
     612                if (rc != EOK) {
     613                        /* The call will be freed by ipc_cleanup(). */
    608614                        return rc;
    609                 process_answer(&call);
     615                }
     616                process_answer(call);
    610617        } else
    611                 IPC_SET_RETVAL(call.data, res);
    612 
    613         rc = STRUCT_TO_USPACE(&reply->args, &call.data.args);
     618                IPC_SET_RETVAL(call->data, res);
     619
     620        rc = STRUCT_TO_USPACE(&reply->args, &call->data.args);
     621        ipc_call_free(call);
    614622        if (rc != 0)
    615623                return rc;
     
    658666                return IPC_CALLRET_TEMPORARY;
    659667
    660         GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL);
     668        GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL;);
    661669
    662670        call = ipc_call_alloc(0);
     
    697705                return IPC_CALLRET_TEMPORARY;
    698706
    699         GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL);
     707        GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL;);
    700708
    701709        call = ipc_call_alloc(0);
     
    747755        call->flags |= IPC_CALL_FORWARDED;
    748756
    749         GET_CHECK_PHONE(phone, phoneid, { 
     757        GET_CHECK_PHONE(phone, phoneid, {
    750758                IPC_SET_RETVAL(call->data, EFORWARD);
    751759                ipc_answer(&TASK->answerbox, call);
     
    952960        phone_t *phone;
    953961
    954         GET_CHECK_PHONE(phone, phoneid, return ENOENT);
     962        GET_CHECK_PHONE(phone, phoneid, return ENOENT;);
    955963
    956964        if (ipc_phone_hangup(phone))
     
    991999
    9921000        if (call->flags & IPC_CALL_NOTIF) {
    993                 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));
    994 
    9951001                /* Set in_phone_hash to the interrupt counter */
    9961002                call->data.phone = (void *) call->priv;
     
    10051011        if (call->flags & IPC_CALL_ANSWERED) {
    10061012                process_answer(call);
    1007 
    1008                 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));
    10091013
    10101014                if (call->flags & IPC_CALL_DISCARD_ANSWER) {
  • kernel/generic/src/lib/elf.c

    rcb3d641a rfbcfc4da  
    163163        case PT_LOAD:
    164164                return load_segment(entry, elf, as);
    165                 break;
    166165        case PT_DYNAMIC:
    167166        case PT_INTERP:
     
    182181        default:
    183182                return EE_UNSUPPORTED;
    184                 break;
    185183        }
    186184        return EE_OK;
  • kernel/generic/src/lib/string.c

    rcb3d641a rfbcfc4da  
    537537 * null-terminated and containing only complete characters.
    538538 *
    539  * @param dst   Destination buffer.
     539 * @param dest   Destination buffer.
    540540 * @param count Size of the destination buffer (must be > 0).
    541541 * @param src   Source string.
     
    571571 * have to be null-terminated.
    572572 *
    573  * @param dst   Destination buffer.
     573 * @param dest   Destination buffer.
    574574 * @param count Size of the destination buffer (must be > 0).
    575575 * @param src   Source string.
     
    596596}
    597597
    598 /** Copy NULL-terminated wide string to string
    599  *
    600  * Copy source wide string @a src to destination buffer @a dst.
    601  * No more than @a size bytes are written. NULL-terminator is always
    602  * written after the last succesfully copied character (i.e. if the
    603  * destination buffer is has at least 1 byte, it will be always
    604  * NULL-terminated).
    605  *
    606  * @param src   Source wide string.
    607  * @param dst   Destination buffer.
    608  * @param count Size of the destination buffer.
    609  *
    610  */
    611 void wstr_nstr(char *dst, const wchar_t *src, size_t size)
    612 {
    613         /* No space for the NULL-terminator in the buffer */
    614         if (size == 0)
    615                 return;
    616        
     598/** Convert wide string to string.
     599 *
     600 * Convert wide string @a src to string. The output is written to the buffer
     601 * specified by @a dest and @a size. @a size must be non-zero and the string
     602 * written will always be well-formed.
     603 *
     604 * @param dest  Destination buffer.
     605 * @param size  Size of the destination buffer.
     606 * @param src   Source wide string.
     607 */
     608void wstr_to_str(char *dest, size_t size, const wchar_t *src)
     609{
    617610        wchar_t ch;
    618         size_t src_idx = 0;
    619         size_t dst_off = 0;
     611        size_t src_idx;
     612        size_t dest_off;
     613
     614        /* There must be space for a null terminator in the buffer. */
     615        ASSERT(size > 0);
     616
     617        src_idx = 0;
     618        dest_off = 0;
    620619       
    621620        while ((ch = src[src_idx++]) != 0) {
    622                 if (chr_encode(ch, dst, &dst_off, size) != EOK)
     621                if (chr_encode(ch, dest, &dest_off, size - 1) != EOK)
    623622                        break;
    624623        }
    625        
    626         if (dst_off >= size)
    627                 dst[size - 1] = 0;
    628         else
    629                 dst[dst_off] = 0;
     624
     625        dest[dest_off] = '\0';
    630626}
    631627
  • kernel/generic/src/mm/backend_phys.c

    rcb3d641a rfbcfc4da  
    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

    rcb3d641a rfbcfc4da  
    5454#include <func.h>
    5555#include <string.h>
     56#include <memstr.h>
    5657#include <syscall/copy.h>
    5758#include <macros.h>
     
    7576static task_id_t task_counter = 0;
    7677
     78static slab_cache_t *task_slab;
     79
    7780/* Forward declarations. */
    7881static void task_kill_internal(task_t *);
     82static int tsk_constructor(void *, int);
    7983
    8084/** Initialize kernel tasks support. */
     
    8387        TASK = NULL;
    8488        avltree_create(&tasks_tree);
     89        task_slab = slab_cache_create("task_slab", sizeof(task_t), 0,
     90            tsk_constructor, NULL, 0);
    8591}
    8692
     
    128134}
    129135
     136int tsk_constructor(void *obj, int kmflags)
     137{
     138        task_t *ta = obj;
     139        int i;
     140
     141        atomic_set(&ta->refcount, 0);
     142        atomic_set(&ta->lifecount, 0);
     143        atomic_set(&ta->active_calls, 0);
     144
     145        spinlock_initialize(&ta->lock, "task_ta_lock");
     146        mutex_initialize(&ta->futexes_lock, MUTEX_PASSIVE);
     147
     148        list_initialize(&ta->th_head);
     149        list_initialize(&ta->sync_box_head);
     150
     151        ipc_answerbox_init(&ta->answerbox, ta);
     152        for (i = 0; i < IPC_MAX_PHONES; i++)
     153                ipc_phone_init(&ta->phones[i]);
     154
     155#ifdef CONFIG_UDEBUG
     156        /* Init kbox stuff */
     157        ta->kb.thread = NULL;
     158        ipc_answerbox_init(&ta->kb.box, ta);
     159        mutex_initialize(&ta->kb.cleanup_lock, MUTEX_PASSIVE);
     160#endif
     161
     162        return 0;
     163}
     164
    130165/** Create new task with no threads.
    131166 *
     
    140175        ipl_t ipl;
    141176        task_t *ta;
    142         int i;
    143        
    144         ta = (task_t *) malloc(sizeof(task_t), 0);
    145 
     177       
     178        ta = (task_t *) slab_alloc(task_slab, 0);
    146179        task_create_arch(ta);
    147 
    148         spinlock_initialize(&ta->lock, "task_ta_lock");
    149         list_initialize(&ta->th_head);
    150180        ta->as = as;
    151 
    152181        memcpy(ta->name, name, TASK_NAME_BUFLEN);
    153182        ta->name[TASK_NAME_BUFLEN - 1] = 0;
    154183
    155         atomic_set(&ta->refcount, 0);
    156         atomic_set(&ta->lifecount, 0);
    157184        ta->context = CONTEXT;
    158 
    159185        ta->capabilities = 0;
    160186        ta->cycles = 0;
     
    165191
    166192        /* Init kbox stuff */
    167         ipc_answerbox_init(&ta->kb.box, ta);
    168         ta->kb.thread = NULL;
    169         mutex_initialize(&ta->kb.cleanup_lock, MUTEX_PASSIVE);
    170193        ta->kb.finished = false;
    171194#endif
    172195
    173         ipc_answerbox_init(&ta->answerbox, ta);
    174         for (i = 0; i < IPC_MAX_PHONES; i++)
    175                 ipc_phone_init(&ta->phones[i]);
    176         if ((ipc_phone_0) && (context_check(ipc_phone_0->task->context,
    177             ta->context)))
     196        if ((ipc_phone_0) &&
     197            (context_check(ipc_phone_0->task->context, ta->context)))
    178198                ipc_phone_connect(&ta->phones[0], ipc_phone_0);
    179         atomic_set(&ta->active_calls, 0);
    180 
    181         mutex_initialize(&ta->futexes_lock, MUTEX_PASSIVE);
     199
    182200        btree_create(&ta->futexes);
    183201       
    184202        ipl = interrupts_disable();
    185 
    186         /*
    187          * Increment address space reference count.
    188          */
    189203        atomic_inc(&as->refcount);
    190 
    191204        spinlock_lock(&tasks_lock);
    192205        ta->taskid = ++task_counter;
     
    229242                as_destroy(t->as);
    230243       
    231         free(t);
     244        slab_free(task_slab, t);
    232245        TASK = NULL;
    233246}
  • kernel/generic/src/proc/thread.c

    rcb3d641a rfbcfc4da  
    501501void thread_sleep(uint32_t sec)
    502502{
    503         thread_usleep(sec * 1000000);
     503        /* Sleep in 1000 second steps to support
     504           full argument range */
     505        while (sec > 0) {
     506                uint32_t period = (sec > 1000) ? 1000 : sec;
     507       
     508                thread_usleep(period * 1000000);
     509                sec -= period;
     510        }
    504511}
    505512
     
    575582{
    576583        waitq_t wq;
    577                                  
     584       
    578585        waitq_initialize(&wq);
    579 
     586       
    580587        (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING);
    581588}
     
    812819}
    813820
     821/** Syscall wrapper for sleeping. */
     822unative_t sys_thread_usleep(uint32_t usec)
     823{
     824        thread_usleep(usec);
     825        return 0;
     826}
     827
    814828/** @}
    815829 */
  • kernel/generic/src/synch/futex.c

    rcb3d641a rfbcfc4da  
    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

    rcb3d641a rfbcfc4da  
    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

    rcb3d641a rfbcfc4da  
    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.