From: "Christoph Egger" <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Cc: Keir Fraser <keir@xensource.com>, Jan Beulich <jbeulich@novell.com>
Subject: Re: [PATCH] two missing bits (was Re: Add -Wcast-qual flag)
Date: Fri, 22 Dec 2006 10:52:40 +0100 [thread overview]
Message-ID: <200612221052.40598.Christoph.Egger@amd.com> (raw)
In-Reply-To: <C1B15874.628F%Keir.Fraser@cl.cam.ac.uk>
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
On Friday 22 December 2006 10:40, Keir Fraser wrote:
> Maybe we need a CONST_ADDR macro, as I suspect the problem is the cast
> hidden inside the ADDR macro is dropping the const qualifier.
That's right. Yet another alternative patch, this time with the CONST_ADDR
macro.
> -- Keir
>
> On 22/12/06 9:31 am, "Jan Beulich" <jbeulich@novell.com> wrote:
> > I object to the change to variable_test_bit() - why is that needed? I had
> > specifically
> > submitted a patch to get the const qualifier added there. Jan
[-- Attachment #2: xen-cast-xen.diff --]
[-- Type: text/x-diff, Size: 969 bytes --]
diff -r f1ddc050d848 xen/common/gdbstub.c
--- a/xen/common/gdbstub.c Thu Dec 21 20:44:35 2006 +0000
+++ b/xen/common/gdbstub.c Fri Dec 22 09:51:42 2006 +0100
@@ -382,7 +382,7 @@ static int
static int
process_command(struct cpu_user_regs *regs, struct gdb_context *ctx)
{
- char *ptr;
+ const char *ptr;
unsigned long addr, length;
int resume = 0;
diff -r f1ddc050d848 xen/include/asm-x86/bitops.h
--- a/xen/include/asm-x86/bitops.h Thu Dec 21 20:44:35 2006 +0000
+++ b/xen/include/asm-x86/bitops.h Fri Dec 22 10:47:50 2006 +0100
@@ -22,6 +22,7 @@
* used only when the constraint allows the operand to reside in a register.
*/
+#define CONST_ADDR (*(const volatile long *) addr)
#define ADDR (*(volatile long *) addr)
/**
@@ -253,7 +254,7 @@ static __inline__ int variable_test_bit(
__asm__ __volatile__(
"btl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit)
- :"m" (ADDR),"dIr" (nr));
+ :"m" (CONST_ADDR),"dIr" (nr));
return oldbit;
}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2006-12-22 9:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-22 9:05 [PATCH] two missing bits (was Re: Add -Wcast-qual flag) Christoph Egger
2006-12-22 9:31 ` Jan Beulich
2006-12-22 9:40 ` Keir Fraser
2006-12-22 9:51 ` Jan Beulich
2006-12-22 9:55 ` Christoph Egger
2006-12-22 9:52 ` Christoph Egger [this message]
2006-12-22 9:44 ` Christoph Egger
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=200612221052.40598.Christoph.Egger@amd.com \
--to=christoph.egger@amd.com \
--cc=jbeulich@novell.com \
--cc=keir@xensource.com \
--cc=xen-devel@lists.xensource.com \
/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.