|
5 | 5 | #include <stdio.h>
|
6 | 6 | #include <string.h>
|
7 | 7 |
|
| 8 | +#include "compiler.h" |
8 | 9 | #include "frame_arch.h"
|
9 | 10 | #include "frame_buffer.h"
|
10 | 11 | #include "qemu-plugin.h"
|
@@ -53,7 +54,7 @@ static void add_post_reg_state(VCPU *vcpu, unsigned int vcpu_index,
|
53 | 54 | &g_array_index(current_regs, qemu_plugin_reg_descriptor, i);
|
54 | 55 | int s = qemu_plugin_read_register(reg->handle, rdata);
|
55 | 56 | assert(s == prev_reg->content->len);
|
56 |
| - swap_to_le(rdata->data, s, state.is_big_endian); |
| 57 | + swap_to_le(rdata->data, s, HOST_BIG_ENDIAN); |
57 | 58 | if (!memcmp(rdata->data, prev_reg->content->data, s)) {
|
58 | 59 | // No change
|
59 | 60 | // Flush byte array
|
@@ -82,7 +83,7 @@ static void add_pre_reg_state(VCPU *vcpu, unsigned int vcpu_index,
|
82 | 83 | g_assert(!strcmp(prev_reg->name, reg->name) &&
|
83 | 84 | prev_reg->handle == reg->handle);
|
84 | 85 | memcpy_le(prev_reg->content->data, rdata->data, prev_reg->content->len,
|
85 |
| - state.is_big_endian); |
| 86 | + HOST_BIG_ENDIAN); |
86 | 87 | frame_buffer_append_reg_info(fbuf, reg->name, rdata, s, OperandRead);
|
87 | 88 | // Flush byte array
|
88 | 89 | g_byte_array_set_size(rdata, 0);
|
@@ -341,14 +342,6 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
|
341 | 342 | qemu_plugin_outs("Pass it with 'out=<output_file>'.\n\n");
|
342 | 343 | exit(1);
|
343 | 344 | }
|
344 |
| - char *endianess = get_argv_val(argv, argc, "endianess"); |
345 |
| - if (!endianess || (strcmp(endianess, "b") && strcmp(endianess, "l"))) { |
346 |
| - qemu_plugin_outs("'endianess' argument is missing or is not 'b' or 'l'.\n"); |
347 |
| - qemu_plugin_outs("This is required until QEMU plugins get a richer API.\n"); |
348 |
| - qemu_plugin_outs("Pass it with 'endianess=[b/l]'.\n\n"); |
349 |
| - exit(1); |
350 |
| - } |
351 |
| - state.is_big_endian = endianess[0] == 'b'; |
352 | 345 |
|
353 | 346 | state.target_name = g_strdup(info->target_name);
|
354 | 347 | state.frame_buffer = g_ptr_array_new();
|
|
0 commit comments