xref: /freebsd/sys/i386/include/md_var.h (revision 7c958a41fe6d7926706eff76e53d6c79f3df5d7b)
1b5e8ce9fSBruce Evans /*-
2b5e8ce9fSBruce Evans  * Copyright (c) 1995 Bruce D. Evans.
3b5e8ce9fSBruce Evans  * All rights reserved.
4b5e8ce9fSBruce Evans  *
5b5e8ce9fSBruce Evans  * Redistribution and use in source and binary forms, with or without
6b5e8ce9fSBruce Evans  * modification, are permitted provided that the following conditions
7b5e8ce9fSBruce Evans  * are met:
8b5e8ce9fSBruce Evans  * 1. Redistributions of source code must retain the above copyright
9b5e8ce9fSBruce Evans  *    notice, this list of conditions and the following disclaimer.
10b5e8ce9fSBruce Evans  * 2. Redistributions in binary form must reproduce the above copyright
11b5e8ce9fSBruce Evans  *    notice, this list of conditions and the following disclaimer in the
12b5e8ce9fSBruce Evans  *    documentation and/or other materials provided with the distribution.
13b5e8ce9fSBruce Evans  * 3. Neither the name of the author nor the names of contributors
14b5e8ce9fSBruce Evans  *    may be used to endorse or promote products derived from this software
15b5e8ce9fSBruce Evans  *    without specific prior written permission.
16b5e8ce9fSBruce Evans  *
17b5e8ce9fSBruce Evans  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18b5e8ce9fSBruce Evans  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19b5e8ce9fSBruce Evans  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20b5e8ce9fSBruce Evans  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21b5e8ce9fSBruce Evans  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22b5e8ce9fSBruce Evans  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23b5e8ce9fSBruce Evans  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24b5e8ce9fSBruce Evans  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25b5e8ce9fSBruce Evans  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26b5e8ce9fSBruce Evans  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27b5e8ce9fSBruce Evans  * SUCH DAMAGE.
28b5e8ce9fSBruce Evans  *
29c3aac50fSPeter Wemm  * $FreeBSD$
30b5e8ce9fSBruce Evans  */
31b5e8ce9fSBruce Evans 
32b5e8ce9fSBruce Evans #ifndef _MACHINE_MD_VAR_H_
33b5e8ce9fSBruce Evans #define	_MACHINE_MD_VAR_H_
34b5e8ce9fSBruce Evans 
35*7c958a41SKonstantin Belousov #include <x86/x86_var.h>
36b5e8ce9fSBruce Evans 
377fb40488SJohn Baldwin extern	u_int	cyrix_did;
387fb40488SJohn Baldwin #if defined(I586_CPU) && !defined(NO_F00F_HACK)
397fb40488SJohn Baldwin extern	int	has_f00f_bug;
407fb40488SJohn Baldwin #endif
4123eeeff7SPeter Wemm #ifdef COMPAT_FREEBSD4
4223eeeff7SPeter Wemm extern	int	szfreebsd4_sigcode;
4323eeeff7SPeter Wemm #endif
4423eeeff7SPeter Wemm #ifdef COMPAT_43
4523eeeff7SPeter Wemm extern	int	szosigcode;
4623eeeff7SPeter Wemm #endif
474503a06eSPeter Wemm extern	uint32_t *vm_page_dump;
48b5e8ce9fSBruce Evans 
49b63dc6adSAlfred Perlstein typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss);
5006d058bdSKonstantin Belousov struct	segment_descriptor;
51*7c958a41SKonstantin Belousov union savefpu;
52b5e8ce9fSBruce Evans 
53b63dc6adSAlfred Perlstein void	bcopyb(const void *from, void *to, size_t len);
54b63dc6adSAlfred Perlstein void	cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs));
55b63dc6adSAlfred Perlstein void	doreti_iret(void) __asm(__STRING(doreti_iret));
56b63dc6adSAlfred Perlstein void	doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault));
57b63dc6adSAlfred Perlstein void	doreti_popl_ds(void) __asm(__STRING(doreti_popl_ds));
58b63dc6adSAlfred Perlstein void	doreti_popl_ds_fault(void) __asm(__STRING(doreti_popl_ds_fault));
59b63dc6adSAlfred Perlstein void	doreti_popl_es(void) __asm(__STRING(doreti_popl_es));
60b63dc6adSAlfred Perlstein void	doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault));
61b63dc6adSAlfred Perlstein void	doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs));
62b63dc6adSAlfred Perlstein void	doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault));
637fb40488SJohn Baldwin void	finishidentcpu(void);
6406d058bdSKonstantin Belousov void	fill_based_sd(struct segment_descriptor *sdp, uint32_t base);
65b63dc6adSAlfred Perlstein void	i686_pagezero(void *addr);
66977f9ab5SJeff Roberson void	sse2_pagezero(void *addr);
6714a3a6eaSPoul-Henning Kamp void	init_AMD_Elan_sc520(void);
68227f9a1cSJake Burkholder vm_paddr_t kvtop(void *addr);
69645b112bSJohn Baldwin void	ppro_reenable_apic(void);
70809dbbc9SBruce Evans void	setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec);
71824fc460SJohn Baldwin union savefpu *get_pcb_user_save_td(struct thread *td);
72824fc460SJohn Baldwin union savefpu *get_pcb_user_save_pcb(struct pcb *pcb);
73824fc460SJohn Baldwin struct pcb *get_pcb_td(struct thread *td);
74b5e8ce9fSBruce Evans 
75b5e8ce9fSBruce Evans #endif /* !_MACHINE_MD_VAR_H_ */
76