[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Update kern/ directory to use mach_port_name_t.
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] Update kern/ directory to use mach_port_name_t. |
Date: |
Wed, 7 Dec 2022 23:26:36 +0100 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Applied, thanks!
Flavio Cruz, le mar. 06 déc. 2022 23:57:08 -0500, a ecrit:
> Make it clear where exactly we use port names vs port addresses.
> ---
> kern/boot_script.c | 4 ++--
> kern/boot_script.h | 4 ++--
> kern/bootstrap.c | 12 ++++++------
> kern/ipc_host.c | 2 +-
> kern/ipc_tt.c | 4 ++--
> kern/syscall_subr.c | 4 ++--
> kern/syscall_subr.h | 2 +-
> kern/syscall_sw.c | 2 +-
> 8 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/kern/boot_script.c b/kern/boot_script.c
> index 7e31075f..07ce4b35 100644
> --- a/kern/boot_script.c
> +++ b/kern/boot_script.c
> @@ -548,7 +548,7 @@ boot_script_exec (void)
> {
> char *p, buf[50];
> int len;
> - mach_port_t name;
> + mach_port_name_t name;
>
> if (arg->type == VAL_SYM)
> {
> @@ -750,7 +750,7 @@ main (int argc, char **argv)
> char buf[500], *p;
> int len;
> FILE *fp;
> - mach_port_t host_port, device_port;
> + mach_port_name_t host_port, device_port;
>
> if (argc < 2)
> {
> diff --git a/kern/boot_script.h b/kern/boot_script.h
> index c007d777..d1f968d6 100644
> --- a/kern/boot_script.h
> +++ b/kern/boot_script.h
> @@ -74,8 +74,8 @@ int boot_script_exec_cmd (void *hook,
> int boot_script_task_create (struct cmd *); /* task_create + task_suspend */
> int boot_script_task_resume (struct cmd *);
> int boot_script_prompt_task_resume (struct cmd *);
> -int boot_script_insert_right (struct cmd *, mach_port_t, mach_port_t *namep);
> -int boot_script_insert_task_port (struct cmd *, task_t, mach_port_t *namep);
> +int boot_script_insert_right (struct cmd *, mach_port_t, mach_port_name_t
> *namep);
> +int boot_script_insert_task_port (struct cmd *, task_t, mach_port_name_t
> *namep);
>
> /* The user must define this function to clean up the `task_t'
> returned by boot_script_task_create. */
> diff --git a/kern/bootstrap.c b/kern/bootstrap.c
> index 61f179cf..6593fed1 100644
> --- a/kern/bootstrap.c
> +++ b/kern/bootstrap.c
> @@ -77,8 +77,8 @@ extern struct multiboot_raw_info boot_info; /* XXX put this
> in a header! */
> #include "boot_script.h"
>
>
> -static mach_port_t boot_device_port; /* local name */
> -static mach_port_t boot_host_port; /* local name */
> +static mach_port_name_t boot_device_port; /* local name */
> +static mach_port_name_t boot_host_port; /* local name */
>
> extern char *kernel_cmdline;
>
> @@ -87,12 +87,12 @@ static void user_bootstrap_compat(void); /* forward */
> static void bootstrap_exec_compat(void *exec_data); /* forward */
> static void get_compat_strings(char *flags_str, char *root_str); /* forward
> */
>
> -static mach_port_t
> +static mach_port_name_t
> task_insert_send_right(
> task_t task,
> ipc_port_t port)
> {
> - mach_port_t name;
> + mach_port_name_t name;
>
> for (name = 1;; name++) {
> kern_return_t kr;
> @@ -902,7 +902,7 @@ boot_script_free_task (task_t task, int aborting)
> }
>
> int
> -boot_script_insert_right (struct cmd *cmd, mach_port_t port, mach_port_t
> *name)
> +boot_script_insert_right (struct cmd *cmd, mach_port_t port,
> mach_port_name_t *name)
> {
> *name = task_insert_send_right (cmd->task,
> ipc_port_make_send((ipc_port_t) port));
> @@ -910,7 +910,7 @@ boot_script_insert_right (struct cmd *cmd, mach_port_t
> port, mach_port_t *name)
> }
>
> int
> -boot_script_insert_task_port (struct cmd *cmd, task_t task, mach_port_t
> *name)
> +boot_script_insert_task_port (struct cmd *cmd, task_t task, mach_port_name_t
> *name)
> {
> *name = task_insert_send_right (cmd->task,
> ipc_port_make_send(task->itk_sself));
> diff --git a/kern/ipc_host.c b/kern/ipc_host.c
> index a02eb6f6..6163beff 100644
> --- a/kern/ipc_host.c
> +++ b/kern/ipc_host.c
> @@ -94,7 +94,7 @@ void ipc_host_init(void)
> * or other errors.
> */
>
> -mach_port_t
> +mach_port_name_t
> mach_host_self(void)
> {
> ipc_port_t sright;
> diff --git a/kern/ipc_tt.c b/kern/ipc_tt.c
> index 0b10204c..d2a22f9f 100644
> --- a/kern/ipc_tt.c
> +++ b/kern/ipc_tt.c
> @@ -511,7 +511,7 @@ retrieve_thread_exception(thread)
> * or other errors.
> */
>
> -mach_port_t
> +mach_port_name_t
> mach_task_self(void)
> {
> task_t task = current_task();
> @@ -532,7 +532,7 @@ mach_task_self(void)
> * or other errors.
> */
>
> -mach_port_t
> +mach_port_name_t
> mach_thread_self(void)
> {
> thread_t thread = current_thread();
> diff --git a/kern/syscall_subr.c b/kern/syscall_subr.c
> index 6d23462c..1aa4bc27 100644
> --- a/kern/syscall_subr.c
> +++ b/kern/syscall_subr.c
> @@ -152,8 +152,8 @@ void thread_switch_continue(void)
> * even if that violates priority order.
> */
> kern_return_t thread_switch(
> - mach_port_t thread_name,
> - int option,
> + mach_port_name_t thread_name,
> + int option,
> mach_msg_timeout_t option_time)
> {
> thread_t cur_thread = current_thread();
> diff --git a/kern/syscall_subr.h b/kern/syscall_subr.h
> index b6b61ab2..c9a2777f 100644
> --- a/kern/syscall_subr.h
> +++ b/kern/syscall_subr.h
> @@ -33,7 +33,7 @@
>
> extern int swtch(void);
> extern int swtch_pri(int);
> -extern int thread_switch(mach_port_t, int, mach_msg_timeout_t);
> +extern int thread_switch(mach_port_name_t, int, mach_msg_timeout_t);
> extern void thread_depress_timeout(thread_t);
> extern kern_return_t thread_depress_abort(thread_t);
> extern void mach_print(const char *);
> diff --git a/kern/syscall_sw.c b/kern/syscall_sw.c
> index a383e467..3cdefde1 100644
> --- a/kern/syscall_sw.c
> +++ b/kern/syscall_sw.c
> @@ -60,7 +60,7 @@
>
> boolean_t kern_invalid_debug = FALSE;
>
> -mach_port_t null_port(void)
> +mach_port_name_t null_port(void)
> {
> if (kern_invalid_debug) SoftDebugger("null_port mach trap");
> return(MACH_PORT_NULL);
> --
> 2.37.2
>
>
--
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.