diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2006-02-20 19:42:29 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:26:34 +0200 |
commit | 68754c496b16c6416ee601d6d9cc634e91e3b9f1 (patch) | |
tree | 7f490db59b229b29773b40016cb56a6f401b5f13 /scsi/adapters/scsi_user_dma.c | |
parent | 886c5cc034a87a2123cee87aa8ea757b096c8755 (diff) | |
download | gnumach-68754c496b16c6416ee601d6d9cc634e91e3b9f1.tar.gz gnumach-68754c496b16c6416ee601d6d9cc634e91e3b9f1.tar.bz2 gnumach-68754c496b16c6416ee601d6d9cc634e91e3b9f1.zip |
2006-02-20 Thomas Schwinge <tschwinge@gnu.org>
Remove unused and unsupported code. Consult the file
`DEVELOPMENT' for details. Partly based on suggestions by
Gianluca Guida <glguida@gmail.com>.
* i386/bogus/asc.h: Remove file.
* i386/bogus/aha.h: Likewise.
* i386/bogus/eaha.h: Likewise.
* i386/bogus/sbic.h: Likewise.
* i386/bogus/sci.h: Likewise.
* i386/bogus/sii.h: Likewise.
* i386/bogus/siop.h: Likewise.
* i386/i386at/eisa.h: Likewise.
* scsi/adapters/README: Likewise.
* scsi/adapters/scsi_33C93.h: Likewise.
* scsi/adapters/scsi_33C93_hdw.c: Likewise.
* scsi/adapters/scsi_5380.h: Likewise.
* scsi/adapters/scsi_5380_hdw.c: Likewise.
* scsi/adapters/scsi_53C700.h: Likewise.
* scsi/adapters/scsi_53C700_hdw.c: Likewise.
* scsi/adapters/scsi_53C94.h: Likewise.
* scsi/adapters/scsi_53C94_hdw.c: Likewise.
* scsi/adapters/scsi_7061.h: Likewise.
* scsi/adapters/scsi_7061_hdw.c: Likewise.
* scsi/adapters/scsi_89352.h: Likewise.
* scsi/adapters/scsi_89352_hdw.c: Likewise.
* scsi/adapters/scsi_aha15.h: Likewise.
* scsi/adapters/scsi_aha15_hdw.c: Likewise.
* scsi/adapters/scsi_aha17_hdw.c: Likewise.
* scsi/adapters/scsi_dma.h: Likewise.
* scsi/adapters/scsi_user_dma.c: Likewise.
* scsi/adapters/scsi_user_dma.h: Likewise.
* scsi/compat_30.h: Likewise.
* scsi/disk_label.c: Likewise.
* scsi/mapped_scsi.c: Likewise.
* scsi/mapped_scsi.h: Likewise.
* scsi/pc_scsi_label.c: Likewise.
* scsi/rz.c: Likewise.
* scsi/rz.h: Likewise.
* scsi/rz_audio.c: Likewise.
* scsi/rz_cpu.c: Likewise.
* scsi/rz_disk.c: Likewise.
* scsi/rz_disk_bbr.c: Likewise.
* scsi/rz_host.c: Likewise.
* scsi/rz_labels.h: Likewise.
* scsi/rz_tape.c: Likewise.
* scsi/scsi.c: Likewise.
* scsi/scsi.h: Likewise.
* scsi/scsi2.h: Likewise.
* scsi/scsi_alldevs.c: Likewise.
* scsi/scsi_comm.c: Likewise.
* scsi/scsi_cpu.c: Likewise.
* scsi/scsi_defs.h: Likewise.
* scsi/scsi_disk.c: Likewise.
* scsi/scsi_endian.h: Likewise.
* scsi/scsi_jukebox.c: Likewise.
* scsi/scsi_optical.c: Likewise.
* scsi/scsi_printer.c: Likewise.
* scsi/scsi_rom.c: Likewise.
* scsi/scsi_scanner.c: Likewise.
* scsi/scsi_tape.c: Likewise.
* scsi/scsi_worm.c: Likewise.
* i386/i386at/autoconf.c: Don't include <aha.h> and <eaha.h> anymore
and adopt all users of NAHA and NEAHA as if it were always defined to
`0'.
* i386/i386at/conf.c: Likewise.
* Makefile.in (scsi-files): Remove variable and all users of it.
Diffstat (limited to 'scsi/adapters/scsi_user_dma.c')
-rw-r--r-- | scsi/adapters/scsi_user_dma.c | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/scsi/adapters/scsi_user_dma.c b/scsi/adapters/scsi_user_dma.c deleted file mode 100644 index 5fb98d64..00000000 --- a/scsi/adapters/scsi_user_dma.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Mach Operating System - * Copyright (c) 1991,1990 Carnegie Mellon University - * All Rights Reserved. - * - * 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 - * 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. - */ -/* - * File: scsi_user_dma.c - * Author: Alessandro Forin, Carnegie Mellon University - * Date: 4/91 - * - * Mach 2.5 compat file, to handle case of DMA to user space - * [e.g. fsck and other raw device accesses] - */ - -#ifdef MACH_KERNEL -/* We do not need this in 3.0 */ -#else /*MACH_KERNEL*/ - -#include <mach/std_types.h> -#include <scsi/adapters/scsi_user_dma.h> - -#include <kern/assert.h> - -#include <vm/vm_kern.h> -#include <mach/vm_param.h> /* round_page() */ - -/* bp -> pmap */ -#include <sys/buf.h> -#include <sys/proc.h> - -/* - * Initialization, called once per device - */ -fdma_init(fdma, size) - fdma_t fdma; - vm_size_t size; -{ - vm_offset_t addr; - - size = round_page(size); - addr = kmem_alloc_pageable(kernel_map, size); - if (addr == 0) panic("fdma_init"); - - fdma->kernel_virtual = addr; - fdma->max_data = size; - fdma->user_virtual = -1; - -} - -/* - * Remap a buffer from user space to kernel space. - * Note that physio() has already validated - * and wired the user's address range. - */ -fdma_map(fdma, bp) - fdma_t fdma; - struct buf *bp; -{ - pmap_t pmap; - vm_offset_t user_addr; - vm_size_t size; - vm_offset_t kernel_addr; - vm_offset_t off; - vm_prot_t prot; - - /* - * If this is not to user space, or no data xfer is - * involved, no need to do anything. - */ - user_addr = (vm_offset_t)bp->b_un.b_addr; - if (!(bp->b_flags & B_PHYS) || (user_addr == 0)) { - fdma->user_virtual = -1; - return; - } - /* - * We are going to clobber the buffer pointer, so - * remember what it was to restore it later. - */ - fdma->user_virtual = user_addr; - - /* - * Account for initial offset into phys page - */ - off = user_addr - trunc_page(user_addr); - - /* - * Check xfer size makes sense, note how many pages we'll remap - */ - size = bp->b_bcount + off; - assert((size <= fdma->max_data)); - fdma->xfer_size_rnd = round_page(size); - - pmap = bp->b_proc->task->map->pmap; - - /* - * Use minimal protection possible - */ - prot = VM_PROT_READ; - if (bp->b_flags & B_READ) - prot |= VM_PROT_WRITE; - - /* - * Loop through all phys pages, taking them from the - * user pmap (they are wired) and inserting them into - * the kernel pmap. - */ - user_addr -= off; - kernel_addr = fdma->kernel_virtual; - bp->b_un.b_addr = (char *)kernel_addr + off; - - for (size = fdma->xfer_size_rnd; size; size -= PAGE_SIZE) { - register vm_offset_t phys; - - phys = pmap_extract(pmap, user_addr); - pmap_enter(kernel_pmap, kernel_addr, phys, prot, TRUE); - user_addr += PAGE_SIZE; - kernel_addr += PAGE_SIZE; - } -} - -/* - * Called at end of xfer, to restore the buffer - */ -fdma_unmap(fdma, bp) - fdma_t fdma; - struct buf *bp; -{ - register vm_offset_t end_addr; - - /* - * Check we actually did remap it - */ - if (fdma->user_virtual == -1) - return; - - /* - * Restore the buffer - */ - bp->b_un.b_addr = (char *)fdma->user_virtual; - fdma->user_virtual = -1; - - /* - * Eliminate the mapping, pmap module might mess up - * the pv list otherwise. Some might actually tolerate it. - */ - end_addr = fdma->kernel_virtual + fdma->xfer_size_rnd; - pmap_remove(kernel_pmap, fdma->kernel_virtual, end_addr); - -} - -#endif /*MACH_KERNEL*/ |