Changeset cf3aee19 in mainline for kernel/generic/src


Ignore:
Timestamp:
2015-06-17T23:45:24Z (11 years ago)
Author:
Michal Koutný <xm.koutny+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
523b17a
Parents:
fc7bf19 (diff), 2654afb (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:

Sync with mainline

Location:
kernel/generic/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ops/conctmeto.c

    rfc7bf19 rcf3aee19  
    4444        int newphid = phone_alloc(TASK);
    4545
     46        /* Remember the phoneid or the error. */
     47        call->priv = newphid;
    4648        if (newphid < 0)
    4749                return ELIMIT;
     
    4951        /* Set arg5 for server */
    5052        IPC_SET_ARG5(call->data, (sysarg_t) &TASK->phones[newphid]);
    51         call->priv = newphid;
    5253
    5354        return EOK;
     
    7374static int answer_process(call_t *answer)
    7475{
    75         if (IPC_GET_RETVAL(answer->data))
    76                 phone_dealloc(answer->priv);
    77         else
    78                 IPC_SET_ARG5(answer->data, answer->priv);
     76        int newphid = (int) answer->priv;
     77
     78        if (IPC_GET_RETVAL(answer->data)) {
     79                if (newphid >= 0) {
     80                        /*
     81                         * The phone was indeed allocated and now needs
     82                         * to be deallocated.
     83                         */
     84                        phone_dealloc(newphid);
     85                }
     86        } else {
     87                IPC_SET_ARG5(answer->data, newphid);
     88        }
    7989       
    8090        return EOK;
  • kernel/generic/src/ipc/sysipc.c

    rfc7bf19 rcf3aee19  
    388388{
    389389        call_t *call = get_call(callid);
    390         phone_t *phone;
    391         bool need_old = answer_need_old(call);
    392         bool after_forward = false;
    393         ipc_data_t old;
    394         int rc;
    395 
    396390        if (!call)
    397391                return ENOENT;
    398 
     392       
     393        ipc_data_t old;
     394        bool need_old = answer_need_old(call);
    399395        if (need_old)
    400396                old = call->data;
     397       
     398        bool after_forward = false;
     399        int rc;
     400        phone_t *phone;
    401401       
    402402        if (phone_get(phoneid, &phone) != EOK) {
     
    409409                goto error;
    410410        }
    411 
     411       
    412412        call->flags |= IPC_CALL_FORWARDED;
    413413       
  • kernel/generic/src/lib/func.c

    rfc7bf19 rcf3aee19  
    5151 *
    5252 */
    53 void halt()
     53void halt(void)
    5454{
    5555#if (defined(CONFIG_DEBUG)) && (defined(CONFIG_KCONSOLE))
  • kernel/generic/src/mm/as.c

    rfc7bf19 rcf3aee19  
    834834                        if ((cond = (bool) node->keys)) {
    835835                                uintptr_t ptr = node->key[node->keys - 1];
    836                                 size_t size =
     836                                size_t node_size =
    837837                                    (size_t) node->value[node->keys - 1];
    838838                                size_t i = 0;
    839839                               
    840                                 if (overlaps(ptr, P2SZ(size), area->base,
     840                                if (overlaps(ptr, P2SZ(node_size), area->base,
    841841                                    P2SZ(pages))) {
    842842                                       
    843                                         if (ptr + P2SZ(size) <= start_free) {
     843                                        if (ptr + P2SZ(node_size) <= start_free) {
    844844                                                /*
    845845                                                 * The whole interval fits
     
    860860                                        i = (start_free - ptr) >> PAGE_WIDTH;
    861861                                        if (!used_space_remove(area, start_free,
    862                                             size - i))
     862                                            node_size - i))
    863863                                                panic("Cannot remove used space.");
    864864                                } else {
     
    867867                                         * completely removed.
    868868                                         */
    869                                         if (!used_space_remove(area, ptr, size))
     869                                        if (!used_space_remove(area, ptr, node_size))
    870870                                                panic("Cannot remove used space.");
    871871                                }
     
    887887                                    area->pages - pages);
    888888               
    889                                 for (; i < size; i++) {
     889                                for (; i < node_size; i++) {
    890890                                        pte_t *pte = page_mapping_find(as,
    891891                                            ptr + P2SZ(i), false);
  • kernel/generic/src/mm/slab.c

    rfc7bf19 rcf3aee19  
    610610    unsigned int kmflag), size_t (*destructor)(void *obj), unsigned int flags)
    611611{
     612        ASSERT(size > 0);
     613       
    612614        memsetb(cache, sizeof(*cache), 0);
    613615        cache->name = name;
     
    888890        /* Initialize magazine cache */
    889891        _slab_cache_create(&mag_cache, "slab_magazine_t",
    890             sizeof(slab_magazine_t) + SLAB_MAG_SIZE * sizeof(void*),
     892            sizeof(slab_magazine_t) + SLAB_MAG_SIZE * sizeof(void *),
    891893            sizeof(uintptr_t), NULL, NULL, SLAB_CACHE_NOMAGAZINE |
    892894            SLAB_CACHE_SLINSIDE);
  • kernel/generic/src/synch/futex.c

    rfc7bf19 rcf3aee19  
    400400                return (sysarg_t) ENOENT;
    401401
     402#ifdef CONFIG_UDEBUG
     403        udebug_stoppable_begin();
     404#endif
     405
    402406        int rc = waitq_sleep_timeout(&futex->wq, 0, SYNCH_FLAGS_INTERRUPTIBLE);
     407
     408#ifdef CONFIG_UDEBUG
     409        udebug_stoppable_end();
     410#endif
    403411
    404412        return (sysarg_t) rc;
  • kernel/generic/src/udebug/udebug_ops.c

    rfc7bf19 rcf3aee19  
    375375        if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) {
    376376                mutex_unlock(&TASK->udebug.lock);
     377                free(id_buffer);
    377378                return EINVAL;
    378379        }
     
    456457int udebug_args_read(thread_t *thread, void **buffer)
    457458{
    458         /* Prepare a buffer to hold the arguments. */
    459         sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);
    460        
    461459        /* On success, this will lock t->udebug.lock. */
    462460        int rc = _thread_op_begin(thread, false);
     
    471469        }
    472470       
     471        /* Prepare a buffer to hold the arguments. */
     472        sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);
     473       
    473474        /* Copy to a local buffer before releasing the lock. */
    474475        memcpy(arg_buffer, thread->udebug.syscall_args, 6 * sizeof(sysarg_t));
     
    499500int udebug_regs_read(thread_t *thread, void **buffer)
    500501{
    501         /* Prepare a buffer to hold the data. */
    502         istate_t *state_buf = malloc(sizeof(istate_t), 0);
    503        
    504502        /* On success, this will lock t->udebug.lock */
    505503        int rc = _thread_op_begin(thread, false);
     
    512510                return EBUSY;
    513511        }
     512       
     513        /* Prepare a buffer to hold the data. */
     514        istate_t *state_buf = malloc(sizeof(istate_t), 0);
    514515       
    515516        /* Copy to the allocated buffer */
Note: See TracChangeset for help on using the changeset viewer.