public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* cli()/sti() clarification
@ 2002-07-18  6:27 irfan_hamid
  2002-07-18  6:58 ` george anzinger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: irfan_hamid @ 2002-07-18  6:27 UTC (permalink / raw)
  To: linux-kernel

Hi, 

I added two system calls, blockintr() and unblockintr() to give cli()/sti() 
control to userland programs (yes I know its not advisable) but I only want 
to do it as a test. My test program looks like this: 

	blockintr();
	/* Some long calculations */
	unblockintr(); 

The problem is that if I press Ctrl+C during the calculation, the program
terminates. So I checked the _syscallN() and __syscall_return() macros to 
see if they explicitly call sti() before returning to userspace, but they 
dont. 

Reading the lkml archives, I found that cli() disables only the interrupts, 
exceptions are allowed, so it makes sense that the SIGINT was delivered, but 
if thats the case, then how come the SIGINT was delivered from the Ctrl+C? 
Doesnt this mean that the SIGINT signal was generated as a result of the 
keyboard interrupt? 

I know I am missing something here, would appreciate if someone could point 
me in the right direction. 

Regards,
Irfan Hamid.

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: cli()/sti() clarification
@ 2002-07-22  7:20 irfan_hamid
  0 siblings, 0 replies; 5+ messages in thread
From: irfan_hamid @ 2002-07-22  7:20 UTC (permalink / raw)
  To: linux-kernel

Thankyou all for explaining the system call internals to me. Feel like an 
idiot now :) 

Marco Colombo: As for what I am trying to achieve, it is simply this. I need 
to do plot extraction from radar raw returns. The scan time for one 
revolution is 2.44 secs. I need to extract plots for each pi/2 radians in 
less than 2.44/4 secs. I have already optimized the extraction algo upto 
SSE2 in assembly and am running the process as realtime, but it just cant 
seem to cut it. So now I am going to try and block interrupts while I do the 
DSP. 

Regards,
Irfan Hamid.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-07-22  7:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-18  6:27 cli()/sti() clarification irfan_hamid
2002-07-18  6:58 ` george anzinger
2002-07-18  9:33 ` Kasper Dupont
2002-07-18 14:52 ` Marco Colombo
  -- strict thread matches above, loose matches on Subject: below --
2002-07-22  7:20 irfan_hamid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox