From: falcovorbis <fal...@us...> - 2024-09-06 02:31:26
|
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 892b8149ca90bb77c3452c4edeecbb0082b89dba (commit) from c1104515865a09ffa6ccfc05dcd6f991c524f951 (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 892b8149ca90bb77c3452c4edeecbb0082b89dba Author: Andy Barajas <and...@gm...> Date: Thu Sep 5 19:30:42 2024 -0700 Refactor sysinfo_icon/id (#734) * Refactor sysinfo_icon/id Made syscall_sysinfo_init() public and call it in arch_auto_init() to prepare for future calls to syscalls for info_icon and info_id. * Update kernel/arch/dreamcast/include/dc/syscalls.h Added not that KOS automatically calls this during initialization Co-authored-by: Falco Girgis <gyr...@gm...> --------- Co-authored-by: Falco Girgis <gyr...@gm...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/syscalls.c | 9 +-------- kernel/arch/dreamcast/include/dc/syscalls.h | 8 ++++++++ kernel/arch/dreamcast/kernel/init.c | 2 ++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/syscalls.c b/kernel/arch/dreamcast/hardware/syscalls.c index 60d7cf07..a2bc5d66 100644 --- a/kernel/arch/dreamcast/hardware/syscalls.c +++ b/kernel/arch/dreamcast/hardware/syscalls.c @@ -116,18 +116,12 @@ syscall((r4), (r5), (r6), (func)); \ } while(0) -/* - Prepares FUNC_SYSINFO_ICON and FUNC_SYSINFO_ID calls for use by - copying the relevant data from the system flashrom into - 8C000068-8C00007F. No point in making this public. -*/ -static void syscall_sysinfo_init(void) { +void syscall_sysinfo_init(void) { MAKE_SYSCALL_VOID(VEC_SYSINFO, FUNC_SYSINFO_INIT, PARAM_NA, PARAM_NA, PARAM_NA); } int syscall_sysinfo_icon(uint32_t icon, uint8_t *dest) { - syscall_sysinfo_init(); MAKE_SYSCALL_INT(VEC_SYSINFO, FUNC_SYSINFO_ICON, icon, dest, PARAM_NA); } @@ -135,7 +129,6 @@ int syscall_sysinfo_icon(uint32_t icon, uint8_t *dest) { uint64_t syscall_sysinfo_id(void) { uint64_t *id = NULL; - syscall_sysinfo_init(); MAKE_SYSCALL_SET(VEC_SYSINFO, FUNC_SYSINFO_ID, PARAM_NA, PARAM_NA, PARAM_NA, id, uint64_t *); diff --git a/kernel/arch/dreamcast/include/dc/syscalls.h b/kernel/arch/dreamcast/include/dc/syscalls.h index 0f705ea4..71c21852 100644 --- a/kernel/arch/dreamcast/include/dc/syscalls.h +++ b/kernel/arch/dreamcast/include/dc/syscalls.h @@ -38,6 +38,14 @@ __BEGIN_DECLS #include <stdint.h> #include <sys/types.h> +/** \brief Inits data needed by sysinfo id/icon + \note This is called automatically by KOS during initialization. + This function prepares syscall_sysinfo_icon and syscall_sysinfo_id + calls for use by copying the relevant data from the system flashrom + into 8C000068-8C00007F. +*/ +void syscall_sysinfo_init(void); + /** \brief Reads an icon from the flashrom. This function reads an icon from the flashrom into a destination diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c index ed90b7f1..f2c222b1 100644 --- a/kernel/arch/dreamcast/kernel/init.c +++ b/kernel/arch/dreamcast/kernel/init.c @@ -172,6 +172,8 @@ int __weak arch_auto_init(void) { timer_init(); /* Timers */ hardware_sys_init(); /* DC low-level hardware init */ + syscall_sysinfo_init(); + /* Initialize our timer */ perf_cntr_timer_enable(); timer_ms_enable(); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |