From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/gio/gcancel.x | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sys/gio/gcancel.x (limited to 'sys/gio/gcancel.x') diff --git a/sys/gio/gcancel.x b/sys/gio/gcancel.x new file mode 100644 index 00000000..30e53ce5 --- /dev/null +++ b/sys/gio/gcancel.x @@ -0,0 +1,32 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include + +# GCANCEL -- Cancel any buffered graphics output (as far as possible). Should +# be called by interrupt handlers to avoid leaving GIO in a funny state +# following an interrupt. +# +# As far as possible, GKI instructions are built up in internal storage and +# written to the output file in a single write. This decreases the likliehood +# of leaving a botched instruction in the output stream in response to an +# interrupt. Do not call FSETI to cancel the file output because that will +# almost certainly guarantee a botched instruction. Instead, we discard any +# partially built polylines still in GPL storage and append the GKI_CANCEL to +# the output instruction stream. The cancel instruction is passed on to the +# graphics kernel which eventually calls FSETI to cancel its output file +# buffer (containing device instructions). If a metacode reader does detect +# a botched instruction it will scan forward for the next BOI to try to resync +# the instruction stream. + +procedure gcancel (gp) + +pointer gp # graphics descriptor +int and() + +begin + if (and (GP_GFLAGS(gp), GF_WSOPEN) != 0) { + call gki_cancel (GP_FD(gp)) + call gki_fflush (GP_FD(gp)) + } + call gfrinit (gp) +end -- cgit