summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2018-10-30 14:26:23 +0200
committerDan McDonald <danmcd@joyent.com>2018-10-31 14:48:16 -0400
commit508de9f313d4260d23954085ed866e727901964c (patch)
treef30ed795df1891290aceb641080b1186302bec7d
parentd06952d085d59072d42d77e29ac5669bbdc25d6e (diff)
downloadillumos-joyent-508de9f313d4260d23954085ed866e727901964c.tar.gz
9940 _kobj_printf must use va_list
Reviewed by: John Levon <john.levon@joyent.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/common/krtld/bootrd.c3
-rw-r--r--usr/src/uts/common/krtld/kobj.c3
-rw-r--r--usr/src/uts/common/krtld/kobj_subr.c17
-rw-r--r--usr/src/uts/common/sys/kobj_impl.h4
-rw-r--r--usr/src/uts/i86pc/os/fakebop.c18
-rw-r--r--usr/src/uts/intel/sys/bootconf.h10
-rw-r--r--usr/src/uts/sparc/os/bootops.c8
-rw-r--r--usr/src/uts/sun/sys/bootconf.h3
8 files changed, 45 insertions, 21 deletions
diff --git a/usr/src/uts/common/krtld/bootrd.c b/usr/src/uts/common/krtld/bootrd.c
index 91d9d863be..a79b877e30 100644
--- a/usr/src/uts/common/krtld/bootrd.c
+++ b/usr/src/uts/common/krtld/bootrd.c
@@ -35,6 +35,7 @@
#include <sys/reboot.h>
extern void (*_kobj_printf)(void *, const char *fmt, ...);
+extern void (*_vkobj_printf)(void *, const char *fmt, va_list);
extern int get_weakish_int(int *);
extern struct bootops *ops;
extern struct boot_fs_ops bufs_ops, bhsfs_ops, bbootfs_ops, bcpio_ops;
@@ -244,6 +245,6 @@ kobj_printf(char *fmt, ...)
va_list adx;
va_start(adx, fmt);
- _kobj_printf(ops, fmt, adx);
+ _vkobj_printf(ops, fmt, adx);
va_end(adx);
}
diff --git a/usr/src/uts/common/krtld/kobj.c b/usr/src/uts/common/krtld/kobj.c
index 90303d496b..b98f5c188a 100644
--- a/usr/src/uts/common/krtld/kobj.c
+++ b/usr/src/uts/common/krtld/kobj.c
@@ -297,7 +297,7 @@ int standalone = 1; /* an unwholey kernel? */
int use_iflush; /* iflush after relocations */
/*
- * _kobj_printf()
+ * _kobj_printf() and _vkobj_printf()
*
* Common printf function pointer. Can handle only one conversion
* specification in the format string. Some of the functions invoked
@@ -305,6 +305,7 @@ int use_iflush; /* iflush after relocations */
* specification in the format string.
*/
void (*_kobj_printf)(void *, const char *, ...); /* printf routine */
+void (*_vkobj_printf)(void *, const char *, va_list); /* vprintf routine */
/*
* Standalone function pointers for use within krtld.
diff --git a/usr/src/uts/common/krtld/kobj_subr.c b/usr/src/uts/common/krtld/kobj_subr.c
index 761c8b69f6..8dd6ca7863 100644
--- a/usr/src/uts/common/krtld/kobj_subr.c
+++ b/usr/src/uts/common/krtld/kobj_subr.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
@@ -44,15 +42,22 @@
* vector so that krtld may simply refer to bzero etc.
* as usual. See kobj_impl.h.
*/
+extern void vprintf(const char *, va_list);
/*ARGSUSED*/
static void
+vkprintf(void *op, const char *fmt, va_list adx)
+{
+ vprintf(fmt, adx);
+}
+
+static void
kprintf(void *op, const char *fmt, ...)
{
va_list adx;
va_start(adx, fmt);
- vprintf(fmt, adx);
+ vkprintf(op, fmt, adx);
va_end(adx);
}
@@ -109,14 +114,15 @@ stand_strlcat(char *dst, const char *src, size_t dstsize)
void
kobj_setup_standalone_vectors()
{
- _kobj_printf = (void (*)(void *, const char *, ...))bop_printf;
+ _kobj_printf = bop_printf;
+ _vkobj_printf = vbop_printf;
kobj_bcopy = stand_bcopy;
kobj_bzero = stand_bzero;
kobj_strlcat = stand_strlcat;
}
/*
- * Restore the kprintf/bcopy/bzero kobj vectors.
+ * Restore the kprintf/vkprintf/bcopy/bzero kobj vectors.
* We need to undefine the override macros to
* accomplish this.
*
@@ -132,6 +138,7 @@ void
kobj_restore_vectors()
{
_kobj_printf = kprintf;
+ _vkobj_printf = vkprintf;
kobj_bcopy = bcopy;
kobj_bzero = bzero;
kobj_strlcat = strlcat;
diff --git a/usr/src/uts/common/sys/kobj_impl.h b/usr/src/uts/common/sys/kobj_impl.h
index 1dd7da9ee7..8b3ce3fdeb 100644
--- a/usr/src/uts/common/sys/kobj_impl.h
+++ b/usr/src/uts/common/sys/kobj_impl.h
@@ -30,10 +30,9 @@
#ifndef _SYS_KOBJ_IMPL_H
#define _SYS_KOBJ_IMPL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/kdi.h>
#include <sys/kobj.h>
+#include <sys/varargs.h>
#ifdef __cplusplus
extern "C" {
@@ -186,6 +185,7 @@ extern void mach_modpath(char *, const char *);
extern void kobj_setup_standalone_vectors(void);
extern void kobj_restore_vectors(void);
extern void (*_kobj_printf)(void *, const char *fmt, ...);
+extern void (*_vkobj_printf)(void *, const char *fmt, va_list);
extern void (*kobj_bcopy)(const void *, void *, size_t);
extern void (*kobj_bzero)(void *, size_t);
extern size_t (*kobj_strlcat)(char *, const char *, size_t);
diff --git a/usr/src/uts/i86pc/os/fakebop.c b/usr/src/uts/i86pc/os/fakebop.c
index 2ee67b522b..1544eab3b6 100644
--- a/usr/src/uts/i86pc/os/fakebop.c
+++ b/usr/src/uts/i86pc/os/fakebop.c
@@ -859,22 +859,28 @@ done:
/*
* print formatted output
*/
-/*PRINTFLIKE2*/
/*ARGSUSED*/
void
-bop_printf(bootops_t *bop, const char *fmt, ...)
+vbop_printf(void *ptr, const char *fmt, va_list ap)
{
- va_list ap;
-
if (have_console == 0)
return;
- va_start(ap, fmt);
(void) vsnprintf(buffer, BUFFERSIZE, fmt, ap);
- va_end(ap);
PUT_STRING(buffer);
}
+/*PRINTFLIKE2*/
+void
+bop_printf(void *bop, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ vbop_printf(bop, fmt, ap);
+ va_end(ap);
+}
+
/*
* Another panic() variant; this one can be used even earlier during boot than
* prom_panic().
diff --git a/usr/src/uts/intel/sys/bootconf.h b/usr/src/uts/intel/sys/bootconf.h
index 03bd4b70b8..27a89206cf 100644
--- a/usr/src/uts/intel/sys/bootconf.h
+++ b/usr/src/uts/intel/sys/bootconf.h
@@ -39,6 +39,7 @@
#include <sys/dirent.h> /* for struct dirent */
#include <sys/memlist.h>
#include <sys/obpdefs.h>
+#include <sys/varargs.h>
#include <net/if.h> /* for IFNAMSIZ */
#ifdef __cplusplus
@@ -83,7 +84,7 @@ struct bsys_mem {
struct memlist *physavail; /* amt of physmem avail for use */
struct memlist *virtavail; /* amt of virtmem avail for use */
struct memlist *pcimem; /* amt of pcimem avail for use */
- uint_t extent; /* number of bytes in the space */
+ uint_t extent; /* number of bytes in the space */
};
/*
@@ -103,7 +104,7 @@ typedef struct bootops {
/*
* the area containing boot's memlists
*/
- struct bsys_mem *boot_mem;
+ struct bsys_mem *boot_mem;
/*
* have boot allocate size bytes at virthint
@@ -136,7 +137,7 @@ typedef struct bootops {
/*
* print formatted output
*/
- void (*bsys_printf)(struct bootops *, const char *, ...);
+ void (*bsys_printf)(void *, const char *, ...);
/*
* Do a real mode interrupt
@@ -230,8 +231,9 @@ extern char *netdev_path;
extern void bop_no_more_mem(void);
/*PRINTFLIKE2*/
-extern void bop_printf(struct bootops *, const char *, ...)
+extern void bop_printf(void *, const char *, ...)
__KPRINTFLIKE(2);
+extern void vbop_printf(void *, const char *, va_list);
/*PRINTFLIKE1*/
extern void bop_panic(const char *, ...)
diff --git a/usr/src/uts/sparc/os/bootops.c b/usr/src/uts/sparc/os/bootops.c
index 658e989e9a..dd11142738 100644
--- a/usr/src/uts/sparc/os/bootops.c
+++ b/usr/src/uts/sparc/os/bootops.c
@@ -427,12 +427,18 @@ bop_getprop(const char *name, void *value)
*/
/*ARGSUSED*/
void
+vbop_printf(void *ptr, const char *fmt, va_list ap)
+{
+ prom_vprintf(fmt, ap);
+}
+
+void
bop_printf(void *ops, const char *fmt, ...)
{
va_list adx;
va_start(adx, fmt);
- prom_vprintf(fmt, adx);
+ vbop_printf(ops, fmt, adx);
va_end(adx);
}
diff --git a/usr/src/uts/sun/sys/bootconf.h b/usr/src/uts/sun/sys/bootconf.h
index 3fe17c4198..7f1d1e0e56 100644
--- a/usr/src/uts/sun/sys/bootconf.h
+++ b/usr/src/uts/sun/sys/bootconf.h
@@ -61,7 +61,7 @@ struct bsys_mem {
struct memlist *physinstalled; /* amt of physmem installed */
struct memlist *physavail; /* amt of physmem avail for use */
struct memlist *virtavail; /* amt of virtmem avail for use */
- uint_t extent; /* number of bytes in the space */
+ uint_t extent; /* number of bytes in the space */
};
#define BO_VERSION 9 /* bootops interface revision # */
@@ -110,6 +110,7 @@ extern void bop_enter_mon(void);
extern void bop_fini(void);
extern void bop_printf(void *ops, const char *fmt, ...);
+extern void vbop_printf(void *ops, const char *fmt, va_list);
extern void bop_putsarg(const char *fmt, char *arg);
extern void bop_panic(const char *s);