18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * asmmacro.h: Assembler macros to make things easier to read.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
68c2ecf20Sopenharmony_ci * Copyright (C) 1998, 1999 Ralf Baechle
78c2ecf20Sopenharmony_ci * Copyright (C) 1999 Silicon Graphics, Inc.
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#ifndef _ASM_ASMMACRO_64_H
108c2ecf20Sopenharmony_ci#define _ASM_ASMMACRO_64_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <asm/asm-offsets.h>
138c2ecf20Sopenharmony_ci#include <asm/regdef.h>
148c2ecf20Sopenharmony_ci#include <asm/fpregdef.h>
158c2ecf20Sopenharmony_ci#include <asm/mipsregs.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci	.macro	cpu_save_nonscratch thread
188c2ecf20Sopenharmony_ci	LONG_S	s0, THREAD_REG16(\thread)
198c2ecf20Sopenharmony_ci	LONG_S	s1, THREAD_REG17(\thread)
208c2ecf20Sopenharmony_ci	LONG_S	s2, THREAD_REG18(\thread)
218c2ecf20Sopenharmony_ci	LONG_S	s3, THREAD_REG19(\thread)
228c2ecf20Sopenharmony_ci	LONG_S	s4, THREAD_REG20(\thread)
238c2ecf20Sopenharmony_ci	LONG_S	s5, THREAD_REG21(\thread)
248c2ecf20Sopenharmony_ci	LONG_S	s6, THREAD_REG22(\thread)
258c2ecf20Sopenharmony_ci	LONG_S	s7, THREAD_REG23(\thread)
268c2ecf20Sopenharmony_ci	LONG_S	sp, THREAD_REG29(\thread)
278c2ecf20Sopenharmony_ci	LONG_S	fp, THREAD_REG30(\thread)
288c2ecf20Sopenharmony_ci	.endm
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci	.macro	cpu_restore_nonscratch thread
318c2ecf20Sopenharmony_ci	LONG_L	s0, THREAD_REG16(\thread)
328c2ecf20Sopenharmony_ci	LONG_L	s1, THREAD_REG17(\thread)
338c2ecf20Sopenharmony_ci	LONG_L	s2, THREAD_REG18(\thread)
348c2ecf20Sopenharmony_ci	LONG_L	s3, THREAD_REG19(\thread)
358c2ecf20Sopenharmony_ci	LONG_L	s4, THREAD_REG20(\thread)
368c2ecf20Sopenharmony_ci	LONG_L	s5, THREAD_REG21(\thread)
378c2ecf20Sopenharmony_ci	LONG_L	s6, THREAD_REG22(\thread)
388c2ecf20Sopenharmony_ci	LONG_L	s7, THREAD_REG23(\thread)
398c2ecf20Sopenharmony_ci	LONG_L	sp, THREAD_REG29(\thread)
408c2ecf20Sopenharmony_ci	LONG_L	fp, THREAD_REG30(\thread)
418c2ecf20Sopenharmony_ci	LONG_L	ra, THREAD_REG31(\thread)
428c2ecf20Sopenharmony_ci	.endm
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#endif /* _ASM_ASMMACRO_64_H */
45