]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - sys/ia64/include/sal.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / sys / ia64 / include / sal.h
1 /*-
2  * Copyright (c) 2001 Doug Rabson
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
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.
13  *
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
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28
29 #ifndef _MACHINE_SAL_H_
30 #define _MACHINE_SAL_H_
31
32 struct sal_system_table {
33         char            sal_signature[4];
34 #define SAL_SIGNATURE   "SST_"
35         uint32_t        sal_length;
36         uint8_t         sal_rev[2];
37         uint16_t        sal_entry_count;
38         uint8_t         sal_checksum;
39         uint8_t         sal_reserved1[7];
40         uint8_t         sal_a_version[2];
41         uint8_t         sal_b_version[2];
42         char            sal_oem_id[32];
43         char            sal_product_id[32];
44         uint8_t         sal_reserved2[8];
45 };
46
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;
52         uint64_t        sale_sal_gp;
53         uint8_t         sale_reserved2[16];
54 };
55
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;
65         uint32_t        sale_length;
66         uint8_t         sale_reserved2[12];
67 };
68
69 struct sal_platform_descriptor {
70         uint8_t         sale_type;      /* == 2 */
71         uint8_t         sale_features;
72         uint8_t         sale_reserved[14];
73 };
74
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];
83 };
84
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;
90 };
91
92 struct sal_ap_wakeup_descriptor {
93         uint8_t         sale_type;      /* == 5 */
94         uint8_t         sale_mechanism;
95         uint8_t         sale_reserved[6];
96         uint64_t        sale_vector;
97 };
98
99 /*
100  * SAL Procedure numbers.
101  */
102
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
116
117 /* SAL_SET_VECTORS event handler types */
118 #define SAL_OS_MCA              0
119 #define SAL_OS_INIT             1
120 #define SAL_OS_BOOT_RENDEZ      2
121
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 */
128
129 struct ia64_sal_result {
130         int64_t         sal_status;
131         uint64_t        sal_result[3];
132 };
133
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);
136
137 extern sal_entry_t *ia64_sal_entry;
138
139 extern void ia64_sal_init(void);
140
141 #endif /* _MACHINE_SAL_H_ */