bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help with assembly code


From: Svante Signell
Subject: Re: Need help with assembly code
Date: Tue, 30 Nov 2021 11:27:09 +0100
User-agent: Evolution 3.30.5-1.1

On Mon, 2021-11-29 at 22:19 +0100, Samuel Thibault wrote:
> Hello,
> 
> Svante Signell, le lun. 29 nov. 2021 18:40:48 +0100, a ecrit:
> > I've been working lately with on how to port valgrind to GNU/Hurd, and found
> > out that this is not a trivial task.
> 
> It is indeed very far from a trivial task. I'd rather recommend to port
> gcc's lsan support, it will be most probably much easier to port.

Maybe it is. I might look into that later on. Thanks for the tip.

> > Seems like one have to make a suitable mix of linux and darwin code
> > (and to some extent freebsd/solaris code).
> 
> Also it'd need a fair amount of code to reimplement the basic posixish
> needs of valgrind in terms of the Hurd RPCs.

Do you mean that Darwin does not use RPCs? Seems like valgrind has some 
RPC-code 
for Darwin already. In fact there is a directory containing mach code:
coregrind/m_mach/ but most *.defs code is absent. Basically only mach_msg and
mach_msg_trap are defined (and nothing about Hurd RPCs of course).

> > 
> >         movl    $$__NR___pthread_sigmask, %eax        
> >         int     $$0x80  /* should be sysenter? */
> >         jc      L_$0_7  /* __pthread_sigmask failed */

> Mach doesn't use int 0x80 but an lcall. See for instance
> glibc/sysdeps/mach/i386/syscall.S

Can't 0x80 just be replaced by lcall? Probably not. Looking at the x86-specific
assembly code for all architectures 0x80 seems to be used everywhere.

Additionally: My question was about the macro definition with an option
argument:
/* DO_SYSCALL MACH|MDEP|UNIX */
#define MACH 1
#define MDEP 2
#define UNIX 3

.macro DO_SYSCALL <what to add here?>
<and here>
.endm

.globl ML_(do_syscall_for_client_unix_WRK)
ML_(do_syscall_for_client_unix_WRK):
        DO_SYSCALL UNIX

.globl ML_(do_syscall_for_client_mach_WRK)
ML_(do_syscall_for_client_mach_WRK):
        DO_SYSCALL MACH

.globl ML_(do_syscall_for_client_mdep_WRK)
ML_(do_syscall_for_client_mdep_WRK):
        DO_SYSCALL MDEP





reply via email to

[Prev in Thread] Current Thread [Next in Thread]