ia64/xen-unstable

changeset 15408:6b1b119191f1

[IA64] More SN2 SAL calls that needs to be emulated.

Signed-off-by: Jes Sorensen <jes@sgi.com>
author Alex Williamson <alex.williamson@hp.com>
date Thu Jun 21 16:50:55 2007 -0600 (2007-06-21)
parents 593fe08cfca2
children 4d159746d0e6
files xen/arch/ia64/xen/fw_emul.c
line diff
     1.1 --- a/xen/arch/ia64/xen/fw_emul.c	Thu Jun 21 16:45:41 2007 -0600
     1.2 +++ b/xen/arch/ia64/xen/fw_emul.c	Thu Jun 21 16:50:55 2007 -0600
     1.3 @@ -23,6 +23,7 @@
     1.4  #include <asm/pal.h>
     1.5  #include <asm/sal.h>
     1.6  #include <asm/sn/sn_sal.h>
     1.7 +#include <asm/sn/hubdev.h>
     1.8  #include <asm/xenmca.h>
     1.9  
    1.10  #include <public/sched.h>
    1.11 @@ -380,7 +381,7 @@ sal_emulator (long index, unsigned long 
    1.12  	    case SN_SAL_GET_MASTER_NASID:
    1.13  		status = -1;
    1.14  		if (current->domain == dom0) {
    1.15 -			printk("*** Emulating SN_SAL_GET_MASTER_NASID ***\n");
    1.16 +			/* printk("*** Emulating SN_SAL_GET_MASTER_NASID ***\n"); */
    1.17  			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_MASTER_NASID,
    1.18  					0, 0, 0, 0, 0, 0, 0);
    1.19  			status = ret_stuff.status;
    1.20 @@ -392,7 +393,7 @@ sal_emulator (long index, unsigned long 
    1.21  	    case SN_SAL_GET_KLCONFIG_ADDR:
    1.22  		status = -1;
    1.23  		if (current->domain == dom0) {
    1.24 -			printk("*** Emulating SN_SAL_GET_KLCONFIG_ADDR ***\n");
    1.25 +			/* printk("*** Emulating SN_SAL_GET_KLCONFIG_ADDR ***\n"); */
    1.26  			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR,
    1.27  					in1, 0, 0, 0, 0, 0, 0);
    1.28  			status = ret_stuff.status;
    1.29 @@ -404,9 +405,9 @@ sal_emulator (long index, unsigned long 
    1.30  	    case SN_SAL_GET_SAPIC_INFO:
    1.31  		status = -1;
    1.32  		if (current->domain == dom0) {
    1.33 -			printk("*** Emulating SN_SAL_GET_SAPIC_INFO ***\n");
    1.34 -			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SAPIC_INFO, in1,
    1.35 -					0, 0, 0, 0, 0, 0);
    1.36 +			/* printk("*** Emulating SN_SAL_GET_SAPIC_INFO ***\n"); */
    1.37 +			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SAPIC_INFO,
    1.38 +					in1, 0, 0, 0, 0, 0, 0);
    1.39  			status = ret_stuff.status;
    1.40  			r9 = ret_stuff.v0;
    1.41  			r10 = ret_stuff.v1;
    1.42 @@ -416,9 +417,9 @@ sal_emulator (long index, unsigned long 
    1.43  	    case SN_SAL_GET_SN_INFO:
    1.44  		status = -1;
    1.45  		if (current->domain == dom0) {
    1.46 -			printk("*** Emulating SN_SAL_GET_SN_INFO ***\n");
    1.47 -			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SN_INFO, in1,
    1.48 -					0, 0, 0, 0, 0, 0);
    1.49 +			/* printk("*** Emulating SN_SAL_GET_SN_INFO ***\n"); */
    1.50 +			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SN_INFO,
    1.51 +					in1, 0, 0, 0, 0, 0, 0);
    1.52  			status = ret_stuff.status;
    1.53  			r9 = ret_stuff.v0;
    1.54  			r10 = ret_stuff.v1;
    1.55 @@ -428,7 +429,7 @@ sal_emulator (long index, unsigned long 
    1.56  	    case SN_SAL_IOIF_GET_HUBDEV_INFO:
    1.57  		status = -1;
    1.58  		if (current->domain == dom0) {
    1.59 -			printk("*** Emulating SN_SAL_IOIF_GET_HUBDEV_INFO ***\n");
    1.60 +			/* printk("*** Emulating SN_SAL_IOIF_GET_HUBDEV_INFO ***\n"); */
    1.61  			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_IOIF_GET_HUBDEV_INFO,
    1.62  					in1, in2, 0, 0, 0, 0, 0);
    1.63  			status = ret_stuff.status;
    1.64 @@ -437,6 +438,121 @@ sal_emulator (long index, unsigned long 
    1.65  			r11 = ret_stuff.v2;
    1.66  		}
    1.67  		break;
    1.68 +	    case SN_SAL_IOIF_INIT:
    1.69 +		status = -1;
    1.70 +		if (current->domain == dom0) {
    1.71 +			/* printk("*** Emulating SN_SAL_IOIF_INIT ***\n"); */
    1.72 +			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_IOIF_INIT,
    1.73 +					0, 0, 0, 0, 0, 0, 0);
    1.74 +			status = ret_stuff.status;
    1.75 +			r9 = ret_stuff.v0;
    1.76 +			r10 = ret_stuff.v1;
    1.77 +			r11 = ret_stuff.v2;
    1.78 +		}
    1.79 +		break;
    1.80 +	    case SN_SAL_GET_PROM_FEATURE_SET:
    1.81 +		status = -1;
    1.82 +		if (current->domain == dom0) {
    1.83 +			/* printk("*** Emulating SN_SAL_GET_PROM_FEATURE_SET ***\n"); */
    1.84 +			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_PROM_FEATURE_SET,
    1.85 +					in1, 0, 0, 0, 0, 0, 0);
    1.86 +			status = ret_stuff.status;
    1.87 +			r9 = ret_stuff.v0;
    1.88 +			r10 = ret_stuff.v1;
    1.89 +			r11 = ret_stuff.v2;
    1.90 +		}
    1.91 +		break;
    1.92 +	    case SN_SAL_SET_OS_FEATURE_SET:
    1.93 +		status = -1;
    1.94 +		if (current->domain == dom0) {
    1.95 +			/* printk("*** Emulating SN_SAL_SET_OS_FEATURE_SET ***\n"); */
    1.96 +			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_SET_OS_FEATURE_SET,
    1.97 +					in1, 0, 0, 0, 0, 0, 0);
    1.98 +			status = ret_stuff.status;
    1.99 +			r9 = ret_stuff.v0;
   1.100 +			r10 = ret_stuff.v1;
   1.101 +			r11 = ret_stuff.v2;
   1.102 +		}
   1.103 +		break;
   1.104 +	    case SN_SAL_SET_ERROR_HANDLING_FEATURES:
   1.105 +		status = -1;
   1.106 +		if (current->domain == dom0) {
   1.107 +			/* printk("*** Emulating SN_SAL_SET_ERROR_HANDLING_FEATURES ***\n"); */
   1.108 +			SAL_CALL_NOLOCK(ret_stuff,
   1.109 +					SN_SAL_SET_ERROR_HANDLING_FEATURES,
   1.110 +					in1, 0, 0, 0, 0, 0, 0);
   1.111 +			status = ret_stuff.status;
   1.112 +			r9 = ret_stuff.v0;
   1.113 +			r10 = ret_stuff.v1;
   1.114 +			r11 = ret_stuff.v2;
   1.115 +		}
   1.116 +		break;
   1.117 +#if 0
   1.118 +/*
   1.119 + * Somehow ACPI breaks if allowing this one
   1.120 + */
   1.121 +	    case SN_SAL_SET_CPU_NUMBER:
   1.122 +		status = -1;
   1.123 +		if (current->domain == dom0) {
   1.124 +			printk("*** Emulating SN_SAL_SET_CPU_NUMBER ***\n");
   1.125 +			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_SET_CPU_NUMBER,
   1.126 +					in1, 0, 0, 0, 0, 0, 0);
   1.127 +			status = ret_stuff.status;
   1.128 +			r9 = ret_stuff.v0;
   1.129 +			r10 = ret_stuff.v1;
   1.130 +			r11 = ret_stuff.v2;
   1.131 +		}
   1.132 +		break;
   1.133 +#endif
   1.134 +	    case SN_SAL_LOG_CE:
   1.135 +		status = -1;
   1.136 +		if (current->domain == dom0) {
   1.137 +			static int log_ce = 0;
   1.138 +			if (!log_ce) {
   1.139 +				printk("*** Emulating SN_SAL_LOG_CE *** "
   1.140 +				       " this will only be printed once\n");
   1.141 +				log_ce = 1;
   1.142 +			}
   1.143 +			SAL_CALL_NOLOCK(ret_stuff, SN_SAL_LOG_CE,
   1.144 +					0, 0, 0, 0, 0, 0, 0);
   1.145 +			status = ret_stuff.status;
   1.146 +			r9 = ret_stuff.v0;
   1.147 +			r10 = ret_stuff.v1;
   1.148 +			r11 = ret_stuff.v2;
   1.149 +		}
   1.150 +		break;
   1.151 +	    case SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST:
   1.152 +		status = -1;
   1.153 +		if (current->domain == dom0) {
   1.154 +			struct sn_flush_device_common flush;
   1.155 +			int flush_size;
   1.156 +
   1.157 +			flush_size = sizeof(struct sn_flush_device_common);
   1.158 +			memset(&flush, 0, flush_size);
   1.159 +			SAL_CALL_NOLOCK(ret_stuff,
   1.160 +					SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST,
   1.161 +					in1, in2, in3, &flush, 0, 0, 0);
   1.162 +#if 0
   1.163 +			printk("*** Emulating "
   1.164 +			       "SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST ***\n");
   1.165 +#endif
   1.166 +			if (ret_stuff.status == SALRET_OK) {
   1.167 +				XEN_GUEST_HANDLE(void) handle =
   1.168 +					*(XEN_GUEST_HANDLE(void)*)&in4;
   1.169 +				if (copy_to_guest(handle, &flush, 1)) {
   1.170 +					printk("SN_SAL_IOIF_GET_DEVICE_"
   1.171 +					       "DMAFLUSH_LIST can't copy "
   1.172 +					       "to user!\n");
   1.173 +					ret_stuff.status = SALRET_ERROR;
   1.174 +				}
   1.175 +			}
   1.176 +
   1.177 +			status = ret_stuff.status;
   1.178 +			r9 = ret_stuff.v0;
   1.179 +			r10 = ret_stuff.v1;
   1.180 +			r11 = ret_stuff.v2;
   1.181 +		}
   1.182 +		break;
   1.183  	    default:
   1.184  		printk("*** CALLED SAL_ WITH UNKNOWN INDEX (%lx).  "
   1.185  		       "IGNORED...\n", index);