sal.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:24k
- #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 Hewlett-Packard Co
- * Copyright (C) 1998, 1999, 2001 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)
- */
- #include <linux/spinlock.h>
- #include <linux/efi.h>
- #include <asm/pal.h>
- #include <asm/system.h>
- #include <asm/fpu.h>
- extern spinlock_t sal_lock;
- /* SAL spec _requires_ eight args for each call. */
- #define __SAL_CALL(result,a0,a1,a2,a3,a4,a5,a6,a7)
- result = (*ia64_sal)(a0,a1,a2,a3,a4,a5,a6,a7)
- # define SAL_CALL(result,args...) do {
- unsigned long flags;
- spin_lock_irqsave(&sal_lock, flags);
- __SAL_CALL(result,args);
- spin_unlock_irqrestore(&sal_lock, flags);
- } while (0)
- #define SAL_SET_VECTORS 0x01000000
- #define SAL_GET_STATE_INFO 0x01000001
- #define SAL_GET_STATE_INFO_SIZE 0x01000002
- #define SAL_CLEAR_STATE_INFO 0x01000003
- #define SAL_MC_RENDEZ 0x01000004
- #define SAL_MC_SET_PARAMS 0x01000005
- #define SAL_REGISTER_PHYSICAL_ADDR 0x01000006
- #define SAL_CACHE_FLUSH 0x01000008
- #define SAL_CACHE_INIT 0x01000009
- #define SAL_PCI_CONFIG_READ 0x01000010
- #define SAL_PCI_CONFIG_WRITE 0x01000011
- #define SAL_FREQ_BASE 0x01000012
- #define SAL_UPDATE_PAL 0x01000020
- struct ia64_sal_retval {
- /*
- * A zero status value indicates call completed without error.
- * A negative status value indicates reason of call failure.
- * A positive status value indicates success but an
- * informational value should be printed (e.g., "reboot for
- * change to take effect").
- */
- s64 status;
- u64 v0;
- u64 v1;
- u64 v2;
- };
- typedef struct ia64_sal_retval (*ia64_sal_handler) (u64, ...);
- enum {
- SAL_FREQ_BASE_PLATFORM = 0,
- SAL_FREQ_BASE_INTERVAL_TIMER = 1,
- SAL_FREQ_BASE_REALTIME_CLOCK = 2
- };
- /*
- * The SAL system table is followed by a variable number of variable
- * length descriptors. The structure of these descriptors follows
- * below.
- * The defininition follows SAL specs from July 2000
- */
- struct ia64_sal_systab {
- u8 signature[4]; /* should be "SST_" */
- u32 size; /* size of this table in bytes */
- u8 sal_rev_minor;
- u8 sal_rev_major;
- u16 entry_count; /* # of entries in variable portion */
- u8 checksum;
- u8 reserved1[7];
- u8 sal_a_rev_minor;
- u8 sal_a_rev_major;
- u8 sal_b_rev_minor;
- u8 sal_b_rev_major;
- /* oem_id & product_id: terminating NUL is missing if string is exactly 32 bytes long. */
- u8 oem_id[32];
- u8 product_id[32]; /* ASCII product id */
- u8 reserved2[8];
- };
- enum sal_systab_entry_type {
- SAL_DESC_ENTRY_POINT = 0,
- SAL_DESC_MEMORY = 1,
- SAL_DESC_PLATFORM_FEATURE = 2,
- SAL_DESC_TR = 3,
- SAL_DESC_PTC = 4,
- SAL_DESC_AP_WAKEUP = 5
- };
- /*
- * Entry type: Size:
- * 0 48
- * 1 32
- * 2 16
- * 3 32
- * 4 16
- * 5 16
- */
- #define SAL_DESC_SIZE(type) "