ia64/linux-2.6.18-xen.hg

annotate arch/sparc/prom/devmap.c @ 912:dd42cdb0ab89

[IA64] Build blktap2 driver by default in x86 builds.

add CONFIG_XEN_BLKDEV_TAP2=y to buildconfigs/linux-defconfig_xen_ia64.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 12:09:16 2009 +0900 (2009-06-29)
parents 831230e53067
children
rev   line source
ian@0 1 /* $Id: devmap.c,v 1.7 2000/08/26 02:38:03 anton Exp $
ian@0 2 * promdevmap.c: Map device/IO areas to virtual addresses.
ian@0 3 *
ian@0 4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
ian@0 5 */
ian@0 6
ian@0 7 #include <linux/types.h>
ian@0 8 #include <linux/kernel.h>
ian@0 9 #include <linux/sched.h>
ian@0 10
ian@0 11 #include <asm/openprom.h>
ian@0 12 #include <asm/oplib.h>
ian@0 13
ian@0 14 extern void restore_current(void);
ian@0 15
ian@0 16 /* Just like the routines in palloc.c, these should not be used
ian@0 17 * by the kernel at all. Bootloader facility mainly. And again,
ian@0 18 * this is only available on V2 proms and above.
ian@0 19 */
ian@0 20
ian@0 21 /* Map physical device address 'paddr' in IO space 'ios' of size
ian@0 22 * 'num_bytes' to a virtual address, with 'vhint' being a hint to
ian@0 23 * the prom as to where you would prefer the mapping. We return
ian@0 24 * where the prom actually mapped it.
ian@0 25 */
ian@0 26 char *
ian@0 27 prom_mapio(char *vhint, int ios, unsigned int paddr, unsigned int num_bytes)
ian@0 28 {
ian@0 29 unsigned long flags;
ian@0 30 char *ret;
ian@0 31
ian@0 32 spin_lock_irqsave(&prom_lock, flags);
ian@0 33 if((num_bytes == 0) || (paddr == 0)) ret = (char *) 0x0;
ian@0 34 else
ian@0 35 ret = (*(romvec->pv_v2devops.v2_dumb_mmap))(vhint, ios, paddr,
ian@0 36 num_bytes);
ian@0 37 restore_current();
ian@0 38 spin_unlock_irqrestore(&prom_lock, flags);
ian@0 39 return ret;
ian@0 40 }
ian@0 41
ian@0 42 /* Unmap an IO/device area that was mapped using the above routine. */
ian@0 43 void
ian@0 44 prom_unmapio(char *vaddr, unsigned int num_bytes)
ian@0 45 {
ian@0 46 unsigned long flags;
ian@0 47
ian@0 48 if(num_bytes == 0x0) return;
ian@0 49 spin_lock_irqsave(&prom_lock, flags);
ian@0 50 (*(romvec->pv_v2devops.v2_dumb_munmap))(vaddr, num_bytes);
ian@0 51 restore_current();
ian@0 52 spin_unlock_irqrestore(&prom_lock, flags);
ian@0 53 return;
ian@0 54 }