forked from mirrors/linux
		
	xen: add variable hypercall caller
Allow non-constant hypercall to be called, for privcmd. [ Impact: make arbitrary hypercalls; needed for privcmd ] Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
This commit is contained in:
		
							parent
							
								
									eba3ff8b99
								
							
						
					
					
						commit
						1246ae0bb9
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
					@ -200,6 +200,23 @@ extern struct { char _entry[32]; } hypercall_page[];
 | 
				
			||||||
	(type)__res;							\
 | 
						(type)__res;							\
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static inline long
 | 
				
			||||||
 | 
					privcmd_call(unsigned call,
 | 
				
			||||||
 | 
						     unsigned long a1, unsigned long a2,
 | 
				
			||||||
 | 
						     unsigned long a3, unsigned long a4,
 | 
				
			||||||
 | 
						     unsigned long a5)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						__HYPERCALL_DECLS;
 | 
				
			||||||
 | 
						__HYPERCALL_5ARG(a1, a2, a3, a4, a5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						asm volatile("call *%[call]"
 | 
				
			||||||
 | 
							     : __HYPERCALL_5PARAM
 | 
				
			||||||
 | 
							     : [call] "a" (&hypercall_page[call])
 | 
				
			||||||
 | 
							     : __HYPERCALL_CLOBBER5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return (long)__res;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline int
 | 
					static inline int
 | 
				
			||||||
HYPERVISOR_set_trap_table(struct trap_info *table)
 | 
					HYPERVISOR_set_trap_table(struct trap_info *table)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue