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;
76 extern vm_paddr_t paddr_max;
77 extern u_int busdma_swi_pending;
79 void *acpi_find_table(const char *sig);
80 void busdma_swi(void);
81 int copyout_regstack(struct thread *, uint64_t *, uint64_t *);
82 void cpu_mp_add(u_int, u_int, u_int);
83 int do_ast(struct trapframe *);
84 void ia32_trap(int, struct trapframe *);
85 int ia64_count_cpus(void);
86 int ia64_emulate(struct trapframe *, struct thread *);
87 int ia64_flush_dirty(struct thread *, struct _special *);
88 uint64_t ia64_get_hcdp(void);
89 int ia64_highfp_drop(struct thread *);
90 int ia64_highfp_enable(struct thread *, struct trapframe *);
91 int ia64_highfp_save(struct thread *);
92 int ia64_highfp_save_ipi(void);
93 struct ia64_init_return ia64_init(void);
94 u_int ia64_itc_freq(void);
95 int ia64_physmem_add(vm_paddr_t, vm_size_t);
96 void *ia64_physmem_alloc(vm_size_t, vm_size_t);
97 int ia64_physmem_delete(vm_paddr_t, vm_size_t);
98 int ia64_physmem_fini(void);
99 int ia64_physmem_init(void);
100 int ia64_physmem_track(vm_paddr_t, vm_size_t);
101 void ia64_probe_sapics(void);
102 void ia64_sync_icache(vm_offset_t, vm_size_t);
103 void interrupt(struct trapframe *);
104 void map_gateway_page(void);
105 void map_pal_code(void);
106 void map_vhpt(uintptr_t);
107 void os_boot_rendez(void);
109 int syscall(struct trapframe *);
110 void trap(int, struct trapframe *);
111 void trap_panic(int, struct trapframe *);
112 int unaligned_fixup(struct trapframe *, struct thread *);
116 #endif /* !_MACHINE_MD_VAR_H_ */