• David Mosberger's avatar
    [IA64] fix per-CPU MCA mess and make UP kernels work again · 55c8c0cb
    David Mosberger authored
    This patch cleans up the per-CPU MCA mess with the following changes
    (and yields a UP kernel that actually boots again):
    
     - In percpu.h, make per_cpu_init() a function-call even for the
       UP case.
     - In contig.c, enable per_cpu_init() even for UP since we need to
       allocate the per-CPU MCA data in that case as well.
     - Move the MCA-related stuff out of the cpuinfo structure into
       per-CPU variables defined by mca.c.
     - Rename IA64_KR_PA_CPU_INFO to IA64_KR_PER_CPU_DATA, since it really
       is a per-CPU pointer now.
     - In mca.h, move IA64_MCA_STACK_SIZE early enough so it gets defined
       for assembly-code, too.  Tidy up struct ia64_mca_struct.  Add declaration
       of ia64_mca_cpu_init().
     - In mca_asm.[hS], replace various GET_*() macros with a single
       GET_PERCPU_ADDR() which loads the physical address of an
       arbitrary per-CPU variable.  Remove all dependencies on the
       layout of the cpuinfo structure.  Replace hardcoded stack-size
       with IA64_MCA_STACK_SIZE constant.  Replace hardcoded references
       to ar.k3 with IA64_KR(PER_CPU_DATA).
     - In setup.c:cpu_init(), initialize ar.k3 to be the physical equivalent
       of the per-CPU data pointer.
     - Nuke silly ia64_mca_cpu_t typedef and just use struct ia64_mca_cpu instead.
     - Move __per_cpu_mca[] from setup.c to mca.c.
     - Rename set_mca_pointer() to ia64_mca_cpu_init() and sanitize it.
     - Rename efi.c:pal_code_memdesc() to efi_get_pal_addr() and make it
       return the PAL address, rather than a memory-descriptor.
     - Make efi_map_pal_code() use efi_get_pal_addr().
    Signed-off-by: default avatarDavid Mosberger-Tang <davidm@hpl.hp.com>
    Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
    55c8c0cb
mca.c 41.4 KB