/************************************************************************** * * * Copyright (C) 1992-1996 Silicon Graphics, Inc. * * * * These coded instructions, statements, and computer programs contain * * unpublished proprietary information of Silicon Graphics, Inc., and * * are protected by Federal copyright law. They may not be disclosed * * to third parties or copied or duplicated in any form, in whole or * * in part, without the prior written consent of Silicon Graphics, Inc. * * * **************************************************************************/ #ident "$Revision: 1.3 $" #include #include #include #include #include #include #include #include #include int io_get_widgetid(nasid_t nasid, int widget) { int wid_id; jmp_buf fault_buf; void *prev_fault; extern void hubii_prb_cleanup(nasid_t, int); if (setfault(fault_buf, &prev_fault)) { printf("Reading link %X (addr 0x%lx) failed\n", widget, (SN0_WIDGET_BASE(nasid, widget) + WIDGET_ID)); hubii_prb_cleanup(nasid, widget); restorefault(prev_fault); return -1; } wid_id = *(volatile __uint32_t *)(SN0_WIDGET_BASE(nasid, widget) + WIDGET_ID); restorefault(prev_fault); return wid_id; }