| /kernel/linux/linux-5.10/fs/cachefiles/ |
| D | key.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 12 "0123456789" /* 0 - 9 */ 13 "abcdefghijklmnopqrstuvwxyz" /* 10 - 35 */ 14 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" /* 36 - 61 */ 15 "_-" /* 62 - 63 */ 20 [33 ... 46] = 1, /* '!' -> '.' */ 22 [48 ... 127] = 1, /* '0' -> '~' */ 27 * - the raw key should include the length in the two bytes at the front 28 * - the key may be up to 514 bytes in length (including the length word) 29 * - "base64" encode the strange keys, mapping 3 bytes of raw to four of [all …]
|
| /kernel/liteos_a/arch/arm/arm/src/ |
| D | user_copy.c | 2 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. 3 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. 40 size_t arch_copy_from_user(void *dst, const void *src, size_t len) in arch_copy_from_user() argument 42 return LOS_ArchCopyFromUser(dst, src, len); in arch_copy_from_user() 45 size_t LOS_ArchCopyFromUser(void *dst, const void *src, size_t len) in LOS_ArchCopyFromUser() argument 47 if (!LOS_IsUserAddressRange((VADDR_T)(UINTPTR)src, len)) { in LOS_ArchCopyFromUser() 48 return len; in LOS_ArchCopyFromUser() 51 return _arm_user_copy(dst, src, len); in LOS_ArchCopyFromUser() 54 size_t arch_copy_to_user(void *dst, const void *src, size_t len) in arch_copy_to_user() argument 56 return LOS_ArchCopyToUser(dst, src, len); in arch_copy_to_user() [all …]
|
| /kernel/linux/linux-6.6/lib/zlib_inflate/ |
| D | inftrees.c | 1 /* inftrees.c -- generate Huffman trees for efficient decoding 2 * Copyright (C) 1995-2005 Mark Adler 13 The code lengths are lens[0..codes-1]. The result starts at *table, 14 whose indices are 0..2^bits-1. work is a writable array of at least 17 -1 is an invalid code, and +1 means that ENOUGH isn't enough. table 26 unsigned len; /* a code's length in bits */ in zlib_inflate_table() local 28 unsigned min, max; /* minimum and maximum code lengths */ in zlib_inflate_table() local 31 unsigned drop; /* code bits to drop for sub-table */ in zlib_inflate_table() 63 code lengths are lens[0..codes-1]. Each length corresponds to the in zlib_inflate_table() 64 symbols 0..codes-1. The Huffman code is generated by first sorting the in zlib_inflate_table() [all …]
|
| /kernel/linux/linux-5.10/lib/zlib_inflate/ |
| D | inftrees.c | 1 /* inftrees.c -- generate Huffman trees for efficient decoding 2 * Copyright (C) 1995-2005 Mark Adler 13 The code lengths are lens[0..codes-1]. The result starts at *table, 14 whose indices are 0..2^bits-1. work is a writable array of at least 17 -1 is an invalid code, and +1 means that ENOUGH isn't enough. table 26 unsigned len; /* a code's length in bits */ in zlib_inflate_table() local 28 unsigned min, max; /* minimum and maximum code lengths */ in zlib_inflate_table() local 31 unsigned drop; /* code bits to drop for sub-table */ in zlib_inflate_table() 63 code lengths are lens[0..codes-1]. Each length corresponds to the in zlib_inflate_table() 64 symbols 0..codes-1. The Huffman code is generated by first sorting the in zlib_inflate_table() [all …]
|
| /kernel/linux/linux-5.10/tools/power/cpupower/lib/ |
| D | cpufreq.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * (C) 2004-2009 Dominik Brodowski <linux@dominikbrodowski.de> 37 const char *value, size_t len) in sysfs_cpufreq_write_file() argument 47 if (fd == -1) in sysfs_cpufreq_write_file() 50 numwrite = write(fd, value, len); in sysfs_cpufreq_write_file() 91 unsigned int len; in sysfs_cpufreq_get_one_value() local 98 len = sysfs_cpufreq_read_file(cpu, cpufreq_value_files[which], in sysfs_cpufreq_get_one_value() 101 if (len == 0) in sysfs_cpufreq_get_one_value() 131 unsigned int len; in sysfs_cpufreq_get_one_string() local 136 len = sysfs_cpufreq_read_file(cpu, cpufreq_string_files[which], in sysfs_cpufreq_get_one_string() [all …]
|
| /kernel/linux/linux-6.6/tools/power/cpupower/lib/ |
| D | cpufreq.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * (C) 2004-2009 Dominik Brodowski <linux@dominikbrodowski.de> 37 const char *value, size_t len) in sysfs_cpufreq_write_file() argument 47 if (fd == -1) in sysfs_cpufreq_write_file() 50 numwrite = write(fd, value, len); in sysfs_cpufreq_write_file() 92 unsigned int len; in cpufreq_get_sysfs_value_from_table() local 99 len = sysfs_cpufreq_read_file(cpu, table[index], linebuf, in cpufreq_get_sysfs_value_from_table() 102 if (len == 0) in cpufreq_get_sysfs_value_from_table() 140 unsigned int len; in sysfs_cpufreq_get_one_string() local 145 len = sysfs_cpufreq_read_file(cpu, cpufreq_string_files[which], in sysfs_cpufreq_get_one_string() [all …]
|
| /kernel/linux/linux-5.10/drivers/scsi/ibmvscsi_tgt/ |
| D | libsrp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 17 #include <linux/dma-mapping.h> 24 static int srp_iu_pool_alloc(struct srp_queue *q, size_t max, in srp_iu_pool_alloc() argument 30 q->pool = kcalloc(max, sizeof(struct iu_entry *), GFP_KERNEL); in srp_iu_pool_alloc() 31 if (!q->pool) in srp_iu_pool_alloc() 32 return -ENOMEM; in srp_iu_pool_alloc() 33 q->items = kcalloc(max, sizeof(struct iu_entry), GFP_KERNEL); in srp_iu_pool_alloc() 34 if (!q->items) in srp_iu_pool_alloc() 37 spin_lock_init(&q->lock); in srp_iu_pool_alloc() 38 kfifo_init(&q->queue, (void *)q->pool, max * sizeof(void *)); in srp_iu_pool_alloc() [all …]
|
| /kernel/linux/linux-6.6/drivers/scsi/ibmvscsi_tgt/ |
| D | libsrp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 17 #include <linux/dma-mapping.h> 24 static int srp_iu_pool_alloc(struct srp_queue *q, size_t max, in srp_iu_pool_alloc() argument 30 q->pool = kcalloc(max, sizeof(struct iu_entry *), GFP_KERNEL); in srp_iu_pool_alloc() 31 if (!q->pool) in srp_iu_pool_alloc() 32 return -ENOMEM; in srp_iu_pool_alloc() 33 q->items = kcalloc(max, sizeof(struct iu_entry), GFP_KERNEL); in srp_iu_pool_alloc() 34 if (!q->items) in srp_iu_pool_alloc() 37 spin_lock_init(&q->lock); in srp_iu_pool_alloc() 38 kfifo_init(&q->queue, (void *)q->pool, max * sizeof(void *)); in srp_iu_pool_alloc() [all …]
|
| /kernel/linux/linux-6.6/lib/ |
| D | nlattr.c | 1 // SPDX-License-Identifier: GPL-2.0 60 static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype, 72 return -EINVAL; in validate_nla_bitfield32() 75 if (bf->selector & ~valid_flags_mask) in validate_nla_bitfield32() 76 return -EINVAL; in validate_nla_bitfield32() 79 if (bf->value & ~valid_flags_mask) in validate_nla_bitfield32() 80 return -EINVAL; in validate_nla_bitfield32() 83 if (bf->value & ~bf->selector) in validate_nla_bitfield32() 84 return -EINVAL; in validate_nla_bitfield32() 89 static int nla_validate_array(const struct nlattr *head, int len, int maxtype, in nla_validate_array() argument [all …]
|
| /kernel/linux/linux-6.6/include/linux/ |
| D | minmax.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 11 * min()/max()/clamp() macros must accomplish three things: 13 * - Avoid multiple evaluations of the arguments (so side-effects like 14 * "x++" happen only once) when non-constant. 15 * - Retain result as a constant expressions when called with only 18 * - Perform signed v unsigned type-checking (to generate compile 20 * - Unsigned char/short are always promoted to signed int and can be 22 * - Unsigned arguments can be compared against non-negative signed constants. 23 * - Comparison of a signed argument against an unsigned constant fails 34 /* True for a non-negative signed int constant */ [all …]
|
| /kernel/linux/linux-5.10/lib/ |
| D | nlattr.c | 1 // SPDX-License-Identifier: GPL-2.0 56 static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype, 68 return -EINVAL; in validate_nla_bitfield32() 71 if (bf->selector & ~valid_flags_mask) in validate_nla_bitfield32() 72 return -EINVAL; in validate_nla_bitfield32() 75 if (bf->value & ~valid_flags_mask) in validate_nla_bitfield32() 76 return -EINVAL; in validate_nla_bitfield32() 79 if (bf->value & ~bf->selector) in validate_nla_bitfield32() 80 return -EINVAL; in validate_nla_bitfield32() 85 static int nla_validate_array(const struct nlattr *head, int len, int maxtype, in nla_validate_array() argument [all …]
|
| /kernel/linux/linux-6.6/rust/alloc/ |
| D | raw_vec.rs | 1 // SPDX-License-Identifier: Apache-2.0 OR MIT 30 /// A low-level utility for more ergonomically allocating, reallocating, and deallocating 35 /// * Produces `Unique::dangling()` on zero-sized types. 36 /// * Produces `Unique::dangling()` on zero-length allocations. 39 /// * Guards against 32-bit systems allocating more than isize::MAX bytes. 49 /// Note that the excess of a zero-sized types is always infinite, so `capacity()` always returns 50 /// `usize::MAX`. This means that you need to be careful when round-tripping this type with a 64 /// that would truly const-call something unstable. 69 /// `RawVec` with capacity `0`. If `T` is zero-sized, then it makes a 70 /// `RawVec` with capacity `usize::MAX`. Useful for implementing [all …]
|
| /kernel/linux/linux-6.6/net/netfilter/ |
| D | nf_log_syslog.c | 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* (C) 1999-2001 Paul `Rusty' Russell 3 * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org> 57 nf_log_buf_add(m, "VPROTO=%04x VID=%u ", ntohs(skb->vlan_proto), vid); in nf_log_dump_vlan() 76 if (info->type == NF_LOG_TYPE_LOG) in dump_arp_packet() 77 logflags = info->u.log.logflags; in dump_arp_packet() 83 eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest); in dump_arp_packet() 86 ntohs(eth_hdr(skb)->h_proto)); in dump_arp_packet() 90 ntohs(ah->ar_hrd), ntohs(ah->ar_pro), ntohs(ah->ar_op)); in dump_arp_packet() 94 if (ah->ar_hrd != htons(ARPHRD_ETHER) || in dump_arp_packet() [all …]
|
| /kernel/linux/linux-5.10/net/ipv4/netfilter/ |
| D | nf_log_ipv4.c | 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* (C) 1999-2001 Paul `Rusty' Russell 3 * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org> 43 if (info->type == NF_LOG_TYPE_LOG) in dump_ipv4_packet() 44 logflags = info->u.log.logflags; in dump_ipv4_packet() 55 * TOS, len, DF/MF, fragment offset, TTL, src, dst, options. */ in dump_ipv4_packet() 56 /* Max length: 40 "SRC=255.255.255.255 DST=255.255.255.255 " */ in dump_ipv4_packet() 57 nf_log_buf_add(m, "SRC=%pI4 DST=%pI4 ", &ih->saddr, &ih->daddr); in dump_ipv4_packet() 59 /* Max length: 46 "LEN=65535 TOS=0xFF PREC=0xFF TTL=255 ID=65535 " */ in dump_ipv4_packet() 60 nf_log_buf_add(m, "LEN=%u TOS=0x%02X PREC=0x%02X TTL=%u ID=%u ", in dump_ipv4_packet() [all …]
|
| /kernel/linux/linux-6.6/drivers/pnp/ |
| D | support.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * support.c - standard functions for the use of pnp protocol drivers 6 * Copyright (C) 2008 Hewlett-Packard Development Company, L.P. 16 * pnp_is_active - Determines if a device is active based on its current 24 * only clears out auto-assigned resources. in pnp_is_active() 28 pnp_irq(dev, 0) == -1 && pnp_dma(dev, 0) == -1) in pnp_is_active() 44 * According to the specs, the first three characters are five-bit in pnp_eisa_id_to_string() 45 * compressed ASCII, and the left-over high order bit should be zero. in pnp_eisa_id_to_string() 51 str[0] = 'A' + ((id >> 26) & 0x3f) - 1; in pnp_eisa_id_to_string() 52 str[1] = 'A' + ((id >> 21) & 0x1f) - 1; in pnp_eisa_id_to_string() [all …]
|
| /kernel/linux/linux-5.10/drivers/pnp/ |
| D | support.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * support.c - standard functions for the use of pnp protocol drivers 6 * Copyright (C) 2008 Hewlett-Packard Development Company, L.P. 16 * pnp_is_active - Determines if a device is active based on its current 24 * only clears out auto-assigned resources. in pnp_is_active() 28 pnp_irq(dev, 0) == -1 && pnp_dma(dev, 0) == -1) in pnp_is_active() 45 * According to the specs, the first three characters are five-bit in pnp_eisa_id_to_string() 46 * compressed ASCII, and the left-over high order bit should be zero. in pnp_eisa_id_to_string() 52 str[0] = 'A' + ((id >> 26) & 0x3f) - 1; in pnp_eisa_id_to_string() 53 str[1] = 'A' + ((id >> 21) & 0x1f) - 1; in pnp_eisa_id_to_string() [all …]
|
| /kernel/linux/linux-6.6/fs/xfs/libxfs/ |
| D | xfs_types.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc. 48 if (agno >= mp->m_sb.sb_agcount) in xfs_verify_fsbno() 61 xfs_fsblock_t len) in xfs_verify_fsbext() argument 63 if (fsbno + len <= fsbno) in xfs_verify_fsbext() 69 if (!xfs_verify_fsbno(mp, fsbno + len - 1)) in xfs_verify_fsbext() 73 XFS_FSB_TO_AGNO(mp, fsbno + len - 1); in xfs_verify_fsbext() 105 if (agno >= mp->m_sb.sb_agcount) in xfs_verify_ino() 118 return ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino || in xfs_internal_inum() 120 xfs_is_quota_inode(&mp->m_sb, ino)); in xfs_internal_inum() [all …]
|
| /kernel/linux/linux-5.10/net/ipv6/netfilter/ |
| D | nf_log_ipv6.c | 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* (C) 1999-2001 Paul `Rusty' Russell 3 * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org> 49 if (info->type == NF_LOG_TYPE_LOG) in dump_ipv6_packet() 50 logflags = info->u.log.logflags; in dump_ipv6_packet() 60 …/* Max length: 88 "SRC=0000.0000.0000.0000.0000.0000.0000.0000 DST=0000.0000.0000.0000.0000.0000.0… in dump_ipv6_packet() 61 nf_log_buf_add(m, "SRC=%pI6 DST=%pI6 ", &ih->saddr, &ih->daddr); in dump_ipv6_packet() 63 /* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */ in dump_ipv6_packet() 64 nf_log_buf_add(m, "LEN=%zu TC=%u HOPLIMIT=%u FLOWLBL=%u ", in dump_ipv6_packet() 65 ntohs(ih->payload_len) + sizeof(struct ipv6hdr), in dump_ipv6_packet() [all …]
|
| /kernel/linux/linux-6.6/drivers/net/wireless/mediatek/mt76/ |
| D | mt792x_acpi_sar.c | 1 // SPDX-License-Identifier: ISC 8 mt792x_acpi_read(struct mt792x_dev *dev, u8 *method, u8 **tbl, u32 *len) in mt792x_acpi_read() argument 11 struct mt76_dev *mdev = &dev->mt76; in mt792x_acpi_read() 18 root = ACPI_HANDLE(mdev->dev); in mt792x_acpi_read() 20 return -EOPNOTSUPP; in mt792x_acpi_read() 24 return -EIO; in mt792x_acpi_read() 28 return -EIO; in mt792x_acpi_read() 31 if (sar_root->type != ACPI_TYPE_PACKAGE || in mt792x_acpi_read() 32 sar_root->package.count < 4 || in mt792x_acpi_read() 33 sar_root->package.elements[0].type != ACPI_TYPE_INTEGER) { in mt792x_acpi_read() [all …]
|
| /kernel/linux/linux-6.6/tools/perf/scripts/python/ |
| D | task-analyzer.py | 1 # task-analyzer.py - comprehensive perf tasks analysis 2 # SPDX-License-Identifier: GPL-2.0 8 # perf record -e sched:sched_switch -a -- sleep 10 9 # perf script report task-analyzer 21 os.environ["PERF_EXEC_PATH"] + "/scripts/python/Perf-Trace-Util/lib/Perf/Trace" 39 LEN_SWITCHED_IN = len("9999999.999999999") # 17 40 LEN_SWITCHED_OUT = len("9999999.999999999") # 17 41 LEN_CPU = len("000") 42 LEN_PID = len("maxvalue") # 8 43 LEN_TID = len("maxvalue") # 8 [all …]
|
| /kernel/liteos_a/arch/arm/include/ |
| D | user_copy.h | 2 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. 3 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. 43 * @param len The number of bytes to copy. 47 size_t LOS_ArchCopyFromUser(void *dst, const void *src, size_t len); 57 * @param len The number of bytes to copy. 61 size_t LOS_ArchCopyToUser(void *dst, const void *src, size_t len); 70 * @param max The maxsimum number of bytes to copy. 72 * @param len The number of bytes to copy. 74 * @return zero on success; non-zero on failure. 76 INT32 LOS_CopyFromKernel(VOID *dest, UINT32 max, const VOID *src, UINT32 count); [all …]
|
| /kernel/linux/linux-5.10/fs/hfsplus/ |
| D | bitmap.c | 1 // SPDX-License-Identifier: GPL-2.0 20 u32 offset, u32 *max) in hfsplus_block_allocate() argument 26 u32 mask, start, len, n; in hfsplus_block_allocate() local 30 len = *max; in hfsplus_block_allocate() 31 if (!len) in hfsplus_block_allocate() 34 hfs_dbg(BITMAP, "block_allocate: %u,%u,%u\n", size, offset, len); in hfsplus_block_allocate() 35 mutex_lock(&sbi->alloc_mutex); in hfsplus_block_allocate() 36 mapping = sbi->alloc_file->i_mapping; in hfsplus_block_allocate() 43 curr = pptr + (offset & (PAGE_CACHE_BITS - 1)) / 32; in hfsplus_block_allocate() 45 offset &= ~(PAGE_CACHE_BITS - 1); in hfsplus_block_allocate() [all …]
|
| /kernel/linux/linux-6.6/fs/hfsplus/ |
| D | bitmap.c | 1 // SPDX-License-Identifier: GPL-2.0 20 u32 offset, u32 *max) in hfsplus_block_allocate() argument 26 u32 mask, start, len, n; in hfsplus_block_allocate() local 30 len = *max; in hfsplus_block_allocate() 31 if (!len) in hfsplus_block_allocate() 34 hfs_dbg(BITMAP, "block_allocate: %u,%u,%u\n", size, offset, len); in hfsplus_block_allocate() 35 mutex_lock(&sbi->alloc_mutex); in hfsplus_block_allocate() 36 mapping = sbi->alloc_file->i_mapping; in hfsplus_block_allocate() 43 curr = pptr + (offset & (PAGE_CACHE_BITS - 1)) / 32; in hfsplus_block_allocate() 45 offset &= ~(PAGE_CACHE_BITS - 1); in hfsplus_block_allocate() [all …]
|
| /kernel/linux/linux-6.6/Documentation/core-api/ |
| D | netlink.rst | 1 .. SPDX-License-Identifier: BSD-3-Clause 13 --------------- 21 ------------- 31 --------------- 44 ---------- 51 ------------------------ 54 them - make sure to report dump inconsistency with ``NLM_F_DUMP_INTR``. 65 ------- 67 kernel-policy 71 operations of the family, defined for each operation individually - ``per-op``, [all …]
|
| /kernel/linux/linux-5.10/drivers/pnp/pnpbios/ |
| D | rsparser.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * rsparser.c - parses and encodes pnpbios resource data streams 45 * end tag -> 47 * end tag -> 49 * final end tag -> 57 int start, int len) in pnpbios_parse_allocated_ioresource() argument 60 int end = start + len - 1; in pnpbios_parse_allocated_ioresource() 62 if (len <= 0 || end >= 0x10003) in pnpbios_parse_allocated_ioresource() 69 int start, int len) in pnpbios_parse_allocated_memresource() argument 72 int end = start + len - 1; in pnpbios_parse_allocated_memresource() [all …]
|