1 // SPDX-License-Identifier: GPL-2.0
3 * linux/arch/alpha/kernel/pci-noop.c
5 * Stub PCI interfaces for Jensen-specific kernels.
9 #include <linux/init.h>
10 #include <linux/bootmem.h>
11 #include <linux/gfp.h>
12 #include <linux/capability.h>
14 #include <linux/errno.h>
15 #include <linux/sched.h>
16 #include <linux/dma-mapping.h>
17 #include <linux/scatterlist.h>
18 #include <linux/syscalls.h>
24 * The PCI controller list.
27 struct pci_controller
*hose_head
, **hose_tail
= &hose_head
;
28 struct pci_controller
*pci_isa_hose
;
31 struct pci_controller
* __init
32 alloc_pci_controller(void)
34 struct pci_controller
*hose
;
36 hose
= alloc_bootmem(sizeof(*hose
));
39 hose_tail
= &hose
->next
;
44 struct resource
* __init
47 return alloc_bootmem(sizeof(struct resource
));
50 SYSCALL_DEFINE3(pciconfig_iobase
, long, which
, unsigned long, bus
,
53 struct pci_controller
*hose
;
55 /* from hose or from bus.devfn */
56 if (which
& IOBASE_FROM_HOSE
) {
57 for (hose
= hose_head
; hose
; hose
= hose
->next
)
58 if (hose
->index
== bus
)
63 /* Special hook for ISA access. */
64 if (bus
== 0 && dfn
== 0)
70 switch (which
& ~IOBASE_FROM_HOSE
) {
73 case IOBASE_SPARSE_MEM
:
74 return hose
->sparse_mem_base
;
75 case IOBASE_DENSE_MEM
:
76 return hose
->dense_mem_base
;
77 case IOBASE_SPARSE_IO
:
78 return hose
->sparse_io_base
;
80 return hose
->dense_io_base
;
82 return hose
->bus
->number
;
88 SYSCALL_DEFINE5(pciconfig_read
, unsigned long, bus
, unsigned long, dfn
,
89 unsigned long, off
, unsigned long, len
, void __user
*, buf
)
91 if (!capable(CAP_SYS_ADMIN
))
97 SYSCALL_DEFINE5(pciconfig_write
, unsigned long, bus
, unsigned long, dfn
,
98 unsigned long, off
, unsigned long, len
, void __user
*, buf
)
100 if (!capable(CAP_SYS_ADMIN
))