* [PATCH] INTERNAL_SYSCALL_NCS for SH
@ 2004-09-23 22:43 Kaz Kojima
2004-09-23 22:52 ` Kaz Kojima
2004-09-24 6:20 ` Ulrich Drepper
0 siblings, 2 replies; 5+ messages in thread
From: Kaz Kojima @ 2004-09-23 22:43 UTC (permalink / raw)
To: libc-hacker
Hi,
The appended patch is an SH version of INTERNAL_SYSCALL_NCS.
BTW, SH port has a few problems with setXid changes. I'll report
them in the next mail.
Regards,
kaz
--
2004-09-23 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/unix/sysv/linux/sh/sysdep.h (INTERNAL_SYSCALL_NCS): Define.
diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.h LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.h Mon Jul 5 11:14:22 2004
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.h Mon Sep 20 10:10:41 2004
@@ -333,6 +333,20 @@
\
(int) resultvar; })
+/* The _NCS variant allows non-constant syscall numbers. */
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+ ({ \
+ unsigned long int resultvar; \
+ register long int r3 asm ("%r3") = (name); \
+ SUBSTITUTE_ARGS_##nr(args); \
+ \
+ asm volatile (SYSCALL_INST_STR##nr SYSCALL_INST_PAD \
+ : "=z" (resultvar) \
+ : "r" (r3) ASMFMT_##nr \
+ : "memory"); \
+ \
+ (int) resultvar; })
+
#undef INTERNAL_SYSCALL_DECL
#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] INTERNAL_SYSCALL_NCS for SH
2004-09-23 22:43 [PATCH] INTERNAL_SYSCALL_NCS for SH Kaz Kojima
@ 2004-09-23 22:52 ` Kaz Kojima
2004-09-23 23:25 ` Kaz Kojima
2004-09-24 6:20 ` Ulrich Drepper
1 sibling, 1 reply; 5+ messages in thread
From: Kaz Kojima @ 2004-09-23 22:52 UTC (permalink / raw)
To: libc-hacker
> BTW, SH port has a few problems with setXid changes. I'll report
> them in the next mail.
SH uses the old-fashioned 16-bit id's. It causes a few problems with
setXid changes. The first problem is that seteuid.c and setegid.c may
call __setre*[ug]id and causes undefined references. It seems pthread
cases should use pthread_setre*[ug]id_np instead of __setre*[ug]id.
The second one is that the variable __libc_missing_32bit_uids is defined
in getuid.c but we don't have pthread_getuid. I've added an SH specific
pthread_getuid as a workaround. I'd like to append a patch I'm using
for comments.
Regards,
kaz
--
[nptl/ChangeLog]
2004-09-23 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* pthread_setegid.c (__setregid): Set to the pthread version.
(__setresgid): Likewise.
* pthread_seteuid.c (__setreuid, __setresuid): Likewise.
* sysdeps/unix/sysv/linux/sh/Makefile: New file.
* sysdeps/unix/sysv/linux/sh/pthread_getuid.c: New file.
diff -u3prN ORIG/libc/nptl/pthread_setegid.c LOCAL/libc/nptl/pthread_setegid.c
--- ORIG/libc/nptl/pthread_setegid.c Mon Sep 20 09:05:06 2004
+++ LOCAL/libc/nptl/pthread_setegid.c Mon Sep 20 13:23:00 2004
@@ -1,3 +1,5 @@
#define SINGLE_THREAD
#define setegid pthread_setegid_np
+#define __setregid pthread_setregid_np
+#define __setresgid pthread_setresgid_np
#include <setegid.c>
diff -u3prN ORIG/libc/nptl/pthread_seteuid.c LOCAL/libc/nptl/pthread_seteuid.c
--- ORIG/libc/nptl/pthread_seteuid.c Mon Sep 20 09:05:38 2004
+++ LOCAL/libc/nptl/pthread_seteuid.c Thu Sep 23 17:04:43 2004
@@ -1,3 +1,5 @@
#define SINGLE_THREAD
#define seteuid pthread_seteuid_np
+#define __setreuid pthread_setreuid_np
+#define __setresuid pthread_setresuid_np
#include <seteuid.c>
diff -u3prN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/Makefile LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/Makefile
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/Makefile Thu Jan 1 09:00:00 1970
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/Makefile Thu Sep 23 21:31:04 2004
@@ -0,0 +1,2 @@
+# to get __libc_missing_32bit_uids
+libpthread-routines += pthread_getuid
diff -u3prN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_getuid.c LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_getuid.c
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_getuid.c Thu Jan 1 09:00:00 1970
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_getuid.c Thu Sep 23 21:32:14 2004
@@ -0,0 +1,3 @@
+#define SINGLE_THREAD
+#define __getuid pthread_getuid_np
+#include <getuid.c>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] INTERNAL_SYSCALL_NCS for SH
2004-09-23 22:52 ` Kaz Kojima
@ 2004-09-23 23:25 ` Kaz Kojima
2004-09-24 1:22 ` Kaz Kojima
0 siblings, 1 reply; 5+ messages in thread
From: Kaz Kojima @ 2004-09-23 23:25 UTC (permalink / raw)
To: libc-hacker
>> BTW, SH port has a few problems with setXid changes. I'll report
>> them in the next mail.
>
> SH uses the old-fashioned 16-bit id's. It causes a few problems with
> setXid changes. The first problem is that seteuid.c and setegid.c may
> call __setre*[ug]id and causes undefined references. It seems pthread
> cases should use pthread_setre*[ug]id_np instead of __setre*[ug]id.
>
> The second one is that the variable __libc_missing_32bit_uids is defined
> in getuid.c but we don't have pthread_getuid. I've added an SH specific
> pthread_getuid as a workaround. I'd like to append a patch I'm using
> for comments.
Ugh. Please ignore this mail. I didn't noticed that some setXid changes
have been removed. I'll update my tree and try again. Sorry for the noise.
Regards,
kaz
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] INTERNAL_SYSCALL_NCS for SH
2004-09-23 23:25 ` Kaz Kojima
@ 2004-09-24 1:22 ` Kaz Kojima
0 siblings, 0 replies; 5+ messages in thread
From: Kaz Kojima @ 2004-09-24 1:22 UTC (permalink / raw)
To: libc-hacker
> I'll update my tree and try again. Sorry for the noise.
I've confirmed that the INTERNAL_SYSCALL_NCS patch in
http://sources.redhat.com/ml/libc-hacker/2004-09/msg00088.html
is enough for SH port.
Regards,
kaz
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] INTERNAL_SYSCALL_NCS for SH
2004-09-23 22:43 [PATCH] INTERNAL_SYSCALL_NCS for SH Kaz Kojima
2004-09-23 22:52 ` Kaz Kojima
@ 2004-09-24 6:20 ` Ulrich Drepper
1 sibling, 0 replies; 5+ messages in thread
From: Ulrich Drepper @ 2004-09-24 6:20 UTC (permalink / raw)
To: Kaz Kojima; +Cc: libc-hacker
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Applied.
- --
⧠Ulrich Drepper ⧠Red Hat, Inc. ⧠444 Castro St ⧠Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFBU7yN2ijCOnn/RHQRApELAJ9I33+gSqP0xp69EtMIhK6zblmknQCfXVUG
gjVqIqA2aXPr+OyQBjvRsgM=
=iIrY
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-09-24 6:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-23 22:43 [PATCH] INTERNAL_SYSCALL_NCS for SH Kaz Kojima
2004-09-23 22:52 ` Kaz Kojima
2004-09-23 23:25 ` Kaz Kojima
2004-09-24 1:22 ` Kaz Kojima
2004-09-24 6:20 ` Ulrich Drepper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).