1 /* Definitions to support devices that can handle exceptions.
2    Copyright 2001, 2003 Brian R. Gaeke.
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 _DEVICEEXC_H_
21 #define _DEVICEEXC_H_
22 
23 #include "accesstypes.h"
24 #include "types.h"
25 
26 /* An abstract class which describes a device that can handle exceptions. */
27 
28 class DeviceExc {
29 public:
30 	/* This message notifies the device that an exception of type EXCCODE
31 	   has been generated. The memory access (if any) is of type MODE,
32 	   and the coprocessor that generated it (if any) is COPROCNO. */
33     virtual void exception(uint16 excCode, int mode = ANY,
34 		int coprocno = -1) = 0;
~DeviceExc()35     virtual ~DeviceExc() { }
36 
37 	/* A flag which says whether an exception is ready to be handled. */
38 	bool exception_pending;
39 };
40 
41 #endif /* _DEVICEEXC_H_ */
42