public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] Replacements for local_irq_xxx()
Date: Thu, 10 May 2001 08:55:13 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590693005562@msgid-missing> (raw)

Existing local_irq_xxx() routines clear psr.i which masks all
interrupts, including NMI.  Then the only way to get the attention of a
cpu in a disabled spin loop is via INIT which is too drastic.  How
about these alternatives which set cr.tpr.mmi instead, masking all
external interrupts except NMI?

This is not complete, I have to do the debugging versions plus check
out callers of ia64_{get,set}_tpr and resolve any conflicts.  Before I
do any more work, is it worth continuing with this or do we live with
psr.i and accept that the only remedy for a cpu that is hung in a
disabled spin loop is to reboot the entire machine?

/* Nothing changes cr.tpr except local_irq_xxx() and they should always
 * leave tpr in the same state that they found it, so there is no need
 * to serialize access to tpr.  If this is incorrect, uncomment the
 * references to psr and the following srlz.d and add r15 to the clobbers.
 */

# define local_irq_save(x)						\
do {									\
	__asm__ __volatile__ (						\
	";;\n\t"							\
	"# mov r15=psr;\n\t"						\
	"mov r17=(1 << 16);\n\t"					\
	"# ;; rsm psr.i;;\n\t"						\
	"mov %0=cr.tpr;;\n\t"						\
	"or r17=r17,%0;;\n\t"						\
	"mov cr.tpr=r17;;\n\t"						\
	"srlz.d;;\n\t"							\
	"# mov psr.l=r15;;\n\t"						\
	"# srlz.d;;\n\t"						\
	: "=r" (x) : : "r16", "r17");					\
} while (0)

# define local_irq_disable()						\
do {									\
	__asm__ __volatile__ (						\
	";;\n\t"							\
	"# mov r15=psr;\n\t"						\
	"mov r17=(1 << 16);\n\t"					\
	"# ;; rsm psr.i;;\n\t"						\
	"mov r16=cr.tpr;;\n\t"						\
	"or r17=r17,r16;;\n\t"						\
	"mov cr.tpr=r17;;\n\t"						\
	"srlz.d;;\n\t"							\
	"# mov psr.l=r15;;\n\t"						\
	"# srlz.d;;\n\t"						\
	: : : "r16", "r17");						\
} while (0)

# define local_irq_restore(x)						\
do {									\
	__asm__ __volatile__ (						\
	";;\n\t"							\
	"# mov r15=psr;\n\t"						\
	"# rsm psr.i;;\n\t"						\
	"mov cr.tpr=%0;;\n\t"						\
	"srlz.d;;\n\t"							\
	"# mov psr.l=r15;;\n\t"						\
	"# srlz.d;;\n\t"						\
	: : "r" (x) );							\
} while (0)



             reply	other threads:[~2001-05-10  8:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-10  8:55 Keith Owens [this message]
2001-05-10 14:26 ` [Linux-ia64] Replacements for local_irq_xxx() David Mosberger
2001-05-10 15:39 ` David Mosberger
2001-05-14 12:52 ` Keith Owens
2001-05-14 17:22 ` DE-DINECHIN,CHRISTOPHE (HP-Cupertino,ex1)
2001-05-15 15:11 ` David Mosberger

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=marc-linux-ia64-105590693005562@msgid-missing \
    --to=kaos@ocs.com.au \
    --cc=linux-ia64@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