Changeset 7bdcc45 in mainline for kernel/generic/src/proc


Ignore:
Timestamp:
2010-12-16T16:38:49Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7837101
Parents:
8e58f94 (diff), eb221e5 (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/proc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/program.c

    r8e58f94 r7bdcc45  
    145145               
    146146                program_loader = image_addr;
    147                 LOG("Registered program loader at 0x%" PRIp,
    148                     image_addr);
     147                LOG("Registered program loader at %p",
     148                    (void *) image_addr);
    149149               
    150150                return EOK;
     
    210210 *
    211211 */
    212 unative_t sys_program_spawn_loader(char *uspace_name, size_t name_len)
     212sysarg_t sys_program_spawn_loader(char *uspace_name, size_t name_len)
    213213{
    214214        /* Cap length of name and copy it from userspace. */
     
    219219        int rc = copy_from_uspace(namebuf, uspace_name, name_len);
    220220        if (rc != 0)
    221                 return (unative_t) rc;
     221                return (sysarg_t) rc;
    222222       
    223223        namebuf[name_len] = 0;
  • kernel/generic/src/proc/scheduler.c

    r8e58f94 r7bdcc45  
    727727                irq_spinlock_lock(&cpus[cpu].lock, true);
    728728               
    729                 printf("cpu%u: address=%p, nrdy=%ld, needs_relink=%" PRIs "\n",
     729                printf("cpu%u: address=%p, nrdy=%" PRIua ", needs_relink=%zu\n",
    730730                    cpus[cpu].id, &cpus[cpu], atomic_get(&cpus[cpu].nrdy),
    731731                    cpus[cpu].needs_relink);
  • kernel/generic/src/proc/task.c

    r8e58f94 r7bdcc45  
    151151        atomic_set(&task->refcount, 0);
    152152        atomic_set(&task->lifecount, 0);
    153         atomic_set(&task->active_calls, 0);
    154153       
    155154        irq_spinlock_initialize(&task->lock, "task_t_lock");
     
    291290}
    292291
    293 /** Syscall for reading task ID from userspace.
    294  *
    295  * @param uspace_task_id Userspace address of 8-byte buffer
    296  *                       where to store current task ID.
     292#ifdef __32_BITS__
     293
     294/** Syscall for reading task ID from userspace (32 bits)
     295 *
     296 * @param uspace_taskid Pointer to user-space buffer
     297 *                      where to store current task ID.
    297298 *
    298299 * @return Zero on success or an error code from @ref errno.h.
    299300 *
    300301 */
    301 unative_t sys_task_get_id(task_id_t *uspace_task_id)
     302sysarg_t sys_task_get_id(sysarg64_t *uspace_taskid)
    302303{
    303304        /*
     
    305306         * the lifespan of the task.
    306307         */
    307         return (unative_t) copy_to_uspace(uspace_task_id, &TASK->taskid,
     308        return (sysarg_t) copy_to_uspace(uspace_taskid, &TASK->taskid,
    308309            sizeof(TASK->taskid));
    309310}
     311
     312#endif  /* __32_BITS__ */
     313
     314#ifdef __64_BITS__
     315
     316/** Syscall for reading task ID from userspace (64 bits)
     317 *
     318 * @return Current task ID.
     319 *
     320 */
     321sysarg_t sys_task_get_id(void)
     322{
     323        /*
     324         * No need to acquire lock on TASK because taskid remains constant for
     325         * the lifespan of the task.
     326         */
     327        return TASK->taskid;
     328}
     329
     330#endif  /* __64_BITS__ */
    310331
    311332/** Syscall for setting the task name.
     
    319340 *
    320341 */
    321 unative_t sys_task_set_name(const char *uspace_name, size_t name_len)
     342sysarg_t sys_task_set_name(const char *uspace_name, size_t name_len)
    322343{
    323344        int rc;
     
    331352        rc = copy_from_uspace(namebuf, uspace_name, name_len);
    332353        if (rc != 0)
    333                 return (unative_t) rc;
     354                return (sysarg_t) rc;
    334355       
    335356        namebuf[name_len] = '\0';
     
    478499#ifdef __32_BITS__
    479500        if (*additional)
    480                 printf("%-8" PRIu64 " %9lu %7lu", task->taskid,
    481                     atomic_get(&task->refcount), atomic_get(&task->active_calls));
     501                printf("%-8" PRIu64 " %9" PRIua, task->taskid,
     502                    atomic_get(&task->refcount));
    482503        else
    483504                printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %10p %10p"
     
    489510#ifdef __64_BITS__
    490511        if (*additional)
    491                 printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c %9lu %7lu",
    492                     task->taskid, ucycles, usuffix, kcycles, ksuffix,
    493                     atomic_get(&task->refcount), atomic_get(&task->active_calls));
     512                printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c "
     513                    "%9" PRIua, task->taskid, ucycles, usuffix, kcycles,
     514                    ksuffix, atomic_get(&task->refcount));
    494515        else
    495516                printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %18p %18p\n",
     
    501522                for (i = 0; i < IPC_MAX_PHONES; i++) {
    502523                        if (task->phones[i].callee)
    503                                 printf(" %" PRIs ":%p", i, task->phones[i].callee);
     524                                printf(" %zu:%p", i, task->phones[i].callee);
    504525                }
    505526                printf("\n");
  • kernel/generic/src/proc/thread.c

    r8e58f94 r7bdcc45  
    755755 *
    756756 */
    757 unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,
     757sysarg_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,
    758758    size_t name_len, thread_id_t *uspace_thread_id)
    759759{
     
    764764        int rc = copy_from_uspace(namebuf, uspace_name, name_len);
    765765        if (rc != 0)
    766                 return (unative_t) rc;
     766                return (sysarg_t) rc;
    767767       
    768768        namebuf[name_len] = 0;
     
    779779        if (rc != 0) {
    780780                free(kernel_uarg);
    781                 return (unative_t) rc;
     781                return (sysarg_t) rc;
    782782        }
    783783       
     
    804804                                free(kernel_uarg);
    805805                               
    806                                 return (unative_t) rc;
     806                                return (sysarg_t) rc;
    807807                         }
    808808                }
     
    827827                free(kernel_uarg);
    828828       
    829         return (unative_t) ENOMEM;
     829        return (sysarg_t) ENOMEM;
    830830}
    831831
     
    833833 *
    834834 */
    835 unative_t sys_thread_exit(int uspace_status)
     835sysarg_t sys_thread_exit(int uspace_status)
    836836{
    837837        thread_exit();
     
    849849 *
    850850 */
    851 unative_t sys_thread_get_id(thread_id_t *uspace_thread_id)
     851sysarg_t sys_thread_get_id(thread_id_t *uspace_thread_id)
    852852{
    853853        /*
     
    856856         *
    857857         */
    858         return (unative_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,
     858        return (sysarg_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,
    859859            sizeof(THREAD->tid));
    860860}
    861861
    862862/** Syscall wrapper for sleeping. */
    863 unative_t sys_thread_usleep(uint32_t usec)
     863sysarg_t sys_thread_usleep(uint32_t usec)
    864864{
    865865        thread_usleep(usec);
Note: See TracChangeset for help on using the changeset viewer.