/*
- * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#include <mach/i386/fp_reg.h>
#include <mach/thread_status.h>
-#include <kern/lock.h>
+#include <kern/simple_lock.h>
#include <i386/iopb.h>
#include <i386/seg.h>
* as saved in a context-switch. It lives at the base of the stack.
*/
-#ifdef __i386__
-struct x86_kernel_state {
- uint32_t k_ebx; /* kernel context */
- uint32_t k_esp;
- uint32_t k_ebp;
- uint32_t k_edi;
- uint32_t k_esi;
- uint32_t k_eip;
- /*
- * Kernel stacks are 16-byte aligned with x86_kernel_state at the top,
- * so we need a couple of dummy 32-bit words here.
- */
- uint32_t dummy[2];
-};
-#else
struct x86_kernel_state {
uint64_t k_rbx; /* kernel context */
uint64_t k_rsp;
uint64_t k_r15;
uint64_t k_rip;
};
-#endif
/*
* Maps state flavor to number of words in the state:
*/
-__private_extern__ unsigned int _MachineStateCount[];
+extern unsigned int _MachineStateCount[];
/*
* The machine-dependent thread state - registers and all platform-dependent
* as the PCB.
*/
struct machine_thread {
- void *sf;
x86_saved_state_t *iss;
void *ifps;
void *ids;
decl_simple_lock_data(,lock); /* protects ifps and ids */
uint64_t iss_pte0;
uint64_t iss_pte1;
- uint32_t arg_store_valid;
+
#ifdef MACH_BSD
uint64_t cthread_self; /* for use of cthread package */
struct real_descriptor cthread_desc;
#endif
struct pal_pcb pal_pcb;
-
uint32_t specFlags;
+ /* N.B.: These "specFlags" are read-modify-written non-atomically within
+ * the copyio routine. So conceivably any exception that modifies the
+ * flags in a persistent manner could be clobbered if it occurs within
+ * a copyio context. For now, the only other flag here is OnProc which
+ * is not modified except at context switch.
+ */
#define OnProc 0x1
#define CopyIOActive 0x2 /* Checked to ensure DTrace actions do not re-enter copyio(). */
-
+ uint64_t thread_gpu_ns;
#if NCOPY_WINDOWS > 0
struct {
user_addr_t user_base;
extern void act_thread_catt(void *ctx);
extern void act_thread_cfree(void *ctx);
+#define FIND_PERFCONTROL_STATE(th) (PERFCONTROL_STATE_NULL)
/*
* On the kernel stack is: