Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:PowerPC
xf86-input-vmmouse
xf86-input-vmmouse-iopl.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xf86-input-vmmouse-iopl.diff of Package xf86-input-vmmouse
diff --git a/shared/vmmouse_proto.c b/shared/vmmouse_proto.c index b50e071..263bb36 100644 --- a/shared/vmmouse_proto.c +++ b/shared/vmmouse_proto.c @@ -33,6 +33,7 @@ */ +#include <sys/io.h> #include "vmmouse_proto.h" @@ -119,6 +120,31 @@ VMMouseProtoInOut(VMMouseProtoCmd *cmd) // IN/OUT #endif } +/* + *----------------------------------------------------------------------------- + * + * VMMouseGetIOPL -- + * + * Helper to figure out the current I/O privilege level (idea by + * Jiri Kosina <jkosina@suse.cz>) + * + * Results: + * Returns I/O privilege level + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +int +VMMouseGetIOPL() +{ + unsigned long eflags; + + asm ("pushf\n\tpop %0" : "=r" (eflags)); + return (eflags >> 12) & 3; +} /* *----------------------------------------------------------------------------- @@ -140,8 +166,22 @@ VMMouseProtoInOut(VMMouseProtoCmd *cmd) // IN/OUT void VMMouseProto_SendCmd(VMMouseProtoCmd *cmd) // IN/OUT { + int cpl; + cmd->in.magic = VMMOUSE_PROTO_MAGIC; cmd->in.port = VMMOUSE_PROTO_PORT; +#if defined __i386__ || defined __x86_64__ + cpl = VMMouseGetIOPL(); + /* + * To access i/o ports above 0x3ff, we need to be in iopl(3). + */ + iopl(3); +#endif + VMMouseProtoInOut(cmd); + +#if defined __i386__ || defined __x86_64__ + iopl(cpl); +#endif }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor