| /linux/lib/ |
| H A D | sort.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * A fast, small, non-recursive O(n log n) sort for the Linux kernel 6 * and 1.5*n*log2(n) + O(n) in the (very contrived) worst case. 8 * Quicksort manages n*log2(n) - 1.26*n for random inputs (1.63*n 9 * better) at the expense of stack usage and much larger code to avoid 18 * is_aligned - is this pointer & size okay for word-wide copying? 23 * Returns true if elements can be copied using word loads and stores. 24 * The size must be a multiple of the alignment, and the base address must 39 return (lsbits & (align - 1)) == 0; in is_aligned() 43 * swap_words_32 - swap two elements in 32-bit chunks [all …]
|
| /linux/arch/xtensa/kernel/ |
| H A D | s32c1i_selftest.c | 4 * This file is subject to the terms and conditions of the GNU General Public 21 * Basic atomic compare-and-swap, that records PC of S32C1I for probing. 45 if (regs->pc == rcw_probe_pc) { /* exception on s32c1i ? */ in do_probed_exception() 46 regs->pc += 3; /* skip the s32c1i instruction */ in do_probed_exception() 47 rcw_exc = regs->exccause; in do_probed_exception() 80 panic("S32C1I compare error"); in check_s32c1i() 121 pr_warn("Processor configuration lacks atomic compare-and-swap support!\n"); in check_s32c1i()
|
| /linux/arch/m68k/include/asm/ |
| H A D | cmpxchg.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 21 swap(*(u8 *)ptr, x); in __arch_xchg() 24 swap(*(u16 *)ptr, x); in __arch_xchg() 27 swap(*(u32 *)ptr, x); in __arch_xchg() 75 #include <asm-generic/cmpxchg-local.h> 83 * Atomic compare and exchange. Compare OLD with MEM, if identical, 126 #include <asm-generic/cmpxchg.h>
|
| /linux/arch/m68k/ifpsp060/src/ |
| H A D | ilsp.S | 3 M68000 Hi-Performance Microprocessor Division 5 Production Release P1.00 -- October 10, 1994 9 THE SOFTWARE is provided on an "AS IS" basis and without warranty. 13 and any warranty against infringement with regard to the SOFTWARE label 14 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials. 21 Motorola assumes no responsibility for the maintenance and support of the SOFTWARE. 23 You are hereby granted a copyright license to use, modify, and distribute the SOFTWARE 24 so long as this entire notice is retained without alteration in any modified and/or 25 redistributed versions, and that such modified versions are clearly identified as such. 31 # and contains the entry points into the package. The user, in [all …]
|
| H A D | isp.S | 3 M68000 Hi-Performance Microprocessor Division 5 Production Release P1.00 -- October 10, 1994 9 THE SOFTWARE is provided on an "AS IS" basis and without warranty. 13 and any warranty against infringement with regard to the SOFTWARE label 14 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials. 21 Motorola assumes no responsibility for the maintenance and support of the SOFTWARE. 23 You are hereby granted a copyright license to use, modify, and distribute the SOFTWARE 24 so long as this entire notice is retained without alteration in any modified and/or 25 redistributed versions, and that such modified versions are clearly identified as such. 31 # and contains the entry points into the package. The user, in [all …]
|
| /linux/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/ |
| H A D | g98.fuc0s | 5 * This program is free software; you can redistribute it and/or modify 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 43 swap: 99 // $r0 is always set to 0 in our code - this allows some space savings. 109 // set interrupt dispatch - route timer, fifo, ctxswitch to i0, others to host 119 // enable fifo access and context switching 138 and $r2 $r1 0x8 146 // 128-byte context. 158 // unload the current channel - save the context 161 // and clear bit 30, then write back [all …]
|
| /linux/arch/s390/tools/ |
| H A D | gen_facilities.c | 1 // SPDX-License-Identifier: GPL-2.0 26 * -march=<machine>. 33 21, /* extended-immediate facility */ 36 32, /* compare and swap and store */ 37 33, /* compare and swap and store 2 */ 41 45, /* fast-BCR, etc. */ 44 49, /* misc-instruction-extensions */ 48 53, /* load-and-zero-rightmost-byte, etc. */ 52 58, /* miscellaneous-instruction-extension 2 */ 55 61, /* miscellaneous-instruction-extension 3 */ [all …]
|
| /linux/drivers/misc/genwqe/ |
| H A D | card_ddcb.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 11 * Author: Joerg-Stephan Vogt <jsvogt@de.ibm.com> 23 * struct ddcb - Device Driver Control Block DDCB 25 * @shi: Software hardware interlock. Hsi and shi are used to interlock 26 * software and hardware activities. We are using a compare and 27 * swap operation to ensure that there are no races when 120 * Accessing HSI/SHI is done 32-bit wide 121 * Normally 16-bit access would work too, but on some platforms the 122 * 16 compare and swap operation is not supported. Therefore 123 * switching to 32-bit such that those platforms will work too. [all …]
|
| /linux/arch/xtensa/include/uapi/asm/ |
| H A D | unistd.h | 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 21 #define SYS_XTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */ 23 #define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */
|
| /linux/arch/m68k/lib/ |
| H A D | udivsi3.S | 1 /* libgcc1 routines for 68000 w/o floating-point hardware. 6 GNU CC is free software; you can redistribute it and/or modify it 13 compiled version of this file with other programs, and to distribute 16 respects; for example, they cover modification of the file, and 33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 90 movel d2, sp@- 98 swap d2 define 101 swap d0 define 120 swap d2 define 122 swap d2 /* align high part with low part */ define [all …]
|
| /linux/arch/sh/include/uapi/asm/ |
| H A D | cpu-features.h | 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 19 #define CPU_HAS_DSP 0x0008 /* SH-DSP: DSP support */ 24 #define CPU_HAS_OP32 0x0100 /* 32-bit instruction support */ 26 #define CPU_HAS_CAS_L 0x0400 /* cas.l atomic compare-and-swap */
|
| /linux/include/uapi/linux/ |
| H A D | rds.h | 1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ 3 * Copyright (c) 2008, 2018 Oracle and/or its affiliates. All rights reserved. 11 * Redistribution and use in source and binary forms, with or 15 * - Redistributions of source code must retain the above 16 * copyright notice, this list of conditions and the following 19 * - Redistributions in binary form must reproduce the above 20 * copyright notice, this list of conditions and the following 21 * disclaimer in the documentation and/or other materials 26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 71 /* don't use RDS_TRANS_IWARP - it is deprecated */ [all …]
|
| /linux/arch/sparc/include/asm/ |
| H A D | backoff.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 10 * completion of the compare-and-swap instruction. Heavily 14 * When an atomic operation fails and needs to be retried, we spin a 20 * current cpu strand to block, and therefore make the core fully 24 * On all cpus prior to SPARC-T4 we do three dummy reads of the 26 * between 40 and 50 cpu cycles. 28 * For SPARC-T4 and later we have a special "pause" instruction 31 * unless a disrupting trap happens first. SPARC-T4 specifically 34 * chip shifts the %asr27 value down by 3 bits, and writes the result
|
| /linux/arch/x86/include/asm/ |
| H A D | mc146818rtc.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 19 * special properties. It is owned by a CPU and stores the index register 24 * and performs the access and then restores the index register. If it does 28 * a non-SMP machine just to mark that the lock is owned. 30 * This only works with compare-and-swap. There is no other way to 31 * atomically claim the lock and set the owner.
|
| /linux/include/uapi/rdma/ |
| H A D | vmw_pvrdma-abi.h | 1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ 3 * Copyright (c) 2012-2016 VMware, Inc. All rights reserved. 5 * This program is free software; you can redistribute it and/or 8 * 2-Clause License. This program is distributed in the hope that it 12 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html. 18 * The BSD 2-Clause License 20 * Redistribution and use in source and binary forms, with or 24 * - Redistributions of source code must retain the above 25 * copyright notice, this list of conditions and the following 28 * - Redistributions in binary form must reproduce the above [all …]
|
| /linux/drivers/md/dm-vdo/indexer/ |
| H A D | radix-sort.c | 1 // SPDX-License-Identifier: GPL-2.0-only 6 #include "radix-sort.h" 11 #include "memory-alloc.h" 12 #include "string-utils.h" 23 /* Sort keys are pointers to immutable fixed-length arrays of bytes. */ 31 /* The number of non-empty bins */ 33 /* The index (key byte) of the first non-empty bin */ 35 /* The index (key byte) of the last non-empty bin */ 42 * Sub-tasks are manually managed on a stack, both for performance and to put a logarithmic bound 65 /* Compare a segment of two fixed-length keys starting at an offset. */ [all …]
|
| /linux/mm/ |
| H A D | internal.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 17 #include <linux/swap.h> 20 #include <linux/tracepoint-defs.h> 29 * and destination VMAs already exist and are specified by the user. 31 * Partial moves are permitted, but the old and new ranges must both reside 34 * mmap lock must be held in write and VMA write locks must be held on any VMA 39 * The old_addr and new_addr fields are updated as the page table move is 43 * and old_addr may be updated for better page table alignment, so len_in 69 * The set of flags that only affect watermark checking and reclaim 71 * about IO, FS and watermark checking while ignoring placement [all …]
|
| /linux/net/rds/ |
| H A D | rdma.c | 2 * Copyright (c) 2007, 2020 Oracle and/or its affiliates. 10 * Redistribution and use in source and binary forms, with or 14 * - Redistributions of source code must retain the above 15 * copyright notice, this list of conditions and the following 18 * - Redistributions in binary form must reproduce the above 19 * copyright notice, this list of conditions and the following 20 * disclaimer in the documentation and/or other materials 25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 36 #include <linux/dma-mapping.h> /* for DMA_*_DEVICE */ 42 * - build with sparse [all …]
|
| /linux/arch/powerpc/kvm/ |
| H A D | book3s_xics.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 12 * We use a two-level tree to store interrupt source information. 19 #define KVMPPC_XICS_SRC_MASK (KVMPPC_XICS_IRQ_PER_ICS - 1) 23 * 0 is "no interrupt", and 2 is used for IPIs. 44 u8 lsi; /* level-sensitive interrupt */ 50 /* Atomic ICP state, updated with a single compare & swap */ 122 if (vcpu->arch.icp && nr == vcpu->arch.icp->server_num) in kvmppc_xics_find_server() 123 return vcpu->arch.icp; in kvmppc_xics_find_server() 139 ics = xics->ics[icsid]; in kvmppc_xics_find_ics()
|
| /linux/drivers/infiniband/hw/vmw_pvrdma/ |
| H A D | pvrdma_dev_api.h | 2 * Copyright (c) 2012-2016 VMware, Inc. All rights reserved. 4 * This program is free software; you can redistribute it and/or 7 * 2-Clause License. This program is distributed in the hope that it 11 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html. 17 * The BSD 2-Clause License 19 * Redistribution and use in source and binary forms, with or 23 * - Redistributions of source code must retain the above 24 * copyright notice, this list of conditions and the following 27 * - Redistributions in binary form must reproduce the above 28 * copyright notice, this list of conditions and the following [all …]
|
| /linux/fs/btrfs/ |
| H A D | ctree.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 22 #include "extent-io-tree.h" 41 * will still trigger readahead for other nodes and leaves that follow 52 * level 0 is always the leaf, and nodes[1...BTRFS_MAX_LEVEL] will point 68 * and to force calls to keep space in the nodes 79 * existing item and ins_len contains only the data size and not item 95 * btrfs_record_root_in_trans is a multi-step process, and it can race 96 * with the balancing code. But the race is very small, and only the 104 * Only subvolume trees and their reloc trees have this bit set. 109 * - How balance works [all …]
|
| /linux/Documentation/ |
| H A D | atomic_t.txt | 2 On atomic types (atomic_t atomic64_t and atomic_long_t). 5 RMW operations between CPUs (atomic operations on MMIO are not supported and 9 --- 11 The 'full' API consists of (atomic64_ and atomic_long_ prefixes omitted for 14 Non-RMW ops: 31 atomic_{and,or,xor,andnot}() 32 atomic_fetch_{and,or,xor,andnot}{,_relaxed,_acquire,_release}() 35 Swap: 60 ----- 62 While atomic_t, atomic_long_t and atomic64_t use int, long and s64 [all …]
|
| /linux/arch/m68k/fpsp040/ |
| H A D | srem_mod.S | 5 | input values X and Y. The entry point sREM computes the floating 6 | point (IEEE) REM of the input values X and Y. 9 | ----- 10 | Double-extended value Y is pointed to by address in register 11 | A0. Double-extended value X is located in -12(A0). The values 12 | of X and Y are both nonzero and finite; although either or both 14 | and infinities are handled elsewhere. 17 | ------ 21 | --------- 23 | Step 1. Save and strip signs of X and Y: signX := sign(X), [all …]
|
| /linux/drivers/s390/cio/ |
| H A D | qdio_thinint.c | 1 // SPDX-License-Identifier: GPL-2.0 35 u32 ind; /* u32 because of compare-and-swap performance */ 36 atomic_t count; /* use count, 0 or 1 for non-shared indicators */ 67 atomic_dec(&ind->count); in put_indicator() 72 return irq_ptr->dsci == &q_indicators[TIQDIO_SHARED_IND].ind; in references_shared_dsci() 81 if (*irq_ptr->dsci) in test_nonshared_ind() 95 * tiqdio_thinint_handler - thin interrupt handler for qdio 97 * @tpi_info: interrupt information (e.g. floating vs directed -- unused) 102 u64 irq_time = get_lowcore()->int_clock; in tiqdio_thinint_handler() 118 if (!*irq->dsci) in tiqdio_thinint_handler() [all …]
|
| /linux/arch/s390/include/asm/ |
| H A D | percpu.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 13 #define __my_cpu_offset get_lowcore()->percpu_offset 24 * We use a compare-and-swap loop since that uses less cpu cycles than 25 * disabling and enabling interrupts like the generic variant would do. 74 ((szcast)val__ > -129) && ((szcast)val__ < 128)) { \ 183 #include <asm-generic/percpu.h>
|