From: dsrking on 19 Apr 2010 08:32 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 19 Apr 2010 13:23 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 19 Apr 2010 13:44 > 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 21 Apr 2010 06:29 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 27 Apr 2010 04:28 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
|
Pages: 1 Prev: unknown device Next: RE" Assembly code in driver source with x64 build not working |