|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] spinlock: fix build with older GCC
commit 1037e33c88bb0e1fe530c164f242df17030102e1
Author: David Vrabel <david.vrabel@xxxxxxxxxx>
AuthorDate: Tue May 19 15:49:22 2015 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue May 19 15:49:22 2015 +0200
spinlock: fix build with older GCC
Older GCC versions such as 4.3 cannot have initializers for the
members of anonymous structures, so initialize .head_tail instead.
Use a SPINLOCK_TICKET_INC define so this initializer is near the
spinlock_tickets_t definition (in case the structure changes requiring
changes to the initializer).
Signed-off-by: David Vrabel <david.vrabel@xxxxxxxxxx>
Reported-and-tested-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/common/spinlock.c | 2 +-
xen/include/xen/spinlock.h | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index c8dc8ba..29149d1 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -132,7 +132,7 @@ static always_inline u16 observe_head(spinlock_tickets_t *t)
void _spin_lock(spinlock_t *lock)
{
- spinlock_tickets_t tickets = { .tail = 1, };
+ spinlock_tickets_t tickets = SPINLOCK_TICKET_INC;
LOCK_PROFILE_VAR;
check_lock(&lock->debug);
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 311685a..9286543 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -132,6 +132,8 @@ typedef union {
};
} spinlock_tickets_t;
+#define SPINLOCK_TICKET_INC { .head_tail = 0x10000, }
+
typedef struct spinlock {
spinlock_tickets_t tickets;
u16 recurse_cpu:12;
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |