X-Git-Url: http://git.buserror.net/cgi-bin/gitweb.cgi?p=polintos%2Fscott%2Fpriv.git;a=blobdiff_plain;f=idl%2Faddrspace.idl;h=6b2e44b061de9ae4dce295697dad71c27fd6aced;hp=d26a681d4c39b5af70a5666f92ffddd926f4bd6b;hb=9a0f3d7f714ebabb437c30863548146b307527b7;hpb=5ee1a4b6695c7889466f97d42b8c416b080b361d diff --git a/idl/addrspace.idl b/idl/addrspace.idl index d26a681..6b2e44b 100644 --- a/idl/addrspace.idl +++ b/idl/addrspace.idl @@ -178,7 +178,25 @@ bitfield MapFlags { // then, before the write takes place, copy the object. // It is undefined whether this mapping will receive // the copy or the original. - + + Snapshot, // The mapped object will also be made CopyOnWrite, so + // that any writes to the mapped page via any mapping + // will cause a fault. Thus, after the snapshot, the + // only changes that will be visible will be through + // the new mapping. This is ideal for things like fork() + // and file versioning, and is used by AddrSpace.clone(). + // + // If not set, then only the new mapping will be + // CopyOnWrite, so if another mapping updates the page + // before a write occurs through this mapping (thus + // breaking CopyOnWrite), the change will be visible in + // the new mapping. This is ideal for private + // mappings, where all that is desired is that the new + // mapping cannot change the underlying object (while + // keeping the mapping writeable). + // + // Ignored if CopyOnWrite is not set. + AccessFlags access:3, // These are the requested read/write/execute // permissions on the mapping. A missing permission (or @@ -222,11 +240,17 @@ interface AddrSpace { // By default, the old address space continues to be backed by // whatever Mappables were in use, and pages in the new address space // are backed by anonymous memory when a page in either is written to. - // If old_space_is_anon is true, though, this is reversed, which is useful + // If flags.Reverse is true, though, this is reversed, which is useful // when versioning a file to make the new version the one that gets // stored to disk. + // + // The upstream address space is also marked as copy-on - clone(AddrSpace addrspace out, bool clone_is_real); + clone(AddrSpace addrspace out, CloneFlags flags); + + bitfield CloneFlags { + Reverse + }; // Mappable must be implemented by the local kernel, and must hold // read/write/exec permissions appropriate for the MapFlags given.