Lines Matching +full:reg +full:- +full:spacing
6 * Copyright (C) 1994 - 1999, 2000, 01, 06 Ralf Baechle
49 #include <asm/cpu-type.h>
54 #include <asm/isa-rev.h>
55 #include <asm/mips-cps.h>
56 #include <asm/mips-r2-to-r6-emul.h>
75 #include <asm/mach-loongson64/cpucfg-emul.h>
77 #include "access-helper.h"
155 unsigned long sp = regs->regs[29];
156 unsigned long ra = regs->regs[31];
157 unsigned long pc = regs->cp0_epc;
184 unsigned long *sp = (unsigned long *)regs->regs[29];
188 while ((unsigned long) sp & (PAGE_SIZE - 1)) {
221 regs.regs[29] = task->thread.reg29;
223 regs.cp0_epc = task->thread.reg31;
241 for(i = -3 ; i < 6 ; i++) {
268 unsigned int cause = regs->cp0_cause;
285 pr_cont(" %0*lx", field, regs->regs[i]);
293 printk("Acx : %0*lx\n", field, regs->acx);
296 printk("Hi : %0*lx\n", field, regs->hi);
297 printk("Lo : %0*lx\n", field, regs->lo);
303 printk("epc : %0*lx %pS\n", field, regs->cp0_epc,
304 (void *) regs->cp0_epc);
305 printk("ra : %0*lx %pS\n", field, regs->regs[31],
306 (void *) regs->regs[31]);
308 printk("Status: %08x ", (uint32_t) regs->cp0_status);
311 if (regs->cp0_status & ST0_KUO)
313 if (regs->cp0_status & ST0_IEO)
315 if (regs->cp0_status & ST0_KUP)
317 if (regs->cp0_status & ST0_IEP)
319 if (regs->cp0_status & ST0_KUC)
321 if (regs->cp0_status & ST0_IEC)
324 if (regs->cp0_status & ST0_KX)
326 if (regs->cp0_status & ST0_SX)
328 if (regs->cp0_status & ST0_UX)
330 switch (regs->cp0_status & ST0_KSU) {
344 if (regs->cp0_status & ST0_ERL)
346 if (regs->cp0_status & ST0_EXL)
348 if (regs->cp0_status & ST0_IE)
357 printk("BadVA : %0*lx\n", field, regs->cp0_badvaddr);
379 current->comm, current->pid, current_thread_info(), current,
380 field, current_thread_info()->tp_value);
385 if (tls != current_thread_info()->tp_value)
390 show_code((void *)regs->cp0_epc, user_mode(regs));
403 if (notify_die(DIE_OOPS, str, regs, 0, current->thread.trap_nr,
443 __stop___dbe_table - __start___dbe_table, addr);
453 int data = regs->cp0_cause & 4;
475 regs->cp0_epc = fixup->nextinsn;
488 field, regs->cp0_epc, field, regs->regs[31]);
489 if (notify_die(DIE_OOPS, "bus error", regs, 0, current->thread.trap_nr,
546 ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
564 regs->regs[(opcode & RT) >> 16] = value;
572 unsigned long reg;
586 ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset);
587 reg = (opcode & RT) >> 16;
595 regs->regs[reg] = 0;
602 if (put_user(regs->regs[reg], vaddr))
605 regs->regs[reg] = 1;
613 * executed on ll/sc-less processors. That's the theory. In practice a
630 return -1; /* Must be something else ... */
645 regs->regs[rt] = smp_processor_id();
648 regs->regs[rt] = min(current_cpu_data.dcache.linesz,
652 regs->regs[rt] = read_c0_count();
658 regs->regs[rt] = 1;
661 regs->regs[rt] = 2;
665 regs->regs[rt] = ti->tp_value;
668 return -1;
683 return -1;
696 return -1;
707 return -1; /* Must be something else ... */
711 * Loongson-3 CSR instructions emulation
733 __u64 sel = regs->regs[rs];
741 return -1;
743 regs->regs[rd] = loongson3_cpucfg_read_synthesized(
750 return -1;
761 force_sig_fault(SIGFPE, FPE_INTOVF, (void __user *)regs->cp0_epc);
809 mmap_read_lock(current->mm);
810 if (vma_lookup(current->mm, (unsigned long)fault_addr))
814 mmap_read_unlock(current->mm);
843 return -1;
850 regs->cp0_epc = old_epc;
851 regs->regs[31] = old_ra;
854 sig = fpu_emulator_cop1Handler(regs, ¤t->thread.fpu, 1,
861 fcr31 = mask_fcr31_x(current->thread.fpu.fcr31);
862 current->thread.fpu.fcr31 &= ~fcr31;
883 if (notify_die(DIE_FP, "FP exception", regs, 0, current->thread.trap_nr,
896 * software emulator on-board, let's use it...
900 * instruction, but the alternative is to pre-decode the FP
906 sig = fpu_emulator_cop1Handler(regs, ¤t->thread.fpu, 1,
913 fcr31 = mask_fcr31_x(current->thread.fpu.fcr31);
914 current->thread.fpu.fcr31 &= ~fcr31;
920 fault_addr = (void __user *) regs->cp0_epc;
939 ((current->thread.emulated_fp++ > mt_fpemul_threshold))) {
945 if (cpumask_intersects(¤t->cpus_mask, &mt_fpu_cpumask)) {
948 current->thread.user_cpus_allowed
949 = current->cpus_mask;
950 cpumask_and(&tmask, ¤t->cpus_mask,
964 return -1;
975 if (kgdb_ll_trap(DIE_TRAP, str, regs, code, current->thread.trap_nr,
980 if (notify_die(DIE_TRAP, str, regs, code, current->thread.trap_nr,
988 * But should we continue the brokenness??? --macro
997 (void __user *) regs->cp0_epc);
1037 current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f;
1038 if (get_isa16_mode(regs->cp0_epc)) {
1048 /* 16-bit microMIPS BREAK */
1051 /* 32-bit microMIPS BREAK */
1055 bcode = (opcode >> 6) & ((1 << 20) - 1);
1060 bcode = (opcode >> 6) & ((1 << 20) - 1);
1066 * Gas is bug-compatible, but not always, grrr...
1067 * We handle both cases with a simple heuristics. --macro
1070 bcode = ((bcode & ((1 << 10) - 1)) << 10) | (bcode >> 10);
1079 current->thread.trap_nr, SIGTRAP) == NOTIFY_STOP)
1085 current->thread.trap_nr, SIGTRAP) == NOTIFY_STOP)
1091 current->thread.trap_nr, SIGTRAP) == NOTIFY_STOP)
1097 current->thread.trap_nr, SIGTRAP) == NOTIFY_STOP)
1125 current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f;
1126 if (get_isa16_mode(regs->cp0_epc)) {
1133 tcode = (opcode >> 12) & ((1 << 4) - 1);
1139 tcode = (opcode >> 6) & ((1 << 10) - 1);
1156 unsigned long old_epc = regs->cp0_epc;
1157 unsigned long old31 = regs->regs[31];
1160 int status = -1;
1180 ¤t->thread.cp0_baduaddr,
1189 current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f;
1191 if (notify_die(DIE_RI, "RI Fault", regs, 0, current->thread.trap_nr,
1200 if (!get_isa16_mode(regs->cp0_epc)) {
1238 regs->cp0_epc = old_epc; /* Undo skip-over. */
1239 regs->regs[31] = old31;
1295 write_msa_csr(current->thread.fpu.msacsr);
1319 * - Restore the vector context & clobber any registers modified by
1324 * - Not restore the vector context & lose the most significant bits
1349 write_msa_csr(current->thread.fpu.msacsr);
1386 current->thread.fpu.fcr31);
1414 cpid = (regs->cp0_cause >> CAUSEB_CE) & 3;
1422 old_epc = regs->cp0_epc;
1423 old31 = regs->regs[31];
1425 status = -1;
1430 if (!get_isa16_mode(regs->cp0_epc)) {
1442 regs->cp0_epc = old_epc; /* Undo skip-over. */
1443 regs->regs[31] = old31;
1458 * exceptions. Some FPU-less processors that implement one
1478 sig = fpu_emulator_cop1Handler(regs, ¤t->thread.fpu, 0,
1485 fcr31 = mask_fcr31_x(current->thread.fpu.fcr31);
1486 current->thread.fpu.fcr31 &= ~fcr31;
1514 current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f;
1516 current->thread.trap_nr, SIGFPE) == NOTIFY_STOP)
1591 int multi_match = regs->cp0_status & ST0_TS;
1603 show_code((void *)regs->cp0_epc, user_mode(regs));
1609 panic("Caught Machine Check exception - %scaused by multiple "
1661 * Game over - no way to handle this if it ever occurs. Most probably
1666 panic("Caught reserved exception %ld - should not happen.",
1667 (regs->cp0_cause & 0x7f) >> 2);
1869 printk("IDX: 0x%08x\n", reg_val & ((1<<22)-1));
1922 * also-undocumented instructions accessible from userspace.
1936 panic("Unhandled Loongson exception - GSCause = %08x", diag1);
1952 printk(KERN_DEBUG "SDBBP EJTAG debug exception - not handled yet, just ignored!\n");
1963 old_epc = regs->cp0_epc;
1964 old_ra = regs->regs[31];
1965 regs->cp0_epc = depc;
1967 depc = regs->cp0_epc;
1968 regs->cp0_epc = old_epc;
1969 regs->regs[31] = old_ra;
1975 printk(KERN_DEBUG "\n\n----- Enable EJTAG single stepping ----\n\n");
1999 smp_processor_id(), regs->cp0_epc);
2000 regs->cp0_epc = read_c0_errorepc();
2041 unsigned long jump_mask = ~((1 << 27) - 1);
2043 unsigned long jump_mask = ~((1 << 28) - 1);
2101 ori_offset = except_vec_vi_ori - vec_start + 2;
2103 ori_offset = except_vec_vi_ori - vec_start;
2105 handler_len = except_vec_vi_end - vec_start;
2115 set_handler(((unsigned long)b - ebase), vec_start,
2117 (handler_len - 1));
2138 * Performance counter IRQ or -1 if shared with timer
2144 * Fast debug channel IRQ or -1 if not present
2164 * Disable coprocessors and select 32-bit or 64-bit addressing
2220 /* Setting vector spacing enables EI/VI mode */
2250 cp0_compare_irq_shift = CAUSEB_TI - CAUSEB_IP;
2255 cp0_fdc_irq = -1;
2260 cp0_perfcount_irq = -1;
2261 cp0_fdc_irq = -1;
2270 current->active_mm = &init_mm;
2271 BUG_ON(current->mm);
2285 memcpy((void *)(ebase + offset), ((unsigned char *)addr - 1), size);