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