ia64/xen-unstable

changeset 10686:e5c7350b8cbb

[IA64] clean up pal_emul.c compiler warnings

This patch cleans up some compiler warnings in pal_emul.c. The
problem was that a struct ia64_pal_retval was being used to return
the results from emulated PAL calls, but not all of the fields
were being initialized. Given that fields were not initialized,
I was also thinking that there might be a remote chance of data
leaking between vcpu's -- but I haven't convinced myself that
that could actually happen.

Signed-off-by: Al Stone <ahs3@fc.hp.com>
[whitespace and line wrapping cleanup throughout file]
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Mon Jul 10 13:53:17 2006 -0600 (2006-07-10)
parents 8ad37880564d
children 7538ae7ea365
files xen/arch/ia64/vmx/pal_emul.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/pal_emul.c	Mon Jul 10 13:12:41 2006 -0600
     1.2 +++ b/xen/arch/ia64/vmx/pal_emul.c	Mon Jul 10 13:53:17 2006 -0600
     1.3 @@ -27,17 +27,36 @@
     1.4  #include <xen/hypercall.h>
     1.5  #include <public/sched.h>
     1.6  
     1.7 +/*
     1.8 + * Handy macros to make sure that the PAL return values start out
     1.9 + * as something meaningful.
    1.10 + */
    1.11 +#define INIT_PAL_STATUS_UNIMPLEMENTED(x)		\
    1.12 +	{						\
    1.13 +		x.status = PAL_STATUS_UNIMPLEMENTED;	\
    1.14 +		x.v0 = 0;				\
    1.15 +		x.v1 = 0;				\
    1.16 +		x.v2 = 0;				\
    1.17 +	}
    1.18 +
    1.19 +#define INIT_PAL_STATUS_SUCCESS(x)			\
    1.20 +	{						\
    1.21 +	       	x.status = PAL_STATUS_SUCCESS;		\
    1.22 +		x.v0 = 0;				\
    1.23 +		x.v1 = 0;				\
    1.24 +		x.v2 = 0;				\
    1.25 +	}
    1.26 +
    1.27  static void
    1.28 -get_pal_parameters (VCPU *vcpu, UINT64 *gr29,
    1.29 -			UINT64 *gr30, UINT64 *gr31) {
    1.30 +get_pal_parameters(VCPU *vcpu, UINT64 *gr29, UINT64 *gr30, UINT64 *gr31) {
    1.31  
    1.32 -  	vcpu_get_gr_nat(vcpu,29,gr29);
    1.33 -  	vcpu_get_gr_nat(vcpu,30,gr30); 
    1.34 -  	vcpu_get_gr_nat(vcpu,31,gr31);
    1.35 +	vcpu_get_gr_nat(vcpu,29,gr29);
    1.36 +	vcpu_get_gr_nat(vcpu,30,gr30); 
    1.37 +	vcpu_get_gr_nat(vcpu,31,gr31);
    1.38  }
    1.39  
    1.40  static void
    1.41 -set_pal_result (VCPU *vcpu,struct ia64_pal_retval result) {
    1.42 +set_pal_result(VCPU *vcpu,struct ia64_pal_retval result) {
    1.43  
    1.44  	vcpu_set_gr(vcpu,8, result.status,0);
    1.45  	vcpu_set_gr(vcpu,9, result.v0,0);
    1.46 @@ -46,58 +65,60 @@ set_pal_result (VCPU *vcpu,struct ia64_p
    1.47  }
    1.48  
    1.49  static void
    1.50 -set_sal_result (VCPU *vcpu,struct sal_ret_values result) {
    1.51 +set_sal_result(VCPU *vcpu,struct sal_ret_values result) {
    1.52  
    1.53  	vcpu_set_gr(vcpu,8, result.r8,0);
    1.54  	vcpu_set_gr(vcpu,9, result.r9,0);
    1.55  	vcpu_set_gr(vcpu,10, result.r10,0);
    1.56  	vcpu_set_gr(vcpu,11, result.r11,0);
    1.57  }
    1.58 +
    1.59  static struct ia64_pal_retval
    1.60 -pal_cache_flush (VCPU *vcpu) {
    1.61 +pal_cache_flush(VCPU *vcpu) {
    1.62  	UINT64 gr28,gr29, gr30, gr31;
    1.63  	struct ia64_pal_retval result;
    1.64  
    1.65 -	get_pal_parameters (vcpu, &gr29, &gr30, &gr31);
    1.66 -	vcpu_get_gr_nat(vcpu,28,&gr28);
    1.67 +	get_pal_parameters(vcpu, &gr29, &gr30, &gr31);
    1.68 +	vcpu_get_gr_nat(vcpu, 28, &gr28);
    1.69  
    1.70  	/* Always call Host Pal in int=1 */
    1.71 -	gr30 = gr30 &(~(0x2UL));
    1.72 +	gr30 = gr30 & ~0x2UL;
    1.73  
    1.74 -	/* call Host PAL cache flush */
    1.75 -	result=ia64_pal_call_static(gr28 ,gr29, gr30,gr31,1);  // Clear psr.ic when call PAL_CACHE_FLUSH
    1.76 +	/*
    1.77 +	 * Call Host PAL cache flush
    1.78 +	 * Clear psr.ic when call PAL_CACHE_FLUSH
    1.79 +	 */
    1.80 +	result = ia64_pal_call_static(gr28 ,gr29, gr30, gr31, 1);
    1.81  
    1.82  	/* If host PAL call is interrupted, then loop to complete it */
    1.83 -//	while (result.status == 1) {
    1.84 -//		ia64_pal_call_static(gr28 ,gr29, gr30, 
    1.85 -//				result.v1,1LL);
    1.86 -//	}
    1.87 -	if(result.status != 0) {
    1.88 -        	panic_domain(vcpu_regs(vcpu),"PAL_CACHE_FLUSH ERROR, status %ld", result.status);
    1.89 -	}
    1.90 +//	while (result.status == 1)
    1.91 +//		ia64_pal_call_static(gr28 ,gr29, gr30, result.v1, 1LL);
    1.92 +//
    1.93 +	if (result.status != 0)
    1.94 +		panic_domain(vcpu_regs(vcpu), "PAL_CACHE_FLUSH ERROR, "
    1.95 +		             "status %ld", result.status);
    1.96  
    1.97  	return result;
    1.98  }
    1.99  
   1.100  static struct ia64_pal_retval
   1.101 -pal_vm_tr_read (VCPU *vcpu ) {
   1.102 +pal_vm_tr_read(VCPU *vcpu) {
   1.103  	struct ia64_pal_retval result;
   1.104  
   1.105 -	result.status= -1; //unimplemented
   1.106 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.107  
   1.108  	return result;
   1.109  }
   1.110  
   1.111 -
   1.112  static struct ia64_pal_retval
   1.113 -pal_prefetch_visibility (VCPU *vcpu)  {
   1.114 +pal_prefetch_visibility(VCPU *vcpu) {
   1.115  	/* Due to current MM virtualization algorithm,
   1.116  	 * We do not allow guest to change mapping attribute.
   1.117  	 * Thus we will not support PAL_PREFETCH_VISIBILITY
   1.118  	 */
   1.119  	struct ia64_pal_retval result;
   1.120  
   1.121 -	result.status= -1; //unimplemented
   1.122 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.123  
   1.124  	return result;
   1.125  }
   1.126 @@ -106,290 +127,315 @@ static struct ia64_pal_retval
   1.127  pal_platform_addr(VCPU *vcpu) {
   1.128  	struct ia64_pal_retval result;
   1.129  
   1.130 -	result.status= 0; //success
   1.131 -
   1.132 -	return result;
   1.133 -}
   1.134 -
   1.135 -static struct ia64_pal_retval
   1.136 -pal_halt (VCPU *vcpu) {
   1.137 -	//bugbug: to be implement. 
   1.138 -	struct ia64_pal_retval result;
   1.139 -
   1.140 -	result.status= -1; //unimplemented
   1.141 -
   1.142 -	return result;
   1.143 -}
   1.144 -
   1.145 -
   1.146 -static struct ia64_pal_retval
   1.147 -pal_halt_light (VCPU *vcpu) {
   1.148 -	struct ia64_pal_retval result;
   1.149 -	
   1.150 -	if(SPURIOUS_VECTOR==vmx_check_pending_irq(vcpu))
   1.151 -		do_sched_op_compat(SCHEDOP_block,0);
   1.152 -	    
   1.153 -	result.status= 0;
   1.154 -	return result;
   1.155 -}
   1.156 -
   1.157 -static struct ia64_pal_retval
   1.158 -pal_cache_read (VCPU *vcpu) {
   1.159 -	struct ia64_pal_retval result;
   1.160 -
   1.161 -	result.status= -1; //unimplemented
   1.162 -
   1.163 -	return result;
   1.164 -}
   1.165 -
   1.166 -static struct ia64_pal_retval
   1.167 -pal_cache_write (VCPU *vcpu) {
   1.168 -	struct ia64_pal_retval result;
   1.169 -
   1.170 -	result.status= -1; //unimplemented
   1.171 +	INIT_PAL_STATUS_SUCCESS(result);
   1.172  
   1.173  	return result;
   1.174  }
   1.175  
   1.176  static struct ia64_pal_retval
   1.177 -pal_bus_get_features(VCPU *vcpu){
   1.178 -	struct ia64_pal_retval result;
   1.179 -
   1.180 -	result.status= -1; //unimplemented
   1.181 -	return result;
   1.182 -}
   1.183 -
   1.184 -static struct ia64_pal_retval
   1.185 -pal_cache_summary(VCPU *vcpu){
   1.186 -	struct ia64_pal_retval result;
   1.187 -
   1.188 -	result.status= -1; //unimplemented
   1.189 -	return result;
   1.190 -}
   1.191 -
   1.192 -static struct ia64_pal_retval
   1.193 -pal_cache_init(VCPU *vcpu){
   1.194 -	struct ia64_pal_retval result;
   1.195 -	result.status=0;
   1.196 -	return result;
   1.197 -}
   1.198 -
   1.199 -static struct ia64_pal_retval
   1.200 -pal_cache_info(VCPU *vcpu){
   1.201 +pal_halt(VCPU *vcpu) {
   1.202 +	//bugbug: to be implement. 
   1.203  	struct ia64_pal_retval result;
   1.204  
   1.205 -	result.status= -1; //unimplemented
   1.206 -	return result;
   1.207 -}
   1.208 -
   1.209 -static struct ia64_pal_retval
   1.210 -pal_cache_prot_info(VCPU *vcpu){
   1.211 -	struct ia64_pal_retval result;
   1.212 -
   1.213 -	result.status= -1; //unimplemented
   1.214 -	return result;
   1.215 -}
   1.216 -
   1.217 -static struct ia64_pal_retval
   1.218 -pal_mem_attrib(VCPU *vcpu){
   1.219 -	struct ia64_pal_retval result;
   1.220 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.221  
   1.222 -	result.status= -1; //unimplemented
   1.223 -	return result;
   1.224 -}
   1.225 -
   1.226 -static struct ia64_pal_retval
   1.227 -pal_debug_info(VCPU *vcpu){
   1.228 -	struct ia64_pal_retval result;
   1.229 -
   1.230 -	result.status= -1; //unimplemented
   1.231 -	return result;
   1.232 -}
   1.233 -
   1.234 -static struct ia64_pal_retval
   1.235 -pal_fixed_addr(VCPU *vcpu){
   1.236 -	struct ia64_pal_retval result;
   1.237 -
   1.238 -	result.status= -1; //unimplemented
   1.239  	return result;
   1.240  }
   1.241  
   1.242  static struct ia64_pal_retval
   1.243 -pal_freq_base(VCPU *vcpu){
   1.244 -    struct ia64_pal_retval result;
   1.245 -    struct ia64_sal_retval isrv;
   1.246 -
   1.247 -    PAL_CALL(result,PAL_FREQ_BASE, 0, 0, 0);
   1.248 -    if(result.v0 == 0){ //PAL_FREQ_BASE may not be implemented in some platforms, call SAL instead.
   1.249 -        SAL_CALL(isrv, SAL_FREQ_BASE, 
   1.250 -                SAL_FREQ_BASE_PLATFORM, 0, 0, 0, 0, 0, 0);
   1.251 -        result.status = isrv.status;
   1.252 -        result.v0 = isrv.v0;
   1.253 -        result.v1 = result.v2 =0;
   1.254 -    }
   1.255 -    return result;
   1.256 -}
   1.257 +pal_halt_light(VCPU *vcpu) {
   1.258 +	struct ia64_pal_retval result;
   1.259 +	
   1.260 +	if (SPURIOUS_VECTOR == vmx_check_pending_irq(vcpu))
   1.261 +		do_sched_op_compat(SCHEDOP_block, 0);
   1.262 +	    
   1.263 +	INIT_PAL_STATUS_SUCCESS(result);
   1.264  
   1.265 -static struct ia64_pal_retval
   1.266 -pal_freq_ratios(VCPU *vcpu){
   1.267 -    struct ia64_pal_retval result;
   1.268 -
   1.269 -    PAL_CALL(result,PAL_FREQ_RATIOS, 0, 0, 0);
   1.270 -    return result;
   1.271 -}
   1.272 -
   1.273 -static struct ia64_pal_retval
   1.274 -pal_halt_info(VCPU *vcpu){
   1.275 -	struct ia64_pal_retval result;
   1.276 -
   1.277 -	result.status= -1; //unimplemented
   1.278 -	return result;
   1.279 -}
   1.280 -
   1.281 -static struct ia64_pal_retval
   1.282 -pal_logical_to_physica(VCPU *vcpu){
   1.283 -	struct ia64_pal_retval result;
   1.284 -
   1.285 -	result.status= -1; //unimplemented
   1.286  	return result;
   1.287  }
   1.288  
   1.289  static struct ia64_pal_retval
   1.290 -pal_perf_mon_info(VCPU *vcpu){
   1.291 +pal_cache_read(VCPU *vcpu) {
   1.292  	struct ia64_pal_retval result;
   1.293  
   1.294 -	result.status= -1; //unimplemented
   1.295 -	return result;
   1.296 -}
   1.297 -
   1.298 -static struct ia64_pal_retval
   1.299 -pal_proc_get_features(VCPU *vcpu){
   1.300 -	struct ia64_pal_retval result;
   1.301 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.302  
   1.303 -	result.status= -1; //unimplemented
   1.304 -	return result;
   1.305 -}
   1.306 -
   1.307 -static struct ia64_pal_retval
   1.308 -pal_ptce_info(VCPU *vcpu){
   1.309 -	struct ia64_pal_retval result;
   1.310 -
   1.311 -	result.status= -1; //unimplemented
   1.312  	return result;
   1.313  }
   1.314  
   1.315  static struct ia64_pal_retval
   1.316 -pal_register_info(VCPU *vcpu){
   1.317 +pal_cache_write(VCPU *vcpu) {
   1.318  	struct ia64_pal_retval result;
   1.319  
   1.320 -	result.status= -1; //unimplemented
   1.321 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.322 +
   1.323  	return result;
   1.324  }
   1.325  
   1.326  static struct ia64_pal_retval
   1.327 -pal_rse_info(VCPU *vcpu){
   1.328 +pal_bus_get_features(VCPU *vcpu) {
   1.329  	struct ia64_pal_retval result;
   1.330  
   1.331 -	result.status= -1; //unimplemented
   1.332 -	return result;
   1.333 -}
   1.334 -static struct ia64_pal_retval
   1.335 -pal_test_info(VCPU *vcpu){
   1.336 -	struct ia64_pal_retval result;
   1.337 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.338  
   1.339 -	result.status= -1; //unimplemented
   1.340  	return result;
   1.341  }
   1.342  
   1.343  static struct ia64_pal_retval
   1.344 -pal_vm_summary(VCPU *vcpu){
   1.345 +pal_cache_summary(VCPU *vcpu) {
   1.346 +	struct ia64_pal_retval result;
   1.347 +
   1.348 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.349 +
   1.350 +	return result;
   1.351 +}
   1.352 +
   1.353 +static struct ia64_pal_retval
   1.354 +pal_cache_init(VCPU *vcpu) {
   1.355 +	struct ia64_pal_retval result;
   1.356 +
   1.357 +	INIT_PAL_STATUS_SUCCESS(result);
   1.358 +
   1.359 +	return result;
   1.360 +}
   1.361 +
   1.362 +static struct ia64_pal_retval
   1.363 +pal_cache_info(VCPU *vcpu) {
   1.364 +	struct ia64_pal_retval result;
   1.365 +
   1.366 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.367 +
   1.368 +	return result;
   1.369 +}
   1.370 +
   1.371 +static struct ia64_pal_retval
   1.372 +pal_cache_prot_info(VCPU *vcpu) {
   1.373 +	struct ia64_pal_retval result;
   1.374 +
   1.375 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.376 +
   1.377 +	return result;
   1.378 +}
   1.379 +
   1.380 +static struct ia64_pal_retval
   1.381 +pal_mem_attrib(VCPU *vcpu) {
   1.382 +	struct ia64_pal_retval result;
   1.383 +
   1.384 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.385 +
   1.386 +	return result;
   1.387 +}
   1.388 +
   1.389 +static struct ia64_pal_retval
   1.390 +pal_debug_info(VCPU *vcpu) {
   1.391 +	struct ia64_pal_retval result;
   1.392 +
   1.393 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.394 +
   1.395 +	return result;
   1.396 +}
   1.397 +
   1.398 +static struct ia64_pal_retval
   1.399 +pal_fixed_addr(VCPU *vcpu) {
   1.400 +	struct ia64_pal_retval result;
   1.401 +
   1.402 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.403 +
   1.404 +	return result;
   1.405 +}
   1.406 +
   1.407 +static struct ia64_pal_retval
   1.408 +pal_freq_base(VCPU *vcpu) {
   1.409 +	struct ia64_pal_retval result;
   1.410 +	struct ia64_sal_retval isrv;
   1.411 +
   1.412 +	PAL_CALL(result,PAL_FREQ_BASE, 0, 0, 0);
   1.413 +	/*
   1.414 +	 * PAL_FREQ_BASE may not be implemented in some platforms,
   1.415 +	 * call SAL instead.
   1.416 +	 */
   1.417 +	if (result.v0 == 0) {
   1.418 +		SAL_CALL(isrv, SAL_FREQ_BASE, 
   1.419 +		         SAL_FREQ_BASE_PLATFORM, 0, 0, 0, 0, 0, 0);
   1.420 +		result.status = isrv.status;
   1.421 +		result.v0 = isrv.v0;
   1.422 +		result.v1 = result.v2 = 0;
   1.423 +	}
   1.424 +	return result;
   1.425 +}
   1.426 +
   1.427 +static struct ia64_pal_retval
   1.428 +pal_freq_ratios(VCPU *vcpu) {
   1.429 +	struct ia64_pal_retval result;
   1.430 +
   1.431 +	PAL_CALL(result, PAL_FREQ_RATIOS, 0, 0, 0);
   1.432 +	return result;
   1.433 +}
   1.434 +
   1.435 +static struct ia64_pal_retval
   1.436 +pal_halt_info(VCPU *vcpu) {
   1.437 +	struct ia64_pal_retval result;
   1.438 +
   1.439 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.440 +
   1.441 +	return result;
   1.442 +}
   1.443 +
   1.444 +static struct ia64_pal_retval
   1.445 +pal_logical_to_physica(VCPU *vcpu) {
   1.446 +	struct ia64_pal_retval result;
   1.447 +
   1.448 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.449 +
   1.450 +	return result;
   1.451 +}
   1.452 +
   1.453 +static struct ia64_pal_retval
   1.454 +pal_perf_mon_info(VCPU *vcpu) {
   1.455 +	struct ia64_pal_retval result;
   1.456 +
   1.457 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.458 +
   1.459 +	return result;
   1.460 +}
   1.461 +
   1.462 +static struct ia64_pal_retval
   1.463 +pal_proc_get_features(VCPU *vcpu) {
   1.464 +	struct ia64_pal_retval result;
   1.465 +
   1.466 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.467 +
   1.468 +	return result;
   1.469 +}
   1.470 +
   1.471 +static struct ia64_pal_retval
   1.472 +pal_ptce_info(VCPU *vcpu) {
   1.473 +	struct ia64_pal_retval result;
   1.474 +
   1.475 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.476 +
   1.477 +	return result;
   1.478 +}
   1.479 +
   1.480 +static struct ia64_pal_retval
   1.481 +pal_register_info(VCPU *vcpu) {
   1.482 +	struct ia64_pal_retval result;
   1.483 +
   1.484 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.485 +
   1.486 +	return result;
   1.487 +}
   1.488 +
   1.489 +static struct ia64_pal_retval
   1.490 +pal_rse_info(VCPU *vcpu) {
   1.491 +	struct ia64_pal_retval result;
   1.492 +
   1.493 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.494 +
   1.495 +	return result;
   1.496 +}
   1.497 +
   1.498 +static struct ia64_pal_retval
   1.499 +pal_test_info(VCPU *vcpu) {
   1.500 +	struct ia64_pal_retval result;
   1.501 +
   1.502 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.503 +
   1.504 +	return result;
   1.505 +}
   1.506 +
   1.507 +static struct ia64_pal_retval
   1.508 +pal_vm_summary(VCPU *vcpu) {
   1.509  	pal_vm_info_1_u_t vminfo1;
   1.510  	pal_vm_info_2_u_t vminfo2;	
   1.511  	struct ia64_pal_retval result;
   1.512  	
   1.513 -	PAL_CALL(result,PAL_VM_SUMMARY,0,0,0);
   1.514 -	if(!result.status){
   1.515 +	PAL_CALL(result, PAL_VM_SUMMARY, 0, 0, 0);
   1.516 +	if (!result.status) {
   1.517  		vminfo1.pvi1_val = result.v0;
   1.518  		vminfo1.pal_vm_info_1_s.max_itr_entry = NITRS -1;
   1.519  		vminfo1.pal_vm_info_1_s.max_dtr_entry = NDTRS -1;
   1.520  		result.v0 = vminfo1.pvi1_val;
   1.521  		vminfo2.pal_vm_info_2_s.impl_va_msb = GUEST_IMPL_VA_MSB;
   1.522 -		vminfo2.pal_vm_info_2_s.rid_size = current->domain->arch.rid_bits;
   1.523 +		vminfo2.pal_vm_info_2_s.rid_size =
   1.524 +		                             current->domain->arch.rid_bits;
   1.525  		result.v1 = vminfo2.pvi2_val;
   1.526  	} 
   1.527  	return result;
   1.528  }
   1.529  
   1.530  static struct ia64_pal_retval
   1.531 -pal_vm_info(VCPU *vcpu){
   1.532 +pal_vm_info(VCPU *vcpu) {
   1.533  	struct ia64_pal_retval result;
   1.534  
   1.535 -	result.status= -1; //unimplemented
   1.536 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.537 +
   1.538  	return result;
   1.539  }
   1.540  
   1.541  static struct ia64_pal_retval
   1.542 -pal_vm_page_size(VCPU *vcpu){
   1.543 +pal_vm_page_size(VCPU *vcpu) {
   1.544  	struct ia64_pal_retval result;
   1.545  
   1.546 -	result.status= -1; //unimplemented
   1.547 +	INIT_PAL_STATUS_UNIMPLEMENTED(result);
   1.548 +
   1.549  	return result;
   1.550  }
   1.551 +
   1.552  void
   1.553 -pal_emul( VCPU *vcpu) {
   1.554 +pal_emul(VCPU *vcpu) {
   1.555  	UINT64 gr28;
   1.556  	struct ia64_pal_retval result;
   1.557  
   1.558 -
   1.559  	vcpu_get_gr_nat(vcpu,28,&gr28);  //bank1
   1.560  
   1.561  	switch (gr28) {
   1.562  		case PAL_CACHE_FLUSH:
   1.563 -			result = pal_cache_flush (vcpu);
   1.564 +			result = pal_cache_flush(vcpu);
   1.565  			break;
   1.566  
   1.567  		case PAL_PREFETCH_VISIBILITY:
   1.568 -			result = pal_prefetch_visibility (vcpu);
   1.569 +			result = pal_prefetch_visibility(vcpu);
   1.570  			break;
   1.571  
   1.572  		case PAL_VM_TR_READ:
   1.573 -			result = pal_vm_tr_read (vcpu);
   1.574 +			result = pal_vm_tr_read(vcpu);
   1.575  			break;
   1.576  
   1.577  		case PAL_HALT:
   1.578 -			result = pal_halt (vcpu);
   1.579 +			result = pal_halt(vcpu);
   1.580  			break;
   1.581  
   1.582  		case PAL_HALT_LIGHT:
   1.583 -			result = pal_halt_light (vcpu);
   1.584 +			result = pal_halt_light(vcpu);
   1.585  			break;
   1.586  
   1.587  		case PAL_CACHE_READ:
   1.588 -			result = pal_cache_read (vcpu);
   1.589 +			result = pal_cache_read(vcpu);
   1.590  			break;
   1.591  
   1.592  		case PAL_CACHE_WRITE:
   1.593 -			result = pal_cache_write (vcpu);
   1.594 +			result = pal_cache_write(vcpu);
   1.595  			break;
   1.596  
   1.597  		case PAL_PLATFORM_ADDR:
   1.598 -			result = pal_platform_addr (vcpu);
   1.599 +			result = pal_platform_addr(vcpu);
   1.600  			break;
   1.601  
   1.602  		case PAL_FREQ_RATIOS:
   1.603 -			result = pal_freq_ratios (vcpu);
   1.604 +			result = pal_freq_ratios(vcpu);
   1.605  			break;
   1.606  
   1.607  		case PAL_FREQ_BASE:
   1.608 -			result = pal_freq_base (vcpu);
   1.609 +			result = pal_freq_base(vcpu);
   1.610  			break;
   1.611  
   1.612  		case PAL_BUS_GET_FEATURES :
   1.613 -			result = pal_bus_get_features (vcpu);
   1.614 +			result = pal_bus_get_features(vcpu);
   1.615  			break;
   1.616  
   1.617  		case PAL_CACHE_SUMMARY :
   1.618 -			result = pal_cache_summary (vcpu);
   1.619 +			result = pal_cache_summary(vcpu);
   1.620  			break;
   1.621  
   1.622  		case PAL_CACHE_INIT :
   1.623 @@ -461,17 +507,18 @@ pal_emul( VCPU *vcpu) {
   1.624  			break;
   1.625  
   1.626  		default:
   1.627 -			panic_domain(vcpu_regs(vcpu),"pal_emul(): guest call unsupported pal" );
   1.628 -  }
   1.629 -		set_pal_result (vcpu, result);
   1.630 +			panic_domain(vcpu_regs(vcpu),"pal_emul(): guest "
   1.631 +			             "call unsupported pal" );
   1.632 +	}
   1.633 +	set_pal_result(vcpu, result);
   1.634  }
   1.635  
   1.636  void
   1.637  sal_emul(VCPU *v) {
   1.638  	struct sal_ret_values result;
   1.639 -	result = sal_emulator(vcpu_get_gr(v,32),vcpu_get_gr(v,33),
   1.640 -	                      vcpu_get_gr(v,34),vcpu_get_gr(v,35),
   1.641 -	                      vcpu_get_gr(v,36),vcpu_get_gr(v,37),
   1.642 -	                      vcpu_get_gr(v,38),vcpu_get_gr(v,39));
   1.643 +	result = sal_emulator(vcpu_get_gr(v, 32), vcpu_get_gr(v, 33),
   1.644 +	                      vcpu_get_gr(v, 34), vcpu_get_gr(v, 35),
   1.645 +	                      vcpu_get_gr(v, 36), vcpu_get_gr(v, 37),
   1.646 +	                      vcpu_get_gr(v, 38), vcpu_get_gr(v, 39));
   1.647  	set_sal_result(v, result);	
   1.648  }