+2021-06-27 Mike Frysinger <vapier@gentoo.org>
+
+ * bpf-helpers.c: Include bpf-helpers.h.
+ * bpf-helpers.h (bpf_trace_printk): Change return type to int.
+ (bpfbf_breakpoint): New prototype.
+ * bpf.c: Include decode-be.h & decode-le.h.
+ (bpfbf_ebpfle_init_idesc_table): Delete prototype.
+ (bpfbf_ebpfbe_init_idesc_table): Delete prototype.
+ (bpfbf_model_insn_after): Add 3rd argument.
+ (bpf_def_model_init): Add 1st argument.
+ (bpfbf_prepare_run): Mark static.
+ * sim-main.h: Include bpf-helpers.h.
+
2021-06-27 Mike Frysinger <vapier@gentoo.org>
* bpf-helpers.c (bpf_trace_printk): Add casts to every value printf.
#include "cgen-ops.h"
#include "cpu.h"
+#include "bpf-helpers.h"
+
/* bpf_trace_printk is a printk-like facility for debugging.
In the kernel, it appends a line to the Linux's tracing debugging
#undef DEF_HELPER
};
-void bpf_trace_printk (SIM_CPU *current_cpu);
+int bpf_trace_printk (SIM_CPU *current_cpu);
+
+VOID bpfbf_breakpoint (SIM_CPU *current_cpu);
#endif /* ! BPF_HELPERS_H */
#include "cpuall.h"
#include "decode.h"
+#include "decode-be.h"
+#include "decode-le.h"
+
#include "defs-le.h" /* For SCACHE */
#include "bpf-helpers.h"
-/* It is not possible to include both defs-le.h and defs-be.h due to
- duplicated definitions, so we need a bunch of forward declarations
- here. */
-extern void bpfbf_ebpfle_init_idesc_table (SIM_CPU *);
-extern void bpfbf_ebpfbe_init_idesc_table (SIM_CPU *);
-
uint64_t skb_data_offset;
IDESC *bpf_idesc_le;
}
void
-bpfbf_model_insn_after (SIM_CPU *current_cpu, int first_p)
+bpfbf_model_insn_after (SIM_CPU *current_cpu, int first_p, int cycles)
{
/* XXX */
}
several ISAs. This should be fixed in CGEN. */
static void
-bpf_def_model_init (void)
+bpf_def_model_init (SIM_CPU *cpu)
{
/* Do nothing. */
}
/* Nothing. */
}
-void
+static void
bpf_engine_run_full (SIM_CPU *cpu)
{
if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
#include "sim-base.h"
#include "cgen-sim.h"
#include "bpf-sim.h"
+#include "bpf-helpers.h"
struct _sim_cpu