| /tools/testing/selftests/landlock/ |
| A D | common.h | 88 const cap_flag_t flag, const cap_value_t cap, in _change_cap() argument 104 const cap_value_t cap) in set_cap() argument 106 _change_cap(_metadata, CAP_EFFECTIVE, cap, CAP_SET); in set_cap() 110 const cap_value_t cap) in clear_cap() argument 112 _change_cap(_metadata, CAP_EFFECTIVE, cap, CAP_CLEAR); in clear_cap() 118 _change_cap(_metadata, CAP_INHERITABLE, cap, CAP_SET); in set_ambient_cap() 120 EXPECT_NE(-1, cap_set_ambient(cap, CAP_SET)) in set_ambient_cap() 122 TH_LOG("Failed to set ambient capability %d: %s", cap, in set_ambient_cap() 130 EXPECT_EQ(1, cap_get_ambient(cap)); in clear_ambient_cap() 131 _change_cap(_metadata, CAP_INHERITABLE, cap, CAP_CLEAR); in clear_ambient_cap() [all …]
|
| /tools/power/acpi/tools/pfrut/ |
| A D | pfrut.c | 167 void print_cap(struct pfru_update_cap_info *cap) in print_cap() argument 177 printf("update capability:%d\n", cap->update_cap); in print_cap() 179 uuid_unparse(cap->code_type, uuid); in print_cap() 181 printf("fw_version:%d\n", cap->fw_version); in print_cap() 184 uuid_unparse(cap->drv_type, uuid); in print_cap() 187 printf("drv_svn:%d\n", cap->drv_svn); in print_cap() 189 uuid_unparse(cap->platform_id, uuid); in print_cap() 191 uuid_unparse(cap->oem_id, uuid); in print_cap() 203 struct pfru_update_cap_info cap; in main() local 229 ret = ioctl(fd_update, PFRU_IOC_QUERY_CAP, &cap); in main() [all …]
|
| /tools/perf/util/ |
| A D | cap.c | 15 bool perf_cap__capable(int cap, bool *used_root) in perf_cap__capable() argument 38 if (cap >= 32) { in perf_cap__capable() 48 return (cap_val & (1 << (cap & 0x1f))) != 0; in perf_cap__capable()
|
| A D | hashmap.c | 46 map->cap = 0; in hashmap__init() 73 map->cap = map->cap_bits = map->sz = 0; in hashmap__clear() 92 return map->cap; in hashmap__capacity() 98 return (map->cap == 0) || ((map->sz + 1) * 4 / 3 > map->cap); in hashmap_needs_to_grow() 122 map->cap = new_cap; in hashmap_grow()
|
| A D | cap.h | 22 bool perf_cap__capable(int cap, bool *used_root);
|
| A D | hashmap.h | 78 size_t cap; member 169 for (bkt = 0; bkt < (map)->cap; bkt++) \ 181 for (bkt = 0; bkt < (map)->cap; bkt++) \
|
| /tools/power/x86/x86_energy_perf_policy/ |
| A D | x86_energy_perf_policy.c | 775 cap->lowest, cap->efficient, cap->guaranteed, cap->highest); in print_hwp_cap() 895 struct msr_hwp_cap cap; in print_cpu_msrs() local 909 print_hwp_cap(cpu, &cap, ""); in print_cpu_msrs() 1038 if (req->hwp_max > cap->highest) in check_hwp_request_v_hwp_capabilities() 1041 if (req->hwp_max < cap->lowest) in check_hwp_request_v_hwp_capabilities() 1047 if (req->hwp_min > cap->highest) in check_hwp_request_v_hwp_capabilities() 1050 if (req->hwp_min < cap->lowest) in check_hwp_request_v_hwp_capabilities() 1080 struct msr_hwp_cap cap; in update_hwp_request() local 1107 print_hwp_cap(cpu, &cap, ""); in update_hwp_request() 1125 struct msr_hwp_cap cap; in update_hwp_request_pkg() local [all …]
|
| /tools/testing/selftests/clone3/ |
| A D | clone3_cap_checkpoint_restore.c | 98 struct libcap *cap; in set_capability() local 117 cap = (struct libcap *) caps; in set_capability() 120 cap->data[1].effective |= 1 << (40 - 32); in set_capability() 121 cap->data[1].permitted |= 1 << (40 - 32); in set_capability()
|
| /tools/testing/selftests/net/mptcp/ |
| A D | mptcp_diag.c | 211 char caps[32 + 1] = { 0 }, *cap = &caps[0]; in print_subflow_info() local 216 *cap++ = 'M'; in print_subflow_info() 218 *cap++ = 'm'; in print_subflow_info() 220 *cap++ = 'J'; in print_subflow_info() 222 *cap++ = 'j'; in print_subflow_info() 224 *cap++ = 'B'; in print_subflow_info() 226 *cap++ = 'b'; in print_subflow_info() 228 *cap++ = 'e'; in print_subflow_info() 230 *cap++ = 'c'; in print_subflow_info() 232 *cap++ = 'v'; in print_subflow_info()
|
| A D | mptcp_connect.c | 582 size_t cap = rand(); in do_rnd_read() local 584 cap &= 0xffff; in do_rnd_read() 586 if (cap == 0) in do_rnd_read() 587 cap = 1; in do_rnd_read() 588 else if (cap > len) in do_rnd_read() 589 cap = len; in do_rnd_read() 592 ret = recv(fd, buf, cap, MSG_PEEK); in do_rnd_read() 595 ret = recv(fd, buf, cap, MSG_PEEK); in do_rnd_read() 596 ret = (ret < 0) ? ret : read(fd, buf, cap); in do_rnd_read() 598 ret = do_recvmsg_cmsg(fd, buf, cap); in do_rnd_read() [all …]
|
| /tools/testing/selftests/x86/bugs/ |
| A D | common.py | 142 cap = init_capstone() 143 for instruction in cap.disasm(code, target_address): 150 cap = Cs(CS_ARCH_X86, CS_MODE_64) 151 cap.syntax = CS_OPT_SYNTAX_ATT 152 return cap
|
| A D | its_indirect_alignment.py | 46 cap = c.init_capstone() variable 91 kcore_insn = list(cap.disasm(prog.read(site, 16), site))[0] 112 insn_at_thunk = list(cap.disasm(prog.read(thunk, 16), thunk))[0]
|
| A D | its_ret_alignment.py | 41 cap = c.init_capstone() variable 89 kcore_insn = list(cap.disasm(prog.read(site, 16), site))[0]
|
| /tools/lib/bpf/ |
| A D | hashmap.c | 46 map->cap = 0; in hashmap__init() 73 map->cap = map->cap_bits = map->sz = 0; in hashmap__clear() 92 return map->cap; in hashmap__capacity() 98 return (map->cap == 0) || ((map->sz + 1) * 4 / 3 > map->cap); in hashmap_needs_to_grow() 122 map->cap = new_cap; in hashmap_grow()
|
| A D | hashmap.h | 78 size_t cap; member 169 for (bkt = 0; bkt < (map)->cap; bkt++) \ 181 for (bkt = 0; bkt < (map)->cap; bkt++) \
|
| /tools/power/x86/intel-speed-select/ |
| A D | hfi-events.c | 202 struct nlattr *cap; in handle_event() local 206 nla_for_each_nested(cap, attrs[THERMAL_GENL_ATTR_CPU_CAPABILITY], j) { in handle_event() 209 perf_cap.cpu = nla_get_u32(cap); in handle_event() 212 perf_cap.perf = nla_get_u32(cap); in handle_event() 215 perf_cap.eff = nla_get_u32(cap); in handle_event()
|
| /tools/testing/selftests/bpf/progs/ |
| A D | token_lsm.c | 15 int BPF_PROG(token_capable, struct bpf_token *token, int cap) in BPF_PROG() argument
|
| /tools/testing/selftests/kvm/include/ |
| A D | kvm_util.h | 271 unsigned int kvm_check_cap(long cap); 273 static inline bool kvm_has_cap(long cap) in kvm_has_cap() argument 275 return kvm_check_cap(cap); in kvm_has_cap() 370 static inline int vm_check_cap(struct kvm_vm *vm, long cap) in vm_check_cap() argument 372 int ret = __vm_ioctl(vm, KVM_CHECK_EXTENSION, (void *)cap); in vm_check_cap() 378 static inline int __vm_enable_cap(struct kvm_vm *vm, uint32_t cap, uint64_t arg0) in __vm_enable_cap() argument 380 struct kvm_enable_cap enable_cap = { .cap = cap, .args = { arg0 } }; in __vm_enable_cap() 384 static inline void vm_enable_cap(struct kvm_vm *vm, uint32_t cap, uint64_t arg0) in vm_enable_cap() argument 386 struct kvm_enable_cap enable_cap = { .cap = cap, .args = { arg0 } }; in vm_enable_cap() 728 static inline void vcpu_enable_cap(struct kvm_vcpu *vcpu, uint32_t cap, in vcpu_enable_cap() argument [all …]
|
| /tools/testing/selftests/kvm/x86/ |
| A D | sync_regs_test.c | 404 int cap; in main() local 406 cap = kvm_check_cap(KVM_CAP_SYNC_REGS); in main() 407 TEST_REQUIRE((cap & TEST_SYNC_FIELDS) == TEST_SYNC_FIELDS); in main() 408 TEST_REQUIRE(!(cap & INVALID_SYNC_FIELD)); in main()
|
| A D | userspace_msr_exit_test.c | 710 struct kvm_enable_cap cap = { .cap = KVM_CAP_X86_USER_SPACE_MSR }; in run_user_space_msr_flag_test() local 711 int nflags = sizeof(cap.args[0]) * BITS_PER_BYTE; in run_user_space_msr_flag_test() 719 cap.args[0] = BIT_ULL(i); in run_user_space_msr_flag_test() 720 test_user_exit_msr_ioctl(vm, KVM_ENABLE_CAP, &cap, in run_user_space_msr_flag_test()
|
| /tools/testing/selftests/mm/ |
| A D | mlock-random-test.c | 30 cap_t cap = cap_init(); in set_cap_limits() local 40 if (cap_set_proc(cap)) { in set_cap_limits()
|
| A D | memfd_secret.c | 253 cap_t cap = cap_init(); in set_cap_limits() local 263 if (cap_set_proc(cap)) { in set_cap_limits()
|
| /tools/testing/selftests/vDSO/ |
| A D | vdso_test_getrandom.c | 49 size_t len, cap; member 75 new_cap = vgrnd.cap + num; in vgetrandom_get_state() 79 vgrnd.cap = new_cap; in vgetrandom_get_state()
|
| /tools/testing/selftests/tpm2/ |
| A D | tpm2.py | 689 def __get_cap_cnt(self, cap, pt, cnt): argument 697 cap, pt, cnt) 700 more_data, cap, cnt = struct.unpack('>BII', rsp[:9]) 710 def get_cap(self, cap, pt): argument 715 next_handles, more_data = self.__get_cap_cnt(cap, pt, 1)
|
| /tools/bpf/bpftool/ |
| A D | feature.c | 1067 cap_value_t cap; in handle_perms() member 1099 cap_value_t cap = bpf_caps[i].cap; in handle_perms() local 1101 if (cap_get_flag(caps, cap, CAP_EFFECTIVE, &val)) { in handle_perms() 1109 cap_list[nb_bpf_caps++] = cap; in handle_perms()
|