blob: c13a709c4db5a332d56fe09d64e8cde50e3d5874 [file] [log] [blame]
Dean Nelsonb0d82bd2005-03-23 19:46:00 -07001/*
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 Nelson45d9ca42008-04-22 14:46:56 -05006 * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved.
Dean Nelsonb0d82bd2005-03-23 19:46:00 -07007 */
8
9
10/*
11 * The xp_nofault_PIOR function takes a pointer to a remote PIO register
12 * and attempts to load and consume a value from it. This function
13 * will be registered as a nofault code block. In the event that the
14 * PIO read fails, the MCA handler will force the error to look
15 * corrected and vector to the xp_error_PIOR which will return an error.
16 *
Russ Anderson2022c1f2008-01-03 10:23:49 -060017 * The definition of "consumption" and the time it takes for an MCA
18 * to surface is processor implementation specific. This code
19 * is sufficient on Itanium through the Montvale processor family.
20 * It may need to be adjusted for future processor implementations.
21 *
Dean Nelsonb0d82bd2005-03-23 19:46:00 -070022 * extern int xp_nofault_PIOR(void *remote_register);
23 */
24
25 .global xp_nofault_PIOR
26xp_nofault_PIOR:
27 mov r8=r0 // Stage a success return value
28 ld8.acq r9=[r32];; // PIO Read the specified register
Russ Andersonc0346372007-06-14 16:01:24 -050029 adds r9=1,r9;; // Add to force consumption
Russ Anderson2022c1f2008-01-03 10:23:49 -060030 srlz.i;; // Allow time for MCA to surface
Dean Nelsonb0d82bd2005-03-23 19:46:00 -070031 br.ret.sptk.many b0;; // Return success
32
33 .global xp_error_PIOR
34xp_error_PIOR:
35 mov r8=1 // Return value of 1
36 br.ret.sptk.many b0;; // Return failure