bfa_debug.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. /**
  18. * bfa_debug.h BFA debug interfaces
  19. */
  20. #ifndef __BFA_DEBUG_H__
  21. #define __BFA_DEBUG_H__
  22. #define bfa_assert(__cond) do { \
  23. if (!(__cond)) \
  24. bfa_panic(__LINE__, __FILE__, #__cond); \
  25. } while (0)
  26. #define bfa_sm_fault(__mod, __event) do { \
  27. bfa_trc(__mod, (((uint32_t)0xDEAD << 16) | __event)); \
  28. bfa_sm_panic((__mod)->logm, __LINE__, __FILE__, __event); \
  29. } while (0)
  30. #ifndef BFA_PERF_BUILD
  31. #define bfa_assert_fp(__cond) bfa_assert(__cond)
  32. #else
  33. #define bfa_assert_fp(__cond)
  34. #endif
  35. struct bfa_log_mod_s;
  36. void bfa_panic(int line, char *file, char *panicstr);
  37. void bfa_sm_panic(struct bfa_log_mod_s *logm, int line, char *file, int event);
  38. #endif /* __BFA_DEBUG_H__ */