linux/arch/x86/include/asm/genapic_32.h
<<
>>
Prefs
   1#ifndef _ASM_X86_GENAPIC_32_H
   2#define _ASM_X86_GENAPIC_32_H
   3
   4#include <asm/mpspec.h>
   5
   6/*
   7 * Generic APIC driver interface.
   8 *
   9 * An straight forward mapping of the APIC related parts of the
  10 * x86 subarchitecture interface to a dynamic object.
  11 *
  12 * This is used by the "generic" x86 subarchitecture.
  13 *
  14 * Copyright 2003 Andi Kleen, SuSE Labs.
  15 */
  16
  17struct mpc_config_bus;
  18struct mp_config_table;
  19struct mpc_config_processor;
  20
  21struct genapic {
  22        char *name;
  23        int (*probe)(void);
  24
  25        int (*apic_id_registered)(void);
  26        cpumask_t (*target_cpus)(void);
  27        int int_delivery_mode;
  28        int int_dest_mode;
  29        int ESR_DISABLE;
  30        int apic_destination_logical;
  31        unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
  32        unsigned long (*check_apicid_present)(int apicid);
  33        int no_balance_irq;
  34        int no_ioapic_check;
  35        void (*init_apic_ldr)(void);
  36        physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
  37
  38        void (*setup_apic_routing)(void);
  39        int (*multi_timer_check)(int apic, int irq);
  40        int (*apicid_to_node)(int logical_apicid);
  41        int (*cpu_to_logical_apicid)(int cpu);
  42        int (*cpu_present_to_apicid)(int mps_cpu);
  43        physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
  44        void (*setup_portio_remap)(void);
  45        int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
  46        void (*enable_apic_mode)(void);
  47        u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
  48
  49        /* mpparse */
  50        /* When one of the next two hooks returns 1 the genapic
  51           is switched to this. Essentially they are additional probe
  52           functions. */
  53        int (*mps_oem_check)(struct mp_config_table *mpc, char *oem,
  54                             char *productid);
  55        int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
  56
  57        unsigned (*get_apic_id)(unsigned long x);
  58        unsigned long apic_id_mask;
  59        unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask);
  60        cpumask_t (*vector_allocation_domain)(int cpu);
  61
  62#ifdef CONFIG_SMP
  63        /* ipi */
  64        void (*send_IPI_mask)(cpumask_t mask, int vector);
  65        void (*send_IPI_allbutself)(int vector);
  66        void (*send_IPI_all)(int vector);
  67#endif
  68};
  69
  70#define APICFUNC(x) .x = x,
  71
  72/* More functions could be probably marked IPIFUNC and save some space
  73   in UP GENERICARCH kernels, but I don't have the nerve right now
  74   to untangle this mess. -AK  */
  75#ifdef CONFIG_SMP
  76#define IPIFUNC(x) APICFUNC(x)
  77#else
  78#define IPIFUNC(x)
  79#endif
  80
  81#define APIC_INIT(aname, aprobe)                        \
  82{                                                       \
  83        .name = aname,                                  \
  84        .probe = aprobe,                                \
  85        .int_delivery_mode = INT_DELIVERY_MODE,         \
  86        .int_dest_mode = INT_DEST_MODE,                 \
  87        .no_balance_irq = NO_BALANCE_IRQ,               \
  88        .ESR_DISABLE = esr_disable,                     \
  89        .apic_destination_logical = APIC_DEST_LOGICAL,  \
  90        APICFUNC(apic_id_registered)                    \
  91        APICFUNC(target_cpus)                           \
  92        APICFUNC(check_apicid_used)                     \
  93        APICFUNC(check_apicid_present)                  \
  94        APICFUNC(init_apic_ldr)                         \
  95        APICFUNC(ioapic_phys_id_map)                    \
  96        APICFUNC(setup_apic_routing)                    \
  97        APICFUNC(multi_timer_check)                     \
  98        APICFUNC(apicid_to_node)                        \
  99        APICFUNC(cpu_to_logical_apicid)                 \
 100        APICFUNC(cpu_present_to_apicid)                 \
 101        APICFUNC(apicid_to_cpu_present)                 \
 102        APICFUNC(setup_portio_remap)                    \
 103        APICFUNC(check_phys_apicid_present)             \
 104        APICFUNC(mps_oem_check)                         \
 105        APICFUNC(get_apic_id)                           \
 106        .apic_id_mask = APIC_ID_MASK,                   \
 107        APICFUNC(cpu_mask_to_apicid)                    \
 108        APICFUNC(vector_allocation_domain)                      \
 109        APICFUNC(acpi_madt_oem_check)                   \
 110        IPIFUNC(send_IPI_mask)                          \
 111        IPIFUNC(send_IPI_allbutself)                    \
 112        IPIFUNC(send_IPI_all)                           \
 113        APICFUNC(enable_apic_mode)                      \
 114        APICFUNC(phys_pkg_id)                           \
 115}
 116
 117extern struct genapic *genapic;
 118
 119enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
 120#define get_uv_system_type()            UV_NONE
 121#define is_uv_system()                  0
 122#define uv_wakeup_secondary(a, b)       1
 123#define uv_system_init()                do {} while (0)
 124
 125
 126#endif /* _ASM_X86_GENAPIC_32_H */
 127
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.