]> git.saurik.com Git - apple/xnu.git/blame - osfmk/i386/misc_protos.h
xnu-4570.71.2.tar.gz
[apple/xnu.git] / osfmk / i386 / misc_protos.h
CommitLineData
1c79356b 1/*
39236c6e 2 * Copyright (c) 2000-2012 Apple Inc. All rights reserved.
1c79356b 3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
1c79356b 5 *
2d21ac55
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
8f6c56a5 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
8f6c56a5 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31
0c530ab8
A
32#ifndef _I386_MISC_PROTOS_H_
33#define _I386_MISC_PROTOS_H_
34
b0d623f7 35#include <machine/thread.h>
1c79356b 36
0c530ab8
A
37struct boot_args;
38struct cpu_data;
39
316670eb
A
40extern boolean_t virtualized;
41
b0d623f7 42extern void vstart(vm_offset_t);
7ddcb079 43extern void i386_init(void);
316670eb 44extern void x86_init_wrapper(uintptr_t, uintptr_t) __attribute__((noreturn));
0c530ab8 45extern void i386_vm_init(
2d21ac55
A
46 uint64_t,
47 boolean_t,
48 struct boot_args *);
b0d623f7
A
49
50#if NCOPY_WINDOWS > 0
2d21ac55
A
51extern void cpu_userwindow_init(int);
52extern void cpu_physwindow_init(int);
b0d623f7 53#endif
91447636
A
54
55extern void machine_startup(void);
56
1c79356b
A
57extern void get_root_device(void);
58extern void picinit(void);
1c79356b
A
59extern void interrupt_processor(
60 int cpu);
61extern void mp_probe_cpus(void);
0c530ab8 62extern void panic_io_port_read(void);
2d21ac55 63
1c79356b
A
64extern void remote_kdb(void);
65extern void clear_kdb_intr(void);
91447636 66extern void cpu_init(void);
1c79356b
A
67extern void fix_desc(
68 void * desc,
69 int num_desc);
0c530ab8
A
70extern void fix_desc64(
71 void * desc,
72 int num_desc);
1c79356b
A
73extern void cnpollc(
74 boolean_t on);
75extern void form_pic_mask(void);
76extern void intnull(
77 int unit);
78extern char * i386_boot_info(
79 char *buf,
80 vm_size_t buf_len);
81
82extern void blkclr(
83 const char *from,
84 int nbytes);
85
3e170ce0
A
86extern void memset_word(
87 int *dst,
88 int pattern,
89 int nwords);
90
0b4e3aa0
A
91
92/* Move arbitrarily-aligned data from one physical address to another */
55e303ae
A
93extern void bcopy_phys(addr64_t from, addr64_t to, vm_size_t nbytes);
94
6d2010ae
A
95/* allow a function to get a quick virtual mapping of a physical page */
96extern int apply_func_phys(addr64_t src64, vm_size_t bytes, int (*func)(void * buffer, vm_size_t bytes, void * arg), void * arg);
97
39236c6e 98extern int ml_copy_phys(addr64_t, addr64_t, vm_size_t);
b0d623f7 99
91447636
A
100/* Flush all cachelines for a page. */
101extern void cache_flush_page_phys(ppnum_t pa);
102
103/* Flushing for incoherent I/O */
104extern void dcache_incoherent_io_flush64(addr64_t pa, unsigned int count);
105extern void dcache_incoherent_io_store64(addr64_t pa, unsigned int count);
106
107
108extern processor_t cpu_processor_alloc(boolean_t is_boot_cpu);
109extern void cpu_processor_free(processor_t proc);
110
111extern void sysclk_gettime_interrupts_disabled(
112 mach_timespec_t *cur_time);
113
0c530ab8 114extern void rtc_nanotime_init_commpage(void);
6601e61a 115
0c530ab8 116extern void rtc_sleep_wakeup(uint64_t base);
91447636 117
060df5ea 118extern void rtc_timer_start(void);
91447636
A
119
120extern void rtc_clock_stepping(
121 uint32_t new_frequency,
122 uint32_t old_frequency);
123extern void rtc_clock_stepped(
124 uint32_t new_frequency,
125 uint32_t old_frequency);
4a3eedf9 126extern void rtc_clock_napped(uint64_t, uint64_t);
0b4c1975 127extern void rtc_clock_adjust(uint64_t);
91447636 128
b0d623f7 129extern void pmap_lowmem_finalize(void);
0c530ab8 130
2d21ac55 131thread_t Switch_context(thread_t, thread_continue_t, thread_t);
b0d623f7
A
132thread_t Shutdown_context(thread_t thread, void (*doshutdown)(processor_t),processor_t processor);
133
134#ifdef __x86_64__
135uint64_t x86_64_pre_sleep(void);
136void x86_64_post_sleep(uint64_t new_cr3);
137#endif
138
139boolean_t
140debug_state_is_valid32(x86_debug_state32_t *ds);
141
142boolean_t
143debug_state_is_valid64(x86_debug_state64_t *ds);
144
145void
146copy_debug_state32(x86_debug_state32_t *src, x86_debug_state32_t *target, boolean_t all);
147
148void
149copy_debug_state64(x86_debug_state64_t *src, x86_debug_state64_t *target, boolean_t all);
150
6d2010ae
A
151extern void act_machine_switch_pcb(thread_t old, thread_t new);
152
b0d623f7
A
153/* Fast-restart parameters */
154#define FULL_SLAVE_INIT (NULL)
155#define FAST_SLAVE_INIT ((void *)(uintptr_t)1)
0c530ab8 156
bd504ef0 157void cpu_pmc_control(void *);
fe8ab488
A
158
159extern void pstate_trace(void);
160
5ba3f43e
A
161extern void mp_interrupt_watchdog(void);
162
2d21ac55 163#endif /* _I386_MISC_PROTOS_H_ */