1
0

diplomacy: report cacheability in ResourceAddress

This commit is contained in:
Wesley W. Terpstra 2017-06-01 23:25:26 -07:00
parent 985d9750e6
commit ae8734da05
3 changed files with 5 additions and 4 deletions

View File

@ -26,9 +26,9 @@ object JSON
} }
private def helper(res: ResourceValue)(implicit path: Map[String, String]): Seq[String] = res match { private def helper(res: ResourceValue)(implicit path: Map[String, String]): Seq[String] = res match {
case ResourceAddress(address, r, w, x) => case ResourceAddress(address, r, w, x, c) =>
AddressRange.fromSets(address).map { case AddressRange(base, size) => AddressRange.fromSets(address).map { case AddressRange(base, size) =>
s"""{"base":${base},"size":${size},"r":${r},"w":${w},"x":${x}}"""} s"""{"base":${base},"size":${size},"r":${r},"w":${w},"x":${x},"c":${c}}"""}
case ResourceMapping(address, offset) => case ResourceMapping(address, offset) =>
AddressRange.fromSets(address).map { case AddressRange(base, size) => AddressRange.fromSets(address).map { case AddressRange(base, size) =>
s"""{"base":${base},"size":${size},"offset":${offset}}"""} s"""{"base":${base},"size":${size},"offset":${offset}}"""}

View File

@ -7,7 +7,7 @@ import config._
import scala.collection.immutable.{ListMap,SortedMap} import scala.collection.immutable.{ListMap,SortedMap}
sealed trait ResourceValue sealed trait ResourceValue
final case class ResourceAddress(address: Seq[AddressSet], r: Boolean, w: Boolean, x: Boolean) extends ResourceValue final case class ResourceAddress(address: Seq[AddressSet], r: Boolean, w: Boolean, x: Boolean, c: Boolean) extends ResourceValue
final case class ResourceMapping(address: Seq[AddressSet], offset: BigInt) extends ResourceValue final case class ResourceMapping(address: Seq[AddressSet], offset: BigInt) extends ResourceValue
final case class ResourceInt(value: BigInt) extends ResourceValue final case class ResourceInt(value: BigInt) extends ResourceValue
final case class ResourceString(value: String) extends ResourceValue final case class ResourceString(value: String) extends ResourceValue

View File

@ -60,7 +60,8 @@ case class TLManagerParameters(
ResourceAddress(address, ResourceAddress(address,
r = supportsAcquireB || supportsGet, r = supportsAcquireB || supportsGet,
w = supportsAcquireT || supportsPutFull, w = supportsAcquireT || supportsPutFull,
x = executable) x = executable,
c = supportsAcquireB)
} }
} }