summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/p5ioc2-phb.c23
-rw-r--r--hw/p7ioc-phb.c24
-rw-r--r--hw/phb3.c26
3 files changed, 14 insertions, 59 deletions
diff --git a/hw/p5ioc2-phb.c b/hw/p5ioc2-phb.c
index b52fe44b..0dcf0cea 100644
--- a/hw/p5ioc2-phb.c
+++ b/hw/p5ioc2-phb.c
@@ -25,25 +25,10 @@
#include <interrupts.h>
#include <ccan/str/str.h>
-static void p5ioc2_phb_trace(struct p5ioc2_phb *p, FILE *s, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
-
-static void p5ioc2_phb_trace(struct p5ioc2_phb *p, FILE *s, const char *fmt, ...)
-{
- /* Use a temp stack buffer to print all at once to avoid
- * mixups of a trace entry on SMP
- */
- char tbuf[128 + 10];
- va_list args;
- char *b = tbuf;
-
- b += sprintf(b, "PHB%d: ", p->phb.opal_id);
- va_start(args, fmt);
- vsnprintf(b, 128, fmt, args);
- va_end(args);
- fputs(tbuf, s);
-}
-#define PHBDBG(p, fmt...) p5ioc2_phb_trace(p, stdout, fmt)
-#define PHBERR(p, fmt...) p5ioc2_phb_trace(p, stderr, fmt)
+#define PHBDBG(p, fmt, a...) prlog(PR_DEBUG, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
+#define PHBERR(p, fmt, a...) prlog(PR_ERR, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
/* Helper to set the state machine timeout */
static inline uint64_t p5ioc2_set_sm_timeout(struct p5ioc2_phb *p, uint64_t dur)
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c
index 834a7941..fd2ebd6e 100644
--- a/hw/p7ioc-phb.c
+++ b/hw/p7ioc-phb.c
@@ -26,26 +26,10 @@
#include <opal.h>
#include <ccan/str/str.h>
-static void p7ioc_phb_trace(struct p7ioc_phb *p, FILE *s, const char *fmt, ...)
-__attribute__ ((format (printf, 3, 4)));
-
-static void p7ioc_phb_trace(struct p7ioc_phb *p, FILE *s, const char *fmt, ...)
-{
- /* Use a temp stack buffer to print all at once to avoid
- * mixups of a trace entry on SMP
- */
- char tbuf[128 + 10];
- va_list args;
- char *b = tbuf;
-
- b += sprintf(b, "PHB%d: ", p->phb.opal_id);
- va_start(args, fmt);
- vsnprintf(b, 128, fmt, args);
- va_end(args);
- fputs(tbuf, s);
-}
-#define PHBDBG(p, fmt...) p7ioc_phb_trace(p, stdout, fmt)
-#define PHBERR(p, fmt...) p7ioc_phb_trace(p, stderr, fmt)
+#define PHBDBG(p, fmt, a...) prlog(PR_DEBUG, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
+#define PHBERR(p, fmt, a...) prlog(PR_ERR, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
/* Helper to select an IODA table entry */
static inline void p7ioc_phb_ioda_sel(struct p7ioc_phb *p, uint32_t table,
diff --git a/hw/phb3.c b/hw/phb3.c
index 90e5be5e..5fea0352 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -51,26 +51,12 @@
static void phb3_init_hw(struct phb3 *p);
-static void phb3_trace(struct phb3 *p, FILE *s, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
-
-static void phb3_trace(struct phb3 *p, FILE *s, const char *fmt, ...)
-{
- /* Use a temp stack buffer to print all at once to avoid
- * mixups of a trace entry on SMP
- */
- char tbuf[128 + 10];
- va_list args;
- char *b = tbuf;
-
- b += sprintf(b, "PHB%d: ", p->phb.opal_id);
- va_start(args, fmt);
- vsnprintf(b, 128, fmt, args);
- va_end(args);
- fputs(tbuf, s);
-}
-#define PHBDBG(p, fmt...) phb3_trace(p, stdout, fmt)
-#define PHBINF(p, fmt...) phb3_trace(p, stderr, fmt)
-#define PHBERR(p, fmt...) phb3_trace(p, stderr, fmt)
+#define PHBDBG(p, fmt, a...) prlog(PR_DEBUG, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
+#define PHBINF(p, fmt, a...) prlog(PR_INFO, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
+#define PHBERR(p, fmt, a...) prlog(PR_ERR, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
/*
* Lock callbacks. Allows the OPAL API handlers to lock the
OpenPOWER on IntegriCloud