On Fri, Oct 12, 2001 at 08:58:13PM +0100, Russell King - ARM Linux wrote:
> On Fri, Oct 12, 2001 at 12:48:35PM -0700, gavin li wrote:
> > First, thanks for your reply!
> > I have these two functions:
> > void SetCp15(unsigned int uCp15Val)
> > {
> > asm ("mcr p15, 0, %0, c1, c0, 0;" : "=r"(uCp15Val) :
> > );
> > }
>
> This is wrong. asm statements are basically:
>
> asm( ... code ... : ... outputs ... : ... inputs ... : ... corrupted ... );
>
> "=r" means "output register" and can only appear in the
> "outputs" section.
>
> "r" means "register", and should appear in the inputs
> section.
Inline assembly is pretty nice explained in:
http://www-106.ibm.com/developerworks/linux/library/l-ia.html
http://www.uwsg.indiana.edu/hypermail/linux/kernel/9804.2/0953.html
They're both geared towards x86, but the general principles apply to
arm assembly as well.
Erik
--
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands
Phone: +31-15-2783635 Fax: +31-15-2781843 Email: [EMAIL PROTECTED]
WWW: http://www-ict.its.tudelft.nl/~erik/
_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.