diff options
author | 1996-04-21 23:38:17 +0000 | |
---|---|---|
committer | 1996-04-21 23:38:17 +0000 | |
commit | f3bae140e877f130f33051ddb228cb34a056c92b (patch) | |
tree | c5f519d1e41a8239f986cc5a6f4fb0b979e31e11 /lib/libarch | |
parent | partial sync with netbsd 960418, more to come (diff) | |
download | wireguard-openbsd-f3bae140e877f130f33051ddb228cb34a056c92b.tar.xz wireguard-openbsd-f3bae140e877f130f33051ddb228cb34a056c92b.zip |
sync to netbsd 960418
Diffstat (limited to 'lib/libarch')
-rw-r--r-- | lib/libarch/alpha/Makefile | 8 | ||||
-rw-r--r-- | lib/libarch/alpha/alpha_mmclock_gettime.c | 55 | ||||
-rw-r--r-- | lib/libarch/alpha/alpha_mmclock_init.c | 68 | ||||
-rw-r--r-- | lib/libarch/alpha/gettimeofday.c | 82 | ||||
-rw-r--r-- | lib/libarch/alpha/libalpha.h | 30 |
5 files changed, 0 insertions, 243 deletions
diff --git a/lib/libarch/alpha/Makefile b/lib/libarch/alpha/Makefile deleted file mode 100644 index d2822fd6bfd..00000000000 --- a/lib/libarch/alpha/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $OpenBSD: Makefile,v 1.1 1996/03/19 23:14:54 niklas Exp $ -# $NetBSD: Makefile,v 1.1 1996/02/21 02:45:40 jtk Exp $ - -#.PATH: ${LIBC}/i386 - -SRCS+= alpha_mmclock_gettime.c alpha_mmclock_init.c gettimeofday.c - -.include <bsd.lib.mk> diff --git a/lib/libarch/alpha/alpha_mmclock_gettime.c b/lib/libarch/alpha/alpha_mmclock_gettime.c deleted file mode 100644 index ca56c77bfcf..00000000000 --- a/lib/libarch/alpha/alpha_mmclock_gettime.c +++ /dev/null @@ -1,55 +0,0 @@ -/* $NetBSD: alpha_mmclock_gettime.c,v 1.1 1995/12/20 12:54:24 cgd Exp $ */ - -/* - * Copyright (c) 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include <sys/types.h> -#include <sys/fcntl.h> -#include <sys/mman.h> -#include <sys/syscall.h> -#include <machine/sysarch.h> - -#include "libalpha.h" - -void -alpha_mmclock_gettime(tdp) - struct alpha_timedata *tdp; -{ - u_long npcc, pccdiff; - - do { - tdp->td_tv.tv_usec = alpha_mmclockdata->td_tv.tv_usec; - tdp->td_tv.tv_sec = alpha_mmclockdata->td_tv.tv_sec; - tdp->td_cc = alpha_mmclockdata->td_cc; - } while (tdp->td_tv.tv_usec != alpha_mmclockdata->td_tv.tv_usec || - tdp->td_tv.tv_sec != alpha_mmclockdata->td_tv.tv_sec); - - npcc = rpcc() & 0x00000000ffffffffUL; - if (npcc < tdp->td_cc) - npcc += 0x0000000100000000UL; - tdp->td_cc = npcc - tdp->td_cc; -} diff --git a/lib/libarch/alpha/alpha_mmclock_init.c b/lib/libarch/alpha/alpha_mmclock_init.c deleted file mode 100644 index 5a83f2750ce..00000000000 --- a/lib/libarch/alpha/alpha_mmclock_init.c +++ /dev/null @@ -1,68 +0,0 @@ -/* $NetBSD: alpha_mmclock_init.c,v 1.1 1995/12/20 12:55:21 cgd Exp $ */ - -/* - * Copyright (c) 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include <sys/types.h> -#include <sys/fcntl.h> -#include <sys/mman.h> -#include <machine/sysarch.h> - -#include "libalpha.h" - -volatile struct alpha_timedata *alpha_mmclockdata; -u_long alpha_cycles_per_second; - -int __alpha_mmclock_init_failed; - -volatile struct alpha_timedata * -alpha_mmclock_init() -{ - int fd; - - if (alpha_mmclockdata != NULL) - return (alpha_mmclockdata); - - fd = open("/dev/mmclock", O_RDONLY, 0); - if (fd == -1) - goto fail; - - alpha_mmclockdata = (struct alpha_timedata *) - mmap(NULL, getpagesize(), PROT_READ, MAP_FILE, fd, 0); - close(fd); - if (alpha_mmclockdata == NULL) - goto fail; - - alpha_cycles_per_second = alpha_mmclockdata->td_cpc; - - __alpha_mmclock_init_failed = 0; - return (alpha_mmclockdata); - -fail: - __alpha_mmclock_init_failed = 1; - return (NULL); -} diff --git a/lib/libarch/alpha/gettimeofday.c b/lib/libarch/alpha/gettimeofday.c deleted file mode 100644 index 6ef009b37b4..00000000000 --- a/lib/libarch/alpha/gettimeofday.c +++ /dev/null @@ -1,82 +0,0 @@ -/* $NetBSD: gettimeofday.c,v 1.1 1995/12/20 12:56:06 cgd Exp $ */ - -/* - * Copyright (c) 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include <sys/types.h> -#include <sys/fcntl.h> -#include <sys/mman.h> -#include <sys/syscall.h> -#include <machine/sysarch.h> - -#include "libalpha.h" - -int -gettimeofday(tvp, tzp) - struct timeval *tvp; - struct timezone *tzp; -{ - u_long opcc, npcc, pccdiff; - static struct timeval lasttime; - - if (tzp == NULL && alpha_mmclockdata == NULL && - !__alpha_mmclock_init_failed) - alpha_mmclockdata = alpha_mmclock_init(); - if (tzp != NULL || alpha_mmclockdata == NULL) - return (syscall(SYS_gettimeofday, tvp, tzp)); - - if (tvp == NULL) - return 0; - - do { - tvp->tv_usec = alpha_mmclockdata->td_tv.tv_usec; - tvp->tv_sec = alpha_mmclockdata->td_tv.tv_sec; - opcc = alpha_mmclockdata->td_cc; - } while (tvp->tv_usec != alpha_mmclockdata->td_tv.tv_usec || - tvp->tv_sec != alpha_mmclockdata->td_tv.tv_sec); - - npcc = rpcc() & 0x00000000ffffffffUL; - if (npcc < opcc) - npcc += 0x0000000100000000UL; - pccdiff = npcc - opcc; - - tvp->tv_usec += (pccdiff * 1000000) / alpha_cycles_per_second; - if (tvp->tv_usec > 1000000) { - tvp->tv_sec++; - tvp->tv_usec -= 1000000; - } - - if ((tvp->tv_sec == lasttime.tv_sec && - tvp->tv_usec <= lasttime.tv_usec) && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { - tvp->tv_sec++; - tvp->tv_usec -= 1000000; - } - - lasttime = *tvp; - return 0; -} diff --git a/lib/libarch/alpha/libalpha.h b/lib/libarch/alpha/libalpha.h deleted file mode 100644 index 358f2ec3cbe..00000000000 --- a/lib/libarch/alpha/libalpha.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $NetBSD: libalpha.h,v 1.1 1995/12/20 12:56:44 cgd Exp $ */ - -/* - * Copyright (c) 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -extern int __alpha_mmclock_init_failed; |