From: kosmirror <kos...@us...> - 2025-09-25 15:44:23
|
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 7d8cba2c46866dd4b757557826fe2967844fb520 (commit) via db7081ba931f97d241fa9e8e684f566544da531d (commit) via 0a673d1bff9d2c454d71df1064d73b808d5c4876 (commit) via 4e9d15d687d3bd527f9cec3abf337bcc1bccaee3 (commit) from d8f7df2599dc3e147ae585855f396d74e8a28ef4 (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 7d8cba2c46866dd4b757557826fe2967844fb520 Author: QuzarDC <qu...@co...> Date: Thu Sep 11 11:47:09 2025 -0400 init: Privatize prototype for `arch_real_exit` This is clearly meant to be internal, and was described as such. Just actually doing so. commit db7081ba931f97d241fa9e8e684f566544da531d Author: QuzarDC <qu...@co...> Date: Thu Sep 11 10:44:58 2025 -0400 Remove extraneous includes of <arch/spinlock.h> I was looking for *any* unneeded includes and for some reason these were all over the place. I don't see any reason that they'd be needed and things build fine without. commit 0a673d1bff9d2c454d71df1064d73b808d5c4876 Author: QuzarDC <qu...@co...> Date: Thu Sep 11 00:36:58 2025 -0400 thread: Move definition of `tid_t` to thread.h Almost every place internally that was using it was doing so by including <kos/thread.h> rather than <arch/types.h> (though partially due to previous cleanups). commit 4e9d15d687d3bd527f9cec3abf337bcc1bccaee3 Author: QuzarDC <qu...@co...> Date: Wed Sep 10 22:20:55 2025 -0400 library: Remove unnecessary use of `tid_t`. The two types have nothing to do with each other. Instead unrolled it to the type it has always been, an int. ----------------------------------------------------------------------- Summary of changes: include/kos/library.h | 4 +--- include/kos/thread.h | 4 ++++ kernel/arch/dreamcast/hardware/asic.c | 1 - kernel/arch/dreamcast/hardware/g2bus.c | 1 - kernel/arch/dreamcast/hardware/scif.c | 1 - kernel/arch/dreamcast/include/arch/arch.h | 10 ---------- kernel/arch/dreamcast/include/arch/types.h | 9 --------- kernel/arch/dreamcast/kernel/init.c | 3 +++ kernel/libc/koslib/malloc.c | 6 ++++-- 9 files changed, 12 insertions(+), 27 deletions(-) diff --git a/include/kos/library.h b/include/kos/library.h index da0d718c..feb4b114 100644 --- a/include/kos/library.h +++ b/include/kos/library.h @@ -31,7 +31,6 @@ #include <kos/cdefs.h> __BEGIN_DECLS -#include <kos/thread.h> #include <kos/elf.h> #include <kos/fs.h> @@ -49,8 +48,7 @@ TAILQ_HEAD(klqueue, klibrary); LIST_HEAD(kllist, klibrary); /** \endcond */ -/* Thread IDs are ok for us */ -typedef tid_t libid_t; /**< \brief Library ID type. */ +typedef int libid_t; /**< \brief Library ID type. */ /** \brief Loaded library structure. diff --git a/include/kos/thread.h b/include/kos/thread.h index 22a798ae..e0b8f9c6 100644 --- a/include/kos/thread.h +++ b/include/kos/thread.h @@ -151,6 +151,10 @@ typedef enum kthread_state { STATE_FINISHED = 0x0004 /**< \brief Finished execution */ } kthread_state_t; +/* Thread and priority types */ +typedef int tid_t; /**< \brief Thread ID type */ +typedef int prio_t; /**< \brief Priority value type */ + /** \brief Structure describing one running thread. Each thread has one of these structures assigned to it, which holds all the diff --git a/kernel/arch/dreamcast/hardware/asic.c b/kernel/arch/dreamcast/hardware/asic.c index 725ff3ae..9cc0329b 100644 --- a/kernel/arch/dreamcast/hardware/asic.c +++ b/kernel/arch/dreamcast/hardware/asic.c @@ -100,7 +100,6 @@ #include <assert.h> #include <arch/irq.h> #include <dc/asic.h> -#include <arch/spinlock.h> #include <kos/genwait.h> #include <kos/regfield.h> #include <kos/worker_thread.h> diff --git a/kernel/arch/dreamcast/hardware/g2bus.c b/kernel/arch/dreamcast/hardware/g2bus.c index 0b1bdf44..568646e2 100644 --- a/kernel/arch/dreamcast/hardware/g2bus.c +++ b/kernel/arch/dreamcast/hardware/g2bus.c @@ -20,7 +20,6 @@ #include <string.h> #include <stdio.h> #include <dc/g2bus.h> -#include <arch/spinlock.h> /* Always use these functions to access G2 bus memory (includes the SPU and the expansion port, e.g., BBA) */ diff --git a/kernel/arch/dreamcast/hardware/scif.c b/kernel/arch/dreamcast/hardware/scif.c index 41eb0b55..c61d2d77 100644 --- a/kernel/arch/dreamcast/hardware/scif.c +++ b/kernel/arch/dreamcast/hardware/scif.c @@ -8,7 +8,6 @@ #include <errno.h> #include <kos/dbgio.h> #include <arch/arch.h> -#include <arch/spinlock.h> #include <arch/irq.h> #include <dc/fs_dcload.h> #include <dc/scif.h> diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h index 2fd7981e..a152d691 100644 --- a/kernel/arch/dreamcast/include/arch/arch.h +++ b/kernel/arch/dreamcast/include/arch/arch.h @@ -213,16 +213,6 @@ void * mm_sbrk(unsigned long increment); #include <kos/init.h> /* Dreamcast-specific arch init things */ -/** \brief Jump back to the bootloader. - \ingroup arch - - You generally shouldn't use this function, but rather use arch_exit() or - exit() instead. - - \note This function will never return! -*/ -void arch_real_exit(int ret_code) __noreturn; - /** \brief Initialize bare-bones hardware systems. \ingroup arch diff --git a/kernel/arch/dreamcast/include/arch/types.h b/kernel/arch/dreamcast/include/arch/types.h index 295bc031..ae1b2439 100644 --- a/kernel/arch/dreamcast/include/arch/types.h +++ b/kernel/arch/dreamcast/include/arch/types.h @@ -48,15 +48,6 @@ typedef volatile int32 vint32; /**< \brief 32-bit volatile signed type */ typedef volatile int16 vint16; /**< \brief 16-bit volatile signed type */ typedef volatile int8 vint8; /**< \brief 8-bit volatile signed type */ -/* This type may be used for any generic handle type that is allowed - to be negative (for errors) and has no specific bit count - restraints. */ -typedef int handle_t; /**< \brief Generic "handle" type */ - -/* Thread and priority types */ -typedef handle_t tid_t; /**< \brief Thread ID type */ -typedef handle_t prio_t; /**< \brief Priority value type */ - /** @} */ __END_DECLS diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c index 73221e63..d459ad19 100644 --- a/kernel/arch/dreamcast/kernel/init.c +++ b/kernel/arch/dreamcast/kernel/init.c @@ -43,6 +43,9 @@ extern void _fini(void); extern void __verify_newlib_patch(); extern void dma_init(void); +/* Jump back to the bootloader. From startup.S */ +void arch_real_exit(int ret_code) __noreturn; + void (*__kos_init_early_fn)(void) __attribute__((weak,section(".data"))) = NULL; int main(int argc, char **argv); diff --git a/kernel/libc/koslib/malloc.c b/kernel/libc/koslib/malloc.c index aedfeaec..ef2c918e 100644 --- a/kernel/libc/koslib/malloc.c +++ b/kernel/libc/koslib/malloc.c @@ -1650,6 +1650,10 @@ static pthread_mutex_t mALLOC_MUTEx = PTHREAD_MUTEX_INITIALIZER; #ifdef KM_DBG +#include <stdlib.h> +#include <kos/dbgio.h> +#include <kos/thread.h> + #define BLOCK_MAGIC 0x1c518a74 #define PRE_MAGIC 0x6765adb8 #define POST_MAGIC 0x29d4ca6d @@ -1679,8 +1683,6 @@ static LIST_HEAD(memctl_list, memctl) block_list; #define get_cur_tid_safe ((thd_current == NULL) ? (tid_t)0 : thd_current->tid) -#include <kos/dbgio.h> -#include <stdlib.h> char dbg_print_buffer[256]; enum func_type_names { name_MALLOC = 0, name_REALLOC = 1, name_MEMALIGN = 2, name_CALLOC = 3, hooks/post-receive -- A pseudo Operating System for the Dreamcast. |