attr.bp_addr = (unsigned long)&mydata;
attr.bp_len = HW_BREAKPOINT_LEN_4;
attr.bp_type = HW_BREAKPOINT_W;
bps = register_wide_hw_breakpoint(&attr, gpio_dump_stack, NULL);
if(IS_ERR(bps)) {
pr_err("Failed to register hardware breakpoint: %ld\n",PTR_ERR(bps));
bps = NULL;
NULL);
}
This prints:
Failed to register hardware breakpoint: -19
-19 is ENODEV.
I have the following flags added to the kernel:
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_KPROBES=y
I am using kernel:
https://github.com/nxp-imx/linux-imx.git
With branch lf-5.15.y