CLEANFILES+= ${ORIG_UNPAGED_OBJS}
-SRCS+= mpx.S arch_clock.c arch_do_vmctl.c arch_system.c \
+SRCS+= mpx.S arch_clock.c arch_do_vmctl.c arch_system.c do_padconf.c \
omap_serial.c omap_timer.c omap_padconf.c omap_intr.c omap_rtc.c \
omap_reset.c exception.c klib.S memory.c \
protect.c direct_tty_utils.c arch_reset.c \
--- /dev/null
+# Makefile for the sys_padconf test.
+
+.include <bsd.own.mk>
+
+PROG= padconftest
+SRCS= padconftest.c
+
+DPADD+= ${LIBSYS}
+LDADD+= -lsys
+
+MAN=
+
+BINDIR?= /usr/tests/minix-posix
+
+.include "${NETBSDSRCDIR}/drivers/Makefile.inc"
+.include <minix.service.mk>
--- /dev/null
+/* Test for sys_padconf() */
+#include <errno.h>
+#include <stdio.h>
+#include <minix/com.h>
+#include <minix/syslib.h>
+#include <minix/padconf.h>
+#include <minix/drivers.h>
+#include <assert.h>
+
+static unsigned int failures = 0;
+
+/*
+ * padconf is only supported on ARM. On other systems sys_padconf() should
+ * return -EBADREQUEST.
+ */
+static void test_badrequest(void)
+{
+#if !defined(__arm__)
+ int r;
+
+ r = sys_padconf(0xffffffff, 0xffffffff, 0xffffffff);
+ if (r != -EBADREQUEST) {
+ printf("Expected r=%d | Got r=%d\n", -EBADREQUEST, r);
+ failures++;
+ }
+#endif
+ return;
+}
+
+static void do_tests(void)
+{
+ test_badrequest();
+}
+
+static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
+{
+ do_tests();
+
+ /* The returned code will determine the outcome of the RS call, and
+ * thus the entire test. The actual error code does not matter.
+ */
+ return (failures) ? EINVAL : 0;
+}
+
+static void sef_local_startup(void)
+{
+ sef_setcb_init_fresh(sef_cb_init_fresh);
+
+ sef_startup();
+}
+
+int main(int argc, char **argv)
+{
+ env_setargs(argc, argv);
+
+ sef_local_startup();
+
+ return 0;
+}