]>
Commit | Line | Data |
---|---|---|
cfc91acd | 1 | /* brk system call for Linux. PowerPC64 version. |
a334319f | 2 | Copyright (C) 1995,96,97,99, 2000, 2002 Free Software Foundation, Inc. |
cfc91acd RM |
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 | |
a334319f UD |
17 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
18 | 02111-1307 USA. */ | |
cfc91acd RM |
19 | |
20 | #include <sysdep.h> | |
21 | #define _ERRNO_H 1 | |
22 | #include <bits/errno.h> | |
23 | #include <bp-sym.h> | |
24 | #include <bp-asm.h> | |
25 | ||
26 | .comm __curbrk,8,8 | |
2ce1a10f UD |
27 | .section ".toc","aw" |
28 | .LC__curbrk: | |
29 | .tc __curbrk[TC],__curbrk | |
cfc91acd RM |
30 | .section ".text" |
31 | ENTRY (BP_SYM (__brk)) | |
865d953f | 32 | CALL_MCOUNT 1 |
cfc91acd RM |
33 | DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em. */ |
34 | ||
35 | stdu r1,-64(r1) | |
36 | std r3,48(r1) | |
37 | DO_CALL(SYS_ify(brk)) | |
38 | ld r6,48(r1) | |
2ce1a10f | 39 | ld r5,.LC__curbrk@toc(r2) |
cfc91acd RM |
40 | std r3,0(r5) |
41 | cmpld r6,r3 | |
42 | addi r1,r1,64 | |
43 | li r3,0 | |
44 | blelr+ | |
45 | li r3,ENOMEM | |
46 | b JUMPTARGET(__syscall_error) | |
47 | END (BP_SYM (__brk)) | |
48 | ||
49 | weak_alias (BP_SYM (__brk), BP_SYM (brk)) |