thanks rajat,<br>and of course mulyadi , sorry for the confusion.<br>@ mulyadi : u got me right as u always do. :)<br>except system dependencies is there anything which should be taken care of before implementing this task??<br>
<br><div class="gmail_quote">On Tue, Jan 11, 2011 at 3:40 PM, Rajat Sharma <span dir="ltr"><<a href="mailto:fs.rajat@gmail.com">fs.rajat@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">> is there any procedure in kernel to check for the interrupt vector number which caused it to be invoked?<br>
</div>Its actually very architecture dependent, on x86, its 'int $0x80'<br>
which causes user space to call system calls handlers. Recent intel<br>
architectures have callgate mechanism to enter into system call, look<br>
for sysenter instruction.<br>
Anyways, are you interested in interrupt number or the system call number?<br>
<div class="im"><br>
> i mean like one of my friends said that when kernel is about to restart a<br>
> syscall then it raises signal -ERESTARTSYS signal for signal handler.<br>
<br>
</div>Thats totally wrong. Like any other error code, its just an error code<br>
which waiting API return if process was interrupted while waiting on<br>
semaphore, e.g.<br>
<br>
rc = wait_event_inetrruptible(..);<br>
if (rc == -ERESTARTSYS) {<br>
/*<br>
* your driver should take corrective measure, may be to retry the<br>
code path again,<br>
* or do some error recovery and send appropriate error code to user space.<br>
* Note that conventionally -ERESTARTSYS should never be returned<br>
to user space<br>
*/<br>
}<br>
<br>
Although name is misleading, its an internal kernel error and is not<br>
at all related to system call restart.<br>
<br>
Rajat<br>
<div><div></div><div class="h5"><br>
On Tue, Jan 11, 2011 at 1:09 PM, Mulyadi Santosa<br>
<<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>> wrote:<br>
> just to avoid confusion 1st...<br>
><br>
> On Tue, Jan 11, 2011 at 14:06, mohit verma <<a href="mailto:mohit89mlnc@gmail.com">mohit89mlnc@gmail.com</a>> wrote:<br>
>> i mean like one of my friends said that when kernel is about to restart a<br>
>> syscall then it raises signal -ERESTARTSYS signal for signal handler. but i<br>
>> think it is for<br>
>> something went wrong and kernel wanna start the syscall again. but in<br>
>> between a syscall routine is it possible to get vector number (i repeat<br>
>> ,sorry) ??<br>
><br>
> allow me to rephrase it: if an interrupt crosses by during the<br>
> execution of that code path, you wanna find out the interrupt number?<br>
><br>
> --<br>
> regards,<br>
><br>
> Mulyadi Santosa<br>
> Freelance Linux trainer and consultant<br>
><br>
> blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>
> training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a><br>
><br>
</div></div>> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br>........................<div><i>MOHIT VERMA</i></div><br>