import "objects/process.def"

# A ``vma`` object represents a single virtual memory area, which may be shared
# between several processes. A process having a handle to a ``vma`` does not
# necessarily mean that it is mapped into that process' virtual memory space.

object vma : object {
    uid d6a12b63b3ed3937
    cname vm_area

    capabilities [
        map
        unmap
        resize
    ]

    method create [constructor] {
        param size size
        param flags uint32
    }

    method create_map [constructor cap:map] {
        param size size
        param address address [inout]
        param flags uint32
    }

    method map [cap:map] {
        param process ref process [optional]
        param address address [inout]
        param flags uint32
    }

    method unmap [cap:unmap] {
        param process ref process [optional]
    }

    method resize [cap:resize] {
        param size size [inout]  # New size for the VMA, or 0 to query the current size without changing
    }
}
