| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #ifndef _ASM_IA64_PERCPU_H
 | 
					
						
							|  |  |  | #define _ASM_IA64_PERCPU_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (C) 2002-2003 Hewlett-Packard Co | 
					
						
							|  |  |  |  *	David Mosberger-Tang <davidm@hpl.hp.com> | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PERCPU_ENOUGH_ROOM PERCPU_PAGE_SIZE
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef __ASSEMBLY__
 | 
					
						
							| 
									
										
										
										
											2009-10-29 22:34:15 +09:00
										 |  |  | # define THIS_CPU(var)	(var)  /* use this to mark accesses to per-CPU variables... */
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #else /* !__ASSEMBLY__ */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/threads.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-30 23:27:58 +01:00
										 |  |  | #ifdef CONFIG_SMP
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #ifdef HAVE_MODEL_SMALL_ATTRIBUTE
 | 
					
						
							| 
									
										
										
										
											2008-01-30 13:32:52 +01:00
										 |  |  | # define PER_CPU_ATTRIBUTES	__attribute__((__model__ (__small__)))
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-30 23:27:58 +01:00
										 |  |  | #define __my_cpu_offset	__ia64_per_cpu_var(local_per_cpu_offset)
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | extern void *per_cpu_init(void); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #else /* ! SMP */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define per_cpu_init()				(__phys_per_cpu_start)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif	/* SMP */
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-20 01:03:43 +01:00
										 |  |  | #define PER_CPU_BASE_SECTION ".data..percpu"
 | 
					
						
							| 
									
										
										
										
											2009-02-08 09:58:38 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Be extremely careful when taking the address of this variable!  Due to virtual | 
					
						
							|  |  |  |  * remapping, it is different from the canonical address returned by __get_cpu_var(var)! | 
					
						
							|  |  |  |  * On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly | 
					
						
							|  |  |  |  * more efficient. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2010-05-12 12:10:39 +02:00
										 |  |  | #define __ia64_per_cpu_var(var) (*({					\
 | 
					
						
							|  |  |  | 	__verify_pcpu_ptr(&(var));					\ | 
					
						
							|  |  |  | 	((typeof(var) __kernel __force *)&(var));			\ | 
					
						
							|  |  |  | })) | 
					
						
							| 
									
										
										
										
											2008-01-30 23:27:58 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <asm-generic/percpu.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ | 
					
						
							|  |  |  | DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif /* !__ASSEMBLY__ */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* _ASM_IA64_PERCPU_H */
 |