Changeset 63e27ef in mainline for kernel/generic/include


Ignore:
Timestamp:
2017-06-19T21:47:42Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
deacc58d
Parents:
7354b5e
Message:

ASSERT → assert

Location:
kernel/generic/include
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/adt/list.h

    r7354b5e r63e27ef  
    3737#define KERN_LIST_H_
    3838
    39 #include <debug.h>
     39#include <assert.h>
    4040#include <stdbool.h>
    4141#include <stddef.h>
     
    120120       
    121121#define assert_link_not_used(link) \
    122         ASSERT(!link_used(link))
     122        assert(!link_used(link))
    123123
    124124/** Initialize doubly-linked circular list link
     
    390390                return false;
    391391
    392         ASSERT(link->prev != NULL && link->next != NULL);
     392        assert(link->prev != NULL && link->next != NULL);
    393393        return true;
    394394}
  • kernel/generic/include/debug.h

    r7354b5e r63e27ef  
    3636#define KERN_DEBUG_H_
    3737
    38 #include <panic.h>
    3938#include <log.h>
    4039#include <symtab_lookup.h>
    4140
    4241#define CALLER  ((uintptr_t) __builtin_return_address(0))
    43 
    44 #ifdef CONFIG_DEBUG
    45 
    46 /** Debugging ASSERT macro
    47  *
    48  * If CONFIG_DEBUG is set, the ASSERT() macro
    49  * evaluates expr and if it is false raises
    50  * kernel panic.
    51  *
    52  * @param expr Expression which is expected to be true.
    53  *
    54  */
    55 #define ASSERT(expr) \
    56         do { \
    57                 if (!(expr)) \
    58                         panic_assert("%s() at %s:%u:\n%s", \
    59                             __func__, __FILE__, __LINE__, #expr); \
    60         } while (0)
    61 
    62 /** Debugging verbose ASSERT macro
    63  *
    64  * If CONFIG_DEBUG is set, the ASSERT() macro
    65  * evaluates expr and if it is false raises
    66  * kernel panic. The panic message contains also
    67  * the supplied message.
    68  *
    69  * @param expr Expression which is expected to be true.
    70  * @param msg  Additional message to show (string).
    71  *
    72  */
    73 #define ASSERT_VERBOSE(expr, msg) \
    74         do { \
    75                 if (!(expr)) \
    76                         panic_assert("%s() at %s:%u:\n%s, %s", \
    77                             __func__, __FILE__, __LINE__, #expr, msg); \
    78         } while (0)
    79 
    80 /** Static assert macro
    81  *
    82  */
    83 #define STATIC_ASSERT(expr) \
    84         _Static_assert(expr, "")
    85 
    86 #define STATIC_ASSERT_VERBOSE(expr, msg) \
    87         _Static_assert(expr, msg)
    88 
    89 
    90 #else /* CONFIG_DEBUG */
    91 
    92 #define ASSERT(expr)
    93 #define ASSERT_VERBOSE(expr, msg)
    94 #define STATIC_ASSERT(expr)
    95 #define STATIC_ASSERT_VERBOSE(expr, msg)
    96 
    97 #endif /* CONFIG_DEBUG */
    9842
    9943#ifdef CONFIG_LOG
  • kernel/generic/include/preemption.h

    r7354b5e r63e27ef  
    3737
    3838#include <arch.h>
     39#include <assert.h>
    3940#include <compiler/barrier.h>
    40 #include <debug.h>
    4141
    4242#define PREEMPTION_INC         (1 << 0)
     
    5454#define preemption_enable() \
    5555        do { \
    56                 ASSERT(PREEMPTION_DISABLED); \
     56                assert(PREEMPTION_DISABLED); \
    5757                compiler_barrier(); \
    5858                THE->preemption -= PREEMPTION_INC; \
  • kernel/generic/include/synch/rcu.h

    r7354b5e r63e27ef  
    3636#define KERN_RCU_H_
    3737
     38#include <assert.h>
    3839#include <synch/rcu_types.h>
    3940#include <compiler/barrier.h>
     
    162163static inline void _rcu_record_qs(void)
    163164{
    164         ASSERT(PREEMPTION_DISABLED || interrupts_disabled());
     165        assert(PREEMPTION_DISABLED || interrupts_disabled());
    165166       
    166167        /*
     
    207208static inline void rcu_read_lock(void)
    208209{
    209         ASSERT(CPU);
     210        assert(CPU);
    210211        preemption_disable();
    211212
     
    222223static inline void rcu_read_unlock(void)
    223224{
    224         ASSERT(CPU);
     225        assert(CPU);
    225226        preemption_disable();
    226227       
  • kernel/generic/include/synch/spinlock.h

    r7354b5e r63e27ef  
    3838#include <stdbool.h>
    3939#include <arch/barrier.h>
     40#include <assert.h>
    4041#include <preemption.h>
    4142#include <atomic.h>
    42 #include <debug.h>
    4343#include <arch/asm.h>
    4444
     
    8080
    8181#define ASSERT_SPINLOCK(expr, lock) \
    82         ASSERT_VERBOSE(expr, (lock)->name)
     82        assert_verbose(expr, (lock)->name)
    8383
    8484#define spinlock_lock(lock)    spinlock_lock_debug((lock))
     
    9898
    9999#define ASSERT_SPINLOCK(expr, lock) \
    100         ASSERT(expr)
     100        assert(expr)
    101101
    102102#define spinlock_lock(lock)    atomic_lock_arch(&(lock)->val)
     
    175175#define SPINLOCK_STATIC_INITIALIZE_NAME(name, desc_name)
    176176
    177 #define ASSERT_SPINLOCK(expr, lock)  ASSERT(expr)
     177#define ASSERT_SPINLOCK(expr, lock)  assert(expr)
    178178
    179179#define spinlock_initialize(lock, name)
Note: See TracChangeset for help on using the changeset viewer.