From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Guthro Subject: Re: [PATCH 1/3] Do not use DEFINE_RWLOCK Macro Date: Wed, 29 Aug 2007 16:31:14 -0400 Message-ID: <46D5D792.9040608@virtualiron.com> References: <46D5B8D5.8030605@virtualiron.com> <1188412657.8719.5.camel@cthulhu.hellion.org.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040106090900040503060206" Return-path: In-Reply-To: <1188412657.8719.5.camel@cthulhu.hellion.org.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------040106090900040503060206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Revised patch attached. Note that I did run into a problem with a buggy kernel in RHEL4-U3. It seems that in this macro, rw_lock_t was used instead of rwlock_t. I added a line to platform-compat.h to account for this. Ben Signed-off-by: Ben Guthro Ian Campbell wrote: > On Wed, 2007-08-29 at 14:20 -0400, Ben Guthro wrote: > >> Do not use the DEFINE_RWLOCK macro, as it is not available when compiled >> against older kernels, such as SLES9's 2.6.5 >> > > Things like this should generally be done by adding a suitably guarded > definition of DEFINE_RWLOCK to the platform-compat.h header in > unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h. > > Ian. > > --------------040106090900040503060206 Content-Type: text/x-patch; name="xen-legacy-reboot.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xen-legacy-reboot.patch" diff -r a381118a247a unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h --- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Aug 29 15:30:40 2007 -0400 +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Aug 29 16:26:33 2007 -0400 @@ -116,4 +116,13 @@ extern char *kasprintf(gfp_t gfp, const #define DEFINE_SEQLOCK(x) seqlock_t x = SEQLOCK_UNLOCKED #endif +#if defined(__LINUX_SPINLOCK_H) && !defined(DEFINE_RWLOCK) +#define DEFINE_RWLOCK(x) rwlock_t x = RW_LOCK_UNLOCKED #endif + +/* Bug in RHEL4-U3 rw_lock_t is mistakenly defined in this macro */ +#if defined(__LINUX_SPINLOCK_H) && defined(DEFINE_RWLOCK) +#define rw_lock_t rwlock_t +#endif + +#endif --------------040106090900040503060206 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 --------------040106090900040503060206--