diff options
author | Tim Newsome <tim@sifive.com> | 2018-03-07 17:17:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 17:17:39 -0800 |
commit | 94651bf1001514d13c0f651564098caba31d07f4 (patch) | |
tree | 949d7e13d9d2491381e510369c6ddd376e9ee739 /riscv/debug_module.h | |
parent | 499199741a599fccca1e5609f95d78a502fa2cbd (diff) | |
parent | 652c09194986fa3d313fba0cea551a2362d2111f (diff) | |
download | spike-94651bf1001514d13c0f651564098caba31d07f4.zip spike-94651bf1001514d13c0f651564098caba31d07f4.tar.gz spike-94651bf1001514d13c0f651564098caba31d07f4.tar.bz2 |
Merge pull request #177 from riscv/debug_auth
Add debug module authentication.
Diffstat (limited to 'riscv/debug_module.h')
-rw-r--r-- | riscv/debug_module.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/riscv/debug_module.h b/riscv/debug_module.h index 82c449e..813c647 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(); |