~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to rtl/linux/i386/syscall.inc

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{
2
 
    $Id: syscall.inc,v 1.18 2005/03/07 08:27:57 florian Exp $
3
2
    This file is part of the Free Pascal run time library.
4
3
    Copyright (c) 1999-2000 by Michael Van Canneyt,
5
4
    member of the Free Pascal development team.
19
18
 
20
19
{$ASMMODE ATT}
21
20
 
22
 
function FpSysCall(sysnr:TSysParam):TSysResult; assembler; {$ifndef VER1_0} oldfpccall; {$endif}[public,alias:'FPC_SYSCALL0'];
 
21
function FpSysCall(sysnr:TSysParam):TSysResult; assembler; oldfpccall;[public,alias:'FPC_SYSCALL0'];
23
22
 
24
23
asm
25
24
{ load the registers... }
28
27
  cmpl  $-4095,%eax
29
28
  jb   .LSyscOK
30
29
  negl  %eax
31
 
{$ifdef VER1_0}
32
 
  movl  %eax,Errno
33
 
{$else}
34
30
{$ifdef REGCALL}
35
31
  movl  fpc_threadvar_relocate_proc,%ecx
36
32
  testl %ecx,%ecx
37
 
  jne   .LThread
 
33
  jne   .LThread
38
34
  movl  %eax,Errno+4
39
 
  jmp   .LNoThread
40
 
.LThread:
 
35
  jmp   .LNoThread
 
36
.LThread:
41
37
  movl  %eax,%ebx
42
38
  movl Errno,%eax
43
39
  call  *%ecx
44
40
  movl  %ebx,(%eax)
45
 
.LNoThread:
46
 
{$else}
 
41
.LNoThread:
 
42
{$else}
47
43
  movl  %eax,%edx
48
44
  movl  fpc_threadvar_relocate_proc,%eax
49
45
  testl %eax,%eax
50
 
  jne   .LThread
 
46
  jne   .LThread
51
47
  movl  %edx,Errno+4
52
 
  jmp   .LNoThread
53
 
.LThread:
 
48
  jmp   .LNoThread
 
49
.LThread:
54
50
  pushl %edx
55
51
  pushl Errno
56
52
  call  *%eax
57
53
  popl  %edx
58
54
  movl  %edx,(%eax)
59
 
.LNoThread:
 
55
.LNoThread:
60
56
{$endif REGCALL}
61
 
{$endif ver1_0}
62
57
  movl  $-1,%eax
63
58
.LSyscOK:
64
59
end;
65
 
 
66
 
function FpSysCall(sysnr,param1 : TSysParam):TSysResult; assembler; {$ifndef VER1_0} oldfpccall; {$endif}[public,alias:'FPC_SYSCALL1'];
67
 
 
 
60
 
 
61
function FpSysCall(sysnr,param1 : TSysParam):TSysResult; assembler; oldfpccall;[public,alias:'FPC_SYSCALL1'];
 
62
 
68
63
asm
69
64
{ load the registers... }
70
65
  movl sysnr,%eax
73
68
  cmpl  $-4095,%eax
74
69
  jb   .LSyscOK
75
70
  negl  %eax
76
 
{$ifdef VER1_0}
77
 
  movl  %eax,Errno
78
 
{$else}
79
71
{$ifdef REGCALL}
80
72
  movl  fpc_threadvar_relocate_proc,%ecx
81
73
  testl %ecx,%ecx
82
 
  jne   .LThread
 
74
  jne   .LThread
83
75
  movl  %eax,Errno+4
84
 
  jmp   .LNoThread
85
 
.LThread:
 
76
  jmp   .LNoThread
 
77
.LThread:
86
78
  movl  %eax,%ebx
87
79
  movl Errno,%eax
88
80
  call  *%ecx
89
81
  movl  %ebx,(%eax)
90
 
.LNoThread:
91
 
{$else}
 
82
.LNoThread:
 
83
{$else}
92
84
  movl  %eax,%edx
93
85
  movl  fpc_threadvar_relocate_proc,%eax
94
86
  testl %eax,%eax
95
 
  jne   .LThread
 
87
  jne   .LThread
96
88
  movl  %edx,Errno+4
97
 
  jmp   .LNoThread
98
 
.LThread:
 
89
  jmp   .LNoThread
 
90
.LThread:
99
91
  pushl %edx
100
92
  pushl Errno
101
93
  call  *%eax
102
94
  popl  %edx
103
95
  movl  %edx,(%eax)
104
 
.LNoThread:
 
96
.LNoThread:
105
97
{$endif REGCALL}
106
 
{$endif ver1_0}
107
98
  movl  $-1,%eax
108
99
.LSyscOK:
109
100
end;
110
 
 
111
 
function FpSysCall(sysnr,param1,param2 : TSysParam):TSysResult; assembler; {$ifndef VER1_0} oldfpccall; {$endif} [public,alias:'FPC_SYSCALL2'];
112
 
 
 
101
 
 
102
function FpSysCall(sysnr,param1,param2 : TSysParam):TSysResult; assembler; oldfpccall; [public,alias:'FPC_SYSCALL2'];
 
103
 
113
104
asm
114
105
{ load the registers... }
115
106
  movl sysnr,%eax
119
110
  cmpl  $-4095,%eax
120
111
  jb   .LSyscOK
121
112
  negl  %eax
122
 
{$ifdef VER1_0}
123
 
  movl  %eax,Errno
124
 
{$else}
125
113
{$ifdef REGCALL}
126
114
  movl  fpc_threadvar_relocate_proc,%ecx
127
115
  testl %ecx,%ecx
149
137
  movl  %edx,(%eax)
150
138
.LNoThread:
151
139
{$endif REGCALL}
152
 
{$endif ver1_0}
153
140
  movl  $-1,%eax
154
141
.LSyscOK:
155
142
end;
156
143
 
157
 
function FpSysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; assembler; {$ifndef VER1_0} oldfpccall; {$endif} [public,alias:'FPC_SYSCALL3'];
 
144
function FpSysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; assembler; oldfpccall; [public,alias:'FPC_SYSCALL3'];
158
145
 
159
146
asm
160
147
{ load the registers... }
166
153
  cmpl  $-4095,%eax
167
154
  jb   .LSyscOK
168
155
  negl  %eax
169
 
{$ifdef VER1_0}
170
 
  movl  %eax,Errno
171
 
{$else}
172
156
{$ifdef REGCALL}
173
157
  movl  fpc_threadvar_relocate_proc,%ecx
174
158
  testl %ecx,%ecx
196
180
  movl  %edx,(%eax)
197
181
.LNoThread:
198
182
{$endif REGCALL}
199
 
{$endif ver1_0}
200
183
  movl  $-1,%eax
201
184
.LSyscOK:
202
185
end;
203
186
 
204
 
function FpSysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; assembler; {$ifndef VER1_0} oldfpccall; {$endif} [public,alias:'FPC_SYSCALL4'];
 
187
function FpSysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; assembler; oldfpccall; [public,alias:'FPC_SYSCALL4'];
205
188
 
206
189
asm
207
190
{ load the registers... }
214
197
  cmpl  $-4095,%eax
215
198
  jb   .LSyscOK
216
199
  negl  %eax
217
 
{$ifdef VER1_0}
218
 
  movl  %eax,Errno
219
 
{$else}
220
200
{$ifdef REGCALL}
221
201
  movl  fpc_threadvar_relocate_proc,%ecx
222
202
  testl %ecx,%ecx
244
224
  movl  %edx,(%eax)
245
225
.LNoThread:
246
226
{$endif REGCALL}
247
 
{$endif ver1_0}
248
227
  movl  $-1,%eax
249
228
.LSyscOK:
250
229
end;
251
230
 
252
 
function FpSysCall(sysnr,param1,param2,param3,param4,param5 : TSysParam):TSysResult; assembler; {$ifndef VER1_0} oldfpccall; {$endif}[public,alias:'FPC_SYSCALL5'];
 
231
function FpSysCall(sysnr,param1,param2,param3,param4,param5 : TSysParam):TSysResult; assembler; oldfpccall;[public,alias:'FPC_SYSCALL5'];
253
232
 
254
233
asm
255
234
{ load the registers... }
263
242
  cmpl  $-4095,%eax
264
243
  jb   .LSyscOK
265
244
  negl  %eax
266
 
{$ifdef VER1_0}
267
 
  movl  %eax,Errno
268
 
{$else}
269
245
{$ifdef REGCALL}
270
246
  movl  fpc_threadvar_relocate_proc,%ecx
271
247
  testl %ecx,%ecx
293
269
  movl  %edx,(%eax)
294
270
.LNoThread:
295
271
{$endif REGCALL}
296
 
{$endif ver1_0}
297
272
  movl  $-1,%eax
298
273
.LSyscOK:
299
274
end;
300
275
 
301
276
{$ifdef notsupported}
302
277
{ Only 5 params are pushed, so it'll not work as expected (PFV) }
303
 
function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6 : TSysParam):TSysResult; assembler; {$ifndef VER1_0} oldfpccall; {$endif}[public,alias:'FPC_SYSCALL6'];
 
278
function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6 : TSysParam):TSysResult; assembler; oldfpccall;[public,alias:'FPC_SYSCALL6'];
304
279
 
305
280
asm
306
281
{ load the registers... }
314
289
  cmpl  $-4095,%eax
315
290
  jb   .LSyscOK
316
291
  negl  %eax
317
 
{$ifdef VER1_0}
318
 
  movl  %eax,Errno
319
 
{$else}
320
292
{$ifdef REGCALL}
321
293
  movl  fpc_threadvar_relocate_proc,%ecx
322
294
  testl %ecx,%ecx
344
316
  movl  %edx,(%eax)
345
317
.LNoThread:
346
318
{$endif REGCALL}
347
 
{$endif ver1_0}
348
319
  movl  $-1,%eax
349
320
.LSyscOK:
350
321
end;
356
327
{$ENDIF SYS_LINUX}
357
328
 
358
329
 
359
 
{
360
 
  $Log: syscall.inc,v $
361
 
  Revision 1.18  2005/03/07 08:27:57  florian
362
 
    * applied syscall patch from C Western
363
 
 
364
 
  Revision 1.17  2005/02/14 17:13:30  peter
365
 
    * truncate log
366
 
 
367
 
}
368
330