Skip to content

Commit

Permalink
Make cap legalisation neater
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterRugg committed Oct 20, 2020
1 parent 6b07062 commit eb53bf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cheri_cap_common.sail
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ function getCapLegalised(c) : Capability -> Capability =
& (base <_u (to_bits(cap_len_width, 1) << cap_addr_width)) then
c
else
/* Legalise the capability by zeroing the ie bit, implicitly setting E to 0. TODO avoid 90 magic number */
capBitsToCapability(false, capToBits(c) & ~(to_bits(128, 1) << 90))
/* Legalise the capability by zeroing the ie bit, implicitly setting E to 0. */
encCapabilityToCapability(false, {capToEncCap(c) with internal_e = bitzero})

function getCapBoundsBits(c) : Capability -> (CapAddrBits, CapLenBits) =
let c_legal = getCapLegalised(c) in
Expand Down

0 comments on commit eb53bf8

Please sign in to comment.