Re: Doubt in Sysem call!!

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

 



On Thu, 2002-03-28 at 15:28, krishnan charumathi wrote:
> Hi
> 
> Could someone tell what is the difference between the following.
> 
> .rept NR_syscalls-(.-sys_call_table)/4
> 	.long SYMBOL_NAME(sys_ni_syscall)
> .endr
This is the right one. It is a repeat assembler directive.
NR_syscalls is a constant of the max available syscalls. The
(.-sys_call_table) calculates the actual adress minus the start adress
of the table of syscall entries, thus the length (in memory) of this
table. Every entry takes four byte. So it is devided by four to get the
amount of syscalls defined in the table. The max avail syscalls MINUS
this amount gives the amount of syscalls not defined. The repeat fills
not-defined times entries for not imlemented into the syscall table.
!!!!!!!! DO NOT CHANGE THIS !!!!!!!!
> 
> and
> 
> 
> .rept NR_syscalls-191
> 	.long SYMBOL_NAME(sys_ni_syscall)
> .endr
This assumes, that actually are 191 syscalls defined ... but ... hmmm
... where does this come from?
> 
> What does each mean and does it make a difference in implementing system 
> call?? Do we have to make any changes to the first one while implamenting a  
> new system call???

I solved this problem yesterday. Assuming you added:

.long SYMBOL_NAME(sys_my_syscall)

just above the rept ( to the end of the defined syscalls), and made a
definition like

#define __NR_my_syscall	###

in asm/unistd.h

everything should be fine.

Hope this helps
Frank



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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