diff options
author | Amitay Isaacs <amitay@gmail.com> | 2018-03-27 11:33:09 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@ozlabs.org> | 2018-05-18 15:40:58 +1000 |
commit | 70e8e4425d27ce4860b612c0b1ffa7212ab61007 (patch) | |
tree | 6484a5d31ff7a62d36ec9573c9bb21705d861469 | |
parent | ba4df6f0ab5a9ba0bee78d5233ac6848f1258b6b (diff) | |
download | pdbg-70e8e4425d27ce4860b612c0b1ffa7212ab61007.tar.gz pdbg-70e8e4425d27ce4860b612c0b1ffa7212ab61007.zip |
libpdbg: Replace PR_PERL with PR_INFO
... and avoid duplicate definitions
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
-rw-r--r-- | libpdbg/chip.c | 1 | ||||
-rw-r--r-- | libpdbg/htm.c | 22 | ||||
-rw-r--r-- | libpdbg/operations.h | 3 | ||||
-rw-r--r-- | libpdbg/target.h | 7 |
4 files changed, 12 insertions, 21 deletions
diff --git a/libpdbg/chip.c b/libpdbg/chip.c index ee12614..8925494 100644 --- a/libpdbg/chip.c +++ b/libpdbg/chip.c @@ -24,6 +24,7 @@ #include "target.h" #include "operations.h" #include "bitutils.h" +#include "debug.h" static uint64_t mfspr(uint64_t reg, uint64_t spr) { diff --git a/libpdbg/htm.c b/libpdbg/htm.c index 741b39f..3a6187e 100644 --- a/libpdbg/htm.c +++ b/libpdbg/htm.c @@ -28,15 +28,11 @@ #include "operations.h" #include "bitutils.h" #include "target.h" +#include "debug.h" #define HTM_ERR(x) ({int rc = x; if (rc) {PR_ERROR("HTM Error %d %s:%d\n", \ rc, __FILE__, __LINE__);} \ rc;}) -/* - * #define PR_PERL(x, args...) \ - * fprintf(stderr, x, ##args) - */ -#define PR_PERL(...) #define MIN(x,y) ((x < y) ? x : y) @@ -334,15 +330,15 @@ static int do_htm_stop(struct htm *htm) return -1; if (status.state == UNINITIALIZED) { - PR_PERL("* Skipping STOP trigger, HTM appears uninitialized\n"); + PR_INFO("* Skipping STOP trigger, HTM appears uninitialized\n"); return -1; } if (status.state == TRACING) { - PR_PERL("* Sending STOP trigger to HTM\n"); + PR_INFO("* Sending STOP trigger to HTM\n"); if (HTM_ERR(pib_write(&htm->target, HTM_SCOM_TRIGGER, HTM_TRIG_STOP))) return -1; } else { - PR_PERL("* Skipping STOP trigger, HTM is not running\n"); + PR_INFO("* Skipping STOP trigger, HTM is not running\n"); } return 1; } @@ -388,7 +384,7 @@ static int do_adu_magic(struct pdbg_target *target, uint32_t index, uint64_t *ar } while (val != 0x2000000000000004 && i < 10); if (val != 0x2000000000000004) { - PR_PERL("Unexpected status on HTM start trigger PMISC command: 0x%" + P_INFO("Unexpected status on HTM start trigger PMISC command: 0x%" PRIx64 "\n", val); return -1; } @@ -561,7 +557,7 @@ static int do_htm_start(struct htm *htm) return -1; } - PR_PERL("* Sending START trigger to HTM\n"); + PR_INFO("* Sending START trigger to HTM\n"); if (HTM_ERR(pib_write(&htm->target, HTM_SCOM_TRIGGER, HTM_TRIG_MARK_VALID))) return -1; @@ -773,11 +769,11 @@ static int do_htm_pause(struct htm *htm) return -1; if (status.state == UNINITIALIZED) { - PR_PERL("* Skipping PAUSE trigger, HTM appears uninitialized\n"); + PR_INFO("* Skipping PAUSE trigger, HTM appears uninitialized\n"); return 0; } - PR_PERL("* Sending PAUSE trigger to HTM\n"); + PR_INFO("* Sending PAUSE trigger to HTM\n"); if (HTM_ERR(pib_write(&htm->target, HTM_SCOM_TRIGGER, HTM_TRIG_PAUSE))) return -1; @@ -879,7 +875,7 @@ static int do_htm_dump(struct htm *htm, uint64_t size, const char *basename) return -1; if (status.state != COMPLETE) { - PR_PERL("* Skipping DUMP tigger, HTM is not in complete state\n"); + PR_INFO("* Skipping DUMP tigger, HTM is not in complete state\n"); return -1; } diff --git a/libpdbg/operations.h b/libpdbg/operations.h index 18a498d..2d8b1e3 100644 --- a/libpdbg/operations.h +++ b/libpdbg/operations.h @@ -18,11 +18,12 @@ #include "bitutils.h" #include "target.h" +#include "debug.h" /* Error codes */ #define EFSI 1 -#define PRINT_ERR PR_DEBUG("%s: %d\n", __FUNCTION__, __LINE__) +#define PRINT_ERR PR_DEBUG("failed\n"); #define CHECK_ERR(x) do { \ if (x) { \ PRINT_ERR; \ diff --git a/libpdbg/target.h b/libpdbg/target.h index 552d1d3..5541729 100644 --- a/libpdbg/target.h +++ b/libpdbg/target.h @@ -24,13 +24,6 @@ #include "device.h" #include "libpdbg.h" -#define PR_DEBUG(x, args...) \ - fprintf(stderr, x, ##args) -#define PR_INFO(x, args...) \ - fprintf(stderr, x, ##args) -#define PR_ERROR(x, args...) \ - fprintf(stderr, "%s: " x, __FUNCTION__, ##args) - enum chip_type {CHIP_UNKNOWN, CHIP_P8, CHIP_P8NV, CHIP_P9}; struct pdbg_target_class { |