Replace FSF snail mail address by URL.
[glibc.git] / sysdeps / unix / sysv / linux / alpha / utimes.S
blob18eb136742fb90afba5117d3a010cffe5ae1b794
1 /* Copyright (C) 1998, 2003, 2006, 2012 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library.  If not, see
16    <http://www.gnu.org/licenses/>.  */
18 #include <sysdep.h>
19 #define _ERRNO_H        1
20 #include <bits/errno.h>
21 #include <kernel-features.h>
23 .text
25 #if defined PIC && defined DO_VERSIONING
26 #define UTIMES  __utimes_tv64
27 #else
28 #define UTIMES  __utimes
29 #endif
31 #if defined __ASSUME_TIMEVAL64
32 PSEUDO(UTIMES, utimes, 2)
33         ret
34 PSEUDO_END(UTIMES)
35 #else
36 /* The problem here is that initially we made struct timeval compatible with
37    OSF/1, using int32.  But we defined time_t with uint64, and later found
38    that POSIX requires tv_sec to be time_t.
40    So now we have to do compatibility stuff.  */
42 /* The variable is shared between all wrappers around signal handling
43    functions which have RT equivalents.  */
44 .comm __libc_missing_axp_tv64, 4
46 LEAF(UTIMES, 16)
47         ldgp    gp, 0(pv)
48         subq    sp, 16, sp
49 #ifdef PROF
50         .set noat
51         lda     AT, _mcount
52         jsr     AT, (AT), _mcount
53         .set at
54 #endif
55         .prologue 1
57         ldl     t0, __libc_missing_axp_tv64
59         /* Save arguments in case we do need to fall back.  */
60         stq     a0, 0(sp)
61         stq     a1, 8(sp)
63         bne     t0, $do32
65         ldi     v0, SYS_ify(utimes)
66         callsys
67         bne     a3, $err64
69         /* Everything ok.  */
70         addq    sp, 16, sp
71         ret
73         /* If we didn't get ENOSYS, it is a real error.  */
74         .align 3
75 $err64: cmpeq   v0, ENOSYS, t0
76         beq     t0, $error
77         stl     t0, __libc_missing_axp_tv64
79         /* Recover the saved arguments.  */
80         ldq     a1, 8(sp)
81         ldq     a0, 0(sp)
83         .align 3
84 $do32:
85         /* Conditionally bounce values down.  */
86         beq     a1, 1f
87         ldq     t0, 0(a1)
88         ldq     t1, 8(a1)
89         ldq     t2, 16(a1)
90         ldq     t3, 24(a1)
91         stl     t0, 0(sp)
92         stl     t1, 4(sp)
93         stl     t2, 8(sp)
94         stl     t3, 12(sp)
95         mov     sp, a1
97 1:      ldi     v0, SYS_ify(osf_utimes)
98         callsys
99         bne     a3, $error
101         addq    sp, 16, sp
102         ret
104         .align 3
105 $error:
106         addq    sp, 16, sp
107         SYSCALL_ERROR_HANDLER
109 END(UTIMES)
110 #endif /* __ASSUME_TIMEVAL64 */
112 #if defined PIC && defined DO_VERSIONING
113 default_symbol_version (__utimes_tv64, __utimes, GLIBC_2.1)
115 /* It seems to me to be a misfeature of the assembler that we can only
116    have one version-alias per symbol.  So create an alias ourselves.
117    The 'p' is for 'public'.  *Shrug*  */
118 strong_alias (__utimes_tv64, __utimes_tv64p)
119 default_symbol_version (__utimes_tv64p, utimes, GLIBC_2.1)
120 #else
121 weak_alias (__utimes, utimes)
122 #endif