generic_timer.cc (12975:f521b0fcc17c) generic_timer.cc (13230:2988dc5d1d6f)
1/*
2 * Copyright (c) 2013, 2015, 2017-2018 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

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

578 value = timerRead(addr - timerRange.start(), size);
579 } else {
580 panic("Invalid address: 0x%x\n", addr);
581 }
582
583 DPRINTF(Timer, "Read 0x%x <- 0x%x(%i)\n", value, addr, size);
584
585 if (size == 8) {
1/*
2 * Copyright (c) 2013, 2015, 2017-2018 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

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

578 value = timerRead(addr - timerRange.start(), size);
579 } else {
580 panic("Invalid address: 0x%x\n", addr);
581 }
582
583 DPRINTF(Timer, "Read 0x%x <- 0x%x(%i)\n", value, addr, size);
584
585 if (size == 8) {
586 pkt->set(value);
586 pkt->setLE<uint64_t>(value);
587 } else if (size == 4) {
587 } else if (size == 4) {
588 pkt->set(value);
588 pkt->setLE<uint32_t>(value);
589 } else {
590 panic("Unexpected access size: %i\n", size);
591 }
592
593 return 0;
594}
595
596Tick
597GenericTimerMem::write(PacketPtr pkt)
598{
599 const unsigned size(pkt->getSize());
600 if (size != 8 && size != 4)
601 panic("Unexpected access size\n");
602
603 const Addr addr(pkt->getAddr());
604 const uint64_t value(size == 8 ?
589 } else {
590 panic("Unexpected access size: %i\n", size);
591 }
592
593 return 0;
594}
595
596Tick
597GenericTimerMem::write(PacketPtr pkt)
598{
599 const unsigned size(pkt->getSize());
600 if (size != 8 && size != 4)
601 panic("Unexpected access size\n");
602
603 const Addr addr(pkt->getAddr());
604 const uint64_t value(size == 8 ?
605 pkt->get<uint64_t>() : pkt->get<uint32_t>());
605 pkt->getLE<uint64_t>() : pkt->getLE<uint32_t>());
606
607 DPRINTF(Timer, "Write 0x%x -> 0x%x(%i)\n", value, addr, size);
608 if (ctrlRange.contains(addr)) {
609 ctrlWrite(addr - ctrlRange.start(), size, value);
610 } else if (timerRange.contains(addr)) {
611 timerWrite(addr - timerRange.start(), size, value);
612 } else {
613 panic("Invalid address: 0x%x\n", addr);

--- 250 unchanged lines hidden ---
606
607 DPRINTF(Timer, "Write 0x%x -> 0x%x(%i)\n", value, addr, size);
608 if (ctrlRange.contains(addr)) {
609 ctrlWrite(addr - ctrlRange.start(), size, value);
610 } else if (timerRange.contains(addr)) {
611 timerWrite(addr - timerRange.start(), size, value);
612 } else {
613 panic("Invalid address: 0x%x\n", addr);

--- 250 unchanged lines hidden ---