2 * Platform dependent support for IO probing.
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (c) 2000-2003 Silicon Graphics, Inc. All rights reserved.
11 #include <asm/sn/sgi.h>
12 #include <asm/sn/sn_sal.h>
15 * ia64_sn_probe_io_slot - test a memory location for readability
16 * @paddr: physical address to probe
17 * @size: number bytes to read (1,2,4,8)
18 * @data_ptr: address to store value read by probe (-1 returned if probe fails)
20 * This function will probe a physical address to determine if
21 * the address can be read. If reading the address causes a BUS
22 * error, an error is returned. If the probe succeeds, the contents
23 * of the memory location is returned.
26 * 0 - probe successful
27 * 1 - probe failed (generated MCA)
32 ia64_sn_probe_io_slot(long paddr, long size, void *data_ptr)
34 struct ia64_sal_retval isrv;
36 SAL_CALL(isrv, SN_SAL_PROBE, paddr, size, 0, 0, 0, 0, 0);
41 *((u8*)data_ptr) = (u8)isrv.v0;
44 *((u16*)data_ptr) = (u16)isrv.v0;
47 *((u32*)data_ptr) = (u32)isrv.v0;
50 *((u64*)data_ptr) = (u64)isrv.v0;