This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH [2/n]: Add x32 sysdep.h file


On 03/15/2012 07:31 PM, H.J. Lu wrote:
Hi,

This patch does:

1. Move all VSYSCALL_ADDR_xxx to a single location x86_64/sysdep.h.
2. Remove the `q' suffix from xor/rol instructions in x86_64 PTR_MANGLE
and PTR_DEMANGLE so that they work for both 32bit registers under x32
and 64bit registers under x86_64.
3. Add LP_SIZE, MOVE_LP, ADD_LP, SUB_LP, CMP_LP and ASM_ADDR to support
both 32bit and 64bit long/pointer sizes in assembly codes.
4. Add RXX_LP for registers used as longs and pointers in assembly
codes.
5. Add x32 system call macros to support 32bit error returns in system
calls.  For a few system calls which returns 64bit integer,
SYSCALL_RETURN_INT64 is used to set up properly 64bit error return values.

I agree with Roland: Please split this in separate pieces.


Just one thing I noticed:

> [...]
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index c9c4dbd..dc9c5fe 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -189,6 +189,11 @@
  # define DOARGS_5 DOARGS_4
  # define DOARGS_6 DOARGS_5

+/* For the calculation see asm/vsyscall.h.  */
+# define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
+# define VSYSCALL_ADDR_vtime		0xffffffffff600400
+# define VSYSCALL_ADDR_vgetcpu		0xffffffffff600800
+
  #else	/* !__ASSEMBLER__ */
  /* Define a macro which expands inline into the wrapper code for a system
     call.  */
@@ -334,6 +339,11 @@
    LOAD_REGS_5
  # define ASM_ARGS_6	ASM_ARGS_5, "r" (_a6)

+/* For the calculation see asm/vsyscall.h.  */
+# define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000ul
+# define VSYSCALL_ADDR_vgetcpu		0xffffffffff600800ul
+# define VSYSCALL_ADDR_vtime		0xffffffffff600400ul

Why defining them twice? Is that really needed?


If needed: Please use the same order.


-- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]