root/include/asm-mips/system.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * include/asm-mips/system.h
   3  *
   4  * This file is subject to the terms and conditions of the GNU General Public
   5  * License.  See the file "COPYING" in the main directory of this archive
   6  * for more details.
   7  *
   8  * Copyright (C) 1994 by Ralf Baechle
   9  */
  10 
  11 #ifndef _ASM_MIPS_SYSTEM_H_
  12 #define _ASM_MIPS_SYSTEM_H_
  13 
  14 #include <linux/segment.h>
  15 #include <mips/mipsregs.h>
  16 
  17 /*
  18  * move_to_user_mode() doesn't switch to user mode on the mips, since
  19  * that would run us into problems: The kernel is located at virtual
  20  * address 0x80000000. If we now would switch over to user mode, we
  21  * we would immediately get an address error exception.
  22  * Anyway - we don't have problems with a task running in kernel mode,
  23  * as long it's code is foolproof.
  24  */
  25 #define move_to_user_mode()
  26 
  27 #define sti() \
  28 __asm__ __volatile__( \
  29         "mfc0\t$1,"STR(CP0_STATUS)"\n\t" \
  30         "ori\t$1,$1,1\n\t" \
  31         "mtc0\t$1,"STR(CP0_STATUS)"\n\t" \
  32         : /* no outputs */ \
  33         : /* no inputs */ \
  34         : "$1","memory")
  35 
  36 #define cli() \
  37 __asm__ __volatile__( \
  38         "mfc0\t$1,"STR(CP0_STATUS)"\n\t" \
  39         "srl\t$1,$1,1\n\t" \
  40         "sll\t$1,$1,1\n\t" \
  41         "mtc0\t$1,"STR(CP0_STATUS)"\n\t" \
  42         : /* no outputs */ \
  43         : /* no inputs */ \
  44         : "$1","memory")
  45 
  46 #define nop() __asm__ __volatile__ ("nop")
  47 
  48 #define save_flags(x) \
  49 __asm__ __volatile__( \
  50         ".set\tnoreorder\n\t" \
  51         ".set\tnoat\n\t" \
  52         "mfc0\t%0,$12\n\t" \
  53         ".set\tat\n\t" \
  54         ".set\treorder" \
  55         : "=r" (x) \
  56         : /* no inputs */ \
  57         : "memory")
  58 
  59 #define restore_flags(x) \
  60 __asm__ __volatile__( \
  61         ".set\tnoreorder\n\t" \
  62         ".set\tnoat\n\t" \
  63         "mtc0\t%0,$12\n\t" \
  64         ".set\tat\n\t" \
  65         ".set\treorder" \
  66         : /* no output */ \
  67         : "r" (x) \
  68         : "memory")
  69 
  70 #endif /* _ASM_MIPS_SYSTEM_H_ */

/* [previous][next][first][last][top][bottom][index][help] */