Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 4585bda in mainline for kernel/generic/src/proc/program.c


Ignore:
Timestamp:
2012-06-01T09:09:32Z (9 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master
Children:
79b5bc9
Parents:
fb04cd90 (diff), db675dd (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 with mainline

File:
1 edited

Legend:

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

    rfb04cd90 r4585bda  
    8080        kernel_uarg->uspace_uarg = NULL;
    8181       
     82        prg->loader_status = EE_OK;
    8283        prg->task = task_create(as, name);
    8384        if (!prg->task)
     
    111112 * executable image. The task is returned in *task.
    112113 *
    113  * @param image_addr Address of an executable program image.
    114  * @param name       Name to set for the program's task.
    115  * @param prg        Buffer for storing program info. If image_addr
    116  *                   points to a loader image, p->task will be set to
    117  *                   NULL and EOK will be returned.
     114 * @param[in]  image_addr Address of an executable program image.
     115 * @param[in]  name       Name to set for the program's task.
     116 * @param[out] prg        Buffer for storing program info.
     117 *                        If image_addr points to a loader image,
     118 *                        prg->task will be set to NULL and EOK
     119 *                        will be returned.
    118120 *
    119121 * @return EOK on success or negative error code.
     
    126128                return ENOMEM;
    127129       
    128         unsigned int rc = elf_load((elf_header_t *) image_addr, as, 0);
    129         if (rc != EE_OK) {
     130        prg->loader_status = elf_load((elf_header_t *) image_addr, as, 0);
     131        if (prg->loader_status != EE_OK) {
    130132                as_destroy(as);
    131133                prg->task = NULL;
    132134                prg->main_thread = NULL;
    133135               
    134                 if (rc != EE_LOADER)
     136                if (prg->loader_status != EE_LOADER)
    135137                        return ENOTSUP;
    136138               
     
    140142               
    141143                program_loader = image_addr;
    142                 LOG("Registered program loader at %p",
    143                     (void *) image_addr);
     144                printf("Program loader at %p\n", (void *) image_addr);
    144145               
    145146                return EOK;
     
    171172        }
    172173       
    173         unsigned int rc = elf_load((elf_header_t *) program_loader, as,
     174        prg->loader_status = elf_load((elf_header_t *) program_loader, as,
    174175            ELD_F_LOADER);
    175         if (rc != EE_OK) {
     176        if (prg->loader_status != EE_OK) {
    176177                as_destroy(as);
    177                 printf("Cannot spawn loader (%s)\n", elf_error(rc));
     178                printf("Cannot spawn loader (%s)\n",
     179                    elf_error(prg->loader_status));
    178180                return ENOENT;
    179181        }
Note: See TracChangeset for help on using the changeset viewer.