projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8dfa45e
)
dev: IDE Disk: Handle bad IDE image size
author
Dongxue Zhang
<elta.era@gmail.com>
Tue, 15 Sep 2015 13:14:07 +0000
(08:14 -0500)
committer
Dongxue Zhang
<elta.era@gmail.com>
Tue, 15 Sep 2015 13:14:07 +0000
(08:14 -0500)
Handle bad IDE disk image size 0. When image size is 0, gem5 will cause an
exception with log "Floating point exception (core dumped)".
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
src/dev/ide_disk.cc
patch
|
blob
|
history
diff --git
a/src/dev/ide_disk.cc
b/src/dev/ide_disk.cc
index 7298da52173eeb66fe2ccf79f287a4382a8f397d..2c8dfceb1adf159ee58af87f70a228dab59fb372 100644
(file)
--- a/
src/dev/ide_disk.cc
+++ b/
src/dev/ide_disk.cc
@@
-90,6
+90,8
@@
IdeDisk::IdeDisk(const Params *p)
} else {
if (lba_size >= 63)
sectors = 63;
+ else if (lba_size == 0)
+ panic("Bad IDE image size: 0\n");
else
sectors = lba_size;