summaryrefslogtreecommitdiffstats
path: root/sys/boot/common
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1998-09-26 10:51:38 +0000
committerdfr <dfr@FreeBSD.org>1998-09-26 10:51:38 +0000
commitad6ddb77671a5780eefdb973075656e601890d74 (patch)
tree7ee815e87abf339583a4b840f14159bc49a21714 /sys/boot/common
parent236ad5eb3ca90664e90a383de91faa975d35b8fc (diff)
downloadFreeBSD-src-ad6ddb77671a5780eefdb973075656e601890d74.zip
FreeBSD-src-ad6ddb77671a5780eefdb973075656e601890d74.tar.gz
* Add old UFS compatibility code to alpha/boot1.
* Fix a raft of warnings, printf and otherwise. * Allocate the correct amount in mod_searchmodule to prevent an overflow. * Fix the makefiles so they work outside my home directory (oops).
Diffstat (limited to 'sys/boot/common')
-rw-r--r--sys/boot/common/bootstrap.h5
-rw-r--r--sys/boot/common/devopen.c4
-rw-r--r--sys/boot/common/load_aout.c8
-rw-r--r--sys/boot/common/misc.c4
-rw-r--r--sys/boot/common/module.c14
5 files changed, 18 insertions, 17 deletions
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index f02b4f4..b53cf97 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bootstrap.h,v 1.6 1998/09/19 01:31:28 msmith Exp $
+ * $Id: bootstrap.h,v 1.7 1998/09/20 21:46:19 dfr Exp $
*/
#include <sys/types.h>
@@ -219,6 +219,7 @@ extern vm_offset_t aout_findsym(char *name, struct loaded_module *mp);
__asm(".previous")
#else
#define MAKE_SET(set, sym) \
+ static void const * const __set_##set##_sym_##sym = &sym; \
__asm(".section .set." #set ",\"aw\""); \
__asm(".long " #sym); \
__asm(".previous")
@@ -280,7 +281,7 @@ struct arch_switch
/* Automatically load modules as required by detected hardware */
int (* arch_autoload)();
/* Locate the device for (name), return pointer to tail in (*path) */
- int (*arch_getdev)(void **dev, char *name, char **path);
+ int (*arch_getdev)(void **dev, const char *name, const char **path);
/* Copy from local address space to module address space, similar to bcopy() */
int (*arch_copyin)(void *src, vm_offset_t dest, size_t len);
/* Copy to local address space from module address space, similar to bcopy() */
diff --git a/sys/boot/common/devopen.c b/sys/boot/common/devopen.c
index bb03f3d..83489c6 100644
--- a/sys/boot/common/devopen.c
+++ b/sys/boot/common/devopen.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: devopen.c,v 1.1.1.1 1998/08/21 03:17:41 msmith Exp $
*/
@@ -33,7 +33,7 @@
#include "bootstrap.h"
int
-devopen(struct open_file *f, const char *fname, char **file)
+devopen(struct open_file *f, const char *fname, const char **file)
{
struct devdesc *dev;
int result;
diff --git a/sys/boot/common/load_aout.c b/sys/boot/common/load_aout.c
index 02beed9..1eaddf3 100644
--- a/sys/boot/common/load_aout.c
+++ b/sys/boot/common/load_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: load_aout.c,v 1.4 1998/09/17 23:52:02 msmith Exp $
+ * $Id: load_aout.c,v 1.5 1998/09/18 01:12:23 msmith Exp $
*/
#include <sys/param.h>
@@ -139,7 +139,7 @@ aout_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
addr += pad;
}
mp->m_addr = addr; /* save the aligned load address */
- printf("%s at 0x%x\n", filename, addr);
+ printf("%s at %p\n", filename, (void *) addr);
mp->m_size = aout_loadimage(fd, addr, &ehdr, kernel);
if (mp->m_size == 0)
@@ -212,7 +212,7 @@ aout_loadimage(int fd, vm_offset_t loadaddr, struct exec *ehdr, int kernel)
addr += sizeof(ehdr->a_syms);
/* symbol table */
- printf("symbols=[0x%x+0x%lx", sizeof(ehdr->a_syms), ehdr->a_syms);
+ printf("symbols=[0x%lx+0x%lx", sizeof(ehdr->a_syms), ehdr->a_syms);
if (archsw.arch_readin(fd, addr, ehdr->a_syms) != ehdr->a_syms)
return(0);
addr += ehdr->a_syms;
@@ -222,7 +222,7 @@ aout_loadimage(int fd, vm_offset_t loadaddr, struct exec *ehdr, int kernel)
archsw.arch_copyin(&ss, addr, sizeof(ss));
addr += sizeof(ss);
ss -= sizeof(ss);
- printf("+0x%x+0x%x]", sizeof(ss), ss);
+ printf("+0x%lx+0x%x]", sizeof(ss), ss);
if (archsw.arch_readin(fd, addr, ss) != ss)
return(0);
printf(" \n");
diff --git a/sys/boot/common/misc.c b/sys/boot/common/misc.c
index 6333eaf..96c58f8 100644
--- a/sys/boot/common/misc.c
+++ b/sys/boot/common/misc.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: misc.c,v 1.2 1998/09/03 02:10:07 msmith Exp $
+ * $Id: misc.c,v 1.3 1998/09/19 01:31:28 msmith Exp $
*/
#include <string.h>
@@ -101,7 +101,7 @@ hexdump(caddr_t region, size_t len)
pager_open();
for (line = region; line < (region + len); line += 16) {
- emit("%08x ", line);
+ emit("%08lx ", (long) line);
for (x = 0; x < 16; x++) {
if ((line + x) < (region + len)) {
diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c
index d7f4019..d68c1a5 100644
--- a/sys/boot/common/module.c
+++ b/sys/boot/common/module.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: module.c,v 1.3 1998/09/03 02:10:08 msmith Exp $
+ * $Id: module.c,v 1.4 1998/09/14 18:27:04 msmith Exp $
*/
/*
@@ -145,8 +145,8 @@ command_lsmod(int argc, char *argv[])
pager_open();
for (am = loaded_modules; (am != NULL); am = am->m_next) {
- sprintf(lbuf, " %x: %s (%s, 0x%x)\n",
- am->m_addr, am->m_name, am->m_type, am->m_size);
+ sprintf(lbuf, " %p: %s (%s, 0x%lx)\n",
+ (void *) am->m_addr, am->m_name, am->m_type, (long) am->m_size);
pager_output(lbuf);
if (am->m_args != NULL) {
pager_output(" args: ");
@@ -156,7 +156,7 @@ command_lsmod(int argc, char *argv[])
if (verbose)
/* XXX could add some formatting smarts here to display some better */
for (md = am->m_metadata; md != NULL; md = md->md_next) {
- sprintf(lbuf, " 0x%04x, 0x%x\n", md->md_type, md->md_size);
+ sprintf(lbuf, " 0x%04x, 0x%lx\n", md->md_type, (long) md->md_size);
pager_output(lbuf);
}
}
@@ -444,8 +444,8 @@ static char *
mod_searchfile(char *name)
{
static char *result = NULL;
- char *path;
- char *cp, *sp;
+ char *path, *sp;
+ const char *cp;
struct stat sb;
/* Don't look for nothing */
@@ -501,7 +501,7 @@ mod_searchmodule(char *name)
char *tn, *result;
/* Look for (name).ko */
- tn = malloc(strlen(name) + 3);
+ tn = malloc(strlen(name) + 3 + 1);
strcpy(tn, name);
strcat(tn, ".ko");
result = mod_searchfile(tn);
OpenPOWER on IntegriCloud