/linux/arch/s390/kernel/ |
H A D | fpu.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * In-kernel vector facility support functions 15 void __kernel_fpu_begin(struct kernel_fpu *state, int flags) in __kernel_fpu_begin() argument 17 __vector128 *vxrs = state->vxrs; in __kernel_fpu_begin() 18 int mask; in __kernel_fpu_begin() local 24 flags &= state->hdr.mask; in __kernel_fpu_begin() 25 if (flags & KERNEL_FPC) in __kernel_fpu_begin() 26 fpu_stfpc(&state->hdr.fpc); in __kernel_fpu_begin() 28 if (flags & KERNEL_VXR_LOW) in __kernel_fpu_begin() 32 mask = flags & KERNEL_VXR; in __kernel_fpu_begin() [all …]
|
/linux/arch/mips/lib/ |
H A D | bitops.c | 6 * Copyright (c) 1994-1997, 99, 2000, 06, 07 Ralf Baechle (ralf@linux-mips.org) 16 * __mips_set_bit - Atomically set a bit in memory. This is called by 25 unsigned long mask; in __mips_set_bit() local 26 unsigned long flags; in __mips_set_bit() local 28 mask = 1UL << bit; in __mips_set_bit() 29 raw_local_irq_save(flags); in __mips_set_bit() 30 *a |= mask; in __mips_set_bit() 31 raw_local_irq_restore(flags); in __mips_set_bit() 37 * __mips_clear_bit - Clears a bit in memory. This is called by clear_bit() if 46 unsigned long mask; in __mips_clear_bit() local [all …]
|
/linux/arch/loongarch/include/asm/ |
H A D | irqflags.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 16 u32 flags = CSR_CRMD_IE; in arch_local_irq_enable() local 17 register u32 mask asm("t0") = CSR_CRMD_IE; in arch_local_irq_enable() 20 "csrxchg %[val], %[mask], %[reg]\n\t" in arch_local_irq_enable() 21 : [val] "+r" (flags) in arch_local_irq_enable() 22 : [mask] "r" (mask), [reg] "i" (LOONGARCH_CSR_CRMD) in arch_local_irq_enable() 28 u32 flags = 0; in arch_local_irq_disable() local 29 register u32 mask asm("t0") = CSR_CRMD_IE; in arch_local_irq_disable() 32 "csrxchg %[val], %[mask], %[reg]\n\t" in arch_local_irq_disable() [all …]
|
/linux/arch/powerpc/platforms/85xx/ |
H A D | socrates_fpga_pic.c | 1 // SPDX-License-Identifier: GPL-2.0-only 24 #define SOCRATES_FPGA_IRQ_MASK ((1 << SOCRATES_FPGA_NUM_IRQS) - 1) 68 unsigned long flags; in socrates_fpga_pic_get_irq() local 79 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); in socrates_fpga_pic_get_irq() 81 raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); in socrates_fpga_pic_get_irq() 82 for (i = SOCRATES_FPGA_NUM_IRQS - 1; i >= 0; i--) { in socrates_fpga_pic_get_irq() 104 chip->irq_eoi(&desc->irq_data); in socrates_fpga_pic_cascade() 109 unsigned long flags; in socrates_fpga_pic_ack() local 111 uint32_t mask; in socrates_fpga_pic_ack() local 114 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); in socrates_fpga_pic_ack() [all …]
|
/linux/drivers/gpio/ |
H A D | gpio-ath79.c | 1 // SPDX-License-Identifier: GPL-2.0-only 6 * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com> 7 * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org> 46 return readl(ctrl->base + reg); in ath79_gpio_read() 52 writel(val, ctrl->base + reg); in ath79_gpio_write() 56 struct ath79_gpio_ctrl *ctrl, unsigned reg, u32 mask, u32 bits) in ath79_gpio_update_bits() argument 61 new_val = (old_val & ~mask) | (bits & mask); in ath79_gpio_update_bits() 72 u32 mask = BIT(irqd_to_hwirq(data)); in ath79_gpio_irq_unmask() local 73 unsigned long flags; in ath79_gpio_irq_unmask() local 75 gpiochip_enable_irq(&ctrl->gc, irqd_to_hwirq(data)); in ath79_gpio_irq_unmask() [all …]
|
/linux/arch/mips/kernel/ |
H A D | irq-gt641xx.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> 15 #define GT641XX_IRQ_TO_BIT(irq) (1U << (irq - GT641XX_IRQ_BASE)) 21 unsigned long flags; in ack_gt641xx_irq() local 24 raw_spin_lock_irqsave(>641xx_irq_lock, flags); in ack_gt641xx_irq() 26 cause &= ~GT641XX_IRQ_TO_BIT(d->irq); in ack_gt641xx_irq() 28 raw_spin_unlock_irqrestore(>641xx_irq_lock, flags); in ack_gt641xx_irq() 33 unsigned long flags; in mask_gt641xx_irq() local 34 u32 mask; in mask_gt641xx_irq() local 36 raw_spin_lock_irqsave(>641xx_irq_lock, flags); in mask_gt641xx_irq() [all …]
|
/linux/sound/soc/sof/ |
H A D | ops.c | 1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) 16 u32 mask, u32 value) in snd_sof_pci_update_bits_unlocked() argument 18 struct pci_dev *pci = to_pci_dev(sdev->dev); in snd_sof_pci_update_bits_unlocked() 24 dev_dbg(sdev->dev, "Debug PCIR: %8.8x at %8.8x\n", old & mask, offset); in snd_sof_pci_update_bits_unlocked() 26 new = (old & ~mask) | (value & mask); in snd_sof_pci_update_bits_unlocked() 32 dev_dbg(sdev->dev, "Debug PCIW: %8.8x at %8.8x\n", value, in snd_sof_pci_update_bits_unlocked() 39 u32 mask, u32 value) in snd_sof_pci_update_bits() argument 41 unsigned long flags; in snd_sof_pci_update_bits() local 44 spin_lock_irqsave(&sdev->hw_lock, flags); in snd_sof_pci_update_bits() 45 change = snd_sof_pci_update_bits_unlocked(sdev, offset, mask, value); in snd_sof_pci_update_bits() [all …]
|
/linux/drivers/ssb/ |
H A D | embedded.c | 5 * Copyright 2005-2008, Broadcom Corporation 6 * Copyright 2006-2008, Michael Buesch <m@bues.ch> 7 * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de> 25 if (ssb_chipco_available(&bus->chipco)) { in ssb_watchdog_timer_set() 26 ssb_chipco_watchdog_timer_set(&bus->chipco, ticks); in ssb_watchdog_timer_set() 29 if (ssb_extif_available(&bus->extif)) { in ssb_watchdog_timer_set() 30 ssb_extif_watchdog_timer_set(&bus->extif, ticks); in ssb_watchdog_timer_set() 33 return -ENODEV; in ssb_watchdog_timer_set() 42 if (ssb_chipco_available(&bus->chipco)) { in ssb_watchdog_register() 43 wdt.driver_data = &bus->chipco; in ssb_watchdog_register() [all …]
|
H A D | driver_extif.c | 22 return ssb_read32(extif->dev, offset); in extif_read32() 27 ssb_write32(extif->dev, offset, value); in extif_write32() 31 u32 mask, u32 value) in extif_write32_masked() argument 33 value &= mask; in extif_write32_masked() 34 value |= extif_read32(extif, offset) & ~mask; in extif_write32_masked() 143 if (!extif->dev) in ssb_extif_init() 145 spin_lock_init(&extif->gpio_lock); in ssb_extif_init() 148 u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask) in ssb_extif_gpio_in() argument 150 return extif_read32(extif, SSB_EXTIF_GPIO_IN) & mask; in ssb_extif_gpio_in() 153 u32 ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value) in ssb_extif_gpio_out() argument [all …]
|
/linux/drivers/clk/baikal-t1/ |
H A D | ccu-div.c | 1 // SPDX-License-Identifier: GPL-2.0-only 9 * Baikal-T1 CCU Dividers interface driver 12 #define pr_fmt(fmt) "bt1-ccu-div: " fmt 19 #include <linux/clk-provider.h> 27 #include "ccu-div.h" 35 GENMASK((_width) + CCU_DIV_CTL_CLKDIV_FLD - 1, CCU_DIV_CTL_CLKDIV_FLD) 48 * getter available with non-constant mask support. 50 static inline u32 ccu_div_get(u32 mask, u32 val) in ccu_div_get() argument 52 return (val & mask) >> CCU_DIV_CTL_CLKDIV_FLD; in ccu_div_get() 55 static inline u32 ccu_div_prep(u32 mask, u32 val) in ccu_div_prep() argument [all …]
|
/linux/fs/notify/fanotify/ |
H A D | fanotify_user.c | 1 // SPDX-License-Identifier: GPL-2.0 99 * All flags that may be specified in parameter event_f_flags of fanotify_init. 101 * Internal and external open flags are stored together in field f_flags of 102 * struct file. Only external open flags shall be allowed in event_f_flags. 103 * Internal flags like FMODE_EXEC shall be excluded. 151 info->name_len); in fanotify_dir_name_info_len() 154 info->name2_len); in fanotify_dir_name_info_len() 166 if (fanotify_is_error_event(event->mask)) in fanotify_event_len() 172 (event->mask & FAN_ONDIR)) { in fanotify_event_len() 184 if (fanotify_is_mnt_event(event->mask)) in fanotify_event_len() [all …]
|
/linux/drivers/net/ethernet/netronome/nfp/flower/ |
H A D | match.c | 1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 /* Copyright (C) 2017-2018 Netronome Systems, Inc. */ 15 ext->nfp_flow_key_layer = key_type; in nfp_flower_compile_meta() 16 ext->mask_id = ~0; in nfp_flower_compile_meta() 18 msk->nfp_flow_key_layer = key_type; in nfp_flower_compile_meta() 19 msk->mask_id = ~0; in nfp_flower_compile_meta() 36 match.key->vlan_priority) | in nfp_flower_compile_tci() 38 match.key->vlan_id); in nfp_flower_compile_tci() 42 match.mask->vlan_priority) | in nfp_flower_compile_tci() 44 match.mask->vlan_id); in nfp_flower_compile_tci() [all …]
|
/linux/arch/sparc/lib/ |
H A D | atomic32.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * atomic32.c: 32-bit atomic_t implementation 8 * Based on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf 17 #define ATOMIC_HASH(a) (&__atomic_hash[(((unsigned long)a)>>8) & (ATOMIC_HASH_SIZE-1)]) 20 [0 ... (ATOMIC_HASH_SIZE-1)] = __SPIN_LOCK_UNLOCKED(__atomic_hash) 35 unsigned long flags; \ 36 spin_lock_irqsave(ATOMIC_HASH(v), flags); \ 38 ret = v->counter; \ 39 v->counter c_op i; \ 41 spin_unlock_irqrestore(ATOMIC_HASH(v), flags); \ [all …]
|
/linux/drivers/bcma/ |
H A D | driver_chipcommon.c | 7 * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de> 19 u32 mask, u32 value) in bcma_cc_write32_masked() argument 21 value &= mask; in bcma_cc_write32_masked() 22 value |= bcma_cc_read32(cc, offset) & ~mask; in bcma_cc_write32_masked() 30 if (cc->capabilities & BCMA_CC_CAP_PMU) in bcma_chipco_get_alp_clock() 39 struct bcma_bus *bus = cc->core->bus; in bcma_core_cc_has_pmu_watchdog() 41 if (cc->capabilities & BCMA_CC_CAP_PMU) { in bcma_core_cc_has_pmu_watchdog() 42 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53573) { in bcma_core_cc_has_pmu_watchdog() 43 WARN(bus->chipinfo.rev <= 1, "No watchdog available\n"); in bcma_core_cc_has_pmu_watchdog() 58 struct bcma_bus *bus = cc->core->bus; in bcma_chipco_watchdog_get_max_timer() [all …]
|
/linux/arch/powerpc/platforms/powermac/ |
H A D | pfunc_core.c | 1 // SPDX-License-Identifier: GPL-2.0-only 84 while(bytes--) { 99 if ((cmd->cmdend - cmd->cmdptr) < 4) { in pmf_next32() 100 cmd->error = 1; in pmf_next32() 103 value = *((u32 *)cmd->cmdptr); in pmf_next32() 104 cmd->cmdptr += 4; in pmf_next32() 111 if ((cmd->cmdend - cmd->cmdptr) < count) { in pmf_next_blob() 112 cmd->error = 1; in pmf_next_blob() 115 value = cmd->cmdptr; in pmf_next_blob() 116 cmd->cmdptr += count; in pmf_next_blob() [all …]
|
H A D | pfunc_base.c | 1 // SPDX-License-Identifier: GPL-2.0 29 unsigned int irq = irq_of_parse_and_map(func->node, 0); in macio_do_gpio_irq_enable() 31 return -EINVAL; in macio_do_gpio_irq_enable() 32 return request_irq(irq, macio_gpio_irq, 0, func->node->name, func); in macio_do_gpio_irq_enable() 37 unsigned int irq = irq_of_parse_and_map(func->node, 0); in macio_do_gpio_irq_disable() 39 return -EINVAL; in macio_do_gpio_irq_disable() 44 static int macio_do_gpio_write(PMF_STD_ARGS, u8 value, u8 mask) in macio_do_gpio_write() argument 46 u8 __iomem *addr = (u8 __iomem *)func->driver_data; in macio_do_gpio_write() 47 unsigned long flags; in macio_do_gpio_write() local 51 if (args && args->count && !args->u[0].v) in macio_do_gpio_write() [all …]
|
/linux/sound/isa/ad1816a/ |
H A D | ad1816a_lib.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 ad1816a.c - lowlevel code for Analog Devices AD1816A chip. 4 Copyright (C) 1999-2000 by Massimo Piccioni <dafastidio@libero.it> 24 for (timeout = 1000; timeout-- > 0; udelay(10)) in snd_ad1816a_busy_wait() 28 dev_warn(chip->card->dev, "chip busy.\n"); in snd_ad1816a_busy_wait() 29 return -EBUSY; in snd_ad1816a_busy_wait() 46 unsigned char mask, unsigned char value) in snd_ad1816a_out_mask() argument 49 (value & mask) | (snd_ad1816a_in(chip, reg) & ~mask)); in snd_ad1816a_out_mask() 68 unsigned short mask, unsigned short value) in snd_ad1816a_write_mask() argument 71 (value & mask) | (snd_ad1816a_read(chip, reg) & ~mask)); in snd_ad1816a_write_mask() [all …]
|
/linux/arch/powerpc/sysdev/ |
H A D | ipic.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 35 .mask = IPIC_SIMSR_H, 42 .mask = IPIC_SIMSR_H, 49 .mask = IPIC_SIMSR_H, 56 .mask = IPIC_SIMSR_H, 63 .mask = IPIC_SIMSR_H, 70 .mask = IPIC_SIMSR_H, 77 .mask = IPIC_SIMSR_H, 84 .mask = IPIC_SIMSR_H, 91 .mask = IPIC_SIMSR_H, [all …]
|
/linux/arch/parisc/include/asm/ |
H A D | bitops.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 23 unsigned long mask = BIT_MASK(nr); in set_bit() local 24 unsigned long flags; in set_bit() local 27 _atomic_spin_lock_irqsave(addr, flags); in set_bit() 28 *addr |= mask; in set_bit() 29 _atomic_spin_unlock_irqrestore(addr, flags); in set_bit() 34 unsigned long mask = BIT_MASK(nr); in clear_bit() local 35 unsigned long flags; in clear_bit() local 38 _atomic_spin_lock_irqsave(addr, flags); in clear_bit() 39 *addr &= ~mask; in clear_bit() [all …]
|
/linux/sound/isa/cs423x/ |
H A D | cs4236_lib.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 * ----- 10 * ----- 20 * D7-D5: version 21 * D4-D0: chip id 22 * 11101 - CS4235 23 * 01011 - CS4236B 24 * 01000 - CS4237B 25 * 01001 - CS4238B 26 * 11110 - CS4239 [all …]
|
/linux/io_uring/ |
H A D | poll.c | 1 // SPDX-License-Identifier: GPL-2.0 49 * We usually have 1-2 refs taken, 128 is more than enough and we want to 61 unsigned long priv = (unsigned long)wqe->private; in wqe_to_req() 68 unsigned long priv = (unsigned long)wqe->private; in wqe_is_double() 82 v = atomic_fetch_or(IO_POLL_RETRY_FLAG, &req->poll_refs); in io_poll_get_ownership_slowpath() 85 return !(atomic_fetch_inc(&req->poll_refs) & IO_POLL_REF_MASK); in io_poll_get_ownership_slowpath() 89 * If refs part of ->poll_refs (see IO_POLL_REF_MASK) is 0, it's free. We can 96 if (unlikely(atomic_read(&req->poll_refs) >= IO_POLL_REF_BIAS)) in io_poll_get_ownership() 98 return !(atomic_fetch_inc(&req->poll_refs) & IO_POLL_REF_MASK); in io_poll_get_ownership() 103 atomic_or(IO_POLL_CANCEL_FLAG, &req->poll_refs); in io_poll_mark_cancelled() [all …]
|
/linux/drivers/clk/ |
H A D | clk-mux.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2011-2012 Mike Turquette, Linaro Ltd <mturquette@linaro.org> 10 #include <linux/clk-provider.h> 21 * prepare - clk_prepare only ensures that parents are prepared 22 * enable - clk_enable only ensures that parents are enabled 23 * rate - rate is only affected by parent switching. No clk_set_rate support 24 * parent - parent is adjustable through clk_set_parent 29 if (mux->flags & CLK_MUX_BIG_ENDIAN) in clk_mux_readl() 30 return ioread32be(mux->reg); in clk_mux_readl() 32 return readl(mux->reg); in clk_mux_readl() [all …]
|
/linux/arch/arm/include/asm/ |
H A D | bitops.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 38 unsigned long flags; in ____atomic_set_bit() local 39 unsigned long mask = BIT_MASK(bit); in ____atomic_set_bit() local 43 raw_local_irq_save(flags); in ____atomic_set_bit() 44 *p |= mask; in ____atomic_set_bit() 45 raw_local_irq_restore(flags); in ____atomic_set_bit() 50 unsigned long flags; in ____atomic_clear_bit() local 51 unsigned long mask = BIT_MASK(bit); in ____atomic_clear_bit() local 55 raw_local_irq_save(flags); in ____atomic_clear_bit() 56 *p &= ~mask; in ____atomic_clear_bit() [all …]
|
/linux/drivers/net/ethernet/aquantia/atlantic/ |
H A D | aq_utils.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 4 * Copyright (C) 2014-2017 aQuantia Corporation. All rights reserved 14 static inline void aq_utils_obj_set(atomic_t *flags, u32 mask) in aq_utils_obj_set() argument 19 flags_old = atomic_read(flags); in aq_utils_obj_set() 20 flags_new = flags_old | (mask); in aq_utils_obj_set() 21 } while (atomic_cmpxchg(flags, flags_old, flags_new) != flags_old); in aq_utils_obj_set() 24 static inline void aq_utils_obj_clear(atomic_t *flags, u32 mask) in aq_utils_obj_clear() argument 29 flags_old = atomic_read(flags); in aq_utils_obj_clear() 30 flags_new = flags_old & ~(mask); in aq_utils_obj_clear() 31 } while (atomic_cmpxchg(flags, flags_old, flags_new) != flags_old); in aq_utils_obj_clear() [all …]
|
/linux/drivers/pinctrl/starfive/ |
H A D | pinctrl-starfive-jh7110.c | 1 // SPDX-License-Identifier: GPL-2.0 27 #include <dt-bindings/pinctrl/starfive,jh7110-pinctrl.h> 30 #include "../pinctrl-utils.h" 33 #include "pinctrl-starfive-jh7110.h" 52 * | 31 - 24 | 23 - 16 | 15 - 10 | 9 - 8 | 7 - 0 | 100 const struct jh7110_pinctrl_soc_info *info = sfp->info; in jh7110_pin_dbg_show() 102 seq_printf(s, "%s", dev_name(pctldev->dev)); in jh7110_pin_dbg_show() 104 if (pin < sfp->gc.ngpio) { in jh7110_pin_dbg_show() 107 u32 dout = readl_relaxed(sfp->base + info->dout_reg_base + offset); in jh7110_pin_dbg_show() 108 u32 doen = readl_relaxed(sfp->base + info->doen_reg_base + offset); in jh7110_pin_dbg_show() [all …]
|