]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/pal_native.h
2 * Copyright (c) 2009 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@
28 #ifndef _I386_PAL_I386_H
29 #define _I386_PAL_I386_H
31 #ifdef XNU_KERNEL_PRIVATE
33 /* No-op on bare-metal */
34 #define pal_dbg_page_fault(x, y, z)
35 #define pal_dbg_set_task_name( x )
36 #define pal_set_signal_delivery( x )
38 #define pal_is_usable_memory(b, t) (TRUE)
40 #define pal_hlt() __asm__ volatile ("sti; hlt")
41 #define pal_sti() __asm__ volatile ("sti")
42 #define pal_cli() __asm__ volatile ("cli")
45 void pal_stop_cpu(boolean_t cli
)
48 __asm__
volatile ( "cli" );
49 __asm__
volatile ( "wbinvd; hlt" );
52 #define pal_register_cache_state(t, v)
54 #define pal_execve_return(t)
55 #define pal_thread_terminate_self(t)
56 #define pal_ast_check(t)
57 #define pal_switch_pmap(t,u,v)
59 #define panic_display_pal_info() do { } while(0)
60 #define pal_kernel_announce() do { } while(0)
62 #define PAL_AICPM_PROPERTY_VALUE 0
64 #define pal_pmc_swi() __asm__ __volatile__("int %0"::"i"(LAPIC_PMC_SWI_VECTOR):"memory")
66 /* Macro used by non-native xnus for access to low globals when it may
69 #define PAL_KDP_ADDR(x) (x)
71 struct pal_rtc_nanotime
{
72 volatile uint64_t tsc_base
; /* timestamp */
73 volatile uint64_t ns_base
; /* nanoseconds */
74 uint32_t scale
; /* tsc -> nanosec multiplier */
75 uint32_t shift
; /* shift is nonzero only on "slow" machines, */
76 /* ie where tscFreq <= SLOW_TSC_THRESHOLD */
77 volatile uint32_t generation
; /* 0 == being updated */
82 #ifdef MACH_KERNEL_PRIVATE
92 struct pal_apic_table
{
96 #endif /* MACH_KERNEL_PRIVATE */
98 #endif /* XNU_KERNEL_PRIVATE */
100 #endif /* _I386_PAL_I386_H */