1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 23 unchanged lines hidden (view full) --- 32 33/** @file 34 * Tsunami I/O Space mapping including RTC/timer interrupts 35 */ 36 37#ifndef __DEV_TSUNAMI_IO_HH__ 38#define __DEV_TSUNAMI_IO_HH__ 39 |
40#include "base/range.hh" 41#include "dev/alpha/tsunami.hh" |
42#include "dev/io_device.hh" 43#include "params/TsunamiIO.hh" |
44#include "sim/eventq.hh" 45 46/** 47 * Tsunami I/O device is a catch all for all the south bridge stuff we care 48 * to implement. 49 */ 50class TsunamiIO : public BasicPioDevice 51{ --- 29 unchanged lines hidden (view full) --- 81 const std::string &name() const { return _name; } 82 83 /** RTC periodic interrupt event */ 84 RTCEvent event; 85 86 /** Current RTC register address/index */ 87 int addr; 88 |
89 /** Data for real-time clock function */ 90 union { 91 uint8_t clock_data[10]; 92 93 struct { 94 uint8_t sec; 95 uint8_t sec_alrm; 96 uint8_t min; --- 10 unchanged lines hidden (view full) --- 107 /** RTC status register A */ 108 uint8_t stat_regA; 109 110 /** RTC status register B */ 111 uint8_t stat_regB; 112 113 public: 114 RTC(const std::string &name, Tsunami* tsunami, |
115 const TsunamiIOParams *params); |
116 117 /** RTC address port: write address of RTC RAM data to access */ 118 void writeAddr(const uint8_t data); 119 120 /** RTC write data */ 121 void writeData(const uint8_t data); 122 123 /** RTC read data */ --- 182 unchanged lines hidden (view full) --- 306 307 public: 308 /** 309 * Return the freqency of the RTC 310 * @return interrupt rate of the RTC 311 */ 312 Tick frequency() const; 313 |
314 public: |
315 typedef TsunamiIOParams Params; |
316 /** 317 * Initialize all the data for devices supported by Tsunami I/O. 318 * @param p pointer to Params struct 319 */ |
320 TsunamiIO(const Params *p); |
321 |
322 const Params * 323 params() const 324 { 325 return dynamic_cast<const Params *>(_params); 326 } 327 |
328 virtual Tick read(PacketPtr pkt); 329 virtual Tick write(PacketPtr pkt); 330 331 /** 332 * Post an PIC interrupt to the CPU via the CChip 333 * @param bitvector interrupt to post. 334 */ 335 void postPIC(uint8_t bitvector); --- 23 unchanged lines hidden --- |