summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-11-14 04:55:30 -0800
committerNathan Binkert <nate@binkert.org>2008-11-14 04:55:30 -0800
commit5711282f87afb609c79d657ed6aa8c9259b5b827 (patch)
tree399daee55331d1a8b0664a4a7d7d493f3b027708 /src/base
parent7a4d75bae31cfe2064fe0718c7f982f769659b3c (diff)
downloadgem5-5711282f87afb609c79d657ed6aa8c9259b5b827.tar.xz
Fix a bunch of bugs I introduced when I changed the flags stuff for packets.
I did some of the flags and assertions wrong. Thanks to Brad Beckmann for pointing this out. I should have run the opt regressions instead of the fast. I also screwed up some of the logical functions in the Flags class.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/flags.hh8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/base/flags.hh b/src/base/flags.hh
index 7cf6ef9c6..712b65319 100644
--- a/src/base/flags.hh
+++ b/src/base/flags.hh
@@ -61,16 +61,14 @@ class Flags
bool any() const { return _flags; }
bool any(Type flags) const { return (_flags & flags); }
- bool all() const { return (~_flags); }
- bool all(Type flags) const { return (_flags & flags) != flags; }
+ bool all() const { return !(~_flags); }
+ bool all(Type flags) const { return (_flags & flags) == flags; }
bool none() const { return _flags == 0; }
bool none(Type flags) const { return (_flags & flags) == 0; }
- bool exact(Type flags) const { return _flags = flags; }
void clear() { _flags = 0; }
void clear(Type flags) { _flags &= ~flags; }
- void reset(Type flags) { _flags = flags;}
void set(Type flags) { _flags |= flags; }
- void set(Type f, bool val) { _flags = (_flags & f) | (val ? f : 0); }
+ void set(Type f, bool val) { _flags = (_flags & ~f) | (val ? f : 0); }
void
update(Type flags, Type mask)
{