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