···11+/*22+ * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>33+ */44+#ifndef _ASM_POWERPC_BARRIER_H55+#define _ASM_POWERPC_BARRIER_H66+77+/*88+ * Memory barrier.99+ * The sync instruction guarantees that all memory accesses initiated1010+ * by this processor have been performed (with respect to all other1111+ * mechanisms that access memory). The eieio instruction is a barrier1212+ * providing an ordering (separately) for (a) cacheable stores and (b)1313+ * loads and stores to non-cacheable memory (e.g. I/O devices).1414+ *1515+ * mb() prevents loads and stores being reordered across this point.1616+ * rmb() prevents loads being reordered across this point.1717+ * wmb() prevents stores being reordered across this point.1818+ * read_barrier_depends() prevents data-dependent loads being reordered1919+ * across this point (nop on PPC).2020+ *2121+ * *mb() variants without smp_ prefix must order all types of memory2222+ * operations with one another. sync is the only instruction sufficient2323+ * to do this.2424+ *2525+ * For the smp_ barriers, ordering is for cacheable memory operations2626+ * only. We have to use the sync instruction for smp_mb(), since lwsync2727+ * doesn't order loads with respect to previous stores. Lwsync can be2828+ * used for smp_rmb() and smp_wmb().2929+ *3030+ * However, on CPUs that don't support lwsync, lwsync actually maps to a3131+ * heavy-weight sync, so smp_wmb() can be a lighter-weight eieio.3232+ */3333+#define mb() __asm__ __volatile__ ("sync" : : : "memory")3434+#define rmb() __asm__ __volatile__ ("sync" : : : "memory")3535+#define wmb() __asm__ __volatile__ ("sync" : : : "memory")3636+#define read_barrier_depends() do { } while(0)3737+3838+#define set_mb(var, value) do { var = value; mb(); } while (0)3939+4040+#ifdef CONFIG_SMP4141+4242+#ifdef __SUBARCH_HAS_LWSYNC4343+# define SMPWMB LWSYNC4444+#else4545+# define SMPWMB eieio4646+#endif4747+4848+#define smp_mb() mb()4949+#define smp_rmb() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")5050+#define smp_wmb() __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")5151+#define smp_read_barrier_depends() read_barrier_depends()5252+#else5353+#define smp_mb() barrier()5454+#define smp_rmb() barrier()5555+#define smp_wmb() barrier()5656+#define smp_read_barrier_depends() do { } while(0)5757+#endif /* CONFIG_SMP */5858+5959+/*6060+ * This is a barrier which prevents following instructions from being6161+ * started until the value of the argument x is known. For example, if6262+ * x is a variable loaded from memory, this prevents following6363+ * instructions from being executed until the load has been performed.6464+ */6565+#define data_barrier(x) \6666+ asm volatile("twi 0,%0,0; isync" : : "r" (x) : "memory");6767+6868+#endif /* _ASM_POWERPC_BARRIER_H */
···385385extern unsigned long cpuidle_disable;386386enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};387387388388+extern int powersave_nap; /* set if nap mode can be used in idle loop */389389+void cpu_idle_wait(void);390390+391391+#ifdef CONFIG_PSERIES_IDLE392392+extern void update_smt_snooze_delay(int snooze);393393+extern int pseries_notify_cpuidle_add_cpu(int cpu);394394+#else395395+static inline void update_smt_snooze_delay(int snooze) {}396396+static inline int pseries_notify_cpuidle_add_cpu(int cpu) { return 0; }397397+#endif398398+399399+extern void flush_instruction_cache(void);400400+extern void hard_reset_now(void);401401+extern void poweroff_now(void);402402+extern int fix_alignment(struct pt_regs *);403403+extern void cvt_fd(float *from, double *to);404404+extern void cvt_df(double *from, float *to);405405+extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);406406+407407+#ifdef CONFIG_PPC64408408+/*409409+ * We handle most unaligned accesses in hardware. On the other hand 410410+ * unaligned DMA can be very expensive on some ppc64 IO chips (it does411411+ * powers of 2 writes until it reaches sufficient alignment).412412+ *413413+ * Based on this we disable the IP header alignment in network drivers.414414+ */415415+#define NET_IP_ALIGN 0416416+#endif417417+388418#endif /* __KERNEL__ */389419#endif /* __ASSEMBLY__ */390420#endif /* _ASM_POWERPC_PROCESSOR_H */
···325325static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;}326326#endif327327328328+extern int call_rtas(const char *, int, int, unsigned long *, ...);329329+328330#endif /* __KERNEL__ */329331#endif /* _POWERPC_RTAS_H */
+45
arch/powerpc/include/asm/runlatch.h
···11+/*22+ * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>33+ */44+#ifndef _ASM_POWERPC_RUNLATCH_H55+#define _ASM_POWERPC_RUNLATCH_H66+77+#ifdef CONFIG_PPC6488+99+extern void __ppc64_runlatch_on(void);1010+extern void __ppc64_runlatch_off(void);1111+1212+/*1313+ * We manually hard enable-disable, this is called1414+ * in the idle loop and we don't want to mess up1515+ * with soft-disable/enable & interrupt replay.1616+ */1717+#define ppc64_runlatch_off() \1818+ do { \1919+ if (cpu_has_feature(CPU_FTR_CTRL) && \2020+ test_thread_local_flags(_TLF_RUNLATCH)) { \2121+ unsigned long msr = mfmsr(); \2222+ __hard_irq_disable(); \2323+ __ppc64_runlatch_off(); \2424+ if (msr & MSR_EE) \2525+ __hard_irq_enable(); \2626+ } \2727+ } while (0)2828+2929+#define ppc64_runlatch_on() \3030+ do { \3131+ if (cpu_has_feature(CPU_FTR_CTRL) && \3232+ !test_thread_local_flags(_TLF_RUNLATCH)) { \3333+ unsigned long msr = mfmsr(); \3434+ __hard_irq_disable(); \3535+ __ppc64_runlatch_on(); \3636+ if (msr & MSR_EE) \3737+ __hard_irq_enable(); \3838+ } \3939+ } while (0)4040+#else4141+#define ppc64_runlatch_on()4242+#define ppc64_runlatch_off()4343+#endif /* CONFIG_PPC64 */4444+4545+#endif /* _ASM_POWERPC_RUNLATCH_H */
+23-1
arch/powerpc/include/asm/setup.h
···5566#ifndef __ASSEMBLY__77extern void ppc_printk_progress(char *s, unsigned short hex);88-#endif88+99+extern unsigned int rtas_data;1010+extern int mem_init_done; /* set on boot once kmalloc can be called */1111+extern int init_bootmem_done; /* set once bootmem is available */1212+extern phys_addr_t memory_limit;1313+extern unsigned long klimit;1414+extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);1515+1616+extern void via_cuda_init(void);1717+extern void read_rtc_time(void);1818+extern void pmac_find_display(void);1919+2020+struct device_node;2121+extern void note_scsi_host(struct device_node *, void *);2222+2323+/* Used in very early kernel initialization. */2424+extern unsigned long reloc_offset(void);2525+extern unsigned long add_reloc_offset(unsigned long);2626+extern void reloc_got2(unsigned long);2727+2828+#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))2929+3030+#endif /* !__ASSEMBLY__ */9311032#endif /* _ASM_POWERPC_SETUP_H */
···2020#include <asm/cputable.h>2121#include <asm/prom.h> /* for PTRRELOC on ARCH=ppc */2222#include <asm/mmu.h>2323+#include <asm/setup.h>23242425struct cpu_spec* cur_cpu_spec = NULL;2526EXPORT_SYMBOL(cur_cpu_spec);
+1-1
arch/powerpc/kernel/crash.c
···2727#include <asm/kdump.h>2828#include <asm/prom.h>2929#include <asm/smp.h>3030-#include <asm/system.h>3130#include <asm/setjmp.h>3131+#include <asm/debug.h>32323333/*3434 * The primary CPU waits a while for all secondary CPUs to enter. This is to
···3232#include <asm/uaccess.h>3333#include <asm/page.h>3434#include <asm/pgtable.h>3535-#include <asm/system.h>3535+#include <asm/switch_to.h>36363737/*3838 * does not yet catch signals sent when the child dies.
···26262727#include <asm/pgtable.h>2828#include <asm/uaccess.h>2929-#include <asm/system.h>3029#include <asm/io.h>31303231/* Eventually we may need a look-up table, but this works for now.
···33#include <asm/io.h>44#include <asm/time.h>55#include <asm/mpc52xx.h>66+#include <asm/switch_to.h>6778/* defined in lite5200_sleep.S and only used here */89extern void lite5200_low_power(void __iomem *sram, void __iomem *mbar);
···3333#include <asm/sections.h>3434#include <asm/cputable.h>3535#include <asm/time.h>3636-#include <asm/system.h>3736#include <asm/mpic.h>3837#include <asm/keylargo.h>3838+#include <asm/switch_to.h>39394040/* WARNING !!! This will cause calibrate_delay() to be called,4141 * but this is an __init function ! So you MUST go edit