i8254.cc (5827:ac2c268bf4f1) i8254.cc (5898:541097c69e22)
1/*
2 * Copyright (c) 2008 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;

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

51 Addr offset = pkt->getAddr() - pioAddr;
52 if (offset < 3) {
53 pkt->set(pit.readCounter(offset));
54 } else if (offset == 3) {
55 pkt->set(uint8_t(-1));
56 } else {
57 panic("Read from undefined i8254 register.\n");
58 }
1/*
2 * Copyright (c) 2008 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;

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

51 Addr offset = pkt->getAddr() - pioAddr;
52 if (offset < 3) {
53 pkt->set(pit.readCounter(offset));
54 } else if (offset == 3) {
55 pkt->set(uint8_t(-1));
56 } else {
57 panic("Read from undefined i8254 register.\n");
58 }
59 pkt->makeAtomicResponse();
59 return latency;
60}
61
62Tick
63X86ISA::I8254::write(PacketPtr pkt)
64{
65 assert(pkt->getSize() == 1);
66 Addr offset = pkt->getAddr() - pioAddr;
67 if (offset < 3) {
68 pit.writeCounter(offset, pkt->get<uint8_t>());
69 } else if (offset == 3) {
70 pit.writeControl(pkt->get<uint8_t>());
71 } else {
72 panic("Write to undefined i8254 register.\n");
73 }
60 return latency;
61}
62
63Tick
64X86ISA::I8254::write(PacketPtr pkt)
65{
66 assert(pkt->getSize() == 1);
67 Addr offset = pkt->getAddr() - pioAddr;
68 if (offset < 3) {
69 pit.writeCounter(offset, pkt->get<uint8_t>());
70 } else if (offset == 3) {
71 pit.writeControl(pkt->get<uint8_t>());
72 } else {
73 panic("Write to undefined i8254 register.\n");
74 }
75 pkt->makeAtomicResponse();
74 return latency;
75}
76
77X86ISA::I8254 *
78I8254Params::create()
79{
80 return new X86ISA::I8254(this);
81}
76 return latency;
77}
78
79X86ISA::I8254 *
80I8254Params::create()
81{
82 return new X86ISA::I8254(this);
83}