1 #ifndef _ASM_IA64_SN_SN_SAL_H
2 #define _ASM_IA64_SN_SN_SAL_H
5 * System Abstraction Layer definitions for IA64
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
11 * Copyright (c) 2000-2002 Silicon Graphics, Inc. All rights reserved.
16 #include <asm/sn/sn_cpuid.h>
20 #define SN_SAL_POD_MODE 0x02000001
21 #define SN_SAL_SYSTEM_RESET 0x02000002
22 #define SN_SAL_PROBE 0x02000003
23 #define SN_SAL_GET_CONSOLE_NASID 0x02000004
24 #define SN_SAL_GET_KLCONFIG_ADDR 0x02000005
25 #define SN_SAL_LOG_CE 0x02000006
26 #define SN_SAL_REGISTER_CE 0x02000007
27 #define SN_SAL_CONSOLE_PUTC 0x02000021
28 #define SN_SAL_CONSOLE_GETC 0x02000022
29 #define SN_SAL_CONSOLE_PUTS 0x02000023
30 #define SN_SAL_CONSOLE_GETS 0x02000024
31 #define SN_SAL_CONSOLE_GETS_TIMEOUT 0x02000025
32 #define SN_SAL_CONSOLE_POLL 0x02000026
33 #define SN_SAL_CONSOLE_INTR 0x02000027
36 * Service-specific constants
38 #define SAL_CONSOLE_INTR_IN 0 /* manipulate input interrupts */
39 #define SAL_CONSOLE_INTR_OUT 1 /* manipulate output low-water
42 #define SAL_CONSOLE_INTR_OFF 0 /* turn the interrupt off */
43 #define SAL_CONSOLE_INTR_ON 1 /* turn the interrupt on */
48 u64 ia64_sn_probe_io_slot(long paddr, long size, void *data_ptr);
51 * Returns the master console nasid, if the call fails, return an illegal
55 ia64_sn_get_console_nasid(void)
57 struct ia64_sal_retval ret_stuff;
59 ret_stuff.status = (uint64_t)0;
60 ret_stuff.v0 = (uint64_t)0;
61 ret_stuff.v1 = (uint64_t)0;
62 ret_stuff.v2 = (uint64_t)0;
63 SAL_CALL(ret_stuff, SN_SAL_GET_CONSOLE_NASID, 0, 0, 0, 0, 0, 0, 0);
65 if (ret_stuff.status < 0)
66 return ret_stuff.status;
68 /* Master console nasid is in 'v0' */
73 ia64_sn_get_klconfig_addr(nasid_t nasid)
75 struct ia64_sal_retval ret_stuff;
76 extern u64 klgraph_addr[];
79 cnodeid = nasid_to_cnodeid(nasid);
80 if (klgraph_addr[cnodeid] == 0) {
81 ret_stuff.status = (uint64_t)0;
82 ret_stuff.v0 = (uint64_t)0;
83 ret_stuff.v1 = (uint64_t)0;
84 ret_stuff.v2 = (uint64_t)0;
85 SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0);
88 * We should panic if a valid cnode nasid does not produce
91 if (ret_stuff.status != 0) {
92 panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status);
95 klgraph_addr[cnodeid] = ret_stuff.v0;
97 return(klgraph_addr[cnodeid]);
101 * Returns the next console character.
104 ia64_sn_console_getc(int *ch)
106 struct ia64_sal_retval ret_stuff;
108 ret_stuff.status = (uint64_t)0;
109 ret_stuff.v0 = (uint64_t)0;
110 ret_stuff.v1 = (uint64_t)0;
111 ret_stuff.v2 = (uint64_t)0;
112 SAL_CALL(ret_stuff, SN_SAL_CONSOLE_GETC, 0, 0, 0, 0, 0, 0, 0);
114 /* character is in 'v0' */
115 *ch = (int)ret_stuff.v0;
117 return ret_stuff.status;
121 * Sends the given character to the console.
124 ia64_sn_console_putc(char ch)
126 struct ia64_sal_retval ret_stuff;
128 ret_stuff.status = (uint64_t)0;
129 ret_stuff.v0 = (uint64_t)0;
130 ret_stuff.v1 = (uint64_t)0;
131 ret_stuff.v2 = (uint64_t)0;
132 SAL_CALL(ret_stuff, SN_SAL_CONSOLE_PUTC, (uint64_t)ch, 0, 0, 0, 0, 0, 0);
134 return ret_stuff.status;
138 * Checks for console input.
141 ia64_sn_console_check(int *result)
143 struct ia64_sal_retval ret_stuff;
145 ret_stuff.status = (uint64_t)0;
146 ret_stuff.v0 = (uint64_t)0;
147 ret_stuff.v1 = (uint64_t)0;
148 ret_stuff.v2 = (uint64_t)0;
149 SAL_CALL(ret_stuff, SN_SAL_CONSOLE_POLL, 0, 0, 0, 0, 0, 0, 0);
151 /* result is in 'v0' */
152 *result = (int)ret_stuff.v0;
154 return ret_stuff.status;
157 #endif /* _ASM_IA64_SN_SN_SAL_H */