From nobody Sun Dec 31 00:07:16 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T2fYw5pZMz55bb1; Sun, 31 Dec 2023 00:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T2fYw476tz4sSh; Sun, 31 Dec 2023 00:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703981236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w99mff9dtCepcT4kIGC4mqsMweFi/GcHmrmmYj4uuBk=; b=JOKOWIvg1VAJT97zL8OeIGj7R7Cm0aXRkxqmN5lAv33uFm3VzPqKr+EIWw9QcC/3Yg+gsj F3J7FuDD0vQG4ta/nLAo+8l/K3fPeTnlkcmYOZy4gzPpJe6/WbMW2R5zIXe/c1oQRc9mOs XB7XueeeYzlyl4NHayPWfN0xVJyNpbZ47wvWZl0vV4K67HZAMvLI9SYPi3LUOwMuhItM+h 4zKDW5E6KIdcvCXL3xwu/5RQuuRMF9byJv5I/Riw7A23tsrQYqq6254Pk/kWikVHDFGzJp 6AZqbgCGtFZT8I/vwnGsDh1Tw1mTA6fX+Lkpwl84eG0K60bd7IHbLmTjvssixw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703981236; a=rsa-sha256; cv=none; b=WChSNG2WsmnNfKe4uBWPwPG6awCbycYS1wOe/AzUuf8GR60RO0K/cIXf9d3enImxm70xmv 58u+TpstS7NbkKuKtqml9guMSR3MdhZXCrTTLFOTG/msae8WKrX+nmiqYLQoJjYFbcej2K 45IbWQBnNWR2318M3pZdmPpHN+QjzaCB2tUAAjcUQs4vPiX0qu5SYf1OY0bX3KfOf78e6D 6qbLmD2IoHppmp15B2C5pPeXc0Ec25tTOgp/kxGBmBXj539PhhvzVE5IXvbkrBMFAYijn5 U/71zgVvQ/bcyFQMi59WNkNsxC6eqyjJfd5vLMnmNmrpkGxfOJKrAnP2cVMaBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703981236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w99mff9dtCepcT4kIGC4mqsMweFi/GcHmrmmYj4uuBk=; b=ePDNG/Vz53Mps9dWVJCG28dsSbgvdrsjsXDgDDgml5wOLt/qKODiV1Lc9UHLxRbq8X5dno w7/Fnuxpnbzw8jVK16CFoxG/XP69qaYLrQexdnHffIeDwMVvg4uSxC57v+ioEBWUt03hu1 w2nc5H1dm3binBoFb9eSsd4z2VaKQmj3bm7/kdJVmwuCT7Pe9oIErpnpu65sYeHBHrBV0S xu9vlhvbV3Ov3xs10HN5bIaRGMHixJCbOa8XHSrKcQQJr/8XrtC7647fzsSDe/gPswSXDY xhuF8+t7FEF9eqhYLcp9KLQG/GsGrPV3ltZsvZVTPFDjCbTUUHUYQssZkSX1lA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T2fYw2xh0z1B4J; Sun, 31 Dec 2023 00:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BV07G68093424; Sun, 31 Dec 2023 00:07:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BV07GCD093421; Sun, 31 Dec 2023 00:07:16 GMT (envelope-from git) Date: Sun, 31 Dec 2023 00:07:16 GMT Message-Id: <202312310007.3BV07GCD093421@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: 83a04250c023 - main - emulators/rtc: Remove expired port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83a04250c023241a27e61f6393fd8f06338cc752 Auto-Submitted: auto-generated The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/ports/commit/?id=83a04250c023241a27e61f6393fd8f06338cc752 commit 83a04250c023241a27e61f6393fd8f06338cc752 Author: Muhammad Moinur Rahman AuthorDate: 2023-12-29 20:58:53 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2023-12-31 00:06:12 +0000 emulators/rtc: Remove expired port 2023-12-31 emulators/rtc: Driver doesn't actually work with current FreeBSD versions --- MOVED | 1 + emulators/Makefile | 1 - emulators/rtc/Makefile | 31 ---- emulators/rtc/files/Makefile | 35 ---- emulators/rtc/files/rtc.c | 361 ---------------------------------------- emulators/rtc/files/rtc.h | 13 -- emulators/rtc/files/rtc_linux.c | 71 -------- emulators/rtc/files/test.c | 56 ------- emulators/rtc/pkg-descr | 4 - emulators/rtc/pkg-message | 19 --- emulators/rtc/pkg-plist | 3 - 11 files changed, 1 insertion(+), 594 deletions(-) diff --git a/MOVED b/MOVED index de5eafebdb57..cea836a809ef 100644 --- a/MOVED +++ b/MOVED @@ -8192,3 +8192,4 @@ databases/mysqlwsrep57-server||2023-12-31|Depends on upstream EOL MySQL 5.7 net-mgmt/glpi-plugins-fusioninventory-server||2023-12-31|Has expired: Requires php80 which is set to expire on 2023-11-26 x11-fonts/fontmatrix||2023-12-31|Has expired: Depends on deprecated www/qt5-webkit cad/jspice3||2023-12-31|Has expired: BROKEN for more than 2 years on all supported versions after the EOL of 12 +emulators/rtc||2023-12-31|Has expired: Driver doesn't actually work with current FreeBSD versions diff --git a/emulators/Makefile b/emulators/Makefile index 4400f75a31c9..b7d4f1087041 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -121,7 +121,6 @@ SUBDIR += ripes SUBDIR += riscv-isa-sim SUBDIR += rpcs3 - SUBDIR += rtc SUBDIR += rubygem-fission SUBDIR += sameboy SUBDIR += simh diff --git a/emulators/rtc/Makefile b/emulators/rtc/Makefile deleted file mode 100644 index 66e5009b17f3..000000000000 --- a/emulators/rtc/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -PORTNAME= rtc -PORTVERSION= 2020.07.07.1 -PORTREVISION= 1 -CATEGORIES= emulators linux -MASTER_SITES= # none -DISTFILES= # none - -MAINTAINER= ports@FreeBSD.org -COMMENT= Kernel module which provides /dev/rtc device support - -LICENSE= BSD2CLAUSE - -DEPRECATED= Driver doesn't actually work with current FreeBSD versions -EXPIRATION_DATE= 2023-12-31 - -USES= kmod uidfix - -WRKSRC= ${WRKDIR}/files - -MAKE_ARGS= KMODDIR="${KMODDIR}" - -do-extract: - @${MKDIR} ${WRKSRC} - @cd ${FILESDIR} && ${CP} Makefile *.[ch] ${WRKSRC}/ - -post-install: - ${INSTALL_DATA} ${WRKSRC}/rtc.h ${STAGEDIR}${PREFIX}/include - ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} - ${INSTALL_DATA} ${WRKSRC}/test.c ${STAGEDIR}${EXAMPLESDIR} - -.include diff --git a/emulators/rtc/files/Makefile b/emulators/rtc/files/Makefile deleted file mode 100644 index 37f5744b61f0..000000000000 --- a/emulators/rtc/files/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2000 Vladimir N.Silyaev -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -SYS?= /sys -KMOD= rtc -SRCS= rtc.c rtc_linux.c vnode_if.h - -INCLUDE= -I${.CURDIR} -I${SYS} - -CFLAGS+= ${INCLUDE} - -all: vnode_if.h - -.include diff --git a/emulators/rtc/files/rtc.c b/emulators/rtc/files/rtc.c deleted file mode 100644 index 13e0f467e2f2..000000000000 --- a/emulators/rtc/files/rtc.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Copyright by Vladimir N. Silyaev 2000 - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $vmFreeBSD: vmware/vmnet-only/freebsd/vmnet.c,v 1.14 2000/01/23 22:29:50 vsilyaev Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "rtc.h" - -#ifdef MODULE_DEPEND -MODULE_DEPEND(rtc, linux, 1, 1, 1); -#endif - -#define DEVICE_NAME "rtc" - -enum rtc_log_level {Lenter=0, Lexit=1, Linfo, Lwarning, Lfail}; -#define DEBUG 0 -#if DEBUG -#define DEB(x) x -#define DLog(level, fmt, args...) printf("%s: " fmt "\n", __FUNCTION__ , ##args) -#else /* !DEBUG */ -#define DEB(x) -#define DLog(level, fmt, args...) -#endif /* DEBUG */ - -struct rtc_softc { - struct cdev *dev; /* Back reference to device */ - struct { - int freq; - struct { - unsigned int opened:1; - unsigned int enabled:1; - } flags; - struct callout rtc_handle; - struct timespec lasttime; - struct selinfo sip; - unsigned long woken; - void *rtc_ident; - } var; -}; - -static d_open_t rtc_open; -static d_close_t rtc_close; -static d_ioctl_t rtc_ioctl; -static d_poll_t rtc_poll; -static d_read_t rtc_read; - -static void rtc_callback(void *xtp); -static int rtc_modeevent(module_t mod, int cmd, void *arg); - -static struct cdevsw rtc_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, - .d_open = rtc_open, - .d_close = rtc_close, - .d_ioctl = rtc_ioctl, - .d_poll = rtc_poll, - .d_read = rtc_read, - .d_name = DEVICE_NAME, -}; - -/* - * Now declare the module to the system. - * IMPORTANT: Must be before netgraph node declaration. - */ -DEV_MODULE(rtc, rtc_modeevent, 0); - -/* -=-=-=-=-=-=-=-=-= attach/detach device stuff -=-=-=-=-=-=-=-=-= */ - -static struct rtc_softc * -rtc_attach(struct cdev *dev) -{ - struct rtc_softc *sc; -/* Clang 13+ realises that "unit" below isn't actually used if we */ -/* aren't running with DEBUG set. The warning is treated as a */ -/* fatal error by FreeBSD's kmod build system, so wrap its usage */ -/* within DEBUG pre-processor conditionals. - Jamie Landeg-Jones */ -#if DEBUG - int unit; - - unit = dev2unit(dev); - DLog(Lenter, "%d %p", unit, dev); -#endif /* DEBUG */ - if (dev->si_drv1) { - DLog(Lexit, "old %p, %p", dev, dev->si_drv1); - return dev->si_drv1; - } - - sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK); - if (sc==NULL) - return NULL; - - bzero(sc, sizeof(*sc)); - dev->si_drv1 = sc; /* Link together */ - sc->dev = dev; - sc->var.freq = 1; - - callout_init(&sc->var.rtc_handle, 1); - - DLog(Lexit, "new %p,%p", dev, sc); - return sc; -} - -static int -rtc_detach(struct cdev *dev, struct rtc_softc *sc) -{ - int error=0; - - if (sc == NULL) { - return error; - } - - callout_stop(&sc->var.rtc_handle); - free(sc, M_DEVBUF); - dev->si_drv1 = NULL; - return error; -} - -/* -=-=-=-=-=-=-=-=-= character device stuff -=-=-=-=-=-=-=-=-= */ - -static int -rtc_open(struct cdev *dev, int oflag, int otyp, struct thread *p) -{ - struct rtc_softc *sc; - - sc = rtc_attach(dev); - - if (sc==NULL) - return (EAGAIN); - - if (sc->var.flags.opened) - return (EBUSY); - - sc->var.flags.opened = 1; - - return 0; -} - -int -rtc_close(struct cdev *dev, int fflag, int otyp, struct thread *p) -{ - struct rtc_softc *sc = (struct rtc_softc *) dev->si_drv1; - - rtc_detach(dev, sc); - sc->var.flags.opened = 0; - return 0; -} - -int -rtc_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int mode, struct thread *p) -{ - struct rtc_softc *sc = (struct rtc_softc *) dev->si_drv1; - int error=0, freq, sleep; - - DLog(Lenter, "cmd 0x%04lx", cmd); - switch (cmd) { - case RTCIO_IRQP_SET: - freq = *(int *)arg; - if (freq < 2) { - error = EINVAL; - break; - } - if (freq > 1024) { - error = EINVAL; - break; - } - sc->var.freq = freq; - if ((sc->var.freq > hz) && (hz < 1000)) { - printf("rtc: %d > kern.hz: Timing will be inaccurate, please increase kern.hz.\n", sc->var.freq); - sc->var.freq = hz; - } - sleep = hz / sc->var.freq; - DLog(Linfo, "Set RTC freq %d", sc->var.freq); - callout_stop(&sc->var.rtc_handle); - nanouptime(&sc->var.lasttime); - callout_reset(&sc->var.rtc_handle, sleep, &rtc_callback, (void *)sc); - break; - case RTCIO_PIE_ON: - sc->var.flags.enabled = 1; - DLog(Linfo, "Enable interrupts"); - break; - default: - DLog(Lfail, "Unknown IOCTL 0x%04lx", cmd); - error = EINVAL; - break; - } - DLog(Lenter, "result %d", error); - return (error); -} - -int -rtc_poll(struct cdev *dev, int events, struct thread *p) -{ - struct rtc_softc *sc = (struct rtc_softc *) dev->si_drv1; - int revents = 0; - - if (!sc->var.flags.enabled) - return 0; - - if (events) { - DLog(Linfo, "Delay for %d usec", delay); - if (sc->var.woken) { - revents = events; - } else { - selrecord(p, &sc->var.sip); - } - } - return revents; -} - -int -rtc_read(struct cdev *dev, struct uio *uio, int flags __unused) -{ - struct rtc_softc *sc = (struct rtc_softc *) dev->si_drv1; - int error = 0; - - if (!sc->var.flags.enabled) - return 0; - - if (flags & IO_NDELAY) - return EAGAIN; - - DLog(Linfo, "Delay for %d usec", delay); - if (sc->var.woken == 0) - tsleep(&sc->var.rtc_ident, PCATCH, "rtc rd", hz * 10); -#if 0 - if (sc->var.woken > 1) - printf("woken: %lu\n", sc->var.woken); -#endif - - if (uio->uio_resid == sizeof(unsigned int)) { - error = uiomove(&sc->var.woken, sizeof(unsigned int), uio); - } else if (uio->uio_resid == sizeof(unsigned long)) { - error = uiomove(&sc->var.woken, sizeof(unsigned long), uio); - } - sc->var.woken = 0; - return error; -} - -/* -=-=-=-=-=-=-=-=-= module load/unload stuff -=-=-=-=-=-=-=-=-= */ -static struct cdev *rtc_dev = NULL; - -static int -init_module(void) -{ - int error = 0; - - rtc_dev = make_dev(&rtc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0644, DEVICE_NAME); - if (rtc_dev==NULL) - error = ENOMEM; - - return error; -} - -static int -cleanup_module(void) -{ - int error = 0; - - destroy_dev(rtc_dev); - DLog(Linfo, "return %d", error); - return error; -} - -static int -rtc_modeevent(module_t mod, int cmd, void *arg) -{ - int error = 0; - - switch (cmd) { - case MOD_LOAD: - error = init_module(); - break; - - case MOD_UNLOAD: - /* fall through */ - case MOD_SHUTDOWN: - error = cleanup_module(); - break; - - default: /* we only understand load/unload */ - error = EINVAL; - break; - } - - return (error); -} - -void -rtc_callback(void *xtp) -{ - int sleep; - struct rtc_softc *sc = (struct rtc_softc *)xtp; - struct timespec curtime, nexttime, increment; - - if (callout_pending(&sc->var.rtc_handle) || !callout_active(&sc->var.rtc_handle)) - return; - /* Wakeup sleepers */ - sc->var.woken++; - selwakeup(&sc->var.sip); - wakeup(&sc->var.rtc_ident); - - /* Setup for our next nap. */ - nanouptime(&curtime); -restart: - increment.tv_sec = 0; - increment.tv_nsec = 1000000000 / sc->var.freq; - timespecadd(&sc->var.lasttime, &increment, &sc->var.lasttime); - timespecadd(&sc->var.lasttime, &increment, &nexttime); - if (timespeccmp(&nexttime, &curtime, <)) { - /* Catch up if we lag curtime */ - timespecsub(&curtime, &increment, &sc->var.lasttime); - timespecsub(&nexttime, &curtime, &nexttime); -#if 0 - printf("lagging curtime by %d.%ld\n", nexttime.tv_sec, nexttime.tv_nsec); -#endif - goto restart; - } else { - timespecsub(&nexttime, &curtime, &nexttime); - sleep = nexttime.tv_nsec / (1000000000 / hz); - } - callout_reset(&sc->var.rtc_handle, sleep, &rtc_callback, xtp); -} diff --git a/emulators/rtc/files/rtc.h b/emulators/rtc/files/rtc.h deleted file mode 100644 index 36fe9083e951..000000000000 --- a/emulators/rtc/files/rtc.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef RTC_H -#define RTC_H - - -#define RTCIO_PIE_ON _IO('p', 0x05) -#define RTCIO_IRQP_SET _IO('p', 0x0c) - -#ifndef M_WAITOK -#define M_WAITOK 0x0000 -#endif - -#endif /* RTC_H */ - diff --git a/emulators/rtc/files/rtc_linux.c b/emulators/rtc/files/rtc_linux.c deleted file mode 100644 index 14f36acbb088..000000000000 --- a/emulators/rtc/files/rtc_linux.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright by Vladimir N. Silyaev 2000 - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $vmFreeBSD: vmware/vmnet-only/freebsd/vmnet_linux.c,v 1.5 2000/01/23 22:29:50 vsilyaev Exp $ - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "rtc.h" - -#define DEBUG 0 -#if DEBUG -#define DEB(x) x -#else /* !DEBUG */ -#define DEB(x) -#endif /* DEBUG */ - -#define LINUX_IOCTL_SET(n,low,high) \ -static linux_ioctl_function_t linux_ioctl_##n; \ -static struct linux_ioctl_handler n##_handler = {linux_ioctl_##n, low, high }; \ -SYSINIT(n##register, SI_SUB_KLD, SI_ORDER_MIDDLE, linux_ioctl_register_handler, &n##_handler); \ -SYSUNINIT(n##unregister, SI_SUB_KLD, SI_ORDER_MIDDLE, linux_ioctl_unregister_handler, &n##_handler); - -#define LINUX_RTC_PIE_ON 0x7005 -#define LINUX_RTC_IRQP_SET 0x700C - -LINUX_IOCTL_SET(rtc, 0x7000, 0x70ff); - -static int -linux_ioctl_rtc(struct thread *p, struct linux_ioctl_args *args) -{ - switch (args->cmd & 0xffff) { - case LINUX_RTC_PIE_ON: - args->cmd=RTCIO_PIE_ON; - return sys_ioctl(p, (struct ioctl_args*)args); - case LINUX_RTC_IRQP_SET: - args->cmd=RTCIO_IRQP_SET; - return sys_ioctl(p, (struct ioctl_args*)args); - } - return (ENOIOCTL); -} diff --git a/emulators/rtc/files/test.c b/emulators/rtc/files/test.c deleted file mode 100644 index 5e7b3b1b6b47..000000000000 --- a/emulators/rtc/files/test.c +++ /dev/null @@ -1,56 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include - - -int main(void) -{ - int rtc; - fd_set rset; - int i,rc; - int ntests=100; - struct timeval tv; - struct timeval begin,end,delta; - - - rtc = open("/dev/rtc", O_RDONLY); - if (rtc<0) { - perror("/dev/rtc"); - return 1; - } - - rc = ioctl(rtc, RTCIO_IRQP_SET, 512); - if (rc<0) { - perror("/dev/rtc"); - return 1; - } - - rc = ioctl(rtc, RTCIO_PIE_ON, NULL); - if (rc<0) { - perror("/dev/rtc"); - return 1; - } - - gettimeofday(&begin, NULL); - for (i=0; i