diff options
author | bd <bdunahu@operationnull.com> | 2025-03-21 16:42:16 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-21 16:42:16 -0400 |
commit | a29cd5297d2d66f05ea91d05175fdc9fd4b2fef3 (patch) | |
tree | 9386aa3ccd2302fceb9750858d74ab56f156b4e2 /inc/dram.h | |
parent | 431cba9a4bcef0e0ae047d45a7f3d98e601e30ed (diff) |
add 'process' function to handle boilerplate on every request
Diffstat (limited to 'inc/dram.h')
-rw-r--r-- | inc/dram.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -32,6 +32,18 @@ class Dram : public Storage private: /** + * Helper for all access methods. + * Calls `request_handler` when `accessor` is allowed to complete its + * request cycle. + * @param the source making the request + * @param the address to write to + * @param the function to call when an access should be completed + */ + Response process( + Accessor accessor, + int address, + std::function<void(int line, int word)> request_handler); + /** * Returns OK if `accessor` is allowed to complete its request this cycle. * Handles wait times, side door, and setting the current accessor this * storage is serving. |