|
@@ -0,0 +1,78 @@
|
|
|
+#ifndef _ASM_IA64_SAL_H
|
|
|
+#define _ASM_IA64_SAL_H
|
|
|
+
|
|
|
+/*
|
|
|
+ * System Abstraction Layer definitions.
|
|
|
+ *
|
|
|
+ * This is based on version 2.5 of the manual "IA-64 System
|
|
|
+ * Abstraction Layer".
|
|
|
+ *
|
|
|
+ * Copyright (C) 2001 Intel
|
|
|
+ * Copyright (C) 2002 Jenna Hall <jenna.s.hall@intel.com>
|
|
|
+ * Copyright (C) 2001 Fred Lewis <frederick.v.lewis@intel.com>
|
|
|
+ * Copyright (C) 1998, 1999, 2001, 2003 Hewlett-Packard Co
|
|
|
+ * David Mosberger-Tang <davidm@hpl.hp.com>
|
|
|
+ * Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
|
|
|
+ *
|
|
|
+ * 02/01/04 J. Hall Updated Error Record Structures to conform to July 2001
|
|
|
+ * revision of the SAL spec.
|
|
|
+ * 01/01/03 fvlewis Updated Error Record Structures to conform with Nov. 2000
|
|
|
+ * revision of the SAL spec.
|
|
|
+ * 99/09/29 davidm Updated for SAL 2.6.
|
|
|
+ * 00/03/29 cfleck Updated SAL Error Logging info for processor (SAL 2.6)
|
|
|
+ * (plus examples of platform error info structures from smariset @ Intel)
|
|
|
+ */
|
|
|
+
|
|
|
+#define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK_BIT 0
|
|
|
+#define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT_BIT 1
|
|
|
+#define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT_BIT 2
|
|
|
+#define IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT_BIT 3
|
|
|
+
|
|
|
+#define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK (1<<IA64_SAL_PLATFORM_FEATURE_BUS_LOCK_BIT)
|
|
|
+#define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT (1<<IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT_BIT)
|
|
|
+#define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT (1<<IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT_BIT)
|
|
|
+#define IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT (1<<IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT_BIT)
|
|
|
+
|
|
|
+#ifndef __ASSEMBLY__
|
|
|
+
|
|
|
+#include <linux/bcd.h>
|
|
|
+#include <linux/spinlock.h>
|
|
|
+#include <linux/efi.h>
|
|
|
+
|
|
|
+#include <asm/pal.h>
|
|
|
+#include <asm/fpu.h>
|
|
|
+
|
|
|
+extern spinlock_t sal_lock;
|
|
|
+
|
|
|
+/* SAL spec _requires_ eight args for each call. */
|
|
|
+#define __IA64_FW_CALL(entry,result,a0,a1,a2,a3,a4,a5,a6,a7) \
|
|
|
+ result = (*entry)(a0,a1,a2,a3,a4,a5,a6,a7)
|
|
|
+
|
|
|
+# define IA64_FW_CALL(entry,result,args...) do { \
|
|
|
+ unsigned long __ia64_sc_flags; \
|
|
|
+ struct ia64_fpreg __ia64_sc_fr[6]; \
|
|
|
+ ia64_save_scratch_fpregs(__ia64_sc_fr); \
|
|
|
+ spin_lock_irqsave(&sal_lock, __ia64_sc_flags); \
|
|
|
+ __IA64_FW_CALL(entry, result, args); \
|
|
|
+ spin_unlock_irqrestore(&sal_lock, __ia64_sc_flags); \
|
|
|
+ ia64_load_scratch_fpregs(__ia64_sc_fr); \
|
|
|
+} while (0)
|
|
|
+
|
|
|
+# define SAL_CALL(result,args...) \
|
|
|
+ IA64_FW_CALL(ia64_sal, result, args);
|
|
|
+
|
|
|
+# define SAL_CALL_NOLOCK(result,args...) do { \
|
|
|
+ unsigned long __ia64_scn_flags; \
|
|
|
+ struct ia64_fpreg __ia64_scn_fr[6]; \
|
|
|
+ ia64_save_scratch_fpregs(__ia64_scn_fr); \
|
|
|
+ local_irq_save(__ia64_scn_flags); \
|
|
|
+ __IA64_FW_CALL(ia64_sal, result, args); \
|
|
|
+ local_irq_restore(__ia64_scn_flags); \
|
|
|
+ ia64_load_scratch_fpregs(__ia64_scn_fr); \
|
|
|
+} while (0)
|
|
|
+
|
|
|
+# define SAL_CALL_REENTRANT(result,args...) do { \
|
|
|
+ struct ia64_fpreg __ia64_scs_fr[6]; \
|
|
|
+ ia64_save_scratch_fpregs(__ia64_scs_fr); \
|
|
|
+ preempt_disable(); \
|
|
|
+ __IA64_FW_CALL(ia64_sal, result, args); \
|