diff mbox series

[04/32] bsd-user: Add freebsd_exec_common and do_freebsd_procctl to qemu.h.

Message ID 20230827155746.84781-5-kariem.taha2.7@gmail.com
State New
Headers show
Series bsd-user: Implement freebsd process related system calls. | expand

Commit Message

Karim Taha Aug. 27, 2023, 3:57 p.m. UTC
From: Stacey Son <sson@FreeBSD.org>

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
---
 bsd-user/main.c | 2 +-
 bsd-user/qemu.h | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

Comments

Richard Henderson Aug. 29, 2023, 7:14 p.m. UTC | #1
On 8/27/23 08:57, Karim Taha wrote:
> From: Stacey Son <sson@FreeBSD.org>
> 
> Signed-off-by: Stacey Son <sson@FreeBSD.org>
> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
> ---
>   bsd-user/main.c | 2 +-
>   bsd-user/qemu.h | 7 +++++++
>   2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/bsd-user/main.c b/bsd-user/main.c
> index 381bb18df8..b94b2d34b6 100644
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -88,7 +88,7 @@ unsigned long reserved_va = MAX_RESERVED_VA;
>   unsigned long reserved_va;
>   #endif
>   
> -static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
> +const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
>   const char *qemu_uname_release;
>   char qemu_proc_pathname[PATH_MAX];  /* full path to exeutable */
>   

Adding interp_prefix is unrelated.

Without that,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

> diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
> index 6724bb9f0a..23bbdd3e0c 100644
> --- a/bsd-user/qemu.h
> +++ b/bsd-user/qemu.h
> @@ -113,6 +113,7 @@ typedef struct TaskState {
>   } __attribute__((aligned(16))) TaskState;
>   
>   void stop_all_tasks(void);
> +extern const char *interp_prefix;
>   extern const char *qemu_uname_release;
>   
>   /*
> @@ -251,6 +252,12 @@ abi_long get_errno(abi_long ret);
>   bool is_error(abi_long ret);
>   int host_to_target_errno(int err);
>   
> +/* os-proc.c */
> +abi_long freebsd_exec_common(abi_ulong path_or_fd, abi_ulong guest_argp,
> +        abi_ulong guest_envp, int do_fexec);
> +abi_long do_freebsd_procctl(void *cpu_env, int idtype, abi_ulong arg2,
> +        abi_ulong arg3, abi_ulong arg4, abi_ulong arg5, abi_ulong arg6);
> +
>   /* os-sys.c */
>   abi_long do_freebsd_sysctl(CPUArchState *env, abi_ulong namep, int32_t namelen,
>           abi_ulong oldp, abi_ulong oldlenp, abi_ulong newp, abi_ulong newlen);
Karim Taha Sept. 11, 2023, 8:58 p.m. UTC | #2
Richard Henderson <richard.henderson@linaro.org> wrote:

> On 8/27/23 08:57, Karim Taha wrote:
>> From: Stacey Son <sson@FreeBSD.org>
>> 
>> Signed-off-by: Stacey Son <sson@FreeBSD.org>
>> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
>> ---
>>   bsd-user/main.c | 2 +-
>>   bsd-user/qemu.h | 7 +++++++
>>   2 files changed, 8 insertions(+), 1 deletion(-)
>> 
>> diff --git a/bsd-user/main.c b/bsd-user/main.c
>> index 381bb18df8..b94b2d34b6 100644
>> --- a/bsd-user/main.c
>> +++ b/bsd-user/main.c
>> @@ -88,7 +88,7 @@ unsigned long reserved_va = MAX_RESERVED_VA;
>>   unsigned long reserved_va;
>>   #endif
>>   
>> -static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
>> +const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
>>   const char *qemu_uname_release;
>>   char qemu_proc_pathname[PATH_MAX];  /* full path to exeutable */
>>   
>
> Adding interp_prefix is unrelated.
>
> Without that,
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
>
> r~
>
I grepped for `interp_prefix`, it's later used in the
`freebsd_exec_common` function definition, so do you mean I should add
it with the relevant commit that defines the function?

--
Karim Taha

>> diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
>> index 6724bb9f0a..23bbdd3e0c 100644
>> --- a/bsd-user/qemu.h
>> +++ b/bsd-user/qemu.h
>> @@ -113,6 +113,7 @@ typedef struct TaskState {
>>   } __attribute__((aligned(16))) TaskState;
>>   
>>   void stop_all_tasks(void);
>> +extern const char *interp_prefix;
>>   extern const char *qemu_uname_release;
>>   
>>   /*
>> @@ -251,6 +252,12 @@ abi_long get_errno(abi_long ret);
>>   bool is_error(abi_long ret);
>>   int host_to_target_errno(int err);
>>   
>> +/* os-proc.c */
>> +abi_long freebsd_exec_common(abi_ulong path_or_fd, abi_ulong guest_argp,
>> +        abi_ulong guest_envp, int do_fexec);
>> +abi_long do_freebsd_procctl(void *cpu_env, int idtype, abi_ulong arg2,
>> +        abi_ulong arg3, abi_ulong arg4, abi_ulong arg5, abi_ulong arg6);
>> +
>>   /* os-sys.c */
>>   abi_long do_freebsd_sysctl(CPUArchState *env, abi_ulong namep, int32_t namelen,
>>           abi_ulong oldp, abi_ulong oldlenp, abi_ulong newp, abi_ulong newlen);
diff mbox series

Patch

diff --git a/bsd-user/main.c b/bsd-user/main.c
index 381bb18df8..b94b2d34b6 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -88,7 +88,7 @@  unsigned long reserved_va = MAX_RESERVED_VA;
 unsigned long reserved_va;
 #endif
 
-static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
+const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
 const char *qemu_uname_release;
 char qemu_proc_pathname[PATH_MAX];  /* full path to exeutable */
 
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 6724bb9f0a..23bbdd3e0c 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -113,6 +113,7 @@  typedef struct TaskState {
 } __attribute__((aligned(16))) TaskState;
 
 void stop_all_tasks(void);
+extern const char *interp_prefix;
 extern const char *qemu_uname_release;
 
 /*
@@ -251,6 +252,12 @@  abi_long get_errno(abi_long ret);
 bool is_error(abi_long ret);
 int host_to_target_errno(int err);
 
+/* os-proc.c */
+abi_long freebsd_exec_common(abi_ulong path_or_fd, abi_ulong guest_argp,
+        abi_ulong guest_envp, int do_fexec);
+abi_long do_freebsd_procctl(void *cpu_env, int idtype, abi_ulong arg2,
+        abi_ulong arg3, abi_ulong arg4, abi_ulong arg5, abi_ulong arg6);
+
 /* os-sys.c */
 abi_long do_freebsd_sysctl(CPUArchState *env, abi_ulong namep, int32_t namelen,
         abi_ulong oldp, abi_ulong oldlenp, abi_ulong newp, abi_ulong newlen);