home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / gdb-4.14-src.lha / gdb-4.14 / gdb / sparclite / sparclite.h < prev   
Encoding:
C/C++ Source or Header  |  1994-02-24  |  701 b   |  19 lines

  1. /* SPARClite defs */
  2.  
  3. /* Macros for reading and writing to arbitrary address spaces.  Note that ASI
  4.    must be a constant (sorry, but the SPARC can only specify ASIs as part of an
  5.    instruction.  */
  6.  
  7. #define read_asi(ASI, LOC, VAL) \
  8.   __asm__ volatile ("lda [%r1]%2,%0" : "=r" (VAL) : "rJ" (LOC), "I" (ASI))
  9.  
  10. #define write_asi(ASI, LOC, VAL) \
  11.   __asm__ volatile ("sta %0,[%r1]%2" : : "r" (VAL), "rJ" (LOC), "I" (ASI));
  12.  
  13. /* Use this when modifying registers that cause memory to be modified.  This
  14.    will cause GCC to reload all values after this point.  */
  15.  
  16. #define write_asi_volatile(ASI, LOC, VAL) \
  17.   __asm__ volatile ("sta %0,[%r1]%2" : : "r" (VAL), "rJ" (LOC), "I" (ASI) \
  18.             : "memory");
  19.