mem.isa (12616:4b463b4dc098) | mem.isa (13233:ded73a80b0b4) |
---|---|
1// -*- mode:c++ -*- 2 3// Copyright (c) 2007 MIPS Technologies, Inc. 4// All rights reserved. 5// 6// Redistribution and use in source and binary forms, with or without 7// modification, are permitted provided that the following conditions are 8// met: redistributions of source code must retain the above copyright --- 95 unchanged lines hidden (view full) --- 104output exec {{ 105 /** return data in cases where there the size of data is only 106 known in the packet 107 */ 108 uint64_t getMemData(ExecContext *xc, Packet *packet) { 109 switch (packet->getSize()) 110 { 111 case 1: | 1// -*- mode:c++ -*- 2 3// Copyright (c) 2007 MIPS Technologies, Inc. 4// All rights reserved. 5// 6// Redistribution and use in source and binary forms, with or without 7// modification, are permitted provided that the following conditions are 8// met: redistributions of source code must retain the above copyright --- 95 unchanged lines hidden (view full) --- 104output exec {{ 105 /** return data in cases where there the size of data is only 106 known in the packet 107 */ 108 uint64_t getMemData(ExecContext *xc, Packet *packet) { 109 switch (packet->getSize()) 110 { 111 case 1: |
112 return packet->get | 112 return packet->getLE<uint8_t>(); |
113 114 case 2: | 113 114 case 2: |
115 return packet->get | 115 return packet->getLE<uint16_t>(); |
116 117 case 4: | 116 117 case 4: |
118 return packet->get | 118 return packet->getLE<uint32_t>(); |
119 120 case 8: | 119 120 case 8: |
121 return packet->get | 121 return packet->getLE<uint64_t>(); |
122 123 default: 124 std::cerr << "bad store data size = " << packet->getSize() << std::endl; 125 126 assert(0); 127 return 0; 128 } 129 } --- 426 unchanged lines hidden --- | 122 123 default: 124 std::cerr << "bad store data size = " << packet->getSize() << std::endl; 125 126 assert(0); 127 return 0; 128 } 129 } --- 426 unchanged lines hidden --- |