From: dsrking on
Hi

I need to read/write acpi registers using portio driver which is got
from WinDDK7600 version. I added some ASM code in my driver source for
read/write as follows,

-------------------------------------------------------------------------------------------------------
__asm
{
MOV ECX, Reg_Addr // address of the reg to be written
MOV EAX, Value1 // First value to be written
MOV EDX, Value2 // second value to be written
WRMSR
}
-------------------------------------------------------------------------------------------------------
Note: Reg_Addr, Value1,Value2 are inputs for this function.

This is working in perfectly x86 build. But not working in x64 build.
It shows errors like,

__asm keyword not supported on this architecture.
'MOV' undeclared identifier,etc.,

Could anybody explain how to solve this problem?

Regards - D.



From: Doron Holan [MSFT] on
which acpi registers are you trying to use? if they are owned by another
driver, you will be putting the machine into an unknown state b/c there is
no way you can synchronize access to the registers with the owner

d

--

This posting is provided "AS IS" with no warranties, and confers no rights.


"dsrking" <dsrking2006(a)gmail.com> wrote in message
news:9ef0a9fc-aa13-48bc-9bb1-e6635b81d4b9(a)j17g2000yqa.googlegroups.com...
> Hi
>
> I need to read/write acpi registers using portio driver which is got
> from WinDDK7600 version. I added some ASM code in my driver source for
> read/write as follows,
>
> -------------------------------------------------------------------------------------------------------
> __asm
> {
> MOV ECX, Reg_Addr // address of the reg to be written
> MOV EAX, Value1 // First value to be written
> MOV EDX, Value2 // second value to be written
> WRMSR
> }
> -------------------------------------------------------------------------------------------------------
> Note: Reg_Addr, Value1,Value2 are inputs for this function.
>
> This is working in perfectly x86 build. But not working in x64 build.
> It shows errors like,
>
> __asm keyword not supported on this architecture.
> 'MOV' undeclared identifier,etc.,
>
> Could anybody explain how to solve this problem?
>
> Regards - D.
>
>
>
From: Maxim S. Shatskih on
> This is working in perfectly x86 build. But not working in x64 build.
> It shows errors like,
>
> __asm keyword not supported on this architecture.

__asm is just plain not supported by x64 compiler.

Use __readmsr() and __writemsr() instead of __asm

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com

From: dsrking on
Hi guys,

thanks for your reply,

now i am using __readmsr, __writemsr instead of __asm.

Need to test in pc. I'll update you later.

thanks onceagain.

regards - D.

From: Wayne on
Another way is to write functions in a separate file xx.asm. Add a new line
in SOURCE file such as:

AMD64_SOURCES = xx.asm

--
thanks
wayne