]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ppc/cpu_data.h
xnu-344.tar.gz
[apple/xnu.git] / osfmk / ppc / cpu_data.h
index ebaf57d9069632c3f46c69b8034e3863a1c24c93..e97ccb86529c69a4392e9f02d24bd2edf3c52557 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef        PPC_CPU_DATA
 #define PPC_CPU_DATA
 
 #ifndef        PPC_CPU_DATA
 #define PPC_CPU_DATA
 
-#if    defined(__GNUC__)
 
 #define disable_preemption                     _disable_preemption
 #define enable_preemption                      _enable_preemption
 
 #define disable_preemption                     _disable_preemption
 #define enable_preemption                      _enable_preemption
 #define mp_enable_preemption                   _enable_preemption
 #define mp_enable_preemption_no_check          _enable_preemption_no_check
 
 #define mp_enable_preemption                   _enable_preemption
 #define mp_enable_preemption_no_check          _enable_preemption_no_check
 
-extern thread_t                                        current_thread(void);
+extern cpu_data_t*                             get_cpu_data(void);
+
+extern __inline__ thread_act_t current_act(void) 
+{
+       thread_act_t act;
+       __asm__ volatile("mfsprg %0,1" : "=r" (act));  
+       return act;
+}
+
+#define        current_thread()        current_act()->thread
+
+extern void                                    set_machine_current_thread(thread_t);
+extern void                                    set_machine_current_act(thread_act_t);
+
 extern int                                     get_preemption_level(void);
 extern void                                    disable_preemption(void);
 extern void                                    enable_preemption(void);
 extern int                                     get_preemption_level(void);
 extern void                                    disable_preemption(void);
 extern void                                    enable_preemption(void);
@@ -45,6 +57,5 @@ extern void                                   mp_disable_preemption(void);
 extern void                                    mp_enable_preemption(void);
 extern void                                    mp_enable_preemption_no_check(void);
 extern int                                     get_simple_lock_count(void);
 extern void                                    mp_enable_preemption(void);
 extern void                                    mp_enable_preemption_no_check(void);
 extern int                                     get_simple_lock_count(void);
-#endif /* defined(__GNUC__) */
 
 #endif /* PPC_CPU_DATA */
 
 #endif /* PPC_CPU_DATA */