summaryrefslogtreecommitdiff
path: root/usr/src/cmd/bhyve/gdb.c
diff options
context:
space:
mode:
authorMichael Zeller <mike@mikezeller.net>2020-03-11 16:55:43 -0400
committerPatrick Mooney <pmooney@pfmooney.com>2020-05-22 23:32:53 +0000
commit84659b24a533984de271059abf9a1092835d15a9 (patch)
treea5b46d9b98d0d88ee35aeef492b48c1e84d82035 /usr/src/cmd/bhyve/gdb.c
parentcf3ec608f736765ec9852eed5e611848a25de9a4 (diff)
downloadillumos-joyent-84659b24a533984de271059abf9a1092835d15a9.tar.gz
12735 bhyve upstream sync 2019 Sept
Reviewed by: Dan McDonald <danmcd@kebe.com> Reviewed by: John Levon <john.levon@joyent.com> Reviewed by: Patrick Mooney <pmooney@oxide.computer> Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src/cmd/bhyve/gdb.c')
-rw-r--r--usr/src/cmd/bhyve/gdb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr/src/cmd/bhyve/gdb.c b/usr/src/cmd/bhyve/gdb.c
index 71cb780544..06809860c6 100644
--- a/usr/src/cmd/bhyve/gdb.c
+++ b/usr/src/cmd/bhyve/gdb.c
@@ -32,6 +32,11 @@ __FBSDID("$FreeBSD$");
#ifndef WITHOUT_CAPSICUM
#include <sys/capsicum.h>
#endif
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#else
+#include <endian.h>
+#endif
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/socket.h>
@@ -969,14 +974,10 @@ gdb_write_mem(const uint8_t *data, size_t len)
val = parse_byte(data);
} else if (gpa & 2 || todo == 2) {
bytes = 2;
- val = parse_byte(data) |
- (parse_byte(data + 2) << 8);
+ val = be16toh(parse_integer(data, 4));
} else {
bytes = 4;
- val = parse_byte(data) |
- (parse_byte(data + 2) << 8) |
- (parse_byte(data + 4) << 16) |
- (parse_byte(data + 6) << 24);
+ val = be32toh(parse_integer(data, 8));
}
error = write_mem(ctx, cur_vcpu, gpa, val,
bytes);