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

2023-09-11 Thread Karim Taha
Richard Henderson  wrote:

> On 8/27/23 08:57, Karim Taha wrote:
>> From: Stacey Son 
>> 
>> Signed-off-by: Stacey Son 
>> Signed-off-by: Karim Taha 
>> ---
>>   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 
>
>
> 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);



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

2023-08-29 Thread Richard Henderson

On 8/27/23 08:57, Karim Taha wrote:

From: Stacey Son 

Signed-off-by: Stacey Son 
Signed-off-by: Karim Taha 
---
  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 


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);





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

2023-08-28 Thread Karim Taha
From: Stacey Son 

Signed-off-by: Stacey Son 
Signed-off-by: Karim Taha 
---
 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 */
 
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);
-- 
2.40.0