Skip to content

Commit

Permalink
Update to new Xen core platform stack
Browse files Browse the repository at this point in the history
Update vchan-xen to the interface changes in the new Xen core
platform stack.

Part of mirage/mirage#1159, depends on mirage/mirage-xen#23.
  • Loading branch information
mato committed Jul 24, 2020
1 parent 4bbeacd commit 70abe3b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion vchan-xen.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ depends: [
"io-page"
"mirage-flow" {>= "2.0.0"}
"xenstore" {>= "1.2.2"}
"mirage-xen" {>= "5.0.0"}
"mirage-xen" {>= "6.0.0"}
"xenstore_transport" {>= "1.0.0"}
"sexplib"
"cmdliner"
Expand Down
2 changes: 1 addition & 1 deletion xen/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name vchan_xen)
(public_name vchan-xen)
(libraries lwt xen-evtchn xenstore xenstore.client mirage-xen mirage-flow vchan)
(libraries lwt xenstore xenstore.client mirage-xen mirage-flow vchan)
(wrapped false)
(preprocess (pps ppx_sexp_conv)))
26 changes: 13 additions & 13 deletions xen/events_xen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ let port_of_string x =

let string_of_port = string_of_int

type channel = Eventchn.t
let sexp_of_channel x = Sexplib.Sexp.Atom (string_of_int (Eventchn.to_int x))
type channel = OS.Eventchn.t
let sexp_of_channel x = Sexplib.Sexp.Atom (string_of_int (OS.Eventchn.to_int x))

type event = OS.Activations.event
let sexp_of_event _ = Sexplib.Sexp.Atom "<event>"
Expand All @@ -37,21 +37,21 @@ let initial = OS.Activations.program_start
let recv = OS.Activations.after

let send channel =
let h = Eventchn.init () in
Eventchn.notify h channel
let h = OS.Eventchn.init () in
OS.Eventchn.notify h channel

let listen domid =
let h = Eventchn.init () in
let port = Eventchn.bind_unbound_port h domid in
Eventchn.unmask h port;
Eventchn.to_int port, port
let h = OS.Eventchn.init () in
let port = OS.Eventchn.bind_unbound_port h domid in
OS.Eventchn.unmask h port;
OS.Eventchn.to_int port, port

let connect domid port =
let h = Eventchn.init () in
let port' = Eventchn.bind_interdomain h domid port in
Eventchn.unmask h port';
let h = OS.Eventchn.init () in
let port' = OS.Eventchn.bind_interdomain h domid port in
OS.Eventchn.unmask h port';
port'

let close channel =
let h = Eventchn.init () in
Eventchn.unbind h channel
let h = OS.Eventchn.init () in
OS.Eventchn.unbind h channel

0 comments on commit 70abe3b

Please sign in to comment.