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

Use typed pointer for MI interfaces of VR4300 #137

Merged
merged 1 commit into from
Dec 14, 2019
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions vr4300/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ void signal_rcp_interrupt(struct vr4300 *vr4300, enum rcp_interrupt_mask mask) {
}

// Reads a word from the MI MMIO register space.
int read_mi_regs(void *opaque, uint32_t address, uint32_t *word) {
struct vr4300 *vr4300 = (struct vr4300 *) opaque;
int read_mi_regs(struct vr4300 *vr4300, uint32_t address, uint32_t *word) {
uint32_t offset = address - MI_REGS_BASE_ADDRESS;
enum mi_register reg = (offset >> 2);

Expand All @@ -99,8 +98,7 @@ int read_mi_regs(void *opaque, uint32_t address, uint32_t *word) {
}

// Writes a word to the MI MMIO register space.
int write_mi_regs(void *opaque, uint32_t address, uint32_t word, uint32_t dqm) {
struct vr4300 *vr4300 = (struct vr4300 *) opaque;
int write_mi_regs(struct vr4300 *vr4300, uint32_t address, uint32_t word, uint32_t dqm) {
uint32_t offset = address - MI_REGS_BASE_ADDRESS;
enum mi_register reg = (offset >> 2);
uint32_t result;
Expand Down
4 changes: 2 additions & 2 deletions vr4300/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ cen64_cold void vr4300_cycle_extra(struct vr4300 *vr4300, struct vr4300_stats *s
uint64_t vr4300_get_register(struct vr4300 *vr4300, size_t i);
uint64_t vr4300_get_pc(struct vr4300 *vr4300);

int read_mi_regs(void *opaque, uint32_t address, uint32_t *word);
int write_mi_regs(void *opaque, uint32_t address, uint32_t word, uint32_t dqm);
int read_mi_regs(struct vr4300 *vr4300, uint32_t address, uint32_t *word);
int write_mi_regs(struct vr4300 *vr4300, uint32_t address, uint32_t word, uint32_t dqm);

void clear_rcp_interrupt(struct vr4300 *vr4300, enum rcp_interrupt_mask mask);
void signal_rcp_interrupt(struct vr4300 *vr4300, enum rcp_interrupt_mask mask);
Expand Down