[PATCH 4/4] ARC: don't hard-code ELF_NGREG

Vineet Gupta <[email protected]>
Newsgroups gmane.comp.lib.uclibc.general
Message-ID <[email protected]>
From: Alexey Brodkin <[email protected]>

Signed-off-by: Alexey Brodkin <[email protected]>
Signed-off-by: Vineet Gupta <[email protected]>
[updated changelog]

Signed-off-by: Vineet Gupta <[email protected]>
---
 libc/sysdeps/linux/arc/sys/procfs.h | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libc/sysdeps/linux/arc/sys/procfs.h b/libc/sysdeps/linux/arc/sys/procfs.h
index a9e375b33edb..a47430340726 100755
--- a/libc/sysdeps/linux/arc/sys/procfs.h
+++ b/libc/sysdeps/linux/arc/sys/procfs.h
@@ -20,17 +20,14 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/user.h>
+#include <asm/ptrace.h>
 
 __BEGIN_DECLS
 
 /* Type for a general-purpose register.  */
 typedef unsigned long elf_greg_t;
 
-/* And the whole bunch of them.  We could have used `struct
-   user_regs' directly in the typedef, but tradition says that
-   the register set is an array, which does have some peculiar
-   semantics, so leave it that way.  */
-#define ELF_NGREG 40
+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 typedef struct { } elf_fpregset_t;
 
-- 
1.9.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.