OXIESEC PANEL
- Current Dir:
/
/
usr
/
src
/
linux-headers-4.15.0-213
/
arch
/
tile
/
include
/
asm
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2024 07:14:13 AM
rwxr-xr-x
📄
Kbuild
439 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
asm-offsets.h
35 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
atomic.h
5.14 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
atomic_32.h
8.91 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
atomic_64.h
5.51 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
backtrace.h
3.98 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
barrier.h
2.89 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
bitops.h
2.37 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
bitops_32.h
4.01 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
bitops_64.h
2.67 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cache.h
2.6 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cacheflush.h
4.94 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
checksum.h
1.23 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cmpxchg.h
3.47 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
compat.h
7.38 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
current.h
947 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
delay.h
1.1 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
device.h
978 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
div64.h
319 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
dma-mapping.h
1.82 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
dma.h
762 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
elf.h
5.42 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
fixmap.h
2.73 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
ftrace.h
1.08 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
futex.h
4.23 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
hardirq.h
1.28 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
hardwall.h
1.08 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
highmem.h
2.08 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
homecache.h
4.21 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
hugetlb.h
3.04 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
hv_driver.h
1.92 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
ide.h
758 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
insn.h
1.79 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
io.h
12.43 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
irq.h
3.11 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
irq_work.h
283 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
irqflags.h
10.55 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
jump_label.h
1.47 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
kdebug.h
769 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
kexec.h
2.23 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
kgdb.h
1.99 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
kmap_types.h
1.02 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
kprobes.h
2.19 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
linkage.h
1.46 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
mmu.h
965 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
mmu_context.h
4.5 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
mmzone.h
2.07 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
module.h
1.12 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
page.h
10.32 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pci.h
6.58 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
percpu.h
1.79 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
perf_event.h
766 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgalloc.h
4.76 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable.h
15.66 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable_32.h
4.08 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable_64.h
5.11 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pmc.h
2.15 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
processor.h
10.62 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
ptrace.h
2.96 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
sections.h
1.37 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
setup.h
1.63 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
sigframe.h
956 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
signal.h
1.07 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
smp.h
3.98 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
spinlock.h
741 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
spinlock_32.h
2.9 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
spinlock_64.h
3.88 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
spinlock_types.h
1.58 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
stack.h
2.59 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
string.h
1.19 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
switch_to.h
2.75 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
syscall.h
2.88 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
syscalls.h
2.35 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
thread_info.h
5.54 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
tile-desc.h
650 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
tile-desc_32.h
12.54 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
tile-desc_64.h
10.83 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
timex.h
1.71 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
tlb.h
878 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
tlbflush.h
3.99 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
topology.h
1.52 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
traps.h
2.44 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
uaccess.h
12.77 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
unaligned.h
1.56 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
unistd.h
777 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
user.h
717 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
vdso.h
1.84 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
vga.h
1.05 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
word-at-a-time.h
1.07 KB
01/28/2018 09:20:33 PM
rw-r--r--
Editing: irqflags.h
Close
/* * Copyright 2010 Tilera Corporation. All Rights Reserved. * * 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, version 2. * * 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, GOOD TITLE or * NON INFRINGEMENT. See the GNU General Public License for * more details. */ #ifndef _ASM_TILE_IRQFLAGS_H #define _ASM_TILE_IRQFLAGS_H #include <arch/interrupts.h> #include <arch/chip.h> /* * The set of interrupts we want to allow when interrupts are nominally * disabled. The remainder are effectively "NMI" interrupts from * the point of view of the generic Linux code. Note that synchronous * interrupts (aka "non-queued") are not blocked by the mask in any case. */ #define LINUX_MASKABLE_INTERRUPTS \ (~((_AC(1,ULL) << INT_PERF_COUNT) | (_AC(1,ULL) << INT_AUX_PERF_COUNT))) #if CHIP_HAS_SPLIT_INTR_MASK() /* The same macro, but for the two 32-bit SPRs separately. */ #define LINUX_MASKABLE_INTERRUPTS_LO (-1) #define LINUX_MASKABLE_INTERRUPTS_HI \ (~((1 << (INT_PERF_COUNT - 32)) | (1 << (INT_AUX_PERF_COUNT - 32)))) #endif #ifndef __ASSEMBLY__ /* NOTE: we can't include <linux/percpu.h> due to #include dependencies. */ #include <asm/percpu.h> #include <arch/spr_def.h> /* * Set and clear kernel interrupt masks. * * NOTE: __insn_mtspr() is a compiler builtin marked as a memory * clobber. We rely on it being equivalent to a compiler barrier in * this code since arch_local_irq_save() and friends must act as * compiler barriers. This compiler semantic is baked into enough * places that the compiler will maintain it going forward. */ #if CHIP_HAS_SPLIT_INTR_MASK() #if INT_PERF_COUNT < 32 || INT_AUX_PERF_COUNT < 32 || INT_MEM_ERROR >= 32 # error Fix assumptions about which word various interrupts are in #endif #define interrupt_mask_set(n) do { \ int __n = (n); \ int __mask = 1 << (__n & 0x1f); \ if (__n < 32) \ __insn_mtspr(SPR_INTERRUPT_MASK_SET_K_0, __mask); \ else \ __insn_mtspr(SPR_INTERRUPT_MASK_SET_K_1, __mask); \ } while (0) #define interrupt_mask_reset(n) do { \ int __n = (n); \ int __mask = 1 << (__n & 0x1f); \ if (__n < 32) \ __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K_0, __mask); \ else \ __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K_1, __mask); \ } while (0) #define interrupt_mask_check(n) ({ \ int __n = (n); \ (((__n < 32) ? \ __insn_mfspr(SPR_INTERRUPT_MASK_K_0) : \ __insn_mfspr(SPR_INTERRUPT_MASK_K_1)) \ >> (__n & 0x1f)) & 1; \ }) #define interrupt_mask_set_mask(mask) do { \ unsigned long long __m = (mask); \ __insn_mtspr(SPR_INTERRUPT_MASK_SET_K_0, (unsigned long)(__m)); \ __insn_mtspr(SPR_INTERRUPT_MASK_SET_K_1, (unsigned long)(__m>>32)); \ } while (0) #define interrupt_mask_reset_mask(mask) do { \ unsigned long long __m = (mask); \ __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K_0, (unsigned long)(__m)); \ __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K_1, (unsigned long)(__m>>32)); \ } while (0) #define interrupt_mask_save_mask() \ (__insn_mfspr(SPR_INTERRUPT_MASK_SET_K_0) | \ (((unsigned long long)__insn_mfspr(SPR_INTERRUPT_MASK_SET_K_1))<<32)) #define interrupt_mask_restore_mask(mask) do { \ unsigned long long __m = (mask); \ __insn_mtspr(SPR_INTERRUPT_MASK_K_0, (unsigned long)(__m)); \ __insn_mtspr(SPR_INTERRUPT_MASK_K_1, (unsigned long)(__m>>32)); \ } while (0) #else #define interrupt_mask_set(n) \ __insn_mtspr(SPR_INTERRUPT_MASK_SET_K, (1UL << (n))) #define interrupt_mask_reset(n) \ __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K, (1UL << (n))) #define interrupt_mask_check(n) \ ((__insn_mfspr(SPR_INTERRUPT_MASK_K) >> (n)) & 1) #define interrupt_mask_set_mask(mask) \ __insn_mtspr(SPR_INTERRUPT_MASK_SET_K, (mask)) #define interrupt_mask_reset_mask(mask) \ __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K, (mask)) #define interrupt_mask_save_mask() \ __insn_mfspr(SPR_INTERRUPT_MASK_K) #define interrupt_mask_restore_mask(mask) \ __insn_mtspr(SPR_INTERRUPT_MASK_K, (mask)) #endif /* * The set of interrupts we want active if irqs are enabled. * Note that in particular, the tile timer interrupt comes and goes * from this set, since we have no other way to turn off the timer. * Likewise, INTCTRL_K is removed and re-added during device * interrupts, as is the the hardwall UDN_FIREWALL interrupt. * We use a low bit (MEM_ERROR) as our sentinel value and make sure it * is always claimed as an "active interrupt" so we can query that bit * to know our current state. */ DECLARE_PER_CPU(unsigned long long, interrupts_enabled_mask); #define INITIAL_INTERRUPTS_ENABLED (1ULL << INT_MEM_ERROR) #ifdef CONFIG_DEBUG_PREEMPT /* Due to inclusion issues, we can't rely on <linux/smp.h> here. */ extern unsigned int debug_smp_processor_id(void); # define smp_processor_id() debug_smp_processor_id() #endif /* Disable interrupts. */ #define arch_local_irq_disable() \ interrupt_mask_set_mask(LINUX_MASKABLE_INTERRUPTS) /* Disable all interrupts, including NMIs. */ #define arch_local_irq_disable_all() \ interrupt_mask_set_mask(-1ULL) /* * Read the set of maskable interrupts. * We avoid the preemption warning here via raw_cpu_ptr since even * if irqs are already enabled, it's harmless to read the wrong cpu's * enabled mask. */ #define arch_local_irqs_enabled() \ (*raw_cpu_ptr(&interrupts_enabled_mask)) /* Re-enable all maskable interrupts. */ #define arch_local_irq_enable() \ interrupt_mask_reset_mask(arch_local_irqs_enabled()) /* Disable or enable interrupts based on flag argument. */ #define arch_local_irq_restore(disabled) do { \ if (disabled) \ arch_local_irq_disable(); \ else \ arch_local_irq_enable(); \ } while (0) /* Return true if "flags" argument means interrupts are disabled. */ #define arch_irqs_disabled_flags(flags) ((flags) != 0) /* Return true if interrupts are currently disabled. */ #define arch_irqs_disabled() interrupt_mask_check(INT_MEM_ERROR) /* Save whether interrupts are currently disabled. */ #define arch_local_save_flags() arch_irqs_disabled() /* Save whether interrupts are currently disabled, then disable them. */ #define arch_local_irq_save() ({ \ unsigned long __flags = arch_local_save_flags(); \ arch_local_irq_disable(); \ __flags; }) /* Prevent the given interrupt from being enabled next time we enable irqs. */ #define arch_local_irq_mask(interrupt) \ this_cpu_and(interrupts_enabled_mask, ~(1ULL << (interrupt))) /* Prevent the given interrupt from being enabled immediately. */ #define arch_local_irq_mask_now(interrupt) do { \ arch_local_irq_mask(interrupt); \ interrupt_mask_set(interrupt); \ } while (0) /* Allow the given interrupt to be enabled next time we enable irqs. */ #define arch_local_irq_unmask(interrupt) \ this_cpu_or(interrupts_enabled_mask, (1ULL << (interrupt))) /* Allow the given interrupt to be enabled immediately, if !irqs_disabled. */ #define arch_local_irq_unmask_now(interrupt) do { \ arch_local_irq_unmask(interrupt); \ if (!irqs_disabled()) \ interrupt_mask_reset(interrupt); \ } while (0) #else /* __ASSEMBLY__ */ /* We provide a somewhat more restricted set for assembly. */ #ifdef __tilegx__ #if INT_MEM_ERROR != 0 # error Fix IRQS_DISABLED() macro #endif /* Return 0 or 1 to indicate whether interrupts are currently disabled. */ #define IRQS_DISABLED(tmp) \ mfspr tmp, SPR_INTERRUPT_MASK_K; \ andi tmp, tmp, 1 /* Load up a pointer to &interrupts_enabled_mask. */ #define GET_INTERRUPTS_ENABLED_MASK_PTR(reg) \ moveli reg, hw2_last(interrupts_enabled_mask); \ shl16insli reg, reg, hw1(interrupts_enabled_mask); \ shl16insli reg, reg, hw0(interrupts_enabled_mask); \ add reg, reg, tp /* Disable interrupts. */ #define IRQ_DISABLE(tmp0, tmp1) \ moveli tmp0, hw2_last(LINUX_MASKABLE_INTERRUPTS); \ shl16insli tmp0, tmp0, hw1(LINUX_MASKABLE_INTERRUPTS); \ shl16insli tmp0, tmp0, hw0(LINUX_MASKABLE_INTERRUPTS); \ mtspr SPR_INTERRUPT_MASK_SET_K, tmp0 /* Disable ALL synchronous interrupts (used by NMI entry). */ #define IRQ_DISABLE_ALL(tmp) \ movei tmp, -1; \ mtspr SPR_INTERRUPT_MASK_SET_K, tmp /* Enable interrupts. */ #define IRQ_ENABLE_LOAD(tmp0, tmp1) \ GET_INTERRUPTS_ENABLED_MASK_PTR(tmp0); \ ld tmp0, tmp0 #define IRQ_ENABLE_APPLY(tmp0, tmp1) \ mtspr SPR_INTERRUPT_MASK_RESET_K, tmp0 #else /* !__tilegx__ */ /* * Return 0 or 1 to indicate whether interrupts are currently disabled. * Note that it's important that we use a bit from the "low" mask word, * since when we are enabling, that is the word we write first, so if we * are interrupted after only writing half of the mask, the interrupt * handler will correctly observe that we have interrupts enabled, and * will enable interrupts itself on return from the interrupt handler * (making the original code's write of the "high" mask word idempotent). */ #define IRQS_DISABLED(tmp) \ mfspr tmp, SPR_INTERRUPT_MASK_K_0; \ shri tmp, tmp, INT_MEM_ERROR; \ andi tmp, tmp, 1 /* Load up a pointer to &interrupts_enabled_mask. */ #define GET_INTERRUPTS_ENABLED_MASK_PTR(reg) \ moveli reg, lo16(interrupts_enabled_mask); \ auli reg, reg, ha16(interrupts_enabled_mask); \ add reg, reg, tp /* Disable interrupts. */ #define IRQ_DISABLE(tmp0, tmp1) \ { \ movei tmp0, LINUX_MASKABLE_INTERRUPTS_LO; \ moveli tmp1, lo16(LINUX_MASKABLE_INTERRUPTS_HI) \ }; \ { \ mtspr SPR_INTERRUPT_MASK_SET_K_0, tmp0; \ auli tmp1, tmp1, ha16(LINUX_MASKABLE_INTERRUPTS_HI) \ }; \ mtspr SPR_INTERRUPT_MASK_SET_K_1, tmp1 /* Disable ALL synchronous interrupts (used by NMI entry). */ #define IRQ_DISABLE_ALL(tmp) \ movei tmp, -1; \ mtspr SPR_INTERRUPT_MASK_SET_K_0, tmp; \ mtspr SPR_INTERRUPT_MASK_SET_K_1, tmp /* Enable interrupts. */ #define IRQ_ENABLE_LOAD(tmp0, tmp1) \ GET_INTERRUPTS_ENABLED_MASK_PTR(tmp0); \ { \ lw tmp0, tmp0; \ addi tmp1, tmp0, 4 \ }; \ lw tmp1, tmp1 #define IRQ_ENABLE_APPLY(tmp0, tmp1) \ mtspr SPR_INTERRUPT_MASK_RESET_K_0, tmp0; \ mtspr SPR_INTERRUPT_MASK_RESET_K_1, tmp1 #endif #define IRQ_ENABLE(tmp0, tmp1) \ IRQ_ENABLE_LOAD(tmp0, tmp1); \ IRQ_ENABLE_APPLY(tmp0, tmp1) /* * Do the CPU's IRQ-state tracing from assembly code. We call a * C function, but almost everywhere we do, we don't mind clobbering * all the caller-saved registers. */ #ifdef CONFIG_TRACE_IRQFLAGS # define TRACE_IRQS_ON jal trace_hardirqs_on # define TRACE_IRQS_OFF jal trace_hardirqs_off #else # define TRACE_IRQS_ON # define TRACE_IRQS_OFF #endif #endif /* __ASSEMBLY__ */ #endif /* _ASM_TILE_IRQFLAGS_H */