1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
//
// bus/controller.h: System bus controller.
//
// CEN64: Cycle-Accurate Nintendo 64 Emulator.
// Copyright (C) 2015, Tyler J. Stachecki.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#ifndef __bus_controller_h__
#define __bus_controller_h__
#include "common.h"
#include "bus/memorymap.h"
#include <setjmp.h>
struct ai_controller;
struct dd_controller;
struct pi_controller;
struct ri_controller;
struct si_controller;
struct vi_controller;
struct rdp;
struct rsp;
struct vr4300;
struct bus_controller {
struct ai_controller *ai;
struct dd_controller *dd;
struct pi_controller *pi;
struct ri_controller *ri;
struct si_controller *si;
struct vi_controller *vi;
struct rdp *rdp;
struct rsp *rsp;
struct vr4300 *vr4300;
// For resolving physical address ranges to devices.
struct memory_map map;
// Allows to to pop back out into device_run during simulation.
// Kind of a hack to put this in with the device "bus", but at
// least everyone gets access to it this way.
jmp_buf unwind_data;
};
cen64_cold int bus_init(struct bus_controller *bus);
// General-purpose accesssor functions.
cen64_flatten cen64_hot int bus_read_word(void *component,
uint32_t address, uint32_t *word);
cen64_flatten cen64_hot int bus_write_word(void *component,
uint32_t address, uint32_t word, uint32_t dqm);
// For asserting and deasserting RCP interrupts.
enum rcp_interrupt_mask;
int raise_rcp_interrupt(struct bus_controller *bus,
enum rcp_interrupt_mask mask);
#endif
|