Changeset 3ce7f082 in mainline


Ignore:
Timestamp:
2007-04-06T12:53:07Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dd655970
Parents:
c9d20755
Message:

add syscall for getting current thread ID

Location:
kernel/generic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/proc/thread.h

    rc9d20755 r3ce7f082  
    251251unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name);
    252252unative_t sys_thread_exit(int uspace_status);
     253unative_t sys_thread_get_id(void);
    253254
    254255#endif
  • kernel/generic/include/syscall/syscall.h

    rc9d20755 r3ce7f082  
    4141        SYS_THREAD_CREATE,
    4242        SYS_THREAD_EXIT,
     43        SYS_THREAD_GET_ID,
    4344        SYS_TASK_GET_ID,
    4445        SYS_FUTEX_SLEEP,
  • kernel/generic/src/proc/thread.c

    rc9d20755 r3ce7f082  
    679679}
    680680
     681/** Syscall for getting TID.
     682 *
     683 * @return Thread ID.
     684 */
     685unative_t sys_thread_get_id(void)
     686{
     687        /*
     688         * No need to acquire lock on THREAD because tid
     689         * remains constant for the lifespan of the thread.
     690         */
     691        return THREAD->tid;
     692}
     693
    681694/** @}
    682695 */
    683 
  • kernel/generic/src/syscall/syscall.c

    rc9d20755 r3ce7f082  
    119119        (syshandler_t) sys_thread_create,
    120120        (syshandler_t) sys_thread_exit,
     121        (syshandler_t) sys_thread_get_id,
    121122        (syshandler_t) sys_task_get_id,
    122123       
Note: See TracChangeset for help on using the changeset viewer.