Patch series "iomap: Constify ioreadX() iomem argument", v3. The ioread8/16/32() and others have inconsistent interface among the architectures: some taking address as const, some not. It seems there is nothing really stopping all of them to take pointer to const. This patch (of 4): The ioreadX() and ioreadX_rep() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among architectures. [krzk@kernel.org: sh: clk: fix assignment from incompatible pointer type for ioreadX()] Link: http://lkml.kernel.org/r/20200723082017.24053-1-krzk@kernel.org [akpm@linux-foundation.org: fix drivers/mailbox/bcm-pdc-mailbox.c] Link: http://lkml.kernel.org/r/202007132209.Rxmv4QyS%25lkp@intel.com Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com> Cc: Helge Deller <deller@gmx.de> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Rich Felker <dalias@libc.org> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Jon Mason <jdmason@kudzu.us> Cc: Allen Hubbe <allenbh@gmail.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Jason Wang <jasowang@redhat.com> Link: http://lkml.kernel.org/r/20200709072837.5869-1-krzk@kernel.org Link: http://lkml.kernel.org/r/20200709072837.5869-2-krzk@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
144 lines
3.7 KiB
C
144 lines
3.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ALPHA_MACHVEC_H
|
|
#define __ALPHA_MACHVEC_H 1
|
|
|
|
#include <linux/types.h>
|
|
|
|
/*
|
|
* This file gets pulled in by asm/io.h from user space. We don't
|
|
* want most of this escaping.
|
|
*/
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
/* The following structure vectors all of the I/O and IRQ manipulation
|
|
from the generic kernel to the hardware specific backend. */
|
|
|
|
struct task_struct;
|
|
struct mm_struct;
|
|
struct vm_area_struct;
|
|
struct linux_hose_info;
|
|
struct pci_dev;
|
|
struct pci_ops;
|
|
struct pci_controller;
|
|
struct _alpha_agp_info;
|
|
struct rtc_time;
|
|
|
|
struct alpha_machine_vector
|
|
{
|
|
/* This "belongs" down below with the rest of the runtime
|
|
variables, but it is convenient for entry.S if these
|
|
two slots are at the beginning of the struct. */
|
|
unsigned long hae_cache;
|
|
unsigned long *hae_register;
|
|
|
|
int nr_irqs;
|
|
int rtc_port;
|
|
int rtc_boot_cpu_only;
|
|
unsigned int max_asn;
|
|
unsigned long max_isa_dma_address;
|
|
unsigned long irq_probe_mask;
|
|
unsigned long iack_sc;
|
|
unsigned long min_io_address;
|
|
unsigned long min_mem_address;
|
|
unsigned long pci_dac_offset;
|
|
|
|
void (*mv_pci_tbi)(struct pci_controller *hose,
|
|
dma_addr_t start, dma_addr_t end);
|
|
|
|
unsigned int (*mv_ioread8)(const void __iomem *);
|
|
unsigned int (*mv_ioread16)(const void __iomem *);
|
|
unsigned int (*mv_ioread32)(const void __iomem *);
|
|
|
|
void (*mv_iowrite8)(u8, void __iomem *);
|
|
void (*mv_iowrite16)(u16, void __iomem *);
|
|
void (*mv_iowrite32)(u32, void __iomem *);
|
|
|
|
u8 (*mv_readb)(const volatile void __iomem *);
|
|
u16 (*mv_readw)(const volatile void __iomem *);
|
|
u32 (*mv_readl)(const volatile void __iomem *);
|
|
u64 (*mv_readq)(const volatile void __iomem *);
|
|
|
|
void (*mv_writeb)(u8, volatile void __iomem *);
|
|
void (*mv_writew)(u16, volatile void __iomem *);
|
|
void (*mv_writel)(u32, volatile void __iomem *);
|
|
void (*mv_writeq)(u64, volatile void __iomem *);
|
|
|
|
void __iomem *(*mv_ioportmap)(unsigned long);
|
|
void __iomem *(*mv_ioremap)(unsigned long, unsigned long);
|
|
void (*mv_iounmap)(volatile void __iomem *);
|
|
int (*mv_is_ioaddr)(unsigned long);
|
|
int (*mv_is_mmio)(const volatile void __iomem *);
|
|
|
|
void (*mv_switch_mm)(struct mm_struct *, struct mm_struct *,
|
|
struct task_struct *);
|
|
void (*mv_activate_mm)(struct mm_struct *, struct mm_struct *);
|
|
|
|
void (*mv_flush_tlb_current)(struct mm_struct *);
|
|
void (*mv_flush_tlb_current_page)(struct mm_struct * mm,
|
|
struct vm_area_struct *vma,
|
|
unsigned long addr);
|
|
|
|
void (*update_irq_hw)(unsigned long, unsigned long, int);
|
|
void (*ack_irq)(unsigned long);
|
|
void (*device_interrupt)(unsigned long vector);
|
|
void (*machine_check)(unsigned long vector, unsigned long la);
|
|
|
|
void (*smp_callin)(void);
|
|
void (*init_arch)(void);
|
|
void (*init_irq)(void);
|
|
void (*init_rtc)(void);
|
|
void (*init_pci)(void);
|
|
void (*kill_arch)(int);
|
|
|
|
u8 (*pci_swizzle)(struct pci_dev *, u8 *);
|
|
int (*pci_map_irq)(const struct pci_dev *, u8, u8);
|
|
struct pci_ops *pci_ops;
|
|
|
|
struct _alpha_agp_info *(*agp_info)(void);
|
|
|
|
const char *vector_name;
|
|
|
|
/* NUMA information */
|
|
int (*pa_to_nid)(unsigned long);
|
|
int (*cpuid_to_nid)(int);
|
|
unsigned long (*node_mem_start)(int);
|
|
unsigned long (*node_mem_size)(int);
|
|
|
|
/* System specific parameters. */
|
|
union {
|
|
struct {
|
|
unsigned long gru_int_req_bits;
|
|
} cia;
|
|
|
|
struct {
|
|
unsigned long gamma_bias;
|
|
} t2;
|
|
|
|
struct {
|
|
unsigned int route_tab;
|
|
} sio;
|
|
} sys;
|
|
};
|
|
|
|
extern struct alpha_machine_vector alpha_mv;
|
|
|
|
#ifdef CONFIG_ALPHA_GENERIC
|
|
extern int alpha_using_srm;
|
|
extern int alpha_using_qemu;
|
|
#else
|
|
# ifdef CONFIG_ALPHA_SRM
|
|
# define alpha_using_srm 1
|
|
# else
|
|
# define alpha_using_srm 0
|
|
# endif
|
|
# ifdef CONFIG_ALPHA_QEMU
|
|
# define alpha_using_qemu 1
|
|
# else
|
|
# define alpha_using_qemu 0
|
|
# endif
|
|
#endif /* GENERIC */
|
|
|
|
#endif /* __KERNEL__ */
|
|
#endif /* __ALPHA_MACHVEC_H */
|