[BACK]Return to irqflags_64.h CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / include / asm-sh

File: [Development] / linux-2.6-xfs / include / asm-sh / Attic / irqflags_64.h (download)

Revision 1.1, Tue Feb 26 16:44:40 2008 UTC (9 years, 7 months ago) by lachlan.longdrop.melbourne.sgi.com
Branch: MAIN

Merge up to 2.6.25-rc3
Merge of 2.6.x-xfs-melb:linux:30555a by kenmcd.

#ifndef __ASM_SH_IRQFLAGS_64_H
#define __ASM_SH_IRQFLAGS_64_H

#include <asm/cpu/registers.h>

#define SR_MASK_LL	0x00000000000000f0LL
#define SR_BL_LL	0x0000000010000000LL

static inline void raw_local_irq_enable(void)
{
	unsigned long long __dummy0, __dummy1 = ~SR_MASK_LL;

	__asm__ __volatile__("getcon	" __SR ", %0\n\t"
			     "and	%0, %1, %0\n\t"
			     "putcon	%0, " __SR "\n\t"
			     : "=&r" (__dummy0)
			     : "r" (__dummy1));
}

static inline void raw_local_irq_disable(void)
{
	unsigned long long __dummy0, __dummy1 = SR_MASK_LL;

	__asm__ __volatile__("getcon	" __SR ", %0\n\t"
			     "or	%0, %1, %0\n\t"
			     "putcon	%0, " __SR "\n\t"
			     : "=&r" (__dummy0)
			     : "r" (__dummy1));
}

static inline void set_bl_bit(void)
{
	unsigned long long __dummy0, __dummy1 = SR_BL_LL;

	__asm__ __volatile__("getcon	" __SR ", %0\n\t"
			     "or	%0, %1, %0\n\t"
			     "putcon	%0, " __SR "\n\t"
			     : "=&r" (__dummy0)
			     : "r" (__dummy1));

}

static inline void clear_bl_bit(void)
{
	unsigned long long __dummy0, __dummy1 = ~SR_BL_LL;

	__asm__ __volatile__("getcon	" __SR ", %0\n\t"
			     "and	%0, %1, %0\n\t"
			     "putcon	%0, " __SR "\n\t"
			     : "=&r" (__dummy0)
			     : "r" (__dummy1));
}

static inline unsigned long __raw_local_save_flags(void)
{
	unsigned long long __dummy = SR_MASK_LL;
	unsigned long flags;

	__asm__ __volatile__ (
		"getcon	" __SR ", %0\n\t"
		"and	%0, %1, %0"
		: "=&r" (flags)
		: "r" (__dummy));

	return flags;
}

static inline unsigned long __raw_local_irq_save(void)
{
	unsigned long long __dummy0, __dummy1 = SR_MASK_LL;
	unsigned long flags;

	__asm__ __volatile__ (
		"getcon	" __SR ", %1\n\t"
		"or	%1, r63, %0\n\t"
		"or	%1, %2, %1\n\t"
		"putcon	%1, " __SR "\n\t"
		"and	%0, %2, %0"
		: "=&r" (flags), "=&r" (__dummy0)
		: "r" (__dummy1));

	return flags;
}

#endif /* __ASM_SH_IRQFLAGS_64_H */