sal.h revision 95244
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: head/sys/ia64/include/sal.h 95244 2002-04-22 06:35:40Z marcel $ 27 */ 28 29#ifndef _MACHINE_SAL_H_ 30#define _MACHINE_SAL_H_ 31 32struct sal_system_table { 33 char sal_signature[4]; 34 u_int32_t sal_length; 35 u_int8_t sal_rev[2]; 36 u_int16_t sal_entry_count; 37 u_int8_t sal_checksum; 38 u_int8_t sal_reserved1[7]; 39 u_int8_t sal_a_version[2]; 40 u_int8_t sal_b_version[2]; 41 char sal_oem_id[32]; 42 char sal_product_id[32]; 43 u_int8_t sal_reserved2[8]; 44}; 45 46struct sal_entrypoint_descriptor { 47 u_int8_t sale_type; /* == 0 */ 48 u_int8_t sale_reserved1[7]; 49 u_int64_t sale_pal_proc; 50 u_int64_t sale_sal_proc; 51 u_int64_t sale_sal_gp; 52 u_int8_t sale_reserved2[16]; 53}; 54 55struct sal_memory_descriptor { 56 u_int8_t sale_type; /* == 1 */ 57 u_int8_t sale_need_virtual; 58 u_int8_t sale_current_attribute; 59 u_int8_t sale_access_rights; 60 u_int8_t sale_supported_attributes; 61 u_int8_t sale_reserved1; 62 u_int8_t sale_memory_type[2]; 63 u_int64_t sale_physical_address; 64 u_int32_t sale_length; 65 u_int8_t sale_reserved2[12]; 66}; 67 68struct sal_platform_descriptor { 69 u_int8_t sale_type; /* == 2 */ 70 u_int8_t sale_features; 71 u_int8_t sale_reserved[14]; 72}; 73 74struct sal_tr_descriptor { 75 u_int8_t sale_type; /* == 3 */ 76 u_int8_t sale_register_type; 77 u_int8_t sale_register_number; 78 u_int8_t sale_reserved1[5]; 79 u_int64_t sale_virtual_address; 80 u_int64_t sale_page_size; 81 u_int8_t sale_reserved2[8]; 82}; 83 84struct sal_ptc_cache_descriptor { 85 u_int8_t sale_type; /* == 4 */ 86 u_int8_t sale_reserved[3]; 87 u_int32_t sale_domains; 88 u_int64_t sale_address; 89}; 90 91struct sal_ap_wakeup_descriptor { 92 u_int8_t sale_type; /* == 5 */ 93 u_int8_t sale_mechanism; 94 u_int8_t sale_reserved[6]; 95 u_int64_t sale_vector; 96}; 97 98/* 99 * SAL Procedure numbers. 100 */ 101 102#define SAL_SET_VECTORS 0x01000000 103#define SAL_GET_STATE_INFO 0x01000001 104#define SAL_GET_STATE_INFO_SIZE 0x01000002 105#define SAL_CLEAR_STATE_INFO 0x01000003 106#define SAL_MC_RENDEZ 0x01000004 107#define SAL_MC_SET_PARAMS 0x01000005 108#define SAL_REGISTER_PHYSICAL_ADDR 0x01000006 109#define SAL_CACHE_FLUSH 0x01000008 110#define SAL_CACHE_INIT 0x01000009 111#define SAL_PCI_CONFIG_READ 0x01000010 112#define SAL_PCI_CONFIG_WRITE 0x01000011 113#define SAL_FREQ_BASE 0x01000012 114#define SAL_UPDATE_PAL 0x01000020 115 116/* SAL_SET_VECTORS event handler types */ 117#define SAL_OS_MCA 0 118#define SAL_OS_INIT 1 119#define SAL_OS_BOOT_RENDEZ 2 120 121/* SAL_GET_STATE_INFO, SAL_GET_STATE_INFO_SIZE types */ 122#define SAL_INFO_MCA 0 123#define SAL_INFO_INIT 1 124#define SAL_INFO_CMC 2 125#define SAL_INFO_CPE 3 126#define SAL_INFO_TYPES 4 /* number of types we know about */ 127 128struct ia64_sal_result { 129 int64_t sal_status; 130 u_int64_t sal_result[3]; 131}; 132 133typedef struct ia64_sal_result sal_entry_t 134 (u_int64_t, u_int64_t, u_int64_t, u_int64_t, 135 u_int64_t, u_int64_t, u_int64_t, u_int64_t); 136 137extern sal_entry_t *ia64_sal_entry; 138 139extern void ia64_sal_init(struct sal_system_table *saltab); 140 141#endif /* _MACHINE_SAL_H_ */ 142