Changeset 63e27ef in mainline for kernel/generic/include
- Timestamp:
- 2017-06-19T21:47:42Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- deacc58d
- Parents:
- 7354b5e
- Location:
- kernel/generic/include
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/list.h
r7354b5e r63e27ef 37 37 #define KERN_LIST_H_ 38 38 39 #include < debug.h>39 #include <assert.h> 40 40 #include <stdbool.h> 41 41 #include <stddef.h> … … 120 120 121 121 #define assert_link_not_used(link) \ 122 ASSERT(!link_used(link))122 assert(!link_used(link)) 123 123 124 124 /** Initialize doubly-linked circular list link … … 390 390 return false; 391 391 392 ASSERT(link->prev != NULL && link->next != NULL);392 assert(link->prev != NULL && link->next != NULL); 393 393 return true; 394 394 } -
kernel/generic/include/debug.h
r7354b5e r63e27ef 36 36 #define KERN_DEBUG_H_ 37 37 38 #include <panic.h>39 38 #include <log.h> 40 39 #include <symtab_lookup.h> 41 40 42 41 #define CALLER ((uintptr_t) __builtin_return_address(0)) 43 44 #ifdef CONFIG_DEBUG45 46 /** Debugging ASSERT macro47 *48 * If CONFIG_DEBUG is set, the ASSERT() macro49 * evaluates expr and if it is false raises50 * 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 macro63 *64 * If CONFIG_DEBUG is set, the ASSERT() macro65 * evaluates expr and if it is false raises66 * kernel panic. The panic message contains also67 * 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 macro81 *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 */98 42 99 43 #ifdef CONFIG_LOG -
kernel/generic/include/preemption.h
r7354b5e r63e27ef 37 37 38 38 #include <arch.h> 39 #include <assert.h> 39 40 #include <compiler/barrier.h> 40 #include <debug.h>41 41 42 42 #define PREEMPTION_INC (1 << 0) … … 54 54 #define preemption_enable() \ 55 55 do { \ 56 ASSERT(PREEMPTION_DISABLED); \56 assert(PREEMPTION_DISABLED); \ 57 57 compiler_barrier(); \ 58 58 THE->preemption -= PREEMPTION_INC; \ -
kernel/generic/include/synch/rcu.h
r7354b5e r63e27ef 36 36 #define KERN_RCU_H_ 37 37 38 #include <assert.h> 38 39 #include <synch/rcu_types.h> 39 40 #include <compiler/barrier.h> … … 162 163 static inline void _rcu_record_qs(void) 163 164 { 164 ASSERT(PREEMPTION_DISABLED || interrupts_disabled());165 assert(PREEMPTION_DISABLED || interrupts_disabled()); 165 166 166 167 /* … … 207 208 static inline void rcu_read_lock(void) 208 209 { 209 ASSERT(CPU);210 assert(CPU); 210 211 preemption_disable(); 211 212 … … 222 223 static inline void rcu_read_unlock(void) 223 224 { 224 ASSERT(CPU);225 assert(CPU); 225 226 preemption_disable(); 226 227 -
kernel/generic/include/synch/spinlock.h
r7354b5e r63e27ef 38 38 #include <stdbool.h> 39 39 #include <arch/barrier.h> 40 #include <assert.h> 40 41 #include <preemption.h> 41 42 #include <atomic.h> 42 #include <debug.h>43 43 #include <arch/asm.h> 44 44 … … 80 80 81 81 #define ASSERT_SPINLOCK(expr, lock) \ 82 ASSERT_VERBOSE(expr, (lock)->name)82 assert_verbose(expr, (lock)->name) 83 83 84 84 #define spinlock_lock(lock) spinlock_lock_debug((lock)) … … 98 98 99 99 #define ASSERT_SPINLOCK(expr, lock) \ 100 ASSERT(expr)100 assert(expr) 101 101 102 102 #define spinlock_lock(lock) atomic_lock_arch(&(lock)->val) … … 175 175 #define SPINLOCK_STATIC_INITIALIZE_NAME(name, desc_name) 176 176 177 #define ASSERT_SPINLOCK(expr, lock) ASSERT(expr)177 #define ASSERT_SPINLOCK(expr, lock) assert(expr) 178 178 179 179 #define spinlock_initialize(lock, name)
Note:
See TracChangeset
for help on using the changeset viewer.