3 * Purpose: SN specific MCA code.
5 * Copyright (C) 2001-2003 Silicon Graphics, Inc. All Rights Reserved.
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of version 2 of the GNU General Public License
9 * as published by the Free Software Foundation.
11 * This program is distributed in the hope that it would be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
22 * You should have received a copy of the GNU General Public
23 * License along with this program; if not, write the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
26 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27 * Mountain View, CA 94043, or:
31 * For further information regarding this notice, see:
33 * http://oss.sgi.com/projects/GenInfo/NoticeExplan
36 #include <linux/types.h>
37 #include <linux/kernel.h>
38 #include <linux/timer.h>
41 #include <asm/sn/sn_sal.h>
46 * Interval for calling SAL to poll for errors that do NOT cause error
47 * interrupts. SAL will raise a CPEI if any errors are present that
50 #define CPEI_INTERVAL (5*HZ)
53 struct timer_list sn_cpei_timer;
54 void sn_init_cpei_timer(void);
60 * This function is the callback routine that SAL calls to log error
61 * info for platform errors.
64 print_hook(const char *fmt, ...)
77 len += vsnprintf(buf+len, sizeof(buf)-len, fmt, args);
79 /* Prefix each line with "+ " to be consistent with mca.c. */
81 while ((p=strchr(p, '\n')) && *++p != '\0') {
82 memmove(p+2, p, 1+strlen(p));
96 * ia64_sn2_platform_plat_specific_err_print
98 * Called by the MCA handler to log platform-specific errors.
101 ia64_sn2_platform_plat_specific_err_print(int header_len, int sect_len, u8 *p_data, prfunc_t prfunc)
103 ia64_sn_plat_specific_err_print(print_hook, p_data - sect_len);
109 sn_cpei_handler(int irq, void *devid, struct pt_regs *regs)
112 * this function's sole purpose is to call SAL when we receive
113 * a CE interrupt from SHUB or when the timer routine decides
114 * we need to call SAL to check for CEs.
117 /* CALL SAL_LOG_CE */
119 ia64_sn_plat_cpei_handler();
124 sn_cpei_timer_handler(unsigned long dummy) {
125 sn_cpei_handler(-1, NULL, NULL);
126 mod_timer(&sn_cpei_timer, jiffies + CPEI_INTERVAL);
130 sn_init_cpei_timer() {
131 sn_cpei_timer.expires = jiffies + CPEI_INTERVAL;
132 sn_cpei_timer.function = sn_cpei_timer_handler;
133 add_timer(&sn_cpei_timer);