All of lore.kernel.org
 help / color / mirror / Atom feed
From: D Scott Phillips <d.scott.phillips@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 15/29] lib/igt_aux: add null implementation
Date: Tue, 10 Dec 2019 16:52:21 -0800	[thread overview]
Message-ID: <20191211005235.67897-16-d.scott.phillips@intel.com> (raw)
In-Reply-To: <20191211005235.67897-1-d.scott.phillips@intel.com>

igt_aux depends on Linux specific functionality like udev, sysfs,
and others. Add a do-nothing implementation of the same API for
inclusion on other platforms.

Signed-off-by: D Scott Phillips <d.scott.phillips@intel.com>
---
 lib/igt_aux_null.c | 139 +++++++++++++++++++++++++++++++++++++++++++++
 lib/meson.build    |  11 +++-
 2 files changed, 149 insertions(+), 1 deletion(-)
 create mode 100644 lib/igt_aux_null.c

diff --git a/lib/igt_aux_null.c b/lib/igt_aux_null.c
new file mode 100644
index 00000000..b83217e4
--- /dev/null
+++ b/lib/igt_aux_null.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include "igt_aux.h"
+
+void igt_fork_signal_helper(void) {
+}
+
+void igt_stop_signal_helper(void) {
+}
+
+void igt_suspend_signal_helper(void) {
+}
+
+void igt_resume_signal_helper(void) {
+}
+
+void igt_fork_shrink_helper(int fd) {
+}
+
+void igt_stop_shrink_helper(void) {
+}
+
+void igt_fork_hang_detector(int fd) {
+}
+
+void igt_stop_hang_detector(void) {
+}
+
+bool __igt_sigiter_continue(struct __igt_sigiter *iter, bool interrupt) {
+	return false;
+}
+
+void igt_exchange_int(void *array, unsigned i, unsigned j) {
+	igt_swap(((int *)array)[i], ((int *)array)[j]);
+}
+
+void igt_exchange_int64(void *array, unsigned i, unsigned j) {
+	igt_swap(((int64_t *)array)[i], ((int64_t *)array)[j]);
+}
+
+void igt_permute_array(void *array, unsigned size,
+			   void (*exchange_func)(void *array,
+						 unsigned i,
+						 unsigned j)) {
+}
+
+void igt_progress(const char *header, uint64_t i, uint64_t total) {
+}
+
+void igt_print_activity(void) {
+}
+
+bool igt_check_boolean_env_var(const char *env_var, bool default_value) {
+	return false;
+}
+
+bool igt_aub_dump_enabled(void) {
+	return false;
+}
+
+void igt_system_suspend_autoresume(enum igt_suspend_state state,
+				   enum igt_suspend_test test) {
+}
+
+void igt_set_autoresume_delay(int delay_secs) {
+}
+
+int igt_get_autoresume_delay(enum igt_suspend_state state) {
+	return 1;
+}
+
+void igt_drop_root(void) {
+}
+
+void igt_debug_wait_for_keypress(const char *var) {
+}
+
+void igt_debug_manual_check(const char *var, const char *expected) {
+}
+
+void igt_lock_mem(size_t size) {
+}
+
+void igt_unlock_mem(void) {
+}
+
+void igt_start_siglatency(int sig) {
+}
+
+double igt_stop_siglatency(struct igt_mean *result) {
+	return 1.0;
+}
+
+bool igt_allow_unlimited_files(void) {
+	return true;
+}
+
+void igt_set_module_param(const char *name, const char *val) {
+}
+
+void igt_set_module_param_int(const char *name, int val) {
+}
+
+int igt_is_process_running(const char *comm) {
+	return 0;
+}
+
+int igt_terminate_process(int sig, const char *comm) {
+	return 0;
+}
+
+void igt_lsof(const char *dpath) {
+}
+
+uint64_t vfs_file_max(void) {
+	return 1;
+}
diff --git a/lib/meson.build b/lib/meson.build
index 25ea62d5..6a56fff0 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -11,7 +11,6 @@ lib_sources = [
 	'igt_debugfs.c',
 	'igt_device.c',
 	'igt_device_scan.c',
-	'igt_aux.c',
 	'igt_gt.c',
 	'igt_halffloat.c',
 	'igt_matrix.c',
@@ -67,6 +66,16 @@ lib_sources = [
 	'veboxcopy_gen12.c',
 ]
 
+if host_machine.system() == 'linux'
+	lib_sources += [
+		'igt_aux.c',
+	]
+else
+	lib_sources += [
+		'igt_aux_null.c',
+	]
+endif
+
 lib_deps = [
 	cairo,
 	glib,
-- 
2.23.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-12-11  0:59 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  0:52 [igt-dev] [PATCH i-g-t 00/30] Add FreeBSD Support D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 01/29] Remove unused includes D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 02/29] lib/igt_chipset: Add missing libdrm dependency D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 03/29] lib/igt_core: update longjmp buffers to type sigjmp_buf D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 04/29] Include <sys/wait.h>, <limits.h>, and <signal.h> where appropriate D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 05/29] Use /bin/sh for shell scripts D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 06/29] tools/intel_gpu_top: Use POSIX signal handler type definition D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 07/29] kms_atomic: change `PAGE_SIZE` to `page_size` D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 08/29] lib: remove open-coded card index fetching D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 09/29] igt: replace mmap64() with mmap() D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 10/29] drm-uapi: patch sync_file.h to depend on drm.h D Scott Phillips
2019-12-12 11:01   ` Jani Nikula
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 11/29] i915/pm_backlight: use POSIX basename D Scott Phillips
2019-12-16 13:31   ` Petri Latvala
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 12/29] Include Linux specific headers only on Linux D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 13/29] lib/igt_core: skip oom_adjustments on non-Linux platforms D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 14/29] i915/gem: Omit Linux-specific madvise, mmap, and sched flags on non-Linux D Scott Phillips
2019-12-11  0:52 ` D Scott Phillips [this message]
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 16/29] lib/igt_kmod: add null implementation D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 17/29] lib/igt_perf: " D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 18/29] runner: Add support for non-Linux operating systems D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 19/29] Use ETIMEDOUT in place of ETIME on FreeBSD D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 20/29] ilog2: Use libc provided fls() " D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 21/29] lib: undefine FreeBSD libc's ALIGN macro D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 22/29] lib: Add FreeBSD-specific pthread logic D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 23/29] lib/igt_kms: Add FreeBSD support D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 24/29] lib/ioctl_wrappers: Support FreeBSD in igt_require_gem D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 25/29] lib/intel_os: Implement get_avail_ram and get_total_swap for FreeBSD D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 26/29] lib/igt_device: Implement get_card_index " D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 27/29] lib/igt_debugfs: Implement mount() " D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 28/29] build: Add support for building on non-Linux D Scott Phillips
2019-12-11  0:52 ` [igt-dev] [PATCH i-g-t 29/29] lib/igt_device_scan: add null implementation D Scott Phillips
2019-12-11  8:11 ` [igt-dev] ✗ GitLab.Pipeline: warning for Add FreeBSD Support Patchwork
2019-12-12 11:14 ` [igt-dev] [PATCH i-g-t 00/30] " Jani Nikula
2019-12-12 18:20   ` D Scott Phillips
2019-12-16 13:55     ` Petri Latvala
2019-12-27  9:38       ` Arkadiusz Hiler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191211005235.67897-16-d.scott.phillips@intel.com \
    --to=d.scott.phillips@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.