1*ea36eac5Sriastradh /* $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 31cd2156f4Sriastradh #include <sys/kcore.h> 32cd2156f4Sriastradh 33b23cd354Scegger extern phys_ram_seg_t mem_clusters[]; 34b23cd354Scegger extern int mem_cluster_cnt; 359db6d218Scherry extern vaddr_t msgbuf_vaddr; 369db6d218Scherry extern unsigned int msgbuf_p_cnt; 379db6d218Scherry 38b23cd354Scegger 39b23cd354Scegger struct btinfo_memmap; 40b23cd354Scegger struct extent; 4137ddcb99Schristos struct sysctllog; 42b23cd354Scegger 439db6d218Scherry struct msgbuf_p_seg { 449db6d218Scherry paddr_t paddr; 459db6d218Scherry psize_t sz; 469db6d218Scherry }; 479db6d218Scherry 489db6d218Scherry extern struct msgbuf_p_seg msgbuf_p_seg[]; 499db6d218Scherry 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 54c24c993fSbouyer extern u_long x86_rtclock_tval; 55c24c993fSbouyer extern void (*x86_initclock_func)(void); 56c24c993fSbouyer 57c24c993fSbouyer void x86_dummy_initclock(void); 58c24c993fSbouyer 59cd2156f4Sriastradh int x86_select_freelist(uint64_t); 60b23cd354Scegger 61404effc7Smaxv void init_x86_clusters(void); 62404effc7Smaxv int init_x86_vm(paddr_t); 639db6d218Scherry void init_x86_msgbuf(void); 64404effc7Smaxv 659dbb22afSyamt void x86_startup(void); 6637ddcb99Schristos void x86_sysctl_machdep_setup(struct sysctllog **); 679dbb22afSyamt 68*ea36eac5Sriastradh void x86_rndseed(void); 69*ea36eac5Sriastradh 70b23cd354Scegger #endif /* _X86_MACHDEP_H_ */ 71