瀏覽代碼

[relocate] Remove the even megabyte constraint

iPXE is now capable of operating in odd megabytes of memory, so remove
the obsolete code enforcing an even-megabyte constraint.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 年之前
父節點
當前提交
9cf5170c30
共有 1 個檔案被更改,包括 8 行新增48 行删除
  1. 8
    48
      src/arch/i386/core/relocate.c

+ 8
- 48
src/arch/i386/core/relocate.c 查看文件

32
 #define MAX_ADDR (0xfff00000UL)
32
 #define MAX_ADDR (0xfff00000UL)
33
 
33
 
34
 /**
34
 /**
35
- * Relocate Etherboot
35
+ * Relocate iPXE
36
  *
36
  *
37
  * @v ix86		x86 register dump from prefix
37
  * @v ix86		x86 register dump from prefix
38
  * @ret ix86		x86 registers to return to prefix
38
  * @ret ix86		x86 registers to return to prefix
39
  *
39
  *
40
- * This finds a suitable location for Etherboot near the top of 32-bit
40
+ * This finds a suitable location for iPXE near the top of 32-bit
41
  * address space, and returns the physical address of the new location
41
  * address space, and returns the physical address of the new location
42
  * to the prefix in %edi.
42
  * to the prefix in %edi.
43
  */
43
  */
59
 	      start, end, padded_size, max_align );
59
 	      start, end, padded_size, max_align );
60
 
60
 
61
 	/* Walk through the memory map and find the highest address
61
 	/* Walk through the memory map and find the highest address
62
-	 * below 4GB that etherboot will fit into.  Ensure etherboot
63
-	 * lies entirely within a range with A20=0.  This means that
64
-	 * even if something screws up the state of the A20 line, the
65
-	 * etherboot code is still visible and we have a chance to
66
-	 * diagnose the problem.
62
+	 * below 4GB that iPXE will fit into.
67
 	 */
63
 	 */
68
 	new_end = end;
64
 	new_end = end;
69
 	for ( i = 0 ; i < memmap.count ; i++ ) {
65
 	for ( i = 0 ; i < memmap.count ; i++ ) {
87
 		} else {
83
 		} else {
88
 			r_end = region->end;
84
 			r_end = region->end;
89
 		}
85
 		}
90
-		
91
-		/* Shrink the range down to use only even megabytes
92
-		 * (i.e. A20=0).
93
-		 */
94
-		if ( ( r_end - 1 ) & 0x100000 ) {
95
-			/* If last byte that might be used (r_end-1)
96
-			 * is in an odd megabyte, round down r_end to
97
-			 * the top of the next even megabyte.
98
-			 *
99
-			 * Make sure that we don't accidentally wrap
100
-			 * r_end below 0.
101
-			 */
102
-			if ( r_end >= 1 ) {
103
-				r_end = ( r_end - 1 ) & ~0xfffff;
104
-				DBG ( "...end truncated to %lx "
105
-				      "(avoid ending in odd megabyte)\n",
106
-				      r_end );
107
-			}
108
-		} else if ( ( r_end - size ) & 0x100000 ) {
109
-			/* If the last byte that might be used
110
-			 * (r_end-1) is in an even megabyte, but the
111
-			 * first byte that might be used (r_end-size)
112
-			 * is an odd megabyte, round down to the top
113
-			 * of the next even megabyte.
114
-			 * 
115
-			 * Make sure that we don't accidentally wrap
116
-			 * r_end below 0.
117
-			 */
118
-			if ( r_end >= 0x100000 ) {
119
-				r_end = ( r_end - 0x100000 ) & ~0xfffff;
120
-				DBG ( "...end truncated to %lx "
121
-				      "(avoid starting in odd megabyte)\n",
122
-				      r_end );
123
-			}
124
-		}
125
-
126
 		DBG ( "...usable portion is [%lx,%lx)\n", r_start, r_end );
86
 		DBG ( "...usable portion is [%lx,%lx)\n", r_start, r_end );
127
 
87
 
128
 		/* If we have rounded down r_end below r_ start, skip
88
 		/* If we have rounded down r_end below r_ start, skip
133
 			continue;
93
 			continue;
134
 		}
94
 		}
135
 
95
 
136
-		/* Check that there is enough space to fit in Etherboot */
96
+		/* Check that there is enough space to fit in iPXE */
137
 		if ( ( r_end - r_start ) < size ) {
97
 		if ( ( r_end - r_start ) < size ) {
138
 			DBG ( "...too small (need %lx bytes)\n", size );
98
 			DBG ( "...too small (need %lx bytes)\n", size );
139
 			continue;
99
 			continue;
140
 		}
100
 		}
141
 
101
 
142
-		/* If the start address of the Etherboot we would
102
+		/* If the start address of the iPXE we would
143
 		 * place in this block is higher than the end address
103
 		 * place in this block is higher than the end address
144
 		 * of the current highest block, use this block.
104
 		 * of the current highest block, use this block.
145
 		 *
105
 		 *
146
 		 * Note that this avoids overlaps with the current
106
 		 * Note that this avoids overlaps with the current
147
-		 * Etherboot, as well as choosing the highest of all
148
-		 * viable blocks.
107
+		 * iPXE, as well as choosing the highest of all viable
108
+		 * blocks.
149
 		 */
109
 		 */
150
 		if ( ( r_end - size ) > new_end ) {
110
 		if ( ( r_end - size ) > new_end ) {
151
 			new_end = r_end;
111
 			new_end = r_end;
153
 		}
113
 		}
154
 	}
114
 	}
155
 
115
 
156
-	/* Calculate new location of Etherboot, and align it to the
116
+	/* Calculate new location of iPXE, and align it to the
157
 	 * required alignemnt.
117
 	 * required alignemnt.
158
 	 */
118
 	 */
159
 	new_start = new_end - padded_size;
119
 	new_start = new_end - padded_size;

Loading…
取消
儲存