Skip to content

Commit

Permalink
riscv64: Do post-merge sync
Browse files Browse the repository at this point in the history
  • Loading branch information
petrpavlu committed Jun 15, 2024
1 parent 95363b1 commit a6942c1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
1 change: 0 additions & 1 deletion VEX/priv/host_riscv64_isel.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ typedef struct {

static HReg lookupIRTemp(ISelEnv* env, IRTemp tmp)
{
vassert(tmp >= 0);
vassert(tmp < env->n_vregmap);
return env->vregmap[tmp];
}
Expand Down
11 changes: 6 additions & 5 deletions coregrind/m_sigframe/sigframe-riscv64-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,10 @@ void VG_(sigframe_create)(ThreadId tid,
VG_(set_IP)(tid, (Addr)handler);

if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg,
"sigframe_create (thread %u): next pc=%#lx, next sp=%#lx\n",
tid, (Addr)handler, sp);
VG_(message)(
Vg_DebugMsg,
"VG_(sigframe_create) (thread %u): next pc=%#lx, next sp=%#lx\n", tid,
(Addr)handler, sp);
}

/*------------------------------------------------------------*/
Expand Down Expand Up @@ -408,8 +409,8 @@ void VG_(sigframe_destroy)(ThreadId tid, Bool isRT)

/* Returning from a signal handler. */
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg, "sigframe_return (thread %u): pc=%#lx\n", tid,
VG_(get_IP)(tid));
VG_(message)(Vg_DebugMsg, "VG_(sigframe_destroy) (thread %u): pc=%#lx\n",
tid, VG_(get_IP)(tid));

/* Tell the tools. */
VG_TRACK(post_deliver_signal, tid, sigNo);
Expand Down
8 changes: 7 additions & 1 deletion coregrind/m_syswrap/syswrap-riscv64-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static SyscallTableEntry syscall_main_table[] = {
LINX_(__NR_fchownat, sys_fchownat), /* 54 */
GENX_(__NR_fchown, sys_fchown), /* 55 */
LINXY(__NR_openat, sys_openat), /* 56 */
GENXY(__NR_close, sys_close), /* 57 */
GENX_(__NR_close, sys_close), /* 57 */
LINX_(__NR_vhangup, sys_vhangup), /* 58 */
LINXY(__NR_pipe2, sys_pipe2), /* 59 */
LINX_(__NR_quotactl, sys_quotactl), /* 60 */
Expand Down Expand Up @@ -568,6 +568,7 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY(__NR_bpf, sys_bpf), /* 280 */
LINX_(__NR_execveat, sys_execveat), /* 281 */
LINX_(__NR_membarrier, sys_membarrier), /* 283 */
GENX_(__NR_mlock2, sys_mlock2), /* 284 */
LINX_(__NR_copy_file_range, sys_copy_file_range), /* 285 */
LINXY(__NR_preadv2, sys_preadv2), /* 286 */
LINX_(__NR_pwritev2, sys_pwritev2), /* 287 */
Expand All @@ -576,10 +577,15 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY(__NR_io_uring_setup, sys_io_uring_setup), /* 425 */
LINXY(__NR_io_uring_enter, sys_io_uring_enter), /* 426 */
LINXY(__NR_io_uring_register, sys_io_uring_register), /* 427 */
LINXY(__NR_pidfd_open, sys_pidfd_open), /* 434 */
GENX_(__NR_clone3, sys_ni_syscall), /* 435 */
LINXY(__NR_close_range, sys_close_range), /* 436 */
LINXY(__NR_openat2, sys_openat2), /* 437 */
LINXY(__NR_pidfd_getfd, sys_pidfd_getfd), /* 438 */
LINX_(__NR_faccessat2, sys_faccessat2), /* 439 */
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), /* 441 */
LINXY(__NR_memfd_secret, sys_memfd_secret), /* 447 */
LINX_(__NR_fchmodat2, sys_fchmodat2), /* 452 */
};

SyscallTableEntry* ML_(get_linux_syscall_entry)(UInt sysno)
Expand Down
21 changes: 11 additions & 10 deletions include/vki/vki-riscv64-linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,17 @@ typedef struct vki_sigaltstack {
// From linux-6.0/include/uapi/asm-generic/fcntl.h
//----------------------------------------------------------------------

#define VKI_O_ACCMODE 03
#define VKI_O_RDONLY 00
#define VKI_O_WRONLY 01
#define VKI_O_RDWR 02
#define VKI_O_CREAT 0100 /* not fcntl */
#define VKI_O_EXCL 0200 /* not fcntl */
#define VKI_O_TRUNC 01000 /* not fcntl */
#define VKI_O_APPEND 02000
#define VKI_O_NONBLOCK 04000
#define VKI_O_LARGEFILE 0100000
#define VKI_O_ACCMODE 00000003
#define VKI_O_RDONLY 00000000
#define VKI_O_WRONLY 00000001
#define VKI_O_RDWR 00000002
#define VKI_O_CREAT 00000100 /* not fcntl */
#define VKI_O_EXCL 00000200 /* not fcntl */
#define VKI_O_TRUNC 00001000 /* not fcntl */
#define VKI_O_APPEND 00002000
#define VKI_O_NONBLOCK 00004000
#define VKI_O_DIRECT 00040000 /* direct disk access hint */
#define VKI_O_LARGEFILE 00100000

#define VKI_F_DUPFD 0 /* dup */
#define VKI_F_GETFD 1 /* get close_on_exec */
Expand Down
1 change: 1 addition & 0 deletions include/vki/vki-scnums-riscv64-linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
#define __NR_execveat 281
#define __NR_userfaultfd 282
#define __NR_membarrier 283
#define __NR_mlock2 284
#define __NR_copy_file_range 285
#define __NR_preadv2 286
#define __NR_pwritev2 287
Expand Down

0 comments on commit a6942c1

Please sign in to comment.