- th_act = (thread_act_t)get_firstthread(task);
- if (th_act == THREAD_NULL)
- goto errorLabel;
- ut = (uthread_t)get_bsdthread_info(th_act);
- locr0 = ut->uu_ar0;
-#if defined(i386)
- state_count = i386_NEW_THREAD_STATE_COUNT;
- if (act_machine_get_state(th_act, i386_NEW_THREAD_STATE, &statep, &state_count) != KERN_SUCCESS) {
- goto errorLabel;
- }
-#elif defined(ppc)
- state_count = PPC_THREAD_STATE_COUNT;
- if (act_machine_get_state(th_act, PPC_THREAD_STATE, &statep, &state_count) != KERN_SUCCESS) {
- goto errorLabel;
- }
-#else
-#error architecture not supported
-#endif
- if ((int)uap->addr != 1) {
-#if defined(i386)
- locr0[PC] = (int)uap->addr;
-#elif defined(ppc)
-#define ALIGNED(addr,size) (((unsigned)(addr)&((size)-1))==0)
- if (!ALIGNED((int)uap->addr, sizeof(int)))
- return (ERESTART);
-
- statep.srr0 = (int)uap->addr;
- state_count = PPC_THREAD_STATE_COUNT;
- if (act_machine_set_state(th_act, PPC_THREAD_STATE, &statep, &state_count) != KERN_SUCCESS) {
- goto errorLabel;
- }
-#undef ALIGNED
-#else
-#error architecture not implemented!
-#endif
- } /* (int)uap->addr != 1 */