home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / linux / atari / source / source.lzh / atari-linux-0.01pl3 / include / asm / system.h < prev   
Encoding:
C/C++ Source or Header  |  1994-06-11  |  1.4 KB  |  44 lines

  1. /*
  2.  *  linux/include/asm/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 _ASM_SYSTEM_H
  16. #define _ASM_SYSTEM_H
  17.  
  18. #define sti() __asm__ __volatile__ ("andiw #0xfbff,sr": : : "memory")  /* For atari we dont want H/Vsync */
  19. #define cli() __asm__ __volatile__ ("oriw  #0x0700,sr": : : "memory")
  20. #define nop() __asm__ __volatile__ ("nop"::)
  21.  
  22. #define save_flags(x) \
  23. __asm__ __volatile__("movew sr,%0":"=d" (x) : /* no input */ :"memory")
  24.  
  25. #define restore_flags(x) \
  26. __asm__ __volatile__("movew %0,sr": /* no outputs */ :"d" (x) : "memory")
  27.  
  28. #define iret() __asm__ __volatile__ ("rte": : :"memory", "sp", "cc")
  29.  
  30. #define move_to_user_mode() \
  31.     __asm__ __volatile__ ("movel sp,usp\n\t"     /* setup user sp       */ \
  32.               "movec %0,msp\n\t"     /* setup kernel sp     */ \
  33.               "andiw #0xdfff,sr"     /* return to user mode */ \
  34.               : /* no output */                                \
  35.               : "r" (current->kernel_stack_page + PAGE_SIZE)   \
  36.               : "memory", "sp")
  37.  
  38. static inline void clear_fpu(void) {
  39.     unsigned long nilstate = 0;
  40.     __asm__ __volatile__ ("frestore %0@" : : "a" (&nilstate));
  41. }
  42.  
  43. #endif /* _ASM_SYSTEM_H */
  44.