Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1d82de6 authored by Greentime Hu's avatar Greentime Hu
Browse files

nds32: Assembly macros and definitions



This patch includes assembly macros, bit field definitions used in .S
files across arch/nds32/.

Signed-off-by: default avatarVincent Chen <vincentc@andestech.com>
Signed-off-by: default avatarGreentime Hu <greentime@andestech.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 2312dbf7
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2005-2017 Andes Technology Corporation

#ifndef __NDS32_ASSEMBLER_H__
#define __NDS32_ASSEMBLER_H__

.macro gie_disable
	setgie.d
	dsb
.endm

.macro gie_enable
	setgie.e
	dsb
.endm

.macro gie_save oldpsw
	mfsr \oldpsw, $ir0
	setgie.d
        dsb
.endm

.macro gie_restore oldpsw
	andi \oldpsw, \oldpsw, #0x1
	beqz \oldpsw, 7001f
	setgie.e
	dsb
7001:
.endm


#define USER(insn,  reg, addr, opr)	\
9999:	insn  reg, addr, opr;		\
	.section __ex_table,"a";	\
	.align 3;			\
	.long	9999b, 9001f;		\
	.previous

#endif /* __NDS32_ASSEMBLER_H__ */