summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/bootstrap.h
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2011-04-03 22:31:51 +0000
committermarcel <marcel@FreeBSD.org>2011-04-03 22:31:51 +0000
commite253ede76350c4b63552fb9fa2ab251200bba4d6 (patch)
treeeca323dd0978bd6b21c62e82ce8932b641bfb4e0 /sys/boot/common/bootstrap.h
parent37c0565836f4c33ee4fcf4b66d577ca704ea5375 (diff)
downloadFreeBSD-src-e253ede76350c4b63552fb9fa2ab251200bba4d6.zip
FreeBSD-src-e253ede76350c4b63552fb9fa2ab251200bba4d6.tar.gz
Add 2 new archsw interfaces:
1. arch_loadaddr - used by platform code to adjust the address at which the object gets loaded. Implement PC98 using this new interface instead of using conditional compilation. For ELF objects the ELF header is passed as the data pointer. For raw files it's the filename. Note that ELF objects are first considered as raw files. 2. arch_loadseg - used by platform code to keep track of actual segments, so that (instruction) caches can be flushed or translations can be created. Both the ELF header as well as the program header are passed to allow platform code to treat the kernel proper differently from any additional modules and to have all the relevant details of the loaded segment (e.g. protection).
Diffstat (limited to 'sys/boot/common/bootstrap.h')
-rw-r--r--sys/boot/common/bootstrap.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index bf3f962..d8b4551 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -296,6 +296,24 @@ struct arch_switch
/* Perform ISA byte port I/O (only for systems with ISA) */
int (*arch_isainb)(int port);
void (*arch_isaoutb)(int port, int value);
+
+ /*
+ * Interface to adjust the load address according to the "object"
+ * being loaded.
+ */
+ uint64_t (*arch_loadaddr)(u_int type, void *data, uint64_t addr);
+#define LOAD_ELF 1 /* data points to the ELF header. */
+#define LOAD_RAW 2 /* data points to the file name. */
+
+ /*
+ * Interface to inform MD code about a loaded (ELF) segment. This
+ * can be used to flush caches and/or set up translations.
+ */
+#ifdef __elfN
+ void (*arch_loadseg)(Elf_Ehdr *eh, Elf_Phdr *ph, uint64_t delta);
+#else
+ void (*arch_loadseg)(void *eh, void *ph, uint64_t delta);
+#endif
};
extern struct arch_switch archsw;
OpenPOWER on IntegriCloud