OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [s390x/] [lib/] [strncpy.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 *  arch/s390/kernel/strncpy.S
3
 *    S390 strncpy routine
4
 *
5
 *  S390 version
6
 *    Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
7
 *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
8
 */
9
 
10
/*
11
 * R2 = address of destination
12
 * R3 = address of source string
13
 * R4 = max number of bytes to copy
14
 */
15
        .globl   strncpy
16
strncpy:
17
        LGR     1,2            # don't touch address in R2
18
        LTR     4,4
19
        JZ      strncpy_exit   # 0 bytes -> nothing to do
20
        SGR     0,0
21
strncpy_loop:
22
        ICM     0,1,0(3)       # ICM sets the cc, IC does not
23
        LA      3,1(3)
24
        STC     0,0(1)
25
        LA      1,1(1)
26
        JZ      strncpy_exit   # ICM inserted a 0x00
27
        BRCTG   4,strncpy_loop # R4 -= 1, jump to strncpy_loop if > 0
28
strncpy_exit:
29
        BR      14
30
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.