From 1513ff9b7899ab588401c89db0e99903dbf5f886 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 28 Nov 1994 11:59:19 +0000 Subject: Import of Linus's Linux 1.1.68 --- include/asm-mips/system.h | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 include/asm-mips/system.h (limited to 'include/asm-mips/system.h') diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h new file mode 100644 index 000000000..5e0dbfe3c --- /dev/null +++ b/include/asm-mips/system.h @@ -0,0 +1,70 @@ +/* + * include/asm-mips/system.h + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1994 by Ralf Baechle + */ + +#ifndef _ASM_MIPS_SYSTEM_H_ +#define _ASM_MIPS_SYSTEM_H_ + +#include +#include + +/* + * move_to_user_mode() doesn't switch to user mode on the mips, since + * that would run us into problems: The kernel is located at virtual + * address 0x80000000. If we now would switch over to user mode, we + * we would immediately get an address error exception. + * Anyway - we don't have problems with a task running in kernel mode, + * as long it's code is foolproof. + */ +#define move_to_user_mode() + +#define sti() \ +__asm__ __volatile__( \ + "mfc0\t$1,"STR(CP0_STATUS)"\n\t" \ + "ori\t$1,$1,1\n\t" \ + "mtc0\t$1,"STR(CP0_STATUS)"\n\t" \ + : /* no outputs */ \ + : /* no inputs */ \ + : "$1","memory") + +#define cli() \ +__asm__ __volatile__( \ + "mfc0\t$1,"STR(CP0_STATUS)"\n\t" \ + "srl\t$1,$1,1\n\t" \ + "sll\t$1,$1,1\n\t" \ + "mtc0\t$1,"STR(CP0_STATUS)"\n\t" \ + : /* no outputs */ \ + : /* no inputs */ \ + : "$1","memory") + +#define nop() __asm__ __volatile__ ("nop") + +#define save_flags(x) \ +__asm__ __volatile__( \ + ".set\tnoreorder\n\t" \ + ".set\tnoat\n\t" \ + "mfc0\t%0,$12\n\t" \ + ".set\tat\n\t" \ + ".set\treorder" \ + : "=r" (x) \ + : /* no inputs */ \ + : "memory") + +#define restore_flags(x) \ +__asm__ __volatile__( \ + ".set\tnoreorder\n\t" \ + ".set\tnoat\n\t" \ + "mtc0\t%0,$12\n\t" \ + ".set\tat\n\t" \ + ".set\treorder" \ + : /* no output */ \ + : "r" (x) \ + : "memory") + +#endif /* _ASM_MIPS_SYSTEM_H_ */ -- cgit v1.2.3