Subversion Repositories Kolibri OS

Rev

Rev 1693 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1693 serge 1
 
2
.global ___thread_startup
3
4
 
5
6
 
1908 serge 7
8
 
1693 serge 9
_create_thread:
10
#.thr_proc    equ esp+8
11
#.param       equ esp+12
12
#.stack_size  equ esp+16
13
14
 
15
16
 
17
           movl  $12, %ebx
18
           movl  16(%esp), %ecx    #[.stack_size]
19
           addl  $4095, %ecx
20
           andl  $-4096, %ecx
21
           movl  %ecx, 16(%esp)    #save stack size
22
           int   $0x40
23
           testl %eax, %eax
24
           jz    1f
25
26
 
27
28
 
29
           mov  %ebx, 4(%edx)
30
31
 
32
           movl  %ebx, 8(%edx)
33
34
 
35
           movl  %eax, 12(%edx)    #stack low limit
36
           movl  %ecx, 16(%edx)    #stack high limit
37
38
 
39
           movl  $1,  %ebx
40
           lea   ___thread_startup , %ecx
41
           int   $0x40
42
           popl  %ebx
43
           ret
44
1:
45
           notl %eax
46
           popl %ebx
47
           ret
48