From 8e30c4574b468b9ef920d46683f1e29055a77bf0 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Wed, 12 Dec 2018 00:37:48 +0000 Subject: [PATCH] firmware: Treat timestamps consistently as signed [nfc] This matches other functions and the ARTIQ Python side, but isn't actually an ABI change. --- artiq/firmware/ksupport/rtio.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/artiq/firmware/ksupport/rtio.rs b/artiq/firmware/ksupport/rtio.rs index 27e893a97..8c112ea50 100644 --- a/artiq/firmware/ksupport/rtio.rs +++ b/artiq/firmware/ksupport/rtio.rs @@ -94,7 +94,7 @@ mod imp { } } - pub extern fn input_timestamp(timeout: i64, channel: i32) -> u64 { + pub extern fn input_timestamp(timeout: i64, channel: i32) -> i64 { unsafe { csr::rtio::target_write((channel as u32) << 8); csr::rtio::i_timeout_write(timeout as u64); @@ -111,7 +111,7 @@ mod imp { channel as i64, 0, 0); } if status & RTIO_I_STATUS_WAIT_EVENT != 0 { - return !0 + return -1 } if status & RTIO_I_STATUS_DESTINATION_UNREACHABLE != 0 { raise!("RTIODestinationUnreachable", @@ -119,7 +119,7 @@ mod imp { channel as i64, 0, 0); } - csr::rtio::i_timestamp_read() + csr::rtio::i_timestamp_read() as i64 } } @@ -200,7 +200,7 @@ mod imp { unimplemented!("not(has_rtio)") } - pub extern fn input_timestamp(_timeout: i64, _channel: i32) -> u64 { + pub extern fn input_timestamp(_timeout: i64, _channel: i32) -> i64 { unimplemented!("not(has_rtio)") }