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; --- 78 unchanged lines hidden (view full) --- 87 DPRINTF(I8042, "Sending mouse interrupt.\n"); 88 mouseIntPin->raise(); 89 //This is a hack 90 mouseIntPin->lower(); 91 } 92} 93 94void |
95X86ISA::PS2Device::serialize(const std::string &base, CheckpointOut &cp) const 96{ 97 paramOut(cp, base + ".lastCommand", lastCommand); 98 99 std::vector<uint8_t> buffer(outBuffer.size()); 100 std::copy(outBuffer.begin(), outBuffer.end(), buffer.begin()); 101 arrayParamOut(cp, base + ".outBuffer.elts", buffer); 102} 103 104void 105X86ISA::PS2Device::unserialize(const std::string &base, CheckpointIn &cp) 106{ 107 paramIn(cp, base + ".lastCommand", lastCommand); 108 109 std::vector<uint8_t> buffer; 110 arrayParamIn(cp, base + ".outBuffer.elts", buffer); 111 assert(outBuffer.empty()); 112 for (auto c : buffer) 113 outBuffer.push_back(c); 114} 115 116 117void |
118X86ISA::PS2Device::ack() 119{ 120 bufferData(&CommandAck, sizeof(CommandAck)); 121} 122 123void 124X86ISA::PS2Device::nack() 125{ 126 bufferData(&CommandNack, sizeof(CommandNack)); 127} 128 129void 130X86ISA::PS2Device::bufferData(const uint8_t *data, int size) 131{ 132 assert(data || size == 0); 133 while (size) { |
134 outBuffer.push_back(*(data++)); |
135 size--; 136 } 137} 138 139uint8_t 140X86ISA::I8042::readDataOut() 141{ 142 uint8_t data = dataReg; --- 338 unchanged lines hidden (view full) --- 481 } else { 482 panic("Write to unrecognized port %#x.\n", addr); 483 } 484 pkt->makeAtomicResponse(); 485 return latency; 486} 487 488void |
489X86ISA::I8042::serialize(CheckpointOut &cp) const |
490{ 491 uint8_t statusRegData = statusReg.__data; 492 uint8_t commandByteData = commandByte.__data; 493 494 SERIALIZE_SCALAR(dataPort); 495 SERIALIZE_SCALAR(commandPort); 496 SERIALIZE_SCALAR(statusRegData); 497 SERIALIZE_SCALAR(commandByteData); --- 18 unchanged lines hidden (view full) --- 516 mouse.unserialize("mouse", cp); 517 keyboard.unserialize("keyboard", cp); 518 519 statusReg.__data = statusRegData; 520 commandByte.__data = commandByteData; 521} 522 523void |
524X86ISA::PS2Mouse::serialize(const std::string &base, CheckpointOut &cp) const |
525{ |
526 PS2Device::serialize(base, cp); |
527 |
528 paramOut(cp, base + ".status", status); |
529 paramOut(cp, base + ".resolution", resolution); 530 paramOut(cp, base + ".sampleRate", sampleRate); 531} 532 533void 534X86ISA::PS2Mouse::unserialize(const std::string &base, CheckpointIn &cp) 535{ |
536 PS2Device::unserialize(base, cp); 537 538 paramIn(cp, base + ".status", status); |
539 paramIn(cp, base + ".resolution", resolution); 540 paramIn(cp, base + ".sampleRate", sampleRate); |
541} 542 543X86ISA::I8042 * 544I8042Params::create() 545{ 546 return new X86ISA::I8042(this); 547} |