]> git.saurik.com Git - apple/xnu.git/blame - osfmk/i386/misc_protos.h
xnu-1504.9.17.tar.gz
[apple/xnu.git] / osfmk / i386 / misc_protos.h
CommitLineData
1c79356b 1/*
0b4c1975 2 * Copyright (c) 2000-2010 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
b0d623f7 40extern void vstart(vm_offset_t);
0c530ab8 41extern void i386_init(vm_offset_t);
0c530ab8 42extern void i386_vm_init(
2d21ac55
A
43 uint64_t,
44 boolean_t,
45 struct boot_args *);
b0d623f7 46#ifdef __i386__
0c530ab8
A
47extern void cpu_IA32e_enable(struct cpu_data *);
48extern void cpu_IA32e_disable(struct cpu_data *);
49extern void ml_load_desc64(void);
0c530ab8 50extern void ml_64bit_lldt(int);
b0d623f7
A
51#endif
52
53#if NCOPY_WINDOWS > 0
2d21ac55
A
54extern void cpu_userwindow_init(int);
55extern void cpu_physwindow_init(int);
b0d623f7 56#endif
91447636
A
57
58extern void machine_startup(void);
59
1c79356b
A
60extern void get_root_device(void);
61extern void picinit(void);
1c79356b
A
62extern void interrupt_processor(
63 int cpu);
64extern void mp_probe_cpus(void);
0c530ab8 65extern void panic_io_port_read(void);
2d21ac55 66
1c79356b
A
67extern void remote_kdb(void);
68extern void clear_kdb_intr(void);
55e303ae 69extern void draw_panic_dialog(void);
91447636 70extern void cpu_init(void);
b0d623f7 71#ifdef __i386__
1c79356b 72extern void cpu_shutdown(void);
b0d623f7 73#endif
1c79356b
A
74extern void fix_desc(
75 void * desc,
76 int num_desc);
0c530ab8
A
77extern void fix_desc64(
78 void * desc,
79 int num_desc);
1c79356b
A
80extern void cnpollc(
81 boolean_t on);
82extern void form_pic_mask(void);
83extern void intnull(
84 int unit);
85extern char * i386_boot_info(
86 char *buf,
87 vm_size_t buf_len);
88
89extern void blkclr(
90 const char *from,
91 int nbytes);
92
b0d623f7 93#ifdef __i386__
1c79356b
A
94extern unsigned int div_scale(
95 unsigned int dividend,
96 unsigned int divisor,
97 unsigned int *scale);
98
99extern unsigned int mul_scale(
100 unsigned int multiplicand,
101 unsigned int multiplier,
102 unsigned int *scale);
b0d623f7 103#endif
0b4e3aa0
A
104
105/* Move arbitrarily-aligned data from one physical address to another */
55e303ae
A
106extern void bcopy_phys(addr64_t from, addr64_t to, vm_size_t nbytes);
107
b0d623f7
A
108extern void ml_copy_phys(addr64_t, addr64_t, vm_size_t);
109
91447636
A
110/* Flush all cachelines for a page. */
111extern void cache_flush_page_phys(ppnum_t pa);
112
113/* Flushing for incoherent I/O */
114extern void dcache_incoherent_io_flush64(addr64_t pa, unsigned int count);
115extern void dcache_incoherent_io_store64(addr64_t pa, unsigned int count);
116
117
118extern processor_t cpu_processor_alloc(boolean_t is_boot_cpu);
119extern void cpu_processor_free(processor_t proc);
120
0c530ab8
A
121extern void *chudxnu_cpu_alloc(boolean_t is_boot_cpu);
122extern void chudxnu_cpu_free(void *);
123
91447636
A
124extern void sysclk_gettime_interrupts_disabled(
125 mach_timespec_t *cur_time);
126
0c530ab8 127extern void rtc_nanotime_init_commpage(void);
6601e61a 128
0c530ab8 129extern void rtc_sleep_wakeup(uint64_t base);
91447636 130
0c530ab8 131extern void rtc_lapic_start_ticking(void);
91447636
A
132
133extern void rtc_clock_stepping(
134 uint32_t new_frequency,
135 uint32_t old_frequency);
136extern void rtc_clock_stepped(
137 uint32_t new_frequency,
138 uint32_t old_frequency);
4a3eedf9 139extern void rtc_clock_napped(uint64_t, uint64_t);
0b4c1975 140extern void rtc_clock_adjust(uint64_t);
91447636 141
b0d623f7 142extern void pmap_lowmem_finalize(void);
0c530ab8 143
2d21ac55 144thread_t Switch_context(thread_t, thread_continue_t, thread_t);
b0d623f7
A
145thread_t Shutdown_context(thread_t thread, void (*doshutdown)(processor_t),processor_t processor);
146
147#ifdef __x86_64__
148uint64_t x86_64_pre_sleep(void);
149void x86_64_post_sleep(uint64_t new_cr3);
150#endif
151
152boolean_t
153debug_state_is_valid32(x86_debug_state32_t *ds);
154
155boolean_t
156debug_state_is_valid64(x86_debug_state64_t *ds);
157
158void
159copy_debug_state32(x86_debug_state32_t *src, x86_debug_state32_t *target, boolean_t all);
160
161void
162copy_debug_state64(x86_debug_state64_t *src, x86_debug_state64_t *target, boolean_t all);
163
164/* Fast-restart parameters */
165#define FULL_SLAVE_INIT (NULL)
166#define FAST_SLAVE_INIT ((void *)(uintptr_t)1)
0c530ab8 167
2d21ac55 168#endif /* _I386_MISC_PROTOS_H_ */