1 /* Declaration of the halt device.
2    Copyright 2002 Paul Twohey.
3 
4 This file is part of VMIPS.
5 
6 VMIPS is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2 of the License, or (at your
9 option) any later version.
10 
11 VMIPS is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15 
16 You should have received a copy of the GNU General Public License along
17 with VMIPS; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
19 
20 #ifndef _HALTDEV_H_
21 #define _HALTDEV_H_
22 
23 #include "devicemap.h"
24 class vmips;
25 
26 class HaltDevice : public DeviceMap
27 {
28 public:
29 	HaltDevice( vmips *machine );
30 	virtual ~HaltDevice();
31 
32 	/* Ignore vaild reads. */
33 	virtual uint32 fetch_word(uint32 offset, int mode, DeviceExc *client);
34 
35 	/* Halt the machine when a non zero word is written. */
36 	virtual void store_word(uint32 offset, uint32 data, DeviceExc *client);
37 
38 	/* Return a string describing the device. */
39 	const char *descriptor_str();
40 
41 protected:
42 	vmips	*machine;
43 };
44 
45 #endif /* _HALTDEV_H_ */
46