Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  *  linux/arch/arm/kernel/isa.c
0004  *
0005  *  Copyright (C) 1999 Phil Blundell
0006  *
0007  *  ISA shared memory and I/O port support, and is required to support
0008  *  iopl, inb, outb and friends in userspace via glibc emulation.
0009  */
0010 #include <linux/stddef.h>
0011 #include <linux/types.h>
0012 #include <linux/fs.h>
0013 #include <linux/sysctl.h>
0014 #include <linux/init.h>
0015 #include <linux/io.h>
0016 
0017 static unsigned int isa_membase, isa_portbase, isa_portshift;
0018 
0019 static struct ctl_table ctl_isa_vars[4] = {
0020     {
0021         .procname   = "membase",
0022         .data       = &isa_membase, 
0023         .maxlen     = sizeof(isa_membase),
0024         .mode       = 0444,
0025         .proc_handler   = proc_dointvec,
0026     }, {
0027         .procname   = "portbase",
0028         .data       = &isa_portbase, 
0029         .maxlen     = sizeof(isa_portbase),
0030         .mode       = 0444,
0031         .proc_handler   = proc_dointvec,
0032     }, {
0033         .procname   = "portshift",
0034         .data       = &isa_portshift, 
0035         .maxlen     = sizeof(isa_portshift),
0036         .mode       = 0444,
0037         .proc_handler   = proc_dointvec,
0038     }, {}
0039 };
0040 
0041 static struct ctl_table_header *isa_sysctl_header;
0042 
0043 static struct ctl_table ctl_isa[2] = {
0044     {
0045         .procname   = "isa",
0046         .mode       = 0555,
0047         .child      = ctl_isa_vars,
0048     }, {}
0049 };
0050 
0051 static struct ctl_table ctl_bus[2] = {
0052     {
0053         .procname   = "bus",
0054         .mode       = 0555,
0055         .child      = ctl_isa,
0056     }, {}
0057 };
0058 
0059 void __init
0060 register_isa_ports(unsigned int membase, unsigned int portbase, unsigned int portshift)
0061 {
0062     isa_membase = membase;
0063     isa_portbase = portbase;
0064     isa_portshift = portshift;
0065     isa_sysctl_header = register_sysctl_table(ctl_bus);
0066 }