Lines Matching +full:reg +full:- +full:offset
1 /* swap_macros.h - helper macros for context switch */
6 * SPDX-License-Identifier: Apache-2.0
16 #include <zephyr/arch/arc/tool-compat.h>
17 #include <zephyr/arch/arc/asm-compat/assembler.h>
280 * _kernel.current. r3 is a scratch reg.
362 * need two temp reg to do this
367 and MACRO_ARG(reg1), MACRO_ARG(reg1), ((1 << ARC_N_IRQ_START_LEVEL) - 1)
378 * the result will be in reg (a reg)
380 .macro _get_cpu_id, reg
381 LRR MACRO_ARG(reg), [_ARC_V2_IDENTITY]
382 xbfu MACRO_ARG(reg), MACRO_ARG(reg), 0xe8
386 * the result will be in irq_sp (a reg)
402 /* macro to push aux reg through reg */
403 .macro PUSHAX, reg, aux
404 LRR MACRO_ARG(reg), [MACRO_ARG(aux)]
405 PUSHR MACRO_ARG(reg)
408 /* macro to pop aux reg through reg */
409 .macro POPAX, reg, aux
410 POPR MACRO_ARG(reg)
411 SRR MACRO_ARG(reg), [MACRO_ARG(aux)]
421 * TODO: we should add SMP write-after-write data memory barrier here, as we want all
514 .macro _disable_stack_checking, reg
517 lr MACRO_ARG(reg), [_ARC_V2_SEC_STAT]
518 bclr MACRO_ARG(reg), MACRO_ARG(reg), _ARC_V2_SEC_STAT_SSC_BIT
519 sflag MACRO_ARG(reg)
522 lr MACRO_ARG(reg), [_ARC_V2_STATUS32]
523 bclr MACRO_ARG(reg), MACRO_ARG(reg), _ARC_V2_STATUS32_SC_BIT
524 kflag MACRO_ARG(reg)
532 .macro _enable_stack_checking, reg
535 lr MACRO_ARG(reg), [_ARC_V2_SEC_STAT]
536 bset MACRO_ARG(reg), MACRO_ARG(reg), _ARC_V2_SEC_STAT_SSC_BIT
537 sflag MACRO_ARG(reg)
539 lr MACRO_ARG(reg), [_ARC_V2_STATUS32]
540 bset MACRO_ARG(reg), MACRO_ARG(reg), _ARC_V2_STATUS32_SC_BIT
541 kflag MACRO_ARG(reg)
548 #define __arc_u9_min (-256)
555 .macro _st32_huge_offset, d, s, offset, temp
556 .if MACRO_ARG(offset) <= __arc_u9_max && MACRO_ARG(offset) >= __arc_u9_min
557 st MACRO_ARG(d), [MACRO_ARG(s), MACRO_ARG(offset)]
559 * as we use only positive offsets in hand-written assembly code we keep only
560 * positive offset case here for simplicity.
562 .elseif !(MACRO_ARG(offset) % (1 << __arc_ldst32_as_shift)) && \
563 MACRO_ARG(offset) <= (__arc_u9_max << __arc_ldst32_as_shift) && \
564 MACRO_ARG(offset) >= 0
565 st.as MACRO_ARG(d), [MACRO_ARG(s), MACRO_ARG(offset) >> __arc_ldst32_as_shift]
567 ADDR MACRO_ARG(temp), MACRO_ARG(s), MACRO_ARG(offset)