1/*-
2 * Copyright (c) 2000 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_PAL_H_
30#define _MACHINE_PAL_H_
31
32/*
33 * Architected static calling convention procedures.
34 */
35#define PAL_CACHE_FLUSH		1
36#define PAL_CACHE_INFO		2
37#define PAL_CACHE_INIT		3
38#define PAL_CACHE_SUMMARY	4
39#define PAL_MEM_ATTRIB		5
40#define PAL_PTCE_INFO		6
41#define PAL_VM_INFO		7
42#define PAL_VM_SUMMARY		8
43#define PAL_BUS_GET_FEATURES	9
44#define PAL_BUS_SET_FEATURES	10
45#define PAL_DEBUG_INFO		11
46#define PAL_FIXED_ADDR		12
47#define PAL_FREQ_BASE		13
48#define PAL_FREQ_RATIOS		14
49#define PAL_PERF_MON_INFO	15
50#define PAL_PLATFORM_ADDR	16
51#define PAL_PROC_GET_FEATURE	17
52#define PAL_PROC_SET_FEATURE	18
53#define PAL_RSE_INFO		19
54#define PAL_VERSION		20
55#define PAL_MC_CLEAR_LOG	21
56#define PAL_MC_DRAIN		22
57#define	PAL_MC_EXPECTED		23
58#define PAL_MC_DYNAMIC_STATE	24
59#define PAL_MC_ERROR_INFO	25
60#define	PAL_MC_RESUME		26
61#define PAL_MC_REGISTER_MEM	27
62#define PAL_HALT		28
63#define PAL_HALT_LIGHT		29
64#define PAL_COPY_INFO		30
65#define PAL_CACHE_LINE_INIT	31
66#define PAL_PMI_ENTRYPOINT	32
67#define PAL_ENTER_IA_32_ENV	33
68#define PAL_VM_PAGE_SIZE	34
69#define	PAL_TEST_INFO		37
70#define PAL_CACHE_PROT_INFO	38
71#define PAL_REGISTER_INFO	39
72#define PAL_PREFETCH_VISIBILITY	41
73#define	PAL_LOGICAL_TO_PHYSICAL	42
74#define	PAL_CACHE_SHARED_INFO	43
75#define	PAL_PSTATE_INFO		44
76#define	PAL_SHUTDOWN		45
77#define	PAL_GET_HW_POLICY	48
78#define	PAL_SET_HW_POLICY	49
79
80/*
81 * Architected stacked calling convention procedures.
82 */
83#define PAL_COPY_PAL		256
84#define PAL_HALT_INFO		257
85#define PAL_TEST_PROC		258
86#define PAL_CACHE_READ		259
87#define PAL_CACHE_WRITE		260
88#define PAL_VM_TR_READ		261
89#define	PAL_GET_PSTATE		262
90#define	PAL_SET_PSTATE		263
91#define	PAL_VP_CREATE		265
92#define	PAL_VP_ENV_INFO		266
93#define	PAL_VP_EXIT_ENV		267
94#define	PAL_VP_INIT_ENV		268
95#define	PAL_VP_REGISTER		269
96#define	PAL_VP_RESTORE		270
97#define	PAL_VP_SAVE		271
98#define	PAL_VP_TERMINATE	272
99#define	PAL_BRAND_INFO		274
100#define	PAL_MC_ERROR_INJECT	276
101#define	PAL_MEMORY_BUFFER	277
102
103/*
104 * Default physical address of the Processor Interrupt Block (PIB).
105 * See also: IA-64 SDM, rev 1.1, volume 2, page 5-31.
106 */
107#define	PAL_PIB_DEFAULT_ADDR	0x00000000FEE00000L
108
109struct ia64_pal_result {
110	int64_t		pal_status;
111	uint64_t	pal_result[3];
112};
113
114struct ia64_pal_result ia64_pal_physical(u_long, u_long, u_long, u_long);
115
116struct ia64_pal_result ia64_call_pal_static(uint64_t proc, uint64_t arg1,
117    uint64_t arg2, uint64_t arg3);
118
119struct ia64_pal_result ia64_call_pal_stacked(uint64_t proc, uint64_t arg1,
120    uint64_t arg2, uint64_t arg3);
121
122#endif /* _MACHINE_PAL_H_ */
123