i8042.cc (12653:4f6b6c1a8e2f) | i8042.cc (13229:b45254f2733a) |
---|---|
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; --- 104 unchanged lines hidden (view full) --- 113Tick 114X86ISA::I8042::read(PacketPtr pkt) 115{ 116 assert(pkt->getSize() == 1); 117 Addr addr = pkt->getAddr(); 118 if (addr == dataPort) { 119 uint8_t data = readDataOut(); 120 //DPRINTF(I8042, "Read from data port got %#02x.\n", data); | 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; --- 104 unchanged lines hidden (view full) --- 113Tick 114X86ISA::I8042::read(PacketPtr pkt) 115{ 116 assert(pkt->getSize() == 1); 117 Addr addr = pkt->getAddr(); 118 if (addr == dataPort) { 119 uint8_t data = readDataOut(); 120 //DPRINTF(I8042, "Read from data port got %#02x.\n", data); |
121 pkt->set | 121 pkt->setLE<uint8_t>(data); |
122 } else if (addr == commandPort) { 123 //DPRINTF(I8042, "Read status as %#02x.\n", (uint8_t)statusReg); | 122 } else if (addr == commandPort) { 123 //DPRINTF(I8042, "Read status as %#02x.\n", (uint8_t)statusReg); |
124 pkt->set | 124 pkt->setLE<uint8_t>((uint8_t)statusReg); |
125 } else { 126 panic("Read from unrecognized port %#x.\n", addr); 127 } 128 pkt->makeAtomicResponse(); 129 return latency; 130} 131 132Tick 133X86ISA::I8042::write(PacketPtr pkt) 134{ 135 assert(pkt->getSize() == 1); 136 Addr addr = pkt->getAddr(); | 125 } else { 126 panic("Read from unrecognized port %#x.\n", addr); 127 } 128 pkt->makeAtomicResponse(); 129 return latency; 130} 131 132Tick 133X86ISA::I8042::write(PacketPtr pkt) 134{ 135 assert(pkt->getSize() == 1); 136 Addr addr = pkt->getAddr(); |
137 uint8_t data = pkt->get | 137 uint8_t data = pkt->getLE<uint8_t>(); |
138 if (addr == dataPort) { 139 statusReg.commandLast = 0; 140 switch (lastCommand) { 141 case NoCommand: 142 keyboard->hostWrite(data); 143 if (keyboard->hostDataAvailable()) 144 writeData(keyboard->hostRead(), false); 145 break; --- 157 unchanged lines hidden --- | 138 if (addr == dataPort) { 139 statusReg.commandLast = 0; 140 switch (lastCommand) { 141 case NoCommand: 142 keyboard->hostWrite(data); 143 if (keyboard->hostDataAvailable()) 144 writeData(keyboard->hostRead(), false); 145 break; --- 157 unchanged lines hidden --- |