mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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@citrix.com> Reported-and-tested-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
db83975f0f
commit
1037e33c88
2 files changed
+3
-1
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||