public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: irfan_hamid@softhome.net
To: linux-kernel@vger.kernel.org
Subject: cli()/sti() clarification
Date: Thu, 18 Jul 2002 00:27:40 -0600	[thread overview]
Message-ID: <courier.3D365FDC.0000712F@softhome.net> (raw)

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.

             reply	other threads:[~2002-07-18  6:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-18  6:27 irfan_hamid [this message]
2002-07-18  6:58 ` cli()/sti() clarification 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=courier.3D365FDC.0000712F@softhome.net \
    --to=irfan_hamid@softhome.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox