sn_pio_sync.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved.
  8.  */
  9. #ifndef _ASM_IA64_SN_SN_PIO_WRITE_SYNC_H
  10. #define _ASM_IA64_SN_SN_PIO_WRITE_SYNC_H
  11. #include <linux/config.h>
  12. #ifdef CONFIG_IA64_SGI_SN2
  13. #include <asm/sn/sn_cpuid.h>
  14. #include <asm/sn/sn2/addrs.h>
  15. #include <asm/sn/sn2/shub_mmr.h>
  16. #include <asm/sn/sn2/shub_mmr_t.h>
  17. /*
  18.  * This macro flushes all outstanding PIOs performed by this cpu to the 
  19.  * intended destination SHUB.  This in essence ensures that all PIO's
  20.  * issues by this cpu has landed at it's destination.
  21.  *
  22.  * This macro expects the caller:
  23.  * 1.  The thread is locked.
  24.  * 2.  All prior PIO operations has been fenced with __ia64_mf_a().
  25.  *
  26.  * The expectation is that get_slice() will return either 0 or 2.
  27.  * When we have multi-core cpu's, the expectation is get_slice() will 
  28.  * return either 0,1 or 2,3.
  29.  */
  30. #define SN_PIO_WRITE_SYNC 
  31. volatile unsigned long sn_pio_writes_done; 
  32. do { 
  33. sn_pio_writes_done = (volatile unsigned long) (SH_PIO_WRITE_STATUS_0_WRITES_OK_MASK & HUB_L( (unsigned long *)GLOBAL_MMR_ADDR(get_nasid(), (get_slice() < 2) ? SH_PIO_WRITE_STATUS_0 : SH_PIO_WRITE_STATUS_1 ))); 
  34. } while (!sn_pio_writes_done); 
  35. __ia64_mf_a(); 
  36. }
  37. #else
  38. /*
  39.  * For all ARCHITECTURE type, this is a NOOP.
  40.  */
  41. #define SN_PIO_WRITE_SYNC
  42. #endif
  43. #endif /* _ASM_IA64_SN_SN_PIO_WRITE_SYNC_H */