2 * Copyright (c) 1998 Doug Rabson
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
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
29 #ifndef _MACHINE_MD_VAR_H_
30 #define _MACHINE_MD_VAR_H_
33 * Miscellaneous machine-dependent declarations.
41 #define FDESC_FUNC(fn) (((struct ia64_fdesc *) fn)->func)
42 #define FDESC_GP(fn) (((struct ia64_fdesc *) fn)->gp)
44 /* Convenience macros to decompose CFM & ar.pfs. */
45 #define IA64_CFM_SOF(x) ((x) & 0x7f)
46 #define IA64_CFM_SOL(x) (((x) >> 7) & 0x7f)
47 #define IA64_CFM_SOR(x) (((x) >> 14) & 0x0f)
48 #define IA64_CFM_RRB_GR(x) (((x) >> 18) & 0x7f)
49 #define IA64_CFM_RRB_FR(x) (((x) >> 25) & 0x7f)
50 #define IA64_CFM_RRB_PR(x) (((x) >> 32) & 0x3f)
52 /* Convenience function (inline) to adjust backingstore pointers. */
53 static __inline uint64_t
54 ia64_bsp_adjust(uint64_t bsp, int nslots)
56 int bias = ((unsigned int)bsp & 0x1f8) >> 3;
57 nslots += (nslots + bias + 63*8) / 63 - 8;
58 return bsp + (nslots << 3);
68 * Return value from ia64_init. Describes stack to switch to.
70 struct ia64_init_return {
75 extern uint64_t ia64_lapic_addr;
78 extern u_int busdma_swi_pending;
80 void *acpi_find_table(const char *sig);
81 void busdma_swi(void);
82 int copyout_regstack(struct thread *, uint64_t *, uint64_t *);
83 void cpu_mp_add(u_int, u_int, u_int);
84 int do_ast(struct trapframe *);
85 void ia32_trap(int, struct trapframe *);
86 int ia64_count_cpus(void);
87 int ia64_emulate(struct trapframe *, struct thread *);
88 int ia64_flush_dirty(struct thread *, struct _special *);
89 uint64_t ia64_get_hcdp(void);
90 int ia64_highfp_drop(struct thread *);
91 int ia64_highfp_enable(struct thread *, struct trapframe *);
92 int ia64_highfp_save(struct thread *);
93 int ia64_highfp_save_ipi(void);
94 struct ia64_init_return ia64_init(void);
95 u_int ia64_itc_freq(void);
96 void ia64_probe_sapics(void);
97 void ia64_sync_icache(vm_offset_t, vm_size_t);
98 void interrupt(struct trapframe *);
99 void map_gateway_page(void);
100 void map_pal_code(void);
101 void map_vhpt(uintptr_t);
102 void os_boot_rendez(void);
104 int syscall(struct trapframe *);
105 void trap(int, struct trapframe *);
106 void trap_panic(int, struct trapframe *);
107 int unaligned_fixup(struct trapframe *, struct thread *);
111 #endif /* !_MACHINE_MD_VAR_H_ */