[POWERPC] Make crash.c work on 32-bit and 64-bit
To compile kexec on 32-bit we need a few more bits and pieces. Rather than add empty definitions, we can make crash.c work on 32-bit, with only a couple of kludges. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
47585d8f5d
commit
b6f35b4966
@ -67,9 +67,9 @@ pci64-$(CONFIG_PPC64) += pci_64.o pci_dn.o pci_iommu.o \
|
|||||||
pci_direct_iommu.o iomap.o
|
pci_direct_iommu.o iomap.o
|
||||||
pci32-$(CONFIG_PPC32) := pci_32.o
|
pci32-$(CONFIG_PPC32) := pci_32.o
|
||||||
obj-$(CONFIG_PCI) += $(pci64-y) $(pci32-y)
|
obj-$(CONFIG_PCI) += $(pci64-y) $(pci32-y)
|
||||||
kexec-$(CONFIG_PPC64) := machine_kexec_64.o crash.o
|
kexec-$(CONFIG_PPC64) := machine_kexec_64.o
|
||||||
kexec-$(CONFIG_PPC32) := machine_kexec_32.o
|
kexec-$(CONFIG_PPC32) := machine_kexec_32.o
|
||||||
obj-$(CONFIG_KEXEC) += machine_kexec.o $(kexec-y)
|
obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o $(kexec-y)
|
||||||
|
|
||||||
ifeq ($(CONFIG_PPC_ISERIES),y)
|
ifeq ($(CONFIG_PPC_ISERIES),y)
|
||||||
$(obj)/head_64.o: $(obj)/lparmap.s
|
$(obj)/head_64.o: $(obj)/lparmap.s
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
/* This keeps a track of which one is crashing cpu. */
|
/* This keeps a track of which one is crashing cpu. */
|
||||||
int crashing_cpu = -1;
|
int crashing_cpu = -1;
|
||||||
static cpumask_t cpus_in_crash = CPU_MASK_NONE;
|
static cpumask_t cpus_in_crash = CPU_MASK_NONE;
|
||||||
|
cpumask_t cpus_in_sr = CPU_MASK_NONE;
|
||||||
|
|
||||||
static u32 *append_elf_note(u32 *buf, char *name, unsigned type, void *data,
|
static u32 *append_elf_note(u32 *buf, char *name, unsigned type, void *data,
|
||||||
size_t data_len)
|
size_t data_len)
|
||||||
@ -139,7 +140,13 @@ void crash_ipi_callback(struct pt_regs *regs)
|
|||||||
|
|
||||||
if (ppc_md.kexec_cpu_down)
|
if (ppc_md.kexec_cpu_down)
|
||||||
ppc_md.kexec_cpu_down(1, 1);
|
ppc_md.kexec_cpu_down(1, 1);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PPC64
|
||||||
kexec_smp_wait();
|
kexec_smp_wait();
|
||||||
|
#else
|
||||||
|
for (;;); /* FIXME */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +262,11 @@ static void crash_kexec_prepare_cpus(int cpu)
|
|||||||
*
|
*
|
||||||
* do this if kexec in setup.c ?
|
* do this if kexec in setup.c ?
|
||||||
*/
|
*/
|
||||||
|
#ifdef CONFIG_PPC64
|
||||||
smp_release_cpus();
|
smp_release_cpus();
|
||||||
|
#else
|
||||||
|
/* FIXME */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void crash_kexec_secondary(struct pt_regs *regs)
|
void crash_kexec_secondary(struct pt_regs *regs)
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <linux/cpumask.h>
|
|
||||||
#include <linux/kexec.h>
|
#include <linux/kexec.h>
|
||||||
#include <linux/smp.h>
|
#include <linux/smp.h>
|
||||||
#include <linux/thread_info.h>
|
#include <linux/thread_info.h>
|
||||||
|
@ -55,9 +55,6 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_PPC64 /* XXX */
|
#ifdef CONFIG_PPC64 /* XXX */
|
||||||
#define _IO_BASE pci_io_base
|
#define _IO_BASE pci_io_base
|
||||||
#ifdef CONFIG_KEXEC
|
|
||||||
cpumask_t cpus_in_sr = CPU_MASK_NONE;
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUGGER
|
#ifdef CONFIG_DEBUGGER
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
#include <linux/cpumask.h>
|
||||||
|
|
||||||
#ifdef CONFIG_KEXEC
|
#ifdef CONFIG_KEXEC
|
||||||
|
|
||||||
@ -109,7 +110,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
|
|||||||
|
|
||||||
#define MAX_NOTE_BYTES 1024
|
#define MAX_NOTE_BYTES 1024
|
||||||
|
|
||||||
#ifdef __powerpc64__
|
|
||||||
extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
|
extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
|
||||||
master to copy new code to 0 */
|
master to copy new code to 0 */
|
||||||
extern int crashing_cpu;
|
extern int crashing_cpu;
|
||||||
@ -119,7 +119,6 @@ static inline int kexec_sr_activated(int cpu)
|
|||||||
{
|
{
|
||||||
return cpu_isset(cpu,cpus_in_sr);
|
return cpu_isset(cpu,cpus_in_sr);
|
||||||
}
|
}
|
||||||
#endif /* __powerpc64 __ */
|
|
||||||
|
|
||||||
struct kimage;
|
struct kimage;
|
||||||
struct pt_regs;
|
struct pt_regs;
|
||||||
|
Loading…
Reference in New Issue
Block a user