This basically mirrors what already exists in ddb, but provides a
slightly improved interface. It allows the caller to specify the
watchpoint access type, and returns more specific error codes to
differentiate failure cases.
These functions will be used to support hardware watchpoint use in
gdb(4). It is about the same amount of work to add per-arch calls there
than it is to lift this interface to KDB, so I opted for the latter.
Stubs are provided for architectures lacking hardware watchpoint logic
(mips, powerpc, riscv). Other architectures are handled in individual
commits, but presented here for easier review.
Removal of the ddb routines will be in a follow-up commit.
Summary of error codes:
- ENXIO, not supported by platform
- EBUSY, no free hardware watchpoints
- EINVAL, invalid address, size, or access type