|
From: kosmirror <kos...@us...> - 2025-08-04 19:30:42
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 6d7a039b48130587c9063defc9454cc2b0946e51 (commit)
from 75e5b0163e14034be800e1bdf5a642f0b7f0f1dc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6d7a039b48130587c9063defc9454cc2b0946e51
Author: darc <da...@pr...>
Date: Mon Aug 4 13:54:34 2025 -0500
Move arch-specific ELF definitions from elf.c to arch.h
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/include/arch/arch.h | 12 +++++++++++-
kernel/fs/elf.c | 10 ----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h
index 112bb187..cbc731cc 100644
--- a/kernel/arch/dreamcast/include/arch/arch.h
+++ b/kernel/arch/dreamcast/include/arch/arch.h
@@ -25,6 +25,7 @@ __BEGIN_DECLS
#include <stdbool.h>
#include <arch/types.h>
+#include <kos/elf.h>
/** \defgroup arch Architecture
\brief Dreamcast Architecture-Specific Options and high-level API
@@ -44,7 +45,7 @@ extern uint32 _arch_mem_top;
/** \brief Start and End address for .text portion of program. */
extern char _executable_start;
-extern char _etext;
+extern char _etext;
#define PAGESIZE 4096 /**< \brief Page size (for MMU) */
#define PAGESIZE_BITS 12 /**< \brief Bits for page size */
@@ -112,6 +113,15 @@ unsigned HZ __depr("Please use the new THD_SCHED_HZ macro.") = THD_SCHED_HZ;
/** \brief Length of global symbol prefix in ELF files. */
#define ELF_SYM_PREFIX_LEN 1
+/** \brief ELF class for this architecture. */
+#define ARCH_ELFCLASS ELFCLASS32
+
+/** \brief ELF data encoding for this architecture. */
+#define ARCH_ELFDATA ELFDATA2LSB
+
+/** \brief ELF machine type code for this architecture. */
+#define ARCH_CODE EM_SH
+
/** \brief Panic function.
This function will cause a kernel panic, printing the specified message.
diff --git a/kernel/fs/elf.c b/kernel/fs/elf.c
index c652806c..69b939d1 100644
--- a/kernel/fs/elf.c
+++ b/kernel/fs/elf.c
@@ -17,16 +17,6 @@
#include <kos/library.h>
#include <kos/dbglog.h>
-/* What's our architecture code we're expecting? */
-#if defined(_arch_dreamcast)
-# define ARCH_ELFCLASS ELFCLASS32 /* Dreamcast is 32-bit */
-# define ARCH_ELFDATA ELFDATA2LSB /* and little endian */
-# define ARCH_CODE EM_SH /* and uses an SH processor. */
-#else
-# error Unknown architecture
-#endif
-
-
/* Finds a given symbol in a relocated ELF symbol table */
static int find_sym(char *name, elf_sym_t *table, int tablelen) {
int i;
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|