/openbmc/libbej/test/ |
H A D | bej_tree_test.cpp | 3 #include <gmock/gmock-matchers.h> 63 struct RedfishPropertyParent parent; in TEST() local 67 bejTreeInitSet(&parent, nullptr); in TEST() 68 EXPECT_THAT(parent.nChildren, 0); in TEST() 69 EXPECT_THAT(parent.firstChild, nullptr); in TEST() 70 EXPECT_THAT(parent.lastChild, nullptr); in TEST() 72 bejTreeAddInteger(&parent, &child1, nullptr, 1024); in TEST() 73 EXPECT_THAT(parent.nChildren, 1); in TEST() 74 EXPECT_THAT(parent.firstChild, &child1); in TEST() 75 EXPECT_THAT(parent.lastChild, &child1); in TEST() [all …]
|
/openbmc/linux/drivers/mtd/ |
H A D | mtdpart.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> 31 kfree(mtd->name); in free_partition() 37 WARN_ON(!list_empty(&mtd->part.node)); in release_mtd_partition() 41 static struct mtd_info *allocate_partition(struct mtd_info *parent, in allocate_partition() argument 45 struct mtd_info *master = mtd_get_master(parent); in allocate_partition() 46 int wr_alignment = (parent->flags & MTD_NO_ERASE) ? in allocate_partition() 47 master->writesize : master->erasesize; in allocate_partition() 48 u64 parent_size = mtd_is_partition(parent) ? in allocate_partition() 49 parent->part.size : parent->size; in allocate_partition() [all …]
|
/openbmc/libbej/src/ |
H A D | bej_tree.c | 6 node->nodeAttr.name = name; in bejTreeInitParent() 7 node->nodeAttr.format.principalDataType = type; in bejTreeInitParent() 8 node->nodeAttr.format.deferredBinding = 0; in bejTreeInitParent() 9 node->nodeAttr.format.readOnlyProperty = 0; in bejTreeInitParent() 10 node->nodeAttr.format.nullableProperty = 0; in bejTreeInitParent() 11 node->nodeAttr.format.reserved = 0; in bejTreeInitParent() 12 node->nodeAttr.sibling = NULL; in bejTreeInitParent() 13 node->nChildren = 0; in bejTreeInitParent() 14 node->firstChild = NULL; in bejTreeInitParent() 15 node->lastChild = NULL; in bejTreeInitParent() [all …]
|
H A D | bej_encoder_core.c | 17 RETURN_IF_IERROR(output->recvOutput(&nnintLengthByte, sizeof(uint8_t), in bejEncodeNnint() 18 output->handlerContext)); in bejEncodeNnint() 20 return output->recvOutput(&value, nnintLengthByte, output->handlerContext); in bejEncodeNnint() 29 return output->recvOutput(format, sizeof(struct BejTupleF), in bejEncodeFormat() 30 output->handlerContext); in bejEncodeFormat() 40 RETURN_IF_IERROR(bejEncodeNnint(node->metaData.sequenceNumber, output)); in bejEncodeBejSetOrArray() 42 RETURN_IF_IERROR(bejEncodeFormat(&node->nodeAttr.format, output)); in bejEncodeBejSetOrArray() 44 RETURN_IF_IERROR(bejEncodeNnint(node->metaData.vSize, output)); in bejEncodeBejSetOrArray() 45 // Encode the child count in bejEncodeBejSetOrArray() 46 return bejEncodeNnint(node->nChildren, output); in bejEncodeBejSetOrArray() [all …]
|
/openbmc/linux/drivers/pwm/ |
H A D | sysfs.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 18 struct device child; member 24 static struct pwm_export *child_to_pwm_export(struct device *child) in child_to_pwm_export() argument 26 return container_of(child, struct pwm_export, child); in child_to_pwm_export() 29 static struct pwm_device *child_to_pwm_device(struct device *child) in child_to_pwm_device() argument 31 struct pwm_export *export = child_to_pwm_export(child); in child_to_pwm_device() 33 return export->pwm; in child_to_pwm_device() 36 static ssize_t period_show(struct device *child, in period_show() argument 40 const struct pwm_device *pwm = child_to_pwm_device(child); in period_show() 48 static ssize_t period_store(struct device *child, in period_store() argument [all …]
|
/openbmc/linux/security/landlock/ |
H A D | ptrace.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Landlock LSM - Ptrace hooks 5 * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net> 6 * Copyright © 2019-2020 ANSSI 24 * domain_scope_le - Checks domain ordering for scoped ptrace 26 * @parent: Parent domain. 27 * @child: Potential child of @parent. 29 * Checks if the @parent domain is less or equal to (i.e. an ancestor, which 30 * means a subset of) the @child domain. 32 static bool domain_scope_le(const struct landlock_ruleset *const parent, in domain_scope_le() argument [all …]
|
/openbmc/linux/tools/testing/selftests/cgroup/ |
H A D | test_core.c | 1 /* SPDX-License-Identifier: GPL-2.0 */ 30 return -1; in touch_anon() 38 return -1; in touch_anon() 42 size -= ret; in touch_anon() 59 return -1; in alloc_and_touch_anon_noexit() 63 return -1; in alloc_and_touch_anon_noexit() 74 * Create a child process that allocates and touches 100MB, then waits to be 75 * killed. Wait until the child is attached to the cgroup, kill all processes 102 /* wait for the child to enter cgroup */ in test_cgcore_destroy() 133 * A(0) - B(0) - C(1) [all …]
|
H A D | test_cpuset.c | 1 // SPDX-License-Identifier: GPL-2.0 32 const char *child = cgroup; in do_controller_fn() local 33 const char *parent = arg; in do_controller_fn() local 38 if (!cg_read_strstr(child, "cgroup.controllers", "cpuset")) in do_controller_fn() 41 if (cg_write(parent, "cgroup.subtree_control", "+cpuset")) in do_controller_fn() 44 if (cg_read_strstr(child, "cgroup.controllers", "cpuset")) in do_controller_fn() 47 if (cg_write(parent, "cgroup.subtree_control", "-cpuset")) in do_controller_fn() 50 if (!cg_read_strstr(child, "cgroup.controllers", "cpuset")) in do_controller_fn() 58 * The success should only depend on the parent cgroup permissions and not the 67 char *parent = NULL, *child_src = NULL, *child_dst = NULL; in test_cpuset_perms_object() local [all …]
|
H A D | test_kmem.c | 1 // SPDX-License-Identifier: GPL-2.0 38 "/something-non-existent-with-a-long-name-%64lu-%d", in alloc_dcache() 105 int ret = -1; in alloc_kmem_smp() 109 return -1; in alloc_kmem_smp() 115 return -1; in alloc_kmem_smp() 129 static int cg_run_in_subcgroups(const char *parent, in cg_run_in_subcgroups() argument 133 char *child; in cg_run_in_subcgroups() local 137 child = cg_name_indexed(parent, "child", i); in cg_run_in_subcgroups() 138 if (!child) in cg_run_in_subcgroups() 139 return -1; in cg_run_in_subcgroups() [all …]
|
H A D | test_cpu.c | 1 // SPDX-License-Identifier: GPL-2.0 40 char *parent = NULL, *child = NULL, *parent2 = NULL, *child2 = NULL; in test_cpucg_subtree_control() local 44 parent = cg_name(root, "cpucg_test_0"); in test_cpucg_subtree_control() 45 if (!parent) in test_cpucg_subtree_control() 48 if (cg_create(parent)) in test_cpucg_subtree_control() 51 if (cg_write(parent, "cgroup.subtree_control", "+cpu")) in test_cpucg_subtree_control() 54 child = cg_name(parent, "cpucg_test_child"); in test_cpucg_subtree_control() 55 if (!child) in test_cpucg_subtree_control() 58 if (cg_create(child)) in test_cpucg_subtree_control() 61 if (cg_read_strstr(child, "cgroup.controllers", "cpu")) in test_cpucg_subtree_control() [all …]
|
/openbmc/libbej/include/libbej/ |
H A D | bej_tree.h | 15 * @brief Holds info needed to encode a parent in the JSON tree. 21 // Index of the child pointed by nextChild. Used to store the array 31 // Dictionary used for this parent. 64 * @brief Used to store parent type property info. 66 * bejArray, bejSet and bejPropertyAnnotation are the parent type nodes. 75 // Points to the first child. 77 // Points to the last child. Technically we only need the firstChild 80 // elements in the array. So we need a pointer to the first child and 90 * Every type that doesn't belong to parent type are considered as a leaf 161 * @param[in] node - pointer to a RedfishPropertyParent struct. [all …]
|
/openbmc/linux/tools/testing/selftests/landlock/ |
H A D | ptrace_test.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Landlock tests - Ptrace 5 * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net> 6 * Copyright © 2019-2020 ANSSI 80 return -1; in get_yama_ptrace_scope() 88 /* clang-format off */ 90 /* clang-format on */ 100 * Test multiple tracing combinations between a parent process P1 and a child 111 * P1-. P1 -> P2 : allow 112 * \ P2 -> P1 : allow [all …]
|
/openbmc/linux/drivers/scsi/libsas/ |
H A D | sas_expander.c | 1 // SPDX-License-Identifier: GPL-2.0 29 /* ---------- SMP task management ---------- */ 40 to_sas_internal(dev->port->ha->shost->transportt); in smp_execute_task_sg() 41 struct sas_ha_struct *ha = dev->port->ha; in smp_execute_task_sg() 43 pm_runtime_get_sync(ha->dev); in smp_execute_task_sg() 44 mutex_lock(&dev->ex_dev.cmd_mutex); in smp_execute_task_sg() 46 if (test_bit(SAS_DEV_GONE, &dev->state)) { in smp_execute_task_sg() 47 res = -ECOMM; in smp_execute_task_sg() 53 res = -ENOMEM; in smp_execute_task_sg() 56 task->dev = dev; in smp_execute_task_sg() [all …]
|
/openbmc/linux/drivers/pci/pcie/ |
H A D | aspm.c | 1 // SPDX-License-Identifier: GPL-2.0 49 struct pcie_link_state *parent; /* pointer to the parent Link state */ member 99 struct pci_dev *child; in pci_function_0() local 101 list_for_each_entry(child, &linkbus->devices, bus_list) in pci_function_0() 102 if (PCI_FUNC(child->devfn) == 0) in pci_function_0() 103 return child; in pci_function_0() 120 return link->aspm_default; in policy_to_aspm_state() 136 return link->clkpm_default; in policy_to_clkpm_state() 143 struct pci_dev *child; in pcie_set_clkpm_nocheck() local 144 struct pci_bus *linkbus = link->pdev->subordinate; in pcie_set_clkpm_nocheck() [all …]
|
/openbmc/linux/include/linux/ |
H A D | rbtree_augmented.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 20 * Please note - only struct rb_augment_callbacks and the prototypes for 24 * See Documentation/core-api/rbtree.rst for documentation and samples. 50 __rb_insert_augmented(node, root, augment->rotate); in rb_insert_augmented() 59 root->rb_leftmost = node; in rb_insert_augmented_cached() 60 rb_insert_augmented(node, &root->rb_root, augment); in rb_insert_augmented_cached() 68 struct rb_node **link = &tree->rb_root.rb_node; in rb_add_augmented_cached() 69 struct rb_node *parent = NULL; in rb_add_augmented_cached() local 73 parent = *link; in rb_add_augmented_cached() 74 if (less(node, parent)) { in rb_add_augmented_cached() [all …]
|
H A D | bootconfig.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 27 #define BOOTCONFIG_ALIGN_MASK (BOOTCONFIG_ALIGN - 1) 30 * xbc_calc_checksum() - Calculate checksum of bootconfig 43 while (size--) in xbc_calc_checksum() 52 uint16_t child; member 53 uint16_t parent; member 59 /* Maximum size of boot config is 32KB - 1 */ 60 #define XBC_DATA_MAX (XBC_VALUE - 1) 75 * xbc_node_is_value() - Test the node is a value node 82 return node->data & XBC_VALUE; in xbc_node_is_value() [all …]
|
/openbmc/linux/fs/ |
H A D | pnode.c | 1 // SPDX-License-Identifier: GPL-2.0-only 19 return list_entry(p->mnt_share.next, struct mount, mnt_share); in next_peer() 24 return list_entry(p->mnt_slave_list.next, struct mount, mnt_slave); in first_slave() 29 return list_entry(p->mnt_slave_list.prev, struct mount, mnt_slave); in last_slave() 34 return list_entry(p->mnt_slave.next, struct mount, mnt_slave); in next_slave() 45 if (m->mnt_ns == ns && is_path_reachable(m, m->mnt.mnt_root, root)) in get_peer_under_root() 64 for (m = mnt->mnt_master; m != NULL; m = m->mnt_master) { in get_dominating_id() 65 struct mount *d = get_peer_under_root(m, mnt->mnt_ns, root); in get_dominating_id() 67 return d->mnt_group_id; in get_dominating_id() 77 if (list_empty(&mnt->mnt_share)) { in do_make_slave() [all …]
|
/openbmc/linux/tools/include/linux/ |
H A D | rbtree_augmented.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 22 * Please note - only struct rb_augment_callbacks and the prototypes for 26 * See Documentation/core-api/rbtree.rst for documentation and samples. 52 __rb_insert_augmented(node, root, augment->rotate); in rb_insert_augmented() 61 root->rb_leftmost = node; in rb_insert_augmented_cached() 62 rb_insert_augmented(node, &root->rb_root, augment); in rb_insert_augmented_cached() 85 rb = rb_parent(&node->RBFIELD); \ 93 new->RBAUGMENTED = old->RBAUGMENTED; \ 100 new->RBAUGMENTED = old->RBAUGMENTED; \ 119 * RBCOMPUTE: name of function that returns the per-node RBTYPE scalar [all …]
|
/openbmc/linux/drivers/iio/multiplexer/ |
H A D | iio-mux.c | 1 // SPDX-License-Identifier: GPL-2.0 32 struct iio_channel *parent; member 36 struct mux_child *child; member 42 struct mux_child *child = &mux->child[idx]; in iio_mux_select() local 43 struct iio_chan_spec const *chan = &mux->chan[idx]; in iio_mux_select() 47 ret = mux_control_select_delay(mux->control, chan->channel, in iio_mux_select() 48 mux->delay_us); in iio_mux_select() 50 mux->cached_state = -1; in iio_mux_select() 54 if (mux->cached_state == chan->channel) in iio_mux_select() 57 if (chan->ext_info) { in iio_mux_select() [all …]
|
/openbmc/linux/drivers/firmware/efi/ |
H A D | dev-path-parser.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * dev-path-parser.c - EFI Device Path parser 16 struct device *parent, struct device **child) in parse_acpi_path() argument 24 if (node->header.length != 12) in parse_acpi_path() 25 return -EINVAL; in parse_acpi_path() 28 'A' + ((node->acpi.hid >> 10) & 0x1f) - 1, in parse_acpi_path() 29 'A' + ((node->acpi.hid >> 5) & 0x1f) - 1, in parse_acpi_path() 30 'A' + ((node->acpi.hid >> 0) & 0x1f) - 1, in parse_acpi_path() 31 node->acpi.hid >> 16); in parse_acpi_path() 33 for_each_acpi_dev_match(adev, hid, NULL, -1) { in parse_acpi_path() [all …]
|
/openbmc/u-boot/include/linux/ |
H A D | rbtree_augmented.h | 1 /* SPDX-License-Identifier: GPL-2.0+ */ 18 * Please note - only struct rb_augment_callbacks and the prototypes for 37 __rb_insert_augmented(node, root, augment->rotate); in rb_insert_augmented() 48 if (node->rbaugmented == augmented) \ 50 node->rbaugmented = augmented; \ 51 rb = rb_parent(&node->rbfield); \ 59 new->rbaugmented = old->rbaugmented; \ 66 new->rbaugmented = old->rbaugmented; \ 67 old->rbaugmented = rbcompute(old); \ 82 #define rb_color(rb) __rb_color((rb)->__rb_parent_color) [all …]
|
/openbmc/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | cg_storage_multi.c | 1 // SPDX-License-Identifier: GPL-2.0-only 18 #define CHILD_CGROUP "/cgroup_storage/child" 31 "map-lookup", "errno %d", errno)) in assert_storage() 34 "assert-storage", "storages differ")) in assert_storage() 48 "map-lookup", "succeeded, expected ENOENT")) in assert_storage_noexist() 51 "map-lookup", "errno %d, expected ENOENT", errno)) in assert_storage_noexist() 59 int server_fd = -1, client_fd = -1; in connect_send() 99 if (CHECK(!obj, "skel-load", "errno %d", errno)) in test_egress_only() 102 /* Attach to parent cgroup, trigger packet from child. in test_egress_only() 104 * parent cgroup's storage. in test_egress_only() [all …]
|
/openbmc/linux/drivers/powercap/ |
H A D | dtpm.c | 1 // SPDX-License-Identifier: GPL-2.0-only 12 * parent node is a virtual description of the aggregation of the 42 return -ENOSYS; in get_time_window_us() 47 return -ENOSYS; in set_time_window_us() 54 *max_power_uw = dtpm->power_max - dtpm->power_min; in get_max_power_range_uw() 61 struct dtpm *child; in __get_power_uw() local 65 if (dtpm->ops) { in __get_power_uw() 66 *power_uw = dtpm->ops->get_power_uw(dtpm); in __get_power_uw() 72 list_for_each_entry(child, &dtpm->children, sibling) { in __get_power_uw() 73 ret = __get_power_uw(child, &power); in __get_power_uw() [all …]
|
/openbmc/qemu/util/ |
H A D | interval-tree.c | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 4 #include "qemu/interval-tree.h" 10 * For now, don't expose Linux Red-Black Trees separately, but retain the 18 * red-black trees properties: https://en.wikipedia.org/wiki/Rbtree 42 * These two requirements will allow lockless iteration of the tree -- not 47 * and that it will indeed complete -- does not get stuck in a loop. 67 return qatomic_read(&n->rb_parent_color); in rb_pc() 72 qatomic_set(&n->rb_parent_color, pc); in rb_set_pc() 135 static inline void rb_link_node(RBNode *node, RBNode *parent, RBNode **rb_link) in rb_link_node() argument 137 node->rb_parent_color = (uintptr_t)parent; in rb_link_node() [all …]
|
/openbmc/phosphor-mrw-tools/ |
H A D | patchxml.py | 27 This will add a new enumerationType element child to the root element. 54 4) Add child elements to a specific element. Useful when adding several 55 child elements at once. 57 Use a type attribute of 'add-child' and specify the target parent with 60 <enumerationType type="add-child" xpath="enumerationType/[id='TYPE']"> 74 5) Replace a child element inside another element, useful when replacing 75 several child elements of the same parent at once. 77 Use a type attribute of 'replace-child' and the xpath attribute 81 <enumerationType type="replace-child" 117 parser.add_argument("-x", dest="xml", help="The input XML file") [all …]
|