Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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