NVIDIA DRIVE OS Linux API Reference

5.1.0.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bug.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 
26 #ifndef INCLUDED_BUG_H
27 #define INCLUDED_BUG_H
28 
29 #include <qbprint.h>
30 #include <stack_trace.h>
31 
32 #define wfi() __asm__ __volatile__("wfi")
33 
34 #define BUG()\
35  do { \
36  pr_error("BUG %s:%d (%s)\n", \
37  __FILE__, __LINE__, __FUNCTION__); \
38  QbDumpStack(); \
39  while (1) { \
40  wfi(); \
41  } \
42  } while (0)
43 
44 #define BUG_ON(x)\
45  do { \
46  if ((x) != 0) \
47  BUG(); \
48  } while (0)
49 
50 #define BUG_ON_MSG(x, ...)\
51  do { \
52  if ((x) != 0) {\
53  pr_error(__VA_ARGS__);\
54  BUG();\
55  } \
56  } while (0)
57 
58 
59 #define WARN_ON(x)\
60  do { \
61  if ((x) != 0) \
62  { \
63  pr_error("WARN %s:%d (%s)\n", \
64  __FILE__, __LINE__, __FUNCTION__); \
65  QbDumpStack(); \
66  } \
67  } while (0)
68 
71 #endif //INCLUDED_BUG_H
NVIDIA Quickboot Interface: Stack Trace Operations