From 2333824daac5cdd5cf3051a26c05e9e1322670a0 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 5 Jan 2016 15:46:24 -0700 Subject: [PATCH] Add interrupts_p and OS_select_registry_entry for glib/glibio.c. --- src/microcode/pruxffi.c | 12 +++++++++++- src/microcode/uxio.c | 11 +++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/microcode/pruxffi.c b/src/microcode/pruxffi.c index da48d278e..f6c3ca54e 100644 --- a/src/microcode/pruxffi.c +++ b/src/microcode/pruxffi.c @@ -685,7 +685,7 @@ DEFINE_PRIMITIVE ("RETURN-TO-C", Prim_return_to_c, 0, 0, 0) } } -/* This is mainly for src/gtk/gtkio.c, so it does not need to include +/* This is mainly for src/glib/glibio.c, so it does not need to include prim.h, scheme.h and everything. */ void abort_to_c (void) @@ -1086,3 +1086,13 @@ DEFINE_PRIMITIVE ("OUTF-ERROR", Prim_outf_error, 1, 1, 0) PRIMITIVE_RETURN (UNSPECIFIC); } } + +int +interrupts_p (void) +{ + /* Just the pending interrupts bitmap, ignoring the INT_MASK. */ + /* This is mainly for src/glib/glibio.c, which finds pending_ + interrupts_p() useless; it is always /gc-ok. */ + + return (GET_INT_CODE); +} diff --git a/src/microcode/uxio.c b/src/microcode/uxio.c index 12e9ef3cf..6c3a01d6d 100644 --- a/src/microcode/uxio.c +++ b/src/microcode/uxio.c @@ -538,6 +538,17 @@ OS_select_registry_length (select_registry_t registry) return (SR_N_FDS (r)); } +void +OS_select_registry_entry (select_registry_t registry, + unsigned int index, + int * fd_r, + unsigned int * mode_r) +{ + struct select_registry_s * r = registry; + (*fd_r) = ((SR_ENTRY (r, index)) -> fd); + (*mode_r) = (ENCODE_MODE ((SR_ENTRY (r, index)) -> events)); +} + void OS_select_registry_result (select_registry_t registry, unsigned int index, -- 2.25.1