linux-mips
[Top] [All Lists]

Re: how to include mips assembly in c code?

To: durai <durai@isofttech.com>
Subject: Re: how to include mips assembly in c code?
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 9 Oct 2003 09:54:15 +0200
Cc: mips <linux-mips@linux-mips.org>
In-reply-to: <007801c38e27$a1c81920$6b00a8c0@DURAI>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <007801c38e27$a1c81920$6b00a8c0@DURAI>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.1i
On Thu, Oct 09, 2003 at 11:08:56AM +0530, durai wrote:

> I am having the following assembly code and i wanted to call this function
> from a c code.
> can anybody tell me how to include this code in a c program?

Several solutions:

  #define sysWbFlush()   do { (*(volatile unsigned int *)K1BASE) } while (0)

Or using your existing code:

  extern void sysWbFlush(void);

the call as

  sysWbFlush();

No point in using inline assembler for such a small fragment.

Anyway - I suggest you dump this code and look at <asm/wbflush.h>.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>