source: patches/glibc-20051107-mips_nptl-1.patch@ b237cbc

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since b237cbc was 69cde8d, checked in by Jim Gifford <clfs@…>, 19 years ago

Added: All patches needed for the book.

  • Property mode set to 100644
File size: 38.6 KB
RevLine 
[69cde8d]1Submitted By: Jim Gifford (patches at jg555 dot com)
2Date: 2005-09-27
3Initial Package Version: 20050919 Snapshot
4Origin: Daniel Jacobwitz
5Upstream Status: Submitted by Origin
6Description: Adds NPTL support for MIPS
7
8diff -Naur glibc-20050919.orig/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h glibc-20050919/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h
9--- glibc-20050919.orig/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h 2005-03-28 09:21:52.000000000 +0000
10+++ glibc-20050919/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h 2005-09-27 16:15:20.000000000 +0000
11@@ -30,6 +30,8 @@
12 #define FUTEX_WAKE 1
13 #define FUTEX_REQUEUE 3
14 #define FUTEX_CMP_REQUEUE 4
15+#define FUTEX_WAKE_OP 5
16+#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1)
17
18 /* Initializer for compatibility lock. */
19 #define LLL_MUTEX_LOCK_INITIALIZER (0)
20@@ -39,7 +41,7 @@
21 INTERNAL_SYSCALL_DECL (__err); \
22 long int __ret; \
23 __ret = INTERNAL_SYSCALL (futex, __err, 4, \
24- (futexp), FUTEX_WAIT, (val), 0); \
25+ (long) (futexp), FUTEX_WAIT, (val), 0); \
26 INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
27 })
28
29@@ -48,7 +50,7 @@
30 INTERNAL_SYSCALL_DECL (__err); \
31 long int __ret; \
32 __ret = INTERNAL_SYSCALL (futex, __err, 4, \
33- (futexp), FUTEX_WAIT, (val), (timespec)); \
34+ (long) (futexp), FUTEX_WAIT, (val), (timespec));\
35 INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
36 })
37
38@@ -57,7 +59,7 @@
39 INTERNAL_SYSCALL_DECL (__err); \
40 long int __ret; \
41 __ret = INTERNAL_SYSCALL (futex, __err, 4, \
42- (futexp), FUTEX_WAKE, (nr), 0); \
43+ (long) (futexp), FUTEX_WAKE, (nr), 0); \
44 INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
45 })
46
47@@ -67,11 +69,23 @@
48 INTERNAL_SYSCALL_DECL (__err); \
49 long int __ret; \
50 __ret = INTERNAL_SYSCALL (futex, __err, 6, \
51- (futexp), FUTEX_CMP_REQUEUE, (nr_wake), \
52+ (long) (futexp), FUTEX_CMP_REQUEUE, (nr_wake), \
53 (nr_move), (mutex), (val)); \
54 INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
55 })
56
57+/* Returns non-zero if error happened, zero if success. */
58+#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) \
59+ ({ \
60+ INTERNAL_SYSCALL_DECL (__err); \
61+ long int __ret; \
62+ \
63+ __ret = INTERNAL_SYSCALL (futex, __err, 6, \
64+ (futexp), FUTEX_WAKE_OP, (nr_wake), \
65+ (nr_wake2), (futexp2), \
66+ FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \
67+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
68+ })
69
70 static inline int __attribute__((always_inline))
71 __lll_mutex_trylock(int *futex)
72diff -Naur glibc-20050919.orig/nptl/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h glibc-20050919/nptl/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
73--- glibc-20050919.orig/nptl/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h 1970-01-01 00:00:00.000000000 +0000
74+++ glibc-20050919/nptl/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h 2005-09-27 16:15:20.000000000 +0000
75@@ -0,0 +1,183 @@
76+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
77+ This file is part of the GNU C Library.
78+
79+ The GNU C Library is free software; you can redistribute it and/or
80+ modify it under the terms of the GNU Lesser General Public
81+ License as published by the Free Software Foundation; either
82+ version 2.1 of the License, or (at your option) any later version.
83+
84+ The GNU C Library is distributed in the hope that it will be useful,
85+ but WITHOUT ANY WARRANTY; without even the implied warranty of
86+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
87+ Lesser General Public License for more details.
88+
89+ You should have received a copy of the GNU Lesser General Public
90+ License along with the GNU C Library; if not, write to the Free
91+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
92+ 02111-1307 USA. */
93+
94+#include <sysdep.h>
95+#include <sysdeps/generic/sysdep.h>
96+#include <tls.h>
97+#ifndef __ASSEMBLER__
98+# include <nptl/pthreadP.h>
99+#endif
100+#include <sys/asm.h>
101+
102+/* Gas will put the initial save of $gp into the CIE, because it appears to
103+ happen before any instructions. So we use cfi_same_value instead of
104+ cfi_restore. */
105+
106+#ifdef HAVE_ASM_CFI_DIRECTIVES
107+# define cfi_same_value .cfi_same_value
108+#else
109+# define cfi_same_value
110+#endif
111+
112+#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
113+
114+#ifdef __PIC__
115+# undef PSEUDO
116+# define PSEUDO(name, syscall_name, args) \
117+ .align 2; \
118+ L(pseudo_start): \
119+ cfi_startproc; \
120+ cfi_adjust_cfa_offset (STKSPACE); \
121+ cfi_rel_offset (gp, STKOFF_GP); \
122+ 99: PTR_LA t9,__syscall_error; \
123+ /* manual cpreturn */ \
124+ REG_L gp, STKOFF_GP(sp); \
125+ cfi_same_value (gp); \
126+ RESTORESTK; \
127+ jr t9; \
128+ .type __##syscall_name##_nocancel, @function; \
129+ .globl __##syscall_name##_nocancel; \
130+ __##syscall_name##_nocancel: \
131+ SAVESTK; \
132+ .cpsetup t9, STKOFF_GP, name; \
133+ cfi_rel_offset (gp, STKOFF_GP); \
134+ li v0, SYS_ify(syscall_name); \
135+ syscall; \
136+ bne a3, zero, SYSCALL_ERROR_LABEL; \
137+ /* manual cpreturn */ \
138+ REG_L gp, STKOFF_GP(sp); \
139+ cfi_same_value (gp); \
140+ RESTORESTK; \
141+ ret; \
142+ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
143+ ENTRY (name) \
144+ SAVESTK; \
145+ .cpsetup t9, STKOFF_GP, name; \
146+ cfi_rel_offset (gp, STKOFF_GP); \
147+ SINGLE_THREAD_P(v1); \
148+ bne zero, v1, L(pseudo_cancel); \
149+ .set noreorder; \
150+ li v0, SYS_ify(syscall_name); \
151+ syscall; \
152+ .set reorder; \
153+ bne a3, zero, SYSCALL_ERROR_LABEL; \
154+ /* manual cpreturn */ \
155+ REG_L gp, STKOFF_GP(sp); \
156+ cfi_same_value (gp); \
157+ RESTORESTK; \
158+ ret; \
159+ L(pseudo_cancel): \
160+ cfi_adjust_cfa_offset (STKSPACE); \
161+ cfi_rel_offset (gp, STKOFF_GP); \
162+ REG_S ra, STKOFF_RA(sp); \
163+ cfi_rel_offset (ra, STKOFF_RA); \
164+ PUSHARGS_##args; /* save syscall args */ \
165+ CENABLE; \
166+ REG_S v0, STKOFF_SVMSK(sp); /* save mask */ \
167+ POPARGS_##args; /* restore syscall args */ \
168+ .set noreorder; \
169+ li v0, SYS_ify (syscall_name); \
170+ syscall; \
171+ .set reorder; \
172+ REG_S v0, STKOFF_SC_V0(sp); /* save syscall result */ \
173+ REG_S a3, STKOFF_SC_ERR(sp); /* save syscall error flag */ \
174+ REG_L a0, STKOFF_SVMSK(sp); /* pass mask as arg1 */ \
175+ CDISABLE; \
176+ REG_L a3, STKOFF_SC_ERR(sp); /* restore syscall error flag */ \
177+ REG_L ra, STKOFF_RA(sp); /* restore return address */ \
178+ REG_L v0, STKOFF_SC_V0(sp); /* restore syscall result */ \
179+ bne a3, zero, SYSCALL_ERROR_LABEL; \
180+ /* manual cpreturn */ \
181+ REG_L gp, STKOFF_GP(sp); \
182+ cfi_same_value (gp); \
183+ RESTORESTK; \
184+ L(pseudo_end):
185+
186+
187+# undef PSEUDO_END
188+# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
189+
190+#endif
191+
192+# define PUSHARGS_0 /* nothing to do */
193+# define PUSHARGS_1 PUSHARGS_0 REG_S a0, STKOFF_A0(sp); cfi_rel_offset (a0, STKOFF_A0);
194+# define PUSHARGS_2 PUSHARGS_1 REG_S a1, STKOFF_A1(sp); cfi_rel_offset (a1, STKOFF_A1);
195+# define PUSHARGS_3 PUSHARGS_2 REG_S a2, STKOFF_A2(sp); cfi_rel_offset (a2, STKOFF_A2);
196+# define PUSHARGS_4 PUSHARGS_3 REG_S a3, STKOFF_A3(sp); cfi_rel_offset (a3, STKOFF_A3);
197+# define PUSHARGS_5 PUSHARGS_4 REG_S a4, STKOFF_A4(sp); cfi_rel_offset (a3, STKOFF_A4);
198+# define PUSHARGS_6 PUSHARGS_5 REG_S a5, STKOFF_A5(sp); cfi_rel_offset (a3, STKOFF_A5);
199+
200+# define POPARGS_0 /* nothing to do */
201+# define POPARGS_1 POPARGS_0 REG_L a0, STKOFF_A0(sp);
202+# define POPARGS_2 POPARGS_1 REG_L a1, STKOFF_A1(sp);
203+# define POPARGS_3 POPARGS_2 REG_L a2, STKOFF_A2(sp);
204+# define POPARGS_4 POPARGS_3 REG_L a3, STKOFF_A3(sp);
205+# define POPARGS_5 POPARGS_4 REG_L a4, STKOFF_A4(sp);
206+# define POPARGS_6 POPARGS_5 REG_L a5, STKOFF_A5(sp);
207+
208+/* Save an even number of slots. Should be 0 if an even number of slots
209+ are used below, or SZREG if an odd number are used. */
210+# define STK_PAD SZREG
211+
212+/* Place values that we are more likely to use later in this sequence, i.e.
213+ closer to the SP at function entry. If you do that, the are more
214+ likely to already be in your d-cache. */
215+# define STKOFF_A5 (STK_PAD)
216+# define STKOFF_A4 (STKOFF_A5 + SZREG)
217+# define STKOFF_A3 (STKOFF_A4 + SZREG)
218+# define STKOFF_A2 (STKOFF_A3 + SZREG) /* MT and more args. */
219+# define STKOFF_A1 (STKOFF_A2 + SZREG) /* MT and 2 args. */
220+# define STKOFF_A0 (STKOFF_A1 + SZREG) /* MT and 1 arg. */
221+# define STKOFF_RA (STKOFF_A0 + SZREG) /* Used if MT. */
222+# define STKOFF_SC_V0 (STKOFF_RA + SZREG) /* Used if MT. */
223+# define STKOFF_SC_ERR (STKOFF_SC_V0 + SZREG) /* Used if MT. */
224+# define STKOFF_SVMSK (STKOFF_SC_ERR + SZREG) /* Used if MT. */
225+# define STKOFF_GP (STKOFF_SVMSK + SZREG) /* Always used. */
226+
227+# define STKSPACE (STKOFF_GP + SZREG)
228+# define SAVESTK PTR_SUBU sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE)
229+# define RESTORESTK PTR_ADDU sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE)
230+
231+# ifdef IS_IN_libpthread
232+# define CENABLE PTR_LA t9, __pthread_enable_asynccancel; jalr t9
233+# define CDISABLE PTR_LA t9, __pthread_disable_asynccancel; jalr t9
234+# elif defined IS_IN_librt
235+# define CENABLE PTR_LA t9, __librt_enable_asynccancel; jalr t9
236+# define CDISABLE PTR_LA t9, __librt_disable_asynccancel; jalr t9
237+# else
238+# define CENABLE PTR_LA t9, __libc_enable_asynccancel; jalr t9
239+# define CDISABLE PTR_LA t9, __libc_disable_asynccancel; jalr t9
240+# endif
241+
242+# ifndef __ASSEMBLER__
243+# define SINGLE_THREAD_P \
244+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
245+ header.multiple_threads) \
246+ == 0, 1)
247+# else
248+# define SINGLE_THREAD_P(reg) \
249+ READ_THREAD_POINTER(reg); \
250+ lw reg, MULTIPLE_THREADS_OFFSET(reg)
251+#endif
252+
253+#elif !defined __ASSEMBLER__
254+
255+# define SINGLE_THREAD_P 1
256+# define NO_CANCELLATION 1
257+
258+#endif
259diff -Naur glibc-20050919.orig/sysdeps/mips/dl-machine.h glibc-20050919/sysdeps/mips/dl-machine.h
260--- glibc-20050919.orig/sysdeps/mips/dl-machine.h 2005-03-28 09:32:04.000000000 +0000
261+++ glibc-20050919/sysdeps/mips/dl-machine.h 2005-09-27 16:15:20.000000000 +0000
262@@ -266,13 +266,13 @@
263 " STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\
264 # Make sure the stack pointer is aligned for _dl_init_internal.\n\
265 and $2, $29, -2 * " STRINGXP(SZREG) "\n\
266- " STRINGXP(PTR_S) " $29, -4($2)\n\
267+ " STRINGXP(PTR_S) " $29, -" STRINGXP(SZREG) "($2)\n\
268 " STRINGXP(PTR_SUBIU) " $29, $2, 32\n\
269 " STRINGXP(SAVE_GP(16)) "\n\
270 # Call the function to run the initializers.\n\
271 jal _dl_init_internal\n\
272 # Restore the stack pointer for _start.\n\
273- " STRINGXP(PTR_L) " $29, 28($29)\n\
274+ " STRINGXP(PTR_L) " $29, 32-" STRINGXP(SZREG) "($29)\n\
275 # Pass our finalizer function to the user in $2 as per ELF ABI.\n\
276 " STRINGXP(PTR_LA) " $2, _dl_fini\n\
277 # Jump to the user entry point.\n\
278@@ -336,28 +336,24 @@
279 # endif
280 {
281 struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
282- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
283-
284- if (sym)
285- value += sym->st_value;
286
287 switch (r_type)
288 {
289 case R_MIPS_TLS_DTPMOD64:
290 case R_MIPS_TLS_DTPMOD32:
291 if (sym_map)
292- *(ElfW(Word) *)reloc_addr = sym_map->l_tls_modid;
293+ *(ElfW(Addr) *)reloc_addr = sym_map->l_tls_modid;
294 break;
295
296 case R_MIPS_TLS_DTPREL64:
297 case R_MIPS_TLS_DTPREL32:
298- *(ElfW(Word) *)reloc_addr += TLS_DTPREL_VALUE (sym);
299+ *(ElfW(Addr) *)reloc_addr += TLS_DTPREL_VALUE (sym);
300 break;
301
302 case R_MIPS_TLS_TPREL32:
303 case R_MIPS_TLS_TPREL64:
304 CHECK_STATIC_TLS (map, sym_map);
305- *(ElfW(Word) *)reloc_addr += TLS_TPREL_VALUE (sym_map, sym);
306+ *(ElfW(Addr) *)reloc_addr += TLS_TPREL_VALUE (sym_map, sym);
307 break;
308 }
309
310diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/bits/socket.h glibc-20050919/sysdeps/unix/sysv/linux/mips/bits/socket.h
311--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/bits/socket.h 2004-12-15 01:00:55.000000000 +0000
312+++ glibc-20050919/sysdeps/unix/sysv/linux/mips/bits/socket.h 2005-09-27 16:15:20.000000000 +0000
313@@ -219,10 +219,10 @@
314 socklen_t msg_namelen; /* Length of address data. */
315
316 struct iovec *msg_iov; /* Vector of data to send/receive into. */
317- int msg_iovlen; /* Number of elements in the vector. */
318+ size_t msg_iovlen; /* Number of elements in the vector. */
319
320 void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
321- socklen_t msg_controllen; /* Ancillary data buffer length. */
322+ size_t msg_controllen; /* Ancillary data buffer length. */
323
324 int msg_flags; /* Flags on received message. */
325 };
326@@ -270,8 +270,8 @@
327
328 __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
329 + CMSG_ALIGN (__cmsg->cmsg_len));
330- if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
331- + __mhdr->msg_controllen)
332+ if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
333+ + __mhdr->msg_controllen)
334 || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
335 > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
336 /* No more entries. */
337@@ -284,13 +284,12 @@
338 <linux/socket.h>. */
339 enum
340 {
341- SCM_RIGHTS = 0x01, /* Transfer file descriptors. */
342+ SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
343 #define SCM_RIGHTS SCM_RIGHTS
344 #ifdef __USE_BSD
345- SCM_CREDENTIALS = 0x02, /* Credentials passing. */
346+ , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
347 # define SCM_CREDENTIALS SCM_CREDENTIALS
348 #endif
349- __SCM_CONNECT = 0x03 /* Data array is `struct scm_connect'. */
350 };
351
352 /* User visible structure for SCM_CREDENTIALS message */
353diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/Makefile glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/Makefile
354--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/Makefile 1970-01-01 00:00:00.000000000 +0000
355+++ glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/Makefile 2005-09-27 16:15:20.000000000 +0000
356@@ -0,0 +1,9 @@
357+ifeq ($(subdir),socket)
358+CFLAGS-recv.c += -fexceptions
359+CFLAGS-send.c += -fexceptions
360+endif
361+
362+ifeq ($(subdir),nptl)
363+CFLAGS-recv.c += -fexceptions
364+CFLAGS-send.c += -fexceptions
365+endif
366diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
367--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h 2005-02-25 15:18:12.000000000 +0000
368+++ glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h 2005-09-27 16:15:20.000000000 +0000
369@@ -66,22 +66,28 @@
370 #define INTERNAL_SYSCALL_ERRNO(val, err) (val)
371
372 #undef INTERNAL_SYSCALL
373-#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args)
374+#define INTERNAL_SYSCALL(name, err, nr, args...) \
375+ internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
376+ "i" (SYS_ify (name)), err, args)
377
378-#define internal_syscall0(name, err, dummy...) \
379+#undef INTERNAL_SYSCALL_NCS
380+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
381+ internal_syscall##nr (= number, , "r" (__v0), err, args)
382+
383+#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
384 ({ \
385 long _sys_result; \
386 \
387 { \
388- register long __v0 asm("$2"); \
389- register long __a3 asm("$7"); \
390+ register long long __v0 asm("$2") ncs_init; \
391+ register long long __a3 asm("$7"); \
392 __asm__ volatile ( \
393 ".set\tnoreorder\n\t" \
394- "li\t$2, %2\t\t\t# " #name "\n\t" \
395+ cs_init \
396 "syscall\n\t" \
397 ".set reorder" \
398 : "=r" (__v0), "=r" (__a3) \
399- : "i" (SYS_ify(name)) \
400+ : input \
401 : __SYSCALL_CLOBBERS); \
402 err = __a3; \
403 _sys_result = __v0; \
404@@ -89,21 +95,21 @@
405 _sys_result; \
406 })
407
408-#define internal_syscall1(name, err, arg1) \
409+#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
410 ({ \
411 long _sys_result; \
412 \
413 { \
414- register long long __v0 asm("$2"); \
415+ register long long __v0 asm("$2") ncs_init; \
416 register long long __a0 asm("$4") = (long long) arg1; \
417 register long long __a3 asm("$7"); \
418 __asm__ volatile ( \
419 ".set\tnoreorder\n\t" \
420- "li\t$2, %3\t\t\t# " #name "\n\t" \
421+ cs_init \
422 "syscall\n\t" \
423 ".set reorder" \
424 : "=r" (__v0), "=r" (__a3) \
425- : "r" (__a0), "i" (SYS_ify(name)) \
426+ : input, "r" (__a0) \
427 : __SYSCALL_CLOBBERS); \
428 err = __a3; \
429 _sys_result = __v0; \
430@@ -111,22 +117,22 @@
431 _sys_result; \
432 })
433
434-#define internal_syscall2(name, err, arg1, arg2) \
435+#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
436 ({ \
437 long _sys_result; \
438 \
439 { \
440- register long long __v0 asm("$2"); \
441+ register long long __v0 asm("$2") ncs_init; \
442 register long long __a0 asm("$4") = (long long) arg1; \
443 register long long __a1 asm("$5") = (long long) arg2; \
444 register long long __a3 asm("$7"); \
445 __asm__ volatile ( \
446 ".set\tnoreorder\n\t" \
447- "li\t$2, %4\t\t\t# " #name "\n\t" \
448+ cs_init \
449 "syscall\n\t" \
450 ".set\treorder" \
451 : "=r" (__v0), "=r" (__a3) \
452- : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \
453+ : input, "r" (__a0), "r" (__a1) \
454 : __SYSCALL_CLOBBERS); \
455 err = __a3; \
456 _sys_result = __v0; \
457@@ -134,23 +140,23 @@
458 _sys_result; \
459 })
460
461-#define internal_syscall3(name, err, arg1, arg2, arg3) \
462+#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
463 ({ \
464 long _sys_result; \
465 \
466 { \
467- register long long __v0 asm("$2"); \
468+ register long long __v0 asm("$2") ncs_init; \
469 register long long __a0 asm("$4") = (long long) arg1; \
470 register long long __a1 asm("$5") = (long long) arg2; \
471 register long long __a2 asm("$6") = (long long) arg3; \
472 register long long __a3 asm("$7"); \
473 __asm__ volatile ( \
474 ".set\tnoreorder\n\t" \
475- "li\t$2, %5\t\t\t# " #name "\n\t" \
476+ cs_init \
477 "syscall\n\t" \
478 ".set\treorder" \
479 : "=r" (__v0), "=r" (__a3) \
480- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
481+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
482 : __SYSCALL_CLOBBERS); \
483 err = __a3; \
484 _sys_result = __v0; \
485@@ -158,23 +164,23 @@
486 _sys_result; \
487 })
488
489-#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \
490+#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
491 ({ \
492 long _sys_result; \
493 \
494 { \
495- register long long __v0 asm("$2"); \
496+ register long long __v0 asm("$2") ncs_init; \
497 register long long __a0 asm("$4") = (long long) arg1; \
498 register long long __a1 asm("$5") = (long long) arg2; \
499 register long long __a2 asm("$6") = (long long) arg3; \
500 register long long __a3 asm("$7") = (long long) arg4; \
501 __asm__ volatile ( \
502 ".set\tnoreorder\n\t" \
503- "li\t$2, %5\t\t\t# " #name "\n\t" \
504+ cs_init \
505 "syscall\n\t" \
506 ".set\treorder" \
507 : "=r" (__v0), "+r" (__a3) \
508- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
509+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
510 : __SYSCALL_CLOBBERS); \
511 err = __a3; \
512 _sys_result = __v0; \
513@@ -182,12 +188,12 @@
514 _sys_result; \
515 })
516
517-#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \
518+#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
519 ({ \
520 long _sys_result; \
521 \
522 { \
523- register long long __v0 asm("$2"); \
524+ register long long __v0 asm("$2") ncs_init; \
525 register long long __a0 asm("$4") = (long long) arg1; \
526 register long long __a1 asm("$5") = (long long) arg2; \
527 register long long __a2 asm("$6") = (long long) arg3; \
528@@ -195,12 +201,11 @@
529 register long long __a4 asm("$8") = (long long) arg5; \
530 __asm__ volatile ( \
531 ".set\tnoreorder\n\t" \
532- "li\t$2, %5\t\t\t# " #name "\n\t" \
533+ cs_init \
534 "syscall\n\t" \
535 ".set\treorder" \
536 : "=r" (__v0), "+r" (__a3) \
537- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
538- "r" (__a4) \
539+ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
540 : __SYSCALL_CLOBBERS); \
541 err = __a3; \
542 _sys_result = __v0; \
543@@ -208,12 +213,12 @@
544 _sys_result; \
545 })
546
547-#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\
548+#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
549 ({ \
550 long _sys_result; \
551 \
552 { \
553- register long long __v0 asm("$2"); \
554+ register long long __v0 asm("$2") ncs_init; \
555 register long long __a0 asm("$4") = (long long) arg1; \
556 register long long __a1 asm("$5") = (long long) arg2; \
557 register long long __a2 asm("$6") = (long long) arg3; \
558@@ -222,12 +227,12 @@
559 register long long __a5 asm("$9") = (long long) arg6; \
560 __asm__ volatile ( \
561 ".set\tnoreorder\n\t" \
562- "li\t$2, %5\t\t\t# " #name "\n\t" \
563+ cs_init \
564 "syscall\n\t" \
565 ".set\treorder" \
566 : "=r" (__v0), "+r" (__a3) \
567- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
568- "r" (__a4), "r" (__a5) \
569+ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
570+ "r" (__a5) \
571 : __SYSCALL_CLOBBERS); \
572 err = __a3; \
573 _sys_result = __v0; \
574diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
575--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h 2005-02-25 15:18:13.000000000 +0000
576+++ glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h 2005-09-27 16:15:20.000000000 +0000
577@@ -66,22 +66,28 @@
578 #define INTERNAL_SYSCALL_ERRNO(val, err) (val)
579
580 #undef INTERNAL_SYSCALL
581-#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args)
582+#define INTERNAL_SYSCALL(name, err, nr, args...) \
583+ internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
584+ "i" (SYS_ify (name)), err, args)
585
586-#define internal_syscall0(name, err, dummy...) \
587+#undef INTERNAL_SYSCALL_NCS
588+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
589+ internal_syscall##nr (= number, , "r" (__v0), err, args)
590+
591+#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
592 ({ \
593 long _sys_result; \
594 \
595 { \
596- register long __v0 asm("$2"); \
597- register long __a3 asm("$7"); \
598+ register long __v0 asm("$2") ncs_init; \
599+ register long __a3 asm("$7"); \
600 __asm__ volatile ( \
601 ".set\tnoreorder\n\t" \
602- "li\t$2, %2\t\t\t# " #name "\n\t" \
603+ cs_init \
604 "syscall\n\t" \
605 ".set reorder" \
606 : "=r" (__v0), "=r" (__a3) \
607- : "i" (SYS_ify(name)) \
608+ : input \
609 : __SYSCALL_CLOBBERS); \
610 err = __a3; \
611 _sys_result = __v0; \
612@@ -89,21 +95,21 @@
613 _sys_result; \
614 })
615
616-#define internal_syscall1(name, err, arg1) \
617+#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
618 ({ \
619 long _sys_result; \
620 \
621 { \
622- register long __v0 asm("$2"); \
623+ register long __v0 asm("$2") ncs_init; \
624 register long __a0 asm("$4") = (long) arg1; \
625 register long __a3 asm("$7"); \
626 __asm__ volatile ( \
627 ".set\tnoreorder\n\t" \
628- "li\t$2, %3\t\t\t# " #name "\n\t" \
629+ cs_init \
630 "syscall\n\t" \
631 ".set reorder" \
632 : "=r" (__v0), "=r" (__a3) \
633- : "r" (__a0), "i" (SYS_ify(name)) \
634+ : input, "r" (__a0) \
635 : __SYSCALL_CLOBBERS); \
636 err = __a3; \
637 _sys_result = __v0; \
638@@ -111,22 +117,22 @@
639 _sys_result; \
640 })
641
642-#define internal_syscall2(name, err, arg1, arg2) \
643+#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
644 ({ \
645 long _sys_result; \
646 \
647 { \
648- register long __v0 asm("$2"); \
649+ register long __v0 asm("$2") ncs_init; \
650 register long __a0 asm("$4") = (long) arg1; \
651 register long __a1 asm("$5") = (long) arg2; \
652 register long __a3 asm("$7"); \
653 __asm__ volatile ( \
654 ".set\tnoreorder\n\t" \
655- "li\t$2, %4\t\t\t# " #name "\n\t" \
656+ cs_init \
657 "syscall\n\t" \
658 ".set\treorder" \
659 : "=r" (__v0), "=r" (__a3) \
660- : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \
661+ : input, "r" (__a0), "r" (__a1) \
662 : __SYSCALL_CLOBBERS); \
663 err = __a3; \
664 _sys_result = __v0; \
665@@ -134,23 +140,23 @@
666 _sys_result; \
667 })
668
669-#define internal_syscall3(name, err, arg1, arg2, arg3) \
670+#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
671 ({ \
672 long _sys_result; \
673 \
674 { \
675- register long __v0 asm("$2"); \
676+ register long __v0 asm("$2") ncs_init; \
677 register long __a0 asm("$4") = (long) arg1; \
678 register long __a1 asm("$5") = (long) arg2; \
679 register long __a2 asm("$6") = (long) arg3; \
680 register long __a3 asm("$7"); \
681 __asm__ volatile ( \
682 ".set\tnoreorder\n\t" \
683- "li\t$2, %5\t\t\t# " #name "\n\t" \
684+ cs_init \
685 "syscall\n\t" \
686 ".set\treorder" \
687 : "=r" (__v0), "=r" (__a3) \
688- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
689+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
690 : __SYSCALL_CLOBBERS); \
691 err = __a3; \
692 _sys_result = __v0; \
693@@ -158,23 +164,23 @@
694 _sys_result; \
695 })
696
697-#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \
698+#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
699 ({ \
700 long _sys_result; \
701 \
702 { \
703- register long __v0 asm("$2"); \
704+ register long __v0 asm("$2") ncs_init; \
705 register long __a0 asm("$4") = (long) arg1; \
706 register long __a1 asm("$5") = (long) arg2; \
707 register long __a2 asm("$6") = (long) arg3; \
708 register long __a3 asm("$7") = (long) arg4; \
709 __asm__ volatile ( \
710 ".set\tnoreorder\n\t" \
711- "li\t$2, %5\t\t\t# " #name "\n\t" \
712+ cs_init \
713 "syscall\n\t" \
714 ".set\treorder" \
715 : "=r" (__v0), "+r" (__a3) \
716- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
717+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
718 : __SYSCALL_CLOBBERS); \
719 err = __a3; \
720 _sys_result = __v0; \
721@@ -182,12 +188,12 @@
722 _sys_result; \
723 })
724
725-#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \
726+#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
727 ({ \
728 long _sys_result; \
729 \
730 { \
731- register long __v0 asm("$2"); \
732+ register long __v0 asm("$2") ncs_init; \
733 register long __a0 asm("$4") = (long) arg1; \
734 register long __a1 asm("$5") = (long) arg2; \
735 register long __a2 asm("$6") = (long) arg3; \
736@@ -195,12 +201,11 @@
737 register long __a4 asm("$8") = (long) arg5; \
738 __asm__ volatile ( \
739 ".set\tnoreorder\n\t" \
740- "li\t$2, %5\t\t\t# " #name "\n\t" \
741+ cs_init \
742 "syscall\n\t" \
743 ".set\treorder" \
744 : "=r" (__v0), "+r" (__a3) \
745- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
746- "r" (__a4) \
747+ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
748 : __SYSCALL_CLOBBERS); \
749 err = __a3; \
750 _sys_result = __v0; \
751@@ -208,12 +213,12 @@
752 _sys_result; \
753 })
754
755-#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\
756+#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
757 ({ \
758 long _sys_result; \
759 \
760 { \
761- register long __v0 asm("$2"); \
762+ register long __v0 asm("$2") ncs_init; \
763 register long __a0 asm("$4") = (long) arg1; \
764 register long __a1 asm("$5") = (long) arg2; \
765 register long __a2 asm("$6") = (long) arg3; \
766@@ -222,12 +227,12 @@
767 register long __a5 asm("$9") = (long) arg6; \
768 __asm__ volatile ( \
769 ".set\tnoreorder\n\t" \
770- "li\t$2, %5\t\t\t# " #name "\n\t" \
771+ cs_init \
772 "syscall\n\t" \
773 ".set\treorder" \
774 : "=r" (__v0), "+r" (__a3) \
775- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
776- "r" (__a4), "r" (__a5) \
777+ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
778+ "r" (__a5) \
779 : __SYSCALL_CLOBBERS); \
780 err = __a3; \
781 _sys_result = __v0; \
782diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
783--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list 2004-07-21 06:13:15.000000000 +0000
784+++ glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list 2005-09-27 16:15:20.000000000 +0000
785@@ -1,16 +1,12 @@
786 # File name Caller Syscall name Args Strong name Weak names
787
788-lseek - lseek i:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64
789-
790-# proper socket implementations:
791-recvfrom - recvfrom i:ibniBN __libc_recvfrom __recvfrom recvfrom
792-sendto - sendto i:ibnibn __libc_sendto __sendto sendto
793+lseek - lseek Ci:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64
794
795 # semaphore and shm system calls
796 msgctl - msgctl i:iip __msgctl msgctl
797 msgget - msgget i:ii __msgget msgget
798-msgrcv - msgrcv i:ibnii __msgrcv msgrcv
799-msgsnd - msgsnd i:ibni __msgsnd msgsnd
800+msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
801+msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
802 shmat - shmat i:ipi __shmat shmat
803 shmctl - shmctl i:iip __shmctl shmctl
804 shmdt - shmdt i:s __shmdt shmdt
805diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/ptrace.c glibc-20050919/sysdeps/unix/sysv/linux/mips/ptrace.c
806--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/ptrace.c 2004-11-24 04:36:11.000000000 +0000
807+++ glibc-20050919/sysdeps/unix/sysv/linux/mips/ptrace.c 1970-01-01 00:00:00.000000000 +0000
808@@ -1,111 +0,0 @@
809-/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004
810- Free Software Foundation, Inc.
811- This file is part of the GNU C Library.
812-
813- The GNU C Library is free software; you can redistribute it and/or
814- modify it under the terms of the GNU Lesser General Public
815- License as published by the Free Software Foundation; either
816- version 2.1 of the License, or (at your option) any later version.
817-
818- The GNU C Library is distributed in the hope that it will be useful,
819- but WITHOUT ANY WARRANTY; without even the implied warranty of
820- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
821- Lesser General Public License for more details.
822-
823- You should have received a copy of the GNU Lesser General Public
824- License along with the GNU C Library; if not, write to the Free
825- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
826- 02111-1307 USA. */
827-
828-#include <errno.h>
829-#include <sgidefs.h>
830-#include <sys/types.h>
831-#include <sys/ptrace.h>
832-#include <sys/user.h>
833-#include <stdarg.h>
834-
835-#include <sysdep.h>
836-#include <sys/syscall.h>
837-#include <bp-checks.h>
838-#include <sgidefs.h>
839-
840-#if _MIPS_SIM == _ABIN32
841-__extension__ typedef long long int reg_type;
842-#else
843-typedef long int reg_type;
844-#endif
845-
846-reg_type
847-ptrace (enum __ptrace_request request, ...)
848-{
849- reg_type res, ret;
850- va_list ap;
851- pid_t pid;
852- void *addr;
853- reg_type data;
854-
855- va_start (ap, request);
856- pid = va_arg (ap, pid_t);
857- addr = va_arg (ap, void *);
858- data = va_arg (ap, reg_type);
859- va_end (ap);
860-
861- if (request > 0 && request < 4)
862- data = &ret;
863-
864-#if __BOUNDED_POINTERS__
865- switch (request)
866- {
867- case PTRACE_PEEKTEXT:
868- case PTRACE_PEEKDATA:
869- case PTRACE_PEEKUSER:
870- case PTRACE_POKETEXT:
871- case PTRACE_POKEDATA:
872- case PTRACE_POKEUSER:
873- (void) CHECK_1 ((int *) addr);
874- (void) CHECK_1 ((int *) data);
875- break;
876-
877- case PTRACE_GETREGS:
878- case PTRACE_SETREGS:
879- /* We don't know the size of data, so the best we can do is ensure
880- that `data' is valid for at least one word. */
881- (void) CHECK_1 ((int *) data);
882- break;
883-
884- case PTRACE_GETFPREGS:
885- case PTRACE_SETFPREGS:
886- /* We don't know the size of data, so the best we can do is ensure
887- that `data' is valid for at least one word. */
888- (void) CHECK_1 ((int *) data);
889- break;
890-
891- case PTRACE_GETFPXREGS:
892- case PTRACE_SETFPXREGS:
893- /* We don't know the size of data, so the best we can do is ensure
894- that `data' is valid for at least one word. */
895- (void) CHECK_1 ((int *) data);
896- break;
897-
898- case PTRACE_TRACEME:
899- case PTRACE_CONT:
900- case PTRACE_KILL:
901- case PTRACE_SINGLESTEP:
902- case PTRACE_ATTACH:
903- case PTRACE_DETACH:
904- case PTRACE_SYSCALL:
905- /* Neither `data' nor `addr' needs any checks. */
906- break;
907- };
908-#endif
909-
910- res = INLINE_SYSCALL (ptrace, 4, request, pid,
911- __ptrvalue (addr), __ptrvalue (data));
912- if (res >= 0 && request > 0 && request < 4)
913- {
914- __set_errno (0);
915- return ret;
916- }
917-
918- return res;
919-}
920diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/sys/ptrace.h glibc-20050919/sysdeps/unix/sysv/linux/mips/sys/ptrace.h
921--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/sys/ptrace.h 2004-11-24 04:37:35.000000000 +0000
922+++ glibc-20050919/sysdeps/unix/sysv/linux/mips/sys/ptrace.h 1970-01-01 00:00:00.000000000 +0000
923@@ -1,136 +0,0 @@
924-/* `ptrace' debugger support interface. Linux version.
925- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004
926- Free Software Foundation, Inc.
927- This file is part of the GNU C Library.
928-
929- The GNU C Library is free software; you can redistribute it and/or
930- modify it under the terms of the GNU Lesser General Public
931- License as published by the Free Software Foundation; either
932- version 2.1 of the License, or (at your option) any later version.
933-
934- The GNU C Library is distributed in the hope that it will be useful,
935- but WITHOUT ANY WARRANTY; without even the implied warranty of
936- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
937- Lesser General Public License for more details.
938-
939- You should have received a copy of the GNU Lesser General Public
940- License along with the GNU C Library; if not, write to the Free
941- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
942- 02111-1307 USA. */
943-
944-#ifndef _SYS_PTRACE_H
945-#define _SYS_PTRACE_H 1
946-
947-#include <features.h>
948-#include <sgidefs.h>
949-
950-__BEGIN_DECLS
951-
952-/* Type of the REQUEST argument to `ptrace.' */
953-enum __ptrace_request
954-{
955- /* Indicate that the process making this request should be traced.
956- All signals received by this process can be intercepted by its
957- parent, and its parent can use the other `ptrace' requests. */
958- PTRACE_TRACEME = 0,
959-#define PT_TRACE_ME PTRACE_TRACEME
960-
961- /* Return the word in the process's text space at address ADDR. */
962- PTRACE_PEEKTEXT = 1,
963-#define PT_READ_I PTRACE_PEEKTEXT
964-
965- /* Return the word in the process's data space at address ADDR. */
966- PTRACE_PEEKDATA = 2,
967-#define PT_READ_D PTRACE_PEEKDATA
968-
969- /* Return the word in the process's user area at offset ADDR. */
970- PTRACE_PEEKUSER = 3,
971-#define PT_READ_U PTRACE_PEEKUSER
972-
973- /* Write the word DATA into the process's text space at address ADDR. */
974- PTRACE_POKETEXT = 4,
975-#define PT_WRITE_I PTRACE_POKETEXT
976-
977- /* Write the word DATA into the process's data space at address ADDR. */
978- PTRACE_POKEDATA = 5,
979-#define PT_WRITE_D PTRACE_POKEDATA
980-
981- /* Write the word DATA into the process's user area at offset ADDR. */
982- PTRACE_POKEUSER = 6,
983-#define PT_WRITE_U PTRACE_POKEUSER
984-
985- /* Continue the process. */
986- PTRACE_CONT = 7,
987-#define PT_CONTINUE PTRACE_CONT
988-
989- /* Kill the process. */
990- PTRACE_KILL = 8,
991-#define PT_KILL PTRACE_KILL
992-
993- /* Single step the process.
994- This is not supported on all machines. */
995- PTRACE_SINGLESTEP = 9,
996-#define PT_STEP PTRACE_SINGLESTEP
997-
998- /* Get all general purpose registers used by a processes.
999- This is not supported on all machines. */
1000- PTRACE_GETREGS = 12,
1001-#define PT_GETREGS PTRACE_GETREGS
1002-
1003- /* Set all general purpose registers used by a processes.
1004- This is not supported on all machines. */
1005- PTRACE_SETREGS = 13,
1006-#define PT_SETREGS PTRACE_SETREGS
1007-
1008- /* Get all floating point registers used by a processes.
1009- This is not supported on all machines. */
1010- PTRACE_GETFPREGS = 14,
1011-#define PT_GETFPREGS PTRACE_GETFPREGS
1012-
1013- /* Set all floating point registers used by a processes.
1014- This is not supported on all machines. */
1015- PTRACE_SETFPREGS = 15,
1016-#define PT_SETFPREGS PTRACE_SETFPREGS
1017-
1018- /* Attach to a process that is already running. */
1019- PTRACE_ATTACH = 16,
1020-#define PT_ATTACH PTRACE_ATTACH
1021-
1022- /* Detach from a process attached to with PTRACE_ATTACH. */
1023- PTRACE_DETACH = 17,
1024-#define PT_DETACH PTRACE_DETACH
1025-
1026- /* Get all extended floating point registers used by a processes.
1027- This is not supported on all machines. */
1028- PTRACE_GETFPXREGS = 18,
1029-#define PT_GETFPXREGS PTRACE_GETFPXREGS
1030-
1031- /* Set all extended floating point registers used by a processes.
1032- This is not supported on all machines. */
1033- PTRACE_SETFPXREGS = 19,
1034-#define PT_SETFPXREGS PTRACE_SETFPXREGS
1035-
1036- /* Continue and stop at the next (return from) syscall. */
1037- PTRACE_SYSCALL = 24
1038-#define PT_SYSCALL PTRACE_SYSCALL
1039-};
1040-
1041-/* Perform process tracing functions. REQUEST is one of the values
1042- above, and determines the action to be taken.
1043- For all requests except PTRACE_TRACEME, PID specifies the process to be
1044- traced.
1045-
1046- PID and the other arguments described above for the various requests should
1047- appear (those that are used for the particular request) as:
1048- pid_t PID, void *ADDR, int DATA, void *ADDR2
1049- after REQUEST. */
1050-#if _MIPS_SIM == _ABIN32
1051-__extension__ extern long long int ptrace
1052- (enum __ptrace_request __request, ...) __THROW;
1053-#else
1054-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
1055-#endif
1056-
1057-__END_DECLS
1058-
1059-#endif /* _SYS_PTRACE_H */
Note: See TracBrowser for help on using the repository browser.