On Thu, Nov 19, 2009 at 5:50 PM, Johnny Hung <[email protected]> wrote:
> Hi All:
> I want to move two local valuables to x86 arch CPU ebx, ecx
> register and do outb cpu instruction by using AT&A inline asm in
> kernel driver. The following code was I wrote but gcc report syntax
> error:
You must mean AT&T.
> ==
> unsigned int val = 10;
> unsigned int tmp = 5;
> ....
> __asm__ volatile ("movl %0, %%ebx"
You need to put "\n\t" in the end of each asm statement.
> "movl %1, %%ecx"
> "outb $0x27, $0xb2"
This is wrong, 'outb' instruction cann't accept both of
its operands as constants, IIRC.
> :
> :"r"(val), "r"(tmp)
> :"%ebx", "%ecx"
> );
>
> Does anyone can point me out. Any reply is appreciated.
Regards.
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html