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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [sysdeps/] [linux/] [powerpc/] [brk.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/* brk system call for Linux/ppc.
2
   Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
3
   This file is part of the GNU C Library.
4
 
5
   The GNU C Library is free software; you can redistribute it and/or
6
   modify it under the terms of the GNU Lesser General Public
7
   License as published by the Free Software Foundation; either
8
   version 2.1 of the License, or (at your option) any later version.
9
 
10
   The GNU C Library is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Lesser General Public License for more details.
14
 
15
   You should have received a copy of the GNU Lesser General Public
16
   License along with the GNU C Library; if not, write to the Free
17
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
   02111-1307 USA.  */
19
 
20
#include "ppc_asm.h"
21
#define _ERRNO_H        1
22
#include 
23
#include 
24
 
25
#ifdef __NR_brk
26
        .comm   ___brk_addr,4,4
27
        .section ".text"
28
.globl      __brk;
29
.type      __brk, @function;
30
.align  2;
31
 
32
__brk:
33
        stwu    r1,-16(r1)
34
        stw     r3,8(r1)
35
        li 0, __NR_brk;
36
        sc
37
        lwz     r6,8(r1)
38
#ifdef __PIC__
39
        mflr    r4
40
        bl      _GLOBAL_OFFSET_TABLE_@local-4
41
        mflr    r5
42
        lwz     r5,___brk_addr@got(r5)
43
        mtlr    r4
44
        stw     r3,0(r5)
45
#else
46
        lis     r4,___brk_addr@ha
47
        stw     r3,___brk_addr@l(r4)
48
#endif
49
        cmplw   r6,r3
50
        addi    r1,r1,16
51
        li      r3,0
52
        blelr+
53
        li      r3,ENOMEM
54
#ifdef __PIC__
55
        b       __syscall_error@plt
56
#else
57
        b       __syscall_error
58
#endif
59
.size __brk,.-__brk
60
 
61
.weak brk;
62
brk=__brk
63
#endif

powered by: WebSVN 2.1.0

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