@@ -362,6 +362,9 @@ fi
werror=""
+# tonygio04@aol.com
+enable_target_cpu_nptl="no"
+# tonygio04@aol.com
for opt do
optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
case "$opt" in
@@ -489,6 +492,10 @@ for opt do
;;
--disable-nptl) nptl="no"
;;
+# tonygio04@aol.com
+ --enable-target-cpu-nptl) enable_target_cpu_nptl="yes"
+ ;;
+# tonygio04@aol.com
--enable-mixemu) mixemu="yes"
;;
--disable-pthread) pthread="no"
@@ -633,6 +640,9 @@ echo " --disable-curl disable
echo " --disable-bluez disable bluez stack connectivity"
echo " --disable-kvm disable KVM acceleration support"
echo " --disable-nptl disable usermode NPTL support"
+# tonygio04@aol.com
+echo " --enable-target-cpu-nptl enable NPTL support for all target CPUs"
+# tonygio04@aol.com
echo " --enable-system enable all system emulation targets"
echo " --disable-system disable all system emulation targets"
echo " --enable-linux-user enable all linux usermode emulation
targets"
@@ -2065,6 +2075,22 @@ esac
if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
echo "TARGET_HAS_BFLT=y" >> $config_mak
fi
+
+# tonygio04@aol.com
+if test "$enable_target_cpu_nptl" = "yes" -a $(echo $target | cut -d - -f
2) != "softmmu"; then
+ target_nptl="yes"
+fi
+
+echo "*****"
+echo "target: " $target
+echo "target_cpu: " $target_cpu
+echo "target_user_only: " $target_user_only
+echo "nptl: " $nptl
+echo "enable_target_cpu_nptl: " $enable_target_cpu_nptl
+echo "target_nptl: " $target_nptl
+echo "*****"
+# tonygio04@aol.com
+
if test "$target_user_only" = "yes" \
-a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
echo "USE_NPTL=y" >> $config_mak
b/qemu-0.11.0/linux-user/main.c
@@ -37,6 +37,9 @@
#define DEBUG_LOGFILE "/tmp/qemu.log"
char *exec_path;
+//tonygio04@aol.com
+char *file_path;
+//tonygio04@aol.com
int singlestep;
@@ -2510,6 +2513,9 @@ int main(int argc, char **argv, char **e
usage();
filename = argv[optind];
exec_path = argv[optind];
+//tonygio04@aol.com
+ file_path = argv[0];
+//tonygio04@aol.com
/* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs));
b/qemu-0.11.0/linux-user/qemu.h
@@ -129,6 +129,9 @@ typedef struct TaskState {
} __attribute__((aligned(16))) TaskState;
extern char *exec_path;
+// tonygio04@aol.com
+extern char *file_path;
+// tonygio04@aol.com
void init_task_state(TaskState *ts);
void task_settid(TaskState *);
void stop_all_tasks(void);
b/qemu-0.11.0/linux-user/syscall.c
-0700
-0700
@@ -4291,6 +4291,7 @@ abi_long do_syscall(void *cpu_env, int n
unlock_user(p, arg2, 0);
break;
#endif
+//tonygio04@aol.com
case TARGET_NR_execve:
{
char **argp, **envp;
@@ -4300,6 +4301,7 @@ abi_long do_syscall(void *cpu_env, int n
abi_ulong guest_envp;
abi_ulong addr;
char **q;
+ int i=0;
argc = 0;
guest_argp = arg2;
@@ -4320,10 +4322,26 @@ abi_long do_syscall(void *cpu_env, int n
envc++;
}
- argp = alloca((argc + 1) * sizeof(void *));
- envp = alloca((envc + 1) * sizeof(void *));
+ if(do_strace)
+ {
+ i=2;
+ //add one more element to argc that is the path of the
qemu-i386
+ argp = alloca((argc + 3) * sizeof(void *));
+ envp = alloca((envc + 1) * sizeof(void *));
+ //put path of qemu-i386 as first element of argp and "-strace"
as second
+ *argp=file_path;
+ *(argp+1)=(char *)"-strace";
+ }
+ else{
+ i=1;
+ //add one more element to argc that is the path of the
qemu-i386
+ argp = alloca((argc + 2) * sizeof(void *));
+ envp = alloca((envc + 1) * sizeof(void *));
+ //put path of qemu-i386 as first element of argp
+ *argp=file_path;
+ }
- for (gp = guest_argp, q = argp; gp;
+ for (gp = guest_argp, q = argp+i; gp;
gp += sizeof(abi_ulong), q++) {
if (get_user_ual(addr, gp))
goto execve_efault;
@@ -4347,7 +4365,14 @@ abi_long do_syscall(void *cpu_env, int n
if (!(p = lock_user_string(arg1)))
goto execve_efault;
- ret = get_errno(execve(p, argp, envp));
+
+ //put in position i the name of program to execute
+ *(argp+i)=p;
+ printf("\nA new instance of QEMU-i386 will execute\n");
+ printf("the program called by the instruction exec\n\n");
+ ret = get_errno(execve(file_path, argp, envp));
+ printf("\nThe execve was not executed well!!!!!\n\n");
+
unlock_user(p, arg1, 0);
goto execve_end;
@@ -4372,6 +4397,7 @@ abi_long do_syscall(void *cpu_env, int n
}
}
break;
+//tonygio04@aol.com
case TARGET_NR_chdir:
if (!(p = lock_user_string(arg1)))
goto efault;
b/qemu-0.11.0/target-i386/cpu.h
@@ -918,4 +918,10 @@ void apic_init_reset(CPUState *env);
void apic_sipi(CPUState *env);
void do_cpu_init(CPUState *env);
void do_cpu_sipi(CPUState *env);
+
+//tonygio04@aol.com
+static inline void cpu_set_tls(CPUState *env, target_ulong newtls)
+{
+}
+//tonygio04@aol.com
#endif /* CPU_I386_H */