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


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

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

    r3061bc1 ra35b458  
    7575        if (!prg->task)
    7676                return ELIMIT;
    77        
     77
    7878        /*
    7979         * Create the stack address space area.
     
    9494                return ENOMEM;
    9595        }
    96        
     96
    9797        uspace_arg_t *kernel_uarg = (uspace_arg_t *)
    9898            malloc(sizeof(uspace_arg_t), 0);
    99        
     99
    100100        kernel_uarg->uspace_entry = (void *) entry_addr;
    101101        kernel_uarg->uspace_stack = (void *) virt;
     
    104104        kernel_uarg->uspace_thread_arg = NULL;
    105105        kernel_uarg->uspace_uarg = NULL;
    106        
     106
    107107        /*
    108108         * Create the main thread.
     
    117117                return ELIMIT;
    118118        }
    119        
     119
    120120        return EOK;
    121121}
     
    142142        if (!as)
    143143                return ENOMEM;
    144        
     144
    145145        prg->loader_status = elf_load((elf_header_t *) image_addr, as, 0);
    146146        if (prg->loader_status != EE_OK) {
     
    148148                prg->task = NULL;
    149149                prg->main_thread = NULL;
    150                
     150
    151151                if (prg->loader_status != EE_LOADER)
    152152                        return ENOTSUP;
    153                
     153
    154154                /* Register image as the program loader */
    155155                if (program_loader != NULL)
    156156                        return ELIMIT;
    157                
     157
    158158                program_loader = image_addr;
    159159                log(LF_OTHER, LVL_NOTE, "Program loader at %p", (void *) image_addr);
    160                
     160
    161161                return EOK;
    162162        }
    163        
     163
    164164        return program_create(as, ((elf_header_t *) image_addr)->e_entry,
    165165            name, prg);
     
    179179        if (!as)
    180180                return ENOMEM;
    181        
     181
    182182        void *loader = program_loader;
    183183        if (!loader) {
     
    187187                return ENOENT;
    188188        }
    189        
     189
    190190        prg->loader_status = elf_load((elf_header_t *) program_loader, as,
    191191            ELD_F_LOADER);
     
    196196                return ENOENT;
    197197        }
    198        
     198
    199199        return program_create(as, ((elf_header_t *) program_loader)->e_entry,
    200200            name, prg);
     
    230230        if (name_len > TASK_NAME_BUFLEN - 1)
    231231                name_len = TASK_NAME_BUFLEN - 1;
    232        
     232
    233233        char namebuf[TASK_NAME_BUFLEN];
    234234        errno_t rc = copy_from_uspace(namebuf, uspace_name, name_len);
    235235        if (rc != EOK)
    236236                return (sys_errno_t) rc;
    237        
     237
    238238        namebuf[name_len] = 0;
    239        
     239
    240240        /* Spawn the new task. */
    241241        program_t prg;
     
    243243        if (rc != EOK)
    244244                return rc;
    245        
     245
    246246        // FIXME: control the permissions
    247247        perm_set(prg.task, perm_get(TASK));
    248248        program_ready(&prg);
    249        
     249
    250250        return EOK;
    251251}
Note: See TracChangeset for help on using the changeset viewer.