linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "wilbur.chan" <wilbur512@gmail.com>
To: linuxppc-dev@ozlabs.org
Subject: Problem when disabled interrupt in system call (ppc8270)
Date: Fri, 16 Oct 2009 09:12:34 +0800	[thread overview]
Message-ID: <e997b7420910151812m3de16f67hdb756bcd1f40ddc@mail.gmail.com> (raw)

ppc 8270, kernel 2.6.21.7

I took the following steps:


In a system call function , say , sys_reboot, interrupt was disabled
by local_irq_disable.

Then ,  value at the address of 0xc000050  was set to a value , say ,
0x1234.  Code was like this :

sys_reboot()
{
local_irq_disable();
*(volatile unsigned long * )0xc1000050 = 0x1234;
 while(1)
   {
    ;
   }
}

Finally, I reset the board (with power still on)  into uboot,using
'md 0x1000050' to display the content at physical address 0x1000050,
and found that , it was not 0x1234.


However, if I delete the local_irq_disable() in sys_reboot, everything
went well---After I reset the board, 'md 0x1000050' return the value
0x1234.


So, this really puzzled me , could someone explain why this happed?  Thank you.



PS:

static inline unsigned long local_irq_disable(void)
{
	unsigned long flags, zero;

	__asm__ __volatile__("li %1,0; lbz %0,%2(13); stb %1,%2(13)"
	: "=r" (flags), "=&r" (zero)
	: "i" (offsetof(struct paca_struct, soft_enabled))
	: "memory");

	return flags;
}

             reply	other threads:[~2009-10-16  1:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-16  1:12 wilbur.chan [this message]
2009-10-16  4:43 ` Problem when disabled interrupt in system call (ppc8270) Benjamin Herrenschmidt
2009-10-16  5:14   ` wilbur.chan
2009-10-16  7:25 ` Gabriel Paubert

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=e997b7420910151812m3de16f67hdb756bcd1f40ddc@mail.gmail.com \
    --to=wilbur512@gmail.com \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).