xref: /netbsd/sys/arch/x86/include/machdep.h (revision 7756043f)
1*7756043fSriastradh /* $NetBSD: machdep.h,v 1.12 2021/10/28 10:45:48 riastradh Exp $ */
2b23cd354Scegger /*
3b23cd354Scegger  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
4b23cd354Scegger  * All rights reserved.
5b23cd354Scegger  *
6b23cd354Scegger  * Redistribution and use in source and binary forms, with or without
7b23cd354Scegger  * modification, are permitted provided that the following conditions
8b23cd354Scegger  * are met:
9b23cd354Scegger  * 1. Redistributions of source code must retain the above copyright
10b23cd354Scegger  *    notice, this list of conditions and the following disclaimer.
11b23cd354Scegger  * 2. Redistributions in binary form must reproduce the above copyright
12b23cd354Scegger  *    notice, this list of conditions and the following disclaimer in the
13b23cd354Scegger  *    documentation and/or other materials provided with the distribution.
14b23cd354Scegger  *
15b23cd354Scegger  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16b23cd354Scegger  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17b23cd354Scegger  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18b23cd354Scegger  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19b23cd354Scegger  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20b23cd354Scegger  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21b23cd354Scegger  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22b23cd354Scegger  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23b23cd354Scegger  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24b23cd354Scegger  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25b23cd354Scegger  * POSSIBILITY OF SUCH DAMAGE.
26b23cd354Scegger  */
27b23cd354Scegger 
28b23cd354Scegger #ifndef _X86_MACHDEP_H_
29b23cd354Scegger #define _X86_MACHDEP_H_
30b23cd354Scegger 
3187595df5Sriastradh #include <sys/kcore.h>
3287595df5Sriastradh 
33b23cd354Scegger extern phys_ram_seg_t mem_clusters[];
34b23cd354Scegger extern int mem_cluster_cnt;
35466dba5fScherry extern vaddr_t msgbuf_vaddr;
36466dba5fScherry extern unsigned int msgbuf_p_cnt;
37466dba5fScherry 
38b23cd354Scegger 
39b23cd354Scegger struct btinfo_memmap;
40b23cd354Scegger struct extent;
411b89113fSchristos struct sysctllog;
42b23cd354Scegger 
43466dba5fScherry struct msgbuf_p_seg {
44466dba5fScherry 	paddr_t paddr;
45466dba5fScherry 	psize_t sz;
46466dba5fScherry };
47466dba5fScherry 
48466dba5fScherry extern struct msgbuf_p_seg msgbuf_p_seg[];
49466dba5fScherry 
504d861e5bSjruoho void	x86_cpu_idle_init(void);
514d861e5bSjruoho void	x86_cpu_idle_get(void (**)(void), char *, size_t);
524f4a7a5dSjruoho void	x86_cpu_idle_set(void (*)(void), const char *, bool);
534d861e5bSjruoho 
5422e594a0Sbouyer extern u_long x86_rtclock_tval;
5522e594a0Sbouyer extern void (*x86_initclock_func)(void);
5622e594a0Sbouyer 
5722e594a0Sbouyer void x86_dummy_initclock(void);
5822e594a0Sbouyer 
5987595df5Sriastradh int	x86_select_freelist(uint64_t);
60b23cd354Scegger 
619f591920Smaxv void	init_x86_clusters(void);
629f591920Smaxv int	init_x86_vm(paddr_t);
63466dba5fScherry void	init_x86_msgbuf(void);
649f591920Smaxv 
659dbb22afSyamt void	x86_startup(void);
661b89113fSchristos void	x86_sysctl_machdep_setup(struct sysctllog **);
679dbb22afSyamt 
68*7756043fSriastradh void	x86_rndseed(void);
69*7756043fSriastradh 
70b23cd354Scegger #endif	/* _X86_MACHDEP_H_ */
71