mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
sim: syscall: add getpid support
Hoist the Blackfin implementation up to the common one.
This commit is contained in:
parent
d3b0ab8b36
commit
7da5cf78fb
@ -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>
|
||||
|
||||
* 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);
|
||||
goto sys_finish;
|
||||
|
||||
case CB_SYS_getpid:
|
||||
tbuf += sprintf (tbuf, "getpid()");
|
||||
sc.result = getpid ();
|
||||
goto sys_finish;
|
||||
case CB_SYS_kill:
|
||||
tbuf += sprintf (tbuf, "kill(%u, %i)", args[0], args[1]);
|
||||
/* 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>
|
||||
|
||||
* Make-common.in (CONFIG_CFLAGS): Remove SIM_EXTRA_CFLAGS.
|
||||
|
@ -578,6 +578,10 @@ cb_syscall (host_callback *cb, CB_SYSCALL *sc)
|
||||
}
|
||||
break;
|
||||
|
||||
case CB_SYS_getpid:
|
||||
result = getpid ();
|
||||
break;
|
||||
|
||||
case CB_SYS_time :
|
||||
{
|
||||
/* 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>
|
||||
|
||||
* 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user