diff options
-rw-r--r-- | lib/libarch/alpha/Makefile | 8 | ||||
-rw-r--r-- | lib/libarch/alpha/Makefile.inc | 7 | ||||
-rw-r--r-- | lib/libarch/alpha/alpha_mmclock_gettime.c | 56 | ||||
-rw-r--r-- | lib/libarch/alpha/alpha_mmclock_init.c | 69 | ||||
-rw-r--r-- | lib/libarch/alpha/gettimeofday.c | 83 | ||||
-rw-r--r-- | lib/libarch/alpha/libalpha.h | 31 |
6 files changed, 0 insertions, 254 deletions
diff --git a/lib/libarch/alpha/Makefile b/lib/libarch/alpha/Makefile deleted file mode 100644 index c644d09f817..00000000000 --- a/lib/libarch/alpha/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $OpenBSD: Makefile,v 1.3 1996/07/30 06:54:11 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/Makefile.inc b/lib/libarch/alpha/Makefile.inc deleted file mode 100644 index af980a87683..00000000000 --- a/lib/libarch/alpha/Makefile.inc +++ /dev/null @@ -1,7 +0,0 @@ -# $OpenBSD: Makefile.inc,v 1.3 1996/07/30 06:54:12 niklas Exp $ - -# Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp - -#.PATH: ${LIBC}/i386 - -SRCS+= alpha_mmclock_gettime.c alpha_mmclock_init.c gettimeofday.c diff --git a/lib/libarch/alpha/alpha_mmclock_gettime.c b/lib/libarch/alpha/alpha_mmclock_gettime.c deleted file mode 100644 index 14afea0fb3e..00000000000 --- a/lib/libarch/alpha/alpha_mmclock_gettime.c +++ /dev/null @@ -1,56 +0,0 @@ -/* $OpenBSD: alpha_mmclock_gettime.c,v 1.3 1996/07/30 06:46:48 niklas Exp $ */ -/* $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 3b807f7e23c..00000000000 --- a/lib/libarch/alpha/alpha_mmclock_init.c +++ /dev/null @@ -1,69 +0,0 @@ -/* $OpenBSD: alpha_mmclock_init.c,v 1.3 1996/07/30 06:46:49 niklas Exp $ */ -/* $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 f5e5f375046..00000000000 --- a/lib/libarch/alpha/gettimeofday.c +++ /dev/null @@ -1,83 +0,0 @@ -/* $OpenBSD: gettimeofday.c,v 1.3 1996/07/30 06:46:50 niklas Exp $ */ -/* $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 68122f14b8f..00000000000 --- a/lib/libarch/alpha/libalpha.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $OpenBSD: libalpha.h,v 1.3 1996/07/30 06:46:50 niklas Exp $ */ -/* $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; |