Changeset 09d01f2 in mainline for kernel/generic/src/ipc/ipcrsc.c


Ignore:
Timestamp:
2017-12-18T17:40:52Z (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:
2024096, 23d4515
Parents:
6a32cc5f
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-18 15:39:01)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-18 17:40:52)
Message:

Return phones/capabilities separately from error codes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ipcrsc.c

    r6a32cc5f r09d01f2  
    166166 * @param task  Task for which to allocate a new phone.
    167167 *
    168  * @return  New phone capability handle.
     168 * @param[out] out_handle  New phone capability handle.
     169 *
    169170 * @return  Negative error code if a new capability cannot be allocated.
    170171 */
    171 cap_handle_t phone_alloc(task_t *task)
    172 {
    173         cap_handle_t handle = cap_alloc(task);
    174         if (handle >= 0) {
     172int phone_alloc(task_t *task, cap_handle_t *out_handle)
     173{
     174        cap_handle_t handle;
     175        int rc = cap_alloc(task, &handle);
     176        if (rc == EOK) {
    175177                phone_t *phone = slab_alloc(phone_cache, FRAME_ATOMIC);
    176178                if (!phone) {
     
    193195               
    194196                cap_publish(task, handle, kobject);
     197
     198                *out_handle = handle;
    195199        }
    196        
    197         return handle;
     200        return rc;
    198201}
    199202
Note: See TracChangeset for help on using the changeset viewer.