drm/bridge: adv7511: Switch to atomic operations
[drm/drm-misc.git] / tools / testing / selftests / bpf / uptr_test_common.h
blobf8a134ba12f95d18e66d33d5f5e9558faa09f173
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
4 #ifndef _UPTR_TEST_COMMON_H
5 #define _UPTR_TEST_COMMON_H
7 #define MAGIC_VALUE 0xabcd1234
8 #define PAGE_SIZE 4096
10 #ifdef __BPF__
11 /* Avoid fwd btf type being generated for the following struct */
12 struct large_data *dummy_large_data;
13 struct empty_data *dummy_empty_data;
14 struct user_data *dummy_data;
15 struct cgroup *dummy_cgrp;
16 #else
17 #define __uptr
18 #define __kptr
19 #endif
21 struct user_data {
22 int a;
23 int b;
24 int result;
25 int nested_result;
28 struct nested_udata {
29 struct user_data __uptr *udata;
32 struct value_type {
33 struct user_data __uptr *udata;
34 struct cgroup __kptr *cgrp;
35 struct nested_udata nested;
38 struct value_lock_type {
39 struct user_data __uptr *udata;
40 struct bpf_spin_lock lock;
43 struct large_data {
44 __u8 one_page[PAGE_SIZE];
45 int a;
48 struct large_uptr {
49 struct large_data __uptr *udata;
52 struct empty_data {
55 struct empty_uptr {
56 struct empty_data __uptr *udata;
59 struct kstruct_uptr {
60 struct cgroup __uptr *cgrp;
63 #endif