~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/rtl/emx/sysheap.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
    This file is part of the Free Pascal run time library.
 
3
    Copyright (c) 2001 by Free Pascal development team
 
4
 
 
5
    This file implements all the base types and limits required
 
6
    for a minimal POSIX compliant subset required to port the compiler
 
7
    to a new OS.
 
8
 
 
9
    See the file COPYING.FPC, included in this distribution,
 
10
    for details about the copyright.
 
11
 
 
12
    This program is distributed in the hope that it will be useful,
 
13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
15
 
 
16
 **********************************************************************}
 
17
 
 
18
 
 
19
{****************************************************************************
 
20
 
 
21
                    Heap management releated routines.
 
22
 
 
23
****************************************************************************}
 
24
 
 
25
 
 
26
{ this function allows to extend the heap by calling
 
27
syscall $7f00 resizes the brk area}
 
28
 
 
29
function sbrk(size:longint):pointer;
 
30
{$IFDEF DUMPGROW}
 
31
var
 
32
  L: longword;
 
33
begin
 
34
  WriteLn ('Trying to grow heap by ', Size);
 
35
{$IFDEF CONTHEAP}
 
36
  WriteLn ('BrkLimit is ', BrkLimit);
 
37
{$ENDIF CONTHEAP}
 
38
  asm
 
39
    movl size,%edx
 
40
    movw $0x7f00,%ax
 
41
    call syscall     { result directly in EAX }
 
42
    inc %eax         { Result in EAX, -1 = error (has to be transformed to 0) }
 
43
    jz .LSbrk_End
 
44
    dec %eax         { No error - back to previous value }
 
45
.LSbrk_End:
 
46
    mov  %eax,L
 
47
  end ['eax', 'edx'];
 
48
  WriteLn ('New heap at ', L);
 
49
  Sbrk := pointer (L);
 
50
end;
 
51
{$ELSE DUMPGROW}
 
52
                                     assembler;
 
53
asm
 
54
{$IFDEF REGCALL}
 
55
    movl %eax,%edx
 
56
{$ELSE REGCALL}
 
57
    movl size,%edx
 
58
{$ENDIF REGCALL}
 
59
    movw $0x7f00,%ax
 
60
    call syscall
 
61
    inc %eax         { Result in EAX, -1 = error (has to be transformed to 0) }
 
62
    jz .LSbrk_End
 
63
    dec %eax         { No error - back to previous value }
 
64
.LSbrk_End:
 
65
end {['eax', 'edx']};
 
66
{$ENDIF DUMPGROW}
 
67
 
 
68
function SysOSAlloc (Size: ptrint): pointer;
 
69
begin
 
70
 SysOSAlloc := Sbrk (Size);
 
71
end;
 
72
 
 
73
{.$define HAS_SYSOSFREE}
 
74
 
 
75
procedure SysOSFree (P: pointer; Size: ptrint);
 
76
begin
 
77
end;
 
78
 
 
79
 
 
80