1
This series of m68k related commits brings eglibc-2.11.2 up to date with the glibc-ports git
2
as of 2010-06-30, including NPTL support.
4
From: Joseph Myers <joseph@codesourcery.com>
5
Date: Wed, 18 Nov 2009 17:30:48 +0000 (+0000)
6
Subject: Change misleading names of parameters of sync_file_range for M68K.
7
X-Git-Tag: glibc-2.12~86
8
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=6add932d9099ac27762c45e344416c1ee11f6d78
10
Change misleading names of parameters of sync_file_range for M68K.
13
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
14
index 7a3e8b7..87117d3 100644
15
--- a/ports/ChangeLog.m68k
16
+++ b/ports/ChangeLog.m68k
18
+2009-11-18 Joseph Myers <joseph@codesourcery.com>
20
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Change misleading
21
+ names of parameters of sync_file_range.
23
2009-11-17 Joseph Myers <joseph@codesourcery.com>
26
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
27
index 6fc7a0a..c6dd1a8 100644
28
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
29
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
30
@@ -236,7 +236,7 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
33
/* Selective file content synch'ing. */
34
-extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
35
+extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
36
unsigned int __flags);
39
From: Joseph Myers <joseph@codesourcery.com>
40
Date: Thu, 19 Nov 2009 22:34:08 +0000 (+0000)
41
Subject: Define F_OWNER_PGRP for M68K.
42
X-Git-Tag: glibc-2.12~82
43
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=76d306ec9888f824496ea7783266ea91e6825374
45
Define F_OWNER_PGRP for M68K.
48
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
49
index 87117d3..74407c4 100644
50
--- a/ports/ChangeLog.m68k
51
+++ b/ports/ChangeLog.m68k
53
+2009-11-19 Joseph Myers <joseph@codesourcery.com>
55
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Introduce new symbol
56
+ F_OWNER_PGRP and mark F_OWNER_GID obsolete.
58
2009-11-18 Joseph Myers <joseph@codesourcery.com>
60
* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Change misleading
61
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
62
index c6dd1a8..8ed8eb6 100644
63
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
64
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
65
@@ -171,9 +171,10 @@ struct flock64
69
- F_OWNER_TID = 0, /* Kernel thread. */
70
- F_OWNER_PID, /* Process. */
71
- F_OWNER_GID /* Process group. */
72
+ F_OWNER_TID = 0, /* Kernel thread. */
73
+ F_OWNER_PID, /* Process. */
74
+ F_OWNER_PGRP, /* Process group. */
75
+ F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */
78
/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
79
From: Andreas Schwab <schwab@redhat.com>
80
Date: Mon, 23 Nov 2009 15:34:39 +0000 (+0100)
81
Subject: Use struct timespec for timestamps in struct stat also if __USE_XOPEN2K8
82
X-Git-Tag: glibc-2.12~81
83
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=127f9dc1f0b7c21112007f476d710ea6b70d13c0
85
Use struct timespec for timestamps in struct stat also if __USE_XOPEN2K8
88
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
89
index 74407c4..42d6a91 100644
90
--- a/ports/ChangeLog.m68k
91
+++ b/ports/ChangeLog.m68k
93
+2009-11-23 Andreas Schwab <schwab@linux-m68k.org>
95
+ * sysdeps/unix/sysv/linux/m68k/bits/stat.h: Use struct timespec
96
+ for timestamps also if __USE_XOPEN2K8.
98
2009-11-19 Joseph Myers <joseph@codesourcery.com>
100
* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Introduce new symbol
101
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
102
index 8d18d6d..7801043 100644
103
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
104
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
105
@@ -61,7 +61,7 @@ struct stat
107
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
110
+#if defined __USE_MISC || defined __USE_XOPEN2K8
111
/* Nanosecond resolution timestamps are stored in a format
112
equivalent to 'struct timespec'. This is the type used
113
whenever possible but the Unix namespace rules do not allow the
114
@@ -107,7 +107,7 @@ struct stat64
115
__blksize_t st_blksize; /* Optimal block size for I/O. */
117
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
119
+# if defined __USE_MISC || defined __USE_XOPEN2K8
120
/* Nanosecond resolution timestamps are stored in a format
121
equivalent to 'struct timespec'. This is the type used
122
whenever possible but the Unix namespace rules do not allow the
123
@@ -117,14 +117,14 @@ struct stat64
124
struct timespec st_atim; /* Time of last access. */
125
struct timespec st_mtim; /* Time of last modification. */
126
struct timespec st_ctim; /* Time of last status change. */
129
__time_t st_atime; /* Time of last access. */
130
unsigned long int st_atimensec; /* Nscecs of last access. */
131
__time_t st_mtime; /* Time of last modification. */
132
unsigned long int st_mtimensec; /* Nsecs of last modification. */
133
__time_t st_ctime; /* Time of last status change. */
134
unsigned long int st_ctimensec; /* Nsecs of last status change. */
137
__ino64_t st_ino; /* File serial number. */
140
From: Joseph Myers <joseph@codesourcery.com>
141
Date: Wed, 16 Dec 2009 12:37:07 +0000 (+0000)
142
Subject: Update M68K O_SYNC.
143
X-Git-Tag: glibc-2.12~69
144
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=4b8a7d2c3f00ac9a4e31e3c8c132b4b9aefbc5fe
149
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
150
index 42d6a91..8411570 100644
151
--- a/ports/ChangeLog.m68k
152
+++ b/ports/ChangeLog.m68k
154
+2009-12-16 Joseph Myers <joseph@codesourcery.com>
156
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Redefine O_SYNC and
157
+ O_DSYNC to match 2.6.33+ kernels.
159
2009-11-23 Andreas Schwab <schwab@linux-m68k.org>
161
* sysdeps/unix/sysv/linux/m68k/bits/stat.h: Use struct timespec
162
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
163
index 8ed8eb6..1f98cf5 100644
164
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
165
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
167
#define O_APPEND 02000
168
#define O_NONBLOCK 04000
169
#define O_NDELAY O_NONBLOCK
170
-#define O_SYNC 010000
171
+#define O_SYNC 04010000
172
#define O_FSYNC O_SYNC
173
#define O_ASYNC 020000
176
We define the symbols here but let them do the same as O_SYNC since
177
this is a superset. */
178
#if defined __USE_POSIX199309 || defined __USE_UNIX98
179
-# define O_DSYNC O_SYNC /* Synchronize data. */
180
+# define O_DSYNC 010000 /* Synchronize data. */
181
# define O_RSYNC O_SYNC /* Synchronize read operations. */
184
From: Joseph Myers <joseph@codesourcery.com>
185
Date: Wed, 16 Dec 2009 19:35:09 +0000 (+0000)
186
Subject: Update M68K bits/poll.h for POSIX 2008.
187
X-Git-Tag: glibc-2.12~65
188
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=5d79f83e907d938087a5a93c514e48a4ce438c9d
190
Update M68K bits/poll.h for POSIX 2008.
193
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
194
index 8411570..978cd1a 100644
195
--- a/ports/ChangeLog.m68k
196
+++ b/ports/ChangeLog.m68k
198
2009-12-16 Joseph Myers <joseph@codesourcery.com>
201
+ * sysdeps/unix/sysv/linux/m68k/bits/poll.h: Define POLLRDNORM,
202
+ POLLRDBAND, POLLWRNORM, and POLLWRBAND also for POSIX 2008.
204
+2009-12-16 Joseph Myers <joseph@codesourcery.com>
206
* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Redefine O_SYNC and
207
O_DSYNC to match 2.6.33+ kernels.
209
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/poll.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/poll.h
210
index bc28579..84219ba 100644
211
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/poll.h
212
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/poll.h
214
-/* Copyright (C) 1997, 2001, 2008 Free Software Foundation, Inc.
215
+/* Copyright (C) 1997, 2001, 2008, 2009 Free Software Foundation, Inc.
216
This file is part of the GNU C Library.
218
The GNU C Library is free software; you can redistribute it and/or
220
#define POLLPRI 0x002 /* There is urgent data to read. */
221
#define POLLOUT 0x004 /* Writing now will not block. */
224
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
225
/* These values are defined in XPG4.2. */
226
# define POLLRDNORM 0x040 /* Normal data may be read. */
227
# define POLLRDBAND 0x080 /* Priority data may be read. */
228
From: Joseph Myers <joseph@codesourcery.com>
229
Date: Sun, 10 Jan 2010 19:02:51 +0000 (+0000)
230
Subject: Update M68K bits/fcntl.h for XPG7 and allow bits/stat.h inclusion from fcntl.h.
231
X-Git-Tag: glibc-2.12~62
232
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=2f12146a331fa728950cbe55da1efb406c26e5cb
234
Update M68K bits/fcntl.h for XPG7 and allow bits/stat.h inclusion from fcntl.h.
237
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
238
index 978cd1a..094e7a8 100644
239
--- a/ports/ChangeLog.m68k
240
+++ b/ports/ChangeLog.m68k
242
+2010-01-10 Joseph Myers <joseph@codesourcery.com>
244
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Define O_DIRECTORY,
245
+ O_NOFOLLOW, O_CLOEXEC, F_DUPFD_CLOEXEC, F_SETOWN, and F_GETOWN for
247
+ * sysdeps/unix/sysv/linux/m68k/bits/stat.h: Enable using from
250
2009-12-16 Joseph Myers <joseph@codesourcery.com>
253
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
254
index 1f98cf5..d1eb706 100644
255
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
256
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
258
/* O_*, F_*, FD_* bit values for Linux.
259
- Copyright (C) 2000, 2004, 2008, 2009 Free Software Foundation, Inc.
260
+ Copyright (C) 2000, 2004, 2008, 2009, 2010 Free Software Foundation, Inc.
261
This file is part of the GNU C Library.
263
The GNU C Library is free software; you can redistribute it and/or
265
#define O_FSYNC O_SYNC
266
#define O_ASYNC 020000
269
+#ifdef __USE_XOPEN2K8
270
# define O_DIRECTORY 040000 /* Must be a directory. */
271
# define O_NOFOLLOW 0100000 /* Do not follow links. */
272
+# define O_CLOEXEC 02000000 /* Set close_on_exec. */
275
# define O_DIRECT 0200000 /* Direct disk access. */
276
# define O_NOATIME 01000000 /* Do not set atime. */
277
-# define O_CLOEXEC 02000000 /* Set close_on_exec. */
280
/* For now Linux has synchronisity options for data and read operations.
282
#define F_SETLK64 13 /* Set record locking info (non-blocking). */
283
#define F_SETLKW64 14 /* Set record locking info (blocking). */
285
-#if defined __USE_BSD || defined __USE_UNIX98
286
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
287
# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
288
# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
291
# define F_SETLEASE 1024 /* Set a lease. */
292
# define F_GETLEASE 1025 /* Enquire what lease is active. */
293
# define F_NOTIFY 1026 /* Request notfications on a directory. */
295
+#ifdef __USE_XOPEN2K8
296
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
297
close-on-exit set. */
299
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
300
index 7801043..771a53a 100644
301
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
302
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
304
-/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002,2008,2009
305
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002,2008,2009,2010
306
Free Software Foundation, Inc.
307
This file is part of the GNU C Library.
310
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
314
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
315
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
318
From: Joseph Myers <joseph@codesourcery.com>
319
Date: Mon, 11 Jan 2010 21:51:34 +0000 (+0000)
320
Subject: Fix M68K bits/stat.h double inclusion problem.
321
X-Git-Tag: glibc-2.12~59
322
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=fdefc0e1f176327cabedf4011673b3272321093e
324
Fix M68K bits/stat.h double inclusion problem.
327
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
328
index 094e7a8..cdc9242 100644
329
--- a/ports/ChangeLog.m68k
330
+++ b/ports/ChangeLog.m68k
332
+2010-01-11 Joseph Myers <joseph@codesourcery.com>
334
+ * sysdeps/unix/sysv/linux/m68k/bits/stat.h: Fix double-inclusion
337
2010-01-10 Joseph Myers <joseph@codesourcery.com>
339
* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Define O_DIRECTORY,
340
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
341
index 771a53a..0c1d149 100644
342
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
343
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
345
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
348
+#ifndef _BITS_STAT_H
349
+#define _BITS_STAT_H 1
351
/* Versions of the `struct stat' data structure. */
352
#define _STAT_VER_LINUX_OLD 1
353
#define _STAT_VER_KERNEL 1
354
@@ -167,3 +170,5 @@ struct stat64
355
# define UTIME_NOW ((1l << 30) - 1l)
356
# define UTIME_OMIT ((1l << 30) - 2l)
359
+#endif /* bits/stat.h */
360
From: Joseph Myers <joseph@codesourcery.com>
361
Date: Wed, 10 Feb 2010 15:32:33 +0000 (+0000)
362
Subject: Add hidden alias for M68K fegetenv.
363
X-Git-Tag: glibc-2.12~46
364
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=ee0c4dd1ccc424d57d97dc078a4aba0c70eeb8a4
366
Add hidden alias for M68K fegetenv.
369
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
370
index cdc9242..8487ba3 100644
371
--- a/ports/ChangeLog.m68k
372
+++ b/ports/ChangeLog.m68k
374
+2010-02-10 Joseph Myers <joseph@codesourcery.com>
376
+ * sysdeps/m68k/fpu/fegetenv.c: Add hidden alias.
378
2010-01-11 Joseph Myers <joseph@codesourcery.com>
380
* sysdeps/unix/sysv/linux/m68k/bits/stat.h: Fix double-inclusion
381
diff --git a/ports/sysdeps/m68k/fpu/fegetenv.c b/ports/sysdeps/m68k/fpu/fegetenv.c
382
index 6f23e8b..30f3fa5 100644
383
--- a/ports/sysdeps/m68k/fpu/fegetenv.c
384
+++ b/ports/sysdeps/m68k/fpu/fegetenv.c
386
/* Store current floating-point environment.
387
- Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
388
+ Copyright (C) 1997,99,2000,01,10 Free Software Foundation, Inc.
389
This file is part of the GNU C Library.
390
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
392
@@ -41,4 +41,5 @@ strong_alias (__fegetenv, __old_fegetenv)
393
compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
396
+libm_hidden_ver (__fegetenv, fegetenv)
397
versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
398
From: Maxim Kuvyrkov <maxim@codesourcery.com>
399
Date: Tue, 9 Mar 2010 10:20:36 +0000 (-0800)
400
Subject: m68k: update jmpbuf-unwind.h
401
X-Git-Tag: glibc-2.12~41
402
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=42ae1878f326c413dd026373ebdb6bf6cd20e75d
404
m68k: update jmpbuf-unwind.h
407
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
408
index 8487ba3..d14368e 100644
409
--- a/ports/ChangeLog.m68k
410
+++ b/ports/ChangeLog.m68k
412
+2010-03-09 Maxim Kuvyrkov <maxim@codesourcery.com>
414
+ * sysdeps/m68k/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ)
415
+ (_jmpbuf_sp, _JMPBUF_UNWINDS_ADJ, __libc_unwind_longjmp): Define.
417
2010-02-10 Joseph Myers <joseph@codesourcery.com>
419
* sysdeps/m68k/fpu/fegetenv.c: Add hidden alias.
420
diff --git a/ports/sysdeps/m68k/jmpbuf-unwind.h b/ports/sysdeps/m68k/jmpbuf-unwind.h
421
index 3490c79..28b9537 100644
422
--- a/ports/sysdeps/m68k/jmpbuf-unwind.h
423
+++ b/ports/sysdeps/m68k/jmpbuf-unwind.h
425
/* Examine __jmp_buf for unwinding frames. m68k version.
426
- Copyright (C) 2006 Free Software Foundation, Inc.
427
+ Copyright (C) 2006, 2010 Free Software Foundation, Inc.
428
This file is part of the GNU C Library.
430
The GNU C Library is free software; you can redistribute it and/or
438
/* Test if longjmp to JMPBUF would unwind the frame
439
containing a local variable at ADDRESS. */
440
#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
441
((void *) (address) < (void *) demangle ((jmpbuf)->__sp))
443
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
444
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
446
+static inline uintptr_t __attribute__ ((unused))
447
+_jmpbuf_sp (__jmp_buf regs)
449
+ uintptr_t sp = regs[0].__sp;
456
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
457
+ ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
459
+/* We use the normal longjmp for unwinding. */
460
+#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
461
From: Maxim Kuvyrkov <maxim@codesourcery.com>
462
Date: Tue, 9 Mar 2010 10:32:38 +0000 (-0800)
463
Subject: m68k: remove bits/siginfo.h in favor of generic one
464
X-Git-Tag: glibc-2.12~40
465
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=d8e90a15fedd2660d02f5d8e4e7da17e01916d30
467
m68k: remove bits/siginfo.h in favor of generic one
470
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
471
index d14368e..e2b54e5 100644
472
--- a/ports/ChangeLog.m68k
473
+++ b/ports/ChangeLog.m68k
475
2010-03-09 Maxim Kuvyrkov <maxim@codesourcery.com>
477
+ * sysdeps/unix/sysv/linux/m68k/bits/siginfo.h: Remove.
479
* sysdeps/m68k/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ)
480
(_jmpbuf_sp, _JMPBUF_UNWINDS_ADJ, __libc_unwind_longjmp): Define.
482
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/siginfo.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/siginfo.h
483
deleted file mode 100644
484
index 1ded1c2..0000000
485
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/siginfo.h
488
-/* siginfo_t, sigevent and constants. m68k linux version.
489
- Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
490
- This file is part of the GNU C Library.
492
- The GNU C Library is free software; you can redistribute it and/or
493
- modify it under the terms of the GNU Lesser General Public
494
- License as published by the Free Software Foundation; either
495
- version 2.1 of the License, or (at your option) any later version.
497
- The GNU C Library is distributed in the hope that it will be useful,
498
- but WITHOUT ANY WARRANTY; without even the implied warranty of
499
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
500
- Lesser General Public License for more details.
502
- You should have received a copy of the GNU Lesser General Public
503
- License along with the GNU C Library; if not, write to the Free
504
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
507
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
508
- && !defined __need_sigevent_t
509
-# error "Never include this file directly. Use <signal.h> instead"
512
-#include <bits/wordsize.h>
514
-#if (!defined __have_sigval_t \
515
- && (defined _SIGNAL_H || defined __need_siginfo_t \
516
- || defined __need_sigevent_t))
517
-# define __have_sigval_t 1
519
-/* Type for data associated with a signal. */
520
-typedef union sigval
527
-#if (!defined __have_siginfo_t \
528
- && (defined _SIGNAL_H || defined __need_siginfo_t))
529
-# define __have_siginfo_t 1
531
-# define __SI_MAX_SIZE 128
532
-# if __WORDSIZE == 64
533
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
535
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
538
-typedef struct siginfo
540
- int si_signo; /* Signal number. */
541
- int si_errno; /* If non-zero, an errno value associated with
542
- this signal, as defined in <errno.h>. */
543
- int si_code; /* Signal code. */
547
- int _pad[__SI_PAD_SIZE];
552
- __pid_t si_pid; /* Sending process ID. */
553
- unsigned short __pad; /* 16-bit version of si_uid. */
554
- __uid_t si_uid; /* Real user ID of sending process. */
557
- /* POSIX.1b timers. */
560
- int si_tid; /* Timer ID. */
561
- int si_overrun; /* Overrun count. */
562
- sigval_t si_sigval; /* Signal value. */
565
- /* POSIX.1b signals. */
568
- __pid_t si_pid; /* Sending process ID. */
569
- unsigned short __pad; /* 16-bit version of si_uid. */
570
- sigval_t si_sigval; /* Signal value. */
571
- __uid_t si_uid; /* Real user ID of sending process. */
577
- __pid_t si_pid; /* Which child. */
578
- unsigned short __pad; /* 16-bit version of si_uid. */
579
- int si_status; /* Exit value or signal. */
580
- __clock_t si_utime;
581
- __clock_t si_stime;
582
- __uid_t si_uid; /* Real user ID of sending process. */
585
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
588
- void *si_addr; /* Faulting insn/memory ref. */
594
- long int si_band; /* Band event for SIGPOLL. */
601
-/* X/Open requires some more fields with fixed names. */
602
-# define si_pid _sifields._kill.si_pid
603
-# define si_uid _sifields._kill.si_uid
604
-# define si_timerid _sifields._timer.si_tid
605
-# define si_overrun _sifields._timer.si_overrun
606
-# define si_status _sifields._sigchld.si_status
607
-# define si_utime _sifields._sigchld.si_utime
608
-# define si_stime _sifields._sigchld.si_stime
609
-# define si_value _sifields._rt.si_sigval
610
-# define si_int _sifields._rt.si_sigval.sival_int
611
-# define si_ptr _sifields._rt.si_sigval.sival_ptr
612
-# define si_addr _sifields._sigfault.si_addr
613
-# define si_band _sifields._sigpoll.si_band
614
-# define si_fd _sifields._sigpoll.si_fd
617
-/* Values for `si_code'. Positive values are reserved for kernel-generated
621
- SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
622
-# define SI_ASYNCNL SI_ASYNCNL
623
- SI_TKILL = -6, /* Sent by tkill. */
624
-# define SI_TKILL SI_TKILL
625
- SI_SIGIO, /* Sent by queued SIGIO. */
626
-# define SI_SIGIO SI_SIGIO
627
- SI_ASYNCIO, /* Sent by AIO completion. */
628
-# define SI_ASYNCIO SI_ASYNCIO
629
- SI_MESGQ, /* Sent by real time mesq state change. */
630
-# define SI_MESGQ SI_MESGQ
631
- SI_TIMER, /* Sent by timer expiration. */
632
-# define SI_TIMER SI_TIMER
633
- SI_QUEUE, /* Sent by sigqueue. */
634
-# define SI_QUEUE SI_QUEUE
635
- SI_USER, /* Sent by kill, sigsend, raise. */
636
-# define SI_USER SI_USER
637
- SI_KERNEL = 0x80 /* Send by kernel. */
638
-#define SI_KERNEL SI_KERNEL
642
-/* `si_code' values for SIGILL signal. */
645
- ILL_ILLOPC = 1, /* Illegal opcode. */
646
-# define ILL_ILLOPC ILL_ILLOPC
647
- ILL_ILLOPN, /* Illegal operand. */
648
-# define ILL_ILLOPN ILL_ILLOPN
649
- ILL_ILLADR, /* Illegal addressing mode. */
650
-# define ILL_ILLADR ILL_ILLADR
651
- ILL_ILLTRP, /* Illegal trap. */
652
-# define ILL_ILLTRP ILL_ILLTRP
653
- ILL_PRVOPC, /* Privileged opcode. */
654
-# define ILL_PRVOPC ILL_PRVOPC
655
- ILL_PRVREG, /* Privileged register. */
656
-# define ILL_PRVREG ILL_PRVREG
657
- ILL_COPROC, /* Coprocessor error. */
658
-# define ILL_COPROC ILL_COPROC
659
- ILL_BADSTK /* Internal stack error. */
660
-# define ILL_BADSTK ILL_BADSTK
663
-/* `si_code' values for SIGFPE signal. */
666
- FPE_INTDIV = 1, /* Integer divide by zero. */
667
-# define FPE_INTDIV FPE_INTDIV
668
- FPE_INTOVF, /* Integer overflow. */
669
-# define FPE_INTOVF FPE_INTOVF
670
- FPE_FLTDIV, /* Floating point divide by zero. */
671
-# define FPE_FLTDIV FPE_FLTDIV
672
- FPE_FLTOVF, /* Floating point overflow. */
673
-# define FPE_FLTOVF FPE_FLTOVF
674
- FPE_FLTUND, /* Floating point underflow. */
675
-# define FPE_FLTUND FPE_FLTUND
676
- FPE_FLTRES, /* Floating point inexact result. */
677
-# define FPE_FLTRES FPE_FLTRES
678
- FPE_FLTINV, /* Floating point invalid operation. */
679
-# define FPE_FLTINV FPE_FLTINV
680
- FPE_FLTSUB /* Subscript out of range. */
681
-# define FPE_FLTSUB FPE_FLTSUB
684
-/* `si_code' values for SIGSEGV signal. */
687
- SEGV_MAPERR = 1, /* Address not mapped to object. */
688
-# define SEGV_MAPERR SEGV_MAPERR
689
- SEGV_ACCERR /* Invalid permissions for mapped object. */
690
-# define SEGV_ACCERR SEGV_ACCERR
693
-/* `si_code' values for SIGBUS signal. */
696
- BUS_ADRALN = 1, /* Invalid address alignment. */
697
-# define BUS_ADRALN BUS_ADRALN
698
- BUS_ADRERR, /* Non-existant physical address. */
699
-# define BUS_ADRERR BUS_ADRERR
700
- BUS_OBJERR /* Object specific hardware error. */
701
-# define BUS_OBJERR BUS_OBJERR
704
-/* `si_code' values for SIGTRAP signal. */
707
- TRAP_BRKPT = 1, /* Process breakpoint. */
708
-# define TRAP_BRKPT TRAP_BRKPT
709
- TRAP_TRACE /* Process trace trap. */
710
-# define TRAP_TRACE TRAP_TRACE
713
-/* `si_code' values for SIGCHLD signal. */
716
- CLD_EXITED = 1, /* Child has exited. */
717
-# define CLD_EXITED CLD_EXITED
718
- CLD_KILLED, /* Child was killed. */
719
-# define CLD_KILLED CLD_KILLED
720
- CLD_DUMPED, /* Child terminated abnormally. */
721
-# define CLD_DUMPED CLD_DUMPED
722
- CLD_TRAPPED, /* Traced child has trapped. */
723
-# define CLD_TRAPPED CLD_TRAPPED
724
- CLD_STOPPED, /* Child has stopped. */
725
-# define CLD_STOPPED CLD_STOPPED
726
- CLD_CONTINUED /* Stopped child has continued. */
727
-# define CLD_CONTINUED CLD_CONTINUED
730
-/* `si_code' values for SIGPOLL signal. */
733
- POLL_IN = 1, /* Data input available. */
734
-# define POLL_IN POLL_IN
735
- POLL_OUT, /* Output buffers available. */
736
-# define POLL_OUT POLL_OUT
737
- POLL_MSG, /* Input message available. */
738
-# define POLL_MSG POLL_MSG
739
- POLL_ERR, /* I/O error. */
740
-# define POLL_ERR POLL_ERR
741
- POLL_PRI, /* High priority input available. */
742
-# define POLL_PRI POLL_PRI
743
- POLL_HUP /* Device disconnected. */
744
-# define POLL_HUP POLL_HUP
747
-# undef __need_siginfo_t
748
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
751
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
752
- && !defined __have_sigevent_t
753
-# define __have_sigevent_t 1
755
-/* Structure to transport application-defined values with signals. */
756
-# define __SIGEV_MAX_SIZE 64
757
-# if __WORDSIZE == 64
758
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
760
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
763
-typedef struct sigevent
765
- sigval_t sigev_value;
771
- int _pad[__SIGEV_PAD_SIZE];
773
- /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
774
- thread to receive the signal. */
779
- void (*_function) (sigval_t); /* Function to start. */
780
- void *_attribute; /* Really pthread_attr_t. */
785
-/* POSIX names to access some of the members. */
786
-# define sigev_notify_function _sigev_un._sigev_thread._function
787
-# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
789
-/* `sigev_notify' values. */
792
- SIGEV_SIGNAL = 0, /* Notify via signal. */
793
-# define SIGEV_SIGNAL SIGEV_SIGNAL
794
- SIGEV_NONE, /* Other notification: meaningless. */
795
-# define SIGEV_NONE SIGEV_NONE
796
- SIGEV_THREAD, /* Deliver via thread creation. */
797
-# define SIGEV_THREAD SIGEV_THREAD
799
- SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
800
-#define SIGEV_THREAD_ID SIGEV_THREAD_ID
803
-#endif /* have _SIGNAL_H. */
804
From: Maxim Kuvyrkov <maxim@codesourcery.com>
805
Date: Tue, 9 Mar 2010 10:34:24 +0000 (-0800)
806
Subject: m68k: update ColdFire sigcontext ABI
807
X-Git-Tag: glibc-2.12~39
808
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=75e73e66e49104a7aff24aa50043ae7ab02e38f3
810
m68k: update ColdFire sigcontext ABI
813
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
814
index e2b54e5..d63b88e 100644
815
--- a/ports/ChangeLog.m68k
816
+++ b/ports/ChangeLog.m68k
818
2010-03-09 Maxim Kuvyrkov <maxim@codesourcery.com>
820
+ * sysdeps/unix/sysv/linux/m68k/bits/sigcontext.h: Remove.
821
+ * sysdeps/unix/sysv/linux/m68k/register-dump.h: Update.
823
* sysdeps/unix/sysv/linux/m68k/bits/siginfo.h: Remove.
825
* sysdeps/m68k/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ)
826
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/sigcontext.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/sigcontext.h
827
deleted file mode 100644
828
index 8ad0c96..0000000
829
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/sigcontext.h
832
-/* Copyright (C) 2006 Free Software Foundation, Inc.
833
- This file is part of the GNU C Library.
835
- The GNU C Library is free software; you can redistribute it and/or
836
- modify it under the terms of the GNU Lesser General Public
837
- License as published by the Free Software Foundation; either
838
- version 2.1 of the License, or (at your option) any later version.
840
- The GNU C Library is distributed in the hope that it will be useful,
841
- but WITHOUT ANY WARRANTY; without even the implied warranty of
842
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
843
- Lesser General Public License for more details.
845
- You should have received a copy of the GNU Lesser General Public
846
- License along with the GNU C Library; if not, write to the Free
847
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
850
-#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
851
-# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
854
-#ifndef _BITS_SIGCONTEXT_H
855
-#define _BITS_SIGCONTEXT_H 1
858
- unsigned long sc_mask;
859
- unsigned long sc_usp;
860
- unsigned long sc_d0;
861
- unsigned long sc_d1;
862
-#ifdef __mcoldfire__
863
- unsigned long sc_d2;
864
- unsigned long sc_d3;
865
- unsigned long sc_d4;
866
- unsigned long sc_d5;
867
- unsigned long sc_d6;
868
- unsigned long sc_d7;
870
- unsigned long sc_a0;
871
- unsigned long sc_a1;
872
-#ifdef __mcoldfire__
873
- unsigned long sc_a2;
874
- unsigned long sc_a3;
875
- unsigned long sc_a4;
876
- unsigned long sc_a5;
877
- unsigned long sc_a6;
879
- unsigned short sc_sr;
880
- unsigned long sc_pc;
881
- unsigned short sc_formatvec;
882
-#ifdef __mcoldfire__
883
- unsigned long sc_fpregs[8][2];
884
- unsigned long sc_fpcntl[3];
885
- unsigned char sc_fpstate[16];
887
- unsigned long sc_fpregs[2*3];
888
- unsigned long sc_fpcntl[3];
889
- unsigned char sc_fpstate[216];
894
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h b/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h
895
index 391902f..78709d9 100644
896
--- a/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h
897
+++ b/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h
902
-#ifndef __mcoldfire__
903
/* Linux saves only the call-clobbered registers in the sigcontext. We
904
need to use a trampoline that saves the rest so that the C code can
905
access them. We use the sc_fpstate field, since the handler is not
906
@@ -59,14 +58,17 @@ catch_segfault:\n\
907
/* Clear the first 4 bytes to make it a null fp state, just\n\
908
in case the handler does return. */\n\
910
- movem.l %%d2-%%d7/%%a2-%%a6,(%%a0)\n\
911
- fmovem.x %%fp2-%%fp7,11*4(%%a0)\n\
912
- jra real_catch_segfault"
913
+ movem.l %%d2-%%d7/%%a2-%%a6,(%%a0)\n"
914
+#ifndef __mcoldfire__
915
+ "fmovem.x %%fp2-%%fp7,11*4(%%a0)\n"
916
+#elif defined __mcffpu__
917
+ "fmovem.d %%fp2-%%fp7,11*4(%%a0)\n"
919
+ "jra real_catch_segfault"
920
: : "n" (offsetof (struct sigcontext, sc_fpstate)));
922
#define catch_segfault(a,b) \
923
__attribute_used__ real_catch_segfault(a,b)
927
hexvalue (unsigned long int value, char *buf, size_t len)
928
@@ -104,36 +106,19 @@ register_dump (int fd, struct sigcontext *ctx)
929
/* Generate strings of register contents. */
930
hexvalue (ctx->sc_d0, regs[0], 8);
931
hexvalue (ctx->sc_d1, regs[1], 8);
932
-#ifdef __mcoldfire__
933
- hexvalue (ctx->sc_d2, regs[2], 8);
934
- hexvalue (ctx->sc_d3, regs[3], 8);
935
- hexvalue (ctx->sc_d4, regs[4], 8);
936
- hexvalue (ctx->sc_d5, regs[5], 8);
937
- hexvalue (ctx->sc_d6, regs[6], 8);
938
- hexvalue (ctx->sc_d7, regs[7], 8);
940
hexvalue (*p++, regs[2], 8);
941
hexvalue (*p++, regs[3], 8);
942
hexvalue (*p++, regs[4], 8);
943
hexvalue (*p++, regs[5], 8);
944
hexvalue (*p++, regs[6], 8);
945
hexvalue (*p++, regs[7], 8);
947
hexvalue (ctx->sc_a0, regs[8], 8);
948
hexvalue (ctx->sc_a1, regs[9], 8);
949
-#ifdef __mcoldfire__
950
- hexvalue (ctx->sc_a2, regs[10], 8);
951
- hexvalue (ctx->sc_a3, regs[11], 8);
952
- hexvalue (ctx->sc_a4, regs[12], 8);
953
- hexvalue (ctx->sc_a5, regs[13], 8);
954
- hexvalue (ctx->sc_a6, regs[14], 8);
956
hexvalue (*p++, regs[10], 8);
957
hexvalue (*p++, regs[11], 8);
958
hexvalue (*p++, regs[12], 8);
959
hexvalue (*p++, regs[13], 8);
960
hexvalue (*p++, regs[14], 8);
962
hexvalue (ctx->sc_usp, regs[15], 8);
963
hexvalue (ctx->sc_pc, regs[16], 8);
964
hexvalue (ctx->sc_sr, regs[17], 4);
965
@@ -142,9 +127,6 @@ register_dump (int fd, struct sigcontext *ctx)
966
for (i = 0; i < 2; i++)
967
for (j = 0; j < fpreg_size; j += 8)
968
hexvalue (*pfp++, fpregs[i] + j, 8);
969
-#ifdef __mcoldfire__
972
for (i = 2; i < 8; i++)
973
for (j = 0; j < fpreg_size; j += 8)
974
hexvalue (*p++, fpregs[i] + j, 8);
975
From: Maxim Kuvyrkov <maxim@codesourcery.com>
976
Date: Fri, 12 Mar 2010 18:50:55 +0000 (+0100)
977
Subject: NPTL support for m68k/ColdFire
978
X-Git-Tag: glibc-2.12~38
979
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=40111cb9e17a911c8913f00d9b913a71ceb6e609
981
NPTL support for m68k/ColdFire
984
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
985
index d63b88e..32681ff 100644
986
--- a/ports/ChangeLog.m68k
987
+++ b/ports/ChangeLog.m68k
989
2010-03-09 Maxim Kuvyrkov <maxim@codesourcery.com>
991
+ NPTL support for m68k/ColdFire
992
+ * sysdeps/unix/sysv/linux/m68k/sysdep.h (tls.h): Include.
993
+ (INTERNAL_SYSCALL): Convert to INTERNAL_SYSCALL_NCS.
994
+ (PTR_MANGLE, PTR_DEMANGLE): Define.
995
+ (NEED_STATIC_SYSINFO_DSO): Define.
996
+ * sysdeps/unix/sysv/linux/m68k/clone.S: Support RESET_PID.
997
+ * sysdeps/unix/sysv/linux/m68k/m68k-helpers.S: New.
998
+ * sysdeps/unix/sysv/linux/m68k/Makefile: Add new files to lists.
999
+ * sysdeps/unix/sysv/linux/m68k/vfork.S: Add SAVE_PID/RESTORE_PID.
1000
+ * sysdeps/unix/sysv/linux/m68k/m68k-vdso.c: New.
1001
+ * sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c: New.
1002
+ * sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h: New.
1003
+ * sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h: New.
1004
+ * sysdeps/unix/sysv/linux/m68k/Versions: Add symbols for NPTL support.
1005
+ * sysdeps/unix/sysv/linux/m68k/init-first.c: New.
1006
+ * sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h: New.
1007
+ * sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h: New.
1008
+ * sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h: New.
1009
+ * sysdeps/unix/sysv/linux/m68k/nptl/clone.S: New.
1010
+ * sysdeps/unix/sysv/linux/m68k/nptl/fork.c: New.
1011
+ * sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h: New.
1012
+ * sysdeps/unix/sysv/linux/m68k/nptl/vfork.S: New.
1013
+ * sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S: New.
1014
+ * sysdeps/unix/sysv/linux/m68k/nptl/createthread.c: New.
1015
+ * sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c: New.
1016
+ * sysdeps/unix/sysv/linux/m68k/socket.S: Update cancelation code.
1017
+ * sysdeps/m68k/dl-tls.h: New.
1018
+ * sysdeps/m68k/libc-tls.c: New.
1019
+ * sysdeps/m68k/tls-macros.h: New.
1020
+ * sysdeps/m68k/dl-machine.h (RTLD_START): Terminate stack frame to
1021
+ generate better backtraces.
1022
+ (elf_machine_type_class, elf_machine_rela): Handle TLS relocations.
1023
+ * sysdeps/m68k/dl-machine.h: Handle TLS relocations.
1024
+ * sysdeps/m68k/nptl/tcb-offsets.sym: New.
1025
+ * sysdeps/m68k/nptl/pthread_spin_trylock.c: New.
1026
+ * sysdeps/m68k/nptl/tls.h: New.
1027
+ * sysdeps/m68k/nptl/pthread_spin_lock.c: New.
1028
+ * sysdeps/m68k/nptl/pthreaddef.h: New.
1029
+ * sysdeps/m68k/nptl/Makefile: New.
1031
* sysdeps/unix/sysv/linux/m68k/bits/sigcontext.h: Remove.
1032
* sysdeps/unix/sysv/linux/m68k/register-dump.h: Update.
1034
diff --git a/ports/sysdeps/m68k/dl-machine.h b/ports/sysdeps/m68k/dl-machine.h
1035
index 08a4396..9bc35e7 100644
1036
--- a/ports/sysdeps/m68k/dl-machine.h
1037
+++ b/ports/sysdeps/m68k/dl-machine.h
1039
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
1040
- Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
1041
+ Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2010
1042
+ Free Software Foundation, Inc.
1043
This file is part of the GNU C Library.
1045
The GNU C Library is free software; you can redistribute it and/or
1048
#include <sys/param.h>
1050
+#include <dl-tls.h>
1052
/* Return nonzero iff ELF header is compatible with the running host. */
1054
@@ -121,6 +123,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
1056
.type _start,@function\n\
1059
move.l %sp, -(%sp)\n\
1062
@@ -159,12 +162,16 @@ _dl_start_user:\n\
1063
.size _dl_start_user, . - _dl_start_user\n\
1066
-/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
1067
- PLT entries should not be allowed to define the value.
1068
+/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
1069
+ TLS variable, so undefined references should not be allowed to
1071
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
1072
of the main executable's symbols, as for a COPY reloc. */
1073
#define elf_machine_type_class(type) \
1074
- ((((type) == R_68K_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
1075
+ ((((type) == R_68K_JMP_SLOT \
1076
+ || (type) == R_68K_TLS_DTPMOD32 \
1077
+ || (type) == R_68K_TLS_DTPREL32 \
1078
+ || (type) == R_68K_TLS_TPREL32) * ELF_RTYPE_CLASS_PLT) \
1079
| (((type) == R_68K_COPY) * ELF_RTYPE_CLASS_COPY))
1081
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
1082
@@ -262,6 +269,25 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
1084
*reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr;
1086
+#if defined USE_TLS && !defined RTLD_BOOTSTRAP
1087
+ case R_68K_TLS_DTPMOD32:
1088
+ /* Get the information from the link map returned by the
1089
+ resolv function. */
1090
+ if (sym_map != NULL)
1091
+ *reloc_addr = sym_map->l_tls_modid;
1093
+ case R_68K_TLS_DTPREL32:
1095
+ *reloc_addr = TLS_DTPREL_VALUE (sym, reloc);
1097
+ case R_68K_TLS_TPREL32:
1100
+ CHECK_STATIC_TLS (map, sym_map);
1101
+ *reloc_addr = TLS_TPREL_VALUE (sym_map, sym, reloc);
1104
+#endif /* defined USE_TLS && !defined RTLD_BOOTSTRAP */
1105
case R_68K_NONE: /* Alright, Wilbur. */
1108
diff --git a/ports/sysdeps/m68k/dl-tls.h b/ports/sysdeps/m68k/dl-tls.h
1109
new file mode 100644
1110
index 0000000..f2ce998
1112
+++ b/ports/sysdeps/m68k/dl-tls.h
1114
+/* Thread-local storage handling in the ELF dynamic linker. M68K version.
1115
+ Copyright (C) 2010 Free Software Foundation, Inc.
1116
+ This file is part of the GNU C Library.
1117
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1119
+ The GNU C Library is free software; you can redistribute it and/or
1120
+ modify it under the terms of the GNU Lesser General Public
1121
+ License as published by the Free Software Foundation; either
1122
+ version 2.1 of the License, or (at your option) any later version.
1124
+ The GNU C Library is distributed in the hope that it will be useful,
1125
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1126
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1127
+ Lesser General Public License for more details.
1129
+ You should have received a copy of the GNU Lesser General Public
1130
+ License along with the GNU C Library; if not, write to the Free
1131
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1132
+ 02111-1307 USA. */
1135
+/* Type used for the representation of TLS information in the GOT. */
1138
+ unsigned long int ti_module;
1139
+ unsigned long int ti_offset;
1142
+/* The thread pointer points 0x7000 past the first static TLS block. */
1143
+#define TLS_TP_OFFSET 0x7000
1145
+/* Dynamic thread vector pointers point 0x8000 past the start of each
1147
+#define TLS_DTV_OFFSET 0x8000
1149
+/* Compute the value for a TPREL reloc. */
1150
+#define TLS_TPREL_VALUE(sym_map, sym, reloc) \
1151
+ ((sym_map)->l_tls_offset + (sym)->st_value + (reloc)->r_addend \
1154
+/* Compute the value for a DTPREL reloc. */
1155
+#define TLS_DTPREL_VALUE(sym, reloc) \
1156
+ ((sym)->st_value + (reloc)->r_addend - TLS_DTV_OFFSET)
1158
+extern void *__tls_get_addr (tls_index *ti);
1160
+#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
1161
+#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
1162
diff --git a/ports/sysdeps/m68k/libc-tls.c b/ports/sysdeps/m68k/libc-tls.c
1163
new file mode 100644
1164
index 0000000..e865fac
1166
+++ b/ports/sysdeps/m68k/libc-tls.c
1168
+/* Thread-local storage handling in the ELF dynamic linker. m68k version.
1169
+ Copyright (C) 2010 Free Software Foundation, Inc.
1170
+ This file is part of the GNU C Library.
1171
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1173
+ The GNU C Library is free software; you can redistribute it and/or
1174
+ modify it under the terms of the GNU Lesser General Public
1175
+ License as published by the Free Software Foundation; either
1176
+ version 2.1 of the License, or (at your option) any later version.
1178
+ The GNU C Library is distributed in the hope that it will be useful,
1179
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1180
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1181
+ Lesser General Public License for more details.
1183
+ You should have received a copy of the GNU Lesser General Public
1184
+ License along with the GNU C Library; if not, write to the Free
1185
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1186
+ 02111-1307 USA. */
1188
+#include <csu/libc-tls.c>
1189
+#include <dl-tls.h>
1193
+/* On M68K, linker optimizations are not required, so __tls_get_addr
1194
+ can be called even in statically linked binaries. In this case module
1195
+ must be always 1 and PT_TLS segment exist in the binary, otherwise it
1196
+ would not link. */
1199
+__tls_get_addr (tls_index *ti)
1201
+ dtv_t *dtv = THREAD_DTV ();
1202
+ return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET;
1206
diff --git a/ports/sysdeps/m68k/nptl/Makefile b/ports/sysdeps/m68k/nptl/Makefile
1207
new file mode 100644
1208
index 0000000..f36fc8f
1210
+++ b/ports/sysdeps/m68k/nptl/Makefile
1212
+# Copyright (C) 2010 Free Software Foundation, Inc.
1213
+# This file is part of the GNU C Library.
1214
+# Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1216
+# The GNU C Library is free software; you can redistribute it and/or
1217
+# modify it under the terms of the GNU Lesser General Public
1218
+# License as published by the Free Software Foundation; either
1219
+# version 2.1 of the License, or (at your option) any later version.
1221
+# The GNU C Library is distributed in the hope that it will be useful,
1222
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1223
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1224
+# Lesser General Public License for more details.
1226
+# You should have received a copy of the GNU Lesser General Public
1227
+# License along with the GNU C Library; if not, write to the Free
1228
+# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1231
+ifeq ($(subdir),csu)
1232
+gen-as-const-headers += tcb-offsets.sym
1234
diff --git a/ports/sysdeps/m68k/nptl/pthread_spin_lock.c b/ports/sysdeps/m68k/nptl/pthread_spin_lock.c
1235
new file mode 100644
1236
index 0000000..1cc16c8
1238
+++ b/ports/sysdeps/m68k/nptl/pthread_spin_lock.c
1240
+/* Copyright (C) 2010 Free Software Foundation, Inc.
1241
+ This file is part of the GNU C Library.
1242
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1244
+ The GNU C Library is free software; you can redistribute it and/or
1245
+ modify it under the terms of the GNU Lesser General Public
1246
+ License as published by the Free Software Foundation; either
1247
+ version 2.1 of the License, or (at your option) any later version.
1249
+ The GNU C Library is distributed in the hope that it will be useful,
1250
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1251
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1252
+ Lesser General Public License for more details.
1254
+ You should have received a copy of the GNU Lesser General Public
1255
+ License along with the GNU C Library; if not, write to the Free
1256
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1257
+ 02111-1307 USA. */
1259
+#include <atomic.h>
1260
+#include "pthreadP.h"
1263
+pthread_spin_lock (pthread_spinlock_t *lock)
1265
+ while (atomic_compare_and_exchange_val_acq(lock, 1, 0) != 0)
1266
+ while (*lock != 0)
1271
diff --git a/ports/sysdeps/m68k/nptl/pthread_spin_trylock.c b/ports/sysdeps/m68k/nptl/pthread_spin_trylock.c
1272
new file mode 100644
1273
index 0000000..831bffb
1275
+++ b/ports/sysdeps/m68k/nptl/pthread_spin_trylock.c
1277
+/* Copyright (C) 2010 Free Software Foundation, Inc.
1278
+ This file is part of the GNU C Library.
1279
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1281
+ The GNU C Library is free software; you can redistribute it and/or
1282
+ modify it under the terms of the GNU Lesser General Public
1283
+ License as published by the Free Software Foundation; either
1284
+ version 2.1 of the License, or (at your option) any later version.
1286
+ The GNU C Library is distributed in the hope that it will be useful,
1287
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1288
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1289
+ Lesser General Public License for more details.
1291
+ You should have received a copy of the GNU Lesser General Public
1292
+ License along with the GNU C Library; if not, write to the Free
1293
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1294
+ 02111-1307 USA. */
1297
+#include <atomic.h>
1298
+#include "pthreadP.h"
1301
+pthread_spin_trylock (pthread_spinlock_t *lock)
1303
+ return atomic_compare_and_exchange_val_acq(lock, 1, 0) ? EBUSY : 0;
1305
diff --git a/ports/sysdeps/m68k/nptl/pthreaddef.h b/ports/sysdeps/m68k/nptl/pthreaddef.h
1306
new file mode 100644
1307
index 0000000..0a54907
1309
+++ b/ports/sysdeps/m68k/nptl/pthreaddef.h
1311
+/* Copyright (C) 2010 Free Software Foundation, Inc.
1312
+ This file is part of the GNU C Library.
1313
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1315
+ The GNU C Library is free software; you can redistribute it and/or
1316
+ modify it under the terms of the GNU Lesser General Public
1317
+ License as published by the Free Software Foundation; either
1318
+ version 2.1 of the License, or (at your option) any later version.
1320
+ The GNU C Library is distributed in the hope that it will be useful,
1321
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1322
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1323
+ Lesser General Public License for more details.
1325
+ You should have received a copy of the GNU Lesser General Public
1326
+ License along with the GNU C Library; if not, write to the Free
1327
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1328
+ 02111-1307 USA. */
1330
+/* Default stack size. */
1331
+#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
1333
+/* Required stack pointer alignment at beginning. */
1334
+#define STACK_ALIGN 16
1336
+/* Minimal stack size after allocating thread descriptor and guard size. */
1337
+#define MINIMAL_REST_STACK 2048
1339
+/* Alignment requirement for TCB. */
1340
+#define TCB_ALIGNMENT 16
1343
+/* Location of current stack frame. */
1344
+#define CURRENT_STACK_FRAME __builtin_frame_address (0)
1347
+/* XXX Until we have a better place keep the definitions here. */
1348
+#define __exit_thread_inline(val) \
1349
+ INLINE_SYSCALL (exit, 1, (val))
1350
diff --git a/ports/sysdeps/m68k/nptl/tcb-offsets.sym b/ports/sysdeps/m68k/nptl/tcb-offsets.sym
1351
new file mode 100644
1352
index 0000000..b1bba65
1354
+++ b/ports/sysdeps/m68k/nptl/tcb-offsets.sym
1356
+#include <sysdep.h>
1361
+-- Derive offsets relative to the thread register.
1362
+#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
1364
+MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
1365
+PID_OFFSET thread_offsetof (pid)
1366
+TID_OFFSET thread_offsetof (tid)
1367
diff --git a/ports/sysdeps/m68k/nptl/tls.h b/ports/sysdeps/m68k/nptl/tls.h
1368
new file mode 100644
1369
index 0000000..c29824c
1371
+++ b/ports/sysdeps/m68k/nptl/tls.h
1373
+/* Definition for thread-local data handling. NPTL/m68k version.
1374
+ Copyright (C) 2010 Free Software Foundation, Inc.
1375
+ This file is part of the GNU C Library.
1376
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1378
+ The GNU C Library is free software; you can redistribute it and/or
1379
+ modify it under the terms of the GNU Lesser General Public
1380
+ License as published by the Free Software Foundation; either
1381
+ version 2.1 of the License, or (at your option) any later version.
1383
+ The GNU C Library is distributed in the hope that it will be useful,
1384
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1385
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1386
+ Lesser General Public License for more details.
1388
+ You should have received a copy of the GNU Lesser General Public
1389
+ License along with the GNU C Library; if not, write to the Free
1390
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1391
+ 02111-1307 USA. */
1396
+#include <dl-sysdep.h>
1398
+#ifndef __ASSEMBLER__
1399
+# include <stdbool.h>
1400
+# include <stddef.h>
1401
+# include <stdint.h>
1403
+/* Type for the dtv. */
1414
+#else /* __ASSEMBLER__ */
1415
+# include <tcb-offsets.h>
1416
+#endif /* __ASSEMBLER__ */
1418
+/* Signal that TLS support is available. */
1421
+#ifndef __ASSEMBLER__
1423
+/* Get system call information. */
1424
+# include <sysdep.h>
1426
+/* The TP points to the start of the thread blocks. */
1427
+# define TLS_DTV_AT_TP 1
1429
+/* Get the thread descriptor definition. */
1430
+# include <nptl/descr.h>
1438
+/* This is the size of the initial TCB. Because our TCB is before the thread
1439
+ pointer, we don't need this. */
1440
+# define TLS_INIT_TCB_SIZE 0
1442
+/* Alignment requirements for the initial TCB. */
1443
+# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread)
1445
+/* This is the size of the TCB. Because our TCB is before the thread
1446
+ pointer, we don't need this. */
1447
+# define TLS_TCB_SIZE 0
1449
+/* Alignment requirements for the TCB. */
1450
+# define TLS_TCB_ALIGN __alignof__ (struct pthread)
1452
+/* This is the size we need before TCB - actually, it includes the TCB. */
1453
+# define TLS_PRE_TCB_SIZE \
1454
+ (sizeof (struct pthread) \
1455
+ + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
1457
+/* The thread pointer (TP) points to the end of the
1458
+ TCB + 0x7000, as for PowerPC and MIPS. This implies that TCB address is
1459
+ TP - 0x7000. As we define TLS_DTV_AT_TP we can
1460
+ assume that the pthread struct is allocated immediately ahead of the
1461
+ TCB. This implies that the pthread_descr address is
1462
+ TP - (TLS_PRE_TCB_SIZE + 0x7000). */
1463
+# define TLS_TCB_OFFSET 0x7000
1465
+/* Install the dtv pointer. The pointer passed is to the element with
1466
+ index -1 which contain the length. */
1467
+# define INSTALL_DTV(tcbp, dtvp) \
1468
+ ((tcbhead_t *) (tcbp))[-1].dtv = dtvp + 1
1470
+/* Install new dtv for current thread. */
1471
+# define INSTALL_NEW_DTV(dtv) \
1472
+ (THREAD_DTV () = (dtv))
1474
+/* Return dtv of given thread descriptor. */
1475
+# define GET_DTV(tcbp) \
1476
+ (((tcbhead_t *) (tcbp))[-1].dtv)
1478
+/* Code to initially initialize the thread pointer. This might need
1479
+ special attention since 'errno' is not yet available and if the
1480
+ operation can cause a failure 'errno' must not be touched. */
1481
+# define TLS_INIT_TP(tcbp, secondcall) \
1483
+ INTERNAL_SYSCALL_DECL (err); \
1484
+ int _sys_result; \
1486
+ _sys_result = INTERNAL_SYSCALL (set_thread_area, err, 1, \
1487
+ ((void *) (tcbp)) + TLS_TCB_OFFSET); \
1488
+ INTERNAL_SYSCALL_ERROR_P (_sys_result, err) ? "unknown error" : NULL; })
1490
+extern void * __m68k_read_tp (void);
1492
+/* Return the address of the dtv for the current thread. */
1493
+# define THREAD_DTV() \
1494
+ (((tcbhead_t *) (__m68k_read_tp () - TLS_TCB_OFFSET))[-1].dtv)
1496
+/* Return the thread descriptor for the current thread. */
1497
+# define THREAD_SELF \
1498
+ ((struct pthread *) (__m68k_read_tp () - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
1500
+/* Magic for libthread_db to know how to do THREAD_SELF. */
1501
+# define DB_THREAD_SELF \
1502
+ CONST_THREAD_AREA (32, TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
1504
+/* Access to data in the thread descriptor is easy. */
1505
+# define THREAD_GETMEM(descr, member) \
1507
+# define THREAD_GETMEM_NC(descr, member, idx) \
1508
+ descr->member[idx]
1509
+# define THREAD_SETMEM(descr, member, value) \
1510
+ descr->member = (value)
1511
+# define THREAD_SETMEM_NC(descr, member, idx, value) \
1512
+ descr->member[idx] = (value)
1514
+/* l_tls_offset == 0 is perfectly valid on M68K, so we have to use some
1515
+ different value to mean unset l_tls_offset. */
1516
+# define NO_TLS_OFFSET -1
1518
+/* Get and set the global scope generation counter in struct pthread. */
1519
+#define THREAD_GSCOPE_FLAG_UNUSED 0
1520
+#define THREAD_GSCOPE_FLAG_USED 1
1521
+#define THREAD_GSCOPE_FLAG_WAIT 2
1522
+#define THREAD_GSCOPE_RESET_FLAG() \
1525
+ = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
1526
+ THREAD_GSCOPE_FLAG_UNUSED); \
1527
+ if (__res == THREAD_GSCOPE_FLAG_WAIT) \
1528
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
1531
+#define THREAD_GSCOPE_SET_FLAG() \
1534
+ THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED; \
1535
+ atomic_write_barrier (); \
1538
+#define THREAD_GSCOPE_WAIT() \
1539
+ GL(dl_wait_lookup_done) ()
1541
+#endif /* __ASSEMBLER__ */
1544
diff --git a/ports/sysdeps/m68k/tls-macros.h b/ports/sysdeps/m68k/tls-macros.h
1545
new file mode 100644
1546
index 0000000..d03d7b9
1548
+++ b/ports/sysdeps/m68k/tls-macros.h
1550
+/* Macros for accessing thread-local storage. m68k version.
1551
+ Copyright (C) 2010 Free Software Foundation, Inc.
1552
+ This file is part of the GNU C Library.
1553
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1555
+ The GNU C Library is free software; you can redistribute it and/or
1556
+ modify it under the terms of the GNU Lesser General Public
1557
+ License as published by the Free Software Foundation; either
1558
+ version 2.1 of the License, or (at your option) any later version.
1560
+ The GNU C Library is distributed in the hope that it will be useful,
1561
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1562
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1563
+ Lesser General Public License for more details.
1565
+ You should have received a copy of the GNU Lesser General Public
1566
+ License along with the GNU C Library; if not, write to the Free
1567
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1568
+ 02111-1307 USA. */
1570
+#define TLS_GD(x) \
1573
+ extern void *__tls_get_addr (void *); \
1575
+ asm ("movel #_GLOBAL_OFFSET_TABLE_@GOTPC, %0\n\t" \
1576
+ "lea (-6, %%pc, %0), %0\n\t" \
1577
+ "lea " #x "@TLSGD(%0), %0" \
1578
+ : "=&a" (__result)); \
1579
+ (int *) __tls_get_addr (__result); })
1581
+#define TLS_LD(x) \
1585
+ extern void *__tls_get_addr (void *); \
1587
+ asm ("movel #_GLOBAL_OFFSET_TABLE_@GOTPC, %0\n\t" \
1588
+ "lea (-6, %%pc, %0), %0\n\t" \
1589
+ "lea " #x "@TLSLDM(%0), %0" \
1590
+ : "=&a" (__tp)); \
1591
+ __tp = (char *) __tls_get_addr (__tp); \
1592
+ asm ("movel #" #x "@TLSLDO, %0" \
1593
+ : "=a" (__offset)); \
1594
+ (int *) (__tp + __offset); })
1596
+#define TLS_IE(x) \
1600
+ extern void * __m68k_read_tp (void); \
1602
+ __tp = (char *) __m68k_read_tp (); \
1603
+ asm ("movel #_GLOBAL_OFFSET_TABLE_@GOTPC, %0\n\t" \
1604
+ "lea (-6, %%pc, %0), %0\n\t" \
1605
+ "movel " #x "@TLSIE(%0), %0" \
1606
+ : "=&a" (__offset)); \
1607
+ (int *) (__tp + __offset); })
1609
+#define TLS_LE(x) \
1613
+ extern void * __m68k_read_tp (void); \
1615
+ __tp = (char *) __m68k_read_tp (); \
1616
+ asm ("movel #" #x "@TLSLE, %0" \
1617
+ : "=a" (__offset)); \
1618
+ (int *) (__tp + __offset); })
1620
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/Makefile b/ports/sysdeps/unix/sysv/linux/m68k/Makefile
1621
index 6bb4f6b..97d9584 100644
1622
--- a/ports/sysdeps/unix/sysv/linux/m68k/Makefile
1623
+++ b/ports/sysdeps/unix/sysv/linux/m68k/Makefile
1626
m68k-syntax-flag = -DMOTOROLA_SYNTAX
1628
+ifeq ($(subdir),csu)
1629
+sysdep_routines += m68k-helpers
1632
ifeq ($(subdir),misc)
1633
sysdep_routines += mremap
1634
sysdep_headers += sys/reg.h
1637
ifeq ($(subdir),elf)
1638
+sysdep_routines += dl-vdso libc-m68k-vdso
1639
+sysdep-rtld-routines += m68k-vdso
1640
sysdep-others += lddlibc4
1641
install-bin += lddlibc4
1643
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/Versions b/ports/sysdeps/unix/sysv/linux/m68k/Versions
1644
index 5650f7f..8a941f8 100644
1645
--- a/ports/sysdeps/unix/sysv/linux/m68k/Versions
1646
+++ b/ports/sysdeps/unix/sysv/linux/m68k/Versions
1647
@@ -32,4 +32,18 @@ libc {
1655
+ __vdso_atomic_cmpxchg_32; __vdso_atomic_barrier;
1661
+ __rtld___vdso_read_tp;
1662
+ __rtld___vdso_atomic_cmpxchg_32;
1663
+ __rtld___vdso_atomic_barrier;
1666
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
1667
new file mode 100644
1668
index 0000000..c361060
1670
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
1672
+/* Resolve function pointers to VDSO functions.
1673
+ Copyright (C) 2010 Free Software Foundation, Inc.
1674
+ This file is part of the GNU C Library.
1675
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1677
+ The GNU C Library is free software; you can redistribute it and/or
1678
+ modify it under the terms of the GNU Lesser General Public
1679
+ License as published by the Free Software Foundation; either
1680
+ version 2.1 of the License, or (at your option) any later version.
1682
+ The GNU C Library is distributed in the hope that it will be useful,
1683
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1684
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1685
+ Lesser General Public License for more details.
1687
+ You should have received a copy of the GNU Lesser General Public
1688
+ License along with the GNU C Library; if not, write to the Free
1689
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1690
+ 02111-1307 USA. */
1693
+#ifndef _M68K_VDSO_H
1694
+#define _M68K_VDSO_H
1699
+# define M68K_VDSO_SYMBOL(name) __rtld_##name
1700
+# define STR_M68K_VDSO_SYMBOL(name) "__rtld_" #name
1702
+# define M68K_VDSO_SYMBOL(name) name
1703
+# define STR_M68K_VDSO_SYMBOL(name) #name
1706
+# ifndef __ASSEMBLER__
1708
+/* We define __rtld_* copies for rtld.
1709
+ We need them visible in libc to initialize. */
1710
+# if defined IS_IN_rtld || !defined NOT_IN_libc
1711
+extern void *__rtld___vdso_read_tp;
1712
+extern void *__rtld___vdso_atomic_cmpxchg_32;
1713
+extern void *__rtld___vdso_atomic_barrier;
1715
+/* These stubs are meant to be invoked only from the assembly. */
1716
+extern void __vdso_read_tp_stub (void);
1717
+extern void __vdso_atomic_cmpxchg_32_stub (void);
1718
+extern void __vdso_atomic_barrier_stub (void);
1719
+# endif /* IS_IN_rtld || !NOT_IN_libc */
1721
+/* RTLD should only use its own copies. */
1722
+# ifndef IS_IN_rtld
1723
+extern void *__vdso_read_tp;
1724
+extern void *__vdso_atomic_cmpxchg_32;
1725
+extern void *__vdso_atomic_barrier;
1726
+# endif /* !IS_IN_rtld */
1728
+# endif /* !__ASSEMBLER__ */
1730
+#endif /* SHARED */
1732
+#endif /* _M68K_VDSO_H */
1733
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/clone.S b/ports/sysdeps/unix/sysv/linux/m68k/clone.S
1734
index a179f8e..401e2ef 100644
1735
--- a/ports/sysdeps/unix/sysv/linux/m68k/clone.S
1736
+++ b/ports/sysdeps/unix/sysv/linux/m68k/clone.S
1738
-/* Copyright (C) 1996,97,98,2002 Free Software Foundation, Inc.
1739
+/* Copyright (C) 1996,97,98,2002,2010 Free Software Foundation, Inc.
1740
This file is part of the GNU C Library.
1741
Contributed by Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
1744
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1747
-/* clone is even more special than fork as it mucks with stacks
1748
+/* clone() is even more special than fork() as it mucks with stacks
1749
and invokes a function in the right context after its all over. */
1753
#include <bits/errno.h>
1758
+#define CLONE_VM 0x00000100
1759
+#define CLONE_THREAD 0x00010000
1761
-/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
1762
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
1763
+ void *parent_tidptr, void *tls, void *child_tidptr) */
1767
@@ -42,7 +49,17 @@ ENTRY (__clone)
1768
movel 16(%sp), -(%a1)
1770
/* Do the system call */
1771
- movel 12(%sp), %d1 /* get flags */
1772
+ movel 12+0(%sp), %d1 /* get flags */
1773
+ movel %d3, -(%a1) /* save %d3 and get parent_tidptr */
1775
+ movel 20+4(%sp), %d3
1776
+ movel %d4, -(%a1) /* save %d4 and get child_tidptr */
1778
+ movel 28+8(%sp), %d4
1779
+ movel %d5, -(%a1) /* save %d5 and get tls */
1781
+ movel 24+12(%sp), %d5
1782
+ /* save %d2 and get stack pointer */
1783
#ifdef __mcoldfire__
1786
@@ -57,6 +74,9 @@ ENTRY (__clone)
1788
exg %d2, %a1 /* restore %d2 */
1790
+ movel (%sp)+, %d5 /* restore %d5, %d4 and %d3 */
1795
jmi SYSCALL_ERROR_LABEL
1796
@@ -65,11 +85,35 @@ ENTRY (__clone)
1801
+ cfi_undefined (pc) /* Mark end of stack */
1802
subl %fp, %fp /* terminate the stack frame */
1804
+ /* Check and see if we need to reset the PID. */
1806
+ andl #CLONE_THREAD, %d1
1810
+ andl #CLONE_VM, %d1
1812
+ movel #SYS_ify (getpid), %d0
1817
+ bsrl __m68k_read_tp@PLTPC
1819
+ movel %d0, PID_OFFSET(%a0)
1820
+ movel %d0, TID_OFFSET(%a0)
1826
movel #SYS_ify (exit), %d0
1830
PSEUDO_END (__clone)
1832
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h
1833
new file mode 100644
1834
index 0000000..1198bb9
1836
+++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h
1838
+/* Copyright (C) 2010 Free Software Foundation, Inc.
1839
+ This file is part of the GNU C Library.
1840
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1842
+ The GNU C Library is free software; you can redistribute it and/or
1843
+ modify it under the terms of the GNU Lesser General Public
1844
+ License as published by the Free Software Foundation; either
1845
+ version 2.1 of the License, or (at your option) any later version.
1847
+ The GNU C Library is distributed in the hope that it will be useful,
1848
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1849
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1850
+ Lesser General Public License for more details.
1852
+ You should have received a copy of the GNU Lesser General Public
1853
+ License along with the GNU C Library; if not, write to the Free
1854
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1855
+ 02111-1307 USA. */
1857
+#ifndef _BITS_ATOMIC_H
1858
+#define _BITS_ATOMIC_H 1
1860
+#include <stdint.h>
1861
+#include <sysdep.h>
1862
+#include <bits/m68k-vdso.h>
1864
+/* Coldfire has no atomic compare-and-exchange operation, but the
1865
+ kernel provides userspace atomicity operations. Use them. */
1867
+typedef int32_t atomic32_t;
1868
+typedef uint32_t uatomic32_t;
1869
+typedef int_fast32_t atomic_fast32_t;
1870
+typedef uint_fast32_t uatomic_fast32_t;
1872
+typedef intptr_t atomicptr_t;
1873
+typedef uintptr_t uatomicptr_t;
1874
+typedef intmax_t atomic_max_t;
1875
+typedef uintmax_t uatomic_max_t;
1877
+/* The only basic operation needed is compare and exchange. */
1878
+/* For ColdFire we'll have to trap into the kernel mode anyway,
1879
+ so trap from the library rather then from the kernel wrapper. */
1881
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
1883
+ /* Use temporary variables to workaround call-clobberness of */ \
1884
+ /* the registers. */ \
1885
+ __typeof (mem) _mem = mem; \
1886
+ __typeof (oldval) _oldval = oldval; \
1887
+ __typeof (newval) _newval = newval; \
1888
+ register __typeof (mem) _a0 asm ("a0") = _mem; \
1889
+ register __typeof (oldval) _d0 asm ("d0") = _oldval; \
1890
+ register __typeof (newval) _d1 asm ("d1") = _newval; \
1893
+ asm ("movel #_GLOBAL_OFFSET_TABLE_@GOTPC, %2\n\t" \
1894
+ "lea (-6, %%pc, %2), %2\n\t" \
1895
+ "movel " STR_M68K_VDSO_SYMBOL (__vdso_atomic_cmpxchg_32) \
1896
+ "@GOT(%2), %2\n\t" \
1897
+ "movel (%2), %2\n\t" \
1899
+ : "+d" (_d0), "+m" (*_a0), "=&a" (tmp) \
1900
+ : "a" (_a0), "d" (_d1)); \
1904
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
1906
+ /* Use temporary variables to workaround call-clobberness of */ \
1907
+ /* the registers. */ \
1908
+ __typeof (mem) _mem = mem; \
1909
+ __typeof (oldval) _oldval = oldval; \
1910
+ __typeof (newval) _newval = newval; \
1911
+ register __typeof (oldval) _d0 asm ("d0") \
1912
+ = SYS_ify (atomic_cmpxchg_32); \
1913
+ register __typeof (mem) _a0 asm ("a0") = _mem; \
1914
+ register __typeof (oldval) _d2 asm ("d2") = _oldval; \
1915
+ register __typeof (newval) _d1 asm ("d1") = _newval; \
1918
+ : "+d" (_d0), "+m" (*_a0) \
1919
+ : "a" (_a0), "d" (_d2), "d" (_d1)); \
1925
+# define atomic_full_barrier() \
1929
+ asm ("movel #_GLOBAL_OFFSET_TABLE_@GOTPC, %0\n\t" \
1930
+ "lea (-6, %pc, %0), %0\n\t" \
1931
+ "movel " STR_M68K_VDSO_SYMBOL (__vdso_atomic_barrier) \
1932
+ "@GOT(%0), %0\n\t" \
1933
+ "movel (%0), %0\n\t" \
1938
+# define atomic_full_barrier() \
1939
+ (INTERNAL_SYSCALL (atomic_barrier, , 0), (void) 0)
1943
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/init-first.c b/ports/sysdeps/unix/sysv/linux/m68k/init-first.c
1944
new file mode 100644
1945
index 0000000..f8168d1
1947
+++ b/ports/sysdeps/unix/sysv/linux/m68k/init-first.c
1949
+/* Copyright (C) 2010 Free Software Foundation, Inc.
1950
+ This file is part of the GNU C Library.
1951
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
1953
+ The GNU C Library is free software; you can redistribute it and/or
1954
+ modify it under the terms of the GNU Lesser General Public
1955
+ License as published by the Free Software Foundation; either
1956
+ version 2.1 of the License, or (at your option) any later version.
1958
+ The GNU C Library is distributed in the hope that it will be useful,
1959
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1960
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1961
+ Lesser General Public License for more details.
1963
+ You should have received a copy of the GNU Lesser General Public
1964
+ License along with the GNU C Library; if not, write to the Free
1965
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1966
+ 02111-1307 USA. */
1968
+/* Note: linking in vDSO to a static binary requires changes to
1969
+ the main GLIBC proper. Not yet implemented. */
1972
+#include <dl-vdso.h>
1973
+#include <bits/m68k-vdso.h>
1976
+_libc_vdso_platform_setup (void)
1980
+ PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
1982
+ /* It may happen that rtld didn't initialize the vDSO, so fallback
1983
+ to the syscall implementations if _dl_vdso_vsym returns NULL.
1984
+ This may happen when a static executable dlopen's a dynamic library.
1985
+ This really is nothing more than a workaround for rtld/csu
1986
+ deficiency. Ideally, init code would setup the vDSO for static
1989
+ p = _dl_vdso_vsym ("__kernel_read_tp", &linux26);
1992
+ __vdso_read_tp = p;
1993
+ __rtld___vdso_read_tp = p;
1996
+ assert (__vdso_read_tp == (void *) __vdso_read_tp_stub);
1998
+ p = _dl_vdso_vsym ("__kernel_atomic_cmpxchg_32", &linux26);
2001
+ __vdso_atomic_cmpxchg_32 = p;
2002
+ __rtld___vdso_atomic_cmpxchg_32 = p;
2005
+ assert (__vdso_atomic_cmpxchg_32
2006
+ == (void *) __vdso_atomic_cmpxchg_32_stub);
2008
+ p = _dl_vdso_vsym ("__kernel_atomic_barrier", &linux26);
2011
+ __vdso_atomic_barrier = p;
2012
+ __rtld___vdso_atomic_barrier = p;
2015
+ assert (__vdso_atomic_barrier == (void *) __vdso_atomic_barrier_stub);
2018
+#define VDSO_SETUP _libc_vdso_platform_setup
2020
+#endif /* SHARED */
2022
+#include <sysdeps/unix/sysv/linux/init-first.c>
2023
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c b/ports/sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c
2024
new file mode 100644
2025
index 0000000..45982e9
2027
+++ b/ports/sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c
2029
+#include "m68k-vdso.c"
2030
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S b/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
2031
new file mode 100644
2032
index 0000000..00db4bb
2034
+++ b/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
2036
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2037
+ This file is part of the GNU C Library.
2038
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2040
+ The GNU C Library is free software; you can redistribute it and/or
2041
+ modify it under the terms of the GNU Lesser General Public
2042
+ License as published by the Free Software Foundation; either
2043
+ version 2.1 of the License, or (at your option) any later version.
2045
+ In addition to the permissions in the GNU Lesser General Public
2046
+ License, the Free Software Foundation gives you unlimited
2047
+ permission to link the compiled version of this file with other
2048
+ programs, and to distribute those programs without any restriction
2049
+ coming from the use of this file. (The GNU Lesser General Public
2050
+ License restrictions do apply in other respects; for example, they
2051
+ cover modification of the file, and distribution when not linked
2052
+ into another program.)
2054
+ Note that people who make modified versions of this file are not
2055
+ obligated to grant this special exception for their modified
2056
+ versions; it is their choice whether to do so. The GNU Lesser
2057
+ General Public License gives permission to release a modified
2058
+ version without this exception; this exception also makes it
2059
+ possible to release a modified version which carries forward this
2062
+ The GNU C Library is distributed in the hope that it will be useful,
2063
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2064
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2065
+ Lesser General Public License for more details.
2067
+ You should have received a copy of the GNU Lesser General Public
2068
+ License along with the GNU C Library; if not, write to the Free
2069
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2070
+ 02111-1307 USA. */
2072
+#include <sysdep.h>
2073
+#include <bits/m68k-vdso.h>
2077
+ .hidden __vdso_read_tp_stub
2078
+ENTRY (__vdso_read_tp_stub)
2080
+ move.l #__NR_get_thread_area, %d0
2085
+END (__vdso_read_tp_stub)
2088
+/* GCC will emit calls to this routine. Linux has an
2089
+ equivalent helper function (which clobbers fewer registers than
2090
+ a normal function call) in a vdso; tail call to the
2093
+/* rtld gets a hidden copy of __m68k_read_tp. */
2094
+ .hidden __m68k_read_tp
2096
+ENTRY (__m68k_read_tp)
2098
+ move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a0
2099
+ lea (-6, %pc, %a0), %a0
2100
+ move.l M68K_VDSO_SYMBOL (__vdso_read_tp)@GOT(%a0), %a0
2104
+END (__m68k_read_tp)
2106
+/* The following two stubs are for macros in atomic.h, they can't
2107
+ clobber anything. */
2109
+ .hidden __vdso_atomic_cmpxchg_32_stub
2110
+ENTRY (__vdso_atomic_cmpxchg_32_stub)
2112
+ move.l %d2, -(%sp)
2113
+ cfi_adjust_cfa_offset (4)
2114
+ cfi_rel_offset (%d2, 0)
2116
+ move.l #SYS_ify (atomic_cmpxchg_32), %d0
2118
+ move.l (%sp)+, %d2
2119
+ cfi_adjust_cfa_offset (-4)
2123
+END (__vdso_atomic_cmpxchg_32_stub)
2125
+ .hidden __vdso_atomic_barrier_stub
2126
+ENTRY (__vdso_atomic_barrier_stub)
2128
+ move.l %d0, -(%sp)
2129
+ cfi_adjust_cfa_offset (4)
2130
+ move.l #SYS_ify (atomic_barrier), %d0
2132
+ move.l (%sp)+, %d0
2133
+ cfi_adjust_cfa_offset (-4)
2136
+END (__vdso_atomic_barrier_stub)
2137
+# else /* !SHARED */
2138
+/* If the vDSO is not available, use a syscall to get TP. */
2139
+ strong_alias (__vdso_read_tp_stub, __m68k_read_tp)
2140
+# endif /* SHARED */
2141
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c b/ports/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c
2142
new file mode 100644
2143
index 0000000..73b2570
2145
+++ b/ports/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c
2147
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2148
+ This file is part of the GNU C Library.
2149
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2151
+ The GNU C Library is free software; you can redistribute it and/or
2152
+ modify it under the terms of the GNU Lesser General Public
2153
+ License as published by the Free Software Foundation; either
2154
+ version 2.1 of the License, or (at your option) any later version.
2156
+ The GNU C Library is distributed in the hope that it will be useful,
2157
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2158
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2159
+ Lesser General Public License for more details.
2161
+ You should have received a copy of the GNU Lesser General Public
2162
+ License along with the GNU C Library; if not, write to the Free
2163
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2164
+ 02111-1307 USA. */
2168
+#include <bits/m68k-vdso.h>
2170
+/* Because these pointers are used from other libraries than libc,
2171
+ they are exported at GLIBC_PRIVATE version.
2172
+ We initialize them to syscall implementation so that they will be ready
2173
+ to use from the very beginning. */
2174
+void * M68K_VDSO_SYMBOL (__vdso_read_tp)
2175
+= (void *) __vdso_read_tp_stub;
2176
+void * M68K_VDSO_SYMBOL (__vdso_atomic_cmpxchg_32)
2177
+= (void *) __vdso_atomic_cmpxchg_32_stub;
2178
+void * M68K_VDSO_SYMBOL (__vdso_atomic_barrier)
2179
+= (void *) __vdso_atomic_barrier_stub;
2181
+#endif /* SHARED */
2182
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h
2183
new file mode 100644
2184
index 0000000..0140810
2186
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h
2188
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2189
+ This file is part of the GNU C Library.
2190
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2192
+ The GNU C Library is free software; you can redistribute it and/or
2193
+ modify it under the terms of the GNU Lesser General Public
2194
+ License as published by the Free Software Foundation; either
2195
+ version 2.1 of the License, or (at your option) any later version.
2197
+ The GNU C Library is distributed in the hope that it will be useful,
2198
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2199
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2200
+ Lesser General Public License for more details.
2202
+ You should have received a copy of the GNU Lesser General Public
2203
+ License along with the GNU C Library; if not, write to the Free
2204
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2205
+ 02111-1307 USA. */
2207
+#ifndef _BITS_PTHREADTYPES_H
2208
+#define _BITS_PTHREADTYPES_H 1
2210
+#include <endian.h>
2212
+#define __SIZEOF_PTHREAD_ATTR_T 36
2213
+#define __SIZEOF_PTHREAD_MUTEX_T 24
2214
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
2215
+#define __SIZEOF_PTHREAD_COND_T 48
2216
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
2217
+#define __SIZEOF_PTHREAD_RWLOCK_T 32
2218
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
2219
+#define __SIZEOF_PTHREAD_BARRIER_T 20
2220
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
2223
+/* Thread identifiers. The structure of the attribute type is
2224
+ deliberately not exposed. */
2225
+typedef unsigned long int pthread_t;
2230
+ char __size[__SIZEOF_PTHREAD_ATTR_T];
2235
+typedef struct __pthread_internal_slist
2237
+ struct __pthread_internal_slist *__next;
2238
+} __pthread_slist_t;
2241
+/* Data structures for mutex handling. The structure of the attribute
2242
+ type is deliberately not exposed. */
2245
+ struct __pthread_mutex_s
2248
+ unsigned int __count;
2250
+ /* KIND must stay at this position in the structure to maintain
2251
+ binary compatibility. */
2253
+ unsigned int __nusers;
2254
+ __extension__ union
2257
+ __pthread_slist_t __list;
2260
+ char __size[__SIZEOF_PTHREAD_MUTEX_T];
2266
+ char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
2268
+} pthread_mutexattr_t;
2271
+/* Data structure for conditional variable handling. The structure of
2272
+ the attribute type is deliberately not exposed. */
2278
+ unsigned int __futex;
2279
+ __extension__ unsigned long long int __total_seq;
2280
+ __extension__ unsigned long long int __wakeup_seq;
2281
+ __extension__ unsigned long long int __woken_seq;
2283
+ unsigned int __nwaiters;
2284
+ unsigned int __broadcast_seq;
2286
+ char __size[__SIZEOF_PTHREAD_COND_T];
2287
+ __extension__ long long int __align;
2292
+ char __size[__SIZEOF_PTHREAD_CONDATTR_T];
2294
+} pthread_condattr_t;
2297
+/* Keys for thread-specific data */
2298
+typedef unsigned int pthread_key_t;
2301
+/* Once-only execution */
2302
+typedef int pthread_once_t;
2305
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
2306
+/* Data structure for read-write lock variable handling. The
2307
+ structure of the attribute type is deliberately not exposed. */
2313
+ unsigned int __nr_readers;
2314
+ unsigned int __readers_wakeup;
2315
+ unsigned int __writer_wakeup;
2316
+ unsigned int __nr_readers_queued;
2317
+ unsigned int __nr_writers_queued;
2318
+ unsigned char __pad1;
2319
+ unsigned char __pad2;
2320
+ unsigned char __shared;
2321
+ /* FLAGS must stay at this position in the structure to maintain
2322
+ binary compatibility. */
2323
+ unsigned char __flags;
2326
+ char __size[__SIZEOF_PTHREAD_RWLOCK_T];
2328
+} pthread_rwlock_t;
2332
+ char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
2334
+} pthread_rwlockattr_t;
2338
+#ifdef __USE_XOPEN2K
2339
+/* POSIX spinlock data type. */
2340
+typedef volatile int pthread_spinlock_t;
2343
+/* POSIX barriers data type. The structure of the type is
2344
+ deliberately not exposed. */
2347
+ char __size[__SIZEOF_PTHREAD_BARRIER_T];
2349
+} pthread_barrier_t;
2353
+ char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
2355
+} pthread_barrierattr_t;
2359
+#endif /* bits/pthreadtypes.h */
2360
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h
2361
new file mode 100644
2362
index 0000000..2950cc9
2364
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h
2366
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2367
+ This file is part of the GNU C Library.
2368
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2370
+ The GNU C Library is free software; you can redistribute it and/or
2371
+ modify it under the terms of the GNU Lesser General Public
2372
+ License as published by the Free Software Foundation; either
2373
+ version 2.1 of the License, or (at your option) any later version.
2375
+ The GNU C Library is distributed in the hope that it will be useful,
2376
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2377
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2378
+ Lesser General Public License for more details.
2380
+ You should have received a copy of the GNU Lesser General Public
2381
+ License along with the GNU C Library; if not, write to the Free
2382
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2383
+ 02111-1307 USA. */
2385
+#ifndef _SEMAPHORE_H
2386
+# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
2390
+#define __SIZEOF_SEM_T 16
2393
+/* Value returned if `sem_open' failed. */
2394
+#define SEM_FAILED ((sem_t *) 0)
2399
+ char __size[__SIZEOF_SEM_T];
2402
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/clone.S b/ports/sysdeps/unix/sysv/linux/m68k/nptl/clone.S
2403
new file mode 100644
2404
index 0000000..e7388fe
2406
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/clone.S
2409
+#include "../clone.S"
2410
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/createthread.c b/ports/sysdeps/unix/sysv/linux/m68k/nptl/createthread.c
2411
new file mode 100644
2412
index 0000000..be11444
2414
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/createthread.c
2416
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2417
+ This file is part of the GNU C Library.
2418
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2420
+ The GNU C Library is free software; you can redistribute it and/or
2421
+ modify it under the terms of the GNU Lesser General Public
2422
+ License as published by the Free Software Foundation; either
2423
+ version 2.1 of the License, or (at your option) any later version.
2425
+ The GNU C Library is distributed in the hope that it will be useful,
2426
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2427
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2428
+ Lesser General Public License for more details.
2430
+ You should have received a copy of the GNU Lesser General Public
2431
+ License along with the GNU C Library; if not, write to the Free
2432
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2433
+ 02111-1307 USA. */
2435
+/* Value passed to 'clone' for initialization of the thread register. */
2436
+#define TLS_VALUE ((void *) (pd) \
2437
+ + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
2439
+/* Get the real implementation. */
2440
+#include <nptl/sysdeps/pthread/createthread.c>
2441
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/fork.c b/ports/sysdeps/unix/sysv/linux/m68k/nptl/fork.c
2442
new file mode 100644
2443
index 0000000..dc1584e
2445
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/fork.c
2447
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2448
+ This file is part of the GNU C Library.
2449
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2451
+ The GNU C Library is free software; you can redistribute it and/or
2452
+ modify it under the terms of the GNU Lesser General Public
2453
+ License as published by the Free Software Foundation; either
2454
+ version 2.1 of the License, or (at your option) any later version.
2456
+ The GNU C Library is distributed in the hope that it will be useful,
2457
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2458
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2459
+ Lesser General Public License for more details.
2461
+ You should have received a copy of the GNU Lesser General Public
2462
+ License along with the GNU C Library; if not, write to the Free
2463
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2464
+ 02111-1307 USA. */
2467
+#include <signal.h>
2468
+#include <sysdep.h>
2471
+#define ARCH_FORK() \
2472
+ INLINE_SYSCALL (clone, 5, \
2473
+ CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \
2474
+ NULL, &THREAD_SELF->tid, NULL)
2476
+#include <sysdeps/unix/sysv/linux/fork.c>
2477
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
2478
new file mode 100644
2479
index 0000000..926077d
2481
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
2483
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2484
+ This file is part of the GNU C Library.
2485
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2487
+ The GNU C Library is free software; you can redistribute it and/or
2488
+ modify it under the terms of the GNU Lesser General Public
2489
+ License as published by the Free Software Foundation; either
2490
+ version 2.1 of the License, or (at your option) any later version.
2492
+ The GNU C Library is distributed in the hope that it will be useful,
2493
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2494
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2495
+ Lesser General Public License for more details.
2497
+ You should have received a copy of the GNU Lesser General Public
2498
+ License along with the GNU C Library; if not, write to the Free
2499
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2500
+ 02111-1307 USA. */
2502
+/* Borrowed from ARM's version. */
2504
+#ifndef _LOWLEVELLOCK_H
2505
+#define _LOWLEVELLOCK_H 1
2508
+#include <sys/param.h>
2509
+#include <bits/pthreadtypes.h>
2510
+#include <atomic.h>
2511
+#include <sysdep.h>
2512
+#include <kernel-features.h>
2514
+#define FUTEX_WAIT 0
2515
+#define FUTEX_WAKE 1
2516
+#define FUTEX_REQUEUE 3
2517
+#define FUTEX_CMP_REQUEUE 4
2518
+#define FUTEX_WAKE_OP 5
2519
+#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1)
2520
+#define FUTEX_LOCK_PI 6
2521
+#define FUTEX_UNLOCK_PI 7
2522
+#define FUTEX_TRYLOCK_PI 8
2523
+#define FUTEX_WAIT_BITSET 9
2524
+#define FUTEX_WAKE_BITSET 10
2525
+#define FUTEX_PRIVATE_FLAG 128
2526
+#define FUTEX_CLOCK_REALTIME 256
2528
+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
2530
+/* Values for 'private' parameter of locking macros. Yes, the
2531
+ definition seems to be backwards. But it is not. The bit will be
2532
+ reversed before passing to the system call. */
2533
+#define LLL_PRIVATE 0
2534
+#define LLL_SHARED FUTEX_PRIVATE_FLAG
2537
+#if !defined NOT_IN_libc || defined IS_IN_rtld
2538
+/* In libc.so or ld.so all futexes are private. */
2539
+# ifdef __ASSUME_PRIVATE_FUTEX
2540
+# define __lll_private_flag(fl, private) \
2541
+ ((fl) | FUTEX_PRIVATE_FLAG)
2543
+# define __lll_private_flag(fl, private) \
2544
+ ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
2547
+# ifdef __ASSUME_PRIVATE_FUTEX
2548
+# define __lll_private_flag(fl, private) \
2549
+ (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
2551
+# define __lll_private_flag(fl, private) \
2552
+ (__builtin_constant_p (private) \
2553
+ ? ((private) == 0 \
2554
+ ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
2556
+ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
2557
+ & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
2562
+#define lll_futex_wait(futexp, val, private) \
2563
+ lll_futex_timed_wait(futexp, val, NULL, private)
2565
+#define lll_futex_timed_wait(futexp, val, timespec, private) \
2567
+ INTERNAL_SYSCALL_DECL (__err); \
2569
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
2570
+ __lll_private_flag (FUTEX_WAIT, private), \
2571
+ (val), (timespec)); \
2575
+#define lll_futex_wake(futexp, nr, private) \
2577
+ INTERNAL_SYSCALL_DECL (__err); \
2579
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
2580
+ __lll_private_flag (FUTEX_WAKE, private), \
2585
+#define lll_robust_dead(futexv, private) \
2588
+ int *__futexp = &(futexv); \
2589
+ atomic_or (__futexp, FUTEX_OWNER_DIED); \
2590
+ lll_futex_wake (__futexp, 1, private); \
2594
+/* Returns non-zero if error happened, zero if success. */
2595
+#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
2597
+ INTERNAL_SYSCALL_DECL (__err); \
2599
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
2600
+ __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
2601
+ (nr_wake), (nr_move), (mutex), (val)); \
2602
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
2605
+/* Returns non-zero if error happened, zero if success. */
2606
+#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
2608
+ INTERNAL_SYSCALL_DECL (__err); \
2610
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
2611
+ __lll_private_flag (FUTEX_WAKE_OP, private), \
2612
+ (nr_wake), (nr_wake2), (futexp2), \
2613
+ FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \
2614
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
2617
+#define lll_trylock(lock) \
2618
+ atomic_compare_and_exchange_val_acq (&(lock), 1, 0)
2620
+#define lll_cond_trylock(lock) \
2621
+ atomic_compare_and_exchange_val_acq (&(lock), 2, 0)
2623
+#define lll_robust_trylock(lock, id) \
2624
+ atomic_compare_and_exchange_val_acq (&(lock), id, 0)
2626
+extern void __lll_lock_wait_private (int *futex) attribute_hidden;
2627
+extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
2628
+extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
2630
+#define __lll_lock(futex, private) \
2632
+ int *__futex = (futex); \
2633
+ if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex, \
2636
+ if (__builtin_constant_p (private) && (private) == LLL_PRIVATE) \
2637
+ __lll_lock_wait_private (__futex); \
2639
+ __lll_lock_wait (__futex, private); \
2642
+#define lll_lock(futex, private) __lll_lock (&(futex), private)
2645
+#define __lll_robust_lock(futex, id, private) \
2647
+ int *__futex = (futex); \
2650
+ if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \
2652
+ __val = __lll_robust_lock_wait (__futex, private); \
2655
+#define lll_robust_lock(futex, id, private) \
2656
+ __lll_robust_lock (&(futex), id, private)
2659
+#define __lll_cond_lock(futex, private) \
2661
+ int *__futex = (futex); \
2662
+ if (__builtin_expect (atomic_exchange_acq (__futex, 2), 0)) \
2663
+ __lll_lock_wait (__futex, private); \
2665
+#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
2668
+#define lll_robust_cond_lock(futex, id, private) \
2669
+ __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
2672
+extern int __lll_timedlock_wait (int *futex, const struct timespec *,
2673
+ int private) attribute_hidden;
2674
+extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
2675
+ int private) attribute_hidden;
2677
+#define __lll_timedlock(futex, abstime, private) \
2679
+ int *__futex = (futex); \
2682
+ if (__builtin_expect (atomic_exchange_acq (__futex, 1), 0)) \
2683
+ __val = __lll_timedlock_wait (__futex, abstime, private); \
2686
+#define lll_timedlock(futex, abstime, private) \
2687
+ __lll_timedlock (&(futex), abstime, private)
2690
+#define __lll_robust_timedlock(futex, abstime, id, private) \
2692
+ int *__futex = (futex); \
2695
+ if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \
2697
+ __val = __lll_robust_timedlock_wait (__futex, abstime, private); \
2700
+#define lll_robust_timedlock(futex, abstime, id, private) \
2701
+ __lll_robust_timedlock (&(futex), abstime, id, private)
2704
+#define __lll_unlock(futex, private) \
2706
+ ({ int *__futex = (futex); \
2707
+ int __oldval = atomic_exchange_rel (__futex, 0); \
2708
+ if (__builtin_expect (__oldval > 1, 0)) \
2709
+ lll_futex_wake (__futex, 1, private); \
2711
+#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
2714
+#define __lll_robust_unlock(futex, private) \
2716
+ ({ int *__futex = (futex); \
2717
+ int __oldval = atomic_exchange_rel (__futex, 0); \
2718
+ if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \
2719
+ lll_futex_wake (__futex, 1, private); \
2721
+#define lll_robust_unlock(futex, private) \
2722
+ __lll_robust_unlock(&(futex), private)
2725
+#define lll_islocked(futex) \
2729
+/* Our internal lock implementation is identical to the binary-compatible
2730
+ mutex implementation. */
2732
+/* Initializers for lock. */
2733
+#define LLL_LOCK_INITIALIZER (0)
2734
+#define LLL_LOCK_INITIALIZER_LOCKED (1)
2736
+/* The states of a lock are:
2738
+ 1 - taken by one user
2739
+ >1 - taken by more users */
2741
+/* The kernel notifies a process which uses CLONE_CLEARTID via futex
2742
+ wakeup when the clone terminates. The memory location contains the
2743
+ thread ID while the clone is running and is reset to zero
2745
+#define lll_wait_tid(tid) \
2747
+ __typeof (tid) __tid; \
2748
+ while ((__tid = (tid)) != 0) \
2749
+ lll_futex_wait (&(tid), __tid, LLL_SHARED); \
2752
+extern int __lll_timedwait_tid (int *, const struct timespec *)
2755
+#define lll_timedwait_tid(tid, abstime) \
2759
+ __res = __lll_timedwait_tid (&(tid), (abstime)); \
2763
+#endif /* lowlevellock.h */
2764
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S
2765
new file mode 100644
2766
index 0000000..36c9270
2768
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S
2770
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2771
+ This file is part of the GNU C Library.
2772
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2774
+ The GNU C Library is free software; you can redistribute it and/or
2775
+ modify it under the terms of the GNU Lesser General Public
2776
+ License as published by the Free Software Foundation; either
2777
+ version 2.1 of the License, or (at your option) any later version.
2779
+ The GNU C Library is distributed in the hope that it will be useful,
2780
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2781
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2782
+ Lesser General Public License for more details.
2784
+ You should have received a copy of the GNU Lesser General Public
2785
+ License along with the GNU C Library; if not, write to the Free
2786
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2787
+ 02111-1307 USA. */
2789
+#include <tcb-offsets.h>
2792
+ bsrl __m68k_read_tp@PLTPC ; /* Get the thread pointer. */ \
2793
+ movel %a0, %a1 ; /* Save TP for RESTORE_PID. */ \
2794
+ movel PID_OFFSET(%a1), %d0 ; /* Get the PID. */ \
2795
+ movel %d0, %d1 ; /* Save PID for RESTORE_PID. */ \
2796
+ negl %d0 ; /* Negate the PID. */ \
2797
+ movel %d0, PID_OFFSET(%a1) ; /* Store the temporary PID. */
2799
+#define RESTORE_PID \
2801
+ beq 1f ; /* If we are the parent... */ \
2802
+ movel %d1, PID_OFFSET(%a1) ; /* Restore the PID. */ \
2805
+#include <sysdeps/unix/sysv/linux/m68k/vfork.S>
2806
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c
2807
new file mode 100644
2808
index 0000000..415045f
2810
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c
2812
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2813
+ This file is part of the GNU C Library.
2814
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2816
+ The GNU C Library is free software; you can redistribute it and/or
2817
+ modify it under the terms of the GNU Lesser General Public
2818
+ License as published by the Free Software Foundation; either
2819
+ version 2.1 of the License, or (at your option) any later version.
2821
+ The GNU C Library is distributed in the hope that it will be useful,
2822
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2823
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2824
+ Lesser General Public License for more details.
2826
+ You should have received a copy of the GNU Lesser General Public
2827
+ License along with the GNU C Library; if not, write to the Free
2828
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2829
+ 02111-1307 USA. */
2831
+#include "pthreadP.h"
2832
+#include <lowlevellock.h>
2834
+unsigned long int __fork_generation attribute_hidden;
2837
+clear_once_control (void *arg)
2839
+ pthread_once_t *once_control = (pthread_once_t *) arg;
2841
+ *once_control = 0;
2842
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
2846
+__pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
2854
+ newval = __fork_generation | 1;
2855
+ oldval = *once_control;
2856
+ if ((oldval & 2) == 0)
2857
+ *once_control = newval;
2858
+ Do this atomically.
2862
+ newval = __fork_generation | 1;
2863
+ oldval = *once_control;
2866
+ } while (atomic_compare_and_exchange_val_acq (once_control, newval, oldval) != oldval);
2868
+ /* Check if the initializer has already been done. */
2869
+ if ((oldval & 2) != 0)
2872
+ /* Check if another thread already runs the initializer. */
2873
+ if ((oldval & 1) == 0)
2876
+ /* Check whether the initializer execution was interrupted by a fork. */
2877
+ if (oldval != newval)
2880
+ /* Same generation, some other thread was faster. Wait. */
2881
+ lll_futex_wait (once_control, oldval, LLL_PRIVATE);
2884
+ /* This thread is the first here. Do the initialization.
2885
+ Register a cleanup handler so that in case the thread gets
2886
+ interrupted the initialization can be restarted. */
2887
+ pthread_cleanup_push (clear_once_control, once_control);
2891
+ pthread_cleanup_pop (0);
2893
+ /* Say that the initialisation is done. */
2894
+ *once_control = __fork_generation | 2;
2896
+ /* Wake up all other threads. */
2897
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
2901
+weak_alias (__pthread_once, pthread_once)
2902
+strong_alias (__pthread_once, __pthread_once_internal)
2903
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h
2904
new file mode 100644
2905
index 0000000..87e2d55
2907
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h
2909
+/* Copyright (C) 2010 Free Software Foundation, Inc.
2910
+ This file is part of the GNU C Library.
2911
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
2913
+ The GNU C Library is free software; you can redistribute it and/or
2914
+ modify it under the terms of the GNU Lesser General Public
2915
+ License as published by the Free Software Foundation; either
2916
+ version 2.1 of the License, or (at your option) any later version.
2918
+ The GNU C Library is distributed in the hope that it will be useful,
2919
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2920
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2921
+ Lesser General Public License for more details.
2923
+ You should have received a copy of the GNU Lesser General Public
2924
+ License along with the GNU C Library; if not, write to the Free
2925
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2926
+ 02111-1307 USA. */
2928
+#include <sysdep.h>
2930
+#ifndef __ASSEMBLER__
2931
+# include <nptl/pthreadP.h>
2934
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
2937
+# define PSEUDO(name, syscall_name, args) \
2940
+ SINGLE_THREAD_P; \
2941
+ jne .Lpseudo_cancel; \
2942
+ .type __##syscall_name##_nocancel,@function; \
2943
+ .globl __##syscall_name##_nocancel; \
2944
+ __##syscall_name##_nocancel: \
2945
+ DO_CALL (syscall_name, args); \
2946
+ cmp.l &-4095, %d0; \
2947
+ jcc SYSCALL_ERROR_LABEL; \
2949
+ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
2950
+ .Lpseudo_cancel: \
2954
+ move.l %d0, -(%sp); /* Save result of CENABLE. */ \
2955
+ cfi_adjust_cfa_offset (4); \
2956
+ move.l &SYS_ify (syscall_name), %d0; \
2958
+ move.l %d0, %d2; \
2960
+ addq.l &4, %sp; /* Remove result of CENABLE from the stack. */ \
2961
+ cfi_adjust_cfa_offset (-4); \
2962
+ move.l %d2, %d0; \
2963
+ UNDOCARGS_##args \
2964
+ cmp.l &-4095, %d0; \
2965
+ jcc SYSCALL_ERROR_LABEL; \
2968
+/* Note: we use D2 to save syscall's return value as D0 will be clobbered in
2970
+# define DOCARGS_0 move.l %d2, -(%sp); \
2971
+ cfi_adjust_cfa_offset (4); cfi_rel_offset (%d2, 0);
2972
+# define UNDOCARGS_0 move.l (%sp)+, %d2; \
2973
+ cfi_adjust_cfa_offset (-4); cfi_restore (%d2);
2975
+# define DOCARGS_1 _DOCARGS_1 (4); DOCARGS_0
2976
+# define _DOCARGS_1(n) move.l n(%sp), %d1;
2977
+# define UNDOCARGS_1 UNDOCARGS_0
2979
+# define DOCARGS_2 _DOCARGS_2 (8)
2980
+# define _DOCARGS_2(n) DOCARGS_0 move.l n+4(%sp), %d2; _DOCARGS_1 (n)
2981
+# define UNDOCARGS_2 UNDOCARGS_0
2983
+/* TODO: We can optimize DOCARGS_{3, 4} by saving registers to a0 and a1
2984
+ instead of pushing them on stack. */
2985
+# define DOCARGS_3 _DOCARGS_3 (12)
2986
+# define _DOCARGS_3(n) move.l %d3, -(%sp); \
2987
+ cfi_adjust_cfa_offset (4); cfi_rel_offset (%d3, 0); \
2988
+ move.l n+4(%sp), %d3; _DOCARGS_2 (n)
2989
+# define UNDOCARGS_3 UNDOCARGS_2 move.l (%sp)+, %d3; \
2990
+ cfi_adjust_cfa_offset (-4); cfi_restore (%d3);
2992
+# define DOCARGS_4 _DOCARGS_4 (16)
2993
+# define _DOCARGS_4(n) move.l %d4, -(%sp); \
2994
+ cfi_adjust_cfa_offset (4); cfi_rel_offset (%d4, 0); \
2995
+ move.l n+4(%sp), %d4; _DOCARGS_3 (n)
2996
+# define UNDOCARGS_4 UNDOCARGS_3 move.l (%sp)+, %d4; \
2997
+ cfi_adjust_cfa_offset (-4); cfi_restore (%d4);
2999
+# define DOCARGS_5 _DOCARGS_5 (20)
3000
+# define _DOCARGS_5(n) move.l %d5, %a1; cfi_register (%d5, a1); \
3001
+ move.l n(%sp), %d5; _DOCARGS_4 (n-4)
3002
+# define UNDOCARGS_5 UNDOCARGS_4 move.l %a1, %d5; cfi_restore (%d5);
3004
+# define DOCARGS_6 _DOCARGS_6 (24)
3005
+# define _DOCARGS_6(n) move.l n(%sp), %a0; _DOCARGS_5 (n-4)
3006
+# define UNDOCARGS_6 UNDOCARGS_5
3009
+# define PSEUDO_JMP(sym) jbsr sym ## @PLTPC
3011
+# define PSEUDO_JMP(sym) jbsr sym
3014
+# ifdef IS_IN_libpthread
3015
+# define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel)
3016
+# define CDISABLE PSEUDO_JMP (__pthread_disable_asynccancel)
3017
+# elif !defined NOT_IN_libc
3018
+# define CENABLE PSEUDO_JMP (__libc_enable_asynccancel)
3019
+# define CDISABLE PSEUDO_JMP (__libc_disable_asynccancel)
3020
+# elif defined IS_IN_librt
3021
+# define CENABLE PSEUDO_JMP (__librt_enable_asynccancel)
3022
+# define CDISABLE PSEUDO_JMP (__librt_disable_asynccancel)
3024
+# error Unsupported library
3027
+# ifndef __ASSEMBLER__
3028
+# define SINGLE_THREAD_P \
3029
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
3030
+ header.multiple_threads) == 0, 1)
3032
+# define SINGLE_THREAD_P \
3033
+ PSEUDO_JMP (__m68k_read_tp); \
3034
+ tst.l MULTIPLE_THREADS_OFFSET(%a0)
3037
+#elif !defined __ASSEMBLER__
3039
+# define SINGLE_THREAD_P (1)
3040
+# define NO_CANCELLATION (1)
3044
+#ifndef __ASSEMBLER__
3045
+# define RTLD_SINGLE_THREAD_P \
3046
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
3047
+ header.multiple_threads) == 0, \
3050
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S
3051
new file mode 100644
3052
index 0000000..8599c3d
3054
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S
3056
+/* Copyright (C) 2010 Free Software Foundation, Inc.
3057
+ This file is part of the GNU C Library.
3058
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
3060
+ The GNU C Library is free software; you can redistribute it and/or
3061
+ modify it under the terms of the GNU Lesser General Public
3062
+ License as published by the Free Software Foundation; either
3063
+ version 2.1 of the License, or (at your option) any later version.
3065
+ The GNU C Library is distributed in the hope that it will be useful,
3066
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
3067
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3068
+ Lesser General Public License for more details.
3070
+ You should have received a copy of the GNU Lesser General Public
3071
+ License along with the GNU C Library; if not, write to the Free
3072
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
3073
+ 02111-1307 USA. */
3075
+#include <tcb-offsets.h>
3078
+ bsrl __m68k_read_tp@PLTPC ; /* Get the thread pointer. */ \
3079
+ movel %a0, %a1 ; /* Save TP for RESTORE_PID. */ \
3080
+ movel PID_OFFSET(%a1), %d0 ; /* Get the PID. */ \
3081
+ movel %d0, %d1 ; /* Save PID for RESTORE_PID. */ \
3082
+ negl %d0 ; /* Negate the PID. */ \
3083
+ bne 1f ; /* If it was zero... */ \
3084
+ movel #0x80000000, %d0 ; /* use 0x80000000 instead. */ \
3085
+1: movel %d0, PID_OFFSET(%a1) ; /* Store the temporary PID. */
3087
+#define RESTORE_PID \
3089
+ beq 1f ; /* If we are the parent... */ \
3090
+ movel %d1, PID_OFFSET(%a1) ; /* Restore the PID. */ \
3093
+#include <sysdeps/unix/sysv/linux/m68k/vfork.S>
3094
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/socket.S b/ports/sysdeps/unix/sysv/linux/m68k/socket.S
3095
index 2690f18..147a3b2 100644
3096
--- a/ports/sysdeps/unix/sysv/linux/m68k/socket.S
3097
+++ b/ports/sysdeps/unix/sysv/linux/m68k/socket.S
3099
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
3100
+/* Copyright (C) 1996, 1997, 1998, 2010 Free Software Foundation, Inc.
3101
This file is part of the GNU C Library.
3103
The GNU C Library is free software; you can redistribute it and/or
3108
-#if defined NEED_CANCELLATION && defined CENABLE
3109
- SINGLE_THREAD_P (%a0)
3110
+#ifdef NEED_CANCELLATION
3111
+# if !defined CENABLE || !defined CDISABLE
3112
+# error CENABLE and/or CDISABLE is not defined
3118
@@ -69,21 +72,26 @@ ENTRY (__socket)
3119
/* Successful; return the syscall's value. */
3122
-#if defined NEED_CANCELLATION && defined CENABLE
3123
-1: /* Enable asynchronous cancellation. */
3124
+#ifdef NEED_CANCELLATION
3126
+ /* Enable asynchronous cancellation. */
3129
- /* Save registers. */
3132
- move.l %d0, -(%sp)
3133
+ cfi_adjust_cfa_offset (4)
3134
+ cfi_rel_offset (%d2, 0)
3136
- move.l #SYS_ify (socketcall), %d0 /* System call number in %d0. */
3137
+ /* Save the result of CENABLE. */
3138
+ move.l %d0, -(%sp)
3139
+ cfi_adjust_cfa_offset (4)
3141
/* Use ## so `socket' is a separate token that might be #define'd. */
3142
move.l #P (SOCKOP_,socket), %d1 /* Subcode is first arg to syscall. */
3143
lea 4+8(%sp), %a1 /* Address of args is 2nd arg. */
3146
+ move.l #SYS_ify (socketcall), %d0 /* System call number in %d0. */
3147
/* Do the system call trap. */
3150
@@ -91,14 +99,18 @@ ENTRY (__socket)
3154
+ cfi_adjust_cfa_offset (-4)
3157
/* Restore registers. */
3159
+ cfi_adjust_cfa_offset (-4)
3162
/* %d0 is < 0 if there was an error. */
3164
jmi SYSCALL_ERROR_LABEL
3167
/* Successful; return the syscall's value. */
3169
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h
3170
index 12687d8..e3aed15 100644
3171
--- a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h
3172
+++ b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h
3174
-/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
3175
+/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2010
3176
+ Free Software Foundation, Inc.
3177
This file is part of the GNU C Library.
3178
Written by Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>,
3182
#include <sysdeps/unix/sysdep.h>
3183
#include <sysdeps/m68k/sysdep.h>
3186
/* Defines RTLD_PRIVATE_ERRNO. */
3187
#include <dl-sysdep.h>
3188
@@ -148,9 +150,11 @@ SYSCALL_ERROR_LABEL: \
3189
arg 3 %d3 call-saved
3190
arg 4 %d4 call-saved
3191
arg 5 %d5 call-saved
3192
+ arg 6 %a0 call-clobbered
3194
The stack layout upon entering the function is:
3200
@@ -229,7 +233,7 @@ SYSCALL_ERROR_LABEL: \
3201
normally. It will never touch errno. This returns just what the kernel
3203
#undef INTERNAL_SYSCALL
3204
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
3205
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
3206
({ unsigned int _sys_result; \
3208
/* Load argument values in temporary variables
3209
@@ -237,7 +241,7 @@ SYSCALL_ERROR_LABEL: \
3210
before the call used registers are set. */ \
3211
LOAD_ARGS_##nr (args) \
3213
- register int _d0 asm ("%d0") = __NR_##name; \
3214
+ register int _d0 asm ("%d0") = name; \
3215
asm volatile ("trap #0" \
3217
: "0" (_d0) ASM_ARGS_##nr \
3218
@@ -245,6 +249,8 @@ SYSCALL_ERROR_LABEL: \
3219
_sys_result = _d0; \
3221
(int) _sys_result; })
3222
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
3223
+ INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
3225
#undef INTERNAL_SYSCALL_ERROR_P
3226
#define INTERNAL_SYSCALL_ERROR_P(val, err) \
3227
@@ -300,4 +306,15 @@ SYSCALL_ERROR_LABEL: \
3228
#define ASM_ARGS_6 ASM_ARGS_5, "a" (_a0)
3230
#endif /* not __ASSEMBLER__ */
3232
+/* Pointer mangling is not yet supported for M68K. */
3233
+#define PTR_MANGLE(var) (void) (var)
3234
+#define PTR_DEMANGLE(var) (void) (var)
3236
+#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
3237
+/* M68K needs system-supplied DSO to access TLS helpers
3238
+ even when statically linked. */
3239
+# define NEED_STATIC_SYSINFO_DSO 1
3243
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/vfork.S b/ports/sysdeps/unix/sysv/linux/m68k/vfork.S
3244
index 8027b2f..61bbf2f 100644
3245
--- a/ports/sysdeps/unix/sysv/linux/m68k/vfork.S
3246
+++ b/ports/sysdeps/unix/sysv/linux/m68k/vfork.S
3248
-/* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
3249
+/* Copyright (C) 1999, 2002, 2003, 2010 Free Software Foundation, Inc.
3250
This file is part of the GNU C Library.
3251
Contributed by Andreas Schwab <schwab@gnu.org>.
3254
#include <bits/errno.h>
3255
#include <kernel-features.h>
3261
+#ifndef RESTORE_PID
3262
+#define RESTORE_PID
3265
/* Clone the calling process, but without copying the whole address space.
3266
The calling process is suspended until the new process exits or is
3267
replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
3268
@@ -31,12 +39,20 @@ ENTRY (__vfork)
3272
+ /* SAVE_PID clobbers call-clobbered registers and
3273
+ saves data in D1 and A1. */
3277
/* Pop the return PC value into A0. */
3280
/* Stuff the syscall number in D0 and trap into the kernel. */
3281
movel #SYS_ify (vfork), %d0
3287
jmi .Lerror /* Branch forward if it failed. */
3289
From: Andreas Schwab <schwab@linux-m68k.org>
3290
Date: Fri, 12 Mar 2010 18:55:40 +0000 (+0100)
3291
Subject: Whitespace cleanup
3292
X-Git-Tag: glibc-2.12~37
3293
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=2b3dafb0874b7843355e7e02b0009be6df52271d
3298
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S b/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
3299
index 00db4bb..242d23d 100644
3300
--- a/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
3301
+++ b/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
3302
@@ -86,7 +86,7 @@ ENTRY (__vdso_atomic_cmpxchg_32_stub)
3305
END (__vdso_atomic_cmpxchg_32_stub)
3308
.hidden __vdso_atomic_barrier_stub
3309
ENTRY (__vdso_atomic_barrier_stub)
3311
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
3312
index 926077d..bc2970e 100644
3313
--- a/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
3314
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
3317
: ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
3318
& THREAD_GETMEM (THREAD_SELF, header.private_futex))))
3324
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S
3325
index 36c9270..639d5ed 100644
3326
--- a/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S
3327
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S
3330
beq 1f ; /* If we are the parent... */ \
3331
movel %d1, PID_OFFSET(%a1) ; /* Restore the PID. */ \
3335
#include <sysdeps/unix/sysv/linux/m68k/vfork.S>
3336
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S
3337
index 8599c3d..95e3764 100644
3338
--- a/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S
3339
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S
3342
beq 1f ; /* If we are the parent... */ \
3343
movel %d1, PID_OFFSET(%a1) ; /* Restore the PID. */ \
3347
#include <sysdeps/unix/sysv/linux/m68k/vfork.S>
3348
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/vfork.S b/ports/sysdeps/unix/sysv/linux/m68k/vfork.S
3349
index 61bbf2f..4def7e3 100644
3350
--- a/ports/sysdeps/unix/sysv/linux/m68k/vfork.S
3351
+++ b/ports/sysdeps/unix/sysv/linux/m68k/vfork.S
3352
@@ -43,7 +43,7 @@ ENTRY (__vfork)
3353
saves data in D1 and A1. */
3358
/* Pop the return PC value into A0. */
3361
From: Andreas Schwab <schwab@linux-m68k.org>
3362
Date: Fri, 12 Mar 2010 20:37:02 +0000 (+0100)
3363
Subject: Add m68k-helpers optimized for m680x0
3364
X-Git-Tag: glibc-2.12~36
3365
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=7e261ba3d85d10eefbb55f2e9d67c55910dfae2f
3367
Add m68k-helpers optimized for m680x0
3370
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3371
index 32681ff..446a307 100644
3372
--- a/ports/ChangeLog.m68k
3373
+++ b/ports/ChangeLog.m68k
3375
+2010-03-12 Andreas Schwab <schwab@linux-m68k.org>
3377
+ * sysdeps/unix/sysv/linux/m68k/m68k-helpers.S: Renamed ...
3378
+ * sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S: ... to
3380
+ * sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S: New file.
3382
2010-03-09 Maxim Kuvyrkov <maxim@codesourcery.com>
3384
NPTL support for m68k/ColdFire
3385
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S
3386
similarity index 100%
3387
copy from sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
3388
copy to sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S
3389
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S
3390
similarity index 97%
3391
rename from sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
3392
rename to sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S
3393
index 242d23d..83ce564 100644
3394
--- a/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
3395
+++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S
3396
@@ -60,11 +60,9 @@ END (__vdso_read_tp_stub)
3398
ENTRY (__m68k_read_tp)
3400
- move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a0
3401
- lea (-6, %pc, %a0), %a0
3402
+ lea _GLOBAL_OFFSET_TABLE_@GOTPC(%pc), %a0
3403
move.l M68K_VDSO_SYMBOL (__vdso_read_tp)@GOT(%a0), %a0
3408
END (__m68k_read_tp)
3410
From: Andreas Schwab <schwab@linux-m68k.org>
3411
Date: Fri, 12 Mar 2010 21:15:23 +0000 (+0100)
3412
Subject: m68k: don't include <sysdep.h> in lowlevellock.h
3413
X-Git-Tag: glibc-2.12~35
3414
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=7d6cb729ed0451f51b63cb563271f1ce889d5a78
3416
m68k: don't include <sysdep.h> in lowlevellock.h
3419
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3420
index 446a307..712651d 100644
3421
--- a/ports/ChangeLog.m68k
3422
+++ b/ports/ChangeLog.m68k
3424
2010-03-12 Andreas Schwab <schwab@linux-m68k.org>
3426
+ * sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h: Don't include
3429
* sysdeps/unix/sysv/linux/m68k/m68k-helpers.S: Renamed ...
3430
* sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S: ... to
3432
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
3433
index bc2970e..5ca78ec 100644
3434
--- a/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
3435
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
3437
#include <sys/param.h>
3438
#include <bits/pthreadtypes.h>
3440
-#include <sysdep.h>
3441
#include <kernel-features.h>
3443
#define FUTEX_WAIT 0
3444
From: Andreas Schwab <schwab@linux-m68k.org>
3445
Date: Sat, 13 Mar 2010 00:00:03 +0000 (+0100)
3446
Subject: m68k: TLS reference to errno in syscall stubs
3447
X-Git-Tag: glibc-2.12~34
3448
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=dbd0094b3f71213bc178cd1946496defbedb1d62
3450
m68k: TLS reference to errno in syscall stubs
3453
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3454
index 712651d..b16fde2 100644
3455
--- a/ports/ChangeLog.m68k
3456
+++ b/ports/ChangeLog.m68k
3458
+2010-03-13 Andreas Schwab <schwab@linux-m68k.org>
3460
+ * sysdeps/unix/sysv/linux/m68k/sysdep.h (SYSCALL_ERROR_HANDLER):
3461
+ Add variant for USE__THREAD.
3463
2010-03-12 Andreas Schwab <schwab@linux-m68k.org>
3465
* sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h: Don't include
3466
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h
3467
index e3aed15..8bd188b 100644
3468
--- a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h
3469
+++ b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h
3470
@@ -111,10 +111,27 @@ SYSCALL_ERROR_LABEL: \
3471
a pointer (e.g., mmap). */ \
3474
-# else /* !RTLD_PRIVATE_ERRNO */
3475
-/* Store (- %d0) into errno through the GOT. */
3476
-# if defined _LIBC_REENTRANT
3477
-# define SYSCALL_ERROR_HANDLER \
3478
+# elif USE___THREAD
3479
+# ifndef NOT_IN_libc
3480
+# define SYSCALL_ERROR_ERRNO __libc_errno
3482
+# define SYSCALL_ERROR_ERRNO errno
3484
+# define SYSCALL_ERROR_HANDLER \
3485
+SYSCALL_ERROR_LABEL: \
3487
+ move.l %d0, -(%sp); \
3488
+ jbsr __m68k_read_tp@PLTPC; \
3489
+ lea (_GLOBAL_OFFSET_TABLE_@GOTPC, %pc), %a1; \
3490
+ add.l (SYSCALL_ERROR_ERRNO@TLSIE, %a1), %a0; \
3491
+ move.l (%sp)+, (%a0); \
3492
+ move.l &-1, %d0; \
3493
+ /* Copy return value to %a0 for syscalls that are declared to return \
3494
+ a pointer (e.g., mmap). */ \
3495
+ move.l %d0, %a0; \
3497
+# elif defined _LIBC_REENTRANT
3498
+# define SYSCALL_ERROR_HANDLER \
3499
SYSCALL_ERROR_LABEL: \
3501
move.l %d0, -(%sp); \
3502
@@ -125,8 +142,9 @@ SYSCALL_ERROR_LABEL: \
3503
a pointer (e.g., mmap). */ \
3506
-# else /* !_LIBC_REENTRANT */
3507
-# define SYSCALL_ERROR_HANDLER \
3508
+# else /* !_LIBC_REENTRANT */
3509
+/* Store (- %d0) into errno through the GOT. */
3510
+# define SYSCALL_ERROR_HANDLER \
3511
SYSCALL_ERROR_LABEL: \
3512
move.l (errno@GOTPC, %pc), %a0; \
3514
@@ -136,8 +154,7 @@ SYSCALL_ERROR_LABEL: \
3515
a pointer (e.g., mmap). */ \
3518
-# endif /* _LIBC_REENTRANT */
3519
-# endif /* RTLD_PRIVATE_ERRNO */
3520
+# endif /* _LIBC_REENTRANT */
3522
# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
3524
From: Andreas Schwab <schwab@linux-m68k.org>
3525
Date: Sat, 13 Mar 2010 15:59:42 +0000 (+0100)
3526
Subject: m68k: define __signbit inlines
3527
X-Git-Tag: glibc-2.12~33
3528
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=326a03edf9a702f60ea2116364d8177dc682b9a5
3530
m68k: define __signbit inlines
3533
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3534
index b16fde2..1c8d232 100644
3535
--- a/ports/ChangeLog.m68k
3536
+++ b/ports/ChangeLog.m68k
3538
2010-03-13 Andreas Schwab <schwab@linux-m68k.org>
3540
+ * sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__signbit)
3541
+ (__signbitf, __signbitl): Define.
3543
* sysdeps/unix/sysv/linux/m68k/sysdep.h (SYSCALL_ERROR_HANDLER):
3544
Add variant for USE__THREAD.
3546
diff --git a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
3547
index 6b69f7a..0da98e4 100644
3548
--- a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
3549
+++ b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
3551
/* Definitions of inline math functions implemented by the m68881/2.
3552
- Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008
3553
+ Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008, 2010
3554
Free Software Foundation, Inc.
3555
This file is part of the GNU C Library.
3558
: "=dm" (__result) : "f" (x), "f" (y)); \
3560
# endif /* GCC 3.1 */
3562
+/* Test for negative number. Used in the signbit() macro. */
3564
+__NTH (__signbitf (float __x))
3566
+ __extension__ union { float __f; int __i; } __u = { __f: __x };
3567
+ return __u.__i < 0;
3570
+__NTH (__signbit (double __x))
3572
+ __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
3573
+ return __u.__i[0] < 0;
3576
+__NTH (__signbitl (long double __x))
3578
+ __extension__ union { long double __d; int __i[3]; } __u = { __d: __x };
3579
+ return __u.__i[0] < 0;
3584
From: Andreas Schwab <schwab@linux-m68k.org>
3585
Date: Sat, 13 Mar 2010 16:28:12 +0000 (+0100)
3586
Subject: m68k: remove duplicate __signbit definitions
3587
X-Git-Tag: glibc-2.12~32
3588
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=b5e933757cbe34989698fc1b1390c9b2a9a6b0be
3590
m68k: remove duplicate __signbit definitions
3593
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3594
index 1c8d232..9fafc08 100644
3595
--- a/ports/ChangeLog.m68k
3596
+++ b/ports/ChangeLog.m68k
3598
2010-03-13 Andreas Schwab <schwab@linux-m68k.org>
3600
* sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__signbit)
3601
- (__signbitf, __signbitl): Define.
3602
+ (__signbitf, __signbitl): Always define as inline.
3604
* sysdeps/unix/sysv/linux/m68k/sysdep.h (SYSCALL_ERROR_HANDLER):
3605
Add variant for USE__THREAD.
3606
diff --git a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
3607
index 0da98e4..975ffd8 100644
3608
--- a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
3609
+++ b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
3610
@@ -301,17 +301,7 @@ __inline_functions(long double,l)
3613
# define __inline_functions(float_type, s) \
3614
-__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
3616
- /* There is no branch-condition for the sign bit, so we must extract \
3617
- and examine the condition codes manually. */ \
3618
- unsigned long int __fpsr; \
3619
- __asm ("ftst%.x %1\n" \
3620
- "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \
3621
- return (__fpsr >> 27) & 1; \
3624
- __m81_defun (float_type, __CONCAT(__scalbln,s), \
3625
+__m81_defun (float_type, __CONCAT(__scalbln,s), \
3626
(float_type __x, long int __n)) \
3628
return __CONCAT(__scalbn,s) (__x, __n); \
3629
From: Andreas Schwab <schwab@linux-m68k.org>
3630
Date: Sat, 13 Mar 2010 17:14:35 +0000 (+0100)
3631
Subject: m68k: use signbit macro
3632
X-Git-Tag: glibc-2.12~31
3633
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=92dd2ecf169ac81a2fa16cbe246a1036c6b94656
3635
m68k: use signbit macro
3638
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3639
index 9fafc08..c7d068e 100644
3640
--- a/ports/ChangeLog.m68k
3641
+++ b/ports/ChangeLog.m68k
3643
2010-03-13 Andreas Schwab <schwab@linux-m68k.org>
3645
+ * sysdeps/m68k/m680x0/fpu/s_ccosh.c: Use signbit macro.
3646
+ * sysdeps/m68k/m680x0/fpu/s_ccos.c: Likewise.
3648
* sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__signbit)
3649
(__signbitf, __signbitl): Always define as inline.
3651
diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c b/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c
3652
index d302d3d..8239159 100644
3653
--- a/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c
3654
+++ b/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c
3656
/* Complex cosine function. m68k fpu version
3657
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
3658
+ Copyright (C) 1997, 1999, 2010 Free Software Foundation, Inc.
3659
This file is part of the GNU C Library.
3660
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
3662
@@ -48,7 +48,7 @@ s(__ccos) (__complex__ float_type x)
3663
: "f" (__real__ x));
3664
__real__ retval = cos_rx * m81(__ieee754_cosh) (__imag__ x);
3665
if (rx_cond & __M81_COND_ZERO)
3666
- __imag__ retval = (m81(__signbit) (__imag__ x)
3667
+ __imag__ retval = (signbit (__imag__ x)
3668
? __real__ x : -__real__ x);
3670
__imag__ retval = -sin_rx * m81(__ieee754_sinh) (__imag__ x);
3671
diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c b/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c
3672
index 1698881..d272e98 100644
3673
--- a/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c
3674
+++ b/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c
3676
/* Complex cosine hyperbole function. m68k fpu version
3677
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
3678
+ Copyright (C) 1997, 1999, 2010 Free Software Foundation, Inc.
3679
This file is part of the GNU C Library.
3680
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
3682
@@ -48,7 +48,7 @@ s(__ccosh) (__complex__ float_type x)
3683
: "f" (__imag__ x));
3684
__real__ retval = cos_ix * m81(__ieee754_cosh) (__real__ x);
3685
if (ix_cond & __M81_COND_ZERO)
3686
- __imag__ retval = (m81(__signbit) (__real__ x)
3687
+ __imag__ retval = (signbit (__real__ x)
3688
? -__imag__ x : __imag__ x);
3690
__imag__ retval = sin_ix * m81(__ieee754_sinh) (__real__ x);
3691
From: Andreas Schwab <schwab@linux-m68k.org>
3692
Date: Sat, 22 May 2010 19:04:42 +0000 (+0200)
3693
Subject: m68k: add c++-types and localplt data for m68k-linux-gnu
3694
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=0a124d8bc7a3d99f461af942aebdd3a8848672e9
3696
m68k: add c++-types and localplt data for m68k-linux-gnu
3699
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3700
index c7d068e..cdc0ab5 100644
3701
--- a/ports/ChangeLog.m68k
3702
+++ b/ports/ChangeLog.m68k
3704
+2010-05-22 Andreas Schwab <schwab@linux-m68k.org>
3706
+ * data/c++-types-m68k-linux-gnu.data: New file.
3707
+ * data/localplt-m68k-linux-gnu.data: New file.
3709
2010-03-13 Andreas Schwab <schwab@linux-m68k.org>
3711
* sysdeps/m68k/m680x0/fpu/s_ccosh.c: Use signbit macro.
3712
diff --git a/ports/data/c++-types-m68k-linux-gnu.data b/ports/data/c++-types-m68k-linux-gnu.data
3713
new file mode 100644
3714
index 0000000..fde53bf
3716
+++ b/ports/data/c++-types-m68k-linux-gnu.data
3748
+pthread_attr_t:14pthread_attr_t
3749
+pthread_barrier_t:17pthread_barrier_t
3750
+pthread_barrierattr_t:21pthread_barrierattr_t
3751
+pthread_cond_t:14pthread_cond_t
3752
+pthread_condattr_t:18pthread_condattr_t
3754
+pthread_mutex_t:15pthread_mutex_t
3755
+pthread_mutexattr_t:19pthread_mutexattr_t
3757
+pthread_rwlock_t:16pthread_rwlock_t
3758
+pthread_rwlockattr_t:20pthread_rwlockattr_t
3759
+pthread_spinlock_t:i
3765
+sigset_t:10__sigset_t
3785
diff --git a/ports/data/localplt-m68k-linux-gnu.data b/ports/data/localplt-m68k-linux-gnu.data
3786
new file mode 100644
3787
index 0000000..d266b8f
3789
+++ b/ports/data/localplt-m68k-linux-gnu.data
3791
+libc.so: _Unwind_Find_FDE
3792
+libc.so: __m68k_read_tp
3799
From: Andreas Schwab <schwab@linux-m68k.org>
3800
Date: Fri, 11 Jun 2010 19:58:32 +0000 (+0200)
3801
Subject: m68k: force alignment of futex variables
3802
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=0df56592854fa25ce091883cb60fc417283383b8
3804
m68k: force alignment of futex variables
3807
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3808
index cdc0ab5..6cf5d39 100644
3809
--- a/ports/ChangeLog.m68k
3810
+++ b/ports/ChangeLog.m68k
3812
+2010-06-11 Andreas Schwab <schwab@linux-m68k.org>
3814
+ * sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h: Force
3815
+ alignment of futex variables.
3817
2010-05-22 Andreas Schwab <schwab@linux-m68k.org>
3819
* data/ports/c++-types-m68k-linux-gnu.data: New file.
3820
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h
3821
index 0140810..832609d 100644
3822
--- a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h
3823
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h
3824
@@ -57,7 +57,7 @@ typedef union
3826
struct __pthread_mutex_s
3829
+ int __lock __attribute__ ((__aligned__ (4)));
3830
unsigned int __count;
3832
/* KIND must stay at this position in the structure to maintain
3833
@@ -87,7 +87,7 @@ typedef union
3838
+ int __lock __attribute__ ((__aligned__ (4)));
3839
unsigned int __futex;
3840
__extension__ unsigned long long int __total_seq;
3841
__extension__ unsigned long long int __wakeup_seq;
3842
@@ -112,7 +112,7 @@ typedef unsigned int pthread_key_t;
3845
/* Once-only execution */
3846
-typedef int pthread_once_t;
3847
+typedef int __attribute__ ((__aligned__ (4))) pthread_once_t;
3850
#if defined __USE_UNIX98 || defined __USE_XOPEN2K
3851
@@ -122,7 +122,7 @@ typedef union
3856
+ int __lock __attribute__ ((__aligned__ (4)));
3857
unsigned int __nr_readers;
3858
unsigned int __readers_wakeup;
3859
unsigned int __writer_wakeup;
3860
@@ -158,7 +158,7 @@ typedef volatile int pthread_spinlock_t;
3863
char __size[__SIZEOF_PTHREAD_BARRIER_T];
3865
+ long int __align __attribute__ ((__aligned__ (4)));
3866
} pthread_barrier_t;
3869
From: Andreas Schwab <schwab@linux-m68k.org>
3870
Date: Sun, 13 Jun 2010 19:09:38 +0000 (+0200)
3871
Subject: m68k: Add required definitions to sys/user.h
3872
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=08b1b36387286ed1ba48c56a32e52429b5ef6963
3874
m68k: Add required definitions to sys/user.h
3877
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3878
index 6cf5d39..bbc8a8c 100644
3879
--- a/ports/ChangeLog.m68k
3880
+++ b/ports/ChangeLog.m68k
3882
+2010-06-13 Andreas Schwab <schwab@linux-m68k.org>
3884
+ * sysdeps/unix/sysv/linux/m68k/sys/user.h (NBPG, UPAGES)
3885
+ (HOST_TEXT_START_ADDR, HOST_STACK_END_ADDR): Define.
3887
2010-06-11 Andreas Schwab <schwab@linux-m68k.org>
3889
* sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h: Force
3890
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h b/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h
3891
index f8b19fc..2663ac6 100644
3892
--- a/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h
3893
+++ b/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h
3895
-/* Copyright (C) 2008 Free Software Foundation, Inc.
3896
+/* Copyright (C) 2008, 2010 Free Software Foundation, Inc.
3897
This file is part of the GNU C Library.
3899
The GNU C Library is free software; you can redistribute it and/or
3900
@@ -58,4 +58,9 @@ struct user {
3906
+#define HOST_TEXT_START_ADDR u.start_code
3907
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
3910
From: Andreas Schwab <schwab@linux-m68k.org>
3911
Date: Sun, 13 Jun 2010 20:30:17 +0000 (+0200)
3912
Subject: m68k: mark all inline math functions as non-throwing
3913
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=9166f36fcc5390efb701e50564c63cb4534bd998
3915
m68k: mark all inline math functions as non-throwing
3918
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3919
index bbc8a8c..c5b5706 100644
3920
--- a/ports/ChangeLog.m68k
3921
+++ b/ports/ChangeLog.m68k
3923
2010-06-13 Andreas Schwab <schwab@linux-m68k.org>
3925
+ * sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Mark all functions as
3928
* sysdeps/unix/sysv/linux/m68k/sys/user.h (NBPG, UPAGES)
3929
(HOST_TEXT_START_ADDR, HOST_STACK_END_ADDR): Define.
3931
diff --git a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
3932
index 975ffd8..8a17127 100644
3933
--- a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
3934
+++ b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
3935
@@ -126,7 +126,7 @@ __NTH (__signbitl (long double __x))
3936
/* Define a const math function. */
3937
#define __m81_defun(rettype, func, args) \
3938
__m81_inline rettype __attribute__((__const__)) \
3939
- __m81_u(func) args
3940
+ __NTH (__m81_u(func) args)
3942
/* Define the three variants of a math function that has a direct
3943
implementation in the m68k fpu. FUNC is the name for C (which will be
3944
@@ -329,8 +329,8 @@ __m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) \
3947
__m81_inline float_type \
3948
-__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \
3950
+__NTH (__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \
3951
+ float_type __z)) \
3953
return (__x * __y) + __z; \
3955
@@ -346,8 +346,8 @@ __inline_functions (long double,l)
3957
# define __inline_functions(float_type, s) \
3959
-__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
3960
- float_type *__cosx) \
3961
+__NTH (__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
3962
+ float_type *__cosx)) \
3964
__asm ("fsincos%.x %2,%1:%0" \
3965
: "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \
3966
@@ -368,13 +368,13 @@ __inline_functions (long double,l)
3967
NAME, to make token pasting work correctly with -traditional. */
3968
# define __inline_forward_c(rettype, name, args1, args2) \
3969
__MATH_INLINE rettype __attribute__((__const__)) \
3971
+__NTH (name args1) \
3973
return __CONCAT(__,name) args2; \
3976
# define __inline_forward(rettype, name, args1, args2) \
3977
-__MATH_INLINE rettype name args1 \
3978
+__MATH_INLINE rettype __NTH (name args1) \
3980
return __CONCAT(__,name) args2; \
3982
From: Joseph Myers <joseph@codesourcery.com>
3983
Date: Thu, 24 Jun 2010 16:18:51 +0000 (+0000)
3984
Subject: Define F_SETPIPE_SZ and F_GETPIPE_SZ for M68K.
3985
X-Git-Url: http://sourceware.org/git/?p=glibc-ports.git;a=commitdiff_plain;h=71feaf72066abfe0e434e49d56e26b54152fb221
3987
Define F_SETPIPE_SZ and F_GETPIPE_SZ for M68K.
3990
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
3991
index c5b5706..be4956b 100644
3992
--- a/ports/ChangeLog.m68k
3993
+++ b/ports/ChangeLog.m68k
3995
+2010-06-24 Joseph Myers <joseph@codesourcery.com>
3997
+ * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h (F_SETPIPE_SZ,
3998
+ F_GETPIPE_SZ): Define.
4000
2010-06-13 Andreas Schwab <schwab@linux-m68k.org>
4002
* sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Mark all functions as
4003
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
4004
index d1eb706..f36507b 100644
4005
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
4006
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
4008
# define F_SETLEASE 1024 /* Set a lease. */
4009
# define F_GETLEASE 1025 /* Enquire what lease is active. */
4010
# define F_NOTIFY 1026 /* Request notfications on a directory. */
4011
+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
4012
+# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */
4014
#ifdef __USE_XOPEN2K8
4015
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with