diff options
author | Benjamin Nash <benash@umich.edu> | 2005-07-13 12:30:13 -0400 |
---|---|---|
committer | Benjamin Nash <benash@umich.edu> | 2005-07-13 12:30:13 -0400 |
commit | 32b52fe7126091692c0a76314bb3692fa3f70d27 (patch) | |
tree | 70a8172ea171a31ffc88c683eadeb1a9f1175c9a /dev/pciconfigall.cc | |
parent | 6d7911dea0a4f60cbe6726416a9e3248843cc03b (diff) | |
download | gem5-32b52fe7126091692c0a76314bb3692fa3f70d27.tar.xz |
Various changes to m5/dev files to work with FreeBSD.
dev/ide_ctrl.cc:
dev/ide_disk.cc:
dev/pcidev.cc:
Made endian-independent.
dev/ide_disk.hh:
fixed.
dev/pciconfigall.cc:
The data to write is contained in a 32-bit unsigned int now. The union method would not have worked on big-endian machines.
dev/pcidev.hh:
Fixed typo.
dev/tsunami_io.cc:
Return zero on RTC alarm reads.
dev/uart8250.cc:
Fix uart interrupt handling.
--HG--
extra : convert_revision : b5c08e8e77644c399c20888666406805ff1b6649
Diffstat (limited to 'dev/pciconfigall.cc')
-rw-r--r-- | dev/pciconfigall.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/dev/pciconfigall.cc b/dev/pciconfigall.cc index 7d86c3e1b..6a4d60d1b 100644 --- a/dev/pciconfigall.cc +++ b/dev/pciconfigall.cc @@ -152,21 +152,17 @@ PciConfigAll::write(MemReqPtr &req, const uint8_t *data) int func = (daddr >> 8) & 0x7; int reg = daddr & 0xFF; - union { - uint8_t byte_value; - uint16_t half_value; - uint32_t word_value; - }; + uint32_t word_value = 0; if (devices[device][func] == NULL) panic("Attempting to write to config space on non-existant device\n"); else { switch (req->size) { case sizeof(uint8_t): - byte_value = *(uint8_t*)data; + word_value = *(uint8_t*)data & 0x000000FF; break; case sizeof(uint16_t): - half_value = *(uint16_t*)data; + word_value = *(uint16_t*)data & 0x0000FFFF; break; case sizeof(uint32_t): word_value = *(uint32_t*)data; |