···5353#ifdef CONFIG_PPC_MULTIPLATFORM5454static void fixup_resource(struct resource *res, struct pci_dev *dev);5555static void do_bus_setup(struct pci_bus *bus);5656+static void phbs_remap_io(void);5657#endif57585859/* pci_io_base -- the base address from which io bars are offsets.···252251 kfree(phb);253252}254253254254+#ifndef CONFIG_PPC_ISERIES255255void __devinit pcibios_claim_one_bus(struct pci_bus *b)256256{257257 struct pci_dev *dev;···277275EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);278276#endif279277280280-#ifndef CONFIG_PPC_ISERIES281278static void __init pcibios_claim_of_setup(void)282279{283280 struct pci_bus *b;···12191218}12201219EXPORT_SYMBOL(remap_bus_range);1221122012221222-void phbs_remap_io(void)12211221+static void phbs_remap_io(void)12231222{12241223 struct pci_controller *hose, *tmp;12251224
+5-3
arch/powerpc/kernel/process.c
···201201}202202#endif /* CONFIG_SPE */203203204204+#ifndef CONFIG_SMP204205/*205206 * If we are doing lazy switching of CPU state (FP, altivec or SPE),206207 * and the current task has some state, discard it.207208 */208208-static inline void discard_lazy_cpu_state(void)209209+void discard_lazy_cpu_state(void)209210{210210-#ifndef CONFIG_SMP211211 preempt_disable();212212 if (last_task_used_math == current)213213 last_task_used_math = NULL;···220220 last_task_used_spe = NULL;221221#endif222222 preempt_enable();223223-#endif /* CONFIG_SMP */224223}224224+#endif /* CONFIG_SMP */225225226226+#ifdef CONFIG_PPC_MERGE /* XXX for now */226227int set_dabr(unsigned long dabr)227228{228229 if (ppc_md.set_dabr)···232231 mtspr(SPRN_DABR, dabr);233232 return 0;234233}234234+#endif235235236236#ifdef CONFIG_PPC64237237DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array);
+24-4
arch/powerpc/kernel/prom.c
···1100110011011101static void __init early_reserve_mem(void)11021102{11031103- unsigned long base, size;11041104- unsigned long *reserve_map;11031103+ u64 base, size;11041104+ u64 *reserve_map;1105110511061106- reserve_map = (unsigned long *)(((unsigned long)initial_boot_params) +11061106+ reserve_map = (u64 *)(((unsigned long)initial_boot_params) +11071107 initial_boot_params->off_mem_rsvmap);11081108+#ifdef CONFIG_PPC3211091109+ /* 11101110+ * Handle the case where we might be booting from an old kexec11111111+ * image that setup the mem_rsvmap as pairs of 32-bit values11121112+ */11131113+ if (*reserve_map > 0xffffffffull) {11141114+ u32 base_32, size_32;11151115+ u32 *reserve_map_32 = (u32 *)reserve_map;11161116+11171117+ while (1) {11181118+ base_32 = *(reserve_map_32++);11191119+ size_32 = *(reserve_map_32++);11201120+ if (size_32 == 0)11211121+ break;11221122+ DBG("reserving: %lx -> %lx\n", base_32, size_32);11231123+ lmb_reserve(base_32, size_32);11241124+ }11251125+ return;11261126+ }11271127+#endif11081128 while (1) {11091129 base = *(reserve_map++);11101130 size = *(reserve_map++);11111131 if (size == 0)11121132 break;11131113- DBG("reserving: %lx -> %lx\n", base, size);11331133+ DBG("reserving: %llx -> %llx\n", base, size);11141134 lmb_reserve(base, size);11151135 }11161136
+4-4
arch/powerpc/kernel/prom_init.c
···137137};138138139139struct mem_map_entry {140140- unsigned long base;141141- unsigned long size;140140+ u64 base;141141+ u64 size;142142};143143144144typedef u32 cell_t;···897897 * If problems seem to show up, it would be a good start to track898898 * them down.899899 */900900-static void reserve_mem(unsigned long base, unsigned long size)900900+static void reserve_mem(u64 base, u64 size)901901{902902- unsigned long top = base + size;902902+ u64 top = base + size;903903 unsigned long cnt = RELOC(mem_reserve_cnt);904904905905 if (size == 0)
+9-12
arch/powerpc/kernel/signal_32.c
···497497 if (err)498498 return 1;499499500500+ /*501501+ * Do this before updating the thread state in502502+ * current->thread.fpr/vr/evr. That way, if we get preempted503503+ * and another task grabs the FPU/Altivec/SPE, it won't be504504+ * tempted to save the current CPU state into the thread_struct505505+ * and corrupt what we are writing there.506506+ */507507+ discard_lazy_cpu_state();508508+500509 /* force the process to reload the FP registers from501510 current->thread when it next does FP instructions */502511 regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);···547538 return 1;548539#endif /* CONFIG_SPE */549540550550-#ifndef CONFIG_SMP551551- preempt_disable();552552- if (last_task_used_math == current)553553- last_task_used_math = NULL;554554- if (last_task_used_altivec == current)555555- last_task_used_altivec = NULL;556556-#ifdef CONFIG_SPE557557- if (last_task_used_spe == current)558558- last_task_used_spe = NULL;559559-#endif560560- preempt_enable();561561-#endif562541 return 0;563542}564543
+11-9
arch/powerpc/kernel/signal_64.c
···207207208208 if (!sig)209209 regs->gpr[13] = save_r13;210210- err |= __copy_from_user(¤t->thread.fpr, &sc->fp_regs, FP_REGS_SIZE);211210 if (set != NULL)212211 err |= __get_user(set->sig[0], &sc->oldmask);212212+213213+ /*214214+ * Do this before updating the thread state in215215+ * current->thread.fpr/vr. That way, if we get preempted216216+ * and another task grabs the FPU/Altivec, it won't be217217+ * tempted to save the current CPU state into the thread_struct218218+ * and corrupt what we are writing there.219219+ */220220+ discard_lazy_cpu_state();221221+222222+ err |= __copy_from_user(¤t->thread.fpr, &sc->fp_regs, FP_REGS_SIZE);213223214224#ifdef CONFIG_ALTIVEC215225 err |= __get_user(v_regs, &sc->v_regs);···239229 current->thread.vrsave = 0;240230#endif /* CONFIG_ALTIVEC */241231242242-#ifndef CONFIG_SMP243243- preempt_disable();244244- if (last_task_used_math == current)245245- last_task_used_math = NULL;246246- if (last_task_used_altivec == current)247247- last_task_used_altivec = NULL;248248- preempt_enable();249249-#endif250232 /* Force reload of FP/VEC */251233 regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC);252234
+1-1
arch/powerpc/platforms/cell/pervasive.c
···142142 }143143}144144145145-int cbe_system_reset_exception(struct pt_regs *regs)145145+static int cbe_system_reset_exception(struct pt_regs *regs)146146{147147 switch (regs->msr & SRR1_WAKEMASK) {148148 case SRR1_WAKEEE:
···2929 * value of the spu_status register after the SPU has stopped.3030 *3131 */3232-long do_spu_run(struct file *filp, __u32 __user *unpc, __u32 __user *ustatus)3232+static long do_spu_run(struct file *filp,3333+ __u32 __user *unpc,3434+ __u32 __user *ustatus)3335{3436 long ret;3537 struct spufs_inode_info *i;
···11+#ifndef _PLATFORMS_ISERIES_IOMMU_H22+#define _PLATFORMS_ISERIES_IOMMU_H33+44+/*55+ * Copyright (C) 2005 Stephen Rothwell, IBM Corporation66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License as published by99+ * the Free Software Foundation; either version 2 of the License, or1010+ * (at your option) any later version.1111+ *1212+ * This program is distributed in the hope that it will be useful,1313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1414+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515+ * GNU General Public License for more details.1616+ *1717+ * You should have received a copy of the GNU General Public License1818+ * along with this program; if not, write to the:1919+ * Free Software Foundation, Inc.,2020+ * 59 Temple Place, Suite 330,2121+ * Boston, MA 02111-1307 USA2222+ */2323+2424+struct device_node;2525+struct iommu_table;2626+2727+/* Creates table for an individual device node */2828+extern void iommu_devnode_init_iSeries(struct device_node *dn);2929+3030+/* Get table parameters from HV */3131+extern void iommu_table_getparms_iSeries(unsigned long busno,3232+ unsigned char slotno, unsigned char virtbus,3333+ struct iommu_table *tbl);3434+3535+#endif /* _PLATFORMS_ISERIES_IOMMU_H */
+8-11
arch/powerpc/platforms/iseries/irq.c
···4848extern void iSeries_smp_message_recv(struct pt_regs *);4949#endif50505151+#ifdef CONFIG_PCI5252+5153enum pci_event_type {5254 pe_bus_created = 0, /* PHB has been created */5355 pe_bus_error = 1, /* PHB has failed */···149147static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs)150148{151149 if (event && (event->xType == HvLpEvent_Type_PciIo)) {152152- switch (event->xFlags.xFunction) {153153- case HvLpEvent_Function_Int:150150+ if (hvlpevent_is_int(event))154151 int_received((struct pci_event *)event, regs);155155- break;156156- case HvLpEvent_Function_Ack:152152+ else157153 printk(KERN_ERR158154 "pci_event_handler: unexpected ack received\n");159159- break;160160- default:161161- printk(KERN_ERR162162- "pci_event_handler: unexpected event function %d\n",163163- (int)event->xFlags.xFunction);164164- break;165165- }166155 } else if (event)167156 printk(KERN_ERR168157 "pci_event_handler: Unrecognized PCI event type 0x%x\n",···327334 return virtirq;328335}329336337337+#endif /* CONFIG_PCI */338338+330339/*331340 * Get the next pending IRQ.332341 */···348353 if (hvlpevent_is_pending())349354 process_hvlpevents(regs);350355356356+#ifdef CONFIG_PCI351357 if (num_pending_irqs) {352358 spin_lock(&pending_irqs_lock);353359 for (irq = 0; irq < NR_IRQS; irq++) {···362366 if (irq >= NR_IRQS)363367 irq = -2;364368 }369369+#endif365370366371 return irq;367372}
···270270 * First see if this is just a normal monitor message from the271271 * other partition272272 */273273- if (event->xFlags.xFunction == HvLpEvent_Function_Int) {273273+ if (hvlpevent_is_int(event)) {274274 remoteLp = event->xSourceLp;275275 if (!viopathStatus[remoteLp].isActive)276276 sendMonMsg(remoteLp);···331331{332332 if (!event)333333 return;334334- if (event->xFlags.xFunction == HvLpEvent_Function_Int) {334334+ if (hvlpevent_is_int(event)) {335335 printk(VIOPATH_KERN_WARN336336 "unexpected config request from partition %d",337337 event->xSourceLp);338338339339- if ((event->xFlags.xFunction == HvLpEvent_Function_Int) &&340340- (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {339339+ if (hvlpevent_need_ack(event)) {341340 event->xRc = HvLpEvent_Rc_InvalidSubtype;342341 HvCallEvent_ackLpEvent(event);343342 }···376377 int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK)377378 >> VIOMAJOR_SUBTYPE_SHIFT;378379379379- if (event->xFlags.xFunction == HvLpEvent_Function_Int) {380380+ if (hvlpevent_is_int(event)) {380381 remoteLp = event->xSourceLp;381382 /*382383 * The isActive is checked because if the hosting partition···435436 "unexpected virtual io event subtype %d from partition %d\n",436437 event->xSubtype, remoteLp);437438 /* No handler. Ack if necessary */438438- if ((event->xFlags.xFunction == HvLpEvent_Function_Int) &&439439- (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {439439+ if (hvlpevent_is_int(event) && hvlpevent_need_ack(event)) {440440 event->xRc = HvLpEvent_Rc_InvalidSubtype;441441 HvCallEvent_ackLpEvent(event);442442 }
···208208{209209 while (dn) {210210 if (PCI_DN(dn)) {211211- PCI_DN(dn)->eeh_mode |= mode_flag;212212-213211 /* Mark the pci device driver too */214212 struct pci_dev *dev = PCI_DN(dn)->pcidev;213213+214214+ PCI_DN(dn)->eeh_mode |= mode_flag;215215+215216 if (dev && dev->driver)216217 dev->error_state = pci_channel_io_frozen;217218
+2-2
arch/powerpc/platforms/pseries/hvcserver.c
···4040 * functions aren't performance sensitive, so this conversion isn't an4141 * issue.4242 */4343-int hvcs_convert(long to_convert)4343+static int hvcs_convert(long to_convert)4444{4545 switch (to_convert) {4646 case H_Success:···9191EXPORT_SYMBOL(hvcs_free_partner_info);92929393/* Helper function for hvcs_get_partner_info */9494-int hvcs_next_partner(uint32_t unit_address,9494+static int hvcs_next_partner(uint32_t unit_address,9595 unsigned long last_p_partition_ID,9696 unsigned long last_p_unit_address, unsigned long *pi_buff)9797
-2
arch/powerpc/platforms/pseries/iommu.c
···51515252#define DBG(fmt...)53535454-extern int is_python(struct device_node *);5555-5654static void tce_build_pSeries(struct iommu_table *tbl, long index, 5755 long npages, unsigned long uaddr, 5856 enum dma_data_direction direction)
···9393 return cpu_status;9494}95959696-int pSeries_cpu_disable(void)9696+static int pSeries_cpu_disable(void)9797{9898 int cpu = smp_processor_id();9999···109109 return 0;110110}111111112112-void pSeries_cpu_die(unsigned int cpu)112112+static void pSeries_cpu_die(unsigned int cpu)113113{114114 int tries;115115 int cpu_status;
···11-/*22- * arch/ppc/kernel/process.c33- *44- * Derived from "arch/i386/kernel/process.c"55- * Copyright (C) 1995 Linus Torvalds66- *77- * Updated and modified by Cort Dougan (cort@cs.nmt.edu) and88- * Paul Mackerras (paulus@cs.anu.edu.au)99- *1010- * PowerPC version1111- * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)1212- *1313- * This program is free software; you can redistribute it and/or1414- * modify it under the terms of the GNU General Public License1515- * as published by the Free Software Foundation; either version1616- * 2 of the License, or (at your option) any later version.1717- *1818- */1919-2020-#include <linux/config.h>2121-#include <linux/errno.h>2222-#include <linux/sched.h>2323-#include <linux/kernel.h>2424-#include <linux/mm.h>2525-#include <linux/smp.h>2626-#include <linux/smp_lock.h>2727-#include <linux/stddef.h>2828-#include <linux/unistd.h>2929-#include <linux/ptrace.h>3030-#include <linux/slab.h>3131-#include <linux/user.h>3232-#include <linux/elf.h>3333-#include <linux/init.h>3434-#include <linux/prctl.h>3535-#include <linux/init_task.h>3636-#include <linux/module.h>3737-#include <linux/kallsyms.h>3838-#include <linux/mqueue.h>3939-#include <linux/hardirq.h>4040-4141-#include <asm/pgtable.h>4242-#include <asm/uaccess.h>4343-#include <asm/system.h>4444-#include <asm/io.h>4545-#include <asm/processor.h>4646-#include <asm/mmu.h>4747-#include <asm/prom.h>4848-4949-extern unsigned long _get_SP(void);5050-5151-struct task_struct *last_task_used_math = NULL;5252-struct task_struct *last_task_used_altivec = NULL;5353-struct task_struct *last_task_used_spe = NULL;5454-5555-static struct fs_struct init_fs = INIT_FS;5656-static struct files_struct init_files = INIT_FILES;5757-static struct signal_struct init_signals = INIT_SIGNALS(init_signals);5858-static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);5959-struct mm_struct init_mm = INIT_MM(init_mm);6060-EXPORT_SYMBOL(init_mm);6161-6262-/* this is 8kB-aligned so we can get to the thread_info struct6363- at the base of it from the stack pointer with 1 integer instruction. */6464-union thread_union init_thread_union6565- __attribute__((__section__(".data.init_task"))) =6666-{ INIT_THREAD_INFO(init_task) };6767-6868-/* initial task structure */6969-struct task_struct init_task = INIT_TASK(init_task);7070-EXPORT_SYMBOL(init_task);7171-7272-/* only used to get secondary processor up */7373-struct task_struct *current_set[NR_CPUS] = {&init_task, };7474-7575-#undef SHOW_TASK_SWITCHES7676-#undef CHECK_STACK7777-7878-#if defined(CHECK_STACK)7979-unsigned long8080-kernel_stack_top(struct task_struct *tsk)8181-{8282- return ((unsigned long)tsk) + sizeof(union task_union);8383-}8484-8585-unsigned long8686-task_top(struct task_struct *tsk)8787-{8888- return ((unsigned long)tsk) + sizeof(struct thread_info);8989-}9090-9191-/* check to make sure the kernel stack is healthy */9292-int check_stack(struct task_struct *tsk)9393-{9494- unsigned long stack_top = kernel_stack_top(tsk);9595- unsigned long tsk_top = task_top(tsk);9696- int ret = 0;9797-9898-#if 09999- /* check thread magic */100100- if ( tsk->thread.magic != THREAD_MAGIC )101101- {102102- ret |= 1;103103- printk("thread.magic bad: %08x\n", tsk->thread.magic);104104- }105105-#endif106106-107107- if ( !tsk )108108- printk("check_stack(): tsk bad tsk %p\n",tsk);109109-110110- /* check if stored ksp is bad */111111- if ( (tsk->thread.ksp > stack_top) || (tsk->thread.ksp < tsk_top) )112112- {113113- printk("stack out of bounds: %s/%d\n"114114- " tsk_top %08lx ksp %08lx stack_top %08lx\n",115115- tsk->comm,tsk->pid,116116- tsk_top, tsk->thread.ksp, stack_top);117117- ret |= 2;118118- }119119-120120- /* check if stack ptr RIGHT NOW is bad */121121- if ( (tsk == current) && ((_get_SP() > stack_top ) || (_get_SP() < tsk_top)) )122122- {123123- printk("current stack ptr out of bounds: %s/%d\n"124124- " tsk_top %08lx sp %08lx stack_top %08lx\n",125125- current->comm,current->pid,126126- tsk_top, _get_SP(), stack_top);127127- ret |= 4;128128- }129129-130130-#if 0131131- /* check amount of free stack */132132- for ( i = (unsigned long *)task_top(tsk) ; i < kernel_stack_top(tsk) ; i++ )133133- {134134- if ( !i )135135- printk("check_stack(): i = %p\n", i);136136- if ( *i != 0 )137137- {138138- /* only notify if it's less than 900 bytes */139139- if ( (i - (unsigned long *)task_top(tsk)) < 900 )140140- printk("%d bytes free on stack\n",141141- i - task_top(tsk));142142- break;143143- }144144- }145145-#endif146146-147147- if (ret)148148- {149149- panic("bad kernel stack");150150- }151151- return(ret);152152-}153153-#endif /* defined(CHECK_STACK) */154154-155155-/*156156- * Make sure the floating-point register state in the157157- * the thread_struct is up to date for task tsk.158158- */159159-void flush_fp_to_thread(struct task_struct *tsk)160160-{161161- if (tsk->thread.regs) {162162- /*163163- * We need to disable preemption here because if we didn't,164164- * another process could get scheduled after the regs->msr165165- * test but before we have finished saving the FP registers166166- * to the thread_struct. That process could take over the167167- * FPU, and then when we get scheduled again we would store168168- * bogus values for the remaining FP registers.169169- */170170- preempt_disable();171171- if (tsk->thread.regs->msr & MSR_FP) {172172-#ifdef CONFIG_SMP173173- /*174174- * This should only ever be called for current or175175- * for a stopped child process. Since we save away176176- * the FP register state on context switch on SMP,177177- * there is something wrong if a stopped child appears178178- * to still have its FP state in the CPU registers.179179- */180180- BUG_ON(tsk != current);181181-#endif182182- giveup_fpu(current);183183- }184184- preempt_enable();185185- }186186-}187187-188188-void enable_kernel_fp(void)189189-{190190- WARN_ON(preemptible());191191-192192-#ifdef CONFIG_SMP193193- if (current->thread.regs && (current->thread.regs->msr & MSR_FP))194194- giveup_fpu(current);195195- else196196- giveup_fpu(NULL); /* just enables FP for kernel */197197-#else198198- giveup_fpu(last_task_used_math);199199-#endif /* CONFIG_SMP */200200-}201201-EXPORT_SYMBOL(enable_kernel_fp);202202-203203-int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)204204-{205205- preempt_disable();206206- if (tsk->thread.regs && (tsk->thread.regs->msr & MSR_FP))207207- giveup_fpu(tsk);208208- preempt_enable();209209- memcpy(fpregs, &tsk->thread.fpr[0], sizeof(*fpregs));210210- return 1;211211-}212212-213213-#ifdef CONFIG_ALTIVEC214214-void enable_kernel_altivec(void)215215-{216216- WARN_ON(preemptible());217217-218218-#ifdef CONFIG_SMP219219- if (current->thread.regs && (current->thread.regs->msr & MSR_VEC))220220- giveup_altivec(current);221221- else222222- giveup_altivec(NULL); /* just enable AltiVec for kernel - force */223223-#else224224- giveup_altivec(last_task_used_altivec);225225-#endif /* __SMP __ */226226-}227227-EXPORT_SYMBOL(enable_kernel_altivec);228228-229229-/*230230- * Make sure the VMX/Altivec register state in the231231- * the thread_struct is up to date for task tsk.232232- */233233-void flush_altivec_to_thread(struct task_struct *tsk)234234-{235235- if (tsk->thread.regs) {236236- preempt_disable();237237- if (tsk->thread.regs->msr & MSR_VEC) {238238-#ifdef CONFIG_SMP239239- BUG_ON(tsk != current);240240-#endif241241- giveup_altivec(current);242242- }243243- preempt_enable();244244- }245245-}246246-247247-int dump_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs)248248-{249249- if (regs->msr & MSR_VEC)250250- giveup_altivec(current);251251- memcpy(vrregs, ¤t->thread.vr[0], sizeof(*vrregs));252252- return 1;253253-}254254-#endif /* CONFIG_ALTIVEC */255255-256256-#ifdef CONFIG_SPE257257-void258258-enable_kernel_spe(void)259259-{260260- WARN_ON(preemptible());261261-262262-#ifdef CONFIG_SMP263263- if (current->thread.regs && (current->thread.regs->msr & MSR_SPE))264264- giveup_spe(current);265265- else266266- giveup_spe(NULL); /* just enable SPE for kernel - force */267267-#else268268- giveup_spe(last_task_used_spe);269269-#endif /* __SMP __ */270270-}271271-EXPORT_SYMBOL(enable_kernel_spe);272272-273273-void flush_spe_to_thread(struct task_struct *tsk)274274-{275275- if (tsk->thread.regs) {276276- preempt_disable();277277- if (tsk->thread.regs->msr & MSR_SPE) {278278-#ifdef CONFIG_SMP279279- BUG_ON(tsk != current);280280-#endif281281- giveup_spe(current);282282- }283283- preempt_enable();284284- }285285-}286286-287287-int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)288288-{289289- if (regs->msr & MSR_SPE)290290- giveup_spe(current);291291- /* We copy u32 evr[32] + u64 acc + u32 spefscr -> 35 */292292- memcpy(evrregs, ¤t->thread.evr[0], sizeof(u32) * 35);293293- return 1;294294-}295295-#endif /* CONFIG_SPE */296296-297297-struct task_struct *__switch_to(struct task_struct *prev,298298- struct task_struct *new)299299-{300300- struct thread_struct *new_thread, *old_thread;301301- unsigned long s;302302- struct task_struct *last;303303-304304- local_irq_save(s);305305-#ifdef CHECK_STACK306306- check_stack(prev);307307- check_stack(new);308308-#endif309309-310310-#ifdef CONFIG_SMP311311- /* avoid complexity of lazy save/restore of fpu312312- * by just saving it every time we switch out if313313- * this task used the fpu during the last quantum.314314- *315315- * If it tries to use the fpu again, it'll trap and316316- * reload its fp regs. So we don't have to do a restore317317- * every switch, just a save.318318- * -- Cort319319- */320320- if (prev->thread.regs && (prev->thread.regs->msr & MSR_FP))321321- giveup_fpu(prev);322322-#ifdef CONFIG_ALTIVEC323323- /*324324- * If the previous thread used altivec in the last quantum325325- * (thus changing altivec regs) then save them.326326- * We used to check the VRSAVE register but not all apps327327- * set it, so we don't rely on it now (and in fact we need328328- * to save & restore VSCR even if VRSAVE == 0). -- paulus329329- *330330- * On SMP we always save/restore altivec regs just to avoid the331331- * complexity of changing processors.332332- * -- Cort333333- */334334- if ((prev->thread.regs && (prev->thread.regs->msr & MSR_VEC)))335335- giveup_altivec(prev);336336-#endif /* CONFIG_ALTIVEC */337337-#ifdef CONFIG_SPE338338- /*339339- * If the previous thread used spe in the last quantum340340- * (thus changing spe regs) then save them.341341- *342342- * On SMP we always save/restore spe regs just to avoid the343343- * complexity of changing processors.344344- */345345- if ((prev->thread.regs && (prev->thread.regs->msr & MSR_SPE)))346346- giveup_spe(prev);347347-#endif /* CONFIG_SPE */348348-#endif /* CONFIG_SMP */349349-350350-#ifdef CONFIG_ALTIVEC351351- /* Avoid the trap. On smp this this never happens since352352- * we don't set last_task_used_altivec -- Cort353353- */354354- if (new->thread.regs && last_task_used_altivec == new)355355- new->thread.regs->msr |= MSR_VEC;356356-#endif357357-#ifdef CONFIG_SPE358358- /* Avoid the trap. On smp this this never happens since359359- * we don't set last_task_used_spe360360- */361361- if (new->thread.regs && last_task_used_spe == new)362362- new->thread.regs->msr |= MSR_SPE;363363-#endif /* CONFIG_SPE */364364- new_thread = &new->thread;365365- old_thread = ¤t->thread;366366- last = _switch(old_thread, new_thread);367367- local_irq_restore(s);368368- return last;369369-}370370-371371-void show_regs(struct pt_regs * regs)372372-{373373- int i, trap;374374-375375- printk("NIP: %08lX LR: %08lX SP: %08lX REGS: %p TRAP: %04lx %s\n",376376- regs->nip, regs->link, regs->gpr[1], regs, regs->trap,377377- print_tainted());378378- printk("MSR: %08lx EE: %01x PR: %01x FP: %01x ME: %01x IR/DR: %01x%01x\n",379379- regs->msr, regs->msr&MSR_EE ? 1 : 0, regs->msr&MSR_PR ? 1 : 0,380380- regs->msr & MSR_FP ? 1 : 0,regs->msr&MSR_ME ? 1 : 0,381381- regs->msr&MSR_IR ? 1 : 0,382382- regs->msr&MSR_DR ? 1 : 0);383383- trap = TRAP(regs);384384- if (trap == 0x300 || trap == 0x600)385385- printk("DAR: %08lX, DSISR: %08lX\n", regs->dar, regs->dsisr);386386- printk("TASK = %p[%d] '%s' THREAD: %p\n",387387- current, current->pid, current->comm, task_thread_info(current));388388- printk("Last syscall: %ld ", current->thread.last_syscall);389389-390390-#ifdef CONFIG_SMP391391- printk(" CPU: %d", smp_processor_id());392392-#endif /* CONFIG_SMP */393393-394394- for (i = 0; i < 32; i++) {395395- long r;396396- if ((i % 8) == 0)397397- printk("\n" KERN_INFO "GPR%02d: ", i);398398- if (__get_user(r, ®s->gpr[i]))399399- break;400400- printk("%08lX ", r);401401- if (i == 12 && !FULL_REGS(regs))402402- break;403403- }404404- printk("\n");405405-#ifdef CONFIG_KALLSYMS406406- /*407407- * Lookup NIP late so we have the best change of getting the408408- * above info out without failing409409- */410410- printk("NIP [%08lx] ", regs->nip);411411- print_symbol("%s\n", regs->nip);412412- printk("LR [%08lx] ", regs->link);413413- print_symbol("%s\n", regs->link);414414-#endif415415- show_stack(current, (unsigned long *) regs->gpr[1]);416416-}417417-418418-void exit_thread(void)419419-{420420- preempt_disable();421421- if (last_task_used_math == current)422422- last_task_used_math = NULL;423423- if (last_task_used_altivec == current)424424- last_task_used_altivec = NULL;425425-#ifdef CONFIG_SPE426426- if (last_task_used_spe == current)427427- last_task_used_spe = NULL;428428-#endif429429- preempt_enable();430430-}431431-432432-void flush_thread(void)433433-{434434- preempt_disable();435435- if (last_task_used_math == current)436436- last_task_used_math = NULL;437437- if (last_task_used_altivec == current)438438- last_task_used_altivec = NULL;439439-#ifdef CONFIG_SPE440440- if (last_task_used_spe == current)441441- last_task_used_spe = NULL;442442-#endif443443- preempt_enable();444444-}445445-446446-void447447-release_thread(struct task_struct *t)448448-{449449-}450450-451451-/*452452- * This gets called before we allocate a new thread and copy453453- * the current task into it.454454- */455455-void prepare_to_copy(struct task_struct *tsk)456456-{457457- struct pt_regs *regs = tsk->thread.regs;458458-459459- if (regs == NULL)460460- return;461461- preempt_disable();462462- if (regs->msr & MSR_FP)463463- giveup_fpu(current);464464-#ifdef CONFIG_ALTIVEC465465- if (regs->msr & MSR_VEC)466466- giveup_altivec(current);467467-#endif /* CONFIG_ALTIVEC */468468-#ifdef CONFIG_SPE469469- if (regs->msr & MSR_SPE)470470- giveup_spe(current);471471-#endif /* CONFIG_SPE */472472- preempt_enable();473473-}474474-475475-/*476476- * Copy a thread..477477- */478478-int479479-copy_thread(int nr, unsigned long clone_flags, unsigned long usp,480480- unsigned long unused,481481- struct task_struct *p, struct pt_regs *regs)482482-{483483- struct pt_regs *childregs, *kregs;484484- extern void ret_from_fork(void);485485- unsigned long sp = (unsigned long)task_stack_page(p) + THREAD_SIZE;486486- unsigned long childframe;487487-488488- CHECK_FULL_REGS(regs);489489- /* Copy registers */490490- sp -= sizeof(struct pt_regs);491491- childregs = (struct pt_regs *) sp;492492- *childregs = *regs;493493- if ((childregs->msr & MSR_PR) == 0) {494494- /* for kernel thread, set `current' and stackptr in new task */495495- childregs->gpr[1] = sp + sizeof(struct pt_regs);496496- childregs->gpr[2] = (unsigned long) p;497497- p->thread.regs = NULL; /* no user register state */498498- } else {499499- childregs->gpr[1] = usp;500500- p->thread.regs = childregs;501501- if (clone_flags & CLONE_SETTLS)502502- childregs->gpr[2] = childregs->gpr[6];503503- }504504- childregs->gpr[3] = 0; /* Result from fork() */505505- sp -= STACK_FRAME_OVERHEAD;506506- childframe = sp;507507-508508- /*509509- * The way this works is that at some point in the future510510- * some task will call _switch to switch to the new task.511511- * That will pop off the stack frame created below and start512512- * the new task running at ret_from_fork. The new task will513513- * do some house keeping and then return from the fork or clone514514- * system call, using the stack frame created above.515515- */516516- sp -= sizeof(struct pt_regs);517517- kregs = (struct pt_regs *) sp;518518- sp -= STACK_FRAME_OVERHEAD;519519- p->thread.ksp = sp;520520- kregs->nip = (unsigned long)ret_from_fork;521521-522522- p->thread.last_syscall = -1;523523-524524- return 0;525525-}526526-527527-/*528528- * Set up a thread for executing a new program529529- */530530-void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)531531-{532532- set_fs(USER_DS);533533- memset(regs->gpr, 0, sizeof(regs->gpr));534534- regs->ctr = 0;535535- regs->link = 0;536536- regs->xer = 0;537537- regs->ccr = 0;538538- regs->mq = 0;539539- regs->nip = nip;540540- regs->gpr[1] = sp;541541- regs->msr = MSR_USER;542542- preempt_disable();543543- if (last_task_used_math == current)544544- last_task_used_math = NULL;545545- if (last_task_used_altivec == current)546546- last_task_used_altivec = NULL;547547-#ifdef CONFIG_SPE548548- if (last_task_used_spe == current)549549- last_task_used_spe = NULL;550550-#endif551551- preempt_enable();552552- memset(current->thread.fpr, 0, sizeof(current->thread.fpr));553553- current->thread.fpscr.val = 0;554554-#ifdef CONFIG_ALTIVEC555555- memset(current->thread.vr, 0, sizeof(current->thread.vr));556556- memset(¤t->thread.vscr, 0, sizeof(current->thread.vscr));557557- current->thread.vrsave = 0;558558- current->thread.used_vr = 0;559559-#endif /* CONFIG_ALTIVEC */560560-#ifdef CONFIG_SPE561561- memset(current->thread.evr, 0, sizeof(current->thread.evr));562562- current->thread.acc = 0;563563- current->thread.spefscr = 0;564564- current->thread.used_spe = 0;565565-#endif /* CONFIG_SPE */566566-}567567-568568-#define PR_FP_ALL_EXCEPT (PR_FP_EXC_DIV | PR_FP_EXC_OVF | PR_FP_EXC_UND \569569- | PR_FP_EXC_RES | PR_FP_EXC_INV)570570-571571-int set_fpexc_mode(struct task_struct *tsk, unsigned int val)572572-{573573- struct pt_regs *regs = tsk->thread.regs;574574-575575- /* This is a bit hairy. If we are an SPE enabled processor576576- * (have embedded fp) we store the IEEE exception enable flags in577577- * fpexc_mode. fpexc_mode is also used for setting FP exception578578- * mode (asyn, precise, disabled) for 'Classic' FP. */579579- if (val & PR_FP_EXC_SW_ENABLE) {580580-#ifdef CONFIG_SPE581581- tsk->thread.fpexc_mode = val &582582- (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT);583583-#else584584- return -EINVAL;585585-#endif586586- } else {587587- /* on a CONFIG_SPE this does not hurt us. The bits that588588- * __pack_fe01 use do not overlap with bits used for589589- * PR_FP_EXC_SW_ENABLE. Additionally, the MSR[FE0,FE1] bits590590- * on CONFIG_SPE implementations are reserved so writing to591591- * them does not change anything */592592- if (val > PR_FP_EXC_PRECISE)593593- return -EINVAL;594594- tsk->thread.fpexc_mode = __pack_fe01(val);595595- if (regs != NULL && (regs->msr & MSR_FP) != 0)596596- regs->msr = (regs->msr & ~(MSR_FE0|MSR_FE1))597597- | tsk->thread.fpexc_mode;598598- }599599- return 0;600600-}601601-602602-int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)603603-{604604- unsigned int val;605605-606606- if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE)607607-#ifdef CONFIG_SPE608608- val = tsk->thread.fpexc_mode;609609-#else610610- return -EINVAL;611611-#endif612612- else613613- val = __unpack_fe01(tsk->thread.fpexc_mode);614614- return put_user(val, (unsigned int __user *) adr);615615-}616616-617617-int sys_clone(unsigned long clone_flags, unsigned long usp,618618- int __user *parent_tidp, void __user *child_threadptr,619619- int __user *child_tidp, int p6,620620- struct pt_regs *regs)621621-{622622- CHECK_FULL_REGS(regs);623623- if (usp == 0)624624- usp = regs->gpr[1]; /* stack pointer for child */625625- return do_fork(clone_flags, usp, regs, 0, parent_tidp, child_tidp);626626-}627627-628628-int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,629629- unsigned long p4, unsigned long p5, unsigned long p6,630630- struct pt_regs *regs)631631-{632632- CHECK_FULL_REGS(regs);633633- return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL);634634-}635635-636636-int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3,637637- unsigned long p4, unsigned long p5, unsigned long p6,638638- struct pt_regs *regs)639639-{640640- CHECK_FULL_REGS(regs);641641- return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gpr[1],642642- regs, 0, NULL, NULL);643643-}644644-645645-int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,646646- unsigned long a3, unsigned long a4, unsigned long a5,647647- struct pt_regs *regs)648648-{649649- int error;650650- char * filename;651651-652652- filename = getname((char __user *) a0);653653- error = PTR_ERR(filename);654654- if (IS_ERR(filename))655655- goto out;656656- preempt_disable();657657- if (regs->msr & MSR_FP)658658- giveup_fpu(current);659659-#ifdef CONFIG_ALTIVEC660660- if (regs->msr & MSR_VEC)661661- giveup_altivec(current);662662-#endif /* CONFIG_ALTIVEC */663663-#ifdef CONFIG_SPE664664- if (regs->msr & MSR_SPE)665665- giveup_spe(current);666666-#endif /* CONFIG_SPE */667667- preempt_enable();668668- error = do_execve(filename, (char __user *__user *) a1,669669- (char __user *__user *) a2, regs);670670- if (error == 0) {671671- task_lock(current);672672- current->ptrace &= ~PT_DTRACE;673673- task_unlock(current);674674- }675675- putname(filename);676676-out:677677- return error;678678-}679679-680680-void dump_stack(void)681681-{682682- show_stack(current, NULL);683683-}684684-685685-EXPORT_SYMBOL(dump_stack);686686-687687-void show_stack(struct task_struct *tsk, unsigned long *stack)688688-{689689- unsigned long sp, stack_top, prev_sp, ret;690690- int count = 0;691691- unsigned long next_exc = 0;692692- struct pt_regs *regs;693693- extern char ret_from_except, ret_from_except_full, ret_from_syscall;694694-695695- sp = (unsigned long) stack;696696- if (tsk == NULL)697697- tsk = current;698698- if (sp == 0) {699699- if (tsk == current)700700- asm("mr %0,1" : "=r" (sp));701701- else702702- sp = tsk->thread.ksp;703703- }704704-705705- prev_sp = (unsigned long) end_of_stack(tsk);706706- stack_top = (unsigned long) task_stack_page(tsk) + THREAD_SIZE;707707- while (count < 16 && sp > prev_sp && sp < stack_top && (sp & 3) == 0) {708708- if (count == 0) {709709- printk("Call trace:");710710-#ifdef CONFIG_KALLSYMS711711- printk("\n");712712-#endif713713- } else {714714- if (next_exc) {715715- ret = next_exc;716716- next_exc = 0;717717- } else718718- ret = *(unsigned long *)(sp + 4);719719- printk(" [%08lx] ", ret);720720-#ifdef CONFIG_KALLSYMS721721- print_symbol("%s", ret);722722- printk("\n");723723-#endif724724- if (ret == (unsigned long) &ret_from_except725725- || ret == (unsigned long) &ret_from_except_full726726- || ret == (unsigned long) &ret_from_syscall) {727727- /* sp + 16 points to an exception frame */728728- regs = (struct pt_regs *) (sp + 16);729729- if (sp + 16 + sizeof(*regs) <= stack_top)730730- next_exc = regs->nip;731731- }732732- }733733- ++count;734734- sp = *(unsigned long *)sp;735735- }736736-#ifndef CONFIG_KALLSYMS737737- if (count > 0)738738- printk("\n");739739-#endif740740-}741741-742742-#if 0743743-/*744744- * Low level print for debugging - Cort745745- */746746-int __init ll_printk(const char *fmt, ...)747747-{748748- va_list args;749749- char buf[256];750750- int i;751751-752752- va_start(args, fmt);753753- i=vsprintf(buf,fmt,args);754754- ll_puts(buf);755755- va_end(args);756756- return i;757757-}758758-759759-int lines = 24, cols = 80;760760-int orig_x = 0, orig_y = 0;761761-762762-void puthex(unsigned long val)763763-{764764- unsigned char buf[10];765765- int i;766766- for (i = 7; i >= 0; i--)767767- {768768- buf[i] = "0123456789ABCDEF"[val & 0x0F];769769- val >>= 4;770770- }771771- buf[8] = '\0';772772- prom_print(buf);773773-}774774-775775-void __init ll_puts(const char *s)776776-{777777- int x,y;778778- char *vidmem = (char *)/*(_ISA_MEM_BASE + 0xB8000) */0xD00B8000;779779- char c;780780- extern int mem_init_done;781781-782782- if ( mem_init_done ) /* assume this means we can printk */783783- {784784- printk(s);785785- return;786786- }787787-788788-#if 0789789- if ( have_of )790790- {791791- prom_print(s);792792- return;793793- }794794-#endif795795-796796- /*797797- * can't ll_puts on chrp without openfirmware yet.798798- * vidmem just needs to be setup for it.799799- * -- Cort800800- */801801- if ( _machine != _MACH_prep )802802- return;803803- x = orig_x;804804- y = orig_y;805805-806806- while ( ( c = *s++ ) != '\0' ) {807807- if ( c == '\n' ) {808808- x = 0;809809- if ( ++y >= lines ) {810810- /*scroll();*/811811- /*y--;*/812812- y = 0;813813- }814814- } else {815815- vidmem [ ( x + cols * y ) * 2 ] = c;816816- if ( ++x >= cols ) {817817- x = 0;818818- if ( ++y >= lines ) {819819- /*scroll();*/820820- /*y--;*/821821- y = 0;822822- }823823- }824824- }825825- }826826-827827- orig_x = x;828828- orig_y = y;829829-}830830-#endif831831-832832-unsigned long get_wchan(struct task_struct *p)833833-{834834- unsigned long ip, sp;835835- unsigned long stack_page = (unsigned long) task_stack_page(p);836836- int count = 0;837837- if (!p || p == current || p->state == TASK_RUNNING)838838- return 0;839839- sp = p->thread.ksp;840840- do {841841- sp = *(unsigned long *)sp;842842- if (sp < stack_page || sp >= stack_page + 8188)843843- return 0;844844- if (count > 0) {845845- ip = *(unsigned long *)(sp + 4);846846- if (!in_sched_functions(ip))847847- return ip;848848- }849849- } while (count++ < 16);850850- return 0;851851-}
+15-17
drivers/block/viodasd.c
···293293 u16 viocmd;294294 HvLpEvent_Rc hvrc;295295 struct vioblocklpevent *bevent;296296+ struct HvLpEvent *hev;296297 struct scatterlist sg[VIOMAXBLOCKDMA];297298 int sgindex;298299 int statindex;···348347 * token so we can match the response up later349348 */350349 memset(bevent, 0, sizeof(struct vioblocklpevent));351351- bevent->event.xFlags.xValid = 1;352352- bevent->event.xFlags.xFunction = HvLpEvent_Function_Int;353353- bevent->event.xFlags.xAckInd = HvLpEvent_AckInd_DoAck;354354- bevent->event.xFlags.xAckType = HvLpEvent_AckType_ImmediateAck;355355- bevent->event.xType = HvLpEvent_Type_VirtualIo;356356- bevent->event.xSubtype = viocmd;357357- bevent->event.xSourceLp = HvLpConfig_getLpIndex();358358- bevent->event.xTargetLp = viopath_hostLp;359359- bevent->event.xSizeMinus1 =350350+ hev = &bevent->event;351351+ hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK |352352+ HV_LP_EVENT_INT;353353+ hev->xType = HvLpEvent_Type_VirtualIo;354354+ hev->xSubtype = viocmd;355355+ hev->xSourceLp = HvLpConfig_getLpIndex();356356+ hev->xTargetLp = viopath_hostLp;357357+ hev->xSizeMinus1 =360358 offsetof(struct vioblocklpevent, u.rw_data.dma_info) +361359 (sizeof(bevent->u.rw_data.dma_info[0]) * nsg) - 1;362362- bevent->event.xSourceInstanceId =363363- viopath_sourceinst(viopath_hostLp);364364- bevent->event.xTargetInstanceId =365365- viopath_targetinst(viopath_hostLp);366366- bevent->event.xCorrelationToken = (u64)req;360360+ hev->xSourceInstanceId = viopath_sourceinst(viopath_hostLp);361361+ hev->xTargetInstanceId = viopath_targetinst(viopath_hostLp);362362+ hev->xCorrelationToken = (u64)req;367363 bevent->version = VIOVERSION;368364 bevent->disk = DEVICE_NO(d);369365 bevent->u.rw_data.offset = start;···647649 /* Notification that a partition went away! */648650 return;649651 /* First, we should NEVER get an int here...only acks */650650- if (event->xFlags.xFunction == HvLpEvent_Function_Int) {652652+ if (hvlpevent_is_int(event)) {651653 printk(VIOD_KERN_WARNING652654 "Yikes! got an int in viodasd event handler!\n");653653- if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) {655655+ if (hvlpevent_need_ack(event)) {654656 event->xRc = HvLpEvent_Rc_InvalidSubtype;655657 HvCallEvent_ackLpEvent(event);656658 }···693695694696 default:695697 printk(VIOD_KERN_WARNING "invalid subtype!");696696- if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) {698698+ if (hvlpevent_need_ack(event)) {697699 event->xRc = HvLpEvent_Rc_InvalidSubtype;698700 HvCallEvent_ackLpEvent(event);699701 }
+3-3
drivers/cdrom/viocd.c
···542542 /* Notification that a partition went away! */543543 return;544544 /* First, we should NEVER get an int here...only acks */545545- if (event->xFlags.xFunction == HvLpEvent_Function_Int) {545545+ if (hvlpevent_is_int(event)) {546546 printk(VIOCD_KERN_WARNING547547 "Yikes! got an int in viocd event handler!\n");548548- if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) {548548+ if (hvlpevent_need_ack(event)) {549549 event->xRc = HvLpEvent_Rc_InvalidSubtype;550550 HvCallEvent_ackLpEvent(event);551551 }···616616 printk(VIOCD_KERN_WARNING617617 "message with invalid subtype %0x04X!\n",618618 event->xSubtype & VIOMINOR_SUBTYPE_MASK);619619- if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) {619619+ if (hvlpevent_need_ack(event)) {620620 event->xRc = HvLpEvent_Rc_InvalidSubtype;621621 HvCallEvent_ackLpEvent(event);622622 }
···590590{591591 struct veth_lpevent *veth_event = (struct veth_lpevent *)event;592592593593- if (event->xFlags.xFunction == HvLpEvent_Function_Ack)593593+ if (hvlpevent_is_ack(event))594594 veth_handle_ack(veth_event);595595- else if (event->xFlags.xFunction == HvLpEvent_Function_Int)595595+ else596596 veth_handle_int(veth_event);597597}598598
-19
include/asm-powerpc/iommu.h
···64646565#endif /* CONFIG_PPC_MULTIPLATFORM */66666767-#ifdef CONFIG_PPC_PSERIES6868-6969-/* Creates table for an individual device node */7070-extern void iommu_devnode_init_pSeries(struct device_node *dn);7171-7272-#endif /* CONFIG_PPC_PSERIES */7373-7474-#ifdef CONFIG_PPC_ISERIES7575-7676-/* Creates table for an individual device node */7777-extern void iommu_devnode_init_iSeries(struct device_node *dn);7878-/* Get table parameters from HV */7979-extern void iommu_table_getparms_iSeries(unsigned long busno,8080- unsigned char slotno,8181- unsigned char virtbus,8282- struct iommu_table* tbl);8383-8484-#endif /* CONFIG_PPC_ISERIES */8585-8667/* Initializes an iommu_table based in values set in the passed-in8768 * structure8869 */
+1-3
include/asm-powerpc/iseries/hv_call.h
···11/*22- * HvCall.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify···1415 * You should have received a copy of the GNU General Public License1516 * along with this program; if not, write to the Free Software1617 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717- */1818-/*1818+ *1919 * This file contains the "hypervisor call" interface which is used to2020 * drive the hypervisor from the OS.2121 */
+36-98
include/asm-powerpc/iseries/hv_call_event.h
···11/*22- * HvCallEvent.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify···1415 * You should have received a copy of the GNU General Public License1516 * along with this program; if not, write to the Free Software1617 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1717- */1818-/*1818+ *1919 * This file contains the "hypervisor call" interface which is used to2020 * drive the hypervisor from the OS.2121 */···3133typedef u8 HvLpEvent_AckInd;3234typedef u8 HvLpEvent_AckType;33353434-struct HvCallEvent_PackedParms {3535- u8 xAckType:1;3636- u8 xAckInd:1;3737- u8 xRsvd:1;3838- u8 xTargetLp:5;3939- u8 xType;4040- u16 xSubtype;4141- HvLpInstanceId xSourceInstId;4242- HvLpInstanceId xTargetInstId;4343-};4444-4536typedef u8 HvLpDma_Direction;4637typedef u8 HvLpDma_AddressType;4747-4848-struct HvCallEvent_PackedDmaParms {4949- u8 xDirection:1;5050- u8 xLocalAddrType:1;5151- u8 xRemoteAddrType:1;5252- u8 xRsvd1:5;5353- HvLpIndex xRemoteLp;5454- u8 xType;5555- u8 xRsvd2;5656- HvLpInstanceId xLocalInstId;5757- HvLpInstanceId xRemoteInstId;5858-};59386039typedef u64 HvLpEvent_Rc;6140typedef u64 HvLpDma_Rc;···6792static inline void HvCallEvent_setLpEventStack(u8 queueIndex,6893 char *eventStackAddr, u32 eventStackSize)6994{7070- u64 abs_addr;7171-7272- abs_addr = virt_to_abs(eventStackAddr);7373- HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr,7474- eventStackSize);9595+ HvCall3(HvCallEventSetLpEventStack, queueIndex,9696+ virt_to_abs(eventStackAddr), eventStackSize);7597}76987799static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex,···8010881109static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event)82110{8383- u64 abs_addr;8484-8585-#ifdef DEBUG_SENDEVENT8686- printk("HvCallEvent_signalLpEvent: *event = %016lx\n ",8787- (unsigned long)event);8888-#endif8989- abs_addr = virt_to_abs(event);9090- return HvCall1(HvCallEventSignalLpEvent, abs_addr);111111+ return HvCall1(HvCallEventSignalLpEvent, virt_to_abs(event));91112}9211393114static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,···92127{93128 /* Pack the misc bits into a single Dword to pass to PLIC */94129 union {9595- struct HvCallEvent_PackedParms parms;130130+ struct {131131+ u8 ack_and_target;132132+ u8 type;133133+ u16 subtype;134134+ HvLpInstanceId src_inst;135135+ HvLpInstanceId target_inst;136136+ } parms;96137 u64 dword;97138 } packed;9898- packed.parms.xAckType = ackType;9999- packed.parms.xAckInd = ackInd;100100- packed.parms.xRsvd = 0;101101- packed.parms.xTargetLp = targetLp;102102- packed.parms.xType = type;103103- packed.parms.xSubtype = subtype;104104- packed.parms.xSourceInstId = sourceInstanceId;105105- packed.parms.xTargetInstId = targetInstanceId;139139+140140+ packed.parms.ack_and_target = (ackType << 7) | (ackInd << 6) | targetLp;141141+ packed.parms.type = type;142142+ packed.parms.subtype = subtype;143143+ packed.parms.src_inst = sourceInstanceId;144144+ packed.parms.target_inst = targetInstanceId;106145107146 return HvCall7(HvCallEventSignalLpEventParms, packed.dword,108147 correlationToken, eventData1, eventData2,···115146116147static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event)117148{118118- u64 abs_addr;119119-120120- abs_addr = virt_to_abs(event);121121- return HvCall1(HvCallEventAckLpEvent, abs_addr);149149+ return HvCall1(HvCallEventAckLpEvent, virt_to_abs(event));122150}123151124152static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event)125153{126126- u64 abs_addr;127127-128128- abs_addr = virt_to_abs(event);129129- return HvCall1(HvCallEventCancelLpEvent, abs_addr);154154+ return HvCall1(HvCallEventCancelLpEvent, virt_to_abs(event));130155}131156132157static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId(···158195{159196 /* Pack the misc bits into a single Dword to pass to PLIC */160197 union {161161- struct HvCallEvent_PackedDmaParms parms;198198+ struct {199199+ u8 flags;200200+ HvLpIndex remote;201201+ u8 type;202202+ u8 reserved;203203+ HvLpInstanceId local_inst;204204+ HvLpInstanceId remote_inst;205205+ } parms;162206 u64 dword;163207 } packed;164208165165- packed.parms.xDirection = direction;166166- packed.parms.xLocalAddrType = localAddressType;167167- packed.parms.xRemoteAddrType = remoteAddressType;168168- packed.parms.xRsvd1 = 0;169169- packed.parms.xRemoteLp = remoteLp;170170- packed.parms.xType = type;171171- packed.parms.xRsvd2 = 0;172172- packed.parms.xLocalInstId = localInstanceId;173173- packed.parms.xRemoteInstId = remoteInstanceId;209209+ packed.parms.flags = (direction << 7) |210210+ (localAddressType << 6) | (remoteAddressType << 5);211211+ packed.parms.remote = remoteLp;212212+ packed.parms.type = type;213213+ packed.parms.reserved = 0;214214+ packed.parms.local_inst = localInstanceId;215215+ packed.parms.remote_inst = remoteInstanceId;174216175217 return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList,176218 remoteBufList, transferLength);177219}178220179179-static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type,180180- HvLpIndex remoteLp, HvLpDma_Direction direction,181181- HvLpInstanceId localInstanceId,182182- HvLpInstanceId remoteInstanceId,183183- HvLpDma_AddressType localAddressType,184184- HvLpDma_AddressType remoteAddressType,185185- u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength)186186-{187187- /* Pack the misc bits into a single Dword to pass to PLIC */188188- union {189189- struct HvCallEvent_PackedDmaParms parms;190190- u64 dword;191191- } packed;192192-193193- packed.parms.xDirection = direction;194194- packed.parms.xLocalAddrType = localAddressType;195195- packed.parms.xRemoteAddrType = remoteAddressType;196196- packed.parms.xRsvd1 = 0;197197- packed.parms.xRemoteLp = remoteLp;198198- packed.parms.xType = type;199199- packed.parms.xRsvd2 = 0;200200- packed.parms.xLocalInstId = localInstanceId;201201- packed.parms.xRemoteInstId = remoteInstanceId;202202-203203- return (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, packed.dword,204204- localAddrOrTce, remoteAddrOrTce, transferLength);205205-}206206-207221static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote,208222 u32 length, HvLpDma_Direction dir)209223{210210- u64 abs_addr;211211-212212- abs_addr = virt_to_abs(local);213213- return HvCall4(HvCallEventDmaToSp, abs_addr, remote, length, dir);224224+ return HvCall4(HvCallEventDmaToSp, virt_to_abs(local), remote,225225+ length, dir);214226}215227216228#endif /* _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H */
-1
include/asm-powerpc/iseries/hv_call_sc.h
···11/*22- * HvCallSc.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify
-1
include/asm-powerpc/iseries/hv_lp_config.h
···11/*22- * HvLpConfig.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify
+31-11
include/asm-powerpc/iseries/hv_lp_event.h
···11/*22- * HvLpEvent.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify···3132 * partitions through PLIC.3233 */33343434-struct HvEventFlags {3535- u8 xValid:1; /* Indicates a valid request x00-x00 */3636- u8 xRsvd1:4; /* Reserved ... */3737- u8 xAckType:1; /* Immediate or deferred ... */3838- u8 xAckInd:1; /* Indicates if ACK required ... */3939- u8 xFunction:1; /* Interrupt or Acknowledge ... */4040-};4141-4242-4335struct HvLpEvent {4444- struct HvEventFlags xFlags; /* Event flags x00-x00 */3636+ u8 flags; /* Event flags x00-x00 */4537 u8 xType; /* Type of message x01-x01 */4638 u16 xSubtype; /* Subtype for event x02-x03 */4739 u8 xSourceLp; /* Source LP x04-x04 */···116126#define HvLpEvent_AckType_ImmediateAck 0117127#define HvLpEvent_AckType_DeferredAck 1118128129129+#define HV_LP_EVENT_INT 0x01130130+#define HV_LP_EVENT_DO_ACK 0x02131131+#define HV_LP_EVENT_DEFERRED_ACK 0x04132132+#define HV_LP_EVENT_VALID 0x80133133+119134#define HvLpDma_Direction_LocalToRemote 0120135#define HvLpDma_Direction_RemoteToLocal 1121136···133138#define HvLpDma_Rc_PathClosed 3134139#define HvLpDma_Rc_InvalidAddress 4135140#define HvLpDma_Rc_InvalidLength 5141141+142142+static inline int hvlpevent_is_valid(struct HvLpEvent *h)143143+{144144+ return h->flags & HV_LP_EVENT_VALID;145145+}146146+147147+static inline void hvlpevent_invalidate(struct HvLpEvent *h)148148+{149149+ h->flags &= ~ HV_LP_EVENT_VALID;150150+}151151+152152+static inline int hvlpevent_is_int(struct HvLpEvent *h)153153+{154154+ return h->flags & HV_LP_EVENT_INT;155155+}156156+157157+static inline int hvlpevent_is_ack(struct HvLpEvent *h)158158+{159159+ return !hvlpevent_is_int(h);160160+}161161+162162+static inline int hvlpevent_need_ack(struct HvLpEvent *h)163163+{164164+ return h->flags & HV_LP_EVENT_DO_ACK;165165+}136166137167#endif /* _ASM_POWERPC_ISERIES_HV_LP_EVENT_H */
-1
include/asm-powerpc/iseries/hv_types.h
···11/*22- * HvTypes.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify
+13-1
include/asm-powerpc/iseries/iseries_io.h
···66#ifdef CONFIG_PPC_ISERIES77#include <linux/types.h>88/*99- * File iSeries_io.h created by Allan Trautman on Thu Dec 28 2000.99+ * Created by Allan Trautman on Thu Dec 28 2000.1010 *1111 * Remaps the io.h for the iSeries Io1212 * Copyright (C) 2000 Allan H Trautman, IBM Corporation···3232 * End Change Activity3333 */34343535+#ifdef CONFIG_PCI3536extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress);3637extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress);3738extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress);···4544 size_t n);4645extern void iSeries_memcpy_fromio(void *dest,4746 const volatile void __iomem *source, size_t n);4747+#else4848+static inline u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)4949+{5050+ return 0xff;5151+}5252+5353+static inline void iSeries_Write_Byte(u8 IoData,5454+ volatile void __iomem *IoAddress)5555+{5656+}5757+#endif /* CONFIG_PCI */48584959#endif /* CONFIG_PPC_ISERIES */5060#endif /* _ASM_POWERPC_ISERIES_ISERIES_IO_H */
-1
include/asm-powerpc/iseries/it_exp_vpd_panel.h
···11/*22- * ItExtVpdPanel.h32 * Copyright (C) 2002 Dave Boutcher IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify
+11-11
include/asm-powerpc/iseries/it_lp_naca.h
···11/*22- * ItLpNaca.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify···3637 u8 xLpIndex; // LP Index x0B-x0B3738 u16 xMaxLpQueues; // Number of allocated queues x0C-x0D3839 u16 xLpQueueOffset; // Offset to start of LP queues x0E-x0F3939- u8 xPirEnvironMode:8; // Piranha or hardware x10-x104040- u8 xPirConsoleMode:8; // Piranha console indicator x11-x114141- u8 xPirDasdMode:8; // Piranha dasd indicator x12-x124040+ u8 xPirEnvironMode; // Piranha or hardware x10-x104141+ u8 xPirConsoleMode; // Piranha console indicator x11-x114242+ u8 xPirDasdMode; // Piranha dasd indicator x12-x124243 u8 xRsvd1_0[5]; // Reserved for Piranha related x13-x174343- u8 xLparInstalled:1; // Is LPAR installed on system x18-x1F4444- u8 xSysPartitioned:1; // Is the system partitioned ...4545- u8 xHwSyncedTBs:1; // Hardware synced TBs ...4646- u8 xIntProcUtilHmt:1; // Utilize HMT for interrupts ...4747- u8 xRsvd1_1:4; // Reserved ...4848- u8 xSpVpdFormat:8; // VPD areas are in CSP format ...4949- u8 xIntProcRatio:8; // Ratio of int procs to procs ...4444+ u8 flags; // flags, see below x18-x1F4545+ u8 xSpVpdFormat; // VPD areas are in CSP format ...4646+ u8 xIntProcRatio; // Ratio of int procs to procs ...5047 u8 xRsvd1_2[5]; // Reserved ...5148 u16 xRsvd1_3; // Reserved x20-x215249 u16 xPlicVrmIndex; // VRM index of PLIC x22-x23···7176};72777378extern struct ItLpNaca itLpNaca;7979+8080+#define ITLPNACA_LPAR 0x80 /* Is LPAR installed on the system */8181+#define ITLPNACA_PARTITIONED 0x40 /* Is the system partitioned */8282+#define ITLPNACA_HWSYNCEDTBS 0x20 /* Hardware synced TBs */8383+#define ITLPNACA_HMTINT 0x10 /* Utilize MHT for interrupts */74847585#endif /* _ASM_POWERPC_ISERIES_IT_LP_NACA_H */
-1
include/asm-powerpc/iseries/it_lp_queue.h
···11/*22- * ItLpQueue.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify
+1-2
include/asm-powerpc/iseries/it_lp_reg_save.h
···11/*22- * ItLpRegSave.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify···82838384extern struct ItLpRegSave iseries_reg_save[];84858585-#endif /* _ITLPREGSAVE_H */8686+#endif /* _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H */
-1
include/asm-powerpc/iseries/lpar_map.h
···11/*22- * LparMap.h32 * Copyright (C) 2001 Mike Corrigan IBM Corporation43 *54 * This program is free software; you can redistribute it and/or modify
-1
include/asm-powerpc/iseries/mf.h
···11/*22- * mf.h32 * Copyright (C) 2001 Troy D. Armstrong IBM Corporation43 * Copyright (C) 2004 Stephen Rothwell IBM Corporation54 *