Changeset 7f11dc6 in mainline


Ignore:
Timestamp:
2017-12-19T18:07:28Z (6 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:
897fd8f1
Parents:
219c530
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-19 17:08:09)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-19 18:07:28)
Message:

Numerous minor error code tweaks in kernel.

Location:
kernel
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/ipc/ipc.h

    r219c530 r7f11dc6  
    200200
    201201extern void ipc_cleanup(void);
    202 extern void ipc_backsend_err(phone_t *, call_t *, sysarg_t);
     202extern void ipc_backsend_err(phone_t *, call_t *, int);
    203203extern void ipc_answerbox_slam_phones(answerbox_t *, bool);
    204204extern void ipc_cleanup_call_list(answerbox_t *, list_t *);
  • kernel/generic/src/ipc/ipc.c

    r219c530 r7f11dc6  
    371371 *
    372372 */
    373 void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err)
     373void ipc_backsend_err(phone_t *phone, call_t *call, int err)
    374374{
    375375        _ipc_call_actions_internal(phone, call, false);
  • kernel/generic/src/ipc/sysipc.c

    r219c530 r7f11dc6  
    194194        spinlock_unlock(&answer->forget_lock);
    195195
    196         if ((native_t) IPC_GET_RETVAL(answer->data) == EHANGUP) {
     196        if ((int) IPC_GET_RETVAL(answer->data) == EHANGUP) {
    197197                phone_t *phone = answer->caller_phone;
    198198                mutex_lock(&phone->lock);
     
    239239static void process_answer(call_t *call)
    240240{
    241         if (((native_t) IPC_GET_RETVAL(call->data) == EHANGUP) &&
     241        if (((int) IPC_GET_RETVAL(call->data) == EHANGUP) &&
    242242            (call->flags & IPC_CALL_FORWARDED))
    243243                IPC_SET_RETVAL(call->data, EFORWARD);
  • kernel/generic/src/ipc/sysipc_ops.c

    r219c530 r7f11dc6  
    8181int null_request_process(call_t *call, answerbox_t *box)
    8282{
    83         return EOK;
     83        return 0;
    8484}
    8585
  • kernel/generic/src/log/log.c

    r219c530 r7f11dc6  
    223223                int rc = chr_encode(wstr[chars], buffer, &buffer_offset, 16);
    224224                if (rc != EOK) {
    225                         return rc;
     225                        return EOF;
    226226                }
    227227               
  • kernel/generic/src/mm/slab.c

    r219c530 r7f11dc6  
    102102
    103103#include <assert.h>
     104#include <errno.h>
    104105#include <synch/spinlock.h>
    105106#include <mm/slab.h>
     
    334335        irq_spinlock_unlock(&cache->slablock, true);
    335336       
    336         if ((cache->constructor) && (cache->constructor(obj, flags))) {
     337        if ((cache->constructor) && (cache->constructor(obj, flags) != EOK)) {
    337338                /* Bad, bad, construction failed */
    338339                slab_obj_destroy(cache, obj, slab);
  • kernel/generic/src/proc/task.c

    r219c530 r7f11dc6  
    185185#endif
    186186       
    187         return 0;
     187        return EOK;
    188188}
    189189
  • kernel/generic/src/proc/thread.c

    r219c530 r7f11dc6  
    171171        thread->saved_fpu_context = slab_alloc(fpu_context_cache, kmflags);
    172172        if (!thread->saved_fpu_context)
    173                 return -1;
     173                return ENOMEM;
    174174#endif /* CONFIG_FPU_LAZY */
    175175#endif /* CONFIG_FPU */
     
    201201                        slab_free(fpu_context_cache, thread->saved_fpu_context);
    202202#endif
    203                 return -1;
     203                return ENOMEM;
    204204        }
    205205       
     
    210210#endif
    211211       
    212         return 0;
     212        return EOK;
    213213}
    214214
     
    10081008{
    10091009        thread_exit();
    1010        
    1011         /* Unreachable */
    1012         return 0;
    10131010}
    10141011
  • kernel/generic/src/security/perm.c

    r219c530 r7f11dc6  
    8484 *
    8585 */
    86 static sysarg_t perm_grant(task_id_t taskid, perm_t perms)
     86static int perm_grant(task_id_t taskid, perm_t perms)
    8787{
    8888        if (!(perm_get(TASK) & PERM_PERM))
    89                 return (sysarg_t) EPERM;
     89                return EPERM;
    9090       
    9191        irq_spinlock_lock(&tasks_lock, true);
     
    9494        if ((!task) || (!container_check(CONTAINER, task->container))) {
    9595                irq_spinlock_unlock(&tasks_lock, true);
    96                 return (sysarg_t) ENOENT;
     96                return ENOENT;
    9797        }
    9898       
     
    102102       
    103103        irq_spinlock_unlock(&tasks_lock, true);
    104         return 0;
     104        return EOK;
    105105}
    106106
     
    116116 *
    117117 */
    118 static sysarg_t perm_revoke(task_id_t taskid, perm_t perms)
     118static int perm_revoke(task_id_t taskid, perm_t perms)
    119119{
    120120        irq_spinlock_lock(&tasks_lock, true);
     
    123123        if ((!task) || (!container_check(CONTAINER, task->container))) {
    124124                irq_spinlock_unlock(&tasks_lock, true);
    125                 return (sysarg_t) ENOENT;
     125                return ENOENT;
    126126        }
    127127       
     
    136136                irq_spinlock_unlock(&TASK->lock, false);
    137137                irq_spinlock_unlock(&tasks_lock, true);
    138                 return (sysarg_t) EPERM;
     138                return EPERM;
    139139        }
    140140       
     
    143143       
    144144        irq_spinlock_unlock(&tasks_lock, true);
    145         return 0;
     145        return EOK;
    146146}
    147147
  • kernel/generic/src/sysinfo/sysinfo.c

    r219c530 r7f11dc6  
    7171        item->next = NULL;
    7272       
    73         return 0;
     73        return EOK;
    7474}
    7575
  • kernel/generic/src/udebug/udebug_ipc.c

    r219c530 r7f11dc6  
    137137
    138138        rc = udebug_go(t, call);
    139         if (rc < 0) {
     139        if (rc != EOK) {
    140140                IPC_SET_RETVAL(call->data, rc);
    141141                ipc_answer(&TASK->kb.box, call);
     
    182182         */
    183183        rc = udebug_thread_read(&buffer, buf_size, &copied, &needed);
    184         if (rc < 0) {
     184        if (rc != EOK) {
    185185                IPC_SET_RETVAL(call->data, rc);
    186186                ipc_answer(&TASK->kb.box, call);
     
    351351
    352352        rc = udebug_regs_read(t, &buffer);
    353         if (rc < 0) {
     353        if (rc != EOK) {
    354354                IPC_SET_RETVAL(call->data, rc);
    355355                ipc_answer(&TASK->kb.box, call);
     
    397397
    398398        rc = udebug_mem_read(uspace_src, size, &buffer);
    399         if (rc < 0) {
     399        if (rc != EOK) {
    400400                IPC_SET_RETVAL(call->data, rc);
    401401                ipc_answer(&TASK->kb.box, call);
  • kernel/generic/src/udebug/udebug_ops.c

    r219c530 r7f11dc6  
    253253        mutex_unlock(&TASK->udebug.lock);
    254254       
    255         return 0;
     255        return EOK;
    256256}
    257257
     
    285285        _thread_op_end(thread);
    286286       
    287         return 0;
     287        return EOK;
    288288}
    289289
     
    316316                /* Answer will be sent when the thread becomes stoppable. */
    317317                _thread_op_end(thread);
    318                 return 0;
     318                return EOK;
    319319        }
    320320       
     
    339339        mutex_unlock(&TASK->udebug.lock);
    340340       
    341         return 0;
     341        return EOK;
    342342}
    343343
     
    414414        *needed = (copied_ids + extra_ids) * sizeof(sysarg_t);
    415415       
    416         return 0;
     416        return EOK;
    417417}
    418418
     
    437437        memcpy(*data, TASK->name, name_size);
    438438       
    439         return 0;
     439        return EOK;
    440440}
    441441
     
    480480       
    481481        *buffer = arg_buffer;
    482         return 0;
     482        return EOK;
    483483}
    484484
     
    522522       
    523523        *buffer = (void *) state_buf;
    524         return 0;
     524        return EOK;
    525525}
    526526
     
    560560       
    561561        *buffer = data_buffer;
    562         return 0;
     562        return EOK;
    563563}
    564564
  • kernel/test/synch/rcu1.c

    r219c530 r7f11dc6  
    5151} exited_t;
    5252
    53 /* Callback raced with preexisting readers. */
    54 #define ERACE   123
    55 /* Waited for too long for the callback to exit; consider it lost. */
    56 #define ECBLOST 432
     53/* Co-opt EPARTY error code for race detection. */
     54#define ERACE   EPARTY
    5755
    5856/*-------------------------------------------------------------------*/
     
    7169       
    7270        if (!p->exited) {
    73                 *presult = ECBLOST;
     71                *presult = ETIMEOUT;
    7472        }
    7573}
  • kernel/test/synch/semaphore2.c

    r219c530 r7f11dc6  
    6060static void consumer(void *arg)
    6161{
    62         int rc, to;
     62        int rc;
     63        int to;
    6364       
    6465        thread_detach(THREAD);
Note: See TracChangeset for help on using the changeset viewer.