Changeset b7fd2a0 in mainline for kernel/generic/src/ipc/event.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
  • kernel/generic/src/ipc/event.c

    r36f0738 rb7fd2a0  
    138138}
    139139
    140 static int event_enqueue(event_t *event, bool mask, sysarg_t a1, sysarg_t a2,
     140static errno_t event_enqueue(event_t *event, bool mask, sysarg_t a1, sysarg_t a2,
    141141    sysarg_t a3, sysarg_t a4, sysarg_t a5)
    142142{
    143         int res;
     143        errno_t res;
    144144
    145145        spinlock_lock(&event->lock);
     
    206206 *
    207207 */
    208 int event_notify(event_type_t evno, bool mask, sysarg_t a1, sysarg_t a2,
     208errno_t event_notify(event_type_t evno, bool mask, sysarg_t a1, sysarg_t a2,
    209209    sysarg_t a3, sysarg_t a4, sysarg_t a5)
    210210{
     
    234234 *
    235235 */
    236 int event_task_notify(task_t *task, event_task_type_t evno, bool mask,
     236errno_t event_task_notify(task_t *task, event_task_type_t evno, bool mask,
    237237    sysarg_t a1, sysarg_t a2, sysarg_t a3, sysarg_t a4, sysarg_t a5)
    238238{
     
    255255 *
    256256 */
    257 static int event_subscribe(event_t *event, sysarg_t imethod,
     257static errno_t event_subscribe(event_t *event, sysarg_t imethod,
    258258    answerbox_t *answerbox)
    259259{
    260         int res;
     260        errno_t res;
    261261       
    262262        spinlock_lock(&event->lock);
     
    286286 *
    287287 */
    288 static int event_unsubscribe(event_t *event, answerbox_t *answerbox)
    289 {
    290         int res;
     288static errno_t event_unsubscribe(event_t *event, answerbox_t *answerbox)
     289{
     290        errno_t res;
    291291       
    292292        spinlock_lock(&event->lock);
     
    338338 *
    339339 */
    340 sysarg_t sys_ipc_event_subscribe(sysarg_t evno, sysarg_t imethod)
     340sys_errno_t sys_ipc_event_subscribe(sysarg_t evno, sysarg_t imethod)
    341341{
    342342        if (evno >= EVENT_TASK_END)
    343343                return ELIMIT;
    344344       
    345         return (sysarg_t) event_subscribe(evno2event(evno, TASK),
     345        return (sys_errno_t) event_subscribe(evno2event(evno, TASK),
    346346            (sysarg_t) imethod, &TASK->answerbox);
    347347}
     
    357357 *
    358358 */
    359 sysarg_t sys_ipc_event_unsubscribe(sysarg_t evno)
     359sys_errno_t sys_ipc_event_unsubscribe(sysarg_t evno)
    360360{
    361361        if (evno >= EVENT_TASK_END)
    362362                return ELIMIT;
    363363       
    364         return (sysarg_t) event_unsubscribe(evno2event(evno, TASK),
     364        return (sys_errno_t) event_unsubscribe(evno2event(evno, TASK),
    365365            &TASK->answerbox);
    366366}
     
    379379 *
    380380 */
    381 sysarg_t sys_ipc_event_unmask(sysarg_t evno)
     381sys_errno_t sys_ipc_event_unmask(sysarg_t evno)
    382382{
    383383        if (evno >= EVENT_TASK_END)
Note: See TracChangeset for help on using the changeset viewer.