Line
Link Here
|
0 |
-- a/checkvm/checkvm.c |
0 |
++ b/checkvm/checkvm.c |
Lines 79-86
getVersion(uint32 *version)
Link Here
|
79 |
{ |
79 |
{ |
80 |
uint32 eax, ebx, ecx, edx; |
80 |
uint32 eax, ebx, ecx, edx; |
81 |
|
81 |
|
82 |
__asm__ volatile("inl (%%dx)" : |
82 |
#ifdef __x86_64__ |
83 |
"=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : |
83 |
__asm__ volatile("pushq %%rbx \n\t" |
|
|
84 |
"inl (%%dx) \n\t" |
85 |
"movl %%ebx, %3 \n\t" |
86 |
"popq %%rbx \n\t" : |
87 |
#else |
88 |
__asm__ volatile("pushl %%ebx \n\t" |
89 |
"inl (%%dx) \n\t" |
90 |
"movl %%ebx, %3 \n\t" |
91 |
"popl %%ebx \n\t" : |
92 |
#endif |
93 |
"=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) : |
84 |
"0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETVERSION), |
94 |
"0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETVERSION), |
85 |
"2"(BDOOR_PORT) : "memory"); |
95 |
"2"(BDOOR_PORT) : "memory"); |
86 |
version[0] = eax; |
96 |
version[0] = eax; |
Lines 97-103
getHWVersion(uint32 *hwVersion)
Link Here
|
97 |
uint32 eax, ebx, ecx, edx; |
107 |
uint32 eax, ebx, ecx, edx; |
98 |
|
108 |
|
99 |
__asm__ volatile("inl (%%dx)" : |
109 |
__asm__ volatile("inl (%%dx)" : |
100 |
"=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : |
110 |
"=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) : |
101 |
"0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETHWVERSION), |
111 |
"0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETHWVERSION), |
102 |
"2"(BDOOR_PORT) : "memory"); |
112 |
"2"(BDOOR_PORT) : "memory"); |
103 |
*hwVersion = eax; |
113 |
*hwVersion = eax; |
Lines 113-119
getScreenSize(uint32 *screensize)
Link Here
|
113 |
uint32 eax, ebx, ecx, edx; |
123 |
uint32 eax, ebx, ecx, edx; |
114 |
|
124 |
|
115 |
__asm__ volatile("inl (%%dx)" : |
125 |
__asm__ volatile("inl (%%dx)" : |
116 |
"=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : |
126 |
"=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) : |
117 |
"0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETSCREENSIZE), |
127 |
"0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETSCREENSIZE), |
118 |
"2"(BDOOR_PORT) : "memory"); |
128 |
"2"(BDOOR_PORT) : "memory"); |
119 |
*screensize = eax; |
129 |
*screensize = eax; |