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

« back to all changes in this revision

Viewing changes to rtl/bsd/i386/syscall.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
 
    $Id: syscall.inc,v 1.11 2004/05/28 21:40:28 marco Exp $
3
 
    Copyright (c) 2002 by Marco van de Voort
4
 
 
5
 
    Syscall functions for i386 *BSD.
6
 
 
7
 
    This program is free software; you can redistribute it and/or modify
8
 
    it under the terms of the GNU General Public License as published by
9
 
    the Free Software Foundation; either version 2 of the License, or
10
 
    (at your option) any later version.
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.  See the
15
 
    GNU General Public License for more details.
16
 
 
17
 
    You should have received a copy of the GNU General Public License
18
 
    along with this program; if not, write to the Free Software
19
 
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
 
 
21
 
 ****************************************************************************
22
 
 
23
 
These functions are the same over all three BSDs, except that some have a
24
 
32-bit Errno, and some a 16-bit}
25
 
 
26
 
{$ifdef FPC_USE_SYSCALL}
27
 
 
28
 
{$ifdef NetBSD}
29
 
 {$UNDEF ErrnoWord}
30
 
{$endif}
31
 
{$ifdef FreeBSD}
32
 
 {$DEFINE ErrnoWord}
33
 
{$endif}
34
 
 
35
 
procedure actualsyscall; assembler; {inline requires a dummy push IIRC}
36
 
    asm
37
 
         int $0x80
38
 
         jb .LErrorcode
39
 
         ret
40
 
.LErrorcode:
41
 
{$ifdef VER1_0}
42
 
         {$ifdef ErrnoWord}
43
 
          movw  %ax,Errno
44
 
         {$else}
45
 
          movl %eax,Errno
46
 
         {$endif}
47
 
{$else}
48
 
{$ifdef REGCALL}
49
 
  movl  fpc_threadvar_relocate_proc,%ecx
50
 
  testl %ecx,%ecx
51
 
  jne   .LThread
52
 
  movl  %eax,Errno+4
53
 
  jmp   .LNoThread
54
 
.LThread:
55
 
  movl  %eax,%ebx
56
 
  movl Errno,%eax
57
 
  call  *%ecx
58
 
  movl  %ebx,(%eax)
59
 
.LNoThread:
60
 
{$else}
61
 
  movl  %eax,%edx
62
 
  movl  fpc_threadvar_relocate_proc,%eax
63
 
  testl %eax,%eax
64
 
  jne   .LThread
65
 
  movl  %edx,Errno+4
66
 
  jmp   .LNoThread
67
 
.LThread:
68
 
  pushl %edx
69
 
  pushl Errno
70
 
  call  *%eax
71
 
  popl  %edx
72
 
  {$ifdef ErrnoWord}
73
 
   movw  %dx,(%eax)
74
 
  {$else}
75
 
   movl %edx,(%eax)
76
 
  {$endif}
77
 
.LNoThread:
78
 
{$endif REGCALL}
79
 
{$endif}
80
 
  mov $-1,%eax
81
 
end;
82
 
 
83
 
function FpSysCall(sysnr:TSysParam):TSysResult; {$ifndef VER1_0} oldfpccall;{$endif} assembler; [public,alias:'FPC_DOSYS0'];
84
 
 
85
 
asm
86
 
  movl  sysnr,%eax
87
 
  call  actualsyscall
88
 
end;
89
 
 
90
 
function FpSysCall(sysnr,param1:TSysParam):TSysResult; {$ifndef VER1_0} oldfpccall;{$endif} assembler;[public,alias:'FPC_DOSYS1'];
91
 
 
92
 
 asm
93
 
  movl  sysnr,%eax
94
 
  pushl Param1
95
 
  call  actualsyscall
96
 
  addl  $4,%esp
97
 
 end;
98
 
 
99
 
function FpSysCall(sysnr,param1:integer):TSysResult; {$ifndef VER1_0} oldfpccall;{$endif}assembler;[public,alias:'FPC_DOSYS1w'];
100
 
 
101
 
 asm
102
 
  movl  sysnr,%eax
103
 
  pushw Param1
104
 
  call  actualsyscall
105
 
  add   $2,%esp
106
 
 end;
107
 
 
108
 
function FpSysCall(sysnr,param1,param2:TSysParam):TSysResult; {$ifndef VER1_0} oldfpccall;{$endif}assembler; [public,alias:'FPC_DOSYS2'];
109
 
 
110
 
 asm
111
 
   movl  sysnr,%eax
112
 
   pushl param2
113
 
   pushl Param1
114
 
   call  actualsyscall
115
 
   addl  $8,%esp
116
 
 end;
117
 
 
118
 
function FpSysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; {$ifndef VER1_0} oldfpccall;{$endif}assembler;[public,alias:'FPC_DOSYS3'];
119
 
 
120
 
 asm
121
 
   movl  sysnr,%eax
122
 
   pushl param3
123
 
   pushl param2
124
 
   pushl Param1
125
 
   call  actualsyscall
126
 
   addl  $12,%esp
127
 
end;
128
 
 
129
 
function FpSysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult;{$ifndef VER1_0} oldfpccall;{$endif} assembler;[public,alias:'FPC_DOSYS4'];
130
 
 
131
 
asm
132
 
   movl  sysnr,%eax
133
 
   pushl param4
134
 
   pushl param3
135
 
   pushl param2
136
 
   pushl Param1
137
 
   call  actualsyscall
138
 
   addl  $16,%esp
139
 
end;
140
 
 
141
 
 
142
 
function FpSysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResult;{$ifndef VER1_0} oldfpccall;{$endif}  assembler;[public,alias:'FPC_DOSYS5'];
143
 
 
144
 
 asm
145
 
   movl  sysnr,%eax
146
 
   pushl param5
147
 
   pushl param4
148
 
   pushl param3
149
 
   pushl param2
150
 
   pushl Param1
151
 
   call  actualsyscall
152
 
   addl  $20,%esp
153
 
end;
154
 
 
155
 
function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):int64; {$ifndef VER1_0} oldfpccall;{$endif} assembler;[public,alias:'FPC_DOSYS6'];
156
 
 
157
 
asm
158
 
   movl  sysnr,%eax
159
 
   pushl param6
160
 
   pushl param5
161
 
   pushl param4
162
 
   pushl param3
163
 
   pushl param2
164
 
   pushl Param1
165
 
   call  actualsyscall
166
 
   addl  $24,%esp
167
 
end;
168
 
 
169
 
function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6,param7:TSysParam):int64;{$ifndef VER1_0} oldfpccall;{$endif}  assembler; [public,alias:'FPC_DOSYS7'];
170
 
 
171
 
asm
172
 
   movl  sysnr,%eax
173
 
   pushl param7
174
 
   pushl param6
175
 
   pushl param5
176
 
   pushl param4
177
 
   pushl param3
178
 
   pushl param2
179
 
   pushl Param1
180
 
   call  actualsyscall
181
 
   addl  $28,%esp
182
 
end;
183
 
 
184
 
{$endif}
185
 
{
186
 
  $Log: syscall.inc,v $
187
 
  Revision 1.11  2004/05/28 21:40:28  marco
188
 
   * threadvar errno fix
189
 
 
190
 
  Revision 1.10  2003/12/30 12:26:21  marco
191
 
   * FPC_USE_LIBC
192
 
 
193
 
 
194
 
}