cregit-Linux how code gets into the kernel

Release 4.14 arch/nios2/include/asm/irqflags.h

/*
 * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef _ASM_IRQFLAGS_H

#define _ASM_IRQFLAGS_H

#include <asm/registers.h>


static inline unsigned long arch_local_save_flags(void) { return RDCTL(CTL_STATUS); }

Contributors

PersonTokensPropCommitsCommitProp
Ley Foon Tan16100.00%1100.00%
Total16100.00%1100.00%

/* * This will restore ALL status register flags, not only the interrupt * mask flag. */
static inline void arch_local_irq_restore(unsigned long flags) { WRCTL(CTL_STATUS, flags); }

Contributors

PersonTokensPropCommitsCommitProp
Ley Foon Tan18100.00%1100.00%
Total18100.00%1100.00%


static inline void arch_local_irq_disable(void) { unsigned long flags; flags = arch_local_save_flags(); arch_local_irq_restore(flags & ~STATUS_PIE); }

Contributors

PersonTokensPropCommitsCommitProp
Ley Foon Tan26100.00%1100.00%
Total26100.00%1100.00%


static inline void arch_local_irq_enable(void) { unsigned long flags; flags = arch_local_save_flags(); arch_local_irq_restore(flags | STATUS_PIE); }

Contributors

PersonTokensPropCommitsCommitProp
Ley Foon Tan25100.00%1100.00%
Total25100.00%1100.00%


static inline int arch_irqs_disabled_flags(unsigned long flags) { return (flags & STATUS_PIE) == 0; }

Contributors

PersonTokensPropCommitsCommitProp
Ley Foon Tan20100.00%1100.00%
Total20100.00%1100.00%


static inline int arch_irqs_disabled(void) { return arch_irqs_disabled_flags(arch_local_save_flags()); }

Contributors

PersonTokensPropCommitsCommitProp
Ley Foon Tan16100.00%1100.00%
Total16100.00%1100.00%


static inline unsigned long arch_local_irq_save(void) { unsigned long flags; flags = arch_local_save_flags(); arch_local_irq_restore(flags & ~STATUS_PIE); return flags; }

Contributors

PersonTokensPropCommitsCommitProp
Ley Foon Tan30100.00%1100.00%
Total30100.00%1100.00%

#endif /* _ASM_IRQFLAGS_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Ley Foon Tan165100.00%1100.00%
Total165100.00%1100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.