Changeset b7fd2a0 in mainline for kernel/generic/include/ipc/sysipc.h


Ignore:
Timestamp:
2018-01-13T03:10:29Z (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:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

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

    r36f0738 rb7fd2a0  
    4040#include <typedefs.h>
    4141
    42 extern int ipc_req_internal(int, ipc_data_t *, sysarg_t);
     42extern errno_t ipc_req_internal(int, ipc_data_t *, sysarg_t);
    4343
    44 extern sysarg_t sys_ipc_call_async_fast(sysarg_t, sysarg_t, sysarg_t,
     44extern sys_errno_t sys_ipc_call_async_fast(sysarg_t, sysarg_t, sysarg_t,
    4545    sysarg_t, sysarg_t, sysarg_t);
    46 extern sysarg_t sys_ipc_call_async_slow(sysarg_t, ipc_data_t *, sysarg_t);
    47 extern sysarg_t sys_ipc_answer_fast(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     46extern sys_errno_t sys_ipc_call_async_slow(sysarg_t, ipc_data_t *, sysarg_t);
     47extern sys_errno_t sys_ipc_answer_fast(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    4848    sysarg_t, sysarg_t);
    49 extern sysarg_t sys_ipc_answer_slow(sysarg_t, ipc_data_t *);
    50 extern sysarg_t sys_ipc_wait_for_call(ipc_data_t *, uint32_t, unsigned int);
    51 extern sysarg_t sys_ipc_poke(void);
    52 extern sysarg_t sys_ipc_forward_fast(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     49extern sys_errno_t sys_ipc_answer_slow(sysarg_t, ipc_data_t *);
     50extern sys_errno_t sys_ipc_wait_for_call(ipc_data_t *, uint32_t, unsigned int);
     51extern sys_errno_t sys_ipc_poke(void);
     52extern sys_errno_t sys_ipc_forward_fast(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    5353    sysarg_t, unsigned int);
    54 extern sysarg_t sys_ipc_forward_slow(sysarg_t, sysarg_t, ipc_data_t *,
     54extern sys_errno_t sys_ipc_forward_slow(sysarg_t, sysarg_t, ipc_data_t *,
    5555    unsigned int);
    56 extern sysarg_t sys_ipc_hangup(sysarg_t);
     56extern sys_errno_t sys_ipc_hangup(sysarg_t);
    5757
    58 extern sysarg_t sys_ipc_irq_subscribe(inr_t, sysarg_t, irq_code_t *, cap_handle_t *);
    59 extern sysarg_t sys_ipc_irq_unsubscribe(sysarg_t);
     58extern sys_errno_t sys_ipc_irq_subscribe(inr_t, sysarg_t, irq_code_t *, cap_handle_t *);
     59extern sys_errno_t sys_ipc_irq_unsubscribe(sysarg_t);
    6060
    61 extern sysarg_t sys_ipc_connect_kbox(task_id_t *, cap_handle_t *);
     61extern sys_errno_t sys_ipc_connect_kbox(task_id_t *, cap_handle_t *);
    6262
    6363#endif
Note: See TracChangeset for help on using the changeset viewer.