]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - sys/ia64/include/md_var.h
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / sys / ia64 / include / md_var.h
1 /*-
2  * Copyright (c) 1998 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_MD_VAR_H_
30 #define _MACHINE_MD_VAR_H_
31
32 /*
33  * Miscellaneous machine-dependent declarations.
34  */
35
36 struct ia64_fdesc {
37         uint64_t        func;
38         uint64_t        gp;
39 };
40
41 #define FDESC_FUNC(fn)  (((struct ia64_fdesc *) fn)->func)
42 #define FDESC_GP(fn)    (((struct ia64_fdesc *) fn)->gp)
43
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)
51
52 /* Concenience function (inline) to adjust backingstore pointers. */
53 static __inline uint64_t
54 ia64_bsp_adjust(uint64_t bsp, int nslots)
55 {
56         int bias = ((unsigned int)bsp & 0x1f8) >> 3;
57         nslots += (nslots + bias + 63*8) / 63 - 8;
58         return bsp + (nslots << 3);
59 }
60
61 #ifdef _KERNEL
62
63 extern  char    sigcode[];
64 extern  char    esigcode[];
65 extern  int     szsigcode;
66 extern  long    Maxmem;
67
68 struct _special;
69 struct fpreg;
70 struct reg;
71 struct thread;
72 struct trapframe;
73
74 void    busdma_swi(void);
75 int     copyout_regstack(struct thread *, uint64_t *, uint64_t *);
76 void    cpu_mp_add(u_int, u_int, u_int);
77 int     do_ast(struct trapframe *);
78 void    ia32_trap(int, struct trapframe *);
79 int     ia64_count_cpus(void);
80 int     ia64_emulate(struct trapframe *, struct thread *);
81 int     ia64_flush_dirty(struct thread *, struct _special *);
82 uint64_t ia64_get_hcdp(void);
83 int     ia64_highfp_drop(struct thread *);
84 int     ia64_highfp_save(struct thread *);
85 void    ia64_init(void);
86 void    ia64_invalidate_icache(vm_offset_t, vm_size_t);
87 void    ia64_probe_sapics(void);
88 void    interrupt(struct trapframe *);
89 void    map_gateway_page(void);
90 void    map_pal_code(void);
91 void    map_vhpt(uintptr_t);
92 void    os_boot_rendez(void);
93 void    os_mca(void);
94 int     syscall(struct trapframe *);
95 void    trap(int, struct trapframe *);
96 void    trap_panic(int, struct trapframe *);
97 int     unaligned_fixup(struct trapframe *, struct thread *);
98
99 #endif  /* _KERNEL */
100
101 #endif /* !_MACHINE_MD_VAR_H_ */