···11821182 ;;11831183(pNonSys) mov out2=0 // out2==0 => not a syscall11841184 .fframe 1611851185- .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!)11851185+ .spillsp ar.unat, 1611861186 st8 [sp]=r9,-16 // allocate space for ar.unat and save it11871187 st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch11881188 .body···12081208 adds out2=8,sp // out2=&sigscratch->ar_pfs12091209 ;;12101210 .fframe 1612111211- .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!)12111211+ .spillsp ar.unat, 1612121212 st8 [sp]=r9,-16 // allocate space for ar.unat and save it12131213 st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch12141214 .body
+2-2
arch/ia64/kernel/mca.c
···13901390 register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);1391139113921392#ifdef CONFIG_ACPI13931393- /* Setup the CPEI/P vector and handler */13941394- cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);13931393+ /* Setup the CPEI/P handler */13951394 register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);13961395#endif13971396···1435143614361437#ifdef CONFIG_ACPI14371438 /* Setup the CPEI/P vector and handler */14391439+ cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);14381440 init_timer(&cpe_poll_timer);14391441 cpe_poll_timer.function = ia64_mca_cpe_poll;14401442
+1-2
arch/ia64/kernel/minstate.h
···4141(pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;; \4242(pKStk) ld8 r3 = [r3];; \4343(pKStk) addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;; \4444-(pKStk) addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \4444+(pKStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \4545(pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \4646(pUStk) addl r22=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \4747 ;; \···5050(pUStk) mov r23=ar.bspstore; /* save ar.bspstore */ \5151(pUStk) dep r22=-1,r22,61,3; /* compute kernel virtual addr of RBS */ \5252 ;; \5353-(pKStk) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \5453(pUStk) mov ar.bspstore=r22; /* switch to kernel RBS */ \5554 ;; \5655(pUStk) mov r18=ar.bsp; \
+160-15
arch/ia64/kernel/perfmon.c
···1111 * Version Perfmon-2.x is a rewrite of perfmon-1.x1212 * by Stephane Eranian, Hewlett Packard Co.1313 *1414- * Copyright (C) 1999-2003, 2005 Hewlett Packard Co1414+ * Copyright (C) 1999-2005 Hewlett Packard Co1515 * Stephane Eranian <eranian@hpl.hp.com>1616 * David Mosberger-Tang <davidm@hpl.hp.com>1717 *···497497static pfm_stats_t pfm_stats[NR_CPUS];498498static pfm_session_t pfm_sessions; /* global sessions information */499499500500+static spinlock_t pfm_alt_install_check = SPIN_LOCK_UNLOCKED;501501+static pfm_intr_handler_desc_t *pfm_alt_intr_handler;502502+500503static struct proc_dir_entry *perfmon_dir;501504static pfm_uuid_t pfm_null_uuid = {0,};502505···609606DEFINE_PER_CPU(struct task_struct *, pmu_owner);610607DEFINE_PER_CPU(pfm_context_t *, pmu_ctx);611608DEFINE_PER_CPU(unsigned long, pmu_activation_number);609609+EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info);612610613611614612/* forward declaration */···13291325error_conflict:13301326 DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n",13311327 pfm_sessions.pfs_sys_session[cpu]->pid,13321332- smp_processor_id()));13281328+ cpu));13331329abort:13341330 UNLOCK_PFS(flags);13351331···55595555 int ret;5560555655615557 this_cpu = get_cpu();55625562- min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min;55635563- max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max;55585558+ if (likely(!pfm_alt_intr_handler)) {55595559+ min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min;55605560+ max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max;5564556155655565- start_cycles = ia64_get_itc();55625562+ start_cycles = ia64_get_itc();5566556355675567- ret = pfm_do_interrupt_handler(irq, arg, regs);55645564+ ret = pfm_do_interrupt_handler(irq, arg, regs);5568556555695569- total_cycles = ia64_get_itc();55665566+ total_cycles = ia64_get_itc();5570556755715571- /*55725572- * don't measure spurious interrupts55735573- */55745574- if (likely(ret == 0)) {55755575- total_cycles -= start_cycles;55685568+ /*55695569+ * don't measure spurious interrupts55705570+ */55715571+ if (likely(ret == 0)) {55725572+ total_cycles -= start_cycles;5576557355775577- if (total_cycles < min) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min = total_cycles;55785578- if (total_cycles > max) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max = total_cycles;55745574+ if (total_cycles < min) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min = total_cycles;55755575+ if (total_cycles > max) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max = total_cycles;5579557655805580- pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles;55775577+ pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles;55785578+ }55815579 }55805580+ else {55815581+ (*pfm_alt_intr_handler->handler)(irq, arg, regs);55825582+ }55835583+55825584 put_cpu_no_resched();55835585 return IRQ_HANDLED;55845586}···64346424 .flags = SA_INTERRUPT,64356425 .name = "perfmon"64366426};64276427+64286428+static void64296429+pfm_alt_save_pmu_state(void *data)64306430+{64316431+ struct pt_regs *regs;64326432+64336433+ regs = ia64_task_regs(current);64346434+64356435+ DPRINT(("called\n"));64366436+64376437+ /*64386438+ * should not be necessary but64396439+ * let's take not risk64406440+ */64416441+ pfm_clear_psr_up();64426442+ pfm_clear_psr_pp();64436443+ ia64_psr(regs)->pp = 0;64446444+64456445+ /*64466446+ * This call is required64476447+ * May cause a spurious interrupt on some processors64486448+ */64496449+ pfm_freeze_pmu();64506450+64516451+ ia64_srlz_d();64526452+}64536453+64546454+void64556455+pfm_alt_restore_pmu_state(void *data)64566456+{64576457+ struct pt_regs *regs;64586458+64596459+ regs = ia64_task_regs(current);64606460+64616461+ DPRINT(("called\n"));64626462+64636463+ /*64646464+ * put PMU back in state expected64656465+ * by perfmon64666466+ */64676467+ pfm_clear_psr_up();64686468+ pfm_clear_psr_pp();64696469+ ia64_psr(regs)->pp = 0;64706470+64716471+ /*64726472+ * perfmon runs with PMU unfrozen at all times64736473+ */64746474+ pfm_unfreeze_pmu();64756475+64766476+ ia64_srlz_d();64776477+}64786478+64796479+int64806480+pfm_install_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl)64816481+{64826482+ int ret, i;64836483+ int reserve_cpu;64846484+64856485+ /* some sanity checks */64866486+ if (hdl == NULL || hdl->handler == NULL) return -EINVAL;64876487+64886488+ /* do the easy test first */64896489+ if (pfm_alt_intr_handler) return -EBUSY;64906490+64916491+ /* one at a time in the install or remove, just fail the others */64926492+ if (!spin_trylock(&pfm_alt_install_check)) {64936493+ return -EBUSY;64946494+ }64956495+64966496+ /* reserve our session */64976497+ for_each_online_cpu(reserve_cpu) {64986498+ ret = pfm_reserve_session(NULL, 1, reserve_cpu);64996499+ if (ret) goto cleanup_reserve;65006500+ }65016501+65026502+ /* save the current system wide pmu states */65036503+ ret = on_each_cpu(pfm_alt_save_pmu_state, NULL, 0, 1);65046504+ if (ret) {65056505+ DPRINT(("on_each_cpu() failed: %d\n", ret));65066506+ goto cleanup_reserve;65076507+ }65086508+65096509+ /* officially change to the alternate interrupt handler */65106510+ pfm_alt_intr_handler = hdl;65116511+65126512+ spin_unlock(&pfm_alt_install_check);65136513+65146514+ return 0;65156515+65166516+cleanup_reserve:65176517+ for_each_online_cpu(i) {65186518+ /* don't unreserve more than we reserved */65196519+ if (i >= reserve_cpu) break;65206520+65216521+ pfm_unreserve_session(NULL, 1, i);65226522+ }65236523+65246524+ spin_unlock(&pfm_alt_install_check);65256525+65266526+ return ret;65276527+}65286528+EXPORT_SYMBOL_GPL(pfm_install_alt_pmu_interrupt);65296529+65306530+int65316531+pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl)65326532+{65336533+ int i;65346534+ int ret;65356535+65366536+ if (hdl == NULL) return -EINVAL;65376537+65386538+ /* cannot remove someone else's handler! */65396539+ if (pfm_alt_intr_handler != hdl) return -EINVAL;65406540+65416541+ /* one at a time in the install or remove, just fail the others */65426542+ if (!spin_trylock(&pfm_alt_install_check)) {65436543+ return -EBUSY;65446544+ }65456545+65466546+ pfm_alt_intr_handler = NULL;65476547+65486548+ ret = on_each_cpu(pfm_alt_restore_pmu_state, NULL, 0, 1);65496549+ if (ret) {65506550+ DPRINT(("on_each_cpu() failed: %d\n", ret));65516551+ }65526552+65536553+ for_each_online_cpu(i) {65546554+ pfm_unreserve_session(NULL, 1, i);65556555+ }65566556+65576557+ spin_unlock(&pfm_alt_install_check);65586558+65596559+ return 0;65606560+}65616561+EXPORT_SYMBOL_GPL(pfm_remove_alt_pmu_interrupt);6437656264386563/*64396564 * perfmon initialization routine, called from the initcall() table
+17-3
arch/ia64/kernel/ptrace.c
···692692 unsigned long cfm)693693{694694 struct unw_frame_info info, prev_info;695695- unsigned long ip, pr;695695+ unsigned long ip, sp, pr;696696697697 unw_init_from_blocked_task(&info, child);698698 while (1) {699699 prev_info = info;700700 if (unw_unwind(&info) < 0)701701 return;702702- if (unw_get_rp(&info, &ip) < 0)702702+703703+ unw_get_sp(&info, &sp);704704+ if ((long)((unsigned long)child + IA64_STK_OFFSET - sp)705705+ < IA64_PT_REGS_SIZE) {706706+ dprintk("ptrace.%s: ran off the top of the kernel "707707+ "stack\n", __FUNCTION__);703708 return;704704- if (ip < FIXADDR_USER_END)709709+ }710710+ if (unw_get_pr (&prev_info, &pr) < 0) {711711+ unw_get_rp(&prev_info, &ip);712712+ dprintk("ptrace.%s: failed to read "713713+ "predicate register (ip=0x%lx)\n",714714+ __FUNCTION__, ip);715715+ return;716716+ }717717+ if (unw_is_intr_frame(&info)718718+ && (pr & (1UL << PRED_USER_STACK)))705719 break;706720 }707721
···182182 }183183 }184184185185- /*186186- * A zero mmap always succeeds in Linux, independent of whether or not the187187- * remaining arguments are valid.188188- */189189- if (len == 0)190190- goto out;191191-192185 /* Careful about overflows.. */193186 len = PAGE_ALIGN(len);194187 if (!len || len > TASK_SIZE) {
+2
arch/ia64/sn/kernel/setup.c
···271271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor();272272 extern void sn_cpu_init(void);273273274274+ ia64_sn_plat_set_error_handling_features();275275+274276 /*275277 * If the generic code has enabled vga console support - lets276278 * get rid of it again. This is a kludge for the fact that ACPI