1 /* Headers for Control/Status Register emulation. 2 Copyright 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 /* Memory-mapped device representing the Control/Status Register 21 * in the DEC 5000/200 (KN02). 22 */ 23 24 #ifndef _DECCSR_H_ 25 #define _DECCSR_H_ 26 27 #include "devicemap.h" 28 #include "deviceint.h" 29 30 static const unsigned char TURBOchannelSlot0CSRInt = (1 << 0); 31 static const unsigned char TURBOchannelSlot1CSRInt = (1 << 1); 32 static const unsigned char TURBOchannelSlot2CSRInt = (1 << 2); 33 static const unsigned char Reserved0CSRInt = (1 << 3); 34 static const unsigned char Reserved1CSRInt = (1 << 4); 35 static const unsigned char SCSIInterfaceCSRInt = (1 << 5); 36 static const unsigned char EthernetInterfaceCSRInt = (1 << 6); 37 static const unsigned char SystemInterfaceCSRInt = (1 << 7); 38 39 class DECCSRDevice : public DeviceMap, public DeviceInt { 40 uint32 robits; 41 uint32 rwbits; 42 uint8 ioint; 43 uint32 leds; 44 uint32 irq; 45 uint32 update_status_reg(); 46 void update_control_reg(uint32 data); 47 public: 48 void assertInt (uint8 line); 49 void deassertInt (uint8 line); DECCSRDevice(uint32 irq_)50 DECCSRDevice (uint32 irq_) : irq (irq_) { extent = 0x80000; } 51 uint32 fetch_word(uint32 offset, int mode, DeviceExc *client); 52 void store_word(uint32 offset, uint32 data, DeviceExc *client); descriptor_str()53 const char *descriptor_str() const { return "DECstation 5000/200 CSR"; } 54 }; 55 56 #endif /* _DECCSR_H_ */ 57