rtc_pl031.cc (9808:13ffc0066b76) rtc_pl031.cc (10565:23593fdaadcd)
1/*
2 * Copyright (c) 2010-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 48 unchanged lines hidden (view full) ---

57
58
59Tick
60PL031::read(PacketPtr pkt)
61{
62 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr + pioSize);
63 assert(pkt->getSize() == 4);
64 Addr daddr = pkt->getAddr() - pioAddr;
1/*
2 * Copyright (c) 2010-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 48 unchanged lines hidden (view full) ---

57
58
59Tick
60PL031::read(PacketPtr pkt)
61{
62 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr + pioSize);
63 assert(pkt->getSize() == 4);
64 Addr daddr = pkt->getAddr() - pioAddr;
65 pkt->allocate();
66 uint32_t data;
67
68 DPRINTF(Timer, "Reading from RTC at offset: %#x\n", daddr);
69
70 switch (daddr) {
71 case DataReg:
72 data = timeVal + ((curTick() - lastWrittenTick) / SimClock::Int::s);
73 break;

--- 46 unchanged lines hidden (view full) ---

120}
121
122Tick
123PL031::write(PacketPtr pkt)
124{
125 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr + pioSize);
126 assert(pkt->getSize() == 4);
127 Addr daddr = pkt->getAddr() - pioAddr;
65 uint32_t data;
66
67 DPRINTF(Timer, "Reading from RTC at offset: %#x\n", daddr);
68
69 switch (daddr) {
70 case DataReg:
71 data = timeVal + ((curTick() - lastWrittenTick) / SimClock::Int::s);
72 break;

--- 46 unchanged lines hidden (view full) ---

119}
120
121Tick
122PL031::write(PacketPtr pkt)
123{
124 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr + pioSize);
125 assert(pkt->getSize() == 4);
126 Addr daddr = pkt->getAddr() - pioAddr;
128 pkt->allocate();
129 DPRINTF(Timer, "Writing to RTC at offset: %#x\n", daddr);
130
131 switch (daddr) {
132 case DataReg:
133 break;
134 case MatchReg:
135 matchVal = pkt->get<uint32_t>();
136 resyncMatch();

--- 112 unchanged lines hidden ---
127 DPRINTF(Timer, "Writing to RTC at offset: %#x\n", daddr);
128
129 switch (daddr) {
130 case DataReg:
131 break;
132 case MatchReg:
133 matchVal = pkt->get<uint32_t>();
134 resyncMatch();

--- 112 unchanged lines hidden ---