Path: blob/master/arch/unicore32/include/asm/irqflags.h
10818 views
/*1* linux/arch/unicore32/include/asm/irqflags.h2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/11#ifndef __UNICORE_IRQFLAGS_H__12#define __UNICORE_IRQFLAGS_H__1314#ifdef __KERNEL__1516#include <asm/ptrace.h>1718#define ARCH_IRQ_DISABLED (PRIV_MODE | PSR_I_BIT)19#define ARCH_IRQ_ENABLED (PRIV_MODE)2021/*22* Save the current interrupt enable state.23*/24static inline unsigned long arch_local_save_flags(void)25{26unsigned long temp;2728asm volatile("mov %0, asr" : "=r" (temp) : : "memory", "cc");2930return temp & PSR_c;31}3233/*34* restore saved IRQ state35*/36static inline void arch_local_irq_restore(unsigned long flags)37{38unsigned long temp;3940asm volatile(41"mov %0, asr\n"42"mov.a asr, %1\n"43"mov.f asr, %0"44: "=&r" (temp)45: "r" (flags)46: "memory", "cc");47}4849#include <asm-generic/irqflags.h>5051#endif52#endif535455