Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dtm.h with switch_to_* functions #1477

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions fesvr/dtm.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ class dtm_t : public htif_t

void producer_thread();

void switch_to_host() {
// update the target with the current context
target = context_t::current();
host.switch_to();
}

protected:
virtual void read_chunk(addr_t taddr, size_t len, void* dst) override;
virtual void write_chunk(addr_t taddr, size_t len, const void* src) override;
Expand All @@ -74,6 +80,10 @@ class dtm_t : public htif_t
void resume(int);
uint32_t get_data_base() { return data_base; };

void switch_to_target() {
target->switch_to();
}

private:
context_t host;
context_t* target;
Expand Down
Loading