/* * Set up the initial state of a MACH thread */ void _pthread_setup(pthread_t thread, void (*routine)(pthread_t), vm_address_t vsp) { struct hp700_thread_state state; struct hp700_thread_state *ts = &state; kern_return_t r; mach_msg_type_number_t count; int *sp = (int *) vsp;; /* * Set up pa-risc registers & function call. */ count = HP700_THREAD_STATE_COUNT; MACH_CALL(thread_get_state(thread->kernel_thread, HP700_THREAD_STATE, (thread_state_t) &state, &count), r); ts->iioq_head = (int) routine; ts->iioq_tail = (int) routine + 4; ts->arg0 = (int) thread; ts->sp = vsp; ts->dp = _dp(); ts->rp = 0; ts->r3 = 0; sp[-1] = sp[-5] = 0; /* Clear saved SP and RP in frame. */ MACH_CALL(thread_set_state(thread->kernel_thread, HP700_THREAD_STATE, (thread_state_t) &state, HP700_THREAD_STATE_COUNT), r); }
float Units::dp(float value) { return _dp(value); }