mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 19:09:31 +08:00
sim: syscall: add getpid support
Hoist the Blackfin implementation up to the common one.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2021-04-18 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* interp.c (bfin_syscall): Delete CB_SYS_getpid handling.
|
||||||
|
|
||||||
2021-04-12 Mike Frysinger <vapier@gentoo.org>
|
2021-04-12 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
|
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
|
||||||
|
@ -457,10 +457,6 @@ bfin_syscall (SIM_CPU *cpu)
|
|||||||
sc.result = setgid (sc.arg1);
|
sc.result = setgid (sc.arg1);
|
||||||
goto sys_finish;
|
goto sys_finish;
|
||||||
|
|
||||||
case CB_SYS_getpid:
|
|
||||||
tbuf += sprintf (tbuf, "getpid()");
|
|
||||||
sc.result = getpid ();
|
|
||||||
goto sys_finish;
|
|
||||||
case CB_SYS_kill:
|
case CB_SYS_kill:
|
||||||
tbuf += sprintf (tbuf, "kill(%u, %i)", args[0], args[1]);
|
tbuf += sprintf (tbuf, "kill(%u, %i)", args[0], args[1]);
|
||||||
/* Only let the app kill itself. */
|
/* Only let the app kill itself. */
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2021-04-18 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* syscall.c (cb_syscall): Implement CB_SYS_getpid.
|
||||||
|
|
||||||
2021-04-15 John Baldwin <jhb@FreeBSD.org>
|
2021-04-15 John Baldwin <jhb@FreeBSD.org>
|
||||||
|
|
||||||
* Make-common.in (CONFIG_CFLAGS): Remove SIM_EXTRA_CFLAGS.
|
* Make-common.in (CONFIG_CFLAGS): Remove SIM_EXTRA_CFLAGS.
|
||||||
|
@ -578,6 +578,10 @@ cb_syscall (host_callback *cb, CB_SYSCALL *sc)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CB_SYS_getpid:
|
||||||
|
result = getpid ();
|
||||||
|
break;
|
||||||
|
|
||||||
case CB_SYS_time :
|
case CB_SYS_time :
|
||||||
{
|
{
|
||||||
/* FIXME: May wish to change CB_SYS_time to something else.
|
/* FIXME: May wish to change CB_SYS_time to something else.
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2021-04-18 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* getpid.c: New test.
|
||||||
|
|
||||||
2021-04-08 Mike Frysinger <vapier@gentoo.org>
|
2021-04-08 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* allinsn.exp (arch): Delete.
|
* allinsn.exp (arch): Delete.
|
||||||
|
18
sim/testsuite/bfin/getpid.c
Normal file
18
sim/testsuite/bfin/getpid.c
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/* Basic getpid tests.
|
||||||
|
# mach: bfin
|
||||||
|
# cc: -msim
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
pid_t pid = getpid();
|
||||||
|
if (pid < 0) {
|
||||||
|
perror("getpid failed");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
puts("pass");
|
||||||
|
return 0;
|
||||||
|
}
|
Reference in New Issue
Block a user