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/memblock.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
= memblock_alloc(sizeof(*hose
), SMP_CACHE_BYTES
);
38 panic("%s: Failed to allocate %zu bytes\n", __func__
,
42 hose_tail
= &hose
->next
;
47 struct resource
* __init
50 void *ptr
= memblock_alloc(sizeof(struct resource
), SMP_CACHE_BYTES
);
53 panic("%s: Failed to allocate %zu bytes\n", __func__
,
54 sizeof(struct resource
));
59 SYSCALL_DEFINE3(pciconfig_iobase
, long, which
, unsigned long, bus
,
62 struct pci_controller
*hose
;
64 /* from hose or from bus.devfn */
65 if (which
& IOBASE_FROM_HOSE
) {
66 for (hose
= hose_head
; hose
; hose
= hose
->next
)
67 if (hose
->index
== bus
)
72 /* Special hook for ISA access. */
73 if (bus
== 0 && dfn
== 0)
79 switch (which
& ~IOBASE_FROM_HOSE
) {
82 case IOBASE_SPARSE_MEM
:
83 return hose
->sparse_mem_base
;
84 case IOBASE_DENSE_MEM
:
85 return hose
->dense_mem_base
;
86 case IOBASE_SPARSE_IO
:
87 return hose
->sparse_io_base
;
89 return hose
->dense_io_base
;
91 return hose
->bus
->number
;
97 SYSCALL_DEFINE5(pciconfig_read
, unsigned long, bus
, unsigned long, dfn
,
98 unsigned long, off
, unsigned long, len
, void __user
*, buf
)
100 if (!capable(CAP_SYS_ADMIN
))
106 SYSCALL_DEFINE5(pciconfig_write
, unsigned long, bus
, unsigned long, dfn
,
107 unsigned long, off
, unsigned long, len
, void __user
*, buf
)
109 if (!capable(CAP_SYS_ADMIN
))