Jan Glauber | d0b0885 | 2012-12-11 14:53:35 +0100 | [diff] [blame] | 1 | #ifndef _S390_ASM_PCI_DEBUG_H |
| 2 | #define _S390_ASM_PCI_DEBUG_H |
| 3 | |
| 4 | #include <asm/debug.h> |
| 5 | |
| 6 | extern debug_info_t *pci_debug_msg_id; |
| 7 | extern debug_info_t *pci_debug_err_id; |
| 8 | |
Sebastian Ott | a2ab833 | 2013-04-16 14:11:14 +0200 | [diff] [blame] | 9 | #define zpci_dbg(imp, fmt, args...) \ |
| 10 | debug_sprintf_event(pci_debug_msg_id, imp, fmt, ##args) |
Jan Glauber | d0b0885 | 2012-12-11 14:53:35 +0100 | [diff] [blame] | 11 | |
Jan Glauber | d0b0885 | 2012-12-11 14:53:35 +0100 | [diff] [blame] | 12 | #define zpci_err(text...) \ |
| 13 | do { \ |
| 14 | char debug_buffer[16]; \ |
| 15 | snprintf(debug_buffer, 16, text); \ |
| 16 | debug_text_event(pci_debug_err_id, 0, debug_buffer); \ |
| 17 | } while (0) |
| 18 | |
| 19 | static inline void zpci_err_hex(void *addr, int len) |
| 20 | { |
| 21 | while (len > 0) { |
| 22 | debug_event(pci_debug_err_id, 0, (void *) addr, len); |
| 23 | len -= pci_debug_err_id->buf_size; |
| 24 | addr += pci_debug_err_id->buf_size; |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | #endif |