Changeset 1760
- Timestamp:
- Jan 17, 2005, 2:14:01 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/sys/386/__fork.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1759 r1760 4 4 * fork() 'syscall'. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2005 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * Copyright (c) 2004 nickk 8 8 * … … 30 30 .globl LABEL(__fork) 31 31 32 .data 33 fHaveFXSR: 34 .byte -1 35 32 36 .text 33 37 … … 46 50 subl $512, %esp 47 51 movl $0, 0(%esp) /* paranoia!!!!!!! touch the stack page preventing faults in fxsave. */ 52 53 /* check if the cpu support fxsave. */ 54 l_retest: 55 cmpb $1, fHaveFXSR 56 je l_fxsave 57 cmpb $0, fHaveFXSR 58 jne l_check_cpuid 59 jmp l_fnsave 60 61 /* check cpuid for fxrs - ASSUME all processors have cpuid eax=1! */ 62 l_check_cpuid: 63 push %ebx 64 mov $1, %eax 65 cpuid 66 pop %ebx 67 testl $0x1000000, %edx /* bit 24 - fxsr */ 68 setnz fHaveFXSR 69 jnz l_fxsave 70 71 l_fnsave: 72 fnsave 0(%esp) 73 jmp l_after_save 74 l_fxsave: 48 75 fxsave 0(%esp) 76 l_after_save: 49 77 pushf 50 pushl 51 pushl 52 pushl 78 pushl %ebx 79 pushl %esi 80 pushl %edi 53 81 pushl %ebp 54 82 pushl %gs … … 63 91 */ 64 92 movl %esp, %eax 65 pushl 93 pushl %eax 66 94 pushl $fork_ret 67 call 68 addl 95 call LABEL(__libc_fork) 96 addl $12, %esp /* 12 = 8 + fs:[0]. */ 69 97 popl %fs 70 98 jmp fork_skip_regs … … 83 111 popl %ebx 84 112 popf 85 fxrstor 0(%esp) 113 cmpb $1, fHaveFXSR /* check which way it was saved. */ 114 je l_fxrstor 115 frstor 0(%esp) 116 jmp l_after_restore 117 l_fxrstor: 118 fxrstor 0(%esp) 119 l_after_restore: 86 120 87 121 fork_skip_regs: -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.