Lines Matching +full:asi +full:- +full:format
1 // SPDX-License-Identifier: GPL-2.0-only
10 * Added Linux support -miguel (weird, eh?, the original code was meant
33 #include <asm/asi.h>
102 * 1) flush the D-cache if it's possible than an illegal alias
104 * 2) flush the I-cache if this is pre-cheetah and we did a write
121 * D-cache flush. in flush_ptrace_access()
134 start &= ~(dcache_line_size - 1); in flush_ptrace_access()
165 return -EFAULT; in get_from_target()
170 return -EFAULT; in get_from_target()
180 return -EFAULT; in set_to_target()
185 return -EFAULT; in set_to_target()
194 unsigned long rw_addr = regs->u_regs[UREG_I6]; in regwindow64_get()
201 return -EFAULT; in regwindow64_get()
203 wbuf->locals[i] = win32.locals[i]; in regwindow64_get()
205 wbuf->ins[i] = win32.ins[i]; in regwindow64_get()
209 return -EFAULT; in regwindow64_get()
219 unsigned long rw_addr = regs->u_regs[UREG_I6]; in regwindow64_set()
226 win32.locals[i] = wbuf->locals[i]; in regwindow64_set()
228 win32.ins[i] = wbuf->ins[i]; in regwindow64_set()
231 return -EFAULT; in regwindow64_set()
235 return -EFAULT; in regwindow64_set()
256 membuf_write(&to, regs->u_regs, 16 * sizeof(u64)); in genregs64_get()
260 return -EFAULT; in genregs64_get()
263 membuf_write(&to, ®s->tstate, 3 * sizeof(u64)); in genregs64_get()
264 return membuf_store(&to, (u64)regs->y); in genregs64_get()
279 regs->u_regs, in genregs64_set()
285 return -EFAULT; in genregs64_set()
294 return -EFAULT; in genregs64_set()
310 regs->tstate &= ~(TSTATE_ICC | TSTATE_XCC | TSTATE_SYSCALL); in genregs64_set()
311 regs->tstate |= tstate; in genregs64_set()
318 ®s->tpc, in genregs64_set()
324 unsigned long y = regs->y; in genregs64_set()
331 regs->y = y; in genregs64_set()
336 36 * sizeof(u64), -1); in genregs64_set()
351 fprs = t->fpsaved[0]; in fpregs64_get()
354 membuf_write(&to, t->fpregs, 16 * sizeof(u64)); in fpregs64_get()
359 membuf_write(&to, t->fpregs + 16, 16 * sizeof(u64)); in fpregs64_get()
363 membuf_store(&to, t->xfsr[0]); in fpregs64_get()
364 membuf_store(&to, t->gsr[0]); in fpregs64_get()
376 unsigned long *fpregs = task_thread_info(target)->fpregs; in fpregs64_set()
388 task_thread_info(target)->xfsr, in fpregs64_set()
393 task_thread_info(target)->gsr, in fpregs64_set()
397 fprs = task_thread_info(target)->fpsaved[0]; in fpregs64_set()
406 task_thread_info(target)->fpsaved[0] = fprs; in fpregs64_set()
410 35 * sizeof(u64), -1); in fpregs64_set()
415 /* Format is:
416 * G0 --> G7
417 * O0 --> O7
418 * L0 --> L7
419 * I0 --> I7
428 /* Format is:
429 * F0 --> F63
451 membuf_write(&to, regs->u_regs + 1, 15 * sizeof(u64)); in getregs64_get()
453 membuf_write(&to, ®s->tstate, 3 * sizeof(u64)); in getregs64_get()
454 return membuf_store(&to, (u64)regs->y); in getregs64_get()
463 unsigned long y = regs->y; in setregs64_set()
471 regs->u_regs + 1, in setregs64_set()
489 regs->tstate &= ~(TSTATE_ICC | TSTATE_XCC | TSTATE_SYSCALL); in setregs64_set()
490 regs->tstate |= tstate; in setregs64_set()
494 ®s->tpc, in setregs64_set()
505 regs->y = y; in setregs64_set()
510 /* Format is:
511 * G1 --> G7
512 * O0 --> O7
544 membuf_store(&to, (u32)regs->u_regs[i]); in genregs32_get()
547 if (get_from_target(target, regs->u_regs[UREG_I6], in genregs32_get()
549 return -EFAULT; in genregs32_get()
551 membuf_store(&to, (u32)tstate_to_psr(regs->tstate)); in genregs32_get()
552 membuf_store(&to, (u32)(regs->tpc)); in genregs32_get()
553 membuf_store(&to, (u32)(regs->tnpc)); in genregs32_get()
554 membuf_store(&to, (u32)(regs->y)); in genregs32_get()
576 for (; count > 0 && pos < 16; count--) in genregs32_set()
577 regs->u_regs[pos++] = *k++; in genregs32_set()
579 reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; in genregs32_set()
580 reg_window -= 16; in genregs32_set()
582 for (; count > 0 && pos < 32; count--) { in genregs32_set()
584 return -EFAULT; in genregs32_set()
587 for (; count > 0 && pos < 32; count--) { in genregs32_set()
595 return -EFAULT; in genregs32_set()
601 for (; count > 0 && pos < 16; count--) { in genregs32_set()
603 return -EFAULT; in genregs32_set()
604 regs->u_regs[pos++] = reg; in genregs32_set()
607 reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; in genregs32_set()
608 reg_window -= 16; in genregs32_set()
610 for (; count > 0 && pos < 32; count--) { in genregs32_set()
613 return -EFAULT; in genregs32_set()
616 for (; count > 0 && pos < 32; count--) { in genregs32_set()
618 return -EFAULT; in genregs32_set()
625 return -EFAULT; in genregs32_set()
637 return -EFAULT; in genregs32_set()
641 tstate = regs->tstate; in genregs32_set()
646 regs->tstate = tstate; in genregs32_set()
649 regs->tpc = reg; in genregs32_set()
652 regs->tnpc = reg; in genregs32_set()
655 regs->y = reg; in genregs32_set()
665 count--; in genregs32_set()
672 38 * sizeof(reg), -1); in genregs32_set()
686 enabled = t->fpsaved[0] & FPRS_FEF; in fpregs32_get()
688 membuf_write(&to, t->fpregs, 32 * sizeof(u32)); in fpregs32_get()
691 membuf_store(&to, (u32)t->xfsr[0]); in fpregs32_get()
703 unsigned long *fpregs = task_thread_info(target)->fpregs; in fpregs32_set()
710 fprs = task_thread_info(target)->fpsaved[0]; in fpregs32_set()
728 val = task_thread_info(target)->xfsr[0]; in fpregs32_set()
731 task_thread_info(target)->xfsr[0] = val; in fpregs32_set()
736 task_thread_info(target)->fpsaved[0] = fprs; in fpregs32_set()
740 34 * sizeof(u32), -1); in fpregs32_set()
745 /* Format is:
746 * G0 --> G7
747 * O0 --> O7
748 * L0 --> L7
749 * I0 --> I7
758 /* Format is:
759 * F0 --> F31
760 * empty 32-bit word
761 * FSR (32--bit word)
762 * FPU QUEUE COUNT (8-bit char)
763 * FPU QUEUE ENTRYSIZE (8-bit char)
764 * FPU ENABLED (8-bit char)
765 * empty 8-bit char
766 * FPU QUEUE (64 32-bit ints)
786 membuf_store(&to, (u32)tstate_to_psr(regs->tstate)); in getregs_get()
787 membuf_store(&to, (u32)(regs->tpc)); in getregs_get()
788 membuf_store(&to, (u32)(regs->tnpc)); in getregs_get()
789 membuf_store(&to, (u32)(regs->y)); in getregs_get()
791 membuf_store(&to, (u32)regs->u_regs[i]); in getregs_get()
814 tstate = regs->tstate; in setregs_set()
819 regs->tstate = tstate; in setregs_set()
820 regs->tpc = uregs[1]; in setregs_set()
821 regs->tnpc = uregs[2]; in setregs_set()
822 regs->y = uregs[3]; in setregs_set()
825 regs->u_regs[i] = uregs[3 + i]; in setregs_set()
838 membuf_write(&to, t->fpregs, 32 * sizeof(u32)); in getfpregs_get()
839 if (t->fpsaved[0] & FPRS_FEF) in getfpregs_get()
840 membuf_store(&to, (u32)t->xfsr[0]); in getfpregs_get()
851 unsigned long *fpregs = task_thread_info(target)->fpregs; in setfpregs_set()
858 fprs = task_thread_info(target)->fpsaved[0]; in setfpregs_set()
872 val = task_thread_info(target)->xfsr[0]; in setfpregs_set()
875 task_thread_info(target)->xfsr[0] = val; in setfpregs_set()
880 task_thread_info(target)->fpsaved[0] = fprs; in setfpregs_set()
930 compat_ulong_t caddr2 = task_pt_regs(current)->u_regs[UREG_I4]; in compat_arch_ptrace()
943 ret = (addr != 0) ? -EIO : 0; in compat_arch_ptrace()
981 ret = -EIO; in compat_arch_ptrace()
991 ret = -EIO; in compat_arch_ptrace()
1014 unsigned long addr2 = task_pt_regs(current)->u_regs[UREG_I4]; in arch_ptrace()
1026 ret = (addr != 0) ? -EIO : 0; in arch_ptrace()
1063 ret = -EIO; in arch_ptrace()
1072 ret = -EIO; in arch_ptrace()
1090 secure_computing_strict(regs->u_regs[UREG_G1]); in syscall_trace_enter()
1099 trace_sys_enter(regs, regs->u_regs[UREG_G1]); in syscall_trace_enter()
1101 audit_syscall_entry(regs->u_regs[UREG_G1], regs->u_regs[UREG_I0], in syscall_trace_enter()
1102 regs->u_regs[UREG_I1], regs->u_regs[UREG_I2], in syscall_trace_enter()
1103 regs->u_regs[UREG_I3]); in syscall_trace_enter()
1116 trace_sys_exit(regs, regs->u_regs[UREG_I0]); in syscall_trace_leave()
1126 * regs_query_register_offset() - query register offset from its name
1130 * pt_regs from its name. If the name is invalid, this returns -EINVAL;
1136 for (roff = regoffset_table; roff->name != NULL; roff++) in regs_query_register_offset()
1137 if (!strcmp(roff->name, name)) in regs_query_register_offset()
1138 return roff->offset; in regs_query_register_offset()
1139 return -EINVAL; in regs_query_register_offset()
1143 * regs_within_kernel_stack() - check the address in the stack
1154 return ((addr & ~(THREAD_SIZE - 1)) == in regs_within_kernel_stack()
1155 (ksp & ~(THREAD_SIZE - 1))); in regs_within_kernel_stack()
1159 * regs_get_kernel_stack_nth() - get Nth entry of the stack