|
From: Christian B. <bor...@de...> - 2010-12-16 13:47:19
|
Nothing special here. We do the same as other architectures for several
functions and methods.
---
coregrind/m_aspacemgr/aspacemgr-common.c | 3 ++-
coregrind/m_aspacemgr/aspacemgr-linux.c | 2 +-
coregrind/m_libcfile.c | 12 ++++++------
coregrind/m_libcproc.c | 2 +-
coregrind/m_syswrap/priv_types_n_macros.h | 2 +-
coregrind/m_translate.c | 5 +++--
coregrind/m_transtab.c | 3 +++
coregrind/pub_core_mallocfree.h | 1 +
include/pub_tool_basics.h | 4 ++--
9 files changed, 20 insertions(+), 14 deletions(-)
--- valgrind-upstream.orig/coregrind/m_aspacemgr/aspacemgr-common.c
+++ valgrind-upstream/coregrind/m_aspacemgr/aspacemgr-common.c
@@ -159,7 +159,8 @@ SysRes VG_(am_do_mmap_NO_NOTIFY)( Addr s
res = VG_(do_syscall6)(__NR_mmap2, (UWord)start, length,
prot, flags, fd, offset / 4096);
# elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux) \
- || defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ || defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5) \
+ || defined(VGP_s390x_linux)
res = VG_(do_syscall6)(__NR_mmap, (UWord)start, length,
prot, flags, fd, offset);
# elif defined(VGP_x86_darwin)
--- valgrind-upstream.orig/coregrind/m_aspacemgr/aspacemgr-linux.c
+++ valgrind-upstream/coregrind/m_aspacemgr/aspacemgr-linux.c
@@ -903,7 +903,7 @@ static void sync_check_mapping_callback
have a sloppyXcheck mode which we enable on x86 - in this mode we
allow the kernel to report execute permission when we weren't
expecting it but not vice versa. */
-# if defined(VGA_x86)
+# if defined(VGA_x86) || defined (VGA_s390x)
sloppyXcheck = True;
# else
sloppyXcheck = False;
--- valgrind-upstream.orig/coregrind/m_libcfile.c
+++ valgrind-upstream/coregrind/m_libcfile.c
@@ -795,7 +795,7 @@ static Int parse_inet_addr_and_port ( UC
Int VG_(socket) ( Int domain, Int type, Int protocol )
{
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
- || defined(VGP_ppc64_linux)
+ || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
SysRes res;
UWord args[3];
args[0] = domain;
@@ -836,7 +836,7 @@ static
Int my_connect ( Int sockfd, struct vki_sockaddr_in* serv_addr, Int addrlen )
{
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
- || defined(VGP_ppc64_linux)
+ || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
SysRes res;
UWord args[3];
args[0] = sockfd;
@@ -876,7 +876,7 @@ Int VG_(write_socket)( Int sd, void *msg
SIGPIPE */
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
- || defined(VGP_ppc64_linux)
+ || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
SysRes res;
UWord args[4];
args[0] = sd;
@@ -908,7 +908,7 @@ Int VG_(write_socket)( Int sd, void *msg
Int VG_(getsockname) ( Int sd, struct vki_sockaddr *name, Int *namelen)
{
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
- || defined(VGP_ppc64_linux)
+ || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
SysRes res;
UWord args[3];
args[0] = sd;
@@ -940,7 +940,7 @@ Int VG_(getsockname) ( Int sd, struct vk
Int VG_(getpeername) ( Int sd, struct vki_sockaddr *name, Int *namelen)
{
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
- || defined(VGP_ppc64_linux)
+ || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
SysRes res;
UWord args[3];
args[0] = sd;
@@ -973,7 +973,7 @@ Int VG_(getsockopt) ( Int sd, Int level,
Int *optlen)
{
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
- || defined(VGP_ppc64_linux)
+ || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
SysRes res;
UWord args[5];
args[0] = sd;
--- valgrind-upstream.orig/coregrind/m_libcproc.c
+++ valgrind-upstream/coregrind/m_libcproc.c
@@ -545,7 +545,7 @@ Int VG_(getgroups)( Int size, UInt* list
# elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux) \
|| defined(VGP_arm_linux) \
|| defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5) \
- || defined(VGO_darwin)
+ || defined(VGO_darwin) || defined(VGP_s390x_linux)
SysRes sres;
sres = VG_(do_syscall2)(__NR_getgroups, size, (Addr)list);
if (sr_isError(sres))
--- valgrind-upstream.orig/coregrind/m_syswrap/priv_types_n_macros.h
+++ valgrind-upstream/coregrind/m_syswrap/priv_types_n_macros.h
@@ -89,7 +89,7 @@ typedef
Int o_sysno;
# if defined(VGP_x86_linux) || defined(VGP_amd64_linux) \
|| defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux) \
- || defined(VGP_arm_linux)
+ || defined(VGP_arm_linux) || defined(VGP_s390x_linux)
Int o_arg1;
Int o_arg2;
Int o_arg3;
--- valgrind-upstream.orig/coregrind/m_translate.c
+++ valgrind-upstream/coregrind/m_translate.c
@@ -692,7 +692,7 @@ void log_bytes ( HChar* bytes, Int nbyte
static Bool translations_allowable_from_seg ( NSegment const* seg )
{
-# if defined(VGA_x86)
+# if defined(VGA_x86) || defined(VGA_s390x)
Bool allowR = True;
# else
Bool allowR = False;
@@ -1508,7 +1508,8 @@ Bool VG_(translate) ( ThreadId tid,
? (void*) &VG_(run_innerloop__dispatch_profiled)
: (void*) &VG_(run_innerloop__dispatch_unprofiled);
# elif defined(VGA_ppc32) || defined(VGA_ppc64) \
- || defined(VGA_arm)
+ || defined(VGA_arm) || defined(VGA_s390x)
+ /* See comment libvex.h; machine has link register --> dipatch = NULL */
vta.dispatch = NULL;
# else
# error "Unknown arch"
--- valgrind-upstream.orig/coregrind/m_transtab.c
+++ valgrind-upstream/coregrind/m_transtab.c
@@ -901,6 +901,9 @@ static void invalidate_icache ( void *pt
# elif defined(VGA_amd64)
/* no need to do anything, hardware provides coherence */
+# elif defined(VGA_s390x)
+ /* no need to do anything, hardware provides coherence */
+
# elif defined(VGP_arm_linux)
/* ARM cache flushes are privileged, so we must defer to the kernel. */
Addr startaddr = (Addr) ptr;
--- valgrind-upstream.orig/coregrind/pub_core_mallocfree.h
+++ valgrind-upstream/coregrind/pub_core_mallocfree.h
@@ -77,6 +77,7 @@ typedef Int ArenaId;
// for any AltiVec- or SSE-related type. This matches the Darwin libc.
#elif defined(VGP_amd64_linux) || \
defined(VGP_ppc64_linux) || \
+ defined(VGP_s390x_linux) || \
defined(VGP_ppc64_aix5) || \
defined(VGP_ppc32_aix5) || \
defined(VGP_x86_darwin) || \
--- valgrind-upstream.orig/include/pub_tool_basics.h
+++ valgrind-upstream/include/pub_tool_basics.h
@@ -292,7 +292,7 @@ static inline Bool sr_EQ ( SysRes sr1, S
#if defined(VGA_x86) || defined(VGA_amd64) || defined (VGA_arm)
# define VG_LITTLEENDIAN 1
-#elif defined(VGA_ppc32) || defined(VGA_ppc64)
+#elif defined(VGA_ppc32) || defined(VGA_ppc64) || defined(VGA_s390x)
# define VG_BIGENDIAN 1
#else
# error Unknown arch
@@ -302,7 +302,7 @@ static inline Bool sr_EQ ( SysRes sr1, S
#if defined(VGA_x86)
# define VG_REGPARM(n) __attribute__((regparm(n)))
#elif defined(VGA_amd64) || defined(VGA_ppc32) \
- || defined(VGA_ppc64) || defined(VGA_arm)
+ || defined(VGA_ppc64) || defined(VGA_arm) || defined(VGA_s390x)
# define VG_REGPARM(n) /* */
#else
# error Unknown arch
|