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) :
);
}
unsigned int ReadCp15()
{
unsigned int x;
asm ("mrc p15, 0, %0, c1, c0, 0;" : "=r"(x) : );
return x;
}

If I compiled with -O3, they come with:
0000826c <_SetCp15>:
    826c: e1a0c00d  mov ip, sp
    8270: e92dd800  stmdb sp!, {fp, ip, lr, pc}
    8274: e24cb004  sub fp, ip, #4
    8278: ee01ef10  mcr 15, 0, lr, cr1, cr0, {0}
    827c: e91ba800  ldmdb fp, {fp, sp, pc}

00008280 <_ReadCp15>:
    8280: e1a0c00d  mov ip, sp
    8284: e92dd800  stmdb sp!, {fp, ip, lr, pc}
    8288: ee110f10  mrc 15, 0, r0, cr1, cr0, {0}
    828c: e24cb004  sub fp, ip, #4
    8290: e91ba800  ldmdb fp, {fp, sp, pc}

Are those assembler correct? Please help me! I don't
know what registers are those ip, sp, fp, lr, pc.
pc should be R15, right?

--- "Afzal, Naeem M" <[EMAIL PROTECTED]> wrote:
> one example would be:
> 
> unsigned int _read_timer()
> {
>     unsigned x;
>     asm("mrc p14, 0, %0, c1, c0, 0;" : "=r"(x) : );
>     return x;
> }
> 
> naeem
> -----Original Message-----
> From: gavin li [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 10, 2001 6:12 PM
> To: [EMAIL PROTECTED]
> Subject: How to operate CP15 in gnu C code?
> 
> 
> for example : mcr p15,0,r14,c1,c0,0
> Anyone who knows how to implement those kind of
> instructions in gnu C code?
> by the way what does LTORG mean in ARM asm?
> 
> Thanks,
> 
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
> 
> _______________________________________________
>
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
> Please visit the above address for information on
> this list.
> 
> _______________________________________________
>
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
> Please visit the above address for information on
> this list.


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.

Reply via email to