summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-10-15 17:06:36 +0000
committerpeter <peter@FreeBSD.org>1998-10-15 17:06:36 +0000
commitd1bde99276789c2ac3dfe59175fb418cefd1fe2d (patch)
tree12e0a94bbc824dde00aaa8d4e02c16ed32b9e20f /sys/boot/i386
parentd8b0acd7318b41292db67b6e41a90d9ff681fa24 (diff)
downloadFreeBSD-src-d1bde99276789c2ac3dfe59175fb418cefd1fe2d.zip
FreeBSD-src-d1bde99276789c2ac3dfe59175fb418cefd1fe2d.tar.gz
Get the last used address via a more conservative method, don't depend
on the module chain being in increasing address order.
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/libi386/bootinfo.c10
-rw-r--r--sys/boot/i386/libi386/bootinfo32.c10
-rw-r--r--sys/boot/i386/libi386/bootinfo64.c10
3 files changed, 18 insertions, 12 deletions
diff --git a/sys/boot/i386/libi386/bootinfo.c b/sys/boot/i386/libi386/bootinfo.c
index ecd69a2..5b479cd 100644
--- a/sys/boot/i386/libi386/bootinfo.c
+++ b/sys/boot/i386/libi386/bootinfo.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bootinfo.c,v 1.12 1998/10/09 23:24:55 peter Exp $
+ * $Id: bootinfo.c,v 1.13 1998/10/14 05:07:23 peter Exp $
*/
#include <stand.h>
@@ -277,9 +277,11 @@ bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip)
bi.bi_extmem = getextmem();
/* find the last module in the chain */
- for (xp = mod_findmodule(NULL, NULL); xp->m_next != NULL; xp = xp->m_next)
- ;
- addr = xp->m_addr + xp->m_size;
+ addr = 0;
+ for (xp = mod_findmodule(NULL, NULL); xp != NULL; xp = xp->m_next) {
+ if (addr < (xp->m_addr + xp->m_size))
+ addr = xp->m_addr + xp->m_size;
+ }
/* pad to a page boundary */
pad = (u_int)addr & PAGE_MASK;
if (pad != 0) {
diff --git a/sys/boot/i386/libi386/bootinfo32.c b/sys/boot/i386/libi386/bootinfo32.c
index ecd69a2..5b479cd 100644
--- a/sys/boot/i386/libi386/bootinfo32.c
+++ b/sys/boot/i386/libi386/bootinfo32.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bootinfo.c,v 1.12 1998/10/09 23:24:55 peter Exp $
+ * $Id: bootinfo.c,v 1.13 1998/10/14 05:07:23 peter Exp $
*/
#include <stand.h>
@@ -277,9 +277,11 @@ bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip)
bi.bi_extmem = getextmem();
/* find the last module in the chain */
- for (xp = mod_findmodule(NULL, NULL); xp->m_next != NULL; xp = xp->m_next)
- ;
- addr = xp->m_addr + xp->m_size;
+ addr = 0;
+ for (xp = mod_findmodule(NULL, NULL); xp != NULL; xp = xp->m_next) {
+ if (addr < (xp->m_addr + xp->m_size))
+ addr = xp->m_addr + xp->m_size;
+ }
/* pad to a page boundary */
pad = (u_int)addr & PAGE_MASK;
if (pad != 0) {
diff --git a/sys/boot/i386/libi386/bootinfo64.c b/sys/boot/i386/libi386/bootinfo64.c
index ecd69a2..5b479cd 100644
--- a/sys/boot/i386/libi386/bootinfo64.c
+++ b/sys/boot/i386/libi386/bootinfo64.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bootinfo.c,v 1.12 1998/10/09 23:24:55 peter Exp $
+ * $Id: bootinfo.c,v 1.13 1998/10/14 05:07:23 peter Exp $
*/
#include <stand.h>
@@ -277,9 +277,11 @@ bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip)
bi.bi_extmem = getextmem();
/* find the last module in the chain */
- for (xp = mod_findmodule(NULL, NULL); xp->m_next != NULL; xp = xp->m_next)
- ;
- addr = xp->m_addr + xp->m_size;
+ addr = 0;
+ for (xp = mod_findmodule(NULL, NULL); xp != NULL; xp = xp->m_next) {
+ if (addr < (xp->m_addr + xp->m_size))
+ addr = xp->m_addr + xp->m_size;
+ }
/* pad to a page boundary */
pad = (u_int)addr & PAGE_MASK;
if (pad != 0) {
OpenPOWER on IntegriCloud