2 * Copyright (c) 2001 Doug Rabson
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #ifndef _MACHINE_SAL_H_
30 #define _MACHINE_SAL_H_
32 struct sal_system_table {
33 char sal_signature[4];
34 #define SAL_SIGNATURE "SST_"
37 uint16_t sal_entry_count;
39 uint8_t sal_reserved1[7];
40 uint8_t sal_a_version[2];
41 uint8_t sal_b_version[2];
43 char sal_product_id[32];
44 uint8_t sal_reserved2[8];
47 struct sal_entrypoint_descriptor {
48 uint8_t sale_type; /* == 0 */
49 uint8_t sale_reserved1[7];
50 uint64_t sale_pal_proc;
51 uint64_t sale_sal_proc;
53 uint8_t sale_reserved2[16];
56 struct sal_memory_descriptor {
57 uint8_t sale_type; /* == 1 */
58 uint8_t sale_need_virtual;
59 uint8_t sale_current_attribute;
60 uint8_t sale_access_rights;
61 uint8_t sale_supported_attributes;
62 uint8_t sale_reserved1;
63 uint8_t sale_memory_type[2];
64 uint64_t sale_physical_address;
66 uint8_t sale_reserved2[12];
69 struct sal_platform_descriptor {
70 uint8_t sale_type; /* == 2 */
71 uint8_t sale_features;
72 uint8_t sale_reserved[14];
75 struct sal_tr_descriptor {
76 uint8_t sale_type; /* == 3 */
77 uint8_t sale_register_type;
78 uint8_t sale_register_number;
79 uint8_t sale_reserved1[5];
80 uint64_t sale_virtual_address;
81 uint64_t sale_page_size;
82 uint8_t sale_reserved2[8];
85 struct sal_ptc_cache_descriptor {
86 uint8_t sale_type; /* == 4 */
87 uint8_t sale_reserved[3];
88 uint32_t sale_domains;
89 uint64_t sale_address;
92 struct sal_ap_wakeup_descriptor {
93 uint8_t sale_type; /* == 5 */
94 uint8_t sale_mechanism;
95 uint8_t sale_reserved[6];
100 * SAL Procedure numbers.
103 #define SAL_SET_VECTORS 0x01000000
104 #define SAL_GET_STATE_INFO 0x01000001
105 #define SAL_GET_STATE_INFO_SIZE 0x01000002
106 #define SAL_CLEAR_STATE_INFO 0x01000003
107 #define SAL_MC_RENDEZ 0x01000004
108 #define SAL_MC_SET_PARAMS 0x01000005
109 #define SAL_REGISTER_PHYSICAL_ADDR 0x01000006
110 #define SAL_CACHE_FLUSH 0x01000008
111 #define SAL_CACHE_INIT 0x01000009
112 #define SAL_PCI_CONFIG_READ 0x01000010
113 #define SAL_PCI_CONFIG_WRITE 0x01000011
114 #define SAL_FREQ_BASE 0x01000012
115 #define SAL_UPDATE_PAL 0x01000020
117 /* SAL_SET_VECTORS event handler types */
119 #define SAL_OS_INIT 1
120 #define SAL_OS_BOOT_RENDEZ 2
122 /* SAL_GET_STATE_INFO, SAL_GET_STATE_INFO_SIZE types */
123 #define SAL_INFO_MCA 0
124 #define SAL_INFO_INIT 1
125 #define SAL_INFO_CMC 2
126 #define SAL_INFO_CPE 3
127 #define SAL_INFO_TYPES 4 /* number of types we know about */
129 struct ia64_sal_result {
131 uint64_t sal_result[3];
134 typedef struct ia64_sal_result sal_entry_t(uint64_t, uint64_t, uint64_t,
135 uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);
137 extern sal_entry_t *ia64_sal_entry;
139 extern void ia64_sal_init(void);
141 #endif /* _MACHINE_SAL_H_ */