+
+/*
+ * This is where registers that are not normally specified by the mach-o
+ * file on an execve should be nullified, perhaps to avoid a covert channel.
+ * We've never bothered to clear FPRs or VRs, but it is important to clear
+ * the FPSCR, which is kept in the general state but not set by the general
+ * flavor (ie, PPC_THREAD_STATE or PPC_THREAD_STATE64.)
+ */
+kern_return_t
+machine_thread_state_initialize(
+ thread_t thread)
+{
+ savearea *sv;
+
+ sv = get_user_regs(thread); /* Find or allocate and initialize one */
+
+ sv->save_fpscr = 0; /* Clear all floating point exceptions */
+ sv->save_vrsave = 0; /* Set the vector save state */
+ sv->save_vscr[0] = 0x00000000;
+ sv->save_vscr[1] = 0x00000000;
+ sv->save_vscr[2] = 0x00000000;
+ sv->save_vscr[3] = 0x00010000; /* Disable java mode and clear saturated */
+
+ return KERN_SUCCESS;
+}
+
+