root/include/asm-m68k/system.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. clear_fpu

   1 /*
   2  *  linux/include/asm-m68k/system.h
   3  *
   4  *  Copyright (C) 1991, 1992  Linus Torvalds
   5  *
   6  * This file is subject to the terms and conditions of the GNU General Public
   7  * License.  See the file README.legal in the main directory of this archive
   8  * for more details.
   9  */
  10 
  11 /*
  12  * 680x0 support added by Hamish Macdonald
  13  */
  14 
  15 #ifndef _M68K_SYSTEM_H
  16 #define _M68K_SYSTEM_H
  17 
  18 #include <linux/autoconf.h> /* get configuration macros */
  19 
  20 #if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) && !defined(CONFIG_MAC)
  21 /* block out HSYNC on the atari */
  22 #define sti() __asm__ __volatile__ ("andiw #0xfbff,sr": : : "memory")
  23 #else /* portable version */
  24 #define sti() __asm__ __volatile__ ("andiw #0xf8ff,sr": : : "memory")
  25 #endif /* machine compilation types */ 
  26 #define cli() __asm__ __volatile__ ("oriw  #0x0700,sr": : : "memory")
  27 #define nop() __asm__ __volatile__ ("nop"::)
  28 
  29 #define save_flags(x) \
  30 __asm__ __volatile__("movew sr,%0":"=d" (x) : /* no input */ :"memory")
  31 
  32 #define restore_flags(x) \
  33 __asm__ __volatile__("movew %0,sr": /* no outputs */ :"d" (x) : "memory")
  34 
  35 #define iret() __asm__ __volatile__ ("rte": : :"memory", "sp", "cc")
  36 
  37 #define move_to_user_mode() \
  38     __asm__ __volatile__ ("movel sp,usp\n\t"     /* setup user sp       */ \
  39                           "movec %0,msp\n\t"     /* setup kernel sp     */ \
  40                           "andiw #0xdfff,sr"     /* return to user mode */ \
  41                           : /* no output */                                \
  42                           : "r" (current->kernel_stack_page + PAGE_SIZE)   \
  43                           : "memory", "sp")
  44 
  45 static inline void clear_fpu(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
  46         unsigned long nilstate = 0;
  47         __asm__ __volatile__ ("frestore %0@" : : "a" (&nilstate));
  48 }
  49 
  50 #define halt() \
  51         __asm__ __volatile__ ("halt")
  52 
  53 #endif /* _M68K_SYSTEM_H */

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