Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Mar 2010 23:52:30 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r205162 - in projects/altix/sys/boot/ia64: common efi ski
Message-ID:  <201003142352.o2ENqUpb091154@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Mar 14 23:52:30 2010
New Revision: 205162
URL: http://svn.freebsd.org/changeset/base/205162

Log:
  Add ia64_elf_obj to file_formats[] and unify the SKI and EFI
  support by moving the definition from the separate conf.c to
  the common exec.c.

Modified:
  projects/altix/sys/boot/ia64/common/exec.c
  projects/altix/sys/boot/ia64/common/libia64.h
  projects/altix/sys/boot/ia64/efi/conf.c
  projects/altix/sys/boot/ia64/ski/conf.c
  projects/altix/sys/boot/ia64/ski/libski.h

Modified: projects/altix/sys/boot/ia64/common/exec.c
==============================================================================
--- projects/altix/sys/boot/ia64/common/exec.c	Sun Mar 14 23:23:57 2010	(r205161)
+++ projects/altix/sys/boot/ia64/common/exec.c	Sun Mar 14 23:52:30 2010	(r205162)
@@ -36,19 +36,30 @@ __FBSDID("$FreeBSD$");
 #include <machine/ia64_cpu.h>
 #include <machine/pte.h>
 
-#include <ia64/include/bootinfo.h>
 #include <ia64/include/vmparam.h>
 
 #include <efi.h>
 #include <efilib.h>
 
-#include "bootstrap.h"
+#include "libia64.h"
 
-#define _KERNEL
+static int elf64_exec(struct preloaded_file *amp);
+static int elf64_obj_exec(struct preloaded_file *amp);
 
-static int	elf64_exec(struct preloaded_file *amp);
-
-struct file_format ia64_elf = { elf64_loadfile, elf64_exec };
+static struct file_format ia64_elf = {
+	elf64_loadfile,
+	elf64_exec
+};
+static struct file_format ia64_elf_obj = {
+	elf64_obj_loadfile,
+	elf64_obj_exec
+};
+
+struct file_format *file_formats[] = {
+	&ia64_elf,
+	&ia64_elf_obj,
+	NULL
+};
 
 /*
  * Entered with psr.ic and psr.i both zero.
@@ -122,3 +133,12 @@ elf64_exec(struct preloaded_file *fp)
 	/* NOTREACHED */
 	return (0);
 }
+
+static int
+elf64_obj_exec(struct preloaded_file *fp)
+{
+
+	printf("%s called for preloaded file %p (=%s):\n", __func__, fp,
+	    fp->f_name);
+	return (ENOSYS);
+}

Modified: projects/altix/sys/boot/ia64/common/libia64.h
==============================================================================
--- projects/altix/sys/boot/ia64/common/libia64.h	Sun Mar 14 23:23:57 2010	(r205161)
+++ projects/altix/sys/boot/ia64/common/libia64.h	Sun Mar 14 23:52:30 2010	(r205162)
@@ -32,27 +32,29 @@
 #include <bootstrap.h>
 #include <ia64/include/bootinfo.h>
 
+int bi_load(struct preloaded_file *, uint64_t *);
+
 /*
  * Portability functions provided by the loader
  * implementation specific to the platform.
  */
-extern uint64_t ldr_alloc(vm_offset_t);
-extern int ldr_bootinfo(struct bootinfo *, uint64_t *);
-extern int ldr_enter(const char *);
+uint64_t ldr_alloc(vm_offset_t);
+int ldr_bootinfo(struct bootinfo *, uint64_t *);
+int ldr_enter(const char *);
 
 /*
  * Functions and variables provided by the ia64 common code
  * and shared by all loader implementations.
  */
 
-extern int ia64_autoload(void);
+int ia64_autoload(void);
 
-extern ssize_t ia64_copyin(const void *, vm_offset_t, size_t);
-extern ssize_t ia64_copyout(vm_offset_t, void *, size_t);
-extern ssize_t ia64_readin(int, vm_offset_t, size_t);
-
-extern char *ia64_fmtdev(struct devdesc *);
-extern int ia64_getdev(void **, const char *, const char **);
-extern int ia64_setcurrdev(struct env_var *, int, const void *);
+ssize_t ia64_copyin(const void *, vm_offset_t, size_t);
+ssize_t ia64_copyout(vm_offset_t, void *, size_t);
+ssize_t ia64_readin(int, vm_offset_t, size_t);
+
+char *ia64_fmtdev(struct devdesc *);
+int ia64_getdev(void **, const char *, const char **);
+int ia64_setcurrdev(struct env_var *, int, const void *);
 
 #endif /* !_LIBIA64_H_ */

Modified: projects/altix/sys/boot/ia64/efi/conf.c
==============================================================================
--- projects/altix/sys/boot/ia64/efi/conf.c	Sun Mar 14 23:23:57 2010	(r205161)
+++ projects/altix/sys/boot/ia64/efi/conf.c	Sun Mar 14 23:52:30 2010	(r205162)
@@ -69,17 +69,6 @@ struct netif_driver *netif_drivers[] = {
 };
 
 /* 
- * Sort formats so that those that can detect based on arguments
- * rather than reading the file go first.
- */
-extern struct file_format ia64_elf;
-
-struct file_format *file_formats[] = {
-	&ia64_elf,
-	NULL
-};
-
-/* 
  * Consoles 
  *
  * We don't prototype these in efiboot.h because they require

Modified: projects/altix/sys/boot/ia64/ski/conf.c
==============================================================================
--- projects/altix/sys/boot/ia64/ski/conf.c	Sun Mar 14 23:23:57 2010	(r205161)
+++ projects/altix/sys/boot/ia64/ski/conf.c	Sun Mar 14 23:52:30 2010	(r205162)
@@ -60,18 +60,6 @@ struct fs_ops *file_system[] = {
 	NULL
 };
 
-/* Exported for ia64 only */
-/* 
- * Sort formats so that those that can detect based on arguments
- * rather than reading the file go first.
- */
-extern struct file_format ia64_elf;
-
-struct file_format *file_formats[] = {
-	&ia64_elf,
-	NULL
-};
-
 /* 
  * Consoles 
  *

Modified: projects/altix/sys/boot/ia64/ski/libski.h
==============================================================================
--- projects/altix/sys/boot/ia64/ski/libski.h	Sun Mar 14 23:23:57 2010	(r205161)
+++ projects/altix/sys/boot/ia64/ski/libski.h	Sun Mar 14 23:52:30 2010	(r205162)
@@ -46,7 +46,6 @@ extern int		ski_boot(void);
 
 struct bootinfo;
 struct preloaded_file;
-extern int		bi_load(struct bootinfo *, struct preloaded_file *);
 
 #define SSC_CONSOLE_INIT		20
 #define SSC_GETCHAR			21



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003142352.o2ENqUpb091154>