Exemplo n.º 1
0
static void kbd_write_command(struct kvm *kvm, u8 val)
{
	switch (val) {
	case I8042_CMD_CTL_RCTR:
		kbd_queue(state.mode);
		break;
	case I8042_CMD_CTL_WCTR:
	case I8042_CMD_AUX_SEND:
	case I8042_CMD_AUX_LOOP:
		state.write_cmd = val;
		break;
	case I8042_CMD_AUX_TEST:
		/* 0 means we're a normal PS/2 mouse */
		mouse_queue(0);
		break;
	case I8042_CMD_AUX_DISABLE:
		state.mode |= MODE_DISABLE_AUX;
		break;
	case I8042_CMD_AUX_ENABLE:
		state.mode &= ~MODE_DISABLE_AUX;
		break;
	case I8042_CMD_SYSTEM_RESET:
		kvm_cpu__reboot(kvm);
		break;
	default:
		break;
	}
}
Exemplo n.º 2
0
static void rtas_power_off(struct kvm_cpu *vcpu,
                           uint32_t token, uint32_t nargs, target_ulong args,
                           uint32_t nret, target_ulong rets)
{
	if (nargs != 2 || nret != 1) {
		rtas_st(vcpu->kvm, rets, 0, -3);
		return;
	}
	kvm_cpu__reboot(vcpu->kvm);
}
Exemplo n.º 3
0
static void rtas_system_reboot(struct kvm_cpu *vcpu,
                           uint32_t token, uint32_t nargs, target_ulong args,
                           uint32_t nret, target_ulong rets)
{
	if (nargs != 0 || nret != 1) {
		rtas_st(vcpu->kvm, rets, 0, -3);
		return;
	}

	/* NB this actually halts the VM */
	kvm_cpu__reboot(vcpu->kvm);
}