| 
									
										
										
										
											2005-09-03 15:54:30 -07:00
										 |  |  | #ifndef _ASM_GENERIC_PAGE_H
 | 
					
						
							|  |  |  | #define _ASM_GENERIC_PAGE_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef __KERNEL__
 | 
					
						
							|  |  |  | #ifndef __ASSEMBLY__
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-06 19:38:01 -08:00
										 |  |  | #include <linux/compiler.h>
 | 
					
						
							| 
									
										
										
										
											2005-09-03 15:54:30 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-06 19:38:01 -08:00
										 |  |  | /* Pure 2^n version of get_order */ | 
					
						
							|  |  |  | static __inline__ __attribute_const__ int get_order(unsigned long size) | 
					
						
							| 
									
										
										
										
											2005-09-03 15:54:30 -07:00
										 |  |  | { | 
					
						
							|  |  |  | 	int order; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-06 19:38:01 -08:00
										 |  |  | 	size = (size - 1) >> (PAGE_SHIFT - 1); | 
					
						
							| 
									
										
										
										
											2005-09-03 15:54:30 -07:00
										 |  |  | 	order = -1; | 
					
						
							|  |  |  | 	do { | 
					
						
							|  |  |  | 		size >>= 1; | 
					
						
							|  |  |  | 		order++; | 
					
						
							|  |  |  | 	} while (size); | 
					
						
							|  |  |  | 	return order; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif	/* __ASSEMBLY__ */
 | 
					
						
							|  |  |  | #endif	/* __KERNEL__ */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif	/* _ASM_GENERIC_PAGE_H */
 |