-/* This file is part of the program GDB, the GU debugger.
+/* This file is part of the program GDB, the GNU debugger.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sim-main.h"
-#include "hw-base.h"
+#include "hw-main.h"
/* DEVICE
Implements the external mn10300 functionality. This includes the
- delivery of of interrupts generated from other devices and the
+ delivery of interrupts generated from other devices and the
handling of device specific registers.
ack (output)
Output signal indicating that the processor is delivering a level
- interrupt. The value passed with the event specfies the level of
+ interrupt. The value passed with the event specifies the level of
the interrupt being delivered.
struct mn103cpu {
struct mn103cpu_block block;
- hw_event *pending_handler;
+ struct hw_event *pending_handler;
int pending_level;
int pending_nmi;
int pending_reset;
};
-/* input port ID's */
+/* output port ID's */
enum {
ACK_PORT,
/* Finish off the partially created hw device. Attach our local
callbacks. Wire up our port names etc */
-static hw_io_read_buffer_callback mn103cpu_io_read_buffer;
-static hw_io_write_buffer_callback mn103cpu_io_write_buffer;
-static hw_port_event_callback mn103cpu_port_event;
+static hw_io_read_buffer_method mn103cpu_io_read_buffer;
+static hw_io_write_buffer_method mn103cpu_io_write_buffer;
+static hw_port_event_method mn103cpu_port_event;
static void
attach_mn103cpu_regs (struct hw *me,
else if (controller->pending_nmi)
{
controller->pending_nmi = 0;
- store_half (SP - 4, CIA_GET (cpu));
+ store_word (SP - 4, CIA_GET (cpu));
store_half (SP - 8, PSW);
PSW &= ~PSW_IE;
SP = SP - 8;
{
/* Don't clear pending level. Request continues to be pending
until the interrupt controller clears/changes it */
- store_half (SP - 4, CIA_GET (cpu));
+ store_word (SP - 4, CIA_GET (cpu));
store_half (SP - 8, PSW);
PSW &= ~PSW_IE;
PSW &= ~PSW_LM;
SP = SP - 8;
CIA_SET (cpu, 0x40000000 + controller->interrupt_vector[controller->pending_level]);
HW_TRACE ((me, "port-out ack %d", controller->pending_level));
- hw_port_event (me, ACK_PORT, controller->pending_level, NULL, NULL_CIA);
+ hw_port_event (me, ACK_PORT, controller->pending_level);
HW_TRACE ((me, "int level=%d pc=0x%08lx psw=0x%04x sp=0x%08lx",
controller->pending_level,
(long) CIA_GET (cpu), (unsigned) PSW, (long) SP));
int my_port,
struct hw *source,
int source_port,
- int level,
- sim_cpu *processor,
- sim_cia cia)
+ int level)
{
struct mn103cpu *controller = hw_data (me);
void *dest,
int space,
unsigned_word base,
- unsigned nr_bytes,
- sim_cpu *processor,
- sim_cia cia)
+ unsigned nr_bytes)
{
struct mn103cpu *controller = hw_data (me);
unsigned16 val = 0;
const void *source,
int space,
unsigned_word base,
- unsigned nr_bytes,
- sim_cpu *cpu,
- sim_cia cia)
+ unsigned nr_bytes)
{
struct mn103cpu *controller = hw_data (me);
unsigned16 val;
}
-const struct hw_device_descriptor dv_mn103cpu_descriptor[] = {
+const struct hw_descriptor dv_mn103cpu_descriptor[] = {
{ "mn103cpu", mn103cpu_finish, },
{ NULL },
};