From c761aaae652b101959a6f5e182b67f841727de85 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 23 Aug 2005 11:45:52 -0400 Subject: Lots of fixes to serialization and naming of various device objects. The improper serialization of arrays was particularly bad. dev/alpha_console.cc: dev/isa_fake.cc: dev/ns_gige.cc: dev/pciconfigall.cc: dev/tsunami_cchip.cc: dev/tsunami_io.cc: dev/tsunami_pchip.cc: the pio interface is a different simobject and should have a different name. dev/ethertap.cc: fix serialization. dev/ide_ctrl.cc: - the pio interface is a different simobject and should have a different name. - properly initialize variables - When serializing an array, the size is the number of elements, not the number of bytes! dev/pcidev.cc: When serializing an array, the size is the number of elements, not the number of bytes! dev/tsunami_io.hh: Don't make objects SimObjects if they're not exposed to python. Don't add serialization functions to events, it's generally not what you want. allow the real time clock and interval timer to serialize themselves, must pass a base name since it is not a SimObject and the values will be going into the section of the parent. --HG-- extra : convert_revision : 3fc5de9b858ed770c8f385cf38b53242cf859c33 --- dev/ethertap.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'dev/ethertap.cc') diff --git a/dev/ethertap.cc b/dev/ethertap.cc index fdd2425fc..7589991ef 100644 --- a/dev/ethertap.cc +++ b/dev/ethertap.cc @@ -270,7 +270,8 @@ EtherTap::serialize(ostream &os) { SERIALIZE_SCALAR(socket); SERIALIZE_SCALAR(buflen); - SERIALIZE_ARRAY((uint8_t *)buffer,buflen); + uint8_t *buffer = (uint8_t *)this->buffer; + SERIALIZE_ARRAY(buffer, buflen); SERIALIZE_SCALAR(buffer_offset); SERIALIZE_SCALAR(data_len); @@ -290,7 +291,8 @@ EtherTap::unserialize(Checkpoint *cp, const std::string §ion) { UNSERIALIZE_SCALAR(socket); UNSERIALIZE_SCALAR(buflen); - UNSERIALIZE_ARRAY((uint8_t *)buffer,buflen); + uint8_t *buffer = (uint8_t *)this->buffer; + UNSERIALIZE_ARRAY(buffer, buflen); UNSERIALIZE_SCALAR(buffer_offset); UNSERIALIZE_SCALAR(data_len); -- cgit v1.2.3