Lines Matching +full:1 +full:a0
32 * Macro to find first bit set in WINDOWBASE from the left + 1
34 * 100....0 -> 1
36 * 000....1 -> WSBITS
43 addi \bit, \bit, WSBITS - 32 + 1 # uppest bit set -> return 1
63 addi \bit, \bit, -1
102 * a0: trashed, original value saved on stack (PT_AREG0)
114 * a0-a3 and depc have been saved to PT_AREG0...PT_AREG3 and PT_DEPC
126 rsr a0, depc
128 s32i a0, a2, PT_AREG2
164 movi a3, 1
172 UABI_W _bbsi.l a2, 1, .Lsave_window_registers
191 beqi a2, 1, common_exception
194 * We have to save all registers up to the first '1' from
197 * All register frames starting from the top field to the marked '1'
201 addi a3, a2, -1 # eliminate '1' in bit 0: yyyyxxww0
202 neg a3, a3 # yyyyxxww0 -> YYYYXXWW1+1
207 ffs_ws a0, a3 # number of frames to the '1' from left
214 slli a3, a0, 4 # number of frames to save in bits 8..4
221 1: rotw -1
222 s32i a0, a5, PT_AREG_END - 16
226 addi a0, a4, -1
228 _bnez a0, 1b
233 movi a3, 1
257 * a0: trashed, original value saved on stack (PT_AREG0)
269 * a0-a3 and depc have been saved to PT_AREG0...PT_AREG3 and PT_DEPC
280 rsr a0, depc # get a2
282 s32i a0, a2, PT_AREG2
312 KABI_W _bbsi.l a2, 1, 1f
317 KABI_W _bbsi.l a2, 2, 1f
322 KABI_W _bbsi.l a2, 3, 1f
329 _bnei a2, 1, 1f
330 /* Copy spill slots of a0 and a1 to imitate movsp
334 l32i a0, a1, PT_KERNEL_SIZE + 4
336 s32e a0, a1, -12
338 1:
339 l32i a0, a1, PT_AREG0 # restore saved a0
340 wsr a0, depc
379 rsr a0, excsave1
381 s32i a3, a0, EXC_TABLE_FIXUP
388 * Set PS(EXCM = 0, UM = 0, RING = 0, OWB = 0, WOE = 1, INTLEVEL = X)
396 * - in case of exception or level-1 interrupt it's in the PS,
400 movi a0, EXCCAUSE_MAPPED_NMI
402 beq a2, a0, .Lmedium_level_irq
404 beqz a3, .Llevel1_irq # level-1 IRQ sets ps.intlevel to 0
407 rsr a0, excsave2
408 s32i a0, a1, PT_PS # save medium-level interrupt ps
415 KABI_W movi a0, PS_WOE_MASK
416 KABI_W or a3, a3, a0
419 movi a0, LOCKLEVEL
422 moveqz a3, a0, a2 # a3 = LOCKLEVEL iff interrupt
428 rsr a0, depc
454 beqz abi_tmp0, 1f
456 1:
460 bbci.l abi_tmp0, PS_UM_BIT, 1f
462 1:
551 _bbci.l abi_saved0, TIF_DB_DISABLED, 1f
553 1:
564 bgei abi_tmp0, LOCKLEVEL, 1f
566 1:
600 rotw -1 # we restore a4..a7
603 /* The working registers are a0 and a3. We are restoring to
613 1: rotw -1 # a0..a3 become a4..a7
620 _bgeui a2, 16, 1b
625 rsr a0, windowbase
627 sub a3, a0, a3
631 1: rotw -1
632 addi a3, a7, -1
637 bgei a3, 1, 1b
642 * (if we have restored WSBITS-1 frames).
646 movi a2, 1
672 * 'and' WINDOWSTART and WINDOWSTART-1:
674 * (XXXXXX1[0]* - 1) AND XXXXXX1[0]* = XXXXXX0[0]*
684 * We actually have WMASK, so we only have to test if it is 1 or not.
688 _beqi a2, 1, common_exception_exit # Spilled before exception,jump
693 addi a0, a3, -1
694 and a3, a3, a0
697 /* Do a movsp (we returned from a call4, so we have at least a0..a7) */
699 addi a0, a1, -16
700 l32i a3, a0, 0
701 l32i a4, a0, 4
704 l32i a3, a0, 8
705 l32i a4, a0, 12
716 movi a2, 1
723 _bbsi.l a2, 1, 1f
728 _bbsi.l a2, 2, 1f
733 _bbsi.l a2, 3, 1f
741 1: l32i a2, a1, PT_PC
765 l32i a0, a1, PT_DEPC
768 _bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f
770 /* Restore a0...a3 and return */
772 l32i a0, a1, PT_AREG0
776 1: wsr a0, depc
777 l32i a0, a1, PT_AREG0
788 * When we get here, a0 is trashed and saved to excsave[debuglevel]
795 rsr a0, SREG_EPS + XCHAL_DEBUGLEVEL
796 bbsi.l a0, PS_EXCM_BIT, .Ldebug_exception_in_exception # exception mode
809 movi a2, 1 << PS_EXCM_BIT
810 or a2, a0, a2
813 /* Switch to kernel/user stack, restore jump vector, and save a0 */
819 l32i a0, a3, DT_DEBUG_SAVE
821 s32i a0, a2, PT_AREG0
822 movi a0, 0
823 s32i a0, a2, PT_DEPC # mark it as a regular exception
825 xsr a0, depc
827 s32i a0, a2, PT_AREG2
838 addi a3, a3, 1
860 bbci.l a0, PS_UM_BIT, .Ldebug_exception_in_exception # jump if kernel mode
862 rsr a0, debugcause
863 bbsi.l a0, DEBUGCAUSE_DBREAK_BIT, .Ldebug_save_dbreak
867 l32i a0, a3, DT_DBREAKC_SAVE + _index * 4
868 wsr a0, SREG_DBREAKC + _index
869 .set _index, _index + 1
872 l32i a0, a3, DT_ICOUNT_LEVEL_SAVE
873 wsr a0, icountlevel
875 l32i a0, a3, DT_ICOUNT_SAVE
876 xsr a0, icount
878 l32i a0, a3, DT_DEBUG_SAVE
885 movi a0, 0
886 xsr a0, SREG_DBREAKC + _index
887 s32i a0, a3, DT_DBREAKC_SAVE + _index * 4
888 .set _index, _index + 1
891 movi a0, XCHAL_EXCM_LEVEL + 1
892 xsr a0, icountlevel
893 s32i a0, a3, DT_ICOUNT_LEVEL_SAVE
895 movi a0, 0xfffffffe
896 xsr a0, icount
897 s32i a0, a3, DT_ICOUNT_SAVE
899 l32i a0, a3, DT_DEBUG_SAVE
917 * - a0 contains the caller address; original value saved in excsave1.
918 * - the original a0 contains a valid return address (backtrace) or 0.
939 movi a0, 1
942 wsr a0, windowstart
952 movi a0, 0
958 1: j 1b
997 * a0: trashed, original value saved on stack (PT_AREG0)
1009 rsr a0, windowbase
1010 rotw -1
1024 rotw -1
1026 rotw -1
1043 * a0: trashed, original value saved on stack (PT_AREG0)
1053 rsr a0, ps
1054 bbsi.l a0, PS_WOE_BIT, 1f
1057 or a0, a0, a3
1058 wsr a0, ps
1061 rsr a0, epc1
1062 s32i a0, a3, TI_PS_WOE_FIX_ADDR
1065 l32i a0, a2, PT_AREG0
1068 1:
1085 * a0: trashed, original value saved on stack (PT_AREG0)
1097 rsr a0, epc1
1098 addi a0, a0, 3
1099 wsr a0, epc1
1101 l32i a0, a2, PT_DEPC
1102 bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, fast_syscall_unrecoverable
1104 rsr a0, depc # get syscall-nr
1105 _beqz a0, fast_syscall_spill_registers
1106 _beqi a0, __NR_xtensa, fast_syscall_xtensa
1116 l32i a0, a2, PT_AREG0 # restore a0
1119 wsr a0, excsave1
1135 * a0: a2 (syscall-nr), original value saved on stack (PT_AREG0)
1137 * a2: new stack pointer, original in a0 and DEPC
1157 access_ok a3, a7, a0, a2, .Leac # a0: scratch reg, a2: sp
1166 EX(.Leac) l32i a0, a3, 0 # read old value
1167 bne a0, a4, 1f # same as old value? jump
1170 l32i a0, a2, PT_AREG0 # restore a0
1171 movi a2, 1 # and return 1
1174 1: l32i a7, a2, PT_AREG7 # restore a7
1175 l32i a0, a2, PT_AREG0 # restore a0
1183 add a0, a4, a7 # + arg
1184 moveqz a0, a4, a6 # set
1186 EX(.Leac) s32i a0, a3, 0 # write new value
1188 mov a0, a2
1190 l32i a7, a0, PT_AREG7 # restore a7
1191 l32i a0, a0, PT_AREG0 # restore a0
1195 l32i a0, a2, PT_AREG0 # restore a0
1200 l32i a0, a2, PT_AREG0 # restore a0
1210 l32i a0, a2, PT_AREG0 # restore a0
1223 * a0: trashed, original value saved on stack (PT_AREG0)
1241 movi a0, fast_syscall_spill_registers_fixup
1242 s32i a0, a3, EXC_TABLE_FIXUP
1243 rsr a0, windowbase
1244 s32i a0, a3, EXC_TABLE_PARAM
1249 rsr a0, sar
1251 s32i a0, a2, PT_SAR
1268 rsr a0, windowbase
1270 ssr a0 # holds WB
1271 slli a0, a3, WSBITS
1272 or a3, a3, a0 # a3 = xxxwww1yyxxxwww1yy
1277 extui a3, a3, 1, WSBITS-1 # a3 = 0yyxxxwww
1278 movi a0, (1 << (WSBITS-1))
1281 /* We want 1 at the top, so that we return to the current windowbase */
1283 or a3, a3, a0 # 1yyxxxwww
1288 neg a0, a3
1289 and a3, a0, a3 # first bit set from right: 000010000
1291 ffs_ws a0, a3 # a0: shifts to skip empty frames
1293 sub a0, a3, a0 # WSBITS-a0:number of 0-bits from right
1294 ssr a0 # save in SAR for later.
1297 add a3, a3, a0
1313 .Lloop: _bbsi.l a3, 1, .Lc4
1327 _bnei a3, 1, .Lloop
1335 srli a7, a3, 1
1336 rotw 1
1337 _bnei a3, 1, .Lloop
1344 l32e a0, a5, -12
1345 s32e a8, a0, -48
1346 mov a8, a0
1361 * rotw 1
1362 * s32e a0, a13, -16
1367 rotw 1
1369 rotw -1
1378 _beqi a3, 1, .Lexit
1385 rotw 1
1388 movi a3, 1
1396 l32i a0, a2, PT_AREG0
1419 movi a0, 1
1422 wsr a0, windowstart
1426 movi a0, 0
1440 wsr a0, excsave1
1442 1: j 1b
1457 * frame for the current windowbase - 1, we need to rotate a3 left by the
1458 * value of the current windowbase + 1 and move it to windowstart.
1460 * a0: value of depc, original value in depc
1468 xsr a0, depc # restore depc and a0
1471 /* We need to make sure the current registers (a0-a3) are preserved.
1481 slli a3, a3, 1 # shift left by one
1482 addi a3, a3, 1 # set the bit for the current window frame
1488 srli a3, a3, 1
1498 * a0, a1, a2 same
1508 * a0: return address
1520 s32i a0, a2, PT_AREG0
1530 rsr a0, exccause
1531 addx4 a0, a0, a3 # find entry in table
1532 l32i a0, a0, EXC_TABLE_FAST_USER # load handler
1534 jx a0
1572 l32i a0, a2, PT_AREG0 # restore a0
1587 1:
1589 1: j 1b
1602 * a0: trashed, original value saved on stack (PT_AREG0)
1637 l32i a0, a1, TASK_MM # tsk->mm
1638 beqz a0, .Lfast_second_level_miss_no_mm
1642 _PGD_OFFSET(a0, a3, a1)
1643 l32i a0, a0, 0 # read pmdval
1644 beqz a0, .Lfast_second_level_miss_no_pmd
1661 add a0, a0, a1 # pmdval - PAGE_OFFSET
1662 extui a1, a0, 0, PAGE_SHIFT # ... & PAGE_MASK
1663 xor a0, a0, a1
1666 or a0, a0, a1 # ... | PAGE_DIRECTORY
1673 * 0,1 -> way 7 program (0040.0000) and virtual (c000.0000)
1678 extui a3, a3, 28, 2 # addr. bit 28 and 29 0,1,2,3
1682 extui a3, a3, 2, 2 # -> 0,0,1,2
1688 wdtlb a0, a1
1694 movi a0, 0
1695 s32i a0, a3, EXC_TABLE_FIXUP
1699 l32i a0, a2, PT_AREG0
1704 bgeui a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f
1713 1: xsr a2, depc
1718 l32i a0, a1, TASK_ACTIVE_MM # unlikely case mm == 0
1719 bnez a0, .Lfast_second_level_miss_continue
1725 movi a0, init_mm
1740 l32i a0, a2, PT_DEPC
1741 bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, .Lfast_second_level_miss_slow
1745 movi a0, __tlbtemp_mapping_start
1747 bltu a3, a0, .Lfast_second_level_miss_slow
1748 movi a0, __tlbtemp_mapping_end
1749 bgeu a3, a0, .Lfast_second_level_miss_slow
1754 rsr a0, excvaddr
1755 bltu a0, a3, .Lfast_second_level_miss_slow
1757 addi a1, a0, -TLBTEMP_SIZE
1769 and a1, a1, a0
1773 bgez a3, 1f
1777 extui a3, a0, PAGE_SHIFT + DCACHE_ALIAS_ORDER, 1
1782 mov a0, a6
1783 movnez a0, a7, a3
1788 1: witlb a6, a1
1803 bbsi.l a2, PS_UM_BIT, 1f
1805 1: call0 _user_exception
1816 * a0: trashed, original value saved on stack (PT_AREG0)
1835 l32i a0, a1, TASK_MM # tsk->mm
1836 beqz a0, .Lfast_store_no_mm
1840 _PGD_OFFSET(a0, a1, a3)
1841 l32i a0, a0, 0
1842 beqz a0, .Lfast_store_slow
1849 _PTE_OFFSET(a0, a1, a3)
1850 l32i a3, a0, 0 # read pteval
1858 s32i a3, a0, 0
1862 dhwb a0, 0
1864 pdtlb a0, a1
1865 wdtlb a3, a0
1869 movi a0, 0
1871 s32i a0, a3, EXC_TABLE_FIXUP
1877 l32i a0, a2, PT_AREG0
1880 bgeui a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f
1886 1: xsr a2, depc
1891 l32i a0, a1, TASK_ACTIVE_MM # unlikely case mm == 0
1897 pdtlb a0, a1
1898 bbci.l a0, DTLB_HIT_BIT, 1f
1899 idtlb a0
1900 1:
1906 bbsi.l a2, PS_UM_BIT, 1f
1908 1: call0 _user_exception
1930 s32i a0, sp, 0
1947 beqz abi_saved1, 1f
1954 1:
1960 bgeu a7, a5, 1f
1976 1: /* regs->areg[2] = return_value */
1979 bnez abi_saved1, 1f
1984 l32i a0, sp, 0
1992 1:
2009 call12 1f
2013 1:
2015 addi a12, a0, 3
2019 mov a12, a0
2067 s32i a0, a10, THREAD_RA - TASK_THREAD # save return address
2070 s32i a0, a2, THREAD_RA # save return address
2090 beqz a3, 1f
2094 beq a6, a7, 1f # load 0 into CPENABLE if current CPU is not the owner
2096 1:
2125 l32i a0, a11, THREAD_RA # restore return address
2188 .fill XTREGS_USER_SIZE, 1
2198 s32i a0, a2, 0
2250 l32i a0, a2, 0