a newbie question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I saw this code in /include/asm-i386/unistd.h
can any one please explain me the code
i m not good in assembly language but i can understand if u explain me.
as far as i understood
line 5 calls the interrupt 0x80
in line 6 the return value of the system call which is stored in the 
accumulater is assigned to __res
what does line no 7 means.I think it takes the position of the system call in 
the sys_call_table.But i dont understand what does that "0"  means and 
what exactly happens when line 7 is executed.
Simply stating how a particular system call is called when this code is 
executed.

1 #define _syscall0(type,name) \
2 type name(void) \
3 { \
4 long __res; \
5 __asm__ volatile ("int $0x80" \
6 	: "=a" (__res) \
7 	: "0" (__NR_##name)); \
8 __syscall_return(type,__res); \
9 }

thanks and regards,
mohan.
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux