| Dean Nelson | b0d82bd | 2005-03-23 19:46:00 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * This file is subject to the terms and conditions of the GNU General Public | 
|  | 3 | * License.  See the file "COPYING" in the main directory of this archive | 
|  | 4 | * for more details. | 
|  | 5 | * | 
| Dean Nelson | 45d9ca4 | 2008-04-22 14:46:56 -0500 | [diff] [blame] | 6 | * Copyright (c) 2004-2008 Silicon Graphics, Inc.  All Rights Reserved. | 
| Dean Nelson | b0d82bd | 2005-03-23 19:46:00 -0700 | [diff] [blame] | 7 | */ | 
|  | 8 |  | 
| Dean Nelson | b0d82bd | 2005-03-23 19:46:00 -0700 | [diff] [blame] | 9 | /* | 
|  | 10 | * The xp_nofault_PIOR function takes a pointer to a remote PIO register | 
|  | 11 | * and attempts to load and consume a value from it.  This function | 
|  | 12 | * will be registered as a nofault code block.  In the event that the | 
|  | 13 | * PIO read fails, the MCA handler will force the error to look | 
|  | 14 | * corrected and vector to the xp_error_PIOR which will return an error. | 
|  | 15 | * | 
| Russ Anderson | 2022c1f | 2008-01-03 10:23:49 -0600 | [diff] [blame] | 16 | * The definition of "consumption" and the time it takes for an MCA | 
|  | 17 | * to surface is processor implementation specific.  This code | 
|  | 18 | * is sufficient on Itanium through the Montvale processor family. | 
|  | 19 | * It may need to be adjusted for future processor implementations. | 
|  | 20 | * | 
| Dean Nelson | b0d82bd | 2005-03-23 19:46:00 -0700 | [diff] [blame] | 21 | *	extern int xp_nofault_PIOR(void *remote_register); | 
|  | 22 | */ | 
|  | 23 |  | 
|  | 24 | .global xp_nofault_PIOR | 
|  | 25 | xp_nofault_PIOR: | 
|  | 26 | mov	r8=r0			// Stage a success return value | 
|  | 27 | ld8.acq	r9=[r32];;		// PIO Read the specified register | 
| Russ Anderson | c034637 | 2007-06-14 16:01:24 -0500 | [diff] [blame] | 28 | adds	r9=1,r9;;		// Add to force consumption | 
| Russ Anderson | 2022c1f | 2008-01-03 10:23:49 -0600 | [diff] [blame] | 29 | srlz.i;;			// Allow time for MCA to surface | 
| Dean Nelson | b0d82bd | 2005-03-23 19:46:00 -0700 | [diff] [blame] | 30 | br.ret.sptk.many b0;;		// Return success | 
|  | 31 |  | 
|  | 32 | .global xp_error_PIOR | 
|  | 33 | xp_error_PIOR: | 
|  | 34 | mov	r8=1			// Return value of 1 | 
|  | 35 | br.ret.sptk.many b0;;		// Return failure |