blob: 8c373aa28a862f0a5fd559bec87ab2504008d01e [file] [log] [blame]
Ingo Molnarfb1c8f92005-09-10 00:25:56 -07001#ifndef __ASM_SPINLOCK_TYPES_H
2#define __ASM_SPINLOCK_TYPES_H
3
Ingo Molnarfb1c8f92005-09-10 00:25:56 -07004typedef struct {
Matthew Wilcox14e256c2005-10-21 22:41:25 -04005#ifdef CONFIG_PA20
6 volatile unsigned int slock;
Thomas Gleixneredc35bd2009-12-03 12:38:57 +01007# define __ARCH_SPIN_LOCK_UNLOCKED { 1 }
Matthew Wilcox14e256c2005-10-21 22:41:25 -04008#else
Ingo Molnarfb1c8f92005-09-10 00:25:56 -07009 volatile unsigned int lock[4];
Thomas Gleixneredc35bd2009-12-03 12:38:57 +010010# define __ARCH_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } }
Matthew Wilcox14e256c2005-10-21 22:41:25 -040011#endif
Thomas Gleixner445c8952009-12-02 19:49:50 +010012} arch_spinlock_t;
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070013
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070014typedef struct {
Thomas Gleixner445c8952009-12-02 19:49:50 +010015 arch_spinlock_t lock;
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070016 volatile int counter;
Thomas Gleixnerfb3a6bb2009-12-03 20:01:19 +010017} arch_rwlock_t;
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070018
Thomas Gleixnerfb3a6bb2009-12-03 20:01:19 +010019#define __ARCH_RW_LOCK_UNLOCKED { __ARCH_SPIN_LOCK_UNLOCKED, 0 }
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070020
21#endif