instruction
stringlengths
82
202
input
stringclasses
1 value
output
stringlengths
73
23.9M
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/icmps-discard' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Selftest that verifies that incomping ICMPs are ignored, * the TCP connection stays alive, no hard or soft errors get reported * to the usespace and the counter for ignored ICMPs is updated. * * RFC5925, 7.8: * >> A TCP-AO implementation MUST default to ignore incomin...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/setsockopt-closed' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Author: Dmitry Safonov <dima@arista.com> */ #include <inttypes.h> #include "../../../../include/linux/kernel.h" #include "aolib.h" static union tcp_addr tcp_md5_client; #define FILTER_TEST_NKEYS 16 static int test_port = 7788; static void make_listen(int sk) { sockaddr_af...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/key-management' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Author: Dmitry Safonov <dima@arista.com> */ #include <inttypes.h> #include "../../../../include/linux/kernel.h" #include "aolib.h" const size_t nr_packets = 20; const size_t msg_len = 100; const size_t quota = nr_packets * msg_len; union tcp_addr wrong_addr; #define SECOND_P...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/unsigned-md5' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Author: Dmitry Safonov <dima@arista.com> */ #include <inttypes.h> #include "aolib.h" #define fault(type) (inj == FAULT_ ## type) static const char *md5_password = "Some evil genius, enemy to mankind, must have been the first contriver."; static const char *ao_password = DEFA...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/self-connect' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Author: Dmitry Safonov <dima@arista.com> */ #include <inttypes.h> #include "aolib.h" static union tcp_addr local_addr; static void __setup_lo_intf(const char *lo_intf, const char *addr_str, uint8_t prefix) { if (inet_pton(TEST_FAMILY, addr_str, &local_addr) != 1) ...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/lib/netlink' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Original from tools/testing/selftests/net/ipsec.c */ #include <linux/netlink.h> #include <linux/random.h> #include <linux/rtnetlink.h> #include <linux/veth.h> #include <net/if.h> #include <stdint.h> #include <string.h> #include <sys/socket.h> #include "aolib.h" #define MAX_...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/lib/proc' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <inttypes.h> #include <pthread.h> #include <stdio.h> #include "../../../../../include/linux/compiler.h" #include "../../../../../include/linux/kernel.h" #include "aolib.h" struct netstat_counter { uint64_t val; char *name; }; struct netstat { char *header_name; st...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/net/tcp_ao/lib/aolib' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * TCP-AO selftest library. Provides helpers to unshare network * namespaces, create veth, assign ip addresses, set routes, * manipulate socket options, read network counter and etc. * Author: Dmitry Safonov <dima@arista.com> */ #ifndef _AOLIB_H_ #define _AOLIB_H_ #in...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/lib/kconfig' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Check what features does the kernel support (where the selftest is running). * Somewhat inspired by CRIU kerndat/kdat kernel features detector. */ #include <pthread.h> #include "aolib.h" struct kconfig_t { int _error; /* negative errno if not supported */ int (*check_kc...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/lib/repair' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* This is over-simplified TCP_REPAIR for TCP_ESTABLISHED sockets * It tests that TCP-AO enabled connection can be restored. * For the proper socket repair see: * https://github.com/checkpoint-restore/criu/blob/criu-dev/soccr/soccr.h */ #include <fcntl.h> #include <linux/soc...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/lib/ftrace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <inttypes.h> #include <pthread.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <sys/mount.h> #include <sys/time.h> #include <unistd.h> #include "../../../../../include/linux/kernel.h" #include "aolib.h" static char ftrace_path[] = "ksft-ftrace-X...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/lib/sock' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <alloca.h> #include <fcntl.h> #include <inttypes.h> #include <string.h> #include "../../../../../include/linux/kernel.h" #include "../../../../../include/linux/stringify.h" #include "aolib.h" const unsigned int test_server_port = 7010; int __test_listen_socket(int back...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/lib/ftrace-tcp' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <inttypes.h> #include <pthread.h> #include "aolib.h" static const char *trace_event_names[__MAX_TRACE_EVENTS] = { /* TCP_HASH_EVENT */ "tcp_hash_bad_header", "tcp_hash_md5_required", "tcp_hash_md5_unexpected", "tcp_hash_md5_mismatch", "tcp_hash_ao_required", /* ...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/lib/utils' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include "aolib.h" #include <string.h> void randomize_buffer(void *buf, size_t buflen) { int *p = (int *)buf; size_t words = buflen / sizeof(int); size_t leftover = buflen % sizeof(int); if (!buflen) return; while (words--) *p++ = rand(); if (leftover) { int tmp ...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/lib/setup' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <fcntl.h> #include <pthread.h> #include <sched.h> #include <signal.h> #include "aolib.h" /* * Can't be included in the header: it defines static variables which * will be unique to every object. Let's include it only once here. */ #include "kselftest.h" /* Prevent ...
Linux kernel'inin 'tools/testing/selftests/net/forwarding/ipmr' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright 2026 Google LLC */ #include <linux/if.h> #include <linux/mroute.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <linux/socket.h> #include <sched.h> #include <sys/ioctl.h> #include <sys/socket.h> #include "kselftest_harness.h" FIXTURE(ipmr) { ...
Linux kernel'inin 'tools/testing/selftests/rtc/rtctest' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Real Time Clock Driver Test Program * * Copyright (c) 2018 Alexandre Belloni <alexandre.belloni@bootlin.com> */ #include <errno.h> #include <fcntl.h> #include <linux/rtc.h> #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <sys/time.h> #include <sy...
Linux kernel'inin 'tools/testing/selftests/proc/proc-empty-vm' alt sistemi için gerekli C kaynak kodunu implemente et.
```c #if defined __amd64__ || defined __i386__ /* * Copyright (c) 2022 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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...
Linux kernel'inin 'tools/testing/selftests/proc/proc-self-syscall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-2-is-kthread' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright (c) 2024 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 "A...
Linux kernel'inin 'tools/testing/selftests/proc/fd-003-kthread' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-maps-race' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022 Google LLC. * Author: Suren Baghdasaryan <surenb@google.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission n...
Linux kernel'inin 'tools/testing/selftests/proc/proc-uptime-001' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-uptime-002' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-self-isnt-kthread' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright (c) 2024 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 "A...
Linux kernel'inin 'tools/testing/selftests/proc/read' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-net-dev-lseek' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright (c) 2025 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 "A...
Linux kernel'inin 'tools/testing/selftests/proc/self' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/proc/proc' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c #pragma once #undef NDEBUG #include <assert.h> #include <dirent.h> #include <errno.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/syscall.h> static inline pid_t sys_getpid(void) { return syscall(SYS_getpid); } static inline pid_t sys_gettid(void) { return sysc...
Linux kernel'inin 'tools/testing/selftests/proc/setns-sysvipc' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2019 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-self-wchan' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-subset-pid' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright (c) 2021 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 "A...
Linux kernel'inin 'tools/testing/selftests/proc/proc-tid0' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright (c) 2021 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 "A...
Linux kernel'inin 'tools/testing/selftests/proc/proc-self-map-files-002' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/setns-dcache' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2019 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/proc/proc-uptime' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-fsconfig-hidepid' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2020 Alexey Gladkov <gladkov.alexey@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/fd-002-posix-eq' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-pidns' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Author: Aleksa Sarai <cyphar@cyphar.com> * Copyright (C) 2025 SUSE LLC. */ #include <assert.h> #include <errno.h> #include <sched.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <stdio.h> #include <sys/mount.h> #incl...
Linux kernel'inin 'tools/testing/selftests/proc/fd-001-lookup' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-self-map-files-001' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-multiple-procfs' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2020 Alexey Gladkov <gladkov.alexey@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/thread-self' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-loadavg-001' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright © 2018 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 ...
Linux kernel'inin 'tools/testing/selftests/proc/proc-pid-vm' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright (c) 2019 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and 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 "A...
Linux kernel'inin 'tools/testing/selftests/rlimits/rlimits-per-userns' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Author: Alexey Gladkov <gladkov.alexey@gmail.com> */ #define _GNU_SOURCE #include <sys/types.h> #include <sys/wait.h> #include <sys/time.h> #include <sys/resource.h> #include <sys/prctl.h> #include <sys/stat.h> #include <unistd.h> #include <stdlib.h> #include <s...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/za-fork' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2022 ARM Limited. * Original author: Mark Brown <broonie@kernel.org> */ // SPDX-License-Identifier: GPL-2.0-only #include <linux/sched.h> #include <linux/wait.h> #include "kselftest.h" #define EXPECTED_TESTS 1 int fork_test(void); int verify_fork(...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/sve-ptrace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2015-2021 ARM Limited. * Original author: Dave Martin <Dave.Martin@arm.com> */ #include <errno.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/auxv.h> #include <sy...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/arm64/fp/fp-ptrace' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2021-3 ARM Limited. #ifndef FP_PTRACE_H #define FP_PTRACE_H #define SVCR_SM_SHIFT 0 #define SVCR_ZA_SHIFT 1 #define SVCR_SM (1 << SVCR_SM_SHIFT) #define SVCR_ZA (1 << SVCR_ZA_SHIFT) #define HAVE_SVE_SHIFT 0 #define HAVE_SME_SHIFT 1 #define HAVE_SME2_S...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/fp-stress' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2022 ARM Limited. */ #define _GNU_SOURCE #define _POSIX_C_SOURCE 199309L #include <errno.h> #include <getopt.h> #include <poll.h> #include <signal.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/zt-ptrace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2021 ARM Limited. */ #include <errno.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <sys/ptrace.h> #include <sys/types.h> #...
Linux kernel'inde 'tools/testing/selftests/arm64/fp/za-test' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2021 ARM Limited. // Original author: Mark Brown <broonie@kernel.org> // // Scalable Matrix Extension ZA context switch test // Repeatedly writes unique test patterns into each ZA tile // and reads them back to verify integrity. // // for x in `seq 1...
Linux kernel'inde 'tools/testing/selftests/arm64/fp/rdvl' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2021 ARM Limited. #include "sme-inst.h" .arch_extension sve .globl rdvl_sve rdvl_sve: hint 34 // BTI C rdvl x0, #1 ret .globl rdvl_sme rdvl_sme: hint 34 // BTI C rdsvl 0, 1 ret ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/arm64/fp/sme-inst' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2021-2 ARM Limited. // Original author: Mark Brown <broonie@kernel.org> #ifndef SME_INST_H #define SME_INST_H #define REG_FPMR S3_3_C4_C4_2 /* * RDSVL X\nx, #\imm */ .macro rdsvl nx, imm .inst 0x4bf5800 \ | (...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/rdvl-sve' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <stdio.h> #include "rdvl.h" int main(void) { int vl = rdvl_sve(); printf("%d\n", vl); return 0; } ```
Linux kernel'inin 'tools/testing/selftests/arm64/fp/kernel-test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2024 ARM Limited. */ #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <errno.h> #include <fcntl.h> #include <signal.h> #include <string.h> #include <unistd.h> #include <sys/socket.h> #include <linux/kernel.h> ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/arm64/fp/asm-offsets' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c #define sa_sz 32 #define sa_flags 8 #define sa_handler 0 #define sa_mask_sz 8 #define SIGUSR1 10 #define SIGUSR2 12 #define SIGTERM 15 #define SIGINT 2 #define SIGABRT 6 #define SA_NODEFER 1073741824 #define SA_SIGINFO 4 #define ucontext_regs 184 ```
Linux kernel'inde 'tools/testing/selftests/arm64/fp/sve-test' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2015-2019 ARM Limited. // Original author: Dave Martin <Dave.Martin@arm.com> // // Simple Scalable Vector Extension context switch test // Repeatedly writes unique test patterns into each SVE register // and reads them back to verify integrity. // //...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/sve-probe-vls' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2015-2020 ARM Limited. * Original author: Dave Martin <Dave.Martin@arm.com> */ #include <assert.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <asm/sigcontext.h> #...
Linux kernel'inde 'tools/testing/selftests/arm64/fp/fp-pidbench' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2021 ARM Limited. // Original author: Mark Brown <broonie@kernel.org> // // Trivial syscall overhead benchmark. // // This is implemented in asm to ensure that we don't have any issues with // system libraries using instructions that disrupt the test...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/arm64/fp/rdvl' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef RDVL_H #define RDVL_H int rdvl_sme(void); int rdvl_sve(void); #endif ```
Linux kernel'inin 'tools/testing/selftests/arm64/fp/za-ptrace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2021 ARM Limited. */ #include <errno.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <sys/ptrace.h> #include <sys/types.h> #...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/vlset' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2015-2019 ARM Limited. * Original author: Dave Martin <Dave.Martin@arm.com> */ #define _GNU_SOURCE #include <assert.h> #include <errno.h> #include <limits.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <getop...
Linux kernel'inde 'tools/testing/selftests/arm64/fp/asm-utils' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2015-2021 ARM Limited. // Original author: Dave Martin <Dave.Martin@arm.com> // // Utility functions for assembly code. #include <asm/unistd.h> #include "assembler.h" // Print a single character x0 to stdout // Clobbers x0-x2,x8 function putc str ...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/vec-syscfg' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2021 ARM Limited. * Original author: Mark Brown <broonie@kernel.org> */ #include <assert.h> #include <errno.h> #include <fcntl.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #i...
Linux kernel'inde 'tools/testing/selftests/arm64/fp/zt-test' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2021-2 ARM Limited. // Original author: Mark Brown <broonie@kernel.org> // // Scalable Matrix Extension ZT context switch test // Repeatedly writes unique test patterns into ZT0 // and reads them back to verify integrity. #include <asm/unistd.h> #in...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/fp-ptrace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2023 ARM Limited. * Original author: Mark Brown <broonie@kernel.org> */ #define _GNU_SOURCE #include <errno.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/auxv...
Linux kernel'inde 'tools/testing/selftests/arm64/fp/fp-ptrace-asm' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2021-3 ARM Limited. // // Assembly portion of the FP ptrace test // // Load values from memory into registers, break on a breakpoint, then // break on a further breakpoint // #include "fp-ptrace.h" #include "sme-inst.h" .arch_extension sve // Loa...
Linux kernel'inde 'tools/testing/selftests/arm64/fp/fpsimd-test' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2015-2019 ARM Limited. // Original author: Dave Martin <Dave.Martin@arm.com> // // Simple FPSIMD context switch test // Repeatedly writes unique test patterns into each FPSIMD register // and reads them back to verify integrity. // // for x in `seq 1...
Linux kernel'inin 'tools/testing/selftests/arm64/fp/rdvl-sme' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <stdio.h> #include "rdvl.h" int main(void) { int vl = rdvl_sme(); printf("%d\n", vl); return 0; } ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/arm64/fp/assembler' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2015-2019 ARM Limited. // Original author: Dave Martin <Dave.Martin@arm.com> #ifndef ASSEMBLER_H #define ASSEMBLER_H .macro __for from:req, to:req .if (\from) == (\to) _for__body %\from .else __for \from, %(\from) + ((\to) - (\from)) / 2 __for %(\...
Linux kernel'inde 'tools/testing/selftests/arm64/fp/za-fork-asm' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2021 ARM Limited. #include "sme-inst.h" .arch_extension sve #define MAGIC 42 #define MAXVL 2048 #define MAXVL_B (MAXVL / 8) .pushsection .text .data .align 4 scratch: .space MAXVL_B .popsection .globl fork_test fork_test: smstart_za...
Linux kernel'inde 'tools/testing/selftests/arm64/abi/syscall-abi-asm' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2021 ARM Limited. // // Assembly portion of the syscall ABI test // // Load values from memory into registers, invoke a syscall and save the // register values back to memory for later checking. The syscall to be // invoked is configured in x8 of t...
Linux kernel'inin 'tools/testing/selftests/arm64/abi/ptrace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2022 ARM Limited. */ #include <errno.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <sys/ptrace.h> #include <sys/types.h> #...
Linux kernel'inin 'tools/testing/selftests/arm64/abi/syscall-abi' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2021 ARM Limited. */ #include <errno.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <asm/hwcap.h> #include <asm/sigcontext...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/arm64/abi/syscall-abi' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2021 ARM Limited. */ #ifndef SYSCALL_ABI_H #define SYSCALL_ABI_H #define SVCR_ZA_MASK 2 #define SVCR_SM_MASK 1 #define SVCR_ZA_SHIFT 1 #define SVCR_SM_SHIFT 0 #endif ```
Linux kernel'inin 'tools/testing/selftests/arm64/abi/tpidr2' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/sched.h> #include <linux/wait.h> #include "kselftest.h" #define SYS_TPIDR2 "S3_3_C13_C0_5" #define EXPECTED_TESTS 5 static void set_tpidr2(uint64_t val) { asm volatile ( "msr " SYS_TPIDR2 ", %0\n" : : "r"(val) : "cc"); } static uint64_t get_tp...
Linux kernel'inin 'tools/testing/selftests/arm64/abi/hwcap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2022 ARM Limited. */ #include <errno.h> #include <signal.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <linux/auxvec.h> #include <linux/compiler.h> #include <sys/auxv...
Linux kernel'inin 'tools/testing/selftests/arm64/tags/tags_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <stdint.h> #include <sys/prctl.h> #include <sys/utsname.h> #include "kselftest.h" #define SHIFT_TAG(tag) ((uint64_t)(tag) << 56) #define SET_TAG(ptr, tag) (((uint64_t)(ptr) & ~SHIFT_TAG(0xff)) | \ SHIFT_...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/test_signals_utils' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2019 ARM Limited */ #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <string.h> #include <unistd.h> #include <assert.h> #include <sys/auxv.h> #include <linux/auxvec.h> #include <ucontext.h> #include <asm/unistd.h> #include <kselftest.h> #i...
Linux kernel'inde 'tools/testing/selftests/arm64/signal/signals' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (C) 2019 ARM Limited */ #include <asm/unistd.h> .section .rodata, "a" call_fmt: .asciz "Calling sigreturn with fake sigframe sized:%zd at SP @%08lX\n" .text .globl fake_sigreturn /* fake_sigreturn x0:&sigframe, x1:sigframe_size, x2:misalign_...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/arm64/signal/sve_helpers' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2024 ARM Limited * * Common helper functions for SVE and SME functionality. */ #ifndef __SVE_HELPERS_H__ #define __SVE_HELPERS_H__ #include <stdbool.h> #define VLS_USE_SVE false #define VLS_USE_SME true extern unsigned int vls[]; extern unsigned int...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/arm64/signal/test_signals_utils' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (C) 2019 ARM Limited */ #ifndef __TEST_SIGNALS_UTILS_H__ #define __TEST_SIGNALS_UTILS_H__ #include <assert.h> #include <stdio.h> #include <stdint.h> #include <string.h> #include <linux/compiler.h> #include "test_signals.h" int test_init(struct tdescr *td); i...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/test_signals' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2019 ARM Limited * * Generic test wrapper for arm64 signal tests. * * Each test provides its own tde struct tdescr descriptor to link with * this wrapper. Framework provides common helpers. */ #include <sys/auxv.h> #include <sys/prctl.h> #include <kse...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/arm64/signal/test_signals' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (C) 2019 ARM Limited */ #ifndef __TEST_SIGNALS_H__ #define __TEST_SIGNALS_H__ #include <signal.h> #include <stdbool.h> #include <ucontext.h> /* * Using ARCH specific and sanitized Kernel headers from the tree. */ #include <asm/ptrace.h> #include <asm/hwcap.h...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/sve_helpers' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2024 ARM Limited * * Common helper functions for SVE and SME functionality. */ #include <stdbool.h> #include <kselftest.h> #include <asm/sigcontext.h> #include <sys/prctl.h> unsigned int vls[SVE_VQ_MAX]; unsigned int nvls; int sve_fill_vls(bool use_sme,...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/sve_regs' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2021 ARM Limited * * Verify that the SVE register context in signal frames is set up as * expected. */ #include <kselftest.h> #include <signal.h> #include <ucontext.h> #include <sys/prctl.h> #include "test_signals_utils.h" #include "sve_helpers.h" #incl...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/fake_sigreturn_missing_fpsimd' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2019 ARM Limited * * Place a fake sigframe on the stack missing the mandatory FPSIMD * record: on sigreturn Kernel must spot this attempt and the test * case is expected to be terminated via SEGV. */ #include <stdio.h> #include <signal.h> #include <ucon...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/sme_trap_za' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2021 ARM Limited * * Verify that accessing ZA without enabling it generates a SIGILL. */ #include <signal.h> #include <ucontext.h> #include <sys/prctl.h> #include "test_signals_utils.h" #include "testcases.h" int sme_trap_za_trigger(struct tdescr *td) {...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/fpmr_siginfo' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2023 ARM Limited * * Verify that the FPMR register context in signal frames is set up as * expected. */ #include <signal.h> #include <ucontext.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <unistd.h> #include <asm/sigcontext.h> #include "test...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/testcases' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2019 ARM Limited */ #include <ctype.h> #include <string.h> #include "testcases.h" bool validate_extra_context(struct extra_context *extra, char **err, void **extra_data, size_t *extra_size) { struct _aarch64_ctx *term; if (!extra || !err) return f...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/tpidr2_siginfo' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2022 ARM Limited * * Verify that the TPIDR2 register context in signal frames is set up as * expected. */ #include <signal.h> #include <ucontext.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <unistd.h> #include <asm/sigcontext.h> #include "te...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/fake_sigreturn_bad_size_for_magic0' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2019 ARM Limited * * Place a fake sigframe on the stack including a badly sized terminator * record: on sigreturn Kernel must spot this attempt and the test case * is expected to be terminated via SEGV. */ #include <signal.h> #include <ucontext.h> #inc...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/fake_sigreturn_duplicated_fpsimd' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2019 ARM Limited * * Place a fake sigframe on the stack including an additional FPSIMD * record: on sigreturn Kernel must spot this attempt and the test * case is expected to be terminated via SEGV. */ #include <signal.h> #include <ucontext.h> #include...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/poe_siginfo' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2023 Arm Limited * * Verify that the POR_EL0 register context in signal frames is set up as * expected. */ #include <signal.h> #include <ucontext.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <unistd.h> #include <asm/sigcontext.h> #include "t...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/mangle_pstate_invalid_mode_el2h' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2019 ARM Limited * * Try to mangle the ucontext from inside a signal handler, toggling * the mode bit to escalate exception level: this attempt must be spotted * by Kernel and the test case is expected to be termninated via SEGV. */ #include "test_signa...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/zt_regs' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2021 ARM Limited * * Verify that using an instruction not supported in streaming mode * traps when in streaming mode. */ #include <signal.h> #include <ucontext.h> #include <sys/prctl.h> #include "test_signals_utils.h" #include "testcases.h" static unio...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/mangle_pstate_invalid_mode_el3t' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2019 ARM Limited * * Try to mangle the ucontext from inside a signal handler, toggling * the mode bit to escalate exception level: this attempt must be spotted * by Kernel and the test case is expected to be termninated via SEGV. */ #include "test_signa...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/tpidr2_restore' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2023 ARM Limited * * Verify that the TPIDR2 register context in signal frames is restored. */ #include <signal.h> #include <ucontext.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <unistd.h> #include <asm/sigcontext.h> #include "test_signals_ut...
Linux kernel'inin 'tools/testing/selftests/arm64/signal/testcases/gcs_exception_fault' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2023 ARM Limited */ #include <errno.h> #include <signal.h> #include <unistd.h> #include <sys/mman.h> #include <sys/prctl.h> #include "test_signals_utils.h" #include "testcases.h" /* * We should get this from asm/siginfo.h but the testsuite is being * c...