Hi friends,
I am facing problem with 64-bit register read and write with asm
instructions in VxWorks 5.5.1/Tornado 2.2.1.

This is the code:

/* sysInMsr - Read the MSR register value
* long long sysInMsr (address)
* int address; /@ MSR address @/
*

*/
.balign 16,0x90
FUNC_LABEL(sysInMsr)
movl SP_ARG1(%esp),%ecx
RDMSR
jmp sysInMsr0
sysInMsr0:
ret

RDMSR instructions read 64-bit value and it will be in EAX (low 32-
bit )and EDX (High 32-bit ) registers.

While calling this function, it is not returning the high 32-bit
correctly.

For returning 64-bit value in asm function ,What I have to do? Whether
I need to add any compiler flags?

This is for write function:

/* void sysOutMsr(address, LowVal, HighVal)
* int address; /@ MSR address @/
* int LowVal; /@ MSR Reg Lower 32-bit Value @/
* int HighVal; /@ MSR Reg Higher 32-bit Value @/
*
*/
.balign 16,0x90
FUNC_LABEL(sysOutMsr)
movl SP_ARG1(%esp),%ecx
movl SP_ARG2(%esp),%eax
movl SP_ARG3(%esp),%edx
WRMSR
jmp sysOutMsr0
sysOutMsr0:
ret

I am testing both functions. The arch is X86.

Please give your ideas to solve this.

-Thanks
K.Ananth