1 // SPDX-License-Identifier: GPL-2.0
3 * arch/sh/kernel/ioport.c
5 * Copyright (C) 2000 Niibe Yutaka
6 * Copyright (C) 2005 - 2007 Paul Mundt
8 #include <linux/module.h>
11 unsigned long sh_io_port_base __read_mostly
= -1;
12 EXPORT_SYMBOL(sh_io_port_base
);
14 void __iomem
*__ioport_map(unsigned long addr
, unsigned int size
)
16 if (sh_mv
.mv_ioport_map
)
17 return sh_mv
.mv_ioport_map(addr
, size
);
19 return (void __iomem
*)(addr
+ sh_io_port_base
);
21 EXPORT_SYMBOL(__ioport_map
);
23 void __iomem
*ioport_map(unsigned long port
, unsigned int nr
)
27 ret
= __ioport_map_trapped(port
, nr
);
31 return __ioport_map(port
, nr
);
33 EXPORT_SYMBOL(ioport_map
);
35 void ioport_unmap(void __iomem
*addr
)
37 if (sh_mv
.mv_ioport_unmap
)
38 sh_mv
.mv_ioport_unmap(addr
);
40 EXPORT_SYMBOL(ioport_unmap
);