cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

proto.h (6789B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2#include <linux/interrupt.h>
      3#include <linux/io.h>
      4
      5/* Prototypes of functions used across modules here in this directory.  */
      6
      7#define vucp	volatile unsigned char  *
      8#define vusp	volatile unsigned short *
      9#define vip	volatile int *
     10#define vuip	volatile unsigned int   *
     11#define vulp	volatile unsigned long  *
     12
     13struct pt_regs;
     14struct task_struct;
     15struct pci_dev;
     16struct pci_controller;
     17
     18/* core_apecs.c */
     19extern struct pci_ops apecs_pci_ops;
     20extern void apecs_init_arch(void);
     21extern void apecs_pci_clr_err(void);
     22extern void apecs_machine_check(unsigned long vector, unsigned long la_ptr);
     23extern void apecs_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
     24
     25/* core_cia.c */
     26extern struct pci_ops cia_pci_ops;
     27extern void cia_init_pci(void);
     28extern void cia_init_arch(void);
     29extern void pyxis_init_arch(void);
     30extern void cia_kill_arch(int);
     31extern void cia_machine_check(unsigned long vector, unsigned long la_ptr);
     32extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
     33
     34/* core_irongate.c */
     35extern struct pci_ops irongate_pci_ops;
     36extern int irongate_pci_clr_err(void);
     37extern void irongate_init_arch(void);
     38#define irongate_pci_tbi ((void *)0)
     39
     40/* core_lca.c */
     41extern struct pci_ops lca_pci_ops;
     42extern void lca_init_arch(void);
     43extern void lca_machine_check(unsigned long vector, unsigned long la_ptr);
     44extern void lca_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
     45
     46/* core_marvel.c */
     47extern struct pci_ops marvel_pci_ops;
     48extern void marvel_init_arch(void);
     49extern void marvel_kill_arch(int);
     50extern void marvel_machine_check(unsigned long, unsigned long);
     51extern void marvel_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
     52extern struct _alpha_agp_info *marvel_agp_info(void);
     53struct io7 *marvel_find_io7(int pe);
     54struct io7 *marvel_next_io7(struct io7 *prev);
     55void io7_clear_errors(struct io7 *io7);
     56
     57/* core_mcpcia.c */
     58extern struct pci_ops mcpcia_pci_ops;
     59extern void mcpcia_init_arch(void);
     60extern void mcpcia_init_hoses(void);
     61extern void mcpcia_machine_check(unsigned long vector, unsigned long la_ptr);
     62extern void mcpcia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
     63
     64/* core_polaris.c */
     65extern struct pci_ops polaris_pci_ops;
     66extern int polaris_read_config_dword(struct pci_dev *, int, u32 *);
     67extern int polaris_write_config_dword(struct pci_dev *, int, u32);
     68extern void polaris_init_arch(void);
     69extern void polaris_machine_check(unsigned long vector, unsigned long la_ptr);
     70#define polaris_pci_tbi ((void *)0)
     71
     72/* core_t2.c */
     73extern struct pci_ops t2_pci_ops;
     74extern void t2_init_arch(void);
     75extern void t2_kill_arch(int);
     76extern void t2_machine_check(unsigned long vector, unsigned long la_ptr);
     77extern void t2_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
     78
     79/* core_titan.c */
     80extern struct pci_ops titan_pci_ops;
     81extern void titan_init_arch(void);
     82extern void titan_kill_arch(int);
     83extern void titan_machine_check(unsigned long, unsigned long);
     84extern void titan_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
     85extern struct _alpha_agp_info *titan_agp_info(void);
     86
     87/* core_tsunami.c */
     88extern struct pci_ops tsunami_pci_ops;
     89extern void tsunami_init_arch(void);
     90extern void tsunami_kill_arch(int);
     91extern void tsunami_machine_check(unsigned long vector, unsigned long la_ptr);
     92extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
     93
     94/* core_wildfire.c */
     95extern struct pci_ops wildfire_pci_ops;
     96extern void wildfire_init_arch(void);
     97extern void wildfire_kill_arch(int);
     98extern void wildfire_machine_check(unsigned long vector, unsigned long la_ptr);
     99extern void wildfire_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
    100
    101/* console.c */
    102#ifdef CONFIG_VGA_HOSE
    103extern void find_console_vga_hose(void);
    104extern void locate_and_init_vga(void *(*)(void *, void *));
    105#else
    106static inline void find_console_vga_hose(void) { }
    107static inline void locate_and_init_vga(void *(*sel_func)(void *, void *)) { }
    108#endif
    109
    110/* setup.c */
    111extern unsigned long srm_hae;
    112extern int boot_cpuid;
    113#ifdef CONFIG_VERBOSE_MCHECK
    114extern unsigned long alpha_verbose_mcheck;
    115#endif
    116
    117/* srmcons.c */
    118#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM)
    119extern void register_srm_console(void);
    120extern void unregister_srm_console(void);
    121#else
    122#define register_srm_console()
    123#define unregister_srm_console()
    124#endif
    125
    126/* smp.c */
    127extern void setup_smp(void);
    128extern void handle_ipi(struct pt_regs *);
    129
    130/* bios32.c */
    131/* extern void reset_for_srm(void); */
    132
    133/* time.c */
    134extern irqreturn_t rtc_timer_interrupt(int irq, void *dev);
    135extern void init_clockevent(void);
    136extern void common_init_rtc(void);
    137extern unsigned long est_cycle_freq;
    138
    139/* smc37c93x.c */
    140extern void SMC93x_Init(void);
    141
    142/* smc37c669.c */
    143extern void SMC669_Init(int);
    144
    145/* es1888.c */
    146extern void es1888_init(void);
    147
    148/* ../lib/fpreg.c */
    149extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);
    150extern unsigned long alpha_read_fp_reg (unsigned long reg);
    151
    152/* head.S */
    153extern void wrmces(unsigned long mces);
    154extern void cserve_ena(unsigned long);
    155extern void cserve_dis(unsigned long);
    156extern void __smp_callin(unsigned long);
    157
    158/* entry.S */
    159extern void entArith(void);
    160extern void entIF(void);
    161extern void entInt(void);
    162extern void entMM(void);
    163extern void entSys(void);
    164extern void entUna(void);
    165extern void entDbg(void);
    166
    167/* ptrace.c */
    168extern int ptrace_set_bpt (struct task_struct *child);
    169extern int ptrace_cancel_bpt (struct task_struct *child);
    170
    171/* traps.c */
    172extern void dik_show_regs(struct pt_regs *regs, unsigned long *r9_15);
    173extern void die_if_kernel(char *, struct pt_regs *, long, unsigned long *);
    174
    175/* sys_titan.c */
    176extern void titan_dispatch_irqs(u64);
    177
    178/* ../mm/init.c */
    179extern void switch_to_system_map(void);
    180extern void srm_paging_stop(void);
    181
    182static inline int
    183__alpha_remap_area_pages(unsigned long address, unsigned long phys_addr,
    184			 unsigned long size, unsigned long flags)
    185{
    186	pgprot_t prot;
    187
    188	prot = __pgprot(_PAGE_VALID | _PAGE_ASM | _PAGE_KRE
    189			| _PAGE_KWE | flags);
    190	return ioremap_page_range(address, address + size, phys_addr, prot);
    191}
    192
    193/* irq.c */
    194
    195#ifdef CONFIG_SMP
    196#define mcheck_expected(cpu)	(cpu_data[cpu].mcheck_expected)
    197#define mcheck_taken(cpu)	(cpu_data[cpu].mcheck_taken)
    198#define mcheck_extra(cpu)	(cpu_data[cpu].mcheck_extra)
    199#else
    200extern struct mcheck_info
    201{
    202	unsigned char expected __attribute__((aligned(8)));
    203	unsigned char taken;
    204	unsigned char extra;
    205} __mcheck_info;
    206
    207#define mcheck_expected(cpu)	(*((void)(cpu), &__mcheck_info.expected))
    208#define mcheck_taken(cpu)	(*((void)(cpu), &__mcheck_info.taken))
    209#define mcheck_extra(cpu)	(*((void)(cpu), &__mcheck_info.extra))
    210#endif
    211
    212extern void process_mcheck_info(unsigned long vector, unsigned long la_ptr,
    213				const char *machine, int expected);