isa.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * linux/arch/arm/kernel/isa.c
  4. *
  5. * Copyright (C) 1999 Phil Blundell
  6. *
  7. * ISA shared memory and I/O port support, and is required to support
  8. * iopl, inb, outb and friends in userspace via glibc emulation.
  9. */
  10. #include <linux/stddef.h>
  11. #include <linux/types.h>
  12. #include <linux/fs.h>
  13. #include <linux/sysctl.h>
  14. #include <linux/init.h>
  15. #include <linux/io.h>
  16. static unsigned int isa_membase, isa_portbase, isa_portshift;
  17. static struct ctl_table ctl_isa_vars[4] = {
  18. {
  19. .procname = "membase",
  20. .data = &isa_membase,
  21. .maxlen = sizeof(isa_membase),
  22. .mode = 0444,
  23. .proc_handler = proc_dointvec,
  24. }, {
  25. .procname = "portbase",
  26. .data = &isa_portbase,
  27. .maxlen = sizeof(isa_portbase),
  28. .mode = 0444,
  29. .proc_handler = proc_dointvec,
  30. }, {
  31. .procname = "portshift",
  32. .data = &isa_portshift,
  33. .maxlen = sizeof(isa_portshift),
  34. .mode = 0444,
  35. .proc_handler = proc_dointvec,
  36. }, {}
  37. };
  38. static struct ctl_table_header *isa_sysctl_header;
  39. static struct ctl_table ctl_isa[2] = {
  40. {
  41. .procname = "isa",
  42. .mode = 0555,
  43. .child = ctl_isa_vars,
  44. }, {}
  45. };
  46. static struct ctl_table ctl_bus[2] = {
  47. {
  48. .procname = "bus",
  49. .mode = 0555,
  50. .child = ctl_isa,
  51. }, {}
  52. };
  53. void __init
  54. register_isa_ports(unsigned int membase, unsigned int portbase, unsigned int portshift)
  55. {
  56. isa_membase = membase;
  57. isa_portbase = portbase;
  58. isa_portshift = portshift;
  59. isa_sysctl_header = register_sysctl_table(ctl_bus);
  60. }