X-Git-Url: https://git.libre-soc.org/?p=riscv-isa-sim.git;a=blobdiff_plain;f=riscv%2Fdebug_module.h;h=e554ffc8f3623863851a1a4f5fbf4192402fae69;hp=36037b402684e640b488f90af709572433b4328e;hb=aa8cbb1ccd3856fd5e0437b0e24cfd7a3b794b8e;hpb=0329b0741a698f102d64be4f0538427978bacb83 diff --git a/riscv/debug_module.h b/riscv/debug_module.h index 36037b4..e554ffc 100644 --- a/riscv/debug_module.h +++ b/riscv/debug_module.h @@ -74,7 +74,14 @@ typedef struct { class debug_module_t : public abstract_device_t { public: - debug_module_t(sim_t *sim, unsigned progbufsize, unsigned max_bus_master_bits); + /* + * If require_authentication is true, then a debugger must authenticate as + * follows: + * 1. Read a 32-bit value from authdata: + * 2. Write the value that was read back, plus one, to authdata. + */ + debug_module_t(sim_t *sim, unsigned progbufsize, unsigned max_bus_master_bits, + bool require_authentication); ~debug_module_t(); void add_device(bus_t *bus); @@ -96,7 +103,8 @@ class debug_module_t : public abstract_device_t // Actual size of the program buffer, which is 1 word bigger than we let on // to implement the implicit ebreak at the end. unsigned program_buffer_bytes; - unsigned max_bus_master_bits ; + unsigned max_bus_master_bits; + bool require_authentication; static const unsigned debug_data_start = 0x380; unsigned debug_progbuf_start; @@ -134,6 +142,9 @@ class debug_module_t : public abstract_device_t uint32_t sbaddress[4]; uint32_t sbdata[4]; + uint32_t challenge; + const uint32_t secret = 1; + processor_t *current_proc() const; void reset(); bool perform_abstract_command();