Changeset b7fd2a0 in mainline for kernel/generic/include/synch


Ignore:
Timestamp:
2018-01-13T03:10:29Z (8 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.

Location:
kernel/generic/include/synch
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/condvar.h

    r36f0738 rb7fd2a0  
    6262extern void condvar_signal(condvar_t *cv);
    6363extern void condvar_broadcast(condvar_t *cv);
    64 extern int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec,
     64extern errno_t _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec,
    6565    int flags);
    66 extern int _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock,
     66extern errno_t _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock,
    6767        uint32_t usec, int flags);
    68 extern int _condvar_wait_timeout_irq_spinlock(condvar_t *cv,
     68extern errno_t _condvar_wait_timeout_irq_spinlock(condvar_t *cv,
    6969        irq_spinlock_t *irq_lock, uint32_t usec, int flags);
    7070
  • kernel/generic/include/synch/futex.h

    r36f0738 rb7fd2a0  
    5353
    5454extern void futex_init(void);
    55 extern sysarg_t sys_futex_sleep(uintptr_t);
    56 extern sysarg_t sys_futex_wakeup(uintptr_t);
     55extern sys_errno_t sys_futex_sleep(uintptr_t);
     56extern sys_errno_t sys_futex_wakeup(uintptr_t);
    5757
    5858extern void futex_task_cleanup(void);
  • kernel/generic/include/synch/mutex.h

    r36f0738 rb7fd2a0  
    6767extern void mutex_initialize(mutex_t *, mutex_type_t);
    6868extern bool mutex_locked(mutex_t *);
    69 extern int _mutex_lock_timeout(mutex_t *, uint32_t, unsigned int);
     69extern errno_t _mutex_lock_timeout(mutex_t *, uint32_t, unsigned int);
    7070extern void mutex_unlock(mutex_t *);
    7171
  • kernel/generic/include/synch/semaphore.h

    r36f0738 rb7fd2a0  
    5959
    6060extern void semaphore_initialize(semaphore_t *, int);
    61 extern int _semaphore_down_timeout(semaphore_t *, uint32_t, unsigned int);
     61extern errno_t _semaphore_down_timeout(semaphore_t *, uint32_t, unsigned int);
    6262extern void semaphore_up(semaphore_t *);
    6363extern int semaphore_count_get(semaphore_t *);
  • kernel/generic/include/synch/smc.h

    r36f0738 rb7fd2a0  
    3636#define KERN_SMC_H_
    3737
    38 extern sysarg_t sys_smc_coherence(uintptr_t, size_t);
     38extern sys_errno_t sys_smc_coherence(uintptr_t, size_t);
    3939
    4040#endif
  • kernel/generic/include/synch/smp_memory_barrier.h

    r36f0738 rb7fd2a0  
    3838#include <typedefs.h>
    3939
    40 extern sysarg_t sys_smp_memory_barrier(void);
     40extern sys_errno_t sys_smp_memory_barrier(void);
    4141
    4242#endif
  • kernel/generic/include/synch/waitq.h

    r36f0738 rb7fd2a0  
    7272
    7373extern void waitq_initialize(waitq_t *);
    74 extern int waitq_sleep_timeout(waitq_t *, uint32_t, unsigned int, bool *);
     74extern errno_t waitq_sleep_timeout(waitq_t *, uint32_t, unsigned int, bool *);
    7575extern ipl_t waitq_sleep_prepare(waitq_t *);
    76 extern int waitq_sleep_timeout_unsafe(waitq_t *, uint32_t, unsigned int, bool *);
     76extern errno_t waitq_sleep_timeout_unsafe(waitq_t *, uint32_t, unsigned int, bool *);
    7777extern void waitq_sleep_finish(waitq_t *, bool, ipl_t);
    7878extern void waitq_wakeup(waitq_t *, wakeup_mode_t);
Note: See TracChangeset for help on using the changeset viewer.