Lines Matching refs:bpf_insn

96 static void emit(struct bpf_gen *gen, struct bpf_insn insn)
104 static void emit2(struct bpf_gen *gen, struct bpf_insn insn1, struct bpf_insn insn2)
672 /* try to copy from existing bpf_insn */
674 move_blob2blob(gen, insn + offsetof(struct bpf_insn, imm), 4,
675 kdesc->insn + offsetof(struct bpf_insn, imm));
676 move_blob2blob(gen, insn + offsetof(struct bpf_insn, off), 2,
677 kdesc->insn + offsetof(struct bpf_insn, off));
697 emit(gen, BPF_ST_MEM(BPF_W, BPF_REG_8, offsetof(struct bpf_insn, imm), 0));
698 emit(gen, BPF_ST_MEM(BPF_H, BPF_REG_8, offsetof(struct bpf_insn, off), 0));
702 emit(gen, BPF_STX_MEM(BPF_W, BPF_REG_8, BPF_REG_7, offsetof(struct bpf_insn, imm)));
714 emit(gen, BPF_ST_MEM(BPF_H, BPF_REG_8, offsetof(struct bpf_insn, off), 0));
718 emit(gen, BPF_ST_MEM(BPF_H, BPF_REG_8, offsetof(struct bpf_insn, off), btf_fd_idx));
723 offsetof(struct bpf_insn, imm)));
725 offsetof(struct bpf_insn, off)));
741 offsetof(struct bpf_insn, imm)));
742 emit(gen, BPF_LDX_MEM(BPF_H, BPF_REG_9, BPF_REG_8, sizeof(struct bpf_insn) +
743 offsetof(struct bpf_insn, imm)));
746 emit(gen, BPF_LDX_MEM(BPF_B, BPF_REG_9, BPF_REG_8, offsetofend(struct bpf_insn, code)));
764 move_blob2blob(gen, insn + offsetof(struct bpf_insn, imm), 4,
765 kdesc->insn + offsetof(struct bpf_insn, imm));
766 move_blob2blob(gen, insn + sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm), 4,
767 kdesc->insn + sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm));
778 emit(gen, BPF_STX_MEM(BPF_W, BPF_REG_8, BPF_REG_9, offsetof(struct bpf_insn, imm)));
782 sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm)));
811 move_blob2blob(gen, insn + sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm), 4,
812 kdesc->insn + sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm));
813 move_blob2blob(gen, insn + offsetof(struct bpf_insn, imm), 4,
814 kdesc->insn + offsetof(struct bpf_insn, imm));
829 emit(gen, BPF_ST_MEM(BPF_W, BPF_REG_8, offsetof(struct bpf_insn, imm), 0));
830 emit(gen, BPF_ST_MEM(BPF_W, BPF_REG_8, sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm), 0));
834 emit(gen, BPF_STX_MEM(BPF_W, BPF_REG_8, BPF_REG_7, offsetof(struct bpf_insn, imm)));
838 sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm)));
844 emit(gen, BPF_LDX_MEM(BPF_B, BPF_REG_9, BPF_REG_8, offsetofend(struct bpf_insn, code)));
846 emit(gen, BPF_STX_MEM(BPF_B, BPF_REG_8, BPF_REG_9, offsetofend(struct bpf_insn, code)));
873 insn = insns + sizeof(struct bpf_insn) * relo->insn_idx;
913 insn += sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm);
936 const char *license, struct bpf_insn *insns, size_t insn_cnt,
949 insns_off = add_data(gen, insns, insn_cnt * sizeof(struct bpf_insn));