| 
									
										
										
										
											2005-06-21 17:15:03 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 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. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2008-07-29 22:34:11 -07:00
										 |  |  |  * Copyright (c) 2001-2008 Silicon Graphics, Inc.  All rights reserved. | 
					
						
							| 
									
										
										
										
											2005-06-21 17:15:03 -07:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _ASM_IA64_SN_MSPEC_H
 | 
					
						
							|  |  |  | #define _ASM_IA64_SN_MSPEC_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define FETCHOP_VAR_SIZE 64 /* 64 byte per fetchop variable */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define FETCHOP_LOAD		0
 | 
					
						
							|  |  |  | #define FETCHOP_INCREMENT	8
 | 
					
						
							|  |  |  | #define FETCHOP_DECREMENT	16
 | 
					
						
							|  |  |  | #define FETCHOP_CLEAR		24
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define FETCHOP_STORE		0
 | 
					
						
							|  |  |  | #define FETCHOP_AND		24
 | 
					
						
							|  |  |  | #define FETCHOP_OR		32
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define FETCHOP_CLEAR_CACHE	56
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define FETCHOP_LOAD_OP(addr, op) ( \
 | 
					
						
							|  |  |  |          *(volatile long *)((char*) (addr) + (op))) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define FETCHOP_STORE_OP(addr, op, x) ( \
 | 
					
						
							|  |  |  |          *(volatile long *)((char*) (addr) + (op)) = (long) (x)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef __KERNEL__
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2008-07-29 22:34:11 -07:00
										 |  |  |  * Each Atomic Memory Operation (amo, formerly known as fetchop) | 
					
						
							| 
									
										
										
										
											2005-06-21 17:15:03 -07:00
										 |  |  |  * variable is 64 bytes long.  The first 8 bytes are used.  The | 
					
						
							|  |  |  |  * remaining 56 bytes are unaddressable due to the operation taking | 
					
						
							|  |  |  |  * that portion of the address. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2008-07-29 22:34:11 -07:00
										 |  |  |  * NOTE: The amo structure _MUST_ be placed in either the first or second | 
					
						
							|  |  |  |  * half of the cache line.  The cache line _MUST NOT_ be used for anything | 
					
						
							|  |  |  |  * other than additional amo entries.  This is because there are two | 
					
						
							| 
									
										
										
										
											2005-06-21 17:15:03 -07:00
										 |  |  |  * addresses which reference the same physical cache line.  One will | 
					
						
							|  |  |  |  * be a cached entry with the memory type bits all set.  This address | 
					
						
							| 
									
										
										
										
											2008-07-29 22:34:11 -07:00
										 |  |  |  * may be loaded into processor cache.  The amo will be referenced | 
					
						
							| 
									
										
										
										
											2005-06-21 17:15:03 -07:00
										 |  |  |  * uncached via the memory special memory type.  If any portion of the | 
					
						
							|  |  |  |  * cached cache-line is modified, when that line is flushed, it will | 
					
						
							|  |  |  |  * overwrite the uncached value in physical memory and lead to | 
					
						
							|  |  |  |  * inconsistency. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2008-07-29 22:34:11 -07:00
										 |  |  | struct amo { | 
					
						
							| 
									
										
										
										
											2005-06-21 17:15:03 -07:00
										 |  |  |         u64 variable; | 
					
						
							|  |  |  |         u64 unused[7]; | 
					
						
							| 
									
										
										
										
											2008-07-29 22:34:11 -07:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2005-06-21 17:15:03 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* __KERNEL__ */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* _ASM_IA64_SN_MSPEC_H */
 |