instruction
stringlengths
82
202
input
stringclasses
1 value
output
stringlengths
73
23.9M
Linux kernel'inin 'lib/nmi_backtrace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * NMI backtrace support * * Gratuitously copied from arch/x86/kernel/apic/hw_nmi.c by Russell King, * with the following header: * * HW NMI watchdog support * * started by Don Zickus, Copyright (C) 2010 Red Hat, Inc. * * Arch specific calls to support NMI watchd...
Linux kernel'inin 'lib/devres' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/bug.h> #include <linux/device.h> #include <linux/errno.h> #include <linux/export.h> #include <linux/gfp_types.h> #include <linux/io.h> #include <linux/ioport.h> #include <linux/of_address.h> #include <linux/types.h> enum devm_ioremap_type { DEVM_IOREMAP = 0, D...
Linux işletim sistemi çekirdeği için 'lib/locking-selftest-rtmutex' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #undef LOCK #define LOCK RTL #undef UNLOCK #define UNLOCK RTU #undef RLOCK #undef WLOCK #undef INIT #define INIT RTI ```
Linux kernel'inin 'lib/xarray' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0+ /* * XArray implementation * Copyright (c) 2017-2018 Microsoft Corporation * Copyright (c) 2018-2020 Oracle * Author: Matthew Wilcox <willy@infradead.org> */ #include <linux/bitmap.h> #include <linux/export.h> #include <linux/list.h> #include <linux/slab.h> #include <linu...
Linux kernel'inin 'lib/objpool' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/objpool.h> #include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/atomic.h> #include <linux/irqflags.h> #include <linux/cpumask.h> #include <linux/log2.h> /* * objpool: ring-array based lockless MPMC/FIFO queues * * Copyright: wuqiang.matt@byteda...
Linux kernel'inin 'lib/bust_spinlocks' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * lib/bust_spinlocks.c * * Provides a minimal bust_spinlocks for architectures which don't * have one of their own. * * bust_spinlocks() clears any spinlocks which would prevent oops, die(), BUG() * and panic() information from reaching the user. */ #include <linux/k...
Linux işletim sistemi çekirdeği için 'lib/locking-selftest-mutex' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #undef LOCK #define LOCK ML #undef UNLOCK #define UNLOCK MU #undef RLOCK #undef WLOCK #undef INIT #define INIT MI ```
Linux kernel'inin 'lib/test_ida' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0+ /* * test_ida.c: Test the IDA API * Copyright (c) 2016-2018 Microsoft Corporation * Copyright (c) 2018 Oracle Corporation * Author: Matthew Wilcox <willy@infradead.org> */ #include <linux/idr.h> #include <linux/module.h> static unsigned int tests_run; static unsigned int...
Linux kernel'inin 'lib/cmdline' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * linux/lib/cmdline.c * Helper functions generally used for parsing kernel command line * and module options. * * Code and copyrights come from init/main.c and arch/i386/kernel/setup.c. * * GNU Indent formatting options for this file: -kr -i8 -npsl -pcs */ #incl...
Linux kernel'inin 'lib/cpumask' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/slab.h> #include <linux/kernel.h> #include <linux/bitops.h> #include <linux/cpumask.h> #include <linux/export.h> #include <linux/memblock.h> #include <linux/numa.h> /* These are not inline because of header tangles. */ #ifdef CONFIG_CPUMASK_OFFSTACK /** * alloc...
Linux kernel'inin 'lib/vsprintf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * linux/lib/vsprintf.c * * Copyright (C) 1991, 1992 Linus Torvalds */ /* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ /* * Wirzenius wrote this portably, Torvalds fucked it up :-) */ /* * Fri Jul 13 2001 Crutcher Dunnavant <crutcher+kernel@datastacks.com...
Linux kernel'inin 'lib/ashrdi3' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* */ #include <linux/export.h> #include <linux/libgcc.h> long long notrace __ashrdi3(long long u, word_type b) { DWunion uu, w; word_type bm; if (b == 0) return u; uu.ll = u; bm = 32 - b; if (bm <= 0) { /* w.s.high = 1..1 or 0..0 */ w.s.high = ...
Linux kernel'inin 'lib/ashldi3' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* */ #include <linux/export.h> #include <linux/libgcc.h> long long notrace __ashldi3(long long u, word_type b) { DWunion uu, w; word_type bm; if (b == 0) return u; uu.ll = u; bm = 32 - b; if (bm <= 0) { w.s.low = 0; w.s.high = (unsigned int) uu.s.low...
Linux kernel'inin 'lib/test_memcat_p' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test cases for memcat_p() in lib/memcat_p.c */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/string.h> #include <linux/slab.h> #include <linux/module.h> struct test_struct { int num; unsigned int magic; }; #define MAGIC 0xf00ff00f /* Size of each of t...
Linux işletim sistemi çekirdeği için 'lib/locking-selftest-rsem' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #undef LOCK #define LOCK RSL #undef UNLOCK #define UNLOCK RSU #undef RLOCK #define RLOCK RSL #undef WLOCK #define WLOCK WSL #undef INIT #define INIT RWSI ```
Linux kernel'inin 'lib/test_meminit' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test cases for SL[AOU]B/page initialization at alloc/free time. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/init.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/string.h> #include <li...
Linux kernel'inin 'lib/random32' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * This is a maximally equidistributed combined Tausworthe generator * based on code from GNU Scientific Library 1.5 (30 Jun 2004) * * lfsr113 version: * * x_n = (s1_n ^ s2_n ^ s3_n ^ s4_n) * * s1_{n+1} = (((s1_n & 4294967294) << 18) ^ (((s1_n << 6) ^ s1_n) >> 13)) *...
Linux kernel'inin 'lib/test_fpu_impl' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0+ #include <linux/errno.h> #include "test_fpu.h" int test_fpu(void) { /* * This sequence of operations tests that rounding mode is * to nearest and that denormal numbers are supported. * Volatile variables are used to avoid compiler optimizing * the calculations away....
Linux kernel'inin 'lib/test_hexdump' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Test cases for lib/hexdump.c module. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/random.h> #include <linux/string.h> static const unsigned char data_b[] = { '\xbe', '\x32', '\xdb', '\x7b', '\x0a', '\x18', '\x93...
Linux kernel'inin 'lib/iov_iter' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/export.h> #include <linux/bvec.h> #include <linux/fault-inject-usercopy.h> #include <linux/uio.h> #include <linux/pagemap.h> #include <linux/highmem.h> #include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/splice.h> #include <linux/compat.h> #in...
Linux kernel'inin 'lib/notifier-error-inject' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/module.h> #include "notifier-error-inject.h" static int debugfs_errno_set(void *data, u64 val) { *(int *)data = clamp_t(int, val, -MAX_ERRNO, 0); return 0; } static int debugfs_errno_get(void *data, u64 *val) { *val = *(int *)data; return 0; } DEFINE...
Linux işletim sistemi çekirdeği için 'lib/ubsan' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LIB_UBSAN_H #define _LIB_UBSAN_H /* * ABI defined by Clang's UBSAN enum SanitizerHandler: * https://github.com/llvm/llvm-project/blob/release/16.x/clang/lib/CodeGen/CodeGenFunction.h#L113 */ enum ubsan_checks { ubsan_add_overflow, ubsan_builtin_unreachable, ub...
Linux kernel'inin 'lib/error-inject' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // error-inject.c: Function-level error injection table #include <linux/error-injection.h> #include <linux/debugfs.h> #include <linux/kallsyms.h> #include <linux/kprobes.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/list.h> #include <linux/slab.h> #includ...
Linux kernel'inin 'lib/lru_cache' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* lru_cache.c This file is part of DRBD by Philipp Reisner and Lars Ellenberg. Copyright (C) 2003-2008, LINBIT Information Technologies GmbH. Copyright (C) 2003-2008, Philipp Reisner <philipp.reisner@linbit.com>. Copyright (C) 2003-2008, Lars Ellenberg...
Linux kernel'inin 'lib/test_workqueue' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test module for stress and performance analysis of workqueue. * * Benchmarks queue_work() throughput on an unbound workqueue to measure * pool->lock contention under different affinity scope configurations * (e.g., cache vs cache_shard). * * The affinity scope is ch...
Linux kernel'inin 'lib/test_static_key_base' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Kernel module for testing static keys. * * Copyright 2015 Akamai Technologies Inc. All Rights Reserved * * Authors: * Jason Baron <jbaron@akamai.com> */ #include <linux/module.h> #include <linux/jump_label.h> /* old keys */ struct static_key base_ol...
Linux kernel'inin 'lib/memregion' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* identifiers for device / performance-differentiated memory regions */ #include <linux/idr.h> #include <linux/types.h> #include <linux/memregion.h> static DEFINE_IDA(memregion_ids); int memregion_alloc(gfp_t gfp) { return ida_alloc(&memregion_ids, gfp); } EXPORT_SYMBOL...
Linux kernel'inin 'lib/test_lockup' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test module to generate lockups */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/sched.h> #include <linux/sched/signal.h> #include <linux/sched/clock.h> #include <linux/cpu.h> #inc...
Linux kernel'inin 'lib/cmpdi2' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* */ #include <linux/export.h> #include <linux/libgcc.h> word_type notrace __cmpdi2(long long a, long long b) { const DWunion au = { .ll = a }; const DWunion bu = { .ll = b }; if (au.s.high < bu.s.high) return 0; else if (au.s.high > bu.s.high) retur...
Linux kernel'inin 'lib/debug_locks' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * lib/debug_locks.c * * Generic place for common debugging facilities for various locks: * spinlocks, rwlocks, mutexes and rwsems. * * Started by Ingo Molnar: * * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> */ #include <linux/rwsem.h> #incl...
Linux kernel'inin 'lib/earlycpio' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* ----------------------------------------------------------------------- * * * Copyright 2012 Intel Corporation; author H. Peter Anvin * * ----------------------------------------------------------------------- */ /* * earlycpio.c * * Find a specific cpio member...
Linux kernel'inin 'lib/objagg' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /* Copyright (c) 2018 Mellanox Technologies. All rights reserved */ #include <linux/module.h> #include <linux/slab.h> #include <linux/rhashtable.h> #include <linux/idr.h> #include <linux/list.h> #include <linux/sort.h> #include <linux/objagg.h> #define CREATE_T...
Linux kernel'inin 'lib/percpu_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/limits.h> #include <linux/module.h> /* validate @native and @pcp counter values match @expected */ #define CHECK(native, pcp, expected) \ do { \ WARN((native) !...
Linux kernel'inin 'lib/ref_tracker' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later #define pr_fmt(fmt) "ref_tracker: " fmt #include <linux/export.h> #include <linux/list_sort.h> #include <linux/ref_tracker.h> #include <linux/slab.h> #include <linux/stacktrace.h> #include <linux/stackdepot.h> #include <linux/seq_file.h> #define REF_TRACKER_STACK_ENT...
Linux kernel'inin 'lib/iomap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Implement the default iomap interfaces * * (C) Copyright 2004 Linus Torvalds */ #include <linux/pci.h> #include <linux/io.h> #include <linux/kmsan-checks.h> #include <linux/export.h> /* * Read/write from/to an (offsettable) iomem cookie. It might be a PIO * access o...
Linux kernel'inin 'lib/test_objpool' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test module for lockless object pool * * Copyright: wuqiang.matt@bytedance.com */ #include <linux/errno.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/completion.h> #include <linux/kthread.h> #include <linux/slab.h> #include <linux/vmalloc...
Linux kernel'inin 'lib/assoc_array' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* Generic associative array implementation. * * See Documentation/core-api/assoc_array.rst for information. * * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) */ //#define DEBUG #include <linux/rcupdate.h> #...
Linux kernel'inin 'lib/iomap_copy' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2006 PathScale, Inc. All Rights Reserved. */ #include <linux/export.h> #include <linux/io.h> /** * __iowrite32_copy - copy data to MMIO space, in 32-bit units * @to: destination, in MMIO space (must be 32-bit aligned) * @from: source (must be 32-bit a...
Linux kernel'inin 'lib/parser' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * lib/parser.c - simple parser for mount, etc. options. */ #include <linux/ctype.h> #include <linux/types.h> #include <linux/export.h> #include <linux/kstrtox.h> #include <linux/parser.h> #include <linux/slab.h> #include <linux/string.h> /* * max size needed by diff...
Linux kernel'inin 'lib/rbtree_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/rbtree_augmented.h> #include <linux/prandom.h> #include <linux/slab.h> #include <asm/timex.h> #define __param(type, name, init, msg) \ static type name = init; \ module_param(name, type, 0444); \...
Linux kernel'inin 'lib/seq_buf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * seq_buf.c * * Copyright (C) 2014 Red Hat Inc, Steven Rostedt <srostedt@redhat.com> * * The seq_buf is a handy tool that allows you to pass a descriptor around * to a buffer that other functions can write to. It is similar to the * seq_file functionality but has some ...
Linux kernel'inin 'lib/test_ref_tracker' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Reference tracker self test. * * Copyright (c) 2021 Eric Dumazet <edumazet@google.com> */ #include <linux/init.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/ref_tracker.h> #include <linux/slab.h> #include <linux/timer.h> static struct ref_t...
Linux kernel'inin 'lib/glob' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: (GPL-2.0 OR MIT) #include <linux/module.h> #include <linux/glob.h> #include <linux/export.h> /* * The only reason this code can be compiled as a module is because the * ATA code that depends on it can be as well. In practice, they're * both usually compiled in and the module overhe...
Linux kernel'inin 'lib/dhry_2' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) /* **************************************************************************** * * "DHRYSTONE" Benchmark Program * ----------------------------- * * Version: C, Version 2.1 * * File: dhry_2.c (part 3 ...
Linux kernel'inin 'lib/crc/crc4' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * crc4.c - simple crc-4 calculations. */ #include <linux/crc4.h> #include <linux/export.h> #include <linux/module.h> static const uint8_t crc4_tab[] = { 0x0, 0x7, 0xe, 0x9, 0xb, 0xc, 0x5, 0x2, 0x1, 0x6, 0xf, 0x8, 0xa, 0xd, 0x4, 0x3, }; /** * crc4 - calculate the ...
Linux kernel'inin 'lib/crc/crc16' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * crc16.c */ #include <linux/crc16.h> #include <linux/export.h> #include <linux/module.h> #include <linux/types.h> /** CRC table for the CRC-16. The poly is 0x8005 (x^16 + x^15 + x^2 + 1) */ static const u16 crc16_table[256] = { 0x0000, 0xC0C1, 0xC181, 0x0140, ...
Linux kernel'inin 'lib/crc/gen_crc64table' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * This host program runs at kernel build time and generates the lookup tables * used by the generic CRC64 code. * * Copyright 2018 SUSE Linux. * Author: Coly Li <colyli@suse.de> */ #include <inttypes.h> #include <stdio.h> #define CRC64_ECMA182_POLY 0x42F0E1EBA9EA3693...
Linux kernel'inin 'lib/crc/crc-t10dif-main' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * T10 Data Integrity Field CRC16 calculation * * Copyright (c) 2007 Oracle Corporation. All rights reserved. * Written by Martin K. Petersen <martin.petersen@oracle.com> */ #include <linux/crc-t10dif.h> #include <linux/export.h> #include <linux/module.h> #include ...
Linux kernel'inin 'lib/crc/crc8' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright (c) 2011 Broadcom Corporation * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE ...
Linux kernel'inin 'lib/crc/crc-itu-t' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * crc-itu-t.c */ #include <linux/crc-itu-t.h> #include <linux/export.h> #include <linux/module.h> #include <linux/types.h> /* CRC table for the CRC ITU-T V.41 0x1021 (x^16 + x^12 + x^5 + 1) */ const u16 crc_itu_t_table[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0...
Linux kernel'inin 'lib/crc/crc32-main' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Aug 8, 2011 Bob Pearson with help from Joakim Tjernlund and George Spelvin * cleaned up code to current version of sparse and added the slicing-by-8 * algorithm to the closely similar existing slicing-by-4 algorithm. * * Oct 15, 2000 Matt Domsch <Matt_Domsch@dell....
Linux kernel'inin 'lib/crc/crc7' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * crc7.c */ #include <linux/crc7.h> #include <linux/export.h> #include <linux/module.h> #include <linux/types.h> /* * Table for CRC-7 (polynomial x^7 + x^3 + 1). * This is a big-endian CRC (msbit is highest power of x), * aligned so the msbit of the byte is t...
Linux kernel'inin 'lib/crc/crc64-main' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Normal 64-bit CRC calculation. * * This is a basic crc64 implementation following ECMA-182 specification, * which can be found from, * https://www.ecma-international.org/publications/standards/Ecma-182.htm * * Dr. Ross N. Williams has a great document to introduce th...
Linux kernel'inin 'lib/crc/crc-ccitt' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/crc-ccitt.h> #include <linux/export.h> #include <linux/module.h> #include <linux/types.h> /* * This mysterious table is just the CRC of each possible byte. It can be * computed using the standard bit-at-a-time methods. The polynomial can * be seen in en...
Linux kernel'inin 'lib/crc/gen_crc32table' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include "../../include/linux/crc32poly.h" #include "../../include/generated/autoconf.h" #include <inttypes.h> static uint32_t crc32table_le[256]; static uint32_t crc32table_be[256]; static uint32_t crc32ctable_le[256]; /** * crc32init_le() - allocate and i...
Linux kernel'inde 'lib/crc/powerpc/crc32c-vpmsum_asm' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Calculate a crc32c with vpmsum acceleration * * Copyright (C) 2015 Anton Blanchard <anton@au.ibm.com>, IBM */ .section .rodata .balign 16 .byteswap_constant: /* byte reverse permute constant */ .octa 0x0F0E0D0C0B0A09080706050403020100 .constants:...
Linux işletim sistemi çekirdeği için 'lib/crc/powerpc/crc-t10dif' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Calculate a CRC T10-DIF with vpmsum acceleration * * Copyright 2017, Daniel Axtens, IBM Corporation. * [based on crc32c-vpmsum_glue.c] */ #include <asm/simd.h> #include <asm/switch_to.h> #include <linux/cpufeature.h> #include <linux/jump_label.h> #include <li...
Linux işletim sistemi çekirdeği için 'lib/crc/powerpc/crc32' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only #include <asm/simd.h> #include <asm/switch_to.h> #include <linux/cpufeature.h> #include <linux/jump_label.h> #include <linux/preempt.h> #include <linux/uaccess.h> #define VMX_ALIGN 16 #define VMX_ALIGN_MASK (VMX_ALIGN-1) #define VECTOR_BREAKPOINT 512 static __ro_after_...
Linux kernel'inde 'lib/crc/powerpc/crc-vpmsum-template' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Core of the accelerated CRC algorithm. * In your file, define the constants and CRC_FUNCTION_NAME * Then include this file. * * Calculate the checksum of data that is 16 byte aligned and a multiple of * 16 bytes. * * The first step is to reduce it...
Linux kernel'inde 'lib/crc/powerpc/crct10dif-vpmsum_asm' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Calculate a CRC T10DIF with vpmsum acceleration * * Constants generated by crc32-vpmsum, available at * https://github.com/antonblanchard/crc32-vpmsum * * crc32-vpmsum is * Copyright (C) 2015 Anton Blanchard <anton@au.ibm.com>, IBM */ .section ....
Linux işletim sistemi çekirdeği için 'lib/crc/s390/crc32-vx' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _CRC32_VX_S390_H #define _CRC32_VX_S390_H #include <linux/types.h> u32 crc32_be_vgfm_16(u32 crc, unsigned char const *buf, size_t size); u32 crc32_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size); u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, s...
Linux kernel'inin 'lib/crc/s390/crc32be-vx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Hardware-accelerated CRC-32 variants for Linux on z Systems * * Use the z/Architecture Vector Extension Facility to accelerate the * computing of CRC-32 checksums. * * This CRC-32 implementation algorithm processes the most-significant * bit first (BE). * * Copy...
Linux kernel'inin 'lib/crc/s390/crc32le-vx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Hardware-accelerated CRC-32 variants for Linux on z Systems * * Use the z/Architecture Vector Extension Facility to accelerate the * computing of bitreflected CRC-32 checksums for IEEE 802.3 Ethernet * and Castagnoli. * * This CRC-32 implementation algorithm is bi...
Linux işletim sistemi çekirdeği için 'lib/crc/s390/crc32' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0 /* * CRC-32 implemented with the z/Architecture Vector Extension Facility. * * Copyright IBM Corp. 2015 * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> */ #include <linux/cpufeature.h> #include <asm/fpu.h> #include "crc32-vx.h" #define VX_MIN_LEN 64 #define...
Linux işletim sistemi çekirdeği için 'lib/crc/loongarch/crc32' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0 /* * CRC32 and CRC32C using LoongArch crc* instructions * * Module based on mips/crypto/crc32-mips.c * * Copyright (C) 2014 Linaro Ltd <yazen.ghannam@linaro.org> * Copyright (C) 2018 MIPS Tech, LLC * Copyright (C) 2020-2023 Loongson Technology Corporation Limited */ #in...
Linux işletim sistemi çekirdeği için 'lib/crc/arm/crc-t10dif' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Accelerated CRC-T10DIF using ARM NEON and Crypto Extensions instructions * * Copyright (C) 2016 Linaro Ltd <ard.biesheuvel@linaro.org> */ #include <asm/simd.h> static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon); static __ro_after_init DEFINE_STATIC_KEY_FAL...
Linux kernel'inde 'lib/crc/arm/crc-t10dif-core' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // // Accelerated CRC-T10DIF using ARM NEON and Crypto Extensions instructions // // Copyright (C) 2016 Linaro Ltd <ard.biesheuvel@linaro.org> // Copyright (C) 2019 Google LLC <ebiggers@google.com> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU Ge...
Linux işletim sistemi çekirdeği için 'lib/crc/arm/crc32' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Accelerated CRC32(C) using ARM CRC, NEON and Crypto Extensions instructions * * Copyright (C) 2016 Linaro Ltd <ard.biesheuvel@linaro.org> */ #include <linux/cpufeature.h> #include <asm/hwcap.h> #include <asm/simd.h> static __ro_after_init DEFINE_STATIC_KEY_FALSE...
Linux kernel'inde 'lib/crc/arm/crc32-core' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* * Accelerated CRC32(C) using ARM CRC, NEON and Crypto Extensions instructions * * Copyright (C) 2016 Linaro Ltd <ard.biesheuvel@linaro.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by th...
Linux kernel'inin 'lib/crc/tests/crc_kunit' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Unit tests and benchmarks for the CRC library functions * * Copyright 2024 Google LLC * * Author: Eric Biggers <ebiggers@google.com> */ #include <kunit/run-in-irq-context.h> #include <kunit/test.h> #include <linux/crc7.h> #include <linux/crc16.h> #include <li...
Linux kernel'inin 'lib/crc/arm64/crc64-neon-inner' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Accelerated CRC64 (NVMe) using ARM NEON C intrinsics */ #include <linux/types.h> #include <asm/neon-intrinsics.h> u64 crc64_nvme_arm64_c(u64 crc, const u8 *p, size_t len); /* x^191 mod G, x^127 mod G */ static const u64 fold_consts_val[2] = { 0xeadc41fd2ba3d420ULL...
Linux işletim sistemi çekirdeği için 'lib/crc/arm64/crc-t10dif' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Accelerated CRC-T10DIF using arm64 NEON and Crypto Extensions instructions * * Copyright (C) 2016 - 2017 Linaro Ltd <ard.biesheuvel@linaro.org> */ #include <linux/cpufeature.h> #include <asm/simd.h> static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_asimd); sta...
Linux işletim sistemi çekirdeği için 'lib/crc/arm64/crc64' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * CRC64 using ARM64 PMULL instructions */ #include <linux/cpufeature.h> #include <asm/simd.h> #include <linux/minmax.h> #include <linux/sizes.h> u64 crc64_nvme_arm64_c(u64 crc, const u8 *p, size_t len); #define crc64_be_arch crc64_be_generic static inline u64 cr...
Linux kernel'inde 'lib/crc/arm64/crc-t10dif-core' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // // Accelerated CRC-T10DIF using arm64 NEON and Crypto Extensions instructions // // Copyright (C) 2016 Linaro Ltd // Copyright (C) 2019-2024 Google LLC // // Authors: Ard Biesheuvel <ardb@google.com> // Eric Biggers <ebiggers@google.com> // // This program is free software; you can redistribute ...
Linux işletim sistemi çekirdeği için 'lib/crc/arm64/crc32' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only #include <asm/alternative.h> #include <asm/cpufeature.h> #include <asm/simd.h> // The minimum input length to consider the 4-way interleaved code path static const size_t min_len = 1024; asmlinkage u32 crc32_le_arm64(u32 crc, unsigned char const *p, size_t len); asmlinka...
Linux kernel'inde 'lib/crc/arm64/crc32-core' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-only */ /* * Accelerated CRC32(C) using AArch64 CRC and PMULL instructions * * Copyright (C) 2016 - 2018 Linaro Ltd. * Copyright (C) 2024 Google LLC * * Author: Ard Biesheuvel <ardb@kernel.org> */ #include <linux/linkage.h> #include <asm/assembler.h> .cpu gener...
Linux kernel'inde 'lib/crc/sparc/crc32c_asm' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0 */ #include <linux/linkage.h> #include <asm/opcodes.h> #include <asm/visasm.h> #include <asm/asi.h> ENTRY(crc32c_sparc64) /* %o0=crc32p, %o1=data_ptr, %o2=len */ VISEntryHalf lda [%o0] ASI_PL, %f1 1: ldd [%o1], %f2 CRC32C(0,2,0) subcc %o2, 8, %o2 bne,pt %icc, 1b ...
Linux işletim sistemi çekirdeği için 'lib/crc/sparc/crc32' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only /* CRC32c (Castagnoli), sparc64 crc32c opcode accelerated * * This is based largely upon arch/x86/crypto/crc32c-intel.c * * Copyright (C) 2008 Intel Corporation * Authors: Austin Zhang <austin_zhang@linux.intel.com> * Kent Liu <kent.liu@intel.com> */ #inclu...
Linux işletim sistemi çekirdeği için 'lib/crc/x86/crc-t10dif' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * CRC-T10DIF using [V]PCLMULQDQ instructions * * Copyright 2024 Google LLC */ #include "crc-pclmul-template.h" static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pclmulqdq); DECLARE_CRC_PCLMUL_FUNCS(crc16_msb, u16); static inline u16 crc_t10dif_arch(u16 crc,...
Linux kernel'inde 'lib/crc/x86/crc64-pclmul' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-or-later */ // Copyright 2025 Google LLC #include "crc-pclmul-template.S" DEFINE_CRC_PCLMUL_FUNCS(crc64_msb, /* bits= */ 64, /* lsb= */ 0) DEFINE_CRC_PCLMUL_FUNCS(crc64_lsb, /* bits= */ 64, /* lsb= */ 1) ```
Linux işletim sistemi çekirdeği için 'lib/crc/x86/crc64' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * CRC64 using [V]PCLMULQDQ instructions * * Copyright 2025 Google LLC */ #include "crc-pclmul-template.h" static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pclmulqdq); DECLARE_CRC_PCLMUL_FUNCS(crc64_msb, u64); DECLARE_CRC_PCLMUL_FUNCS(crc64_lsb, u64); stati...
Linux işletim sistemi çekirdeği için 'lib/crc/x86/crc-pclmul-consts' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * CRC constants generated by: * * ./scripts/gen-crc-consts.py x86_pclmul crc16_msb_0x8bb7,crc32_lsb_0xedb88320,crc32_lsb_0x82f63b78,crc64_msb_0x42f0e1eba9ea3693,crc64_lsb_0x9a6c9329ac4bc9b5 * * Do not edit manually. */ /* * CRC folding constants generated ...
Linux kernel'inde 'lib/crc/x86/crc-pclmul-template' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-or-later */ // // Template to generate [V]PCLMULQDQ-based CRC functions for x86 // // Copyright 2025 Google LLC // // Author: Eric Biggers <ebiggers@google.com> #include <linux/linkage.h> #include <linux/objtool.h> // Offsets within the generated constants table .set OF...
Linux kernel'inde 'lib/crc/x86/crc32-pclmul' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-or-later */ // Copyright 2025 Google LLC #include "crc-pclmul-template.S" DEFINE_CRC_PCLMUL_FUNCS(crc32_lsb, /* bits= */ 32, /* lsb= */ 1) ```
Linux işletim sistemi çekirdeği için 'lib/crc/x86/crc32' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only /* * x86-optimized CRC32 functions * * Copyright (C) 2008 Intel Corporation * Copyright 2012 Xyratex Technology Limited * Copyright 2024 Google LLC */ #include "crc-pclmul-template.h" static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32); static __ro_after_init...
Linux kernel'inde 'lib/crc/x86/crc16-msb-pclmul' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-or-later */ // Copyright 2025 Google LLC #include "crc-pclmul-template.S" DEFINE_CRC_PCLMUL_FUNCS(crc16_msb, /* bits= */ 16, /* lsb= */ 0) ```
Linux kernel'inde 'lib/crc/x86/crc32c-3way' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* * Implement fast CRC32C with PCLMULQDQ instructions. (x86_64) * * The white papers on CRC32C calculations with PCLMULQDQ instruction can be * downloaded from: * http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/crc-iscsi-polynomial-crc32-instruction-paper.pdf * http://www.int...
Linux işletim sistemi çekirdeği için 'lib/crc/x86/crc-pclmul-template' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Macros for accessing the [V]PCLMULQDQ-based CRC functions that are * instantiated by crc-pclmul-template.S * * Copyright 2025 Google LLC * * Author: Eric Biggers <ebiggers@google.com> */ #ifndef _CRC_PCLMUL_TEMPLATE_H #define _CRC_PCLMUL_TEMPLATE_H #incl...
Linux işletim sistemi çekirdeği için 'lib/crc/riscv/crc-clmul-template' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-or-later */ /* Copyright 2025 Google LLC */ /* * This file is a "template" that generates a CRC function optimized using the * RISC-V Zbc (scalar carryless multiplication) extension. The includer of this * file must define the following parameters to specify the type of CRC...
Linux kernel'inin 'lib/crc/riscv/crc64_lsb' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * RISC-V optimized least-significant-bit-first CRC64 * * Copyright 2025 Google LLC */ #include "crc-clmul.h" typedef u64 crc_t; #define LSB_CRC 1 #include "crc-clmul-template.h" u64 crc64_lsb_clmul(u64 crc, const void *p, size_t len, const struct crc_clm...
Linux kernel'inin 'lib/crc/riscv/crc32_msb' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * RISC-V optimized most-significant-bit-first CRC32 * * Copyright 2025 Google LLC */ #include "crc-clmul.h" typedef u32 crc_t; #define LSB_CRC 0 #include "crc-clmul-template.h" u32 crc32_msb_clmul(u32 crc, const void *p, size_t len, const struct crc_clmu...
Linux işletim sistemi çekirdeği için 'lib/crc/riscv/crc-t10dif' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * RISC-V optimized CRC-T10DIF function * * Copyright 2025 Google LLC */ #include <asm/hwcap.h> #include <asm/alternative-macros.h> #include "crc-clmul.h" static inline u16 crc_t10dif_arch(u16 crc, const u8 *p, size_t len) { if (riscv_has_extension_likely(RISC...
Linux kernel'inin 'lib/crc/riscv/crc16_msb' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * RISC-V optimized most-significant-bit-first CRC16 * * Copyright 2025 Google LLC */ #include "crc-clmul.h" typedef u16 crc_t; #define LSB_CRC 0 #include "crc-clmul-template.h" u16 crc16_msb_clmul(u16 crc, const void *p, size_t len, const struct crc_clmu...
Linux işletim sistemi çekirdeği için 'lib/crc/riscv/crc64' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * RISC-V optimized CRC64 functions * * Copyright 2025 Google LLC */ #include <asm/hwcap.h> #include <asm/alternative-macros.h> #include "crc-clmul.h" static inline u64 crc64_be_arch(u64 crc, const u8 *p, size_t len) { if (riscv_has_extension_likely(RISCV_ISA_...
Linux işletim sistemi çekirdeği için 'lib/crc/riscv/crc-clmul' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-or-later */ /* Copyright 2025 Google LLC */ #ifndef _RISCV_CRC_CLMUL_H #define _RISCV_CRC_CLMUL_H #include <linux/types.h> #include "crc-clmul-consts.h" u16 crc16_msb_clmul(u16 crc, const void *p, size_t len, const struct crc_clmul_consts *consts); u32 crc32_msb_clmul(u...
Linux işletim sistemi çekirdeği için 'lib/crc/riscv/crc-clmul-consts' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * CRC constants generated by: * * ./scripts/gen-crc-consts.py riscv_clmul crc16_msb_0x8bb7,crc32_msb_0x04c11db7,crc32_lsb_0xedb88320,crc32_lsb_0x82f63b78,crc64_msb_0x42f0e1eba9ea3693,crc64_lsb_0x9a6c9329ac4bc9b5 * * Do not edit manually. */ struct crc_clmul...
Linux kernel'inin 'lib/crc/riscv/crc64_msb' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * RISC-V optimized most-significant-bit-first CRC64 * * Copyright 2025 Google LLC */ #include "crc-clmul.h" typedef u64 crc_t; #define LSB_CRC 0 #include "crc-clmul-template.h" u64 crc64_msb_clmul(u64 crc, const void *p, size_t len, const struct crc_clmu...
Linux kernel'inin 'lib/crc/riscv/crc32_lsb' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * RISC-V optimized least-significant-bit-first CRC32 * * Copyright 2025 Google LLC */ #include "crc-clmul.h" typedef u32 crc_t; #define LSB_CRC 1 #include "crc-clmul-template.h" u32 crc32_lsb_clmul(u32 crc, const void *p, size_t len, const struct crc_clm...
Linux işletim sistemi çekirdeği için 'lib/crc/riscv/crc32' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * RISC-V optimized CRC32 functions * * Copyright 2025 Google LLC */ #include <asm/hwcap.h> #include <asm/alternative-macros.h> #include "crc-clmul.h" static inline u32 crc32_le_arch(u32 crc, const u8 *p, size_t len) { if (riscv_has_extension_likely(RISCV_ISA_...
Linux işletim sistemi çekirdeği için 'lib/crc/mips/crc32' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0 /* * crc32-mips.c - CRC32 and CRC32C using optional MIPSr6 instructions * * Module based on arm64/crypto/crc32-arm.c * * Copyright (C) 2014 Linaro Ltd <yazen.ghannam@linaro.org> * Copyright (C) 2018 MIPS Tech, LLC */ #include <linux/cpufeature.h> #include <asm/mipsregs.h...