From: "Kip Walker" <kwalker@broadcom.com>
To: "Ralf Baechle" <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: __volatile__ for asms in unaligned.c
Date: Thu, 20 Feb 2003 14:43:58 -0800 [thread overview]
Message-ID: <3E555A2E.5920F387@broadcom.com> (raw)
I just discovered that my compiler is scheduling the code in the asm
blocks in unaligned.c *before* the 'goto sigbus'. My gcc is 3.1.1 with
some almost certainly unrelated local mods.
Anyway, is there a reason these aren't marked as volatile? The gcc docs
have the scary comment "You can prevent an `asm' instruction from being
deleted, MOVED SIGNIFICANTLY, or combined, by writing the keyword
`volatile' after the`asm'."
Here's an example, for the lw_op case in the mips64 kernel:
---------
case lw_op:
if (verify_area(VERIFY_READ, addr, 4))
goto sigbus;
__asm__(
"1:\tlwl\t%0, (%2)\n"
"2:\tlwr\t%0, 3(%2)\n\t"
---------
Compiled with normal mips64 build flags (for SB1) was turned into:
---------
### verify_area
ld $2,2400($28)
daddu $3,$5,4
or $3,$5,$3
and $2,$2,$3
li $4,-14 # 0xfffffffffffffff2
movz $4,$0,$2
...
### the asm code
1: lwl $9, ($5)
2: lwr $9, 3($5)
li $3, 0
3: .section .fixup,"ax"
4: li $3, -14
j 3b
...
### finally, the verify_area result check
beq $4,$0,$L1131
---------
Kip
next reply other threads:[~2003-02-20 22:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-20 22:43 Kip Walker [this message]
2003-02-21 1:09 ` __volatile__ for asms in unaligned.c Ralf Baechle
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=3E555A2E.5920F387@broadcom.com \
--to=kwalker@broadcom.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.