summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/macppc/stand/alloc.c8
-rw-r--r--sys/arch/macppc/stand/conf.c4
-rw-r--r--sys/arch/sparc64/stand/ofwboot/alloc.c10
-rw-r--r--sys/arch/sparc64/stand/ofwboot/vers.c2
4 files changed, 16 insertions, 8 deletions
diff --git a/sys/arch/macppc/stand/alloc.c b/sys/arch/macppc/stand/alloc.c
index 62afba2976a..787c7607fb1 100644
--- a/sys/arch/macppc/stand/alloc.c
+++ b/sys/arch/macppc/stand/alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alloc.c,v 1.11 2019/09/02 23:40:29 kettenis Exp $ */
+/* $OpenBSD: alloc.c,v 1.12 2024/11/05 14:49:52 miod Exp $ */
/* $NetBSD: alloc.c,v 1.1 1997/04/16 20:29:16 thorpej Exp $ */
/*
@@ -95,7 +95,9 @@ void *
alloc(unsigned size)
{
struct ml *f, *bestf = NULL;
+#ifndef ALLOC_FIRST_FIT
unsigned bestsize = 0xffffffff; /* greater than any real size */
+#endif
char *help;
int failed;
@@ -132,7 +134,7 @@ alloc(unsigned size)
}
/* no match in freelist if bestsize unchanged */
- failed = (bestsize == 0xffffffff);
+ failed = (bestsize == 0xffffffff || bestsize >= size * 2);
#endif
if (failed) { /* nothing found */
@@ -157,7 +159,9 @@ alloc(unsigned size)
/* we take the best fit */
f = bestf;
+#ifndef ALLOC_FIRST_FIT
found:
+#endif
/* remove from freelist */
LIST_REMOVE(f, list);
help = (char *)f;
diff --git a/sys/arch/macppc/stand/conf.c b/sys/arch/macppc/stand/conf.c
index c5770867a8f..aca3b5e23cf 100644
--- a/sys/arch/macppc/stand/conf.c
+++ b/sys/arch/macppc/stand/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.15 2024/11/01 17:16:04 gkoehler Exp $ */
+/* $OpenBSD: conf.c,v 1.16 2024/11/05 14:49:52 miod Exp $ */
/*
* Copyright (c) 2007 Dale Rahn <drahn@openbsd.org>
*
@@ -21,7 +21,7 @@
#include <lib/libsa/stand.h>
-const char version[] = "1.12";
+const char version[] = "1.13";
extern int debug;
void ofc_probe(struct consdev *);
diff --git a/sys/arch/sparc64/stand/ofwboot/alloc.c b/sys/arch/sparc64/stand/ofwboot/alloc.c
index 7c999b9711d..c20643c3acb 100644
--- a/sys/arch/sparc64/stand/ofwboot/alloc.c
+++ b/sys/arch/sparc64/stand/ofwboot/alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alloc.c,v 1.9 2016/03/14 23:08:05 krw Exp $ */
+/* $OpenBSD: alloc.c,v 1.10 2024/11/05 14:49:52 miod Exp $ */
/* $NetBSD: alloc.c,v 1.1 2000/08/20 14:58:37 mrg Exp $ */
/*
@@ -94,8 +94,10 @@ LIST_HEAD(, ml) allocatedlist = LIST_HEAD_INITIALIZER(allocatedlist);
void *
alloc(unsigned size)
{
- struct ml *f, *bestf;
+ struct ml *f, *bestf = NULL;
+#ifndef ALLOC_FIRST_FIT
unsigned bestsize = 0xffffffff; /* greater than any real size */
+#endif
char *help;
int failed;
@@ -132,7 +134,7 @@ alloc(unsigned size)
}
/* no match in freelist if bestsize unchanged */
- failed = (bestsize == 0xffffffff);
+ failed = (bestsize == 0xffffffff || bestsize >= size * 2);
#endif
if (failed) { /* nothing found */
@@ -157,7 +159,9 @@ alloc(unsigned size)
/* we take the best fit */
f = bestf;
+#ifndef ALLOC_FIRST_FIT
found:
+#endif
/* remove from freelist */
LIST_REMOVE(f, list);
help = (char *)f;
diff --git a/sys/arch/sparc64/stand/ofwboot/vers.c b/sys/arch/sparc64/stand/ofwboot/vers.c
index a5f408eeb10..0137fbc74dd 100644
--- a/sys/arch/sparc64/stand/ofwboot/vers.c
+++ b/sys/arch/sparc64/stand/ofwboot/vers.c
@@ -1 +1 @@
-const char version[] = "1.28";
+const char version[] = "1.29";