Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7cc2c59 authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Russell King
Browse files

[ARM] 3852/1: convert atomic bitops and __xchg over to raw_local_irq_{save,restore}



Thomas Gleixner noticed that bitops.h should also use the raw_* irq
disable/enable variants, and __xchg needs them as well.

Signed-off-by: default avatarLennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 0c92e830
Loading
Loading
Loading
Loading
+12 −12
Original line number Original line Diff line number Diff line
@@ -37,9 +37,9 @@ static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *


	p += bit >> 5;
	p += bit >> 5;


	local_irq_save(flags);
	raw_local_irq_save(flags);
	*p |= mask;
	*p |= mask;
	local_irq_restore(flags);
	raw_local_irq_restore(flags);
}
}


static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
@@ -49,9 +49,9 @@ static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long


	p += bit >> 5;
	p += bit >> 5;


	local_irq_save(flags);
	raw_local_irq_save(flags);
	*p &= ~mask;
	*p &= ~mask;
	local_irq_restore(flags);
	raw_local_irq_restore(flags);
}
}


static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
@@ -61,9 +61,9 @@ static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned lon


	p += bit >> 5;
	p += bit >> 5;


	local_irq_save(flags);
	raw_local_irq_save(flags);
	*p ^= mask;
	*p ^= mask;
	local_irq_restore(flags);
	raw_local_irq_restore(flags);
}
}


static inline int
static inline int
@@ -75,10 +75,10 @@ ____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)


	p += bit >> 5;
	p += bit >> 5;


	local_irq_save(flags);
	raw_local_irq_save(flags);
	res = *p;
	res = *p;
	*p = res | mask;
	*p = res | mask;
	local_irq_restore(flags);
	raw_local_irq_restore(flags);


	return res & mask;
	return res & mask;
}
}
@@ -92,10 +92,10 @@ ____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)


	p += bit >> 5;
	p += bit >> 5;


	local_irq_save(flags);
	raw_local_irq_save(flags);
	res = *p;
	res = *p;
	*p = res & ~mask;
	*p = res & ~mask;
	local_irq_restore(flags);
	raw_local_irq_restore(flags);


	return res & mask;
	return res & mask;
}
}
@@ -109,10 +109,10 @@ ____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)


	p += bit >> 5;
	p += bit >> 5;


	local_irq_save(flags);
	raw_local_irq_save(flags);
	res = *p;
	res = *p;
	*p = res ^ mask;
	*p = res ^ mask;
	local_irq_restore(flags);
	raw_local_irq_restore(flags);


	return res & mask;
	return res & mask;
}
}
+4 −4
Original line number Original line Diff line number Diff line
@@ -282,17 +282,17 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
#error SMP is not supported on this platform
#error SMP is not supported on this platform
#endif
#endif
	case 1:
	case 1:
		local_irq_save(flags);
		raw_local_irq_save(flags);
		ret = *(volatile unsigned char *)ptr;
		ret = *(volatile unsigned char *)ptr;
		*(volatile unsigned char *)ptr = x;
		*(volatile unsigned char *)ptr = x;
		local_irq_restore(flags);
		raw_local_irq_restore(flags);
		break;
		break;


	case 4:
	case 4:
		local_irq_save(flags);
		raw_local_irq_save(flags);
		ret = *(volatile unsigned long *)ptr;
		ret = *(volatile unsigned long *)ptr;
		*(volatile unsigned long *)ptr = x;
		*(volatile unsigned long *)ptr = x;
		local_irq_restore(flags);
		raw_local_irq_restore(flags);
		break;
		break;
#else
#else
	case 1:
	case 1: