|
32 | 32 | #include "exec/tswap.h"
|
33 | 33 | #include "system/dma.h"
|
34 | 34 | #include "system/runstate.h"
|
35 |
| - |
36 |
| -#define RISCV_DEBUG_HTIF 0 |
37 |
| -#define HTIF_DEBUG(fmt, ...) \ |
38 |
| - do { \ |
39 |
| - if (RISCV_DEBUG_HTIF) { \ |
40 |
| - qemu_log_mask(LOG_TRACE, "%s: " fmt "\n", __func__, ##__VA_ARGS__);\ |
41 |
| - } \ |
42 |
| - } while (0) |
| 35 | +#include "trace.h" |
43 | 36 |
|
44 | 37 | #define HTIF_DEV_SHIFT 56
|
45 | 38 | #define HTIF_CMD_SHIFT 48
|
@@ -159,8 +152,7 @@ static void htif_handle_tohost_write(HTIFState *s, uint64_t val_written)
|
159 | 152 | uint64_t payload = val_written & 0xFFFFFFFFFFFFULL;
|
160 | 153 | int resp = 0;
|
161 | 154 |
|
162 |
| - HTIF_DEBUG("mtohost write: device: %d cmd: %d what: %02" PRIx64 |
163 |
| - " -payload: %016" PRIx64 "\n", device, cmd, payload & 0xFF, payload); |
| 155 | + trace_htif_uart_write_to_host(device, cmd, payload); |
164 | 156 |
|
165 | 157 | /*
|
166 | 158 | * Currently, there is a fixed mapping of devices:
|
@@ -251,8 +243,7 @@ static void htif_handle_tohost_write(HTIFState *s, uint64_t val_written)
|
251 | 243 | }
|
252 | 244 | } else {
|
253 | 245 | qemu_log("HTIF unknown device or command\n");
|
254 |
| - HTIF_DEBUG("device: %d cmd: %d what: %02" PRIx64 |
255 |
| - " payload: %016" PRIx64, device, cmd, payload & 0xFF, payload); |
| 246 | + trace_htif_uart_unknown_device_command(device, cmd, payload); |
256 | 247 | }
|
257 | 248 | /*
|
258 | 249 | * Latest bbl does not set fromhost to 0 if there is a value in tohost.
|
|
0 commit comments