hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/input/mouse/vmmouse.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for Virtual PS/2 Mouse on VMware and QEMU hypervisors.
34 *
45 * Copyright (C) 2014, VMware, Inc. All Rights Reserved.
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License version 2 as published by
8
- * the Free Software Foundation.
96 *
107 * Twin device code is hugely inspired by the ALPS driver.
118 * Authors:
....@@ -19,12 +16,12 @@
1916 #include <linux/slab.h>
2017 #include <linux/module.h>
2118 #include <asm/hypervisor.h>
19
+#include <asm/vmware.h>
2220
2321 #include "psmouse.h"
2422 #include "vmmouse.h"
2523
2624 #define VMMOUSE_PROTO_MAGIC 0x564D5868U
27
-#define VMMOUSE_PROTO_PORT 0x5658
2825
2926 /*
3027 * Main commands supported by the vmmouse hypervisor port.
....@@ -87,7 +84,7 @@
8784 #define VMMOUSE_CMD(cmd, in1, out1, out2, out3, out4) \
8885 ({ \
8986 unsigned long __dummy1, __dummy2; \
90
- __asm__ __volatile__ ("inl %%dx" : \
87
+ __asm__ __volatile__ (VMWARE_HYPERCALL : \
9188 "=a"(out1), \
9289 "=b"(out2), \
9390 "=c"(out3), \
....@@ -97,7 +94,7 @@
9794 "a"(VMMOUSE_PROTO_MAGIC), \
9895 "b"(in1), \
9996 "c"(VMMOUSE_PROTO_CMD_##cmd), \
100
- "d"(VMMOUSE_PROTO_PORT) : \
97
+ "d"(0) : \
10198 "memory"); \
10299 })
103100