instruction
stringlengths
82
202
input
stringclasses
1 value
output
stringlengths
73
23.9M
Linux kernel'inin 'lib/extable' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Derived from arch/ppc/mm/extable.c and arch/i386/mm/extable.c. * * Copyright (C) 2004 Paul Mackerras, IBM Corp. */ #include <linux/bsearch.h> #include <linux/module.h> #include <linux/init.h> #include <linux/sort.h> #include <linux/uaccess.h> #include <linux/e...
Linux kernel'inin 'lib/stackdepot' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Stack depot - a stack trace storage that avoids duplication. * * Internally, stack depot maintains a hash table of unique stacktraces. The * stack traces themselves are stored contiguously one after another in a set * of separate page allocations. * * Author: Al...
Linux kernel'inin 'lib/decompress_unlzma' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* Lzma decompressor for Linux kernel. Shamelessly snarfed *from busybox 1.1.1 * *Linux kernel adaptation *Copyright (C) 2006 Alain < alain@knaff.lu > * *Based on small lzma deflate implementation/Small range coder *implementation for lzma. *Copyright (C) 2006 Aurelien Jacobs < aurel@gnuage.org > * *Ba...
Linux kernel'inin 'lib/memcat_p' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/slab.h> /* * Merge two NULL-terminated pointer arrays into a newly allocated * array, which is also NULL-terminated. Nomenclature is inspired by * memset_p() and memcat() found elsewhere in the kernel source tree. */ void **__memcat_p(void **a, void **b) { ...
Linux kernel'inin 'lib/check_signature' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/io.h> #include <linux/export.h> /** * check_signature - find BIOS signatures * @io_addr: mmio address to check * @signature: signature block * @length: length of signature * * Perform a signature comparison with the mmio address io_addr. This * address ...
Linux işletim sistemi çekirdeği için 'lib/locking-selftest-softirq' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #undef IRQ_DISABLE #undef IRQ_ENABLE #undef IRQ_ENTER #undef IRQ_EXIT #define IRQ_DISABLE SOFTIRQ_DISABLE #define IRQ_ENABLE SOFTIRQ_ENABLE #define IRQ_ENTER SOFTIRQ_ENTER #define IRQ_EXIT SOFTIRQ_EXIT ```
Linux kernel'inin 'lib/clz_tab' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 const unsigned char __clz_tab[] = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,...
Linux kernel'inin 'lib/test_ubsan' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> typedef void(*test_ubsan_fp)(void); #define UBSAN_TEST(config, ...) do { \ pr_info("%s " __VA_ARGS__ "%s(%s=%s)\n", __func__, \ sizeof(" " __VA_ARGS__) > 2 ? " " : "", \ #config, IS_ENABLE...
Linux kernel'inin 'lib/bug' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Generic support for BUG() This respects the following config options: CONFIG_BUG - emit BUG traps. Nothing happens without this. CONFIG_GENERIC_BUG - enable this code. CONFIG_GENERIC_BUG_RELATIVE_POINTERS - use 32-bit relative pointers for bug_addr and file CON...
Linux kernel'inin 'lib/sg_split' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2015 Robert Jarzmik <robert.jarzmik@free.fr> * * Scatterlist splitting helpers. */ #include <linux/scatterlist.h> #include <linux/slab.h> struct sg_splitter { struct scatterlist *in_sg0; int nents; off_t skip_sg0; unsigned int length_last_sg; ...
Linux kernel'inin 'lib/find_bit' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* bit search implementation * * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * Copyright (C) 2008 IBM Corporation * 'find_last_bit' is written by Rusty Russell <rusty@rustcorp.com.au> * (Inspired by Dav...
Linux kernel'inin 'lib/trace_readwrite' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Register read and write tracepoints * * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/ftrace.h> #include <linux/module.h> #include <linux/io.h> #define CREATE_TRACE_POINTS #include <trace/events/rwmmio.h> #ifdef...
Linux kernel'inin 'lib/iommu-helper' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * IOMMU helper functions for the free area management */ #include <linux/bitmap.h> #include <linux/iommu-helper.h> unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, unsigned long start, unsigned int nr, unsigned long shift, unsigne...
Linux kernel'inin 'lib/devmem_is_allowed' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * A generic version of devmem_is_allowed. * * Based on arch/arm64/mm/mmap.c * * Copyright (C) 2020 Google, Inc. * Copyright (C) 2012 ARM Ltd. */ #include <linux/mm.h> #include <linux/ioport.h> #include <linux/io.h> /* * devmem_is_allowed() checks to see if /dev...
Linux kernel'inin 'lib/debugobjects' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Generic infrastructure for lifetime debugging of objects. * * Copyright (C) 2008, Linutronix GmbH, Thomas Gleixner <tglx@kernel.org> */ #define pr_fmt(fmt) "ODEBUG: " fmt #include <linux/cpu.h> #include <linux/debugobjects.h> #include <linux/debugfs.h> #include <linux...
Linux kernel'inin 'lib/packing' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /* Copyright 2016-2018 NXP * Copyright (c) 2018-2019, Vladimir Oltean <olteanv@gmail.com> */ #include <linux/packing.h> #include <linux/module.h> #include <linux/bitops.h> #include <linux/bits.h> #include <linux/errno.h> #include <linux/types.h> #include <linux...
Linux kernel'inin 'lib/textsearch' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * lib/textsearch.c Generic text search interface * * Authors: Thomas Graf <tgraf@suug.ch> * Pablo Neira Ayuso <pablo@netfilter.org> * * ========================================================================== */ /** * DOC: ts_intro * INTRODUCTION * * ...
Linux kernel'inin 'lib/test_bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Testsuite for BPF interpreter and BPF JIT compiler * * Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/init.h> #include <linux/module.h> #include <linux/filter.h> #include <linux/bpf.h> #include...
Linux kernel'inin 'lib/stmp_device' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 1999 ARM Limited * Copyright (C) 2000 Deep Blue Solutions Ltd * Copyright 2006-2007,2010 Freescale Semiconductor, Inc. All Rights Reserved. * Copyright 2008 Juergen Beisert, kernel@pengutronix.de * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, ...
Linux kernel'inin 'lib/fw_table' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * fw_tables.c - Parsing support for ACPI and ACPI-like tables provided by * platform or device firmware * * Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> * Copyright (C) 2023 Intel Corp. */ #include <linux/errno.h> #includ...
Linux kernel'inin 'lib/union_find' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/union_find.h> /** * uf_find - Find the root of a node and perform path compression * @node: the node to find the root of * * This function returns the root of the node by following the parent * pointers. It also performs path compression, making the tree sh...
Linux kernel'inin 'lib/bitrev' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #ifndef CONFIG_HAVE_ARCH_BITREVERSE #include <linux/types.h> #include <linux/module.h> #include <linux/bitrev.h> MODULE_AUTHOR("Akinobu Mita <akinobu.mita@gmail.com>"); MODULE_DESCRIPTION("Bit ordering reversal functions"); MODULE_LICENSE("GPL"); const u8 byte_rev_table[2...
Linux işletim sistemi çekirdeği için 'lib/radix-tree' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0+ /* radix-tree helpers that are only shared with xarray */ struct kmem_cache; struct rcu_head; extern struct kmem_cache *radix_tree_node_cachep; extern void radix_tree_node_rcu_free(struct rcu_head *head); ```
Linux kernel'inin 'lib/klist' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * klist.c - Routines for manipulating klists. * * Copyright (C) 2005 Patrick Mochel * * This klist interface provides a couple of structures that wrap around * struct list_head to provide explicit list "head" (struct klist) and list * "node" (struct klist_node) ob...
Linux kernel'inin 'lib/bitmap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * lib/bitmap.c * Helper functions for bitmap.h. */ #include <linux/bitmap.h> #include <linux/bitops.h> #include <linux/ctype.h> #include <linux/device.h> #include <linux/export.h> #include <linux/slab.h> /** * DOC: bitmap introduction * * bitmaps provide an array...
Linux kernel'inin 'lib/compat_audit' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/init.h> #include <linux/types.h> #include <linux/audit_arch.h> #include <asm/unistd32.h> unsigned compat_dir_class[] = { #include <asm-generic/audit_dir_write.h> ~0U }; unsigned compat_read_class[] = { #include <asm-generic/audit_read.h> ~0U }; unsigned compat...
Linux kernel'inin 'lib/list_debug' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright 2006, Red Hat, Inc., Dave Jones * Released under the General Public License (GPL). * * This file contains the linked list validation and error reporting for * LIST_HARDENED and DEBUG_LIST. */ #include <linux/export.h> #include <linux/list.h> #include <linux/bug.h> #include <linux/kernel.h> #i...
Linux kernel'inin 'lib/interval_tree' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/interval_tree.h> #include <linux/interval_tree_generic.h> #include <linux/compiler.h> #include <linux/export.h> #define START(node) ((node)->start) #define LAST(node) ((node)->last) INTERVAL_TREE_DEFINE(struct interval_tree_node, rb, unsigned long,...
Linux kernel'inin 'lib/hexdump' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * lib/hexdump.c */ #include <linux/types.h> #include <linux/ctype.h> #include <linux/errno.h> #include <linux/hex.h> #include <linux/kernel.h> #include <linux/minmax.h> #include <linux/export.h> #include <linux/unaligned.h> const char hex_asc[] = "0123456789abcdef"; ...
Linux kernel'inin 'lib/test_bitops' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2020 Intel Corporation */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/cleanup.h> #include <linux/init.h> #include <linux/module.h> #include <linux/printk.h> #include <linux/slab.h> /* a tiny module only meant to test * * set/clear...
Linux kernel'inin 'lib/decompress' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * decompress.c * * Detect the decompression method based on magic number */ #include <linux/decompress/generic.h> #include <linux/decompress/bunzip2.h> #include <linux/decompress/unlzma.h> #include <linux/decompress/unxz.h> #include <linux/decompress/inflate.h> #include...
Linux kernel'inin 'lib/test_parman' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * lib/test_parman.c - Test module for parman * Copyright (c) 2017 Mellanox Technologies. All rights reserved. * Copyright (c) 2017 Jiri Pirko <jiri@mellanox.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are ...
Linux kernel'inin 'lib/test_sysctl' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later OR copyleft-next-0.3.1 /* * proc sysctl test driver * * Copyright (C) 2017 Luis R. Rodriguez <mcgrof@kernel.org> */ /* * This module provides an interface to the proc sysctl interfaces. This * driver requires CONFIG_PROC_SYSCTL. It will not normally be loaded by...
Linux işletim sistemi çekirdeği için 'lib/dhry' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ /* **************************************************************************** * * "DHRYSTONE" Benchmark Program * ----------------------------- * * Version: C, Version 2.1 * * File: dhry.h (part 1...
Linux kernel'inin 'lib/test_fpu_glue' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0+ /* * Test cases for using floating point operations inside a kernel module. * * This tests kernel_fpu_begin() and kernel_fpu_end() functions, especially * when userland has modified the floating point control registers. The kernel * state might depend on the state set by t...
Linux kernel'inin 'lib/kasprintf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * linux/lib/kasprintf.c * * Copyright (C) 1991, 1992 Linus Torvalds */ #include <linux/stdarg.h> #include <linux/export.h> #include <linux/slab.h> #include <linux/types.h> #include <linux/string.h> /* Simplified asprintf. */ char *kvasprintf(gfp_t gfp, const char *fm...
Linux kernel'inin 'lib/buildid' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/buildid.h> #include <linux/cache.h> #include <linux/elf.h> #include <linux/kernel.h> #include <linux/pagemap.h> #include <linux/fs.h> #include <linux/secretmem.h> #define BUILD_ID 3 #define MAX_PHDR_CNT 256 void freader_init_from_file(struct freader *r, void ...
Linux kernel'inin 'lib/memweight' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/export.h> #include <linux/bug.h> #include <linux/bitmap.h> /** * memweight - count the total number of bits set in memory area * @ptr: pointer to the start of the area * @bytes: the size of the area */ size_t memweight(const void *ptr, size_t bytes) { size_...
Linux kernel'inin 'lib/ucmpdi2' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* */ #include <linux/module.h> #include <linux/libgcc.h> word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b) { const DWunion au = {.ll = a}; const DWunion bu = {.ll = b}; if ((unsigned int) au.s.high < (unsigned int) bu.s.high) return 0; e...
Linux kernel'inin 'lib/dump_stack' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Provide a default dump_stack() function for architectures * which don't implement their own. */ #include <linux/kernel.h> #include <linux/buildid.h> #include <linux/export.h> #include <linux/sched.h> #include <linux/sched/debug.h> #include <linux/smp.h> #include <linux/...
Linux kernel'inin 'lib/cmpxchg-emu' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0+ /* * Emulated 1-byte cmpxchg operation for architectures lacking direct * support for this size. This is implemented in terms of 4-byte cmpxchg * operations. * * Copyright (C) 2024 Paul E. McKenney. */ #include <linux/types.h> #include <linux/export.h> #include <linux/i...
Linux kernel'inin 'lib/test_free_pages' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0+ /* * test_free_pages.c: Check that free_pages() doesn't leak memory * Copyright (c) 2020 Oracle * Author: Matthew Wilcox <willy@infradead.org> */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/gfp.h> #include <linux/mm.h> #include <linux/module.h> static voi...
Linux kernel'inin 'lib/lwq' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Light-weight single-linked queue. * * Entries are enqueued to the head of an llist, with no blocking. * This can happen in any context. * * Entries are dequeued using a spinlock to protect against multiple * access. The llist is staged in reverse order, and ref...
Linux kernel'inin 'lib/closure' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Asynchronous refcounty things * * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com> * Copyright 2012 Google, Inc. */ #include <linux/closure.h> #include <linux/debugfs.h> #include <linux/export.h> #include <linux/rcupdate.h> #include <linux/seq_file.h> ...
Linux kernel'inin 'lib/atomic64_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Testsuite for atomic64_t functions * * Copyright © 2010 Luca Barbieri */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/init.h> #include <linux/bug.h> #include <linux/kernel.h> #include <linux/atomic.h> #include <linux/module.h> #ifdef CONFIG_X...
Linux kernel'inin 'lib/idr' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/bitmap.h> #include <linux/bug.h> #include <linux/export.h> #include <linux/idr.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/xarray.h> /** * idr_alloc_u32() - Allocate an ID. * @idr: IDR handle. * @ptr: Pointer to be associated w...
Linux kernel'inin 'lib/interval_tree_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/interval_tree.h> #include <linux/prandom.h> #include <linux/slab.h> #include <asm/timex.h> #include <linux/bitmap.h> #include <linux/maple_tree.h> #define __param(type, name, init, msg) \ static typ...
Linux kernel'inin 'lib/flex_proportions' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Floating proportions with flexible aging period * * Copyright (C) 2011, SUSE, Jan Kara <jack@suse.cz> * * The goal of this code is: Given different types of event, measure proportion * of each type of event over time. The proportions are measured with * exponentia...
Linux kernel'inin 'lib/iomem_copy' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2024 Kalray, Inc. All Rights Reserved. */ #include <linux/align.h> #include <linux/export.h> #include <linux/io.h> #include <linux/types.h> #include <linux/unaligned.h> #ifndef memset_io /** * memset_io() - Set a range of I/O memory to a constant value ...
Linux kernel'inin 'lib/kobject' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * kobject.c - library routines for handling generic kernel objects * * Copyright (c) 2002-2003 Patrick Mochel <mochel@osdl.org> * Copyright (c) 2006-2007 Greg Kroah-Hartman <greg@kroah.com> * Copyright (c) 2006-2007 Novell Inc. * * Please see the file Documentation/cor...
Linux kernel'inin 'lib/test_static_keys' 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 old_tru...
Linux kernel'inin 'lib/linear_ranges' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * helpers to map values in a linear range to range index * * Original idea borrowed from regulator framework * * It might be useful if we could support also inversely proportional ranges? * Copyright 2020 ROHM Semiconductors */ #include <linux/errno.h> #include <linux...
Linux kernel'inin 'lib/percpu-refcount' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #define pr_fmt(fmt) "%s: " fmt, __func__ #include <linux/kernel.h> #include <linux/sched.h> #include <linux/wait.h> #include <linux/slab.h> #include <linux/mm.h> #include <linux/percpu-refcount.h> /* * Initially, a percpu refcount is just a set of percpu counters. Initia...
Linux kernel'inin 'lib/sbitmap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2016 Facebook * Copyright (C) 2013-2014 Jens Axboe */ #include <linux/sched.h> #include <linux/random.h> #include <linux/sbitmap.h> #include <linux/seq_file.h> static int init_alloc_hint(struct sbitmap *sb, gfp_t flags) { unsigned depth = sb->depth;...
Linux kernel'inin 'lib/group_cpus' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2016 Thomas Gleixner. * Copyright (C) 2016-2017 Christoph Hellwig. */ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/cpu.h> #include <linux/sort.h> #include <linux/group_cpus.h> #ifdef CONFIG_SMP static void grp_spread_init_one(struct c...
Linux kernel'inin 'lib/fault-inject' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/kernel.h> #include <linux/init.h> #include <linux/prandom.h> #include <linux/debugfs.h> #include <linux/sched.h> #include <linux/stat.h> #include <linux/types.h> #include <linux/fs.h> #include <linux/export.h> #include <linux/interrupt.h> #include <linux/sta...
Linux kernel'inin 'lib/memory-notifier-error-inject' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/kernel.h> #include <linux/module.h> #include <linux/memory.h> #include "notifier-error-inject.h" static int priority; module_param(priority, int, 0); MODULE_PARM_DESC(priority, "specify memory notifier priority"); static struct notifier_err_inject memory_...
Linux kernel'inin 'lib/rhashtable' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Resizable, Scalable, Concurrent Hash Table * * Copyright (c) 2015 Herbert Xu <herbert@gondor.apana.org.au> * Copyright (c) 2014-2015 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2008-2014 Patrick McHardy <kaber@trash.net> * * Code partially derived from nft_hash ...
Linux kernel'inin 'lib/decompress_unlzo' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * LZO decompressor for the Linux kernel. Code borrowed from the lzo * implementation by Markus Franz Xaver Johannes Oberhumer. * * Linux kernel adaptation: * Copyright (C) 2009 * Albin Tonnerre, Free Electrons <albin.tonnerre@free-electrons.com> * * Original ...
Linux kernel'inin 'lib/of-reconfig-notifier-error-inject' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> #include "notifier-error-inject.h" static int priority; module_param(priority, int, 0); MODULE_PARM_DESC(priority, "specify OF reconfig notifier priority"); static struct notifier_err_inject reconf...
Linux kernel'inin 'lib/irq_regs' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* saved per-CPU IRQ register pointer * * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) */ #include <linux/export.h> #include <linux/percpu.h> #include <asm/irq_regs.h> #ifndef ARCH_HAS_OWN_IRQ_REGS DEFINE_PE...
Linux kernel'inin 'lib/scatterlist' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com> * * Scatterlist handling helpers. */ #include <linux/export.h> #include <linux/slab.h> #include <linux/scatterlist.h> #include <linux/highmem.h> #include <linux/kmemleak.h> #include <linux/bvec.h> #include <linu...
Linux kernel'inin 'lib/test-kstrtox' alt sistemi için gerekli C kaynak kodunu implemente et.
```c #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> #define for_each_test(i, test) \ for (i = 0; i < ARRAY_SIZE(test); i++) struct test_fail { const char *str; unsigned int base; }; #define DEFINE_TEST_FAIL(test) \ const struct test_fail test[] __initconst #define DECLARE_TEST_OK(ty...
Linux kernel'inin 'lib/xxhash' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * xxHash - Extremely Fast Hash algorithm * Copyright (C) 2012-2016, Yann Collet. * * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are *...
Linux kernel'inin 'lib/win_minmax' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * lib/minmax.c: windowed min/max tracker * * Kathleen Nichols' algorithm for tracking the minimum (or maximum) * value of a data stream over some fixed time interval. (E.g., * the minimum RTT over the past five minutes.) It uses constant * space and constant time per u...
Linux kernel'inin 'lib/min_heap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/export.h> #include <linux/min_heap.h> void __min_heap_init(min_heap_char *heap, void *data, size_t size) { __min_heap_init_inline(heap, data, size); } EXPORT_SYMBOL(__min_heap_init); void *__min_heap_peek(struct min_heap_char *heap) { return __min_heap_peek_i...
Linux kernel'inin 'lib/clz_ctz' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * lib/clz_ctz.c * * Copyright (C) 2013 Chanho Min <chanho.min@lge.com> * * The functions in this file aren't called directly, but are required by * GCC builtins such as __builtin_ctz, and therefore they can't be removed * despite appearing unreferenced in kernel s...
Linux kernel'inin 'lib/string_helpers' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Helpers for formatting and printing strings * * Copyright 31 August 2008 James Bottomley * Copyright (C) 2013, Intel Corporation */ #include <linux/bug.h> #include <linux/kernel.h> #include <linux/math64.h> #include <linux/export.h> #include <linux/ctype.h> #inclu...
Linux kernel'inin 'lib/bitmap-str' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/bitmap.h> #include <linux/ctype.h> #include <linux/errno.h> #include <linux/err.h> #include <linux/export.h> #include <linux/hex.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/string.h> #include "kstrtox.h" /** * bitmap_parse_user - c...
Linux kernel'inin 'lib/cpu_rmap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * cpu_rmap.c: CPU affinity reverse-map support * Copyright 2011 Solarflare Communications Inc. */ #include <linux/cpu_rmap.h> #include <linux/interrupt.h> #include <linux/export.h> /* * These functions maintain a mapping from CPUs to some ordered set of * objects ...
Linux kernel'inin 'lib/test_module' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * This module emits "Hello, world" on printk when loaded. * * It is designed to be used for basic evaluation of the module loading * subsystem (for example when validating module signing/verification). It * lacks any extra dependencies, and will not normally be load...
Linux kernel'inin 'lib/ts_bm' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * lib/ts_bm.c Boyer-Moore text search implementation * * Authors: Pablo Neira Ayuso <pablo@eurodev.net> * * ========================================================================== * * Implements Boyer-Moore string matching algorithm: * * [1] A Fast ...
Linux kernel'inin 'lib/codetag' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/codetag.h> #include <linux/idr.h> #include <linux/kallsyms.h> #include <linux/module.h> #include <linux/seq_buf.h> #include <linux/slab.h> #include <linux/vmalloc.h> struct codetag_type { struct list_head link; unsigned int count; struct idr mod_idr; /*...
Linux kernel'inin 'lib/errseq' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/err.h> #include <linux/bug.h> #include <linux/atomic.h> #include <linux/errseq.h> #include <linux/log2.h> /* * An errseq_t is a way of recording errors in one place, and allowing any * number of "subscribers" to tell whether it has changed since a previous * ...
Linux kernel'inin 'lib/ts_fsm' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * lib/ts_fsm.c A naive finite state machine text search approach * * Authors: Thomas Graf <tgraf@suug.ch> * * ========================================================================== * * A finite state machine consists of n states (struct ts_fsm_token) ...
Linux kernel'inin 'lib/hweight' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/export.h> #include <linux/bitops.h> #include <asm/types.h> /** * DOC: __sw_hweightN - returns the hamming weight of a N-bit word * @w: the word to weigh * * The Hamming Weight of a number is the total number of bits set in it. */ unsigned int __sw_hweight3...
Linux kernel'inin 'lib/sg_pool' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/init.h> #include <linux/scatterlist.h> #include <linux/mempool.h> #include <linux/slab.h> #define SG_MEMPOOL_NR ARRAY_SIZE(sg_pools) #define SG_MEMPOOL_SIZE 2 struct sg_pool { size_t size; char *name; struct kmem_cache *slab; mempool_t *pool; }; #...
Linux kernel'inin 'lib/ratelimit' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * ratelimit.c - Do something with rate limit. * * Isolated from kernel/printk.c by Dave Young <hidave.darkstar@gmail.com> * * 2008-05-01 rewrite the function and use a ratelimit_state data struct as * parameter. Now every user can use their own standalone ratelimit...
Linux kernel'inin 'lib/test_debug_virtual' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/kernel.h> #include <linux/module.h> #include <linux/export.h> #include <linux/mm.h> #include <linux/vmalloc.h> #include <linux/slab.h> #include <linux/sizes.h> #include <linux/io.h> #include <asm/page.h> #ifdef CONFIG_MIPS #include <asm/bootinfo.h> #endif ...
Linux kernel'inin 'lib/dhry_1' 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_1.c (part 2 ...
Linux kernel'inin 'lib/bucket_locks' alt sistemi için gerekli C kaynak kodunu implemente et.
```c #include <linux/export.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/slab.h> #include <linux/vmalloc.h> /* Allocate an array of spinlocks to be accessed by a hash. Two arguments * indicate the number of elements to allocate in the array. max_size * gives the maximum number of elements to al...
Linux kernel'inin 'lib/siphash' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) /* Copyright (C) 2016-2022 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. * * SipHash: a fast short-input PRF * https://131002.net/siphash/ * * This implementation is specifically for SipHash2-4 for a secure PRF * and HalfSipHash1-3/SipHa...
Linux kernel'inin 'lib/bsearch' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * A generic implementation of binary search for the Linux kernel * * Copyright (C) 2008-2009 Ksplice, Inc. * Author: Tim Abbott <tabbott@ksplice.com> */ #include <linux/export.h> #include <linux/bsearch.h> #include <linux/kprobes.h> /* * bsearch - binary search a...
Linux kernel'inin 'lib/debug_info' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * This file exists solely to ensure debug information for some core * data structures is included in the final image even for * CONFIG_DEBUG_INFO_REDUCED. Please do not add actual code. However, * adding appropriate #includes is fine. */ #include <linux/cred.h> #include ...
Linux kernel'inin 'lib/asn1_encoder' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Simple encoder primitives for ASN.1 BER/DER/CER * * Copyright (C) 2019 James.Bottomley@HansenPartnership.com */ #include <linux/asn1_encoder.h> #include <linux/bug.h> #include <linux/string.h> #include <linux/module.h> /** * asn1_encode_integer() - encode positi...
Linux kernel'inin 'lib/argv_split' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Helper function for splitting a string into an argv-like array. */ #include <linux/kernel.h> #include <linux/ctype.h> #include <linux/string.h> #include <linux/slab.h> #include <linux/export.h> static int count_argc(const char *str) { int count = 0; bool was_space; ...
Linux kernel'inin 'lib/rbtree' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* Red Black Trees (C) 1999 Andrea Arcangeli <andrea@suse.de> (C) 2002 David Woodhouse <dwmw2@infradead.org> (C) 2012 Michel Lespinasse <walken@google.com> linux/lib/rbtree.c */ #include <linux/rbtree_augmented.h> #include <linux/export.h> /* * red-bla...
Linux kernel'inin 'lib/btree' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * lib/btree.c - Simple In-memory B+Tree * * Copyright (c) 2007-2008 Joern Engel <joern@purestorage.com> * Bits and pieces stolen from Peter Zijlstra's code, which is * Copyright 2007, Red Hat Inc. Peter Zijlstra * * see http://programming.kicks-ass.net/kernel-patc...
Linux kernel'inin 'lib/dynamic_debug' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * lib/dynamic_debug.c * * make pr_debug()/dev_dbg() calls runtime configurable based upon their * source module. * * Copyright (C) 2008 Jason Baron <jbaron@redhat.com> * By Greg Banks <gnb@melbourne.sgi.com> * Copyright (c) 2008 Silicon Graphics Inc. All Rights Reserved. * Copyright (C) 2011 Bart Van ...
Linux kernel'inin 'lib/alloc_tag' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/alloc_tag.h> #include <linux/execmem.h> #include <linux/fs.h> #include <linux/gfp.h> #include <linux/kallsyms.h> #include <linux/module.h> #include <linux/page_ext.h> #include <linux/pgalloc_tag.h> #include <linux/proc_fs.h> #include <linux/rcupdate.h> #incl...
Linux kernel'inin 'lib/sort' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * A fast, small, non-recursive O(n log n) sort for the Linux kernel * * This performs n*log2(n) + 0.37*n + o(n) comparisons on average, * and 1.5*n*log2(n) + O(n) in the (very contrived) worst case. * * Quicksort manages n*log2(n) - 1.26*n for random inputs (1.63*n * b...
Linux kernel'inin 'lib/generic-radix-tree' alt sistemi için gerekli C kaynak kodunu implemente et.
```c #include <linux/atomic.h> #include <linux/export.h> #include <linux/generic-radix-tree.h> #include <linux/gfp.h> #include <linux/kmemleak.h> /* * Returns pointer to the specified byte @offset within @radix, or NULL if not * allocated */ void *__genradix_ptr(struct __genradix *radix, size_t offset) { return _...
Linux kernel'inin 'lib/atomic64' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Generic implementation of 64-bit atomics using spinlocks, * useful on processors that don't have 64-bit atomic instructions. * * Copyright © 2009 Paul Mackerras, IBM Corp. <paulus@au1.ibm.com> */ #include <linux/types.h> #include <linux/cache.h> #include <linu...
Linux kernel'inin 'lib/test_xarray' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0+ /* * test_xarray.c: Test the XArray API * Copyright (c) 2017-2018 Microsoft Corporation * Copyright (c) 2019-2020 Oracle * Author: Matthew Wilcox <willy@infradead.org> */ #include <linux/xarray.h> #include <linux/module.h> static unsigned int tests_run; static unsigned i...
Linux kernel'inin 'lib/timerqueue' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Generic Timer-queue * * Manages a simple queue of timers, ordered by expiration time. * Uses rbtrees for quick list adds and expiration. * * NOTE: All of the following functions need to be serialized * to avoid races. No locking is done by this library ...
Linux kernel'inin 'lib/smp_processor_id' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * lib/smp_processor_id.c * * DEBUG_PREEMPT variant of smp_processor_id(). */ #include <linux/export.h> #include <linux/kprobes.h> #include <linux/sched.h> noinstr static unsigned int check_preemption_disabled(const char *what1, const char *what2) { int this_cpu = raw_sm...
Linux kernel'inin 'lib/kfifo' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * A generic kernel FIFO implementation * * Copyright (C) 2009/2010 Stefani Seibold <stefani@seibold.net> */ #include <linux/dma-mapping.h> #include <linux/err.h> #include <linux/export.h> #include <linux/kfifo.h> #include <linux/log2.h> #include <linux/scatterli...
Linux kernel'inin 'lib/net_utils' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/string.h> #include <linux/if_ether.h> #include <linux/ctype.h> #include <linux/export.h> #include <linux/hex.h> bool mac_pton(const char *s, u8 *mac) { int i; if (strnlen(s, MAC_ADDR_STR_LEN) < MAC_ADDR_STR_LEN) return false; /* Don't dirty result unless ...
Linux kernel'inin 'lib/test_rhashtable' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Resizable, Scalable, Concurrent Hash Table * * Copyright (c) 2014-2015 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2008-2014 Patrick McHardy <kaber@trash.net> */ /************************************************************************** * Self Test ***********...
Linux kernel'inin 'lib/test_kho' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Test module for KHO * Copyright (c) 2025 Microsoft Corporation. * * Authors: * Saurabh Sengar <ssengar@microsoft.com> * Mike Rapoport <rppt@kernel.org> */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/mm.h> #include <linux/gfp.h> #include...