Subject: about ARM-assemble code

From: 박범규 연구원 <[email-masked]>
Date: Fri, 19 May 2000 10:50:49 +0900

Hello, master.
I'm glad to find this site, and thanks.

I'm on study of kernel, porting linux to arm-core processor.
I read source, which is assemble code.  I can't understand, can't find any doc about that.

Please, guide me.

kernel ver 2.2.2
/linux/include/asm-arm/proc-armv/*

==========in semaphore.h===================
extern inline void down(struct semaphore * sem)
{
 unsigned int cpsr, temp;

 __asm__ __volatile__ ("
 @ atomic down operation
 mrs %0, cpsr
 orr %1, %0, #128  @ disable IRQs
 bic %0, %0, #0x80000000 @ clear N
 msr cpsr, %1
 ldr %1, [%2]
 subs %1, %1, #1
 orrmi %0, %0, #0x80000000 @ set N
 str %1, [%2]
 msr cpsr, %0
 movmi r0, %2
 blmi " SYMBOL_NAME_STR(__down_failed)
  : "=&r" (cpsr), "=&r" (temp)
  : "r" (sem)
  : "r0", "lr", "cc");
}
=============================================

help me reading this code,  have good luck, trimendous achievement.
good bye.
리오스 정보통신
TEL  02-522-8370
FAX  02-522-8370

---

From: Jungjun Kim <[email-masked]>
Date: Fri, 19 May 2000 11:01:11 +0900

If you learn ARM assemble code,  it is helpful for you to read the book "ARM
Architectual Reference Manual"
You can find that book in bookstore like Amazon, etc.

But if you just are not familliar with inline assmbler, please do as I did.
First compile it, next disasemble its object file.

	arm-linux-gcc -c -g test.c
To disassemble,
	arm-linux-objdump -S test.o

Or simply,
	arm-linux-gcc -S -c test.c

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
++        Please use [email-masked] for           ++
++                        kernel-related discussions.                      ++