|
27 | 27 | #elif defined(__TARGET_ARCH_riscv) |
28 | 28 | #define bpf_target_riscv |
29 | 29 | #define bpf_target_defined |
| 30 | +#elif defined(__TARGET_ARCH_arc) |
| 31 | + #define bpf_target_arc |
| 32 | + #define bpf_target_defined |
30 | 33 | #else |
31 | 34 |
|
32 | 35 | /* Fall back to what the compiler says */ |
|
54 | 57 | #elif defined(__riscv) && __riscv_xlen == 64 |
55 | 58 | #define bpf_target_riscv |
56 | 59 | #define bpf_target_defined |
| 60 | +#elif defined(__arc__) |
| 61 | + #define bpf_target_arc |
| 62 | + #define bpf_target_defined |
57 | 63 | #endif /* no compiler target */ |
58 | 64 |
|
59 | 65 | #endif |
@@ -320,6 +326,30 @@ struct pt_regs; |
320 | 326 | #define PT_REGS_SP_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), sp) |
321 | 327 | #define PT_REGS_IP_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), epc) |
322 | 328 |
|
| 329 | +#elif defined(bpf_target_arc) |
| 330 | + |
| 331 | +struct pt_regs; |
| 332 | +#define PT_REGS_ARC const volatile struct user_regs_struct |
| 333 | +#define PT_REGS_PARM1(x) (((PT_REGS_ARC *)(x))->scratch.r0) |
| 334 | +#define PT_REGS_PARM2(x) (((PT_REGS_ARC *)(x))->scratch.r1) |
| 335 | +#define PT_REGS_PARM3(x) (((PT_REGS_ARC *)(x))->scratch.r2) |
| 336 | +#define PT_REGS_PARM4(x) (((PT_REGS_ARC *)(x))->scratch.r3) |
| 337 | +#define PT_REGS_PARM5(x) (((PT_REGS_ARC *)(x))->scratch.r4) |
| 338 | +#define PT_REGS_RET(x) (((PT_REGS_ARC *)(x))->scratch.blink) |
| 339 | +#define PT_REGS_RC(x) (((PT_REGS_ARC *)(x))->scratch.r0) |
| 340 | +#define PT_REGS_SP(x) (((PT_REGS_ARC *)(x))->scratch.sp) |
| 341 | +#define PT_REGS_IP(x) (((PT_REGS_ARC *)(x))->scratch.ret) |
| 342 | + |
| 343 | +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((PT_REGS_ARC *)(x), scratch.r0) |
| 344 | +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((PT_REGS_ARC *)(x), scratch.r1) |
| 345 | +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((PT_REGS_ARC *)(x), scratch.r2) |
| 346 | +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((PT_REGS_ARC *)(x), scratch.r3) |
| 347 | +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((PT_REGS_ARC *)(x), scratch.r4) |
| 348 | +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((PT_REGS_ARC *)(x), scratch.blink) |
| 349 | +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((PT_REGS_ARC *)(x), scratch.r0) |
| 350 | +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((PT_REGS_ARC *)(x), scratch.sp) |
| 351 | +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((PT_REGS_ARC *)(x), scratch.ret) |
| 352 | + |
323 | 353 | #endif |
324 | 354 |
|
325 | 355 | #if defined(bpf_target_powerpc) |
|
0 commit comments