diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/alpha/_mcount.S | 11 | ||||
-rw-r--r-- | sysdeps/alpha/bb_init_func.S | 12 | ||||
-rw-r--r-- | sysdeps/alpha/bsd-_setjmp.S | 7 | ||||
-rw-r--r-- | sysdeps/alpha/bsd-setjmp.S | 7 | ||||
-rw-r--r-- | sysdeps/alpha/divrem.h | 11 | ||||
-rw-r--r-- | sysdeps/alpha/ffs.S | 4 | ||||
-rw-r--r-- | sysdeps/alpha/memchr.S | 36 | ||||
-rw-r--r-- | sysdeps/alpha/setjmp.S | 5 | ||||
-rw-r--r-- | sysdeps/alpha/strlen.S | 82 | ||||
-rw-r--r-- | sysdeps/generic/stpncpy.c | 8 | ||||
-rw-r--r-- | sysdeps/generic/ustatbits.h | 10 | ||||
-rw-r--r-- | sysdeps/i386/fpu_control.h | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/Makefile | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/brk.S | 11 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/ioperm.c | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/gnu/types.h | 4 |
16 files changed, 115 insertions, 104 deletions
diff --git a/sysdeps/alpha/_mcount.S b/sysdeps/alpha/_mcount.S index e813ebdd58..6c4af3f233 100644 --- a/sysdeps/alpha/_mcount.S +++ b/sysdeps/alpha/_mcount.S @@ -28,20 +28,17 @@ compiler treats those calls as if they were instructions. In particular, it doesn't save any of the temporary registers (caller saved registers). It is therefore necessary to preserve all caller-saved registers as well - + Upon entering _mcount, register $at holds the return address and ra holds the return address of the function's caller (selfpc and frompc, respectively in gmon.c language...). */ #include <sysdep.h> -#undef ret /* discard `ret' as defined in sysdep.h */ - .set noat .set noreorder LEAF(_mcount, 0xb0) -weak_alias (_mcount, mcount) .prologue 0 subq sp, 0xb0, sp @@ -69,8 +66,6 @@ weak_alias (_mcount, mcount) stq t5, 0x70(sp) stq t6, 0x78(sp) - lda pv, __mcount - stq t7, 0x80(sp) stq t8, 0x88(sp) stq t9, 0x90(sp) @@ -78,7 +73,7 @@ weak_alias (_mcount, mcount) stq t11, 0xa0(sp) stq v0, 0xa8(sp) - jsr ra, (pv), __mcount + jsr ra, __mcount ldq a0, 0x00(sp) ldq a1, 0x08(sp) @@ -108,3 +103,5 @@ weak_alias (_mcount, mcount) ret zero,($at),1 END(_mcount) + +weak_alias (_mcount, mcount) diff --git a/sysdeps/alpha/bb_init_func.S b/sysdeps/alpha/bb_init_func.S index 49be0b2bfe..dcd4eac231 100644 --- a/sysdeps/alpha/bb_init_func.S +++ b/sysdeps/alpha/bb_init_func.S @@ -40,10 +40,10 @@ ENTRY(__bb_init_func) ldq t0, ZERO_WORD(a0) /* t0 <- blocks->zero_word */ beq t0, init /* not initialized yet -> */ ret - + END(__bb_init_func) -.ent init + .ent init init: .frame sp, 0x38, ra, 0 subq sp, 0x38, sp @@ -61,8 +61,8 @@ init: stq t0, ZERO_WORD(a0) /* blocks->zero_word = 1 */ stq t2, NEXT(a0) /* blocks->next = __bb_head */ stq a0, 0(t1) - bne t2, leave - beq t3, leave /* t3 == GMON_PROF_ON? yes -> */ + bne t2, $leave + beq t3, $leave /* t3 == GMON_PROF_ON? yes -> */ /* also need to initialize destructor: */ stq ra, 0x00(sp) @@ -81,8 +81,8 @@ init: ldq a4, 0x20(sp) ldq a5, 0x28(sp) -leave: ldq pv, 0x30(sp) +$leave: ldq pv, 0x30(sp) addq sp, 0x38, sp ret -.end init + .end init diff --git a/sysdeps/alpha/bsd-_setjmp.S b/sysdeps/alpha/bsd-_setjmp.S index da60442c23..a7bdbb5a61 100644 --- a/sysdeps/alpha/bsd-_setjmp.S +++ b/sysdeps/alpha/bsd-_setjmp.S @@ -1,5 +1,5 @@ /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Alpha version. -Copyright (C) 1994 Free Software Foundation, Inc. +Copyright (C) 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,7 +24,8 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> ENTRY(_setjmp) - lda $27, __sigsetjmp /* Load address to jump to. */ + ldgp $29,0($27) + .prologue 1 bis $31, $31, $17 /* Pass a second argument of zero. */ - jmp $31, ($27), __sigsetjmp /* Call __sigsetjmp. */ + jmp $31, __sigsetjmp /* Call __sigsetjmp. */ END(_setjmp) diff --git a/sysdeps/alpha/bsd-setjmp.S b/sysdeps/alpha/bsd-setjmp.S index fc73815a84..c0ed691f40 100644 --- a/sysdeps/alpha/bsd-setjmp.S +++ b/sysdeps/alpha/bsd-setjmp.S @@ -1,5 +1,5 @@ /* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. Alpha version. -Copyright (C) 1994 Free Software Foundation, Inc. +Copyright (C) 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,7 +24,8 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> ENTRY(setjmp) - lda $27, __sigsetjmp /* Load address to jump to. */ + ldgp $29, 0($27) + .prologue 1 bis $31, 1, $17 /* Pass a second argument of one. */ - jmp $31, ($27), __sigsetjmp /* Call __sigsetjmp. */ + jmp $31, __sigsetjmp /* Call __sigsetjmp. */ END(setjmp) diff --git a/sysdeps/alpha/divrem.h b/sysdeps/alpha/divrem.h index 2951335c49..b5b66ae10b 100644 --- a/sysdeps/alpha/divrem.h +++ b/sysdeps/alpha/divrem.h @@ -115,10 +115,9 @@ FUNC_NAME: br AT, 1f 1: ldgp gp, 0(AT) - lda AT, _mcount mov retaddr, ra - jsr AT, (AT), _mcount + jsr AT, _mcount ldq ra, 0x00(sp) ldq pv, 0x08(sp) @@ -137,7 +136,7 @@ FUNC_NAME: stq tmp0,0x18(sp) bis zero,zero,quotient stq tmp1,0x20(sp) - beq divisor,divbyzero + beq divisor,$divbyzero stq sign,0x28(sp) GETSIGN(dividend,divisor,sign) #if SIGNED @@ -170,7 +169,7 @@ FUNC_NAME: ldq arg1,0x00(sp) SETSIGN(sign,result,tmp0) -done: ldq arg2,0x08(sp) +$done: ldq arg2,0x08(sp) ldq mask,0x10(sp) ldq tmp0,0x18(sp) ldq tmp1,0x20(sp) @@ -178,11 +177,11 @@ done: ldq arg2,0x08(sp) lda sp,FRAME_SIZE(sp) ret zero,(retaddr),0 -divbyzero: +$divbyzero: lda a0,GEN_INTDIV(zero) call_pal PAL_gentrap bis zero,zero,result /* if trap returns, return 0 */ ldq arg1,0x00(sp) - br done + br $done END(FUNC_NAME) diff --git a/sysdeps/alpha/ffs.S b/sysdeps/alpha/ffs.S index e4dd87c9f1..b84a51d326 100644 --- a/sysdeps/alpha/ffs.S +++ b/sysdeps/alpha/ffs.S @@ -34,7 +34,7 @@ ENTRY(ffs) negq a0, t0 # due to the srl instruction and a0, t0, t0 clr v0 - beq a0, done + beq a0, $done # now do binary search for first non-zero bit @@ -61,6 +61,6 @@ ENTRY(ffs) addq v0, 1, t3 cmoveq t2, t3, v0 -done: ret +$done: ret END(ffs) diff --git a/sysdeps/alpha/memchr.S b/sysdeps/alpha/memchr.S index 2d21247174..a47ac96e01 100644 --- a/sysdeps/alpha/memchr.S +++ b/sysdeps/alpha/memchr.S @@ -42,7 +42,7 @@ For correctness consider that: ENTRY(memchr) .prologue 0 - beq a2, not_found + beq a2, $not_found ldq_u t0, 0(a0) # load first quadword (a0 may be misaligned) addq a0, a2, t4 and a1, 0xff, a1 # a1 = 00000000000000ch @@ -57,7 +57,7 @@ ENTRY(memchr) extql t0, a0, t6 or t1, a1, a1 # a1 = chchchchchchchch - beq t3, first_quad + beq t3, $first_quad extqh t5, a0, t5 mov a0, v0 @@ -68,15 +68,15 @@ ENTRY(memchr) # in t0. E.g.: # a2 = 6 # t0 = ????c6c5c4c3c2c1 -last_quad: +$last_quad: negq a2, t5 srl t2, t5, t5 # t5 = mask of a2 bits set xor a1, t0, t0 cmpbge zero, t0, t1 and t1, t5, t1 - beq t1, not_found + beq t1, $not_found -found_it: +$found_it: # now, determine which byte matched: negq t1, t2 and t1, t2, t1 @@ -93,20 +93,20 @@ found_it: addq v0, 1, t2 cmoveq t0, t2, v0 -done: ret +$done: ret # # Deal with the case where a2 > 8 bytes remain to be # searched. a0 may not be aligned. # -first_quad: +$first_quad: andnot a0, 0x7, v0 insqh t2, a0, t1 # t1 = 0000ffffffffffff (a0<0:2> ff bytes) xor t0, a1, t0 or t0, t1, t0 # t0 = ====ffffffffffff cmpbge zero, t0, t1 - bne t1, found_it + bne t1, $found_it /* at least one byte left to process */ @@ -119,41 +119,41 @@ first_quad: subq t4, 1, a2 andnot a2, 0x7, a2 cmpult v0, a2, t1 - beq t1, final + beq t1, $final /* at least two quads remain to be accessed */ subq a2, v0, t3 # t3 <- number of quads to be processed in loop and t3, 8, t3 # odd number of quads? - bne t3, odd_quad_count + bne t3, $odd_quad_count /* at least three quads remain to be accessed */ mov t0, t3 # move prefetched value into correct register .align 3 -unrolled_loop: +$unrolled_loop: ldq t0, 8(v0) # prefetch t0 xor a1, t3, t1 cmpbge zero, t1, t1 - bne t1, found_it + bne t1, $found_it addq v0, 8, v0 -odd_quad_count: +$odd_quad_count: xor a1, t0, t1 ldq t3, 8(v0) # prefetch t3 cmpbge zero, t1, t1 - bne t1, found_it + bne t1, $found_it addq v0, 8, v0 cmpult v0, a2, t5 - bne t5, unrolled_loop + bne t5, $unrolled_loop mov t3, t0 # move prefetched value into t0 -final: subq t4, v0, a2 # a2 <- number of bytes left to do - bne a2, last_quad +$final: subq t4, v0, a2 # a2 <- number of bytes left to do + bne a2, $last_quad -not_found: +$not_found: mov zero, v0 ret diff --git a/sysdeps/alpha/setjmp.S b/sysdeps/alpha/setjmp.S index da71a3292a..59929a0234 100644 --- a/sysdeps/alpha/setjmp.S +++ b/sysdeps/alpha/setjmp.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,9 +25,8 @@ ENTRY (__sigsetjmp) ldgp $29, 0($27) .prologue 1 - lda $27, __sigsetjmp_aux /* Load address to jump to. */ bis $30, $30, $18 /* Pass SP as 3rd arg. */ bis $15, $15, $19 /* Pass FP as 4th arg. */ - jmp $31, ($27), __sigsetjmp_aux /* Call __sigsetjmp_aux. */ + jmp $31, __sigsetjmp_aux /* Call __sigsetjmp_aux. */ END(__sigsetjmp) diff --git a/sysdeps/alpha/strlen.S b/sysdeps/alpha/strlen.S index 15c78cde64..9eab707388 100644 --- a/sysdeps/alpha/strlen.S +++ b/sysdeps/alpha/strlen.S @@ -19,52 +19,50 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Finds length of a 0-terminated string. Optimized for the Alpha -architecture: + architecture: - memory accessed as aligned quadwords only - - uses bcmpge to compare 8 bytes in parallel - - does binary search to find 0 byte in last - quadword (HAKMEM needed 12 instructions to - do this instead of the 9 instructions that - binary search needs). */ + - uses cmpbge to compare 8 bytes in parallel + - does binary search to find 0 byte in last quadword (HAKMEM + needed 12 instructions to do this instead of the 8 instructions + that the binary search needs). +*/ #include <sysdep.h> - .set noreorder - .set noat + .set noreorder + .set noat ENTRY(strlen) - ldq_u t0, 0(a0) # load first quadword (a0 may be misaligned) - lda t1, -1(zero) - insqh t1, a0, t1 - andnot a0, 7, v0 - or t1, t0, t0 - cmpbge zero, t0, t1 # t1 <- bitmask: bit i == 1 <==> i-th byte == 0 - bne t1, found - -loop: ldq t0, 8(v0) - addq v0, 8, v0 # addr += 8 - nop # helps dual issue last two insns - cmpbge zero, t0, t1 - beq t1, loop - -found: blbs t1, done # make aligned case fast - negq t1, t2 - and t1, t2, t1 - - and t1, 0x0f, t0 - addq v0, 4, t2 - cmoveq t0, t2, v0 - - and t1, 0x33, t0 - addq v0, 2, t2 - cmoveq t0, t2, v0 - - and t1, 0x55, t0 - addq v0, 1, t2 - cmoveq t0, t2, v0 - -done: subq v0, a0, v0 - ret - - END(strlen) + ldq_u t0, 0(a0) # load first quadword (a0 may be misaligned) + lda t1, -1(zero) + insqh t1, a0, t1 + andnot a0, 7, v0 + or t1, t0, t0 + nop # dual issue the next two on ev5 + cmpbge zero, t0, t1 # t1 <- bitmask: bit i == 1 <==> i-th byte == 0 + bne t1, $found + +$loop: ldq t0, 8(v0) + addq v0, 8, v0 # addr += 8 + cmpbge zero, t0, t1 + beq t1, $loop + +$found: negq t1, t2 # clear all but least set bit + and t1, t2, t1 + + and t1, 0xf0, t2 # binary search for that set bit + and t1, 0xcc, t3 + and t1, 0xaa, t4 + cmovne t2, 4, t2 + cmovne t3, 2, t3 + cmovne t4, 1, t4 + addq t2, t3, t2 + addq v0, t4, v0 + addq v0, t2, v0 + nop # dual issue next two on ev4 and ev5 + + subq v0, a0, v0 + ret + + END(strlen) diff --git a/sysdeps/generic/stpncpy.c b/sysdeps/generic/stpncpy.c index 427ed4b228..c821e95419 100644 --- a/sysdeps/generic/stpncpy.c +++ b/sysdeps/generic/stpncpy.c @@ -57,8 +57,6 @@ DEFUN(__stpncpy, (dest, src, n), char *dest AND CONST char *src AND size_t n) goto last_chars; } n -= dest - s; - if (n == 0) - return dest - 1; goto zero_fill; } @@ -70,16 +68,16 @@ DEFUN(__stpncpy, (dest, src, n), char *dest AND CONST char *src AND size_t n) for (;;) { c = *src++; + --n; *dest++ = c; if (c == '\0') break; - if (--n == 0) + if (n == 0) return dest; } - --n; zero_fill: - while (--n > 0) + while (n-- > 0) dest[n] = '\0'; return dest - 1; diff --git a/sysdeps/generic/ustatbits.h b/sysdeps/generic/ustatbits.h index 57bebdc66f..aa5d493e63 100644 --- a/sysdeps/generic/ustatbits.h +++ b/sysdeps/generic/ustatbits.h @@ -1,5 +1,5 @@ /* Generic declaration of ustat structure. -Copyright (C) 1994 Free Software Foundation, Inc. +Copyright (C) 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,10 +17,14 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +__BEGIN_DECLS + struct ustat { - daddr_t f_tfree; /* total free */ - ino_t f_tinode; /* total inodes free */ + __daddr_t f_tfree; /* total free */ + __ino_t f_tinode; /* total inodes free */ char f_fname[6]; /* filesystem name */ char f_fpack[6]; /* filesystem pack name */ }; + +__END_DECLS diff --git a/sysdeps/i386/fpu_control.h b/sysdeps/i386/fpu_control.h index d72f474eb6..706dea3d6d 100644 --- a/sysdeps/i386/fpu_control.h +++ b/sysdeps/i386/fpu_control.h @@ -19,7 +19,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _FPU_CONTROL_H -#define _FPU_CONTROL_H +#define _FPU_CONTROL_H 1 /* Here is the dirty part. Settup up your 387 through the control word * (cw) register. @@ -80,10 +80,10 @@ Boston, MA 02111-1307, USA. */ /* The fdlibm code requires strict IEEE double precision arithmetic, and no interrupts for exceptions, rounding to nearest. */ -#define _FPU_DEFAULT 0x127f +#define _FPU_DEFAULT 0x137f /* IEEE: same as above, but exceptions */ -#define _FPU_IEEE 0x127f +#define _FPU_IEEE 0x137f /* Type of the control word. */ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 85bab92635..5f6b6b00ca 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -1,5 +1,5 @@ ifeq ($(subdir), misc) -sysdep_routines += sysctl +sysdep_routines += sysctl clone sysdep_headers += sys/mount.h sys/sysinfo.h sys/acct.h sys/sysctl.h \ sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \ diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S index 26bf97f2bd..ad5f021e99 100644 --- a/sysdeps/unix/sysv/linux/alpha/brk.S +++ b/sysdeps/unix/sysv/linux/alpha/brk.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@zen.org). The GNU C Library is free software; you can redistribute it and/or @@ -23,7 +23,16 @@ break value (instead of the new, requested one). */ #include <sysdep.h> #include <errnos.h> +#ifdef PIC +.section .bss + .align 3 + .globl __curbrk +__curbrk: .skip 8 + .type __curbrk,@object + .size __curbrk,8 +#else .comm __curbrk, 8 +#endif .text LEAF(__brk, 0) diff --git a/sysdeps/unix/sysv/linux/alpha/ioperm.c b/sysdeps/unix/sysv/linux/alpha/ioperm.c index cee5f482bb..56331cb596 100644 --- a/sysdeps/unix/sysv/linux/alpha/ioperm.c +++ b/sysdeps/unix/sysv/linux/alpha/ioperm.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger. @@ -92,6 +92,7 @@ static struct platform { {"EB66", IOSYS_APECS, APECS_DENSE_MEM}, /* LCA same as APECS */ {"EB66P", IOSYS_APECS, APECS_DENSE_MEM}, /* LCA same as APECS */ {"Jensen", IOSYS_JENSEN, JENSEN_MEM}, + {"Mikasa", IOSYS_APECS, APECS_DENSE_MEM}, {"Mustang", IOSYS_APECS, APECS_DENSE_MEM}, {"Noname", IOSYS_APECS, APECS_DENSE_MEM}, /* LCA same as APECS */ }; diff --git a/sysdeps/unix/sysv/linux/gnu/types.h b/sysdeps/unix/sysv/linux/gnu/types.h index 0bc072b092..89b815dd60 100644 --- a/sysdeps/unix/sysv/linux/gnu/types.h +++ b/sysdeps/unix/sysv/linux/gnu/types.h @@ -65,4 +65,8 @@ typedef long int __swblk_t; /* Type of a swap block maybe? */ typedef __kernel_fd_set __fd_set; typedef __kernel_clock_t __clock_t; +/* Linus doesn't want __kernel_fd_mask in <linux/posix_types.h> since + XPG4 seems to require `unsigned long'. */ +typedef unsigned long __fd_mask; + #endif /* gnu/types.h */ |