xref: /freebsd/sys/i386/include/md_var.h (revision d86c1f0dc1b17d94a533b4d3e9228dff9cb3fb31)
1b5e8ce9fSBruce Evans /*-
251369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
351369649SPedro F. Giffuni  *
4b5e8ce9fSBruce Evans  * Copyright (c) 1995 Bruce D. Evans.
5b5e8ce9fSBruce Evans  * All rights reserved.
6b5e8ce9fSBruce Evans  *
7b5e8ce9fSBruce Evans  * Redistribution and use in source and binary forms, with or without
8b5e8ce9fSBruce Evans  * modification, are permitted provided that the following conditions
9b5e8ce9fSBruce Evans  * are met:
10b5e8ce9fSBruce Evans  * 1. Redistributions of source code must retain the above copyright
11b5e8ce9fSBruce Evans  *    notice, this list of conditions and the following disclaimer.
12b5e8ce9fSBruce Evans  * 2. Redistributions in binary form must reproduce the above copyright
13b5e8ce9fSBruce Evans  *    notice, this list of conditions and the following disclaimer in the
14b5e8ce9fSBruce Evans  *    documentation and/or other materials provided with the distribution.
15b5e8ce9fSBruce Evans  * 3. Neither the name of the author nor the names of contributors
16b5e8ce9fSBruce Evans  *    may be used to endorse or promote products derived from this software
17b5e8ce9fSBruce Evans  *    without specific prior written permission.
18b5e8ce9fSBruce Evans  *
19b5e8ce9fSBruce Evans  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20b5e8ce9fSBruce Evans  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21b5e8ce9fSBruce Evans  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22b5e8ce9fSBruce Evans  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23b5e8ce9fSBruce Evans  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24b5e8ce9fSBruce Evans  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25b5e8ce9fSBruce Evans  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26b5e8ce9fSBruce Evans  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27b5e8ce9fSBruce Evans  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28b5e8ce9fSBruce Evans  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29b5e8ce9fSBruce Evans  * SUCH DAMAGE.
30b5e8ce9fSBruce Evans  *
31c3aac50fSPeter Wemm  * $FreeBSD$
32b5e8ce9fSBruce Evans  */
33b5e8ce9fSBruce Evans 
34b5e8ce9fSBruce Evans #ifndef _MACHINE_MD_VAR_H_
35b5e8ce9fSBruce Evans #define	_MACHINE_MD_VAR_H_
36b5e8ce9fSBruce Evans 
377c958a41SKonstantin Belousov #include <x86/x86_var.h>
38b5e8ce9fSBruce Evans 
397fb40488SJohn Baldwin extern	u_int	cyrix_did;
407fb40488SJohn Baldwin #if defined(I586_CPU) && !defined(NO_F00F_HACK)
417fb40488SJohn Baldwin extern	int	has_f00f_bug;
427fb40488SJohn Baldwin #endif
4323eeeff7SPeter Wemm #ifdef COMPAT_FREEBSD4
4423eeeff7SPeter Wemm extern	int	szfreebsd4_sigcode;
4523eeeff7SPeter Wemm #endif
4623eeeff7SPeter Wemm #ifdef COMPAT_43
4723eeeff7SPeter Wemm extern	int	szosigcode;
48*d86c1f0dSKonstantin Belousov extern	int	sz_lcall_tramp;
4923eeeff7SPeter Wemm #endif
504503a06eSPeter Wemm extern	uint32_t *vm_page_dump;
51*d86c1f0dSKonstantin Belousov extern  vm_offset_t proc0kstack;
52*d86c1f0dSKonstantin Belousov extern	uintptr_t setidt_disp;
53b5e8ce9fSBruce Evans 
5406d058bdSKonstantin Belousov struct	segment_descriptor;
557c958a41SKonstantin Belousov union savefpu;
56b5e8ce9fSBruce Evans 
57b63dc6adSAlfred Perlstein void	bcopyb(const void *from, void *to, size_t len);
58b63dc6adSAlfred Perlstein void	cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs));
59*d86c1f0dSKonstantin Belousov void	copyout_init_tramp(void);
60b63dc6adSAlfred Perlstein void	doreti_iret(void) __asm(__STRING(doreti_iret));
61b63dc6adSAlfred Perlstein void	doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault));
62b63dc6adSAlfred Perlstein void	doreti_popl_ds(void) __asm(__STRING(doreti_popl_ds));
63b63dc6adSAlfred Perlstein void	doreti_popl_ds_fault(void) __asm(__STRING(doreti_popl_ds_fault));
64b63dc6adSAlfred Perlstein void	doreti_popl_es(void) __asm(__STRING(doreti_popl_es));
65b63dc6adSAlfred Perlstein void	doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault));
66b63dc6adSAlfred Perlstein void	doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs));
67b63dc6adSAlfred Perlstein void	doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault));
6806d058bdSKonstantin Belousov void	fill_based_sd(struct segment_descriptor *sdp, uint32_t base);
69b63dc6adSAlfred Perlstein void	i686_pagezero(void *addr);
70977f9ab5SJeff Roberson void	sse2_pagezero(void *addr);
7114a3a6eaSPoul-Henning Kamp void	init_AMD_Elan_sc520(void);
72227f9a1cSJake Burkholder vm_paddr_t kvtop(void *addr);
7338605d73SJohn Baldwin void	panicifcpuunsupported(void);
74645b112bSJohn Baldwin void	ppro_reenable_apic(void);
75787f835bSKonstantin Belousov void	set_fsbase(struct thread *td, uint32_t base);
76787f835bSKonstantin Belousov void	set_gsbase(struct thread *td, uint32_t base);
77809dbbc9SBruce Evans void	setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec);
78*d86c1f0dSKonstantin Belousov void	setidt_nodisp(int idx, uintptr_t func, int typ, int dpl, int selec);
79824fc460SJohn Baldwin union savefpu *get_pcb_user_save_td(struct thread *td);
80824fc460SJohn Baldwin union savefpu *get_pcb_user_save_pcb(struct pcb *pcb);
81b5e8ce9fSBruce Evans 
82b5e8ce9fSBruce Evans #endif /* !_MACHINE_MD_VAR_H_ */
83