- (2) - If the top 64 bits are non-zero and the representation is
COMPACT, the capability has the following format:
+ <address> [<permissions>,<base>-<top>] (<attr>)
+
- (3) - If the top 64 bits are non-zero and the representation is not
COMPACT, the capability has the following format:
range_str += "-";
range_str += core_addr_to_string_nz (get_limit ());
- std::string attr_str ("");
+ std::string attr1_str ("");
+ std::string attr2_str ("");
+ std::string attr3_str ("");
/* Handle attributes. */
if (get_tag () == false)
- attr_str = "invalid ";
+ attr1_str = "invalid";
if (get_otype () == CAP_SEAL_TYPE_RB)
- attr_str += "sentry ";
+ {
+ if (!attr1_str.empty ())
+ attr2_str += ",";
+ attr2_str += "sentry";
+ }
if (is_sealed ())
- attr_str += "sealed ";
-
- cap_str += "{";
- cap_str = val_str + " [" + perm_str + "," + range_str + "]";
-
- if (!attr_str.empty ())
- cap_str += " ( " + attr_str + ")";
+ {
+ if (!attr1_str.empty () || !attr2_str.empty ())
+ attr3_str += ",";
+ attr3_str += "sealed";
+ }
- cap_str += "}";
+ cap_str += val_str + " [" + perm_str + "," + range_str + "]";
+ cap_str += " (" + attr1_str + attr2_str + attr3_str + ")";
return cap_str;
}
inline bool is_sealed (void)
{
- return check_permissions (CAP_PERM_SEAL);
+ return get_otype () != 0;
}
/* Returns true if this is a system access capability.