3

for example in entry.S

ENTRY(ret_from_fork)
    pushl %eax
    call schedule_tail
    GET_THREAD_INFO(%ebp)
    popl %eax
    jmp syscall_exit

so what's the syntax of ENTRY in as language? I think all the directive of as is start with . and the ENTRY also doesn't look like a macro can anyone tell me about the ENTRY is what? if it is defined in Linux source code could anyone indicate the location or if it is a syntax in as can someone tell me where i can find the specific description of this use! Thanks!

Adambynes
  • 197
  • 1
  • 10

2 Answers2

5

Not sure why you say it doesn't look like a macro, because that's exactly how macros look like. And indeed it is a macro defined in include/linux/linkage.h as follows:

#ifndef ENTRY
#define ENTRY(name) \
    .globl name ASM_NL \
    ALIGN ASM_NL \
    name:
#endif
Jester
  • 56,577
  • 4
  • 81
  • 125
  • the reason i think it is not an macro is i think in assembly there is no preprocessing, but .S suffix is tell the gcc to using preprocessing before compiling the assembly which is not support in as – Adambynes Feb 26 '14 at 08:20
1

I think that's an assembler directive . As per my knowledge ENTRY assembler directive is used when we use Keil assembler. That's actually the entry point of a application.

The way we have _start or _main entry point in assembly code when we use GNU assembler.

Virendra Kumar
  • 947
  • 2
  • 13
  • 31