From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Christoph Egger" Subject: Re: [PATCH] two missing bits (was Re: Add -Wcast-qual flag) Date: Fri, 22 Dec 2006 10:52:40 +0100 Message-ID: <200612221052.40598.Christoph.Egger@amd.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_or6iFK939M76eZr" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org --Boundary-00=_or6iFK939M76eZr Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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" 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 --Boundary-00=_or6iFK939M76eZr Content-Type: text/x-diff; charset=iso-8859-1; name=xen-cast-xen.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=xen-cast-xen.diff 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; } --Boundary-00=_or6iFK939M76eZr Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_or6iFK939M76eZr--