| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #ifndef __MMU_H
 | 
					
						
							|  |  |  | #define __MMU_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-30 09:40:55 +02:00
										 |  |  | #include <linux/errno.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-09 18:24:35 +01:00
										 |  |  | typedef struct { | 
					
						
							| 
									
										
										
										
											2010-08-24 09:26:21 +02:00
										 |  |  | 	atomic_t attach_count; | 
					
						
							|  |  |  | 	unsigned int flush_mm; | 
					
						
							| 
									
										
										
										
											2009-09-11 10:28:57 +02:00
										 |  |  | 	spinlock_t list_lock; | 
					
						
							| 
									
										
										
										
											2008-02-09 18:24:35 +01:00
										 |  |  | 	struct list_head pgtable_list; | 
					
						
							| 
									
										
										
										
											2011-07-24 10:48:20 +02:00
										 |  |  | 	struct list_head gmap_list; | 
					
						
							| 
									
										
										
										
											2008-02-09 18:24:35 +01:00
										 |  |  | 	unsigned long asce_bits; | 
					
						
							| 
									
										
										
										
											2008-02-09 18:24:37 +01:00
										 |  |  | 	unsigned long asce_limit; | 
					
						
							| 
									
										
										
										
											2008-12-25 13:38:36 +01:00
										 |  |  | 	unsigned long vdso_base; | 
					
						
							| 
									
										
										
										
											2011-05-23 10:24:40 +02:00
										 |  |  | 	/* Cloned contexts will be created with extended page tables. */ | 
					
						
							|  |  |  | 	unsigned int alloc_pgste:1; | 
					
						
							|  |  |  | 	/* The mmu context has extended page tables. */ | 
					
						
							|  |  |  | 	unsigned int has_pgste:1; | 
					
						
							| 
									
										
										
										
											2008-02-09 18:24:35 +01:00
										 |  |  | } mm_context_t; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-09 17:18:28 -07:00
										 |  |  | #define INIT_MM_CONTEXT(name)						      \
 | 
					
						
							|  |  |  | 	.context.list_lock    = __SPIN_LOCK_UNLOCKED(name.context.list_lock), \ | 
					
						
							| 
									
										
										
										
											2011-07-24 10:48:20 +02:00
										 |  |  | 	.context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list),    \ | 
					
						
							|  |  |  | 	.context.gmap_list = LIST_HEAD_INIT(name.context.gmap_list), | 
					
						
							| 
									
										
										
										
											2010-08-09 17:18:28 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-28 18:30:02 +01:00
										 |  |  | static inline int tprot(unsigned long addr) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	int rc = -EFAULT; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	asm volatile( | 
					
						
							|  |  |  | 		"	tprot	0(%1),0\n" | 
					
						
							|  |  |  | 		"0:	ipm	%0\n" | 
					
						
							|  |  |  | 		"	srl	%0,28\n" | 
					
						
							|  |  |  | 		"1:\n" | 
					
						
							|  |  |  | 		EX_TABLE(0b,1b) | 
					
						
							|  |  |  | 		: "+d" (rc) : "a" (addr) : "cc"); | 
					
						
							|  |  |  | 	return rc; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif
 |