From: Diego Nieto Cid <[email protected]>

  * kern/task.h: add task_max_priority prototype
  * kern/bootstrap.c: call task_max_priority in
    boot_script_task_create to lower the task
    priority to BASEPRI_USER.
---
 kern/bootstrap.c | 2 ++
 kern/task.h      | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index 2ad11635..d5e26710 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -860,6 +860,8 @@ boot_script_task_create (struct cmd *cmd)
       return BOOT_SCRIPT_MACH_ERROR;
     }
   task_set_name(cmd->task, cmd->path);
+  task_max_priority(realhost.host_self, cmd->task,
+       BASEPRI_USER, TRUE, TRUE);
   return 0;
 }
 
diff --git a/kern/task.h b/kern/task.h
index a23c2d93..3eb77ee1 100644
--- a/kern/task.h
+++ b/kern/task.h
@@ -179,6 +179,12 @@ extern kern_return_t       task_assign_default(
 extern kern_return_t   task_set_name(
        task_t                  task,
        const_kernel_debug_name_t       name);
+extern kern_return_t   task_max_priority(
+       const ipc_port_t        host,
+       task_t                  task,
+       int                     max_priority,
+       boolean_t               set_priority,
+       boolean_t               change_threads);
 extern void consider_task_collect(void);
 
 /*
-- 
2.53.0


Reply via email to