diff options
author | Sean Young <sean@mess.org> | 2021-06-16 11:48:08 +0100 |
---|---|---|
committer | Sean Young <sean@mess.org> | 2021-06-16 15:17:58 +0100 |
commit | 150de0ac2d15b82d874937fcca59675f8b24a13f (patch) | |
tree | 9fd6c008336bcde802fb499ce449da09ca352e98 /utils/keytable/bpf_protocols/raw.c | |
parent | 154a4242117c6f407f2554e0129d21d195366fc1 (diff) |
keytable: ensure BPF IR decoders use correct section name
The convention is to have the type ("lirc_mode2/") prefixed so the
BPF loader knows what type it is.
Signed-off-by: Sean Young <sean@mess.org>
Diffstat (limited to 'utils/keytable/bpf_protocols/raw.c')
-rw-r--r-- | utils/keytable/bpf_protocols/raw.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/keytable/bpf_protocols/raw.c b/utils/keytable/bpf_protocols/raw.c index a0ee78b4..5084264d 100644 --- a/utils/keytable/bpf_protocols/raw.c +++ b/utils/keytable/bpf_protocols/raw.c @@ -27,7 +27,7 @@ struct decoder_state { DECLARE_BITMAP(nomatch, MAX_PATTERNS); }; -struct bpf_map_def SEC("maps") decoder_state_map = { +struct bpf_map_def SEC("lirc_mode2/maps") decoder_state_map = { .type = BPF_MAP_TYPE_ARRAY, .key_size = sizeof(unsigned int), .value_size = sizeof(struct decoder_state), @@ -40,7 +40,7 @@ struct raw_pattern { }; // ir-keytable will load the raw patterns here -struct bpf_map_def SEC("maps") raw_map = { +struct bpf_map_def SEC("lirc_mode2/maps") raw_map = { .type = BPF_MAP_TYPE_ARRAY, .key_size = sizeof(unsigned int), .value_size = sizeof(struct raw_pattern), // this is not used @@ -60,14 +60,14 @@ int rc_protocol = 68; int trail_space = 1000; int max_length = 1; -#define BPF_PARAM(x) (int)(&(x)) +#define BPF_PARAM(x) (int)(long)(&(x)) static inline int eq_margin(unsigned d1, unsigned d2) { return ((d1 > (d2 - BPF_PARAM(margin))) && (d1 < (d2 + BPF_PARAM(margin)))); } -SEC("raw") +SEC("lirc_mode2/raw") int bpf_decoder(unsigned int *sample) { unsigned int key = 0; |