Hi Pradeep,

Pradeep Kumar Bola, TLS,Chennai wrote:
I am working on 5213evb Freescale evaluation board. I am using gcc compiler for the same. I my program I am using inline assembly program for reading status register value.
But is giving some error. Can any one help me regarding this.
My code is
u8_t read_interrupt(void)
{
 u8_t i;
 __asm("move.w %sr, %d0\n"
  "andi.w #0x0700, %d0" : "=r" (i)); //* return value
 return i;
}
I got the error as:
../../boot/boot.c:502: error: invalid 'asm': operand number missing after %-letter ../../boot/boot.c:502: error: invalid 'asm': operand number missing after %-letter

You need to use "%%" in front of real registers, so gcc can tell
the difference between its operands (a single "%" followed by a
number). So it should be something like:

 "move.w %%sr, %%d0\n"

There is plenty of example asm usage in the kernel,
linux-2.6.x/arch/asm-m68knommu/system.h is a good one.

BTW, is this user application code?
Not much point looking at the interrupt flag from
user space - you will always see it as enabled.
And you sure won't be able to change it with user
privileges.

Regards
Greg





------------------------------------------------------------------------
*From:* Pradeep Kumar Bola, TLS,Chennai
*Sent:* Fri 2/2/2007 12:27 PM
*To:* [email protected]
*Cc:* [EMAIL PROTECTED]
*Subject:* Enable and disable interrupt for mcf5213

Hi,
I am working on 5213eb with GCC compiler. For disabling the interrupt I am loading SR value with '7' and for enabling I am loading the SR value with the old value that I read the SR value before disabling.
I am using IPL value for disabling and enabling.
Can any one help me whether this is the proper way to enable or disable the interrupt? If not how can I disable ad enable interrupt by using C or assembly program. With Regards,
/Pradeep Kumar.B/


------------------------------------------------------------------------

DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------


------------------------------------------------------------------------

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

--
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     [EMAIL PROTECTED]
SnapGear -- a Secure Computing Company      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to