|
2
|
1 ##============================================================================= |
|
|
2 ## |
|
|
3 ## linux.S |
|
|
4 ## |
|
|
5 ## Linux setup |
|
|
6 ## |
|
|
7 ##============================================================================= |
|
|
8 #####COPYRIGHTBEGIN#### |
|
|
9 # |
|
|
10 # ------------------------------------------- |
|
|
11 # The contents of this file are subject to the Cygnus eCos Public License |
|
|
12 # Version 1.0 (the "License"); you may not use this file except in |
|
|
13 # compliance with the License. You may obtain a copy of the License at |
|
|
14 # http://sourceware.cygnus.com/ecos |
|
|
15 # |
|
|
16 # Software distributed under the License is distributed on an "AS IS" |
|
|
17 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
18 # License for the specific language governing rights and limitations under |
|
|
19 # the License. |
|
|
20 # |
|
|
21 # The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
22 # September 30, 1998. |
|
|
23 # |
|
|
24 # The Initial Developer of the Original Code is Cygnus. Portions created |
|
|
25 # by Cygnus are Copyright (C) 1998, 1999 Cygnus Solutions. |
|
|
26 # All Rights Reserved. |
|
|
27 # ------------------------------------------- |
|
|
28 # |
|
|
29 #####COPYRIGHTEND#### |
|
|
30 ##============================================================================= |
|
|
31 #######DESCRIPTIONBEGIN#### |
|
|
32 ## |
|
|
33 ## Author(s): jskov |
|
|
34 ## Contributors:jskov |
|
|
35 ## Date: 1999-03-11 |
|
|
36 ## Purpose: Linux setup |
|
|
37 ## Description: This file contains any code needed to initialize the |
|
|
38 ## CPU on an i386/Linux synthetic target. |
|
|
39 ## |
|
|
40 ######DESCRIPTIONEND#### |
|
|
41 ## |
|
|
42 ##============================================================================= |
|
|
43 |
|
|
44 .globl cyg_hal_hardware_init |
|
|
45 cyg_hal_hardware_init: |
|
|
46 push %ebp |
|
|
47 mov %esp,%ebp |
|
|
48 sub $0x4,%esp |
|
|
49 |
|
|
50 ## FIXME: The below turns out to have no effect. At some point |
|
|
51 ## before the cause_fpe test of signal2.c gets executes, the |
|
|
52 ## flags have been reverted. Don't know what's causing it. Are |
|
|
53 ## magic Linux calls required perhaps? |
|
|
54 ## Maybe it is because a segv happens before the FPE.. |
|
|
55 |
|
|
56 ## Enable floating point exceptions. Bit mask: |
|
|
57 ## 1 - invalid operation |
|
|
58 ## 2 - denormalized operand |
|
|
59 ## 4 - zero divide |
|
|
60 ## 8 - overflow |
|
|
61 ## 16 - underflow |
|
|
62 ## 32 - precision |
|
|
63 fstcw -4(%ebp) |
|
|
64 movl -4(%ebp),%eax |
|
|
65 andb $(~0x04),%al |
|
|
66 movl %eax,-4(%ebp) |
|
|
67 fldcw -4(%ebp) |
|
|
68 |
|
|
69 mov %ebp,%esp |
|
|
70 pop %ebp |
|
|
71 ret |
|
|
72 |
|
|
73 #------------------------------------------------------------------------------ |
|
|
74 # end of linux.S |