+static int
+mlx5_glue_query_rt_values(void *ctx, void *devx_clock)
+{
+ struct mlx5_context *mlx5_ctx;
+ struct mlx5_devx_clock *clock;
+ int err;
+
+ if (!ctx) {
+ errno = EINVAL;
+ return errno;
+ }
+ mlx5_ctx = (struct mlx5_context *)ctx;
+ clock = (struct mlx5_devx_clock *)devx_clock;
+ err = devx_hca_clock_query(
+ mlx5_ctx->devx_ctx,
+ &clock->p_iseg_internal_timer,
+ &clock->clock_frequency_hz,
+ &clock->is_stable_clock_frequency);
+ if (err) {
+ errno = err;
+ return errno;
+ }
+ return 0;
+}
+
+static int
+mlx5_glue_devx_init_showdown_event(void *ctx)
+{
+ struct mlx5_context *mlx5_ctx;
+ int err;
+
+ if (!ctx) {
+ errno = EINVAL;
+ return errno;
+ }
+ mlx5_ctx = (struct mlx5_context *)ctx;
+ err = devx_query_shutdown_event(mlx5_ctx->devx_ctx,
+ &mlx5_ctx->shutdown_event_obj);
+ if (err) {
+ errno = err;
+ return errno;
+ }
+ return 0;
+}
+