| 1 | /* This file excercises bpf_spin_lock. */ |
| 2 | |
| 3 | #include "common.h" |
| 4 | |
| 5 | struct bpf_spin_lock { |
| 6 | uint32_t val; |
| 7 | }; |
| 8 | |
| 9 | struct hash_elem { |
| 10 | int cnt; |
| 11 | struct bpf_spin_lock lock; |
| 12 | }; |
| 13 | |
| 14 | struct { |
| 15 | __uint(type, BPF_MAP_TYPE_HASH); |
| 16 | __type(key, uint32_t); |
| 17 | __type(value, struct hash_elem); |
| 18 | __uint(max_entries, 2); |
| 19 | } spin_lock_map __section(".maps"); |