Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/bhyve/gdb.c
Show All 26 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#ifndef WITHOUT_CAPSICUM | #ifndef WITHOUT_CAPSICUM | ||||
#include <sys/capsicum.h> | #include <sys/capsicum.h> | ||||
#endif | #endif | ||||
#include <sys/endian.h> | |||||
#include <sys/ioctl.h> | #include <sys/ioctl.h> | ||||
#include <sys/mman.h> | #include <sys/mman.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <machine/atomic.h> | #include <machine/atomic.h> | ||||
#include <machine/specialreg.h> | #include <machine/specialreg.h> | ||||
#include <machine/vmm.h> | #include <machine/vmm.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <assert.h> | #include <assert.h> | ||||
▲ Show 20 Lines • Show All 905 Lines • ▼ Show 20 Lines | if (cp != NULL) { | ||||
* aligned writes of words when possible. | * aligned writes of words when possible. | ||||
*/ | */ | ||||
while (todo > 0) { | while (todo > 0) { | ||||
if (gpa & 1 || todo == 1) { | if (gpa & 1 || todo == 1) { | ||||
bytes = 1; | bytes = 1; | ||||
val = parse_byte(data); | val = parse_byte(data); | ||||
} else if (gpa & 2 || todo == 2) { | } else if (gpa & 2 || todo == 2) { | ||||
bytes = 2; | bytes = 2; | ||||
val = parse_byte(data) | | val = be16toh(parse_integer(data, 4)); | ||||
(parse_byte(data + 2) << 8); | |||||
} else { | } else { | ||||
bytes = 4; | bytes = 4; | ||||
val = parse_byte(data) | | val = be32toh(parse_integer(data, 8)); | ||||
(parse_byte(data + 2) << 8) | | |||||
(parse_byte(data + 4) << 16) | | |||||
(parse_byte(data + 6) << 24); | |||||
} | } | ||||
error = write_mem(ctx, cur_vcpu, gpa, val, | error = write_mem(ctx, cur_vcpu, gpa, val, | ||||
bytes); | bytes); | ||||
if (error == 0) { | if (error == 0) { | ||||
gpa += bytes; | gpa += bytes; | ||||
gva += bytes; | gva += bytes; | ||||
resid -= bytes; | resid -= bytes; | ||||
todo -= bytes; | todo -= bytes; | ||||
▲ Show 20 Lines • Show All 528 Lines • Show Last 20 Lines |