fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
1/*****************************************************************************
2 * pce *
3 *****************************************************************************/
4
5/*****************************************************************************
6 * File name: src/arch/simarm/simarm.h *
7 * Created: 2004-11-04 by Hampa Hug <hampa@hampa.ch> *
8 * Copyright: (C) 2004-2011 Hampa Hug <hampa@hampa.ch> *
9 * Copyright: (C) 2004-2006 Lukas Ruf <ruf@lpr.ch> *
10 *****************************************************************************/
11
12/*****************************************************************************
13 * This program is free software. You can redistribute it and / or modify it *
14 * under the terms of the GNU General Public License version 2 as published *
15 * by the Free Software Foundation. *
16 * *
17 * This program is distributed in the hope that it will be useful, but *
18 * WITHOUT ANY WARRANTY, without even the implied warranty of *
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
20 * Public License for more details. *
21 *****************************************************************************/
22
23/*****************************************************************************
24 * This software was developed at the Computer Engineering and Networks *
25 * Laboratory (TIK), Swiss Federal Institute of Technology (ETH) Zurich. *
26 *****************************************************************************/
27
28
29#ifndef PCE_SIMARM_SIMARM_H
30#define PCE_SIMARM_SIMARM_H 1
31
32
33#include <stdio.h>
34
35#include "intc.h"
36#include "pci.h"
37#include "timer.h"
38
39#include <devices/memory.h>
40#include <devices/nvram.h>
41#include <devices/serport.h>
42#include <devices/ata.h>
43#include <devices/pci-ata.h>
44
45#include <cpu/arm/arm.h>
46
47#include <libini/libini.h>
48
49#include <lib/brkpt.h>
50
51
52/*****************************************************************************
53 * @short The simarm context struct
54 *****************************************************************************/
55typedef struct simarm_s {
56 arm_t *cpu;
57
58 memory_t *mem;
59 mem_blk_t *ram;
60 nvram_t *nvr;
61
62 ixp_intc_t *intc;
63 ixp_timer_t *timer;
64
65 serport_t *serport[2];
66 unsigned sercons;
67
68 disks_t *dsks;
69
70 pci_ixp_t *pci;
71 pci_ata_t pciata;
72
73 ini_sct_t *cfg;
74
75 bp_set_t bps;
76
77 int bigendian;
78
79 unsigned long rclk_interval;
80
81 unsigned long long clk_cnt;
82 unsigned long clk_div[4];
83
84 unsigned brk;
85} simarm_t;
86
87
88/*****************************************************************************
89 * @short Create a new simarm context
90 * @param ini A libini simarm section. Can be NULL.
91 *****************************************************************************/
92simarm_t *sarm_new (ini_sct_t *ini);
93
94/*****************************************************************************
95 * @short Delete a simarm context
96 *****************************************************************************/
97void sarm_del (simarm_t *sim);
98
99/*****************************************************************************
100 * @short Get the number of clock cycles
101 * @return The number of clock cycles the simarm went through since the last
102 * initialization
103 *****************************************************************************/
104unsigned long long sarm_get_clkcnt (simarm_t *sim);
105
106void sarm_clock_discontinuity (simarm_t *sim);
107
108/*****************************************************************************
109 * @short Reset the simulator
110 *****************************************************************************/
111void sarm_reset (simarm_t *sim);
112
113/*****************************************************************************
114 * @short Clock the simulator
115 * @param n The number of clock cycles. Must not be 0.
116 *****************************************************************************/
117void sarm_clock (simarm_t *sim, unsigned n);
118
119/*****************************************************************************
120 * @short Interrupt the emulator
121 * @param val The type of break (see PCE_BRK_* constants)
122 *
123 * This is a hack
124 *****************************************************************************/
125void sarm_break (simarm_t *sim, unsigned char val);
126
127/*****************************************************************************
128 * Don't use.
129 *****************************************************************************/
130void sarm_set_keycode (simarm_t *sim, unsigned char val);
131
132int sarm_set_msg (simarm_t *sim, const char *msg, const char *val);
133
134
135#endif