]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/misc_protos.h
2 * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
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.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
32 #ifndef _I386_MISC_PROTOS_H_
33 #define _I386_MISC_PROTOS_H_
35 #include <machine/thread.h>
40 extern void vstart(vm_offset_t
);
41 extern void i386_init(vm_offset_t
);
42 extern void i386_vm_init(
47 extern void cpu_IA32e_enable(struct cpu_data
*);
48 extern void cpu_IA32e_disable(struct cpu_data
*);
49 extern void ml_load_desc64(void);
50 extern void ml_64bit_lldt(int);
54 extern void cpu_userwindow_init(int);
55 extern void cpu_physwindow_init(int);
58 extern void machine_startup(void);
60 extern void get_root_device(void);
61 extern void picinit(void);
62 extern void interrupt_processor(
64 extern void mp_probe_cpus(void);
65 extern void panic_io_port_read(void);
67 extern void remote_kdb(void);
68 extern void clear_kdb_intr(void);
69 extern void draw_panic_dialog(void);
70 extern void cpu_init(void);
72 extern void cpu_shutdown(void);
77 extern void fix_desc64(
82 extern void form_pic_mask(void);
85 extern char * i386_boot_info(
94 extern unsigned int div_scale(
95 unsigned int dividend
,
99 extern unsigned int mul_scale(
100 unsigned int multiplicand
,
101 unsigned int multiplier
,
102 unsigned int *scale
);
105 /* Move arbitrarily-aligned data from one physical address to another */
106 extern void bcopy_phys(addr64_t from
, addr64_t to
, vm_size_t nbytes
);
108 extern void ml_copy_phys(addr64_t
, addr64_t
, vm_size_t
);
110 /* Flush all cachelines for a page. */
111 extern void cache_flush_page_phys(ppnum_t pa
);
113 /* Flushing for incoherent I/O */
114 extern void dcache_incoherent_io_flush64(addr64_t pa
, unsigned int count
);
115 extern void dcache_incoherent_io_store64(addr64_t pa
, unsigned int count
);
118 extern processor_t
cpu_processor_alloc(boolean_t is_boot_cpu
);
119 extern void cpu_processor_free(processor_t proc
);
121 extern void *chudxnu_cpu_alloc(boolean_t is_boot_cpu
);
122 extern void chudxnu_cpu_free(void *);
124 extern void sysclk_gettime_interrupts_disabled(
125 mach_timespec_t
*cur_time
);
127 extern void rtc_nanotime_init_commpage(void);
129 extern void rtc_sleep_wakeup(uint64_t base
);
131 extern void rtc_lapic_start_ticking(void);
133 extern void rtc_clock_stepping(
134 uint32_t new_frequency
,
135 uint32_t old_frequency
);
136 extern void rtc_clock_stepped(
137 uint32_t new_frequency
,
138 uint32_t old_frequency
);
139 extern void rtc_clock_napped(uint64_t, uint64_t);
140 extern void rtc_clock_adjust(uint64_t);
142 extern void pmap_lowmem_finalize(void);
144 thread_t
Switch_context(thread_t
, thread_continue_t
, thread_t
);
145 thread_t
Shutdown_context(thread_t thread
, void (*doshutdown
)(processor_t
),processor_t processor
);
148 uint64_t x86_64_pre_sleep(void);
149 void x86_64_post_sleep(uint64_t new_cr3
);
153 debug_state_is_valid32(x86_debug_state32_t
*ds
);
156 debug_state_is_valid64(x86_debug_state64_t
*ds
);
159 copy_debug_state32(x86_debug_state32_t
*src
, x86_debug_state32_t
*target
, boolean_t all
);
162 copy_debug_state64(x86_debug_state64_t
*src
, x86_debug_state64_t
*target
, boolean_t all
);
164 /* Fast-restart parameters */
165 #define FULL_SLAVE_INIT (NULL)
166 #define FAST_SLAVE_INIT ((void *)(uintptr_t)1)
168 #endif /* _I386_MISC_PROTOS_H_ */