diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-03-04 12:26:48 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-03-04 12:26:48 +0000 |
commit | 247e1d3fc4fdac9fd4de1621eb55e1702f9af030 (patch) | |
tree | 2c04b91506e5380d0ffb70a7faaf97506a853d72 /sys | |
parent | b246cee4e1b2f9d715dbb89351ec645dcd947128 (diff) |
Dead meat.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/macppc/macppc/random.c | 87 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/sbicdma.c | 270 |
2 files changed, 0 insertions, 357 deletions
diff --git a/sys/arch/macppc/macppc/random.c b/sys/arch/macppc/macppc/random.c deleted file mode 100644 index 5f684701b16..00000000000 --- a/sys/arch/macppc/macppc/random.c +++ /dev/null @@ -1,87 +0,0 @@ -/* $OpenBSD: random.c,v 1.2 2003/10/15 17:50:16 drahn Exp $ */ - -/* - * Copyright (c) 1990,1993 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that: (1) source code distributions - * retain the above copyright notice and this paragraph in its entirety, (2) - * distributions including binary code include the above copyright notice and - * this paragraph in its entirety in the documentation or other materials - * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: - * ``This product includes software developed by the University of California, - * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of - * the University nor the names of its contributors may be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Here is a very good random number generator. This implementation is - * based on ``Two Fast Implementations of the "Minimal Standard" Random - * Number Generator'', David G. Carta, Communications of the ACM, Jan 1990, - * Vol 33 No 1. Do NOT modify this code unless you have a very thorough - * understanding of the algorithm. It's trickier than you think. If - * you do change it, make sure that its 10,000'th invocation returns - * 1043618065. - * - * Here is easier-to-decipher pseudocode: - * - * p = (16807*seed)<30:0> # e.g., the low 31 bits of the product - * q = (16807*seed)<62:31> # e.g., the high 31 bits starting at bit 32 - * if (p + q < 2^31) - * seed = p + q - * else - * seed = ((p + q) & (2^31 - 1)) + 1 - * return (seed); - * - * The result is in (0,2^31), e.g., it's always positive. - */ -#if 0 -#include <machine/asm.h> - - .data - .globl _C_SYMBOL(_randseed) -_C_SYMBOL(_randseed): - .long 1 - .text -ENTRY(random) -# movl #16807, d0 - lis r5, 1 - ori r5, r5, 0x6807 - lis r4, _C_SYMBOL(_randseed)@h - lwz r6, _C_SYMBOL(_randseed)@l(r4) -# mulsl __randseed, d1:d0 - mulhw r7, r6, r5 - mulhw r8, r6, r5 - -# lsll #1, d0 -# roxll #2, d1 -# addl d1, d0 -# moveql #1, d1 -# addxl d1, d0 -# lsrl #1, d0 - lis r4, _C_SYMBOL(_randseed)@h - stw r6, _C_SYMBOL(_randseed)@l(r4) -# movl d0, __randseed -# rts -#endif - -extern int _randseed; -int -random() -{ - long long value; - int p, q; - value = 16807 * _randseed; - p = value & (long long) (0xffffffff); - q = (value >> 32) & (long long) (0xffffffff); - if (((long long) p + q) < 0x3fffffff) - _randseed = p + q; - else - _randseed = (int)(((long long)p + q ) & 0x3ffffffe) +1; - return _randseed; -} diff --git a/sys/arch/mvme68k/dev/sbicdma.c b/sys/arch/mvme68k/dev/sbicdma.c deleted file mode 100644 index 7b7329dc912..00000000000 --- a/sys/arch/mvme68k/dev/sbicdma.c +++ /dev/null @@ -1,270 +0,0 @@ -/* $OpenBSD: sbicdma.c,v 1.13 2005/12/17 07:31:26 miod Exp $ */ - -/* - * Copyright (c) 1995 Theo de Raadt - * Copyright (c) 1995 Dale Rahn. 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 ``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 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. - */ - -/* - * as you may guess by some of the routines in this file, - * dma is not yet working. - its on the TODO list - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/proc.h> -#include <sys/conf.h> -#include <uvm/uvm_extern.h> - -#include <scsi/scsi_all.h> -#include <scsi/scsiconf.h> - -#include <machine/autoconf.h> -#include <mvme68k/dev/pccreg.h> -#include <mvme68k/dev/sbicreg.h> -#include <mvme68k/dev/sbicvar.h> -#include <mvme68k/dev/dmavar.h> - -void sbicdmaattach(struct device *, struct device *, void *); -int sbicdmamatch(struct device *, void *, void *); -int sbicdmaprint(void *auxp, const char *); - -void sbicdma_dmafree(struct sbic_softc *); -void sbicdma_dmastop(struct sbic_softc *); -int sbicdma_dmanext(struct sbic_softc *); -int sbicdma_dmago(struct sbic_softc *, char *, int, int); -int sbicdma_dmaintr(struct sbic_softc *); -int sbicdma_scintr(struct sbic_softc *); - -struct scsi_adapter sbicdma_scsiswitch = { - sbic_scsicmd, - sbic_minphys, - 0, /* no lun support */ - 0, /* no lun support */ -}; - -struct scsi_device sbicdma_scsidev = { - NULL, /* use default error handler */ - NULL, /* have a queue served by this ??? */ - NULL, /* have no async handler ??? */ - NULL, /* Use default done routine */ -}; - -#ifdef DEBUG -int sbicdma_debug = 1; -#endif - -int sbicdma_maxdma = 0; /* Maximum size per DMA transfer */ -int sbicdma_dmamask = 0; -int sbicdma_dmabounce = 0; - -struct cfdriver sbiccd = { - NULL, "sbic", sbicdmamatch, sbicdmaattach, - DV_DULL, sizeof(struct sbic_softc), -}; - -int -sbicdmamatch(parent, vcf, args) - struct device *parent; - void *vcf, *args; -{ - /* - * XXX finish to properly probe - */ - return (1); -} - -void -sbicdmaattach(parent, self, args) - struct device *parent, *self; - void *args; -{ - struct sbic_softc *sc = (struct sbic_softc *)self; - struct confargs *ca = args; - - sc->sc_dmafree = sbicdma_dmafree; - sc->sc_dmago = sbicdma_dmago; - sc->sc_dmanext = sbicdma_dmanext; - sc->sc_dmastop = sbicdma_dmastop; - sc->sc_dmacmd = 0; - - sc->sc_flags |= SBICF_BADDMA; - sc->sc_dmamask = 0; - sc->sc_sbicp = (sbic_regmap_p)ca->ca_vaddr; - sc->sc_clkfreq = 100; - - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = 7; - sc->sc_link.adapter = &sbicdma_scsiswitch; - sc->sc_link.device = &sbicdma_scsidev; - sc->sc_link.openings = 1; - - printf(": target %d\n", sc->sc_link.adapter_target); - - /* connect the interrupts */ - sc->sc_ih.ih_fn = sbicdma_scintr; - sc->sc_ih.ih_arg = sc; - sc->sc_ih.ih_ipl = ca->ca_ipl; - pccintr_establish(PCCV_SBIC, &sc->sc_ih, self->dv_xname); - - sc->sc_dmaih.ih_fn = sbicdma_dmaintr; - sc->sc_dmaih.ih_arg = sc; - sc->sc_dmaih.ih_ipl = ca->ca_ipl; - pccintr_establish(PCCV_DMA, &sc->sc_dmaih, self->dv_xname); - - sys_pcc->pcc_dmairq = sc->sc_dmaih.ih_ipl | PCC_IRQ_INT; - sys_pcc->pcc_sbicirq = sc->sc_ih.ih_ipl | PCC_SBIC_RESETIRQ; - - sbicreset(sc); - - config_found(self, &sc->sc_link, sbicdmaprint); -} - -/* - * print diag if pnp is NULL else just extra - */ -int -sbicdmaprint(auxp, pnp) - void *auxp; - const char *pnp; -{ - if (pnp == NULL) - return (UNCONF); - return (QUIET); -} - -int -sbicdma_dmago(sc, va, count, flags) - struct sbic_softc *sc; - char *va; - int count, flags; -{ - u_char csr; - u_long pa; - - pmap_extract(pmap_kernel(), (vaddr_t)va, &pa); -#ifdef DEBUG - if (sbicdma_debug) - printf("%s: dmago: va 0x%x pa 0x%x cnt %d flags %x\n", - sc->sc_dev.dv_xname, va, pa, count, flags); -#endif - - sc->sc_flags |= SBICF_INTR; - sys_pcc->pcc_dmadaddr = (u_long)pa; - if (count & PCC_DMABCNT_CNTMASK) { - printf("%s: dma count 0x%x too large\n", - sc->sc_dev.dv_xname, count); - return (0); - } - sys_pcc->pcc_dmabcnt = (PCC_DMABCNT_MAKEFC(FC_USERD)) | - (count & PCC_DMABCNT_CNTMASK); - - /* make certain interrupts are disabled first, and reset */ - sys_pcc->pcc_dmairq = sc->sc_dmaih.ih_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; - sys_pcc->pcc_sbicirq = sc->sc_ih.ih_ipl | PCC_SBIC_RESETIRQ | PCC_IRQ_IEN; - sys_pcc->pcc_dmacsr = 0; - sys_pcc->pcc_dmacsr = PCC_DMACSR_DEN | - ((flags & DMAGO_READ) == 0) ? PCC_DMACSR_TOSCSI : 0; - - return (sc->sc_tcnt); -} - -int -sbicdma_dmaintr(sc) - struct sbic_softc *sc; -{ - u_char stat; - int ret = 0; - - /* DMA done */ - stat = sys_pcc->pcc_dmacsr; -#ifdef DEBUG -printf("dmaintr%d ", stat); -#endif - if (stat & PCC_DMACSR_DONE) { - sys_pcc->pcc_dmacsr = 0; - sys_pcc->pcc_dmairq = 0; /* ack and remove intr */ - if (stat & PCC_DMACSR_ERR8BIT) { - printf("%s: 8 bit error\n", sc->sc_dev.dv_xname); - } - if (stat & PCC_DMACSR_DMAERRDATA) { - printf("%s: DMA bus error\n", sc->sc_dev.dv_xname); - } - return (1); - } - return (0); -} - -int -sbicdma_scintr(sc) - struct sbic_softc *sc; -{ - u_char stat; - int ret = 0; - -#ifdef DEBUG -printf("scintr%d ", stat); -#endif - stat = sys_pcc->pcc_sbicirq; - if (stat & PCC_SBIC_RESETIRQ) { - printf("%s: scintr: a scsi device pulled reset\n", - sc->sc_dev.dv_xname); - sys_pcc->pcc_sbicirq = sys_pcc->pcc_sbicirq | PCC_SBIC_RESETIRQ; - } else if (stat & PCC_IRQ_INT) { - sys_pcc->pcc_sbicirq = 0; - sbicintr(sc); - ret = 1; - } - return (ret); -} - -void -sbicdma_dmastop(sc) - struct sbic_softc *sc; -{ -#ifdef DEBUG - printf("sbicdma_dmastop called\n"); -#endif - /* XXX do nothing */ -} - -int -sbicdma_dmanext(sc) - struct sbic_softc *sc; -{ -#ifdef DEBUG - printf("sbicdma_dmanext called\n"); -#endif -} - -void -sbicdma_dmafree(sc) - struct sbic_softc *sc; -{ -#ifdef DEBUG - printf("sbicdma_dmafree called\n"); -#endif - /* make certain interrupts are disabled first, reset */ - sys_pcc->pcc_dmairq = 0; -} |