2aa62f2b |
1 | /* $NetBSD: sal.h,v 1.1 2006/04/07 14:21:18 cherry Exp $ */\r |
2 | \r |
3 | /*-\r |
4 | * Copyright (c) 2001 Doug Rabson\r |
5 | * All rights reserved.\r |
6 | *\r |
7 | * Redistribution and use in source and binary forms, with or without\r |
8 | * modification, are permitted provided that the following conditions\r |
9 | * are met:\r |
10 | * 1. Redistributions of source code must retain the above copyright\r |
11 | * notice, this list of conditions and the following disclaimer.\r |
12 | * 2. Redistributions in binary form must reproduce the above copyright\r |
13 | * notice, this list of conditions and the following disclaimer in the\r |
14 | * documentation and/or other materials provided with the distribution.\r |
15 | *\r |
16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\r |
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r |
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r |
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\r |
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r |
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r |
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r |
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r |
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r |
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r |
26 | * SUCH DAMAGE.\r |
27 | *\r |
28 | * $FreeBSD$\r |
29 | */\r |
30 | \r |
31 | #ifndef _MACHINE_SAL_H_\r |
32 | #define _MACHINE_SAL_H_\r |
33 | \r |
34 | struct sal_system_table {\r |
35 | char sal_signature[4];\r |
36 | #define SAL_SIGNATURE "SST_"\r |
37 | u_int32_t sal_length;\r |
38 | u_int8_t sal_rev[2];\r |
39 | u_int16_t sal_entry_count;\r |
40 | u_int8_t sal_checksum;\r |
41 | u_int8_t sal_reserved1[7];\r |
42 | u_int8_t sal_a_version[2];\r |
43 | u_int8_t sal_b_version[2];\r |
44 | char sal_oem_id[32];\r |
45 | char sal_product_id[32];\r |
46 | u_int8_t sal_reserved2[8];\r |
47 | };\r |
48 | \r |
49 | struct sal_entrypoint_descriptor {\r |
50 | u_int8_t sale_type; /* == 0 */\r |
51 | u_int8_t sale_reserved1[7];\r |
52 | u_int64_t sale_pal_proc;\r |
53 | u_int64_t sale_sal_proc;\r |
54 | u_int64_t sale_sal_gp;\r |
55 | u_int8_t sale_reserved2[16];\r |
56 | };\r |
57 | \r |
58 | struct sal_memory_descriptor {\r |
59 | u_int8_t sale_type; /* == 1 */\r |
60 | u_int8_t sale_need_virtual;\r |
61 | u_int8_t sale_current_attribute;\r |
62 | u_int8_t sale_access_rights;\r |
63 | u_int8_t sale_supported_attributes;\r |
64 | u_int8_t sale_reserved1;\r |
65 | u_int8_t sale_memory_type[2];\r |
66 | u_int64_t sale_physical_address;\r |
67 | u_int32_t sale_length;\r |
68 | u_int8_t sale_reserved2[12];\r |
69 | };\r |
70 | \r |
71 | struct sal_platform_descriptor {\r |
72 | u_int8_t sale_type; /* == 2 */\r |
73 | u_int8_t sale_features;\r |
74 | u_int8_t sale_reserved[14];\r |
75 | };\r |
76 | \r |
77 | struct sal_tr_descriptor {\r |
78 | u_int8_t sale_type; /* == 3 */\r |
79 | u_int8_t sale_register_type;\r |
80 | u_int8_t sale_register_number;\r |
81 | u_int8_t sale_reserved1[5];\r |
82 | u_int64_t sale_virtual_address;\r |
83 | u_int64_t sale_page_size;\r |
84 | u_int8_t sale_reserved2[8];\r |
85 | };\r |
86 | \r |
87 | struct sal_ptc_cache_descriptor {\r |
88 | u_int8_t sale_type; /* == 4 */\r |
89 | u_int8_t sale_reserved[3];\r |
90 | u_int32_t sale_domains;\r |
91 | u_int64_t sale_address;\r |
92 | };\r |
93 | \r |
94 | struct sal_ap_wakeup_descriptor {\r |
95 | u_int8_t sale_type; /* == 5 */\r |
96 | u_int8_t sale_mechanism;\r |
97 | u_int8_t sale_reserved[6];\r |
98 | u_int64_t sale_vector;\r |
99 | };\r |
100 | \r |
101 | /*\r |
102 | * SAL Procedure numbers.\r |
103 | */\r |
104 | \r |
105 | #define SAL_SET_VECTORS 0x01000000\r |
106 | #define SAL_GET_STATE_INFO 0x01000001\r |
107 | #define SAL_GET_STATE_INFO_SIZE 0x01000002\r |
108 | #define SAL_CLEAR_STATE_INFO 0x01000003\r |
109 | #define SAL_MC_RENDEZ 0x01000004\r |
110 | #define SAL_MC_SET_PARAMS 0x01000005\r |
111 | #define SAL_REGISTER_PHYSICAL_ADDR 0x01000006\r |
112 | #define SAL_CACHE_FLUSH 0x01000008\r |
113 | #define SAL_CACHE_INIT 0x01000009\r |
114 | #define SAL_PCI_CONFIG_READ 0x01000010\r |
115 | #define SAL_PCI_CONFIG_WRITE 0x01000011\r |
116 | #define SAL_FREQ_BASE 0x01000012\r |
117 | #define SAL_UPDATE_PAL 0x01000020\r |
118 | \r |
119 | /* SAL_SET_VECTORS event handler types */\r |
120 | #define SAL_OS_MCA 0\r |
121 | #define SAL_OS_INIT 1\r |
122 | #define SAL_OS_BOOT_RENDEZ 2\r |
123 | \r |
124 | /* SAL_GET_STATE_INFO, SAL_GET_STATE_INFO_SIZE types */\r |
125 | #define SAL_INFO_MCA 0\r |
126 | #define SAL_INFO_INIT 1\r |
127 | #define SAL_INFO_CMC 2\r |
128 | #define SAL_INFO_CPE 3\r |
129 | #define SAL_INFO_TYPES 4 /* number of types we know about */\r |
130 | \r |
131 | struct ia64_sal_result {\r |
132 | int64_t sal_status;\r |
133 | u_int64_t sal_result[3];\r |
134 | };\r |
135 | \r |
136 | typedef struct ia64_sal_result sal_entry_t\r |
137 | (u_int64_t, u_int64_t, u_int64_t, u_int64_t,\r |
138 | u_int64_t, u_int64_t, u_int64_t, u_int64_t);\r |
139 | \r |
140 | extern sal_entry_t *ia64_sal_entry;\r |
141 | \r |
142 | extern void ia64_sal_init(void);\r |
143 | \r |
144 | #endif /* _MACHINE_SAL_H_ */\r |