aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ia64/sn/pio_flush.h
blob: 194348c75c3602bf18d10acc37602eca4ce7b32c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved.
 */


#include <linux/config.h>

#ifndef _ASM_IA64_PIO_FLUSH_H
#define _ASM_IA64_PIO_FLUSH_H

/*
 * This macro flushes all outstanding PIOs performed by this cpu to the 
 * intended destination SHUB.  This in essence ensures that all PIO's
 * issues by this cpu has landed at it's destination.
 *
 * This macro expects the caller:
 *	1.  The thread is locked.
 *	2.  All prior PIO operations has been fenced.
 *
 */

#if defined (CONFIG_IA64_SGI_SN)

#include <asm/sn/pda.h>

#if defined (CONFIG_IA64_SGI_SN2)

#define PIO_FLUSH() \
	{ \
	while ( !((volatile unsigned long) (*pda.pio_write_status_addr)) & 0x8000000000000000) { \
			udelay(5); \
	} \
	__ia64_mf_a(); \
	}

#elif defined (CONFIG_IA64_SGI_SN1)

/*
 * For SN1 we need to first read any local Bedrock's MMR and then poll on the 
 * Synergy MMR.
 */
#define PIO_FLUSH() \
	{ \
	(volatile unsigned long) (*pda.bedrock_rev_id); \
	while (!(volatile unsigned long) (*pda.pio_write_status_addr)) { \
		udelay(5); \
	} \
	__ia64_mf_a(); \
	} 
#endif
#else
/*
 * For all ARCHITECTURE type, this is a NOOP.
 */

#define PIO_FLUSH()

#endif

#endif /* _ASM_IA64_PIO_FLUSH_H */