diff options
author | Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> | 2004-12-09 00:47:45 +0000 |
---|---|---|
committer | Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> | 2004-12-09 00:47:45 +0000 |
commit | 19e64aa99d52ec61c74a09d54b050adc59cdb88b (patch) | |
tree | 3fb037bbfcb7279054a86500ef09e778997a4808 /sim/m32r/traps-linux.c | |
parent | 1626ace5e4bc6df9ef9790e542a0f598b54ed702 (diff) | |
download | gdb-19e64aa99d52ec61c74a09d54b050adc59cdb88b.zip gdb-19e64aa99d52ec61c74a09d54b050adc59cdb88b.tar.gz gdb-19e64aa99d52ec61c74a09d54b050adc59cdb88b.tar.bz2 |
2004-12-09 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
Committed by Kei Sakamoto.
* traps-linux.c (m32r_trap): Add entries of the following dummy system
calls: __NR_mmap2, __NR_lchown32, __NR_getuid32, __NR_getgid32,
__NR_geteuid32, __NR_getegid32, __NR_getgroups32, __NR_fchown32,
__NR_setfsuid32, __NR_setfsgid32, __NR_getresuid32,
__NR_getresgid32 and __NR_chown32.
* syscall.h: Add new definitions of system call number.
Diffstat (limited to 'sim/m32r/traps-linux.c')
-rw-r--r-- | sim/m32r/traps-linux.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sim/m32r/traps-linux.c b/sim/m32r/traps-linux.c index a6362c1..f5b6783 100644 --- a/sim/m32r/traps-linux.c +++ b/sim/m32r/traps-linux.c @@ -384,6 +384,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) errcode = errno; break; + case __NR_lchown32: case __NR_lchown: result = lchown((char *) t2h_addr(cb, &s, arg1), (uid_t) arg2, (gid_t) arg3); @@ -400,6 +401,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) errcode = errno; break; + case __NR_getuid32: case __NR_getuid: result = getuid(); errcode = errno; @@ -483,16 +485,19 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) //result = arg1; break; + case __NR_getgid32: case __NR_getgid: result = getgid(); errcode = errno; break; + case __NR_geteuid32: case __NR_geteuid: result = geteuid(); errcode = errno; break; + case __NR_getegid32: case __NR_getegid: result = getegid(); errcode = errno; @@ -592,6 +597,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) } break; + case __NR_getgroups32: case __NR_getgroups: { gid_t *list; @@ -750,6 +756,33 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) } break; #endif + case __NR_mmap2: + { + void *addr; + size_t len; + int prot, flags, fildes; + off_t off; + + addr = (void *) t2h_addr(cb, &s, arg1); + len = arg2; + prot = arg3; + flags = arg4; + fildes = arg5; + off = arg6 << 12; + + result = (int) mmap(addr, len, prot, flags, fildes, off); + errcode = errno; + if (result != -1) + { + char c; + if (sim_core_read_buffer (sd, NULL, read_map, &c, result, 1) == 0) + sim_core_attach (sd, NULL, + 0, access_read_write_exec, 0, + result, len, 0, NULL, NULL); + } + } + break; + case __NR_mmap: { void *addr; @@ -813,6 +846,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) errcode = errno; break; + case __NR_fchown32: case __NR_fchown: result = fchown(arg1, arg2, arg3); errcode = errno; @@ -1100,11 +1134,13 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) errcode = errno; break; + case __NR_setfsuid32: case __NR_setfsuid: result = setfsuid(arg1); errcode = errno; break; + case __NR_setfsgid32: case __NR_setfsgid: result = setfsgid(arg1); errcode = errno; @@ -1231,6 +1267,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) errcode = errno; break; + case __NR_getresuid32: case __NR_getresuid: { uid_t ruid, euid, suid; @@ -1261,6 +1298,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) } break; + case __NR_getresgid32: case __NR_getresgid: { uid_t rgid, egid, sgid; @@ -1287,6 +1325,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) errcode = errno; break; + case __NR_chown32: case __NR_chown: result = chown((char *) t2h_addr(cb, &s, arg1), arg2, arg3); errcode = errno; |