Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ioport.c
Go to the documentation of this file.
1 /*
2  * arch/sh/kernel/ioport.c
3  *
4  * Copyright (C) 2000 Niibe Yutaka
5  * Copyright (C) 2005 - 2007 Paul Mundt
6  *
7  * This file is subject to the terms and conditions of the GNU General Public
8  * License. See the file "COPYING" in the main directory of this archive
9  * for more details.
10  */
11 #include <linux/module.h>
12 #include <linux/io.h>
13 
14 unsigned long sh_io_port_base __read_mostly = -1;
15 EXPORT_SYMBOL(sh_io_port_base);
16 
17 void __iomem *__ioport_map(unsigned long addr, unsigned int size)
18 {
19  if (sh_mv.mv_ioport_map)
20  return sh_mv.mv_ioport_map(addr, size);
21 
22  return (void __iomem *)(addr + sh_io_port_base);
23 }
25 
26 void __iomem *ioport_map(unsigned long port, unsigned int nr)
27 {
28  void __iomem *ret;
29 
30  ret = __ioport_map_trapped(port, nr);
31  if (ret)
32  return ret;
33 
34  return __ioport_map(port, nr);
35 }
37 
39 {
40  if (sh_mv.mv_ioport_unmap)
41  sh_mv.mv_ioport_unmap(addr);
42 }