Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/bhyve/inout.c
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | static struct { | ||||
inout_func_t handler; | inout_func_t handler; | ||||
void *arg; | void *arg; | ||||
} inout_handlers[MAX_IOPORTS]; | } inout_handlers[MAX_IOPORTS]; | ||||
static int | static int | ||||
default_inout(struct vmctx *ctx, int vcpu, int in, int port, int bytes, | default_inout(struct vmctx *ctx, int vcpu, int in, int port, int bytes, | ||||
uint32_t *eax, void *arg) | uint32_t *eax, void *arg) | ||||
{ | { | ||||
if (in) { | if (in) { | ||||
switch (bytes) { | switch (bytes) { | ||||
case 4: | case 4: | ||||
*eax = 0xffffffff; | *eax = 0xffffffff; | ||||
break; | break; | ||||
case 2: | case 2: | ||||
*eax = 0xffff; | *eax = 0xffff; | ||||
break; | break; | ||||
case 1: | case 1: | ||||
*eax = 0xff; | *eax = 0xff; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
register_default_iohandler(int start, int size) | register_default_iohandler(int start, int size) | ||||
{ | { | ||||
struct inout_port iop; | struct inout_port iop; | ||||
VERIFY_IOPORT(start, size); | VERIFY_IOPORT(start, size); | ||||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |