- Andries Brouwer: final isofs pieces.
[davej-history.git] / arch / alpha / lib / ev6-strncpy.S
blob053146bf5c040979e03deea1a1afd5840f1191e2
1 /*
2  * arch/alpha/lib/strncpy.S
3  * Contributed by Richard Henderson (rth@tamu.edu)
4  *
5  * Copy no more than COUNT bytes of the null-terminated string from
6  * SRC to DST.  If SRC does not cover all of COUNT, the balance is
7  * zeroed.
8  *
9  * Or, rather, if the kernel cared about that weird ANSI quirk.  This
10  * version has cropped that bit o' nastiness as well as assuming that
11  * __stxncpy is in range of a branch.
12  */
14         .set noat
15         .set noreorder
17         .text
19         .align 4
20         .globl strncpy
21         .ent strncpy
22 strncpy:
23         .frame $30, 0, $26
24         .prologue 0
26         mov     $16, $0         # set return value now
27         beq     $18, 0f
28         mov     $26, $23        # set return address
29         br      __stxncpy       # do the work of the copy
31 0:      ret
32         nop
33         nop
34         nop
36         .end strncpy