Changeset b7fd2a0 in mainline for uspace/lib/c/generic/udebug.c


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
  • uspace/lib/c/generic/udebug.c

    r36f0738 rb7fd2a0  
    3939#include <async.h>
    4040
    41 int udebug_begin(async_sess_t *sess)
     41errno_t udebug_begin(async_sess_t *sess)
    4242{
    4343        async_exch_t *exch = async_exchange_begin(sess);
     
    4545}
    4646
    47 int udebug_end(async_sess_t *sess)
     47errno_t udebug_end(async_sess_t *sess)
    4848{
    4949        async_exch_t *exch = async_exchange_begin(sess);
     
    5151}
    5252
    53 int udebug_set_evmask(async_sess_t *sess, udebug_evmask_t mask)
     53errno_t udebug_set_evmask(async_sess_t *sess, udebug_evmask_t mask)
    5454{
    5555        async_exch_t *exch = async_exchange_begin(sess);
     
    5757}
    5858
    59 int udebug_thread_read(async_sess_t *sess, void *buffer, size_t n,
     59errno_t udebug_thread_read(async_sess_t *sess, void *buffer, size_t n,
    6060    size_t *copied, size_t *needed)
    6161{
     
    6363       
    6464        async_exch_t *exch = async_exchange_begin(sess);
    65         int rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_THREAD_READ,
     65        errno_t rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_THREAD_READ,
    6666            (sysarg_t) buffer, n, NULL, &a_copied, &a_needed);
    6767       
     
    7272}
    7373
    74 int udebug_name_read(async_sess_t *sess, void *buffer, size_t n,
     74errno_t udebug_name_read(async_sess_t *sess, void *buffer, size_t n,
    7575    size_t *copied, size_t *needed)
    7676{
     
    7878       
    7979        async_exch_t *exch = async_exchange_begin(sess);
    80         int rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_NAME_READ,
     80        errno_t rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_NAME_READ,
    8181            (sysarg_t) buffer, n, NULL, &a_copied, &a_needed);
    8282       
     
    8787}
    8888
    89 int udebug_areas_read(async_sess_t *sess, void *buffer, size_t n,
     89errno_t udebug_areas_read(async_sess_t *sess, void *buffer, size_t n,
    9090    size_t *copied, size_t *needed)
    9191{
     
    9393       
    9494        async_exch_t *exch = async_exchange_begin(sess);
    95         int rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_AREAS_READ,
     95        errno_t rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_AREAS_READ,
    9696            (sysarg_t) buffer, n, NULL, &a_copied, &a_needed);
    9797       
     
    102102}
    103103
    104 int udebug_mem_read(async_sess_t *sess, void *buffer, uintptr_t addr, size_t n)
     104errno_t udebug_mem_read(async_sess_t *sess, void *buffer, uintptr_t addr, size_t n)
    105105{
    106106        async_exch_t *exch = async_exchange_begin(sess);
     
    109109}
    110110
    111 int udebug_args_read(async_sess_t *sess, thash_t tid, sysarg_t *buffer)
     111errno_t udebug_args_read(async_sess_t *sess, thash_t tid, sysarg_t *buffer)
    112112{
    113113        async_exch_t *exch = async_exchange_begin(sess);
     
    116116}
    117117
    118 int udebug_regs_read(async_sess_t *sess, thash_t tid, void *buffer)
     118errno_t udebug_regs_read(async_sess_t *sess, thash_t tid, void *buffer)
    119119{
    120120        async_exch_t *exch = async_exchange_begin(sess);
     
    123123}
    124124
    125 int udebug_go(async_sess_t *sess, thash_t tid, udebug_event_t *ev_type,
     125errno_t udebug_go(async_sess_t *sess, thash_t tid, udebug_event_t *ev_type,
    126126    sysarg_t *val0, sysarg_t *val1)
    127127{
     
    129129       
    130130        async_exch_t *exch = async_exchange_begin(sess);
    131         int rc = async_req_2_3(exch, IPC_M_DEBUG, UDEBUG_M_GO,
     131        errno_t rc = async_req_2_3(exch, IPC_M_DEBUG, UDEBUG_M_GO,
    132132            tid, &a_ev_type, val0, val1);
    133133       
     
    136136}
    137137
    138 int udebug_stop(async_sess_t *sess, thash_t tid)
     138errno_t udebug_stop(async_sess_t *sess, thash_t tid)
    139139{
    140140        async_exch_t *exch = async_exchange_begin(sess);
Note: See TracChangeset for help on using the changeset viewer.