You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(35) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(37) |
Feb
(10) |
Mar
|
Apr
(2) |
May
(17) |
Jun
(1) |
Jul
(14) |
Aug
(14) |
Sep
(4) |
Oct
|
Nov
(14) |
Dec
(4) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(92) |
Dec
(12) |
2006 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(5) |
May
(3) |
Jun
(15) |
Jul
(3) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
(6) |
Dec
(5) |
2007 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
(3) |
May
(14) |
Jun
(2) |
Jul
(16) |
Aug
(73) |
Sep
(12) |
Oct
(9) |
Nov
(27) |
Dec
(3) |
2008 |
Jan
(4) |
Feb
(4) |
Mar
(3) |
Apr
(8) |
May
(23) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(7) |
Oct
(5) |
Nov
(1) |
Dec
(1) |
2009 |
Jan
|
Feb
(10) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(1) |
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
|
Jun
(3) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(15) |
Nov
(1) |
Dec
(5) |
2011 |
Jan
(4) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(22) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
|
Feb
(10) |
Mar
(1) |
Apr
(6) |
May
(27) |
Jun
(48) |
Jul
(30) |
Aug
(4) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(11) |
2013 |
Jan
(4) |
Feb
(7) |
Mar
(6) |
Apr
(18) |
May
(28) |
Jun
(20) |
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(9) |
May
(11) |
Jun
(10) |
Jul
|
Aug
(18) |
Sep
(12) |
Oct
(17) |
Nov
(10) |
Dec
(16) |
2015 |
Jan
(5) |
Feb
(1) |
Mar
(5) |
Apr
(4) |
May
(28) |
Jun
(2) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
(2) |
Dec
(1) |
2016 |
Jan
(14) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2017 |
Jan
(11) |
Feb
|
Mar
(21) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
(10) |
Feb
(9) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(18) |
Jul
(4) |
Aug
(2) |
Sep
(20) |
Oct
(2) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2022 |
Jan
(1) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2023 |
Jan
(10) |
Feb
(7) |
Mar
(29) |
Apr
(31) |
May
(29) |
Jun
(34) |
Jul
(3) |
Aug
(24) |
Sep
(22) |
Oct
(10) |
Nov
(38) |
Dec
(27) |
2024 |
Jan
(15) |
Feb
(8) |
Mar
(4) |
Apr
(20) |
May
(33) |
Jun
(18) |
Jul
(15) |
Aug
(23) |
Sep
(26) |
Oct
(32) |
Nov
(6) |
Dec
(4) |
2025 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
(4) |
May
(46) |
Jun
(19) |
Jul
(20) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: kosmirror <kos...@us...> - 2025-06-24 01:07:09
|
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 3c2d96a8ce8d4b9622648ad78dfb82a4db5c233c (commit) from 1e95c1f3e843608ebd3f7045bd40e7be27d3a575 (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 3c2d96a8ce8d4b9622648ad78dfb82a4db5c233c Author: Shirobon <126...@us...> Date: Sun Jun 15 12:59:19 2025 +0900 Update to detect Apple Clang 17+ and fix zlib issue. New Apple Clang 17 in Xcode 16.3+ causes build issues with bundled in zlib in binutils/gcc, so detect compiler version and use system zlib if necessary. ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/scripts/init.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/utils/dc-chain/scripts/init.mk b/utils/dc-chain/scripts/init.mk index 0115ca7d..f5d71011 100644 --- a/utils/dc-chain/scripts/init.mk +++ b/utils/dc-chain/scripts/init.mk @@ -68,6 +68,18 @@ ifdef MACOS SH_CXX_FOR_TARGET += $(macos_extra_args) macos_gcc_configure_args = --with-sysroot --with-native-system-header=/usr/include macos_gdb_configure_args = --with-sysroot=$(sdkroot) + # Detect if CC is Apple Clang and get major version, skip if using gcc. + APPLE_CLANG_MAJOR := $(shell $(CC) --version 2>&1 | \ + grep -i "Apple clang" | cut -f 4 -d " " | cut -f 1 -d ".") + ifdef APPLE_CLANG_MAJOR + # When using Apple Clang 17 or above, use system zlib. + ifeq ($(shell [ "$(APPLE_CLANG_MAJOR)" -gt 16 ] && echo "yes"), yes) + $(info Apple clang $(APPLE_CLANG_MAJOR) detected, using system zlib) + macos_gcc_configure_args += --with-system-zlib + macos_gdb_configure_args += --with-system-zlib + binutils_extra_configure_args += --with-system-zlib + endif + endif endif endif hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-23 01:43:46
|
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 1e95c1f3e843608ebd3f7045bd40e7be27d3a575 (commit) from a3d0467bcb2659e44ce7cbeef6e900bb6f33cc62 (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 1e95c1f3e843608ebd3f7045bd40e7be27d3a575 Author: QuzarDC <qu...@co...> Date: Sun Jun 22 20:59:33 2025 -0400 arch/args.h: Add standard double-include protection and decls ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/include/arch/args.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/arch/dreamcast/include/arch/args.h b/kernel/arch/dreamcast/include/arch/args.h index 56f3ffe8..74b719af 100644 --- a/kernel/arch/dreamcast/include/arch/args.h +++ b/kernel/arch/dreamcast/include/arch/args.h @@ -14,6 +14,12 @@ \author Paul Cercueil */ +#ifndef __ARCH_ARGS_H +#define __ARCH_ARGS_H + +#include <kos/cdefs.h> +__BEGIN_DECLS + #ifdef __SH4_SINGLE_ONLY__ #define KOS_SH4_SINGLE_ONLY 1 #else @@ -46,3 +52,7 @@ * floating-point argument of a function (starting from n=0). */ #define KOS_FPARG(n) _KOS_FPARG(n, KOS_SH4_SINGLE_ONLY) + +__END_DECLS + +#endif /* __ARCH_ARGS_H */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-22 23:58:39
|
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 a3d0467bcb2659e44ce7cbeef6e900bb6f33cc62 (commit) from 3de8ac8f710ab4456c5abe5230c6615074fadb4f (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 a3d0467bcb2659e44ce7cbeef6e900bb6f33cc62 Author: QuzarDC <qu...@co...> Date: Thu Jun 19 04:28:09 2025 -0400 Map keyboard 'return' key to CR not LF. This was a regression in the new API from the start in 2012. By mapping LF to 'return' (0x28, the 'enter' key in the main block of keys) it meant that there was no way to send a return on keyboards that lacked a numpad. This change rolls us back to the mapping that had always been used in the older API. It seems that the issue had not been encountered or noted in large part because the old API's mapping had been maintained in code until #984 where I removed them for only differing in this one character code from the standard US keyboard. The old API is still what was backing conio/kosh and the change made them difficult to use. Of course it's still possible for the user to distinguish between the keys if they'd like, and these mappings only apply to using our built-in ASCII translation. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/maple/keyboard.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index 7241bc71..cfa087ef 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -110,7 +110,7 @@ static const kbd_keymap_internal_t keymaps[] = { 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', /* 0x10 - 0x17 */ 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', /* 0x18 - 0x1F */ '3', '4', '5', '6', '7', '8', '9', '0', /* 0x20 - 0x27 */ - 10, 27, 8, 9, ' ', '-', '^', '@', /* 0x28 - 0x2F */ + 13, 27, 8, 9, ' ', '-', '^', '@', /* 0x28 - 0x2F */ '[', 0, ']', ';', ':', 0, ',', '.', /* 0x30 - 0x37 */ '/', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ @@ -160,7 +160,7 @@ static const kbd_keymap_internal_t keymaps[] = { 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', /* 0x10 - 0x17 */ 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', /* 0x18 - 0x1F */ '3', '4', '5', '6', '7', '8', '9', '0', /* 0x20 - 0x27 */ - 10, 27, 8, 9, ' ', '-', '=', '[', /* 0x28 - 0x2F */ + 13, 27, 8, 9, ' ', '-', '=', '[', /* 0x28 - 0x2F */ ']', '\\', 0, ';', '\'', '`', ',', '.', /* 0x30 - 0x37 */ '/', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ @@ -200,7 +200,7 @@ static const kbd_keymap_internal_t keymaps[] = { 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', /* 0x10 - 0x17 */ 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', /* 0x18 - 0x1F */ '3', '4', '5', '6', '7', '8', '9', '0', /* 0x20 - 0x27 */ - 10, 27, 8, 9, ' ', '-', '=', '[', /* 0x28 - 0x2F */ + 13, 27, 8, 9, ' ', '-', '=', '[', /* 0x28 - 0x2F */ ']', '\\', '#', ';', '\'', '`', ',', '.', /* 0x30 - 0x37 */ '/', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ @@ -256,7 +256,7 @@ static const kbd_keymap_internal_t keymaps[] = { 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', /* 0x10 - 0x17 */ 'u', 'v', 'w', 'x', 'z', 'y', '1', '2', /* 0x18 - 0x1F */ '3', '4', '5', '6', '7', '8', '9', '0', /* 0x20 - 0x27 */ - 10, 27, 8, 9, ' ', 0xdf, '\'', 0xfc, /* 0x28 - 0x2F */ + 13, 27, 8, 9, ' ', 0xdf, '\'', 0xfc, /* 0x28 - 0x2F */ '+', '\\', '#', 0xf6, 0xe4, '^', ',', '.', /* 0x30 - 0x37 */ '-', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ @@ -312,7 +312,7 @@ static const kbd_keymap_internal_t keymaps[] = { ',', 'n', 'o', 'p', 'a', 'r', 's', 't', /* 0x10 - 0x17 */ 'u', 'v', 'z', 'x', 'y', 'w', '&', 0xe9, /* 0x18 - 0x1F */ '\"', '\'', '(', '-', 0xe8, '_', 0xe7, 0xe0, /* 0x20 - 0x27 */ - 10, 27, 8, 9, ' ', ')', '=', '^', /* 0x28 - 0x2F */ + 13, 27, 8, 9, ' ', ')', '=', '^', /* 0x28 - 0x2F */ '$', 0, '*', 'm', 0xf9, 0xb2, ';', ':', /* 0x30 - 0x37 */ '!', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ @@ -377,7 +377,7 @@ static const kbd_keymap_internal_t keymaps[] = { 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', /* 0x10 - 0x17 */ 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', /* 0x18 - 0x1F */ '3', '4', '5', '6', '7', '8', '9', '0', /* 0x20 - 0x27 */ - 10, 27, 8, 9, ' ', '\'', 0xa1, '`', /* 0x28 - 0x2F */ + 13, 27, 8, 9, ' ', '\'', 0xa1, '`', /* 0x28 - 0x2F */ '+', 0, 0xe7, 0xf1, 0xb4, 0xba, ',', '.', /* 0x30 - 0x37 */ '-', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-22 23:58:19
|
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 3de8ac8f710ab4456c5abe5230c6615074fadb4f (commit) via fc1a6a049a86e5a8f5e163f14022961ca03199b7 (commit) via a1a315e9b828e2eda03beb236e771a6254e49482 (commit) via ac0c6ff2e5db4a971de79f671f109e60415d5ab4 (commit) from 50322ad313f8c46db7e1aa1391a153ae14f9f003 (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 3de8ac8f710ab4456c5abe5230c6615074fadb4f Author: QuzarDC <qu...@co...> Date: Sat Jun 7 15:23:36 2025 -0400 Apply noinline if we expect a function call for stack tracing. In the examples, ensure that the functions we are stack tracing are not inlined as it would defeat the purpose of the example. Inside the stack tracing functions and assert, there are assumptions made that we are going back by fixed numbers of frame pointers, so avoid inlining as that would the intended tracing. commit fc1a6a049a86e5a8f5e163f14022961ca03199b7 Author: QuzarDC <qu...@co...> Date: Sat Jun 7 13:54:47 2025 -0400 arch: Mark register access inlines as `always_inline` The behavior of these would break if the function call is not inlined, so ensure that they are always inlined. commit a1a315e9b828e2eda03beb236e771a6254e49482 Author: QuzarDC <qu...@co...> Date: Sat Jun 7 13:43:55 2025 -0400 irq: Don't deref fp twice. In #600 there was a change to store `arch_fptr_ret_addr` as it was being tested as valid before being printed. Unfortunately this was done in a way that overwrote the current fp being worked on. So when it came time to pass it to `arch_fptr_next` another layer of deference was happening. commit ac0c6ff2e5db4a971de79f671f109e60415d5ab4 Author: QuzarDC <qu...@co...> Date: Sat Jun 7 13:06:27 2025 -0400 stack: Don't deref fp twice. In #600 there was a change to store `arch_fptr_ret_addr` as it was being tested as valid before being printed. Unfortunately this was done in a way that overwrote the current fp being worked on. So when it came time to pass it to `arch_fptr_next` another layer of deference was happening. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/basic/asserthnd/asserthnd.c | 8 ++++++-- examples/dreamcast/basic/stacktrace/stacktrace.c | 6 +++++- kernel/arch/dreamcast/include/arch/arch.h | 4 ++-- kernel/arch/dreamcast/kernel/irq.c | 9 +++++---- kernel/arch/dreamcast/kernel/stack.c | 15 ++++++++------- kernel/libc/koslib/assert.c | 2 +- 6 files changed, 27 insertions(+), 17 deletions(-) diff --git a/examples/dreamcast/basic/asserthnd/asserthnd.c b/examples/dreamcast/basic/asserthnd/asserthnd.c index a0a06a60..abe486dd 100644 --- a/examples/dreamcast/basic/asserthnd/asserthnd.c +++ b/examples/dreamcast/basic/asserthnd/asserthnd.c @@ -35,14 +35,18 @@ assuming you compiled your program with -g: */ -void func2(void) { +/* These are marked as __noinline to ensure the compiler + doesn't try to get smart and inline them which would + defeat the purpose of the example. +*/ +__noinline void func2(void) { int a = 5; assert_msg(a != 5, "This is a test message!"); assert(a != 5); } -void func1(void) { +__noinline void func1(void) { func2(); } diff --git a/examples/dreamcast/basic/stacktrace/stacktrace.c b/examples/dreamcast/basic/stacktrace/stacktrace.c index 74eaa1f7..67051a9b 100644 --- a/examples/dreamcast/basic/stacktrace/stacktrace.c +++ b/examples/dreamcast/basic/stacktrace/stacktrace.c @@ -6,7 +6,11 @@ #include <kos.h> -void func(void) { +/* This is marked as __noinline to ensure the compiler + doesn't try to get smart and inline it which would + defeat the purpose of the example. +*/ +__noinline void func(void) { arch_stk_trace(0); } diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h index b26d9ea3..f79915de 100644 --- a/kernel/arch/dreamcast/include/arch/arch.h +++ b/kernel/arch/dreamcast/include/arch/arch.h @@ -367,7 +367,7 @@ static inline void arch_sleep(void) { \return The return address of the current function. */ -static inline uintptr_t arch_get_ret_addr(void) { +static __always_inline uintptr_t arch_get_ret_addr(void) { uintptr_t pr; __asm__ __volatile__("sts pr,%0\n" : "=r"(pr)); @@ -386,7 +386,7 @@ static inline uintptr_t arch_get_ret_addr(void) { \return The frame pointer from the current function. \note This only works if you don't disable frame pointers. */ -static inline uintptr_t arch_get_fptr(void) { +static __always_inline uintptr_t arch_get_fptr(void) { register uintptr_t fp __asm__("r14"); return fp; diff --git a/kernel/arch/dreamcast/kernel/irq.c b/kernel/arch/dreamcast/kernel/irq.c index 6201e93b..a7b4c127 100644 --- a/kernel/arch/dreamcast/kernel/irq.c +++ b/kernel/arch/dreamcast/kernel/irq.c @@ -153,8 +153,9 @@ static char *irq_exception_string(irq_t evt) { /* Print a kernel panic reg dump */ extern irq_context_t *irq_srt_addr; -static void irq_dump_regs(int code, irq_t evt) { +void irq_dump_regs(int code, irq_t evt) { uint32_t fp; + uint32_t ret_addr; uint32_t *regs = irq_srt_addr->r; bool valid_pc; bool valid_pr; @@ -191,13 +192,13 @@ static void irq_dump_regs(int code, irq_t evt) { break; /* Get the return address from the function pointer */ - fp = arch_fptr_ret_addr(fp); + ret_addr = arch_fptr_ret_addr(fp); /* Validate the return address */ - if(!arch_valid_text_address(fp)) + if(!arch_valid_text_address(ret_addr)) break; - dbglog(DBG_DEAD, " %08lx", fp); + dbglog(DBG_DEAD, " %08lx", ret_addr); fp = arch_fptr_next(fp); } } diff --git a/kernel/arch/dreamcast/kernel/stack.c b/kernel/arch/dreamcast/kernel/stack.c index 1883a1da..31dffb16 100644 --- a/kernel/arch/dreamcast/kernel/stack.c +++ b/kernel/arch/dreamcast/kernel/stack.c @@ -25,13 +25,14 @@ extern uintptr_t arch_stack_32m __attribute__((weak,alias("arch_stack_32m_dft")) /* Do a stack trace from the current function; leave off the first n frames (i.e., in assert()). */ -void arch_stk_trace(int n) { +__noinline void arch_stk_trace(int n) { arch_stk_trace_at(arch_get_fptr(), n + 1); } /* Do a stack trace from the given frame pointer (useful for things like tracing from an ISR); leave off the first n frames. */ void arch_stk_trace_at(uint32_t fp, size_t n) { + uint32_t ret_addr; if(!__is_defined(FRAME_POINTERS)) { dbgio_printf("Stack Trace: frame pointers not enabled!\n"); return; @@ -42,20 +43,20 @@ void arch_stk_trace_at(uint32_t fp, size_t n) { while(fp != 0xffffffff) { /* Validate the function pointer (fp) */ if((fp & 3) || (fp < 0x8c000000) || (fp > _arch_mem_top)) { - dbgio_printf(" (invalid frame pointer)\n"); + dbgio_printf(" %08lx (invalid frame pointer)\n", fp); break; } - + if(n == 0) { /* Get the return address from the function pointer */ - fp = arch_fptr_ret_addr(fp); + ret_addr = arch_fptr_ret_addr(fp); /* Validate the return address */ - if(!arch_valid_address(fp)) { - dbgio_printf(" %08lx (invalid return address)\n", fp); + if(!arch_valid_address(ret_addr)) { + dbgio_printf(" %08lx (invalid return address)\n", ret_addr); break; } else - dbgio_printf(" %08lx\n", fp); + dbgio_printf(" %08lx\n", ret_addr); } else n--; diff --git a/kernel/libc/koslib/assert.c b/kernel/libc/koslib/assert.c index fdf8c2a6..ca610448 100644 --- a/kernel/libc/koslib/assert.c +++ b/kernel/libc/koslib/assert.c @@ -16,7 +16,7 @@ #include <arch/stack.h> /* The default assert handler */ -static void __noreturn assert_handler_default(const char *file, int line, +__noinline static void __noreturn assert_handler_default(const char *file, int line, const char *expr, const char *msg, const char *func) { dbglog(DBG_CRITICAL, "\n*** ASSERTION FAILURE ***\n"); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-19 22:58:04
|
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 50322ad313f8c46db7e1aa1391a153ae14f9f003 (commit) via 029c9098f68062e1c5c01a59d0ce3b20467249b3 (commit) via 3bf162a67d64da9b217124c7635bad4e182da9dd (commit) via b43ff2b8eaa80ec2d224b87c2c5a933fa451a7e0 (commit) via ff6f3ac5f3f6c20fd2645070046ea85004db9915 (commit) via 7e1609327c79e1614c6f48b5f325357add4e2ddc (commit) via 380688e926ed40c3149b00df7d2feaa77be2cab3 (commit) via 343c58a5c1172485f447928f5a0c6c4a9dd934d0 (commit) from 582833981e3c2de799094f2a0c3643104554361a (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 50322ad313f8c46db7e1aa1391a153ae14f9f003 Author: Paul Cercueil <pa...@cr...> Date: Tue Jun 17 19:50:51 2025 +0200 cdrom: Simplify vblank code Since nothing waited on the "cmd_done" semaphore anymore, the code signaling it as well as the semaphore itself can be dropped. The timeout code can also be dropped, as it was now handled by the cdrom_poll() function. The VBLANK interrupt handler now only has to check for errors when DMA is used. Signed-off-by: Paul Cercueil <pa...@cr...> commit 029c9098f68062e1c5c01a59d0ce3b20467249b3 Author: Paul Cercueil <pa...@cr...> Date: Tue Jun 17 15:17:24 2025 +0200 cdrom: Use cdrom_poll() in cdrom_stream_request() Factorize code by using cdrom_poll() in cdrom_stream_request(). Note how the calls to syscall_gdrom_dma_check() and syscall_gdrom_pio_check() are replaced by a call to cdrom_stream_progress() for further factorization. Also, the ERR_NO_ACTIVE value returned by the poll callback function is just here to signal the code calling cdrom_poll() that we got a "NO_ACTIVE" or "COMPLETED" response. Signed-off-by: Paul Cercueil <pa...@cr...> commit 3bf162a67d64da9b217124c7635bad4e182da9dd Author: Paul Cercueil <pa...@cr...> Date: Tue Jun 17 15:12:22 2025 +0200 cdrom: Use cdrom_poll() in cdrom_stream_stop() Factorize code by using cdrom_poll() in cdrom_stream_stop(). Signed-off-by: Paul Cercueil <pa...@cr...> commit b43ff2b8eaa80ec2d224b87c2c5a933fa451a7e0 Author: Paul Cercueil <pa...@cr...> Date: Tue Jun 17 15:00:54 2025 +0200 cdrom: Use cdrom_poll() in cdrom_read_sectors_dma_irq() Factorize code by using cdrom_poll() in cdrom_read_sectors_dma_irq(). Signed-off-by: Paul Cercueil <pa...@cr...> commit ff6f3ac5f3f6c20fd2645070046ea85004db9915 Author: Paul Cercueil <pa...@cr...> Date: Tue Jun 17 14:59:09 2025 +0200 cdrom: Use cdrom_poll() in cdrom_get_status() Factorize code by using cdrom_poll() in cdrom_get_status(). Signed-off-by: Paul Cercueil <pa...@cr...> commit 7e1609327c79e1614c6f48b5f325357add4e2ddc Author: Paul Cercueil <pa...@cr...> Date: Tue Jun 17 14:57:16 2025 +0200 cdrom: Use cdrom_poll() in cdrom_abort_cmd() Factorize code by using cdrom_poll() in cdrom_abort_cmd(). Signed-off-by: Paul Cercueil <pa...@cr...> commit 380688e926ed40c3149b00df7d2feaa77be2cab3 Author: Paul Cercueil <pa...@cr...> Date: Tue Jun 17 14:41:51 2025 +0200 cdrom: Use cdrom_poll() in cdrom_exec_cmd_timed() Factorize code by using cdrom_poll() in cdrom_exec_cmd_timed(). This commit also fixes cdrom_exec_cmd_timed() being extremely slow; that's because after the command was sent to the GD drive, the response was only obtained after the next VBLANK, which meant having to wait for up to 16ms. Now, instead of waiting on the "cmd_done" semaphore signaled in the vblank interrupt, we poll for the command response until we obtain it. It will cause a slight CPU overhead but will be much faster. Signed-off-by: Paul Cercueil <pa...@cr...> commit 343c58a5c1172485f447928f5a0c6c4a9dd934d0 Author: Paul Cercueil <pa...@cr...> Date: Tue Jun 17 14:39:43 2025 +0200 cdrom: Add function cdrom_poll(), use it in cdrom_req_cmd() The cdrom_poll() function will be used every time we need to poll the GD-ROM drive using syscalls. Use it in cdrom_req_cmd(), which changes from a 10-turn poll to a poll with a 10ms timeout, which should be plenty of time. Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/cdrom.c | 330 +++++++++++++++------------------ 1 file changed, 147 insertions(+), 183 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/cdrom.c b/kernel/arch/dreamcast/hardware/cdrom.c index 46d9551d..78f4aa20 100644 --- a/kernel/arch/dreamcast/hardware/cdrom.c +++ b/kernel/arch/dreamcast/hardware/cdrom.c @@ -45,15 +45,21 @@ also for the CDDA playback routines. typedef int gdc_cmd_hnd_t; +struct cmd_req_data { + int cmd; + void *data; +}; + +struct cmd_transfer_data { + gdc_cmd_hnd_t hnd; + size_t size; +}; + /* The G1 ATA access mutex */ mutex_t _g1_ata_mutex = MUTEX_INITIALIZER; /* Command handling */ static gdc_cmd_hnd_t cmd_hnd = 0; -static semaphore_t cmd_done = SEM_INITIALIZER(0); -static bool cmd_in_progress = false; -static uint64_t cmd_begin_time = 0; -static uint32_t cmd_timeout = 0; static int cmd_response = NO_ACTIVE; static int32_t cmd_status[4] = { 0, /* Error code 1 */ @@ -84,21 +90,105 @@ int cdrom_set_sector_size(int size) { return cdrom_reinit_ex(-1, -1, size); } +static int cdrom_poll(void *d, uint32_t timeout, int (*cb)(void *)) +{ + uint64_t start_time; + int ret; + + if(timeout) + start_time = timer_ms_gettime64(); + + do { + ret = (*cb)(d); + if(ret) + return ret; + + if(!irq_inside_int()) + thd_pass(); + } while(!timeout || (timer_ms_gettime64() - start_time) < timeout); + + return ERR_TIMEOUT; +} + +static int cdrom_submit_cmd(void *d) { + struct cmd_req_data *req = d; + int ret; + + ret = syscall_gdrom_send_command(req->cmd, req->data); + + syscall_gdrom_exec_server(); + + return ret; +} + static inline gdc_cmd_hnd_t cdrom_req_cmd(int cmd, void *param) { - gdc_cmd_hnd_t hnd = 0; - int n; + struct cmd_req_data req = { cmd, param }; + assert(cmd > 0 && cmd < CMD_MAX); - /* Submit the command */ - for(n = 0; n < 10; ++n) { - hnd = syscall_gdrom_send_command(cmd, param); - if(hnd != 0) { - break; - } - syscall_gdrom_exec_server(); - thd_pass(); - } - return hnd; + /* Submit the command, retry if needed for 10ms */ + return cdrom_poll(&req, 10, cdrom_submit_cmd); +} + +static int cdrom_check_ready(void *d) { + syscall_gdrom_exec_server(); + + cmd_response = syscall_gdrom_check_command(*(int *)d, cmd_status); + if(cmd_response < 0) + return ERR_SYS; + + return cmd_response != BUSY; +} + +static int cdrom_check_cmd_done(void *d) { + syscall_gdrom_exec_server(); + + cmd_response = syscall_gdrom_check_command(*(int *)d, cmd_status); + if(cmd_response < 0) + return ERR_SYS; + + return cmd_response != BUSY && cmd_response != PROCESSING; +} + +static int cdrom_check_drive_ready(void *d) { + int rv = syscall_gdrom_check_drive(d); + return rv != BUSY; +} + +static int cdrom_check_abort_done(void *d) { + syscall_gdrom_exec_server(); + + cmd_response = syscall_gdrom_check_command(*(gdc_cmd_hnd_t *)d, cmd_status); + if(cmd_response < 0) + return ERR_SYS; + + return cmd_response == NO_ACTIVE || cmd_response == COMPLETED; +} + +static int cdrom_check_abort_streaming(void *d) { + syscall_gdrom_exec_server(); + + cmd_response = syscall_gdrom_check_command(*(gdc_cmd_hnd_t *)d, cmd_status); + if(cmd_response < 0) + return ERR_SYS; + + return cmd_response == NO_ACTIVE || cmd_response == COMPLETED + || cmd_response == STREAMING; +} + +static int cdrom_check_transfer(void *d) { + struct cmd_transfer_data *data = d; + + syscall_gdrom_exec_server(); + + cmd_response = syscall_gdrom_check_command(data->hnd, cmd_status); + if(cmd_response < 0) + return ERR_SYS; + + if(cmd_response == NO_ACTIVE || cmd_response == COMPLETED) + return ERR_NO_ACTIVE; + + return cdrom_stream_progress(&data->size) == 0; } /* Command execution sequence */ @@ -117,31 +207,9 @@ int cdrom_exec_cmd_timed(int cmd, void *param, uint32_t timeout) { } /* Start the process of executing the command. */ - do { - syscall_gdrom_exec_server(); - cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); - - if(cmd_response != BUSY) { - break; - } - thd_pass(); - } while(1); - - if(cmd_response == PROCESSING) { - cmd_timeout = timeout; - - if(cmd_timeout) { - cmd_begin_time = timer_ms_gettime64(); - } - cmd_in_progress = true; - sem_wait(&cmd_done); - - /* If the command is still in progress, it timed out. */ - if(cmd_in_progress) { - cmd_in_progress = false; - cdrom_abort_cmd(1000, true); - return ERR_TIMEOUT; - } + if(cdrom_poll(&cmd_hnd, timeout, cdrom_check_cmd_done) == ERR_TIMEOUT) { + cdrom_abort_cmd(1000, true); + return ERR_TIMEOUT; } if(cmd_response != STREAMING) { @@ -169,14 +237,12 @@ int cdrom_exec_cmd_timed(int cmd, void *param, uint32_t timeout) { int cdrom_abort_cmd(uint32_t timeout, bool abort_dma) { int rv = ERR_OK; - uint64_t begin; int old = irq_disable(); if(cmd_hnd <= 0) { irq_restore(old); return ERR_NO_ACTIVE; } - cmd_in_progress = false; if(abort_dma && dma_in_progress) { dma_in_progress = false; @@ -191,27 +257,12 @@ int cdrom_abort_cmd(uint32_t timeout, bool abort_dma) { irq_restore(old); syscall_gdrom_abort_command(cmd_hnd); - if(timeout) { - begin = timer_ms_gettime64(); + if(cdrom_poll(&cmd_hnd, timeout, cdrom_check_abort_done) == ERR_TIMEOUT) { + dbglog(DBG_ERROR, "cdrom_abort_cmd: Timeout exceeded, resetting.\n"); + rv = ERR_TIMEOUT; + syscall_gdrom_reset(); + syscall_gdrom_init(); } - do { - syscall_gdrom_exec_server(); - cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); - - if(cmd_response == NO_ACTIVE || cmd_response == COMPLETED) { - break; - } - if(timeout) { - if((timer_ms_gettime64() - begin) >= timeout) { - dbglog(DBG_ERROR, "cdrom_abort_cmd: Timeout exceeded, resetting.\n"); - rv = ERR_TIMEOUT; - syscall_gdrom_reset(); - syscall_gdrom_init(); - break; - } - } - thd_pass(); - } while(1); cmd_hnd = 0; stream_mode = -1; @@ -226,8 +277,8 @@ int cdrom_abort_cmd(uint32_t timeout, bool abort_dma) { /* Return the status of the drive as two integers (see constants) */ int cdrom_get_status(int *status, int *disc_type) { - int rv = ERR_OK; uint32_t params[2]; + int rv; /* We might be called in an interrupt to check for ISO cache flushing, so make sure we're not interrupting something @@ -236,18 +287,13 @@ int cdrom_get_status(int *status, int *disc_type) { /* DH: Figure out a better return to signal error */ return -1; - do { - rv = syscall_gdrom_check_drive(params); - - if(rv != BUSY) { - break; - } - thd_pass(); - } while(1); + rv = cdrom_poll(params, 0, cdrom_check_drive_ready); mutex_unlock(&_g1_ata_mutex); if(rv >= 0) { + rv = ERR_OK; + if(status != NULL) *status = params[0]; @@ -359,38 +405,15 @@ static int cdrom_read_sectors_dma_irq(void *params) { dma_blocking = true; /* Start the process of executing the command. */ - do { - syscall_gdrom_exec_server(); - cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); - - if(cmd_response != BUSY) { - break; - } - thd_pass(); - } while(1); + cdrom_poll(&cmd_hnd, 0, cdrom_check_ready); if(cmd_response == PROCESSING) { - cmd_timeout = 0; - /* Poll syscalls in vblank IRQ in case an unexpected error occurs - while we wait DMA IRQ. */ - cmd_in_progress = true; - /* Wait DMA is finished or command failed. */ sem_wait(&dma_done); /* Just to make sure the command is finished properly. Usually we are already done here. */ - if(cmd_response == PROCESSING || cmd_response == BUSY) { - do { - syscall_gdrom_exec_server(); - cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); - - if(cmd_response != PROCESSING && cmd_response != BUSY) { - break; - } - thd_pass(); - } while(1); - } + cdrom_poll(&cmd_hnd, 0, cdrom_check_cmd_done); } else { /* The command can complete or fails immediately, @@ -506,23 +529,12 @@ int cdrom_stream_stop(bool abort_dma) { } mutex_lock(&_g1_ata_mutex); - do { - syscall_gdrom_exec_server(); - cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); + cdrom_poll(&cmd_hnd, 0, cdrom_check_abort_streaming); - if(cmd_response < 0) { - rv = ERR_SYS; - break; - } - else if(cmd_response == COMPLETED || cmd_response == NO_ACTIVE) { - break; - } - else if(cmd_response == STREAMING) { - mutex_unlock(&_g1_ata_mutex); - return cdrom_abort_cmd(1000, false); - } - thd_pass(); - } while(1); + if(cmd_response == STREAMING) { + mutex_unlock(&_g1_ata_mutex); + return cdrom_abort_cmd(1000, false); + } cmd_hnd = 0; stream_mode = -1; @@ -537,7 +549,7 @@ int cdrom_stream_stop(bool abort_dma) { int cdrom_stream_request(void *buffer, size_t size, bool block) { int rs, rv = ERR_OK; int32_t params[2]; - size_t check_size = -1; + struct cmd_transfer_data data; if(cmd_hnd <= 0) { return ERR_NO_ACTIVE; @@ -569,7 +581,6 @@ int cdrom_stream_request(void *buffer, size_t size, bool block) { mutex_lock_scoped(&_g1_ata_mutex); if(stream_mode == CDROM_READ_DMA) { - dma_in_progress = true; dma_blocking = block; @@ -591,55 +602,23 @@ int cdrom_stream_request(void *buffer, size_t size, bool block) { return rv; } sem_wait(&dma_done); - - do { - syscall_gdrom_exec_server(); - cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); - - if(cmd_response < 0) { - rv = ERR_SYS; - break; - } - else if(cmd_response == COMPLETED || cmd_response == NO_ACTIVE) { - cmd_hnd = 0; - break; - } - else if(syscall_gdrom_dma_check(cmd_hnd, &check_size) == 0) { - break; - } - thd_pass(); - - } while(1); } - else if(stream_mode == CDROM_READ_PIO) { - + else { rs = syscall_gdrom_pio_transfer(cmd_hnd, params); - - if(rs < 0) { + if(rs < 0) return ERR_SYS; - } - do { - syscall_gdrom_exec_server(); - cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); + } - if(cmd_response < 0) { - rv = ERR_SYS; - break; - } - else if(cmd_response == COMPLETED || cmd_response == NO_ACTIVE) { - cmd_hnd = 0; - break; - } - else if(syscall_gdrom_pio_check(cmd_hnd, &check_size) == 0) { - /* Syscalls doesn't call it on last reading in PIO mode. - Looks like a bug, fixing it. */ - if(check_size == 0 && stream_cb) { - stream_cb(stream_cb_param); - } - break; - } - thd_pass(); - } while(1); + data = (struct cmd_transfer_data){ cmd_hnd, 0 }; + + if(cdrom_poll(&data, 0, cdrom_check_transfer) == ERR_NO_ACTIVE) { + cmd_hnd = 0; + } + else if(stream_mode == CDROM_READ_PIO) { + /* Syscalls doesn't call it on last reading in PIO mode. + Looks like a bug, fixing it. */ + if(data.size == 0 && stream_cb) + stream_cb(stream_cb_param); } return rv; @@ -772,32 +751,19 @@ static void cdrom_vblank(uint32 evt, void *data) { (void)evt; (void)data; - if(!cmd_in_progress) { - return; - } - - syscall_gdrom_exec_server(); - cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); - - if(cmd_response != PROCESSING && cmd_response != BUSY) { - cmd_in_progress = false; + if(dma_in_progress) { + syscall_gdrom_exec_server(); + cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); - if(dma_in_progress) { + if(cmd_response != PROCESSING && cmd_response != BUSY && cmd_response != STREAMING) { dma_in_progress = false; if(dma_blocking) { dma_blocking = false; sem_signal(&dma_done); + thd_schedule(1, 0); } } - else { - sem_signal(&cmd_done); - } - thd_schedule(1, 0); - } - else if(cmd_timeout && (timer_ms_gettime64() - cmd_begin_time) >= cmd_timeout) { - sem_signal(&cmd_done); - thd_schedule(1, 0); } } @@ -807,11 +773,9 @@ static void g1_dma_irq_hnd(uint32_t code, void *data) { if(dma_in_progress) { dma_in_progress = false; - if(cmd_in_progress) { - cmd_in_progress = false; - syscall_gdrom_exec_server(); - cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); - } + syscall_gdrom_exec_server(); + cmd_response = syscall_gdrom_check_command(cmd_hnd, cmd_status); + if(dma_blocking) { dma_blocking = false; sem_signal(&dma_done); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-19 22:32:06
|
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 582833981e3c2de799094f2a0c3643104554361a (commit) from dd4514b72ac9e5a96660e5078c975c613d999300 (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 582833981e3c2de799094f2a0c3643104554361a Author: QuzarDC <qu...@co...> Date: Sat May 31 02:33:49 2025 -0400 Fix various warnings in examples. Uninitialized variables, unused args, and signedness mismatches.nehe26 got a bit deeper of a cleanup in order to address unchecked allocations. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/2ndmix/2ndmix.c | 2 +- examples/dreamcast/basic/breaking/breaking.c | 2 +- examples/dreamcast/basic/mmu/nullptr/nullptr.c | 2 +- examples/dreamcast/cdrom/stream/cd-stream-test.c | 7 ++- examples/dreamcast/cpp/concurrency/concurrency.cpp | 2 +- examples/dreamcast/gldc/basic/vq/vq-example.c | 2 +- examples/dreamcast/gldc/nehe/nehe26/nehe26.c | 72 +++++++++++++--------- .../dreamcast/sound/ghettoplay-vorbis/songmenu.c | 2 + 8 files changed, 54 insertions(+), 37 deletions(-) diff --git a/examples/dreamcast/2ndmix/2ndmix.c b/examples/dreamcast/2ndmix/2ndmix.c index 25308251..90548f50 100644 --- a/examples/dreamcast/2ndmix/2ndmix.c +++ b/examples/dreamcast/2ndmix/2ndmix.c @@ -731,7 +731,7 @@ void font_one_frame(void) { } void font_init(void) { - int x, y, c; + size_t x, y, c; uint8 pcxpall[768]; volatile uint16 *vtex; uint16 val; diff --git a/examples/dreamcast/basic/breaking/breaking.c b/examples/dreamcast/basic/breaking/breaking.c index a7d673e4..e8108370 100644 --- a/examples/dreamcast/basic/breaking/breaking.c +++ b/examples/dreamcast/basic/breaking/breaking.c @@ -251,7 +251,7 @@ static bool break_on_sized_operand_region_access_value_range(void) { VERIFY(!handled); /* Read from the region-of-interest as the wrong data size. */ - volatile uint16_t tmp16; (void)tmp16; + volatile uint16_t tmp16 = 0; (void)tmp16; tmp16 = ((uint16_t *)vars)[1023 / sizeof(uint16_t)]; VERIFY(!handled); diff --git a/examples/dreamcast/basic/mmu/nullptr/nullptr.c b/examples/dreamcast/basic/mmu/nullptr/nullptr.c index 861570fd..7ae3a386 100644 --- a/examples/dreamcast/basic/mmu/nullptr/nullptr.c +++ b/examples/dreamcast/basic/mmu/nullptr/nullptr.c @@ -14,7 +14,7 @@ KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); -mmupage_t * catchnull(mmucontext_t * c, int vp) { +mmupage_t * catchnull(mmucontext_t *, int vp) { printf("Caught us trying to use a bad pointer!\n"); printf("The pointer page was %08x\n", vp << PAGESIZE_BITS); printf("The address of the attempt was %08lx\n", diff --git a/examples/dreamcast/cdrom/stream/cd-stream-test.c b/examples/dreamcast/cdrom/stream/cd-stream-test.c index b3a2044d..7a9e83bb 100644 --- a/examples/dreamcast/cdrom/stream/cd-stream-test.c +++ b/examples/dreamcast/cdrom/stream/cd-stream-test.c @@ -116,8 +116,8 @@ static int cd_stream_test(uint32_t lba, uint8_t *buffer, size_t size, int mode) return 0; } -int print_diff(uint8_t *pio_buf, uint8_t *dma_buf, size_t size) { - int i, j, rv = 0; +size_t print_diff(uint8_t *pio_buf, uint8_t *dma_buf, size_t size) { + size_t i, j, rv = 0; for(i = 0; i < size; ++i) { if (dma_buf[i] != pio_buf[i]) { @@ -143,7 +143,8 @@ int print_diff(uint8_t *pio_buf, uint8_t *dma_buf, size_t size) { } int main(int argc, char *argv[]) { - int rs, i; + int rs; + size_t i; uint32_t lba; CDROM_TOC toc; diff --git a/examples/dreamcast/cpp/concurrency/concurrency.cpp b/examples/dreamcast/cpp/concurrency/concurrency.cpp index b623f300..594663cf 100644 --- a/examples/dreamcast/cpp/concurrency/concurrency.cpp +++ b/examples/dreamcast/cpp/concurrency/concurrency.cpp @@ -147,7 +147,7 @@ static void test_semaphore() { struct LatchJob { const std::string name; std::string product{"not worked"}; - std::thread action; + std::thread action{std::thread()}; }; static void test_latch() { diff --git a/examples/dreamcast/gldc/basic/vq/vq-example.c b/examples/dreamcast/gldc/basic/vq/vq-example.c index 86b95ad1..acc79995 100644 --- a/examples/dreamcast/gldc/basic/vq/vq-example.c +++ b/examples/dreamcast/gldc/basic/vq/vq-example.c @@ -42,7 +42,7 @@ static int loadtxr(void) { 512, /* Texture Width */ 512, /* Texture Height */ 0, /* This bit must be set to 0 */ - fruit_end - fruit, /* Compressed Texture Size*/ + (uintptr_t)fruit_end - (uintptr_t)fruit, /* Compressed Texture Size*/ fruit); /* Address of texture data in RAM: OpenGL will load the texture into VRAM for you. Because of this, make sure to call glDeleteTextures() as needed, as that will free the VRAM allocated for the texture. */ diff --git a/examples/dreamcast/gldc/nehe/nehe26/nehe26.c b/examples/dreamcast/gldc/nehe/nehe26/nehe26.c index f5195162..fe1e563a 100644 --- a/examples/dreamcast/gldc/nehe/nehe26/nehe26.c +++ b/examples/dreamcast/gldc/nehe/nehe26/nehe26.c @@ -49,28 +49,32 @@ int key = 1; /* Make sure same morph key not pressed */ int step = 0, steps = 200; /* Step counter and maximum number of steps */ bool morph = false; /* Default morph to false (not morphing) */ -int maxver; /* Holds the max number of vertices */ +size_t maxver; /* Holds the max number of vertices */ object morph1, morph2, morph3, morph4, /* Our 4 morphable objects */ helper, *sour, *dest; /* Helper, source, destination object */ #define MORPHS 4 /* Function to allocate memory for an object */ -void objallocate(object *k, int n) { +bool objallocate(object *k, size_t n) { /* Sets points equal to vertex * number of vertices */ - k->points = (vertex *)malloc(sizeof(vertex) * n); + k->points = (vertex *)calloc(n, sizeof(vertex)); + + /* Check if we actually got memory back */ + if(k->points) + return true; + + return false; } /* Function deallocate memory for an object */ void objfree(object *k) { - free(k->points); } - /* Function to release/destroy our resources and restoring the old desktop */ -void Quit(int returnCode) { +void Quit(void) { /* Deallocate the objects' memory */ objfree(&morph1); @@ -81,42 +85,51 @@ void Quit(int returnCode) { } /* function Loads Object From File (name) */ -void objload(char *name, object *k) { +bool objload(char *name, object *k) { - int ver; /* Will hold vertex count */ + size_t ver; /* Will hold vertex count */ float rx, ry, rz; /* Hold vertex X, Y & Z position */ FILE *filein; /* Filename to open */ - int i; /* Simple loop variable */ + size_t i; /* Simple loop variable */ + bool rv = false; /* return value */ printf(" [objload] file: %s\n", name); /* Opens the file for reading */ filein = fopen(name, "r"); + + if(!filein) + return rv; + /* Reads the number of verts in the file */ fread(&ver, sizeof(int), 1, filein); /* Sets objects verts variable to equal the value of ver */ k->verts = ver; /* Jumps to code that allocates RAM to hold the object */ - objallocate(k, ver); - - /* Loops through the vertices */ - for(i = 0; i < ver; i++) { - /* Reads the next three verts */ - fread(&rx, sizeof(float), 1, filein); - fread(&ry, sizeof(float), 1, filein); - fread(&rz, sizeof(float), 1, filein); - /* Set our object's x, y, z points */ - k->points[i].x = rx; - k->points[i].y = ry; - k->points[i].z = rz; + if(objallocate(k, ver)) { + /* Loops through the vertices */ + for(i = 0; i < ver; i++) { + /* Reads the next three verts */ + fread(&rx, sizeof(float), 1, filein); + fread(&ry, sizeof(float), 1, filein); + fread(&rz, sizeof(float), 1, filein); + /* Set our object's x, y, z points */ + k->points[i].x = rx; + k->points[i].y = ry; + k->points[i].z = rz; + } + + /* If ver is greater than maxver set maxver equal to ver */ + if(ver > maxver) + maxver = ver; + + rv = true; } /* Close the file */ fclose(filein); - /* If ver is greater than maxver set maxver equal to ver */ - if(ver > maxver) - maxver = ver; + return rv; } /* Function to calculate movement of points during morphing */ @@ -133,7 +146,7 @@ vertex calculate(int i) { } /* General OpenGL initialization function */ -int initGL(GLvoid) { +bool initGL(GLvoid) { int i; /* Simple looping variable */ @@ -199,7 +212,7 @@ int initGL(GLvoid) { /* Source & destination are set to equal first object (morph1) */ sour = dest = &morph1; - return(true); + return true; } void draw_gl(void) { @@ -317,7 +330,8 @@ int main(int argc, char **argv) { /* Get basic stuff initialized */ glKosInit(); - initGL(); + if(!initGL()) + return EXIT_FAILURE; printf("Entering main loop\n"); @@ -383,7 +397,7 @@ int main(int argc, char **argv) { glKosSwapBuffers(); } - Quit(0); - return 0; + Quit(); + return EXIT_SUCCESS; } diff --git a/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c b/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c index 8c4d8f61..dccc685e 100644 --- a/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c +++ b/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c @@ -53,6 +53,7 @@ static int curpos = 0; static int filtinitted = 0; static void snd_hook(int strm, void * obj, int freq, int chn, void ** buf, int *req) { + (void)strm; (void)obj, (void)freq, (void)chn; int actual; uint64 t; @@ -115,6 +116,7 @@ static void draw_wave(void) { static void *load_song_list(void * p) { + (void)p; file_t d; d = fs_open(curdir, O_RDONLY | O_DIR); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-19 22:31:04
|
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 dd4514b72ac9e5a96660e5078c975c613d999300 (commit) from 12bdacd1c44d843a7eac1b4dacb835a7d88cf145 (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 dd4514b72ac9e5a96660e5078c975c613d999300 Author: QuzarDC <qu...@co...> Date: Thu Jun 19 05:19:19 2025 -0400 Ensure that the thread's return can fit in the variable provided. `thd_join` is meant to take a `void **` by passing instead `bool *` you could get all sorts of bad stuff when the data overflows the bool. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/basic/threading/barrier/barrier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dreamcast/basic/threading/barrier/barrier.c b/examples/dreamcast/basic/threading/barrier/barrier.c index b7f13c06..51b1de2a 100644 --- a/examples/dreamcast/basic/threading/barrier/barrier.c +++ b/examples/dreamcast/basic/threading/barrier/barrier.c @@ -134,8 +134,8 @@ int main(int argc, char* argv[]) { printf("Joining threads...\n"); for(unsigned t = 0; t < THREAD_COUNT - 1; ++t) { - bool thread_ret; - const int ret = thd_join(threads[t], (void**)&thread_ret); + void *thread_ret; + const int ret = thd_join(threads[t], &thread_ret); if(ret) { fprintf(stderr, "Failed to join thread %u with code: %d!\n", hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-19 18:49:10
|
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 12bdacd1c44d843a7eac1b4dacb835a7d88cf145 (commit) via ccd79960397607e6713f68f5c3172bd88ea33675 (commit) via b7cb5ece15b83daa47d4b20df5fe2640322fde0f (commit) via 7dba4687fec273ecb9e7714afe79647c1432b959 (commit) via d4d96fcd57972df3a67ce1c3fbada650721407a3 (commit) from af47450125b252204d3a9af3a76c837cca281ed1 (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 12bdacd1c44d843a7eac1b4dacb835a7d88cf145 Author: QuzarDC <qu...@co...> Date: Wed Jun 18 00:33:55 2025 -0400 vmu_pkg: add bounds checks. Avoid memcpy from NULL and accepting a pkg with an invalid `data_len`. commit ccd79960397607e6713f68f5c3172bd88ea33675 Author: QuzarDC <qu...@co...> Date: Wed Jun 18 00:08:06 2025 -0400 Create define for data size and ensure the pkg is filled out. commit b7cb5ece15b83daa47d4b20df5fe2640322fde0f Author: QuzarDC <qu...@co...> Date: Wed Jun 18 00:07:08 2025 -0400 Give a message if no controller is detected, and don't write if no vmu found. commit 7dba4687fec273ecb9e7714afe79647c1432b959 Author: QuzarDC <qu...@co...> Date: Tue Jun 17 21:31:32 2025 -0400 Minor type cleanup and restructuring of strangely organized logic. commit d4d96fcd57972df3a67ce1c3fbada650721407a3 Author: QuzarDC <qu...@co...> Date: Mon Jun 16 01:35:43 2025 -0400 Add defines for various screen layout constants ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/vmu/vmu_pkg/vmu.c | 100 +++++++++++++++++++++++------------ kernel/arch/dreamcast/util/vmu_pkg.c | 6 ++- 2 files changed, 70 insertions(+), 36 deletions(-) diff --git a/examples/dreamcast/vmu/vmu_pkg/vmu.c b/examples/dreamcast/vmu/vmu_pkg/vmu.c index 2baa7979..326616ac 100644 --- a/examples/dreamcast/vmu/vmu_pkg/vmu.c +++ b/examples/dreamcast/vmu/vmu_pkg/vmu.c @@ -15,66 +15,93 @@ #define NB_ICONS_MAX 3 +/* How many bytes of data to write */ +#define DATA_LEN 4096 + +#define SCREEN_W 640 +#define SCREEN_H 480 + +/* The Y indentation for the VMU Info text on screen */ +#define INFO_Y 88 + +/* The amount of space from the top of one row of text to the next */ +#define ROW_SPACER 24 + void draw_dir(void) { file_t d; - int y = 88; + size_t y = INFO_Y; dirent_t *de; d = fs_open("/vmu/a1", O_RDONLY | O_DIR); - if(!d) { - bfont_draw_str(vram_s + y * 640 + 10, 640, 0, "Can't read VMU"); + /* If fs_open returned an error */ + if(d == FILEHND_INVALID) { + bfont_draw_str(vram_s + y * SCREEN_W + 10, SCREEN_W, 0, "Can't read VMU"); + return; } - else { - while((de = fs_readdir(d))) { - bfont_draw_str(vram_s + y * 640 + 10, 640, 0, de->name); - y += 24; - if(y >= (480 - 24)) - break; - } + /* Since there was no error, read through the files */ + while((de = fs_readdir(d))) { + bfont_draw_str(vram_s + y * SCREEN_W + 10, SCREEN_W, 0, de->name); + y += ROW_SPACER; - fs_close(d); + /* If we would go off the screen, stop! */ + if(y >= (SCREEN_H - ROW_SPACER)) + break; } + + fs_close(d); } -int dev_checked = 0; +/* Clears out the portion of the screen we use to write info to */ +void clear_screen_info(void) { + memset(vram_s + INFO_Y * SCREEN_W, 0, SCREEN_W * (SCREEN_H - 64) * 2); +} + +bool dev_found = false; void new_vmu(void) { - maple_device_t * dev; + maple_device_t *dev; dev = maple_enum_dev(0, 1); - if(dev == NULL) { - if(dev_checked) { - memset(vram_s + 88 * 640, 0, 640 * (480 - 64) * 2); - bfont_draw_str(vram_s + 88 * 640 + 10, 640, 0, "No VMU"); - dev_checked = 0; - } + /* Device was not found and we haven't written that to the screen yet */ + if(!dev && dev_found) { + clear_screen_info(); + bfont_draw_str(vram_s + INFO_Y * SCREEN_W + 10, SCREEN_W, 0, "No VMU"); + dev_found = false; } - else if(dev_checked) { - } - else { - memset(vram_s + 88 * 640, 0, 640 * (480 - 88)); + /* Device was found and screen currently says 'No VMU' */ + else if(dev && !dev_found) { + clear_screen_info(); draw_dir(); - dev_checked = 1; + dev_found = true; } + + /* In the other two conditions it's not necessary to update the screen */ } int wait_start(void) { maple_device_t *cont; cont_state_t *state; + bool cont_warning_displayed = false; for(;;) { - new_vmu(); - cont = maple_enum_type(0, MAPLE_FUNC_CONTROLLER); - if(!cont) continue; + if(!cont) { + if(!cont_warning_displayed) { + clear_screen_info(); + bfont_draw_str(vram_s + INFO_Y * SCREEN_W + 10, SCREEN_W, 0, "No Controller"); + cont_warning_displayed = true; + } + continue; + } state = (cont_state_t *)maple_dev_status(cont); - if(!state) - continue; + if(!state) continue; + + new_vmu(); if(state->buttons & CONT_START) return 0; @@ -86,7 +113,7 @@ static unsigned char vmu_icon[ICON_SIZE * NB_ICONS_MAX]; /* Here's the actual meat of it */ void write_entry(void) { vmu_pkg_t pkg; - uint8 data[4096], *pkg_out; + uint8_t data[DATA_LEN], *pkg_out; int pkg_size; int i; file_t f; @@ -98,8 +125,10 @@ void write_entry(void) { pkg.icon_data = vmu_icon; pkg.icon_anim_speed = 8; pkg.eyecatch_type = VMUPKG_EC_NONE; + pkg.data_len = DATA_LEN; + pkg.data = data; - for(i = 0; i < 4096; i++) + for(i = 0; i < DATA_LEN; i++) data[i] = i & 255; vmu_pkg_load_icon(&pkg, "/rd/ebook.ico"); @@ -119,15 +148,16 @@ void write_entry(void) { } int main(int argc, char **argv) { - bfont_draw_str(vram_s + 20 * 640 + 20, 640, 0, + bfont_draw_str(vram_s + 20 * SCREEN_W + 20, SCREEN_W, 0, "Put a VMU you don't care too much about"); - bfont_draw_str(vram_s + 42 * 640 + 20, 640, 0, + bfont_draw_str(vram_s + 42 * SCREEN_W + 20, SCREEN_W, 0, "in slot A1 and press START"); - bfont_draw_str(vram_s + 88 * 640 + 10, 640, 0, "No VMU"); + bfont_draw_str(vram_s + INFO_Y * SCREEN_W + 10, SCREEN_W, 0, "No VMU"); if(wait_start() < 0) return 0; - write_entry(); + /* If there was a vmu found, write to it */ + if(dev_found) write_entry(); return 0; } diff --git a/kernel/arch/dreamcast/util/vmu_pkg.c b/kernel/arch/dreamcast/util/vmu_pkg.c index 1082146d..84d80fc7 100644 --- a/kernel/arch/dreamcast/util/vmu_pkg.c +++ b/kernel/arch/dreamcast/util/vmu_pkg.c @@ -97,6 +97,8 @@ int vmu_pkg_build(vmu_pkg_t *src, uint8_t **dst, int *dst_size) { assert(src && dst); + if(src->data_len < 0) return -2; + /* First off, figure out how big it will be */ out_size = sizeof(vmu_hdr_t) + 512 * src->icon_cnt + src->data_len; ec_size = vmu_eyecatch_size(src->eyecatch_type); @@ -138,7 +140,9 @@ int vmu_pkg_build(vmu_pkg_t *src, uint8_t **dst, int *dst_size) { memcpy(out, src->eyecatch_data, ec_size); out += ec_size; - memcpy(out, src->data, src->data_len); + if(src->data) + memcpy(out, src->data, src->data_len); + out += src->data_len; /* Verify the size */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-18 20:33:34
|
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 af47450125b252204d3a9af3a76c837cca281ed1 (commit) from c01e1b0511e107bd3d3c22a7facdc4ddc85ecbd4 (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 af47450125b252204d3a9af3a76c837cca281ed1 Author: Falco Girgis <gyr...@gm...> Date: Tue Jun 17 13:45:38 2025 -0500 Fixed maple crash when unknown device attached. Currently, the Maple driver crashes due to NULL pointer dereference in "maple_driver.c" on line 121. When the user manually disables certain Maple drivers via explicitly providing a custom KOS_INIT_FLAGS() list, and such a device is plugged into the controller, the "dev" pointer never gets allocated, since a driver for it is never found. 1) Check to see if dev is NULL and error out early before dereferencing it. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/maple/maple_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/arch/dreamcast/hardware/maple/maple_driver.c b/kernel/arch/dreamcast/hardware/maple/maple_driver.c index e747c462..00b9ba0b 100644 --- a/kernel/arch/dreamcast/hardware/maple/maple_driver.c +++ b/kernel/arch/dreamcast/hardware/maple/maple_driver.c @@ -116,6 +116,9 @@ int maple_driver_attach(maple_frame_t *det) { } } + if(!dev) + return -1; + /* Did we get any hits? */ if(!attached) { free(dev->status); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-18 20:30:10
|
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 c01e1b0511e107bd3d3c22a7facdc4ddc85ecbd4 (commit) from 9e6dc6e35cf72f458c459a2880050dabcc1fef4c (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 c01e1b0511e107bd3d3c22a7facdc4ddc85ecbd4 Author: QuzarDC <qu...@co...> Date: Tue Jun 10 18:26:51 2025 -0400 Update gitignore to ignore generated `authors.h` ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/kernel/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/arch/dreamcast/kernel/.gitignore b/kernel/arch/dreamcast/kernel/.gitignore index 989e5ff4..96d28f98 100644 --- a/kernel/arch/dreamcast/kernel/.gitignore +++ b/kernel/arch/dreamcast/kernel/.gitignore @@ -1,2 +1,3 @@ arch_exports.c +authors.h banner.h hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-18 20:29:00
|
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 9e6dc6e35cf72f458c459a2880050dabcc1fef4c (commit) from 65b232b0fc206eb9dfd4705d460a9f29fc942839 (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 9e6dc6e35cf72f458c459a2880050dabcc1fef4c Author: DC-SWAT <sw...@21...> Date: Sat Jun 14 09:40:50 2025 +0700 cdrom: Fixed confusion between sessions and areas. GD-ROM drive does not differentiate sessions at all. This TOC is always divided into two, for the low-density area and the high-density area, which is only on the GD-ROM disc. And in fact, this is one and the same TOC, itâs just that for non-requested area the tracks are erased (and first/last changed) in this common TOC, because the tracks numbering remains the same. There may be multiple sessions in one area, but there is no division between them. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/fs/fs_iso9660.c | 2 +- kernel/arch/dreamcast/hardware/cdrom.c | 6 +++--- kernel/arch/dreamcast/include/dc/cdrom.h | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/kernel/arch/dreamcast/fs/fs_iso9660.c b/kernel/arch/dreamcast/fs/fs_iso9660.c index e0f8b435..c8a1aaba 100644 --- a/kernel/arch/dreamcast/fs/fs_iso9660.c +++ b/kernel/arch/dreamcast/fs/fs_iso9660.c @@ -343,7 +343,7 @@ static int init_percd(void) { return -1; } - if((i = cdrom_read_toc(&toc, 0)) != 0) + if((i = cdrom_read_toc(&toc, false)) != 0) return i; if(!(session_base = cdrom_locate_data_track(&toc))) diff --git a/kernel/arch/dreamcast/hardware/cdrom.c b/kernel/arch/dreamcast/hardware/cdrom.c index d76692e4..46d9551d 100644 --- a/kernel/arch/dreamcast/hardware/cdrom.c +++ b/kernel/arch/dreamcast/hardware/cdrom.c @@ -332,14 +332,14 @@ int cdrom_reinit_ex(int sector_part, int cdxa, int sector_size) { } /* Read the table of contents */ -int cdrom_read_toc(CDROM_TOC *toc_buffer, int session) { +int cdrom_read_toc(CDROM_TOC *toc_buffer, bool high_density) { struct { - int session; + int area; void *buffer; } params; int rv; - params.session = session; + params.area = high_density ? 1 : 0; params.buffer = toc_buffer; rv = cdrom_exec_cmd(CMD_GETTOC2, ¶ms); diff --git a/kernel/arch/dreamcast/include/dc/cdrom.h b/kernel/arch/dreamcast/include/dc/cdrom.h index 828e3bc2..9511bfa0 100644 --- a/kernel/arch/dreamcast/include/dc/cdrom.h +++ b/kernel/arch/dreamcast/include/dc/cdrom.h @@ -406,13 +406,14 @@ int cdrom_reinit_ex(int sector_part, int cdxa, int sector_size); /** \brief Read the table of contents from the disc. \ingroup gdrom - This function reads the TOC from the specified session of the disc. + This function reads the TOC from the specified area of the disc. + On regular CD-ROMs, there are only low density area. \param toc_buffer Space to store the returned TOC in. - \param session The session of the disc to read. + \param high_density Whether to read from the high density area. \return \ref cd_cmd_response */ -int cdrom_read_toc(CDROM_TOC *toc_buffer, int session); +int cdrom_read_toc(CDROM_TOC *toc_buffer, bool high_density); /** \brief Read one or more sector from a CD-ROM. \ingroup gdrom hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-10 05:24:19
|
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 65b232b0fc206eb9dfd4705d460a9f29fc942839 (commit) from f376087d912cab7891ae9f9941d871913664c2a6 (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 65b232b0fc206eb9dfd4705d460a9f29fc942839 Author: Falco Girgis <gyr...@gm...> Date: Sun Jun 8 07:44:25 2025 -0500 Fixed race when getting/setting IRQ/TRAPA handlers When accessing an IRQ or TRAPA handler, it's possible that the handler could be swapped out from under you either fully or partially by another thread or IRQ. It's also possible an IRQ or TRAPA handler could be called from an IRQ WHILE its still being set by a user, so both the callback function and userdata pointers may not have both been set atomically before the IRQ, causing them to get out-of-sync. - Disabled IRQs around IRQ and TRAPA handler setter and getter accessors to ensure they accessed atomically. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/kernel/irq.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kernel/arch/dreamcast/kernel/irq.c b/kernel/arch/dreamcast/kernel/irq.c index cb8b3d06..6201e93b 100644 --- a/kernel/arch/dreamcast/kernel/irq.c +++ b/kernel/arch/dreamcast/kernel/irq.c @@ -3,7 +3,7 @@ arch/dreamcast/kernel/irq.c Copyright (C) 2000-2001 Megan Potter Copyright (C) 2024 Paul Cercueil - Copyright (C) 2024 Falco Girgis + Copyright (C) 2024, 2025 Falco Girgis Copyright (C) 2024 Andy Barajas */ @@ -62,6 +62,8 @@ int irq_set_handler(irq_t code, irq_handler hnd, void *data) { return -1; code >>= 5; + + irq_disable_scoped(); irq_handlers[code] = (struct irq_cb){ hnd, data }; return 0; @@ -75,11 +77,14 @@ irq_cb_t irq_get_handler(irq_t code) { code >>= 5; + irq_disable_scoped(); return irq_handlers[code]; } /* Set a global handler */ int irq_set_global_handler(irq_handler hnd, void *data) { + irq_disable_scoped(); + global_irq_handler.hdl = hnd; global_irq_handler.data = data; return 0; @@ -87,17 +92,23 @@ int irq_set_global_handler(irq_handler hnd, void *data) { /* Get the global exception handler */ irq_cb_t irq_get_global_handler(void) { + irq_disable_scoped(); + return global_irq_handler; } /* Set or remove a trapa handler */ int trapa_set_handler(trapa_t code, trapa_handler hnd, void *data) { + irq_disable_scoped(); + trapa_handlers[code] = (struct trapa_cb){ hnd, data }; return 0; } /* Get a particular trapa handler */ trapa_handler trapa_get_handler(trapa_t code, void **data) { + irq_disable_scoped(); + if(data) *data = trapa_handlers[code].data; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-10 05:23:35
|
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 f376087d912cab7891ae9f9941d871913664c2a6 (commit) via a62912ec7f41aa56f8d5cf809955a6f6d382ccc2 (commit) via a805aa69ec215eee64619c134a68a2d3181630b6 (commit) via 744bf35a2f1a099343dbab9b7c17690cdd0dc400 (commit) via 7b12f1e65eaf22201baeedf95df8bca21c0fe0e9 (commit) via e8a8adeb132df44c5e16b33b4540e0e418c774a4 (commit) from de20d2e938d89f63edd7ac8a570986c10478c9db (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 f376087d912cab7891ae9f9941d871913664c2a6 Author: Falco Girgis <gyr...@gm...> Date: Sun Jun 8 08:10:54 2025 -0500 Update examples/dreamcast/modem/ppp/ppp.c Co-authored-by: darcagn <da...@pr...> commit a62912ec7f41aa56f8d5cf809955a6f6d382ccc2 Author: Falco Girgis <gyr...@gm...> Date: Sun Jun 8 08:10:41 2025 -0500 Update examples/dreamcast/sound/hello-adx/libADXplay.c Co-authored-by: darcagn <da...@pr...> commit a805aa69ec215eee64619c134a68a2d3181630b6 Author: Falco Girgis <gyr...@gm...> Date: Sun Jun 8 08:10:28 2025 -0500 Update examples/dreamcast/modem/basic/basic.c Co-authored-by: darcagn <da...@pr...> commit 744bf35a2f1a099343dbab9b7c17690cdd0dc400 Author: Falco Girgis <gyr...@gm...> Date: Sun Jun 8 08:10:24 2025 -0500 Update examples/dreamcast/kgl/demos/specular/specular.c Co-authored-by: darcagn <da...@pr...> commit 7b12f1e65eaf22201baeedf95df8bca21c0fe0e9 Author: Falco Girgis <gyr...@gm...> Date: Sun Jun 8 08:10:17 2025 -0500 Update examples/dreamcast/2ndmix/2ndmix.c Co-authored-by: darcagn <da...@pr...> commit e8a8adeb132df44c5e16b33b4540e0e418c774a4 Author: Falco Girgis <gyr...@gm...> Date: Sun Jun 8 07:58:30 2025 -0500 Fixed main(..) function signature for examples. Several examples were giving warnings when compiled with LTO enabled, with GCC complaining about function signature mismatches between the "main()" prototype used within certain examples and the "mian(int argc, const char* argv[]) prototype that was predeclared within init.c. - Updated noncompliant examples to use proper main() signature. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/2ndmix/2ndmix.c | 2 +- examples/dreamcast/kgl/demos/specular/specular.c | 2 +- examples/dreamcast/modem/basic/basic.c | 2 +- examples/dreamcast/modem/ppp/ppp.c | 2 +- examples/dreamcast/sound/hello-adx/libADXplay.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/dreamcast/2ndmix/2ndmix.c b/examples/dreamcast/2ndmix/2ndmix.c index fb368646..25308251 100644 --- a/examples/dreamcast/2ndmix/2ndmix.c +++ b/examples/dreamcast/2ndmix/2ndmix.c @@ -832,7 +832,7 @@ pvr_init_params_t params = { KOS_INIT_FLAGS(INIT_DEFAULT); /* Main program: init and loop drawing polygons */ -int main() { +int main(int argc, const char *argv[]) { maple_device_t *cont; cont_state_t *state; diff --git a/examples/dreamcast/kgl/demos/specular/specular.c b/examples/dreamcast/kgl/demos/specular/specular.c index 6b794ce2..b3a8b6c0 100644 --- a/examples/dreamcast/kgl/demos/specular/specular.c +++ b/examples/dreamcast/kgl/demos/specular/specular.c @@ -998,7 +998,7 @@ int InputCb(void) { return 1; } -int main() { +int main(int argc, const char *argv[]) { /* Get basic stuff initialized */ glKosInit(); diff --git a/examples/dreamcast/modem/basic/basic.c b/examples/dreamcast/modem/basic/basic.c index c4c74d67..a086e451 100644 --- a/examples/dreamcast/modem/basic/basic.c +++ b/examples/dreamcast/modem/basic/basic.c @@ -29,7 +29,7 @@ int buttonPressed(int button) { return 0; } -int main() { +int main(int argc, const char *argv[]) { int answerMode = 0; unsigned char data[DATA_BUFFER_LENGTH]; int i; diff --git a/examples/dreamcast/modem/ppp/ppp.c b/examples/dreamcast/modem/ppp/ppp.c index 9ef4ca49..b437cca8 100644 --- a/examples/dreamcast/modem/ppp/ppp.c +++ b/examples/dreamcast/modem/ppp/ppp.c @@ -18,7 +18,7 @@ KOS_INIT_FLAGS(INIT_DEFAULT | INIT_NET); -int main() { +int main(int argc, const char *argv[]) { char buffer[1024]; int err; diff --git a/examples/dreamcast/sound/hello-adx/libADXplay.c b/examples/dreamcast/sound/hello-adx/libADXplay.c index 8e220511..e5387bca 100644 --- a/examples/dreamcast/sound/hello-adx/libADXplay.c +++ b/examples/dreamcast/sound/hello-adx/libADXplay.c @@ -56,7 +56,7 @@ int check_cont() return ret; } -int main() +int main(int argc, const char *argv[]) { /* Print some text to the screen */ int o = 20*640+20; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-06-07 21:37:13
|
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 de20d2e938d89f63edd7ac8a570986c10478c9db (commit) via 37b235213e3de444ea2c014bb04eff1009f42dd7 (commit) from 680d18622376666ad9251929f7a6f450e7724607 (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 de20d2e938d89f63edd7ac8a570986c10478c9db Author: darc <da...@pr...> Date: Sat Jun 7 10:55:38 2025 -0500 dc-chain: Upgrade 13.x series profiles to 13.4.0 and 13.4.1 commit 37b235213e3de444ea2c014bb04eff1009f42dd7 Author: darc <da...@pr...> Date: Fri May 23 14:19:35 2025 -0500 dc-chain: Upgrade 14.x series profiles to 14.3.0 and 14.3.1 ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/Makefile.default.cfg | 8 ++-- utils/dc-chain/README.md | 8 ++-- utils/dc-chain/doc/CHANGELOG.md | 2 + .../{gcc-13.3.0-kos.diff => gcc-13.4.0-kos.diff} | 50 ++++++++++----------- .../{gcc-13.3.1-kos.diff => gcc-13.4.1-kos.diff} | 50 ++++++++++----------- .../{gcc-14.2.0-kos.diff => gcc-14.3.0-kos.diff} | 52 +++++++++++----------- .../{gcc-14.2.1-kos.diff => gcc-14.3.1-kos.diff} | 50 ++++++++++----------- .../patches/{ => historical}/gcc-14.2.0-kos.diff | 0 .../{profile.13.3.0.mk => profile.13.4.0.mk} | 8 ++-- ...profile.13.3.1-dev.mk => profile.13.4.1-dev.mk} | 4 +- .../{profile.14.2.0.mk => profile.14.3.0.mk} | 8 ++-- ...profile.14.2.1-dev.mk => profile.14.3.1-dev.mk} | 4 +- 12 files changed, 123 insertions(+), 121 deletions(-) rename utils/dc-chain/patches/{gcc-13.3.0-kos.diff => gcc-13.4.0-kos.diff} (74%) rename utils/dc-chain/patches/{gcc-13.3.1-kos.diff => gcc-13.4.1-kos.diff} (74%) copy utils/dc-chain/patches/{gcc-14.2.0-kos.diff => gcc-14.3.0-kos.diff} (73%) rename utils/dc-chain/patches/{gcc-14.2.1-kos.diff => gcc-14.3.1-kos.diff} (74%) rename utils/dc-chain/patches/{ => historical}/gcc-14.2.0-kos.diff (100%) rename utils/dc-chain/profiles/{profile.13.3.0.mk => profile.13.4.0.mk} (93%) rename utils/dc-chain/profiles/{profile.13.3.1-dev.mk => profile.13.4.1-dev.mk} (94%) rename utils/dc-chain/profiles/{profile.14.2.0.mk => profile.14.3.0.mk} (93%) rename utils/dc-chain/profiles/{profile.14.2.1-dev.mk => profile.14.3.1-dev.mk} (94%) diff --git a/utils/dc-chain/Makefile.default.cfg b/utils/dc-chain/Makefile.default.cfg index 1e0e5375..6658076a 100644 --- a/utils/dc-chain/Makefile.default.cfg +++ b/utils/dc-chain/Makefile.default.cfg @@ -9,12 +9,12 @@ # Release toolchains: # - 9.5.0-winxp: Legacy: Most recent versions of tools which run on Windows XP. # - stable: Stable: Well-tested; based on GCC 13.2.0, released 2023-07-27. -# - 13.3.0: Testing: Latest release in the GCC 13 series, released 2024-05-21. -# - 14.2.0: Testing: Latest release in the GCC 14 series, released 2024-08-01. +# - 13.4.0: Testing: Latest release in the GCC 13 series, released 2025-06-05. +# - 14.3.0: Testing: Latest release in the GCC 14 series, released 2025-05-23. # - 15.1.0: Testing: Latest release in the GCC 15 series, released 2025-04-25. # Development toolchains: -# - 13.3.1-dev Bleeding edge GCC 13 series from git. -# - 14.2.1-dev Bleeding edge GCC 14 series from git. +# - 13.4.1-dev Bleeding edge GCC 13 series from git. +# - 14.3.1-dev Bleeding edge GCC 14 series from git. # - 15.1.1-dev Bleeding edge GCC 15 series from git. # - 16.0.0-dev Bleeding edge GCC 16 series from git. # If unsure, select stable. See README.md for more detailed descriptions. diff --git a/utils/dc-chain/README.md b/utils/dc-chain/README.md index 8156425b..6eb01de0 100644 --- a/utils/dc-chain/README.md +++ b/utils/dc-chain/README.md @@ -100,11 +100,11 @@ The following toolchain profiles are available for users to select in |---------:|:-------:|:----------:|:------------:|:-------:|:----------------:|:------| | 9.5.0-winxp | 9.5.0 | 4.3.0 | 2.34 | 8.5.0 | 2.34 | Most recent versions of tools which run on Windows XP<br />GCC 9 series support ended upstream | | **stable** | **13.2.0** | **4.3.0** | **2.43** | **8.5.0** | **2.43** | **Tested stable; based on GCC 13.2.0, released 2023-07-27** | -| 13.3.0 | 13.3.0 | 4.5.0 | 2.43.1 | 8.5.0 | 2.43.1 | Latest release in the GCC 13 series, released 2024-05-21 | -| 14.2.0 | 14.2.0 | 4.5.0 | 2.43.1 | 8.5.0 | 2.43.1 | Latest release in the GCC 14 series, released 2024-08-01 | +| 13.4.0 | 13.4.0 | 4.5.0 | 2.44 | 8.5.0 | 2.44 | Latest release in the GCC 13 series, released 2025-06-05 | +| 14.3.0 | 14.3.0 | 4.5.0 | 2.44 | 8.5.0 | 2.44 | Latest release in the GCC 14 series, released 2025-05-23 | | 15.1.0 | 15.1.0 | 4.5.0 | 2.44 | 8.5.0 | 2.44 | Latest release in the GCC 15 series, released 2025-04-25 | -| 13.3.1-dev | 13.3.1 (git) | 4.5.0 | 2.44 | 8.5.0 | 2.44 | Bleeding edge GCC 13 series from git | -| 14.2.1-dev | 14.2.1 (git) | 4.5.0 | 2.44 | 8.5.0 | 2.44 | Bleeding edge GCC 14 series from git | +| 13.4.1-dev | 13.3.1 (git) | 4.5.0 | 2.44 | 8.5.0 | 2.44 | Bleeding edge GCC 13 series from git | +| 14.3.1-dev | 14.3.1 (git) | 4.5.0 | 2.44 | 8.5.0 | 2.44 | Bleeding edge GCC 14 series from git | | 15.1.1-dev | 15.1.1 (git) | 4.5.0 | 2.44 | 8.5.0 | 2.44 | Bleeding edge GCC 15 series from git | | 16.0.0-dev | 16.0.0 (git) | 4.5.0 | 2.44 | 8.5.0 | 2.44 | Bleeding edge GCC 16 series from git | diff --git a/utils/dc-chain/doc/CHANGELOG.md b/utils/dc-chain/doc/CHANGELOG.md index 86534f89..9596b84f 100644 --- a/utils/dc-chain/doc/CHANGELOG.md +++ b/utils/dc-chain/doc/CHANGELOG.md @@ -2,6 +2,8 @@ | Date<br/>_____________ | Author(s)<br/>_____________ | Changes<br/>_____________ | |:-----------------------|:----------------------------|---------------------------| +| 2025-06-07 | Eric Fradella | Upgrade 13.x series profiles to 13.4.0 and 13.4.1. | +| 2025-05-23 | Eric Fradella | Upgrade 14.x series profiles to 14.3.0 and 14.3.1. | | 2025-04-18 | Eric Fradella | Add 15.1.0 release profile and 15.1.1/16.0.0 dev profiles. All dev profiles upgraded to Binutils 2.44 and GDB 16.2 | | 2025-02-19 | Eric Fradella | Remove profiles and patches for older toolchains (9.3.0, 10.5.0, 11.5.0, 12.4.0) and Rust dev toolchains. Support for Newlib versions prior to 4.x now deprecated. | | 2025-01-26 | Mickaël Cardoso | Update documentations. | diff --git a/utils/dc-chain/patches/gcc-13.3.0-kos.diff b/utils/dc-chain/patches/gcc-13.4.0-kos.diff similarity index 74% rename from utils/dc-chain/patches/gcc-13.3.0-kos.diff rename to utils/dc-chain/patches/gcc-13.4.0-kos.diff index b5efbe57..57be9dbc 100644 --- a/utils/dc-chain/patches/gcc-13.3.0-kos.diff +++ b/utils/dc-chain/patches/gcc-13.4.0-kos.diff @@ -1,6 +1,6 @@ -diff --color -ruN gcc-13.3.0/gcc/config/sh/sh-c.cc gcc-13.3.0-kos/gcc/config/sh/sh-c.cc ---- gcc-13.3.0/gcc/config/sh/sh-c.cc 2023-06-04 20:48:46.612552162 -0500 -+++ gcc-13.3.0-kos/gcc/config/sh/sh-c.cc 2023-06-04 20:49:03.486606055 -0500 +diff --color -ruN gcc-13.4.0/gcc/config/sh/sh-c.cc gcc-13.4.0-kos/gcc/config/sh/sh-c.cc +--- gcc-13.4.0/gcc/config/sh/sh-c.cc 2023-06-04 20:48:46.612552162 -0500 ++++ gcc-13.4.0-kos/gcc/config/sh/sh-c.cc 2023-06-04 20:49:03.486606055 -0500 @@ -141,4 +141,11 @@ cpp_define_formatted (pfile, "__SH_ATOMIC_MODEL_%s__", @@ -13,10 +13,10 @@ diff --color -ruN gcc-13.3.0/gcc/config/sh/sh-c.cc gcc-13.3.0-kos/gcc/config/sh/ + /* Toolchain supports setting up stack for 32MB */ + builtin_define ("__KOS_GCC_32MB__"); } -diff --color -ruN gcc-13.3.0/gcc/configure gcc-13.3.0-kos/gcc/configure ---- gcc-13.3.0/gcc/configure 2023-06-04 20:48:49.679561957 -0500 -+++ gcc-13.3.0-kos/gcc/configure 2023-06-04 20:49:03.488606061 -0500 -@@ -13058,7 +13058,7 @@ +diff --color -ruN gcc-13.4.0/gcc/configure gcc-13.4.0-kos/gcc/configure +--- gcc-13.4.0/gcc/configure 2023-06-04 20:48:49.679561957 -0500 ++++ gcc-13.4.0-kos/gcc/configure 2023-06-04 20:49:03.488606061 -0500 +@@ -13094,7 +13094,7 @@ target_thread_file='single' ;; aix | dce | lynx | mipssde | posix | rtems | \ @@ -25,9 +25,9 @@ diff --color -ruN gcc-13.3.0/gcc/configure gcc-13.3.0-kos/gcc/configure target_thread_file=${enable_threads} ;; *) -diff --color -ruN gcc-13.3.0/libgcc/config/sh/t-sh gcc-13.3.0-kos/libgcc/config/sh/t-sh ---- gcc-13.3.0/libgcc/config/sh/t-sh 2023-06-04 20:48:45.741549380 -0500 -+++ gcc-13.3.0-kos/libgcc/config/sh/t-sh 2023-06-04 20:49:03.488606061 -0500 +diff --color -ruN gcc-13.4.0/libgcc/config/sh/t-sh gcc-13.4.0-kos/libgcc/config/sh/t-sh +--- gcc-13.4.0/libgcc/config/sh/t-sh 2023-06-04 20:48:45.741549380 -0500 ++++ gcc-13.4.0-kos/libgcc/config/sh/t-sh 2023-06-04 20:49:03.488606061 -0500 @@ -23,6 +23,8 @@ $(LIB1ASMFUNCS_CACHE) LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array @@ -37,9 +37,9 @@ diff --color -ruN gcc-13.3.0/libgcc/config/sh/t-sh gcc-13.3.0-kos/libgcc/config/ crt1.o: $(srcdir)/config/sh/crt1.S $(gcc_compile) -c $< -diff --color -ruN gcc-13.3.0/libgcc/configure gcc-13.3.0-kos/libgcc/configure ---- gcc-13.3.0/libgcc/configure 2023-06-04 20:48:45.787549527 -0500 -+++ gcc-13.3.0-kos/libgcc/configure 2023-06-04 20:49:03.489606065 -0500 +diff --color -ruN gcc-13.4.0/libgcc/configure gcc-13.4.0-kos/libgcc/configure +--- gcc-13.4.0/libgcc/configure 2023-06-04 20:48:45.787549527 -0500 ++++ gcc-13.4.0-kos/libgcc/configure 2023-06-04 20:49:03.489606065 -0500 @@ -5699,6 +5699,7 @@ tpf) thread_header=config/s390/gthr-tpf.h ;; vxworks) thread_header=config/gthr-vxworks.h ;; @@ -48,9 +48,9 @@ diff --color -ruN gcc-13.3.0/libgcc/configure gcc-13.3.0-kos/libgcc/configure mcf) thread_header=config/i386/gthr-mcf.h ;; esac -diff --color -ruN gcc-13.3.0/libobjc/configure gcc-13.3.0-kos/libobjc/configure ---- gcc-13.3.0/libobjc/configure 2023-06-04 20:48:49.902562670 -0500 -+++ gcc-13.3.0-kos/libobjc/configure 2023-06-04 20:49:03.489606065 -0500 +diff --color -ruN gcc-13.4.0/libobjc/configure gcc-13.4.0-kos/libobjc/configure +--- gcc-13.4.0/libobjc/configure 2023-06-04 20:48:49.902562670 -0500 ++++ gcc-13.4.0-kos/libobjc/configure 2023-06-04 20:49:03.489606065 -0500 @@ -2918,11 +2918,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -63,9 +63,9 @@ diff --color -ruN gcc-13.3.0/libobjc/configure gcc-13.3.0-kos/libobjc/configure ; return 0; } -diff --color -ruN gcc-13.3.0/libobjc/Makefile.in gcc-13.3.0-kos/libobjc/Makefile.in ---- gcc-13.3.0/libobjc/Makefile.in 2023-06-04 20:48:49.901562666 -0500 -+++ gcc-13.3.0-kos/libobjc/Makefile.in 2023-06-04 20:49:03.490606068 -0500 +diff --color -ruN gcc-13.4.0/libobjc/Makefile.in gcc-13.4.0-kos/libobjc/Makefile.in +--- gcc-13.4.0/libobjc/Makefile.in 2023-06-04 20:48:49.901562666 -0500 ++++ gcc-13.4.0-kos/libobjc/Makefile.in 2023-06-04 20:49:03.490606068 -0500 @@ -308,14 +308,16 @@ $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) @@ -96,9 +96,9 @@ diff --color -ruN gcc-13.3.0/libobjc/Makefile.in gcc-13.3.0-kos/libobjc/Makefile mostlyclean: -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo -diff --color -ruN gcc-13.3.0/libstdc++-v3/config/cpu/sh/atomicity.h gcc-13.3.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h ---- gcc-13.3.0/libstdc++-v3/config/cpu/sh/atomicity.h 2023-06-04 20:48:46.047550357 -0500 -+++ gcc-13.3.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2023-06-04 20:49:03.490606068 -0500 +diff --color -ruN gcc-13.4.0/libstdc++-v3/config/cpu/sh/atomicity.h gcc-13.4.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h +--- gcc-13.4.0/libstdc++-v3/config/cpu/sh/atomicity.h 2023-06-04 20:48:46.047550357 -0500 ++++ gcc-13.4.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2023-06-04 20:49:03.490606068 -0500 @@ -22,14 +22,40 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. @@ -149,9 +149,9 @@ diff --color -ruN gcc-13.3.0/libstdc++-v3/config/cpu/sh/atomicity.h gcc-13.3.0-k + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace -diff --color -ruN gcc-13.3.0/libstdc++-v3/configure gcc-13.3.0-kos/libstdc++-v3/configure ---- gcc-13.3.0/libstdc++-v3/configure 2023-06-04 20:48:46.398551478 -0500 -+++ gcc-13.3.0-kos/libstdc++-v3/configure 2023-06-04 20:49:03.493606077 -0500 +diff --color -ruN gcc-13.4.0/libstdc++-v3/configure gcc-13.4.0-kos/libstdc++-v3/configure +--- gcc-13.4.0/libstdc++-v3/configure 2023-06-04 20:48:46.398551478 -0500 ++++ gcc-13.4.0-kos/libstdc++-v3/configure 2023-06-04 20:49:03.493606077 -0500 @@ -15825,6 +15825,7 @@ tpf) thread_header=config/s390/gthr-tpf.h ;; vxworks) thread_header=config/gthr-vxworks.h ;; diff --git a/utils/dc-chain/patches/gcc-13.3.1-kos.diff b/utils/dc-chain/patches/gcc-13.4.1-kos.diff similarity index 74% rename from utils/dc-chain/patches/gcc-13.3.1-kos.diff rename to utils/dc-chain/patches/gcc-13.4.1-kos.diff index aa831e2b..d41b7775 100644 --- a/utils/dc-chain/patches/gcc-13.3.1-kos.diff +++ b/utils/dc-chain/patches/gcc-13.4.1-kos.diff @@ -1,6 +1,6 @@ -diff --color -ruN gcc-13.3.1/gcc/config/sh/sh-c.cc gcc-13.3.1-kos/gcc/config/sh/sh-c.cc ---- gcc-13.3.1/gcc/config/sh/sh-c.cc 2023-06-04 20:48:46.612552162 -0500 -+++ gcc-13.3.1-kos/gcc/config/sh/sh-c.cc 2023-06-04 20:49:03.486606055 -0500 +diff --color -ruN gcc-13.4.1/gcc/config/sh/sh-c.cc gcc-13.4.1-kos/gcc/config/sh/sh-c.cc +--- gcc-13.4.1/gcc/config/sh/sh-c.cc 2023-06-04 20:48:46.612552162 -0500 ++++ gcc-13.4.1-kos/gcc/config/sh/sh-c.cc 2023-06-04 20:49:03.486606055 -0500 @@ -141,4 +141,11 @@ cpp_define_formatted (pfile, "__SH_ATOMIC_MODEL_%s__", @@ -13,10 +13,10 @@ diff --color -ruN gcc-13.3.1/gcc/config/sh/sh-c.cc gcc-13.3.1-kos/gcc/config/sh/ + /* Toolchain supports setting up stack for 32MB */ + builtin_define ("__KOS_GCC_32MB__"); } -diff --color -ruN gcc-13.3.1/gcc/configure gcc-13.3.1-kos/gcc/configure ---- gcc-13.3.1/gcc/configure 2023-06-04 20:48:49.679561957 -0500 -+++ gcc-13.3.1-kos/gcc/configure 2023-06-04 20:49:03.488606061 -0500 -@@ -13058,7 +13058,7 @@ +diff --color -ruN gcc-13.4.1/gcc/configure gcc-13.4.1-kos/gcc/configure +--- gcc-13.4.1/gcc/configure 2023-06-04 20:48:49.679561957 -0500 ++++ gcc-13.4.1-kos/gcc/configure 2023-06-04 20:49:03.488606061 -0500 +@@ -13094,7 +13094,7 @@ target_thread_file='single' ;; aix | dce | lynx | mipssde | posix | rtems | \ @@ -25,9 +25,9 @@ diff --color -ruN gcc-13.3.1/gcc/configure gcc-13.3.1-kos/gcc/configure target_thread_file=${enable_threads} ;; *) -diff --color -ruN gcc-13.3.1/libgcc/config/sh/t-sh gcc-13.3.1-kos/libgcc/config/sh/t-sh ---- gcc-13.3.1/libgcc/config/sh/t-sh 2023-06-04 20:48:45.741549380 -0500 -+++ gcc-13.3.1-kos/libgcc/config/sh/t-sh 2023-06-04 20:49:03.488606061 -0500 +diff --color -ruN gcc-13.4.1/libgcc/config/sh/t-sh gcc-13.4.1-kos/libgcc/config/sh/t-sh +--- gcc-13.4.1/libgcc/config/sh/t-sh 2023-06-04 20:48:45.741549380 -0500 ++++ gcc-13.4.1-kos/libgcc/config/sh/t-sh 2023-06-04 20:49:03.488606061 -0500 @@ -23,6 +23,8 @@ $(LIB1ASMFUNCS_CACHE) LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array @@ -37,9 +37,9 @@ diff --color -ruN gcc-13.3.1/libgcc/config/sh/t-sh gcc-13.3.1-kos/libgcc/config/ crt1.o: $(srcdir)/config/sh/crt1.S $(gcc_compile) -c $< -diff --color -ruN gcc-13.3.1/libgcc/configure gcc-13.3.1-kos/libgcc/configure ---- gcc-13.3.1/libgcc/configure 2023-06-04 20:48:45.787549527 -0500 -+++ gcc-13.3.1-kos/libgcc/configure 2023-06-04 20:49:03.489606065 -0500 +diff --color -ruN gcc-13.4.1/libgcc/configure gcc-13.4.1-kos/libgcc/configure +--- gcc-13.4.1/libgcc/configure 2023-06-04 20:48:45.787549527 -0500 ++++ gcc-13.4.1-kos/libgcc/configure 2023-06-04 20:49:03.489606065 -0500 @@ -5699,6 +5699,7 @@ tpf) thread_header=config/s390/gthr-tpf.h ;; vxworks) thread_header=config/gthr-vxworks.h ;; @@ -48,9 +48,9 @@ diff --color -ruN gcc-13.3.1/libgcc/configure gcc-13.3.1-kos/libgcc/configure mcf) thread_header=config/i386/gthr-mcf.h ;; esac -diff --color -ruN gcc-13.3.1/libobjc/configure gcc-13.3.1-kos/libobjc/configure ---- gcc-13.3.1/libobjc/configure 2023-06-04 20:48:49.902562670 -0500 -+++ gcc-13.3.1-kos/libobjc/configure 2023-06-04 20:49:03.489606065 -0500 +diff --color -ruN gcc-13.4.1/libobjc/configure gcc-13.4.1-kos/libobjc/configure +--- gcc-13.4.1/libobjc/configure 2023-06-04 20:48:49.902562670 -0500 ++++ gcc-13.4.1-kos/libobjc/configure 2023-06-04 20:49:03.489606065 -0500 @@ -2918,11 +2918,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -63,9 +63,9 @@ diff --color -ruN gcc-13.3.1/libobjc/configure gcc-13.3.1-kos/libobjc/configure ; return 0; } -diff --color -ruN gcc-13.3.1/libobjc/Makefile.in gcc-13.3.1-kos/libobjc/Makefile.in ---- gcc-13.3.1/libobjc/Makefile.in 2023-06-04 20:48:49.901562666 -0500 -+++ gcc-13.3.1-kos/libobjc/Makefile.in 2023-06-04 20:49:03.490606068 -0500 +diff --color -ruN gcc-13.4.1/libobjc/Makefile.in gcc-13.4.1-kos/libobjc/Makefile.in +--- gcc-13.4.1/libobjc/Makefile.in 2023-06-04 20:48:49.901562666 -0500 ++++ gcc-13.4.1-kos/libobjc/Makefile.in 2023-06-04 20:49:03.490606068 -0500 @@ -308,14 +308,16 @@ $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) @@ -96,9 +96,9 @@ diff --color -ruN gcc-13.3.1/libobjc/Makefile.in gcc-13.3.1-kos/libobjc/Makefile mostlyclean: -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo -diff --color -ruN gcc-13.3.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-13.3.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h ---- gcc-13.3.1/libstdc++-v3/config/cpu/sh/atomicity.h 2023-06-04 20:48:46.047550357 -0500 -+++ gcc-13.3.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2023-06-04 20:49:03.490606068 -0500 +diff --color -ruN gcc-13.4.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-13.4.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h +--- gcc-13.4.1/libstdc++-v3/config/cpu/sh/atomicity.h 2023-06-04 20:48:46.047550357 -0500 ++++ gcc-13.4.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2023-06-04 20:49:03.490606068 -0500 @@ -22,14 +22,40 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. @@ -149,9 +149,9 @@ diff --color -ruN gcc-13.3.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-13.3.1-k + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace -diff --color -ruN gcc-13.3.1/libstdc++-v3/configure gcc-13.3.1-kos/libstdc++-v3/configure ---- gcc-13.3.1/libstdc++-v3/configure 2023-06-04 20:48:46.398551478 -0500 -+++ gcc-13.3.1-kos/libstdc++-v3/configure 2023-06-04 20:49:03.493606077 -0500 +diff --color -ruN gcc-13.4.1/libstdc++-v3/configure gcc-13.4.1-kos/libstdc++-v3/configure +--- gcc-13.4.1/libstdc++-v3/configure 2023-06-04 20:48:46.398551478 -0500 ++++ gcc-13.4.1-kos/libstdc++-v3/configure 2023-06-04 20:49:03.493606077 -0500 @@ -15825,6 +15825,7 @@ tpf) thread_header=config/s390/gthr-tpf.h ;; vxworks) thread_header=config/gthr-vxworks.h ;; diff --git a/utils/dc-chain/patches/gcc-14.2.0-kos.diff b/utils/dc-chain/patches/gcc-14.3.0-kos.diff similarity index 73% copy from utils/dc-chain/patches/gcc-14.2.0-kos.diff copy to utils/dc-chain/patches/gcc-14.3.0-kos.diff index d76c0b44..76e9f6bb 100644 --- a/utils/dc-chain/patches/gcc-14.2.0-kos.diff +++ b/utils/dc-chain/patches/gcc-14.3.0-kos.diff @@ -1,6 +1,6 @@ -diff -ruN gcc-14.2.0/gcc/config/sh/sh-c.cc gcc-14.2.0-kos/gcc/config/sh/sh-c.cc ---- gcc-14.2.0/gcc/config/sh/sh-c.cc 2024-01-04 16:01:33.790051712 -0600 -+++ gcc-14.2.0-kos/gcc/config/sh/sh-c.cc 2024-01-04 16:01:42.910094466 -0600 +diff -ruN gcc-14.3.0/gcc/config/sh/sh-c.cc gcc-14.3.0-kos/gcc/config/sh/sh-c.cc +--- gcc-14.3.0/gcc/config/sh/sh-c.cc 2024-01-04 16:01:33.790051712 -0600 ++++ gcc-14.3.0-kos/gcc/config/sh/sh-c.cc 2024-01-04 16:01:42.910094466 -0600 @@ -141,4 +141,11 @@ cpp_define_formatted (pfile, "__SH_ATOMIC_MODEL_%s__", @@ -13,10 +13,10 @@ diff -ruN gcc-14.2.0/gcc/config/sh/sh-c.cc gcc-14.2.0-kos/gcc/config/sh/sh-c.cc + /* Toolchain supports setting up stack for 32MB */ + builtin_define ("__KOS_GCC_32MB__"); } -diff -ruN gcc-14.2.0/gcc/configure gcc-14.2.0-kos/gcc/configure ---- gcc-14.2.0/gcc/configure 2024-01-04 16:01:33.801051764 -0600 -+++ gcc-14.2.0-kos/gcc/configure 2024-01-04 16:01:42.913094480 -0600 -@@ -13220,7 +13220,7 @@ +diff -ruN gcc-14.3.0/gcc/configure gcc-14.3.0-kos/gcc/configure +--- gcc-14.3.0/gcc/configure 2024-01-04 16:01:33.801051764 -0600 ++++ gcc-14.3.0-kos/gcc/configure 2024-01-04 16:01:42.913094480 -0600 +@@ -13256,7 +13256,7 @@ target_thread_file='single' ;; aix | dce | lynx | mipssde | posix | rtems | \ @@ -25,9 +25,9 @@ diff -ruN gcc-14.2.0/gcc/configure gcc-14.2.0-kos/gcc/configure target_thread_file=${enable_threads} ;; *) -diff -ruN gcc-14.2.0/libgcc/config/sh/t-sh gcc-14.2.0-kos/libgcc/config/sh/t-sh ---- gcc-14.2.0/libgcc/config/sh/t-sh 2024-01-04 16:01:37.134067388 -0600 -+++ gcc-14.2.0-kos/libgcc/config/sh/t-sh 2024-01-04 16:01:42.914094485 -0600 +diff -ruN gcc-14.3.0/libgcc/config/sh/t-sh gcc-14.3.0-kos/libgcc/config/sh/t-sh +--- gcc-14.3.0/libgcc/config/sh/t-sh 2024-01-04 16:01:37.134067388 -0600 ++++ gcc-14.3.0-kos/libgcc/config/sh/t-sh 2024-01-04 16:01:42.914094485 -0600 @@ -23,6 +23,8 @@ $(LIB1ASMFUNCS_CACHE) LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array @@ -37,10 +37,10 @@ diff -ruN gcc-14.2.0/libgcc/config/sh/t-sh gcc-14.2.0-kos/libgcc/config/sh/t-sh crt1.o: $(srcdir)/config/sh/crt1.S $(gcc_compile) -c $< -diff -ruN gcc-14.2.0/libgcc/configure gcc-14.2.0-kos/libgcc/configure ---- gcc-14.2.0/libgcc/configure 2024-01-04 16:01:37.139067412 -0600 -+++ gcc-14.2.0-kos/libgcc/configure 2024-01-04 16:01:42.914094485 -0600 -@@ -5763,6 +5763,7 @@ +diff -ruN gcc-14.3.0/libgcc/configure gcc-14.3.0-kos/libgcc/configure +--- gcc-14.3.0/libgcc/configure 2024-01-04 16:01:37.139067412 -0600 ++++ gcc-14.3.0-kos/libgcc/configure 2024-01-04 16:01:42.914094485 -0600 +@@ -5764,6 +5764,7 @@ tpf) thread_header=config/s390/gthr-tpf.h ;; vxworks) thread_header=config/gthr-vxworks.h ;; win32) thread_header=config/i386/gthr-win32.h ;; @@ -48,9 +48,9 @@ diff -ruN gcc-14.2.0/libgcc/configure gcc-14.2.0-kos/libgcc/configure mcf) thread_header=config/i386/gthr-mcf.h ;; esac -diff -ruN gcc-14.2.0/libobjc/configure gcc-14.2.0-kos/libobjc/configure ---- gcc-14.2.0/libobjc/configure 2024-01-04 16:01:37.499069099 -0600 -+++ gcc-14.2.0-kos/libobjc/configure 2024-01-04 16:01:42.915094489 -0600 +diff -ruN gcc-14.3.0/libobjc/configure gcc-14.3.0-kos/libobjc/configure +--- gcc-14.3.0/libobjc/configure 2024-01-04 16:01:37.499069099 -0600 ++++ gcc-14.3.0-kos/libobjc/configure 2024-01-04 16:01:42.915094489 -0600 @@ -2924,11 +2924,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -63,9 +63,9 @@ diff -ruN gcc-14.2.0/libobjc/configure gcc-14.2.0-kos/libobjc/configure ; return 0; } -diff -ruN gcc-14.2.0/libobjc/Makefile.in gcc-14.2.0-kos/libobjc/Makefile.in ---- gcc-14.2.0/libobjc/Makefile.in 2024-01-04 16:01:37.499069099 -0600 -+++ gcc-14.2.0-kos/libobjc/Makefile.in 2024-01-04 16:01:42.915094489 -0600 +diff -ruN gcc-14.3.0/libobjc/Makefile.in gcc-14.3.0-kos/libobjc/Makefile.in +--- gcc-14.3.0/libobjc/Makefile.in 2024-01-04 16:01:37.499069099 -0600 ++++ gcc-14.3.0-kos/libobjc/Makefile.in 2024-01-04 16:01:42.915094489 -0600 @@ -308,14 +308,16 @@ $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) @@ -96,9 +96,9 @@ diff -ruN gcc-14.2.0/libobjc/Makefile.in gcc-14.2.0-kos/libobjc/Makefile.in mostlyclean: -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo -diff -ruN gcc-14.2.0/libstdc++-v3/config/cpu/sh/atomicity.h gcc-14.2.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h ---- gcc-14.2.0/libstdc++-v3/config/cpu/sh/atomicity.h 2024-01-04 16:01:37.608069611 -0600 -+++ gcc-14.2.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2024-01-04 16:01:42.916094494 -0600 +diff -ruN gcc-14.3.0/libstdc++-v3/config/cpu/sh/atomicity.h gcc-14.3.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h +--- gcc-14.3.0/libstdc++-v3/config/cpu/sh/atomicity.h 2024-01-04 16:01:37.608069611 -0600 ++++ gcc-14.3.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2024-01-04 16:01:42.916094494 -0600 @@ -22,14 +22,40 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. @@ -149,9 +149,9 @@ diff -ruN gcc-14.2.0/libstdc++-v3/config/cpu/sh/atomicity.h gcc-14.2.0-kos/libst + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace -diff -ruN gcc-14.2.0/libstdc++-v3/configure gcc-14.2.0-kos/libstdc++-v3/configure ---- gcc-14.2.0/libstdc++-v3/configure 2024-01-04 16:01:37.616069648 -0600 -+++ gcc-14.2.0-kos/libstdc++-v3/configure 2024-01-04 16:01:42.919094508 -0600 +diff -ruN gcc-14.3.0/libstdc++-v3/configure gcc-14.3.0-kos/libstdc++-v3/configure +--- gcc-14.3.0/libstdc++-v3/configure 2024-01-04 16:01:37.616069648 -0600 ++++ gcc-14.3.0-kos/libstdc++-v3/configure 2024-01-04 16:01:42.919094508 -0600 @@ -15974,6 +15974,7 @@ tpf) thread_header=config/s390/gthr-tpf.h ;; vxworks) thread_header=config/gthr-vxworks.h ;; diff --git a/utils/dc-chain/patches/gcc-14.2.1-kos.diff b/utils/dc-chain/patches/gcc-14.3.1-kos.diff similarity index 74% rename from utils/dc-chain/patches/gcc-14.2.1-kos.diff rename to utils/dc-chain/patches/gcc-14.3.1-kos.diff index a3f559bb..8e15e615 100644 --- a/utils/dc-chain/patches/gcc-14.2.1-kos.diff +++ b/utils/dc-chain/patches/gcc-14.3.1-kos.diff @@ -1,6 +1,6 @@ -diff -ruN gcc-14.2.1/gcc/config/sh/sh-c.cc gcc-14.2.1-kos/gcc/config/sh/sh-c.cc ---- gcc-14.2.1/gcc/config/sh/sh-c.cc 2025-04-18 16:01:33.790051712 -0600 -+++ gcc-14.2.1-kos/gcc/config/sh/sh-c.cc 2025-04-18 16:01:42.910094466 -0600 +diff -ruN gcc-14.3.1/gcc/config/sh/sh-c.cc gcc-14.3.1-kos/gcc/config/sh/sh-c.cc +--- gcc-14.3.1/gcc/config/sh/sh-c.cc 2025-04-18 16:01:33.790051712 -0600 ++++ gcc-14.3.1-kos/gcc/config/sh/sh-c.cc 2025-04-18 16:01:42.910094466 -0600 @@ -141,4 +141,11 @@ cpp_define_formatted (pfile, "__SH_ATOMIC_MODEL_%s__", @@ -13,10 +13,10 @@ diff -ruN gcc-14.2.1/gcc/config/sh/sh-c.cc gcc-14.2.1-kos/gcc/config/sh/sh-c.cc + /* Toolchain supports setting up stack for 32MB */ + builtin_define ("__KOS_GCC_32MB__"); } -diff -ruN gcc-14.2.1/gcc/configure gcc-14.2.1-kos/gcc/configure ---- gcc-14.2.1/gcc/configure 2025-04-18 16:01:33.801051764 -0600 -+++ gcc-14.2.1-kos/gcc/configure 2025-04-18 16:01:42.913094480 -0600 -@@ -13220,7 +13220,7 @@ +diff -ruN gcc-14.3.1/gcc/configure gcc-14.3.1-kos/gcc/configure +--- gcc-14.3.1/gcc/configure 2025-04-18 16:01:33.801051764 -0600 ++++ gcc-14.3.1-kos/gcc/configure 2025-04-18 16:01:42.913094480 -0600 +@@ -13256,7 +13256,7 @@ target_thread_file='single' ;; aix | dce | lynx | mipssde | posix | rtems | \ @@ -25,9 +25,9 @@ diff -ruN gcc-14.2.1/gcc/configure gcc-14.2.1-kos/gcc/configure target_thread_file=${enable_threads} ;; *) -diff -ruN gcc-14.2.1/libgcc/config/sh/t-sh gcc-14.2.1-kos/libgcc/config/sh/t-sh ---- gcc-14.2.1/libgcc/config/sh/t-sh 2025-04-18 16:01:37.134067388 -0600 -+++ gcc-14.2.1-kos/libgcc/config/sh/t-sh 2025-04-18 16:01:42.914094485 -0600 +diff -ruN gcc-14.3.1/libgcc/config/sh/t-sh gcc-14.3.1-kos/libgcc/config/sh/t-sh +--- gcc-14.3.1/libgcc/config/sh/t-sh 2025-04-18 16:01:37.134067388 -0600 ++++ gcc-14.3.1-kos/libgcc/config/sh/t-sh 2025-04-18 16:01:42.914094485 -0600 @@ -23,6 +23,8 @@ $(LIB1ASMFUNCS_CACHE) LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array @@ -37,9 +37,9 @@ diff -ruN gcc-14.2.1/libgcc/config/sh/t-sh gcc-14.2.1-kos/libgcc/config/sh/t-sh crt1.o: $(srcdir)/config/sh/crt1.S $(gcc_compile) -c $< -diff -ruN gcc-14.2.1/libgcc/configure gcc-14.2.1-kos/libgcc/configure ---- gcc-14.2.1/libgcc/configure 2025-04-18 16:01:37.139067412 -0600 -+++ gcc-14.2.1-kos/libgcc/configure 2025-04-18 16:01:42.914094485 -0600 +diff -ruN gcc-14.3.1/libgcc/configure gcc-14.3.1-kos/libgcc/configure +--- gcc-14.3.1/libgcc/configure 2025-04-18 16:01:37.139067412 -0600 ++++ gcc-14.3.1-kos/libgcc/configure 2025-04-18 16:01:42.914094485 -0600 @@ -5764,6 +5764,7 @@ tpf) thread_header=config/s390/gthr-tpf.h ;; vxworks) thread_header=config/gthr-vxworks.h ;; @@ -48,9 +48,9 @@ diff -ruN gcc-14.2.1/libgcc/configure gcc-14.2.1-kos/libgcc/configure mcf) thread_header=config/i386/gthr-mcf.h ;; esac -diff -ruN gcc-14.2.1/libobjc/configure gcc-14.2.1-kos/libobjc/configure ---- gcc-14.2.1/libobjc/configure 2025-04-18 16:01:37.499069099 -0600 -+++ gcc-14.2.1-kos/libobjc/configure 2025-04-18 16:01:42.915094489 -0600 +diff -ruN gcc-14.3.1/libobjc/configure gcc-14.3.1-kos/libobjc/configure +--- gcc-14.3.1/libobjc/configure 2025-04-18 16:01:37.499069099 -0600 ++++ gcc-14.3.1-kos/libobjc/configure 2025-04-18 16:01:42.915094489 -0600 @@ -2924,11 +2924,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -63,9 +63,9 @@ diff -ruN gcc-14.2.1/libobjc/configure gcc-14.2.1-kos/libobjc/configure ; return 0; } -diff -ruN gcc-14.2.1/libobjc/Makefile.in gcc-14.2.1-kos/libobjc/Makefile.in ---- gcc-14.2.1/libobjc/Makefile.in 2025-04-18 16:01:37.499069099 -0600 -+++ gcc-14.2.1-kos/libobjc/Makefile.in 2025-04-18 16:01:42.915094489 -0600 +diff -ruN gcc-14.3.1/libobjc/Makefile.in gcc-14.3.1-kos/libobjc/Makefile.in +--- gcc-14.3.1/libobjc/Makefile.in 2025-04-18 16:01:37.499069099 -0600 ++++ gcc-14.3.1-kos/libobjc/Makefile.in 2025-04-18 16:01:42.915094489 -0600 @@ -308,14 +308,16 @@ $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) @@ -96,9 +96,9 @@ diff -ruN gcc-14.2.1/libobjc/Makefile.in gcc-14.2.1-kos/libobjc/Makefile.in mostlyclean: -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo -diff -ruN gcc-14.2.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-14.2.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h ---- gcc-14.2.1/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:37.608069611 -0600 -+++ gcc-14.2.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:42.916094494 -0600 +diff -ruN gcc-14.3.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-14.3.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h +--- gcc-14.3.1/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:37.608069611 -0600 ++++ gcc-14.3.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:42.916094494 -0600 @@ -22,14 +22,40 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. @@ -149,9 +149,9 @@ diff -ruN gcc-14.2.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-14.2.1-kos/libst + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace -diff -ruN gcc-14.2.1/libstdc++-v3/configure gcc-14.2.1-kos/libstdc++-v3/configure ---- gcc-14.2.1/libstdc++-v3/configure 2025-04-18 16:01:37.616069648 -0600 ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-31 00:38:12
|
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 680d18622376666ad9251929f7a6f450e7724607 (commit) from 5494e88a4d4bab0a288892f55363e48a146417ff (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 680d18622376666ad9251929f7a6f450e7724607 Author: QuzarDC <qu...@co...> Date: Fri May 30 19:19:22 2025 -0400 Add pthread include to fix 9.5.0-winxp profile. ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/patches/gcc/gthr-kos.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/dc-chain/patches/gcc/gthr-kos.h b/utils/dc-chain/patches/gcc/gthr-kos.h index 5e58191c..e71cb923 100644 --- a/utils/dc-chain/patches/gcc/gthr-kos.h +++ b/utils/dc-chain/patches/gcc/gthr-kos.h @@ -45,6 +45,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <arch/irq.h> #include <time.h> +/* 9.5.0 somehow requires this. Remove when no longer supported */ +#include <pthread.h> + /* These should work just fine. */ typedef kthread_key_t __gthread_key_t; typedef kthread_once_t __gthread_once_t; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-30 23:53:39
|
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 5494e88a4d4bab0a288892f55363e48a146417ff (commit) from 5f6cc322256b3c503b462f0a99b221ee304e5482 (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 5494e88a4d4bab0a288892f55363e48a146417ff Author: QuzarDC <qu...@co...> Date: Fri May 30 03:37:50 2025 -0400 Correct `mutex_trylock` errno. According to POSIX spec EBUSY should be returned for trylock when the mutex couldn't be locked. EAGAIN is instead used if the max number of recursive locks for the mutex has been exceeded. ----------------------------------------------------------------------- Summary of changes: include/kos/mutex.h | 2 +- kernel/libc/c11/mtx_trylock.c | 2 +- kernel/thread/mutex.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/kos/mutex.h b/include/kos/mutex.h index 67729b65..243b5cc6 100644 --- a/include/kos/mutex.h +++ b/include/kos/mutex.h @@ -239,7 +239,7 @@ int mutex_is_locked(mutex_t *m); \retval -1 If the mutex cannot be acquired without blocking \par Error Conditions: - \em EAGAIN - the mutex is already locked (mutex_lock() would block) \n + \em EBUSY - the mutex is already locked (mutex_lock() would block) \n \em EINVAL - the mutex has not been initialized properly \n \em EAGAIN - lock has been acquired too many times (recursive) \n \em EDEADLK - would deadlock (error-checking) diff --git a/kernel/libc/c11/mtx_trylock.c b/kernel/libc/c11/mtx_trylock.c index cb0e833b..eead66a0 100644 --- a/kernel/libc/c11/mtx_trylock.c +++ b/kernel/libc/c11/mtx_trylock.c @@ -9,7 +9,7 @@ int mtx_trylock(mtx_t *mtx) { if(mutex_trylock(mtx)) { - if(errno == EAGAIN) + if(errno == EBUSY) return thrd_busy; return thrd_error; diff --git a/kernel/thread/mutex.c b/kernel/thread/mutex.c index 4490ad63..09cdd3a5 100644 --- a/kernel/thread/mutex.c +++ b/kernel/thread/mutex.c @@ -198,7 +198,7 @@ int mutex_trylock(mutex_t *m) { /* Check if the lock is held by some other thread already */ if(m->count && m->holder != thd) { - errno = EAGAIN; + errno = EBUSY; return -1; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-30 02:40:19
|
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 5f6cc322256b3c503b462f0a99b221ee304e5482 (commit) via f1511f8ac9c9a9106aa414afa01d87b75d8d419f (commit) from ca4a4104eaf7c9df5d2551f8ef7748e63a7a87d5 (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 5f6cc322256b3c503b462f0a99b221ee304e5482 Author: DC-SWAT <sw...@21...> Date: Fri May 30 09:24:28 2025 +0700 aica: Fix snd_stream_shutdown(). Also a bit improved init. commit f1511f8ac9c9a9106aa414afa01d87b75d8d419f Author: DC-SWAT <sw...@21...> Date: Fri May 30 08:37:24 2025 +0700 aica: Fixed and improved checks for stream init ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/sound/snd_stream.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/kernel/arch/dreamcast/sound/snd_stream.c b/kernel/arch/dreamcast/sound/snd_stream.c index 76d9c7c1..4c8799e4 100644 --- a/kernel/arch/dreamcast/sound/snd_stream.c +++ b/kernel/arch/dreamcast/sound/snd_stream.c @@ -4,7 +4,7 @@ Copyright (C) 2000, 2001, 2002, 2003, 2004 Megan Potter Copyright (C) 2002 Florian Schulze Copyright (C) 2020 Lawrence Sebald - Copyright (C) 2023, 2024 Ruslan Rostovtsev + Copyright (C) 2023, 2024, 2025 Ruslan Rostovtsev Copyright (C) 2024 Stefanos Kornilios Mitsis Poiitidis SH-4 support routines for SPU streaming sound driver @@ -110,7 +110,8 @@ static uint32_t *sep_buffer[2] = {NULL, NULL}; static mutex_t stream_mutex = MUTEX_INITIALIZER; -static int max_channels = 2; +static int max_channels = 0; +static size_t max_buffer_size = 0; /* Check an incoming handle */ #define CHECK_HND(x) do { \ @@ -323,12 +324,24 @@ int snd_stream_init(void) { int snd_stream_init_ex(int channels, size_t buffer_size) { - if(sep_buffer[0]) { - dbglog(DBG_ERROR, "snd_stream_init_ex(): already initialized\n"); - return -1; + if(max_channels) { + if(channels > max_channels) { + dbglog(DBG_ERROR, "snd_stream_init_ex(): already initialized" + " with %d channels, but %d requested\n", + max_channels, channels); + return -1; + } + else if(max_buffer_size && buffer_size > max_buffer_size) { + dbglog(DBG_ERROR, "snd_stream_init_ex(): already initialized" + " with %d buffer size, but %d requested\n", + max_buffer_size, buffer_size); + return -1; + } + return 0; } max_channels = channels; + max_buffer_size = buffer_size; if(buffer_size > 0) { /* Create stereo separation buffers. This buffer size for each channel. @@ -468,6 +481,9 @@ void snd_stream_shutdown(void) { sep_buffer[0] = NULL; sep_buffer[1] = NULL; } + + max_channels = 0; + max_buffer_size = 0; } /* Enable / disable stream queueing */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-25 17:14:18
|
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 ca4a4104eaf7c9df5d2551f8ef7748e63a7a87d5 (commit) from a22cbb2314db9344debb8f86be9b4cdc226aa897 (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 ca4a4104eaf7c9df5d2551f8ef7748e63a7a87d5 Author: Falco Girgis <gyr...@gm...> Date: Sun May 25 12:13:28 2025 -0500 Cleaned up pvr_header.h. (#1051) * Cleaned up pvr_header.h. pvr_header.h was not matching the coding standards with the rest of the codebase. UnknownShadow also reported that our pvr_poly_hdr_t unionized structure lacked members for setting user clip area... 1) Added typedefs to all structs and enumerations, because they're public and user-facing. 2) Removed explicit names for padding in bitfields. a. They are not required. b. Even if they were, __ prefixing is reserved for internal toolchain and stdlib things and shouldn't be used. 3) Made an alias for "to_pvr_txr_ptr()" which manages to be the only function, variable, or macro in the entire PVR API to not start with PVR. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/include/dc/pvr/pvr_header.h | 216 +++++++++++----------- 1 file changed, 113 insertions(+), 103 deletions(-) diff --git a/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h b/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h index 255bec46..f0cc12b6 100644 --- a/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h +++ b/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h @@ -33,35 +33,35 @@ __BEGIN_DECLS These control how colors are represented in polygon data. */ -enum pvr_color_fmts { +typedef enum pvr_color_fmts { PVR_CLRFMT_ARGBPACKED, /**< 32-bit integer ARGB */ PVR_CLRFMT_4FLOATS, /**< 4 floating point values */ PVR_CLRFMT_INTENSITY, /**< Intensity color */ PVR_CLRFMT_INTENSITY_PREV, /**< Use last intensity */ -}; +} pvr_color_fmts_t; /** \brief Primitive clipping modes These control how primitives are clipped against the user clipping area. */ -enum pvr_clip_mode { +typedef enum pvr_clip_mode { PVR_USERCLIP_DISABLE = 0, /**< Disable clipping */ PVR_USERCLIP_INSIDE = 2, /**< Enable clipping inside area */ PVR_USERCLIP_OUTSIDE = 3, /**< Enable clipping outside area */ -}; +} pvr_clip_mode_t; /** \brief PVR rendering lists Each primitive submitted to the PVR must be placed in one of these lists, depending on its characteristics. */ -enum pvr_list_type { +typedef enum pvr_list_type { PVR_LIST_OP_POLY, /**< Opaque polygon list */ PVR_LIST_OP_MOD, /**< Opaque modifier list */ PVR_LIST_TR_POLY, /**< Translucent polygon list */ PVR_LIST_TR_MOD, /**< Translucent modifier list*/ PVR_LIST_PT_POLY, /**< Punch-thru polygon list */ -}; +} pvr_list_type_t; /** \brief Primitive culling modes @@ -69,18 +69,18 @@ enum pvr_list_type { culled. They work pretty much as you'd expect them to if you've ever used any 3D hardware before. */ -enum pvr_cull_mode { +typedef enum pvr_cull_mode { PVR_CULLING_NONE, /**< Disable culling */ PVR_CULLING_SMALL, /**< Cull if small */ PVR_CULLING_CCW, /**< Cull if counterclockwise */ PVR_CULLING_CW, /**< Cull if clockwise */ -}; +} pvr_cull_mode_t; /** \brief Depth comparison modes These set the depth function used for comparisons. */ -enum pvr_depthcmp_mode { +typedef enum pvr_depthcmp_mode { PVR_DEPTHCMP_NEVER, /**< Never pass */ PVR_DEPTHCMP_LESS, /**< Less than */ PVR_DEPTHCMP_EQUAL, /**< Equal to */ @@ -89,10 +89,10 @@ enum pvr_depthcmp_mode { PVR_DEPTHCMP_NOTEQUAL, /**< Not equal to */ PVR_DEPTHCMP_GEQUAL, /**< Greater than or equal to */ PVR_DEPTHCMP_ALWAYS, /**< Always pass */ -}; +} pvr_depthcmp_mode_t; /** \brief Texture U/V size */ -enum pvr_uv_size { +typedef enum pvr_uv_size { PVR_UV_SIZE_8, PVR_UV_SIZE_16, PVR_UV_SIZE_32, @@ -101,7 +101,7 @@ enum pvr_uv_size { PVR_UV_SIZE_256, PVR_UV_SIZE_512, PVR_UV_SIZE_1024, -}; +} pvr_uv_size_t; /** \brief Texture color calculation modes. @@ -116,40 +116,40 @@ enum pvr_uv_size { Note that the offset color (aka. oargb), if specular lighting is enabled, is added to the result. Its alpha channel is ignored. */ -enum pvr_txr_shading_mode { +typedef enum pvr_txr_shading_mode { PVR_TXRENV_REPLACE, /**< px = ARGB(tex) */ PVR_TXRENV_MODULATE, /**< px = A(tex) + RGB(col) * RGB(tex) */ PVR_TXRENV_DECAL, /**< px = A(col) + RGB(tex) * A(tex) + RGB(col) * (1 - A(tex)) */ PVR_TXRENV_MODULATEALPHA, /**< px = ARGB(col) * ARGB(tex) */ -}; +} pvr_txr_shading_mode_t; /** \brief Texture sampling modes */ -enum pvr_filter_mode { +typedef enum pvr_filter_mode { PVR_FILTER_NEAREST, /**< No filtering (point sample) */ PVR_FILTER_BILINEAR, /**< Bilinear interpolation */ PVR_FILTER_TRILINEAR1, /**< Trilinear interpolation pass 1 */ PVR_FILTER_TRILINEAR2, /**< Trilinear interpolation pass 2 */ PVR_FILTER_NONE = PVR_FILTER_NEAREST, -}; +} pvr_filter_mode_t; /** \brief Fog modes Each polygon can decide what fog type is used by specifying the fog mode in its header. */ -enum pvr_fog_type { +typedef enum pvr_fog_type { PVR_FOG_TABLE, /**< Table fog */ PVR_FOG_VERTEX, /**< Vertex fog */ PVR_FOG_DISABLE, /**< Disable fog */ PVR_FOG_TABLE2, /**< Table fog mode 2 */ -}; +} pvr_fog_type_t; /** \brief Blending modes These are all the blending modes that can be done with regard to alpha blending on the PVR. */ -enum pvr_blend_mode { +typedef enum pvr_blend_mode { PVR_BLEND_ZERO, /**< None of this color */ PVR_BLEND_ONE, /**< All of this color */ PVR_BLEND_DESTCOLOR, /**< Destination color */ @@ -158,13 +158,13 @@ enum pvr_blend_mode { PVR_BLEND_INVSRCALPHA, /**< Blend with inverse source alpha */ PVR_BLEND_DESTALPHA, /**< Blend with destination alpha */ PVR_BLEND_INVDESTALPHA, /**< Blend with inverse destination alpha */ -}; +} pvr_blend_mode_t; /** \brief Texture formats These are the texture formats that the PVR supports. */ -enum pvr_pixel_mode { +typedef enum pvr_pixel_mode { PVR_PIXEL_MODE_ARGB1555, /**< 16-bit ARGB1555 */ PVR_PIXEL_MODE_RGB565, /**< 16-bit RGB565 */ PVR_PIXEL_MODE_ARGB4444, /**< 16-bit ARGB4444 */ @@ -172,31 +172,31 @@ enum pvr_pixel_mode { PVR_PIXEL_MODE_BUMP, /**< Bumpmap format */ PVR_PIXEL_MODE_PAL_4BPP, /**< 4BPP paletted format */ PVR_PIXEL_MODE_PAL_8BPP, /**< 8BPP paletted format */ -}; +} pvr_pixel_mode_t; /** \brief Triangle strip length This sets the maximum length of a triangle strip, if not configured in auto mode. */ -enum pvr_strip_len { +typedef enum pvr_strip_len { PVR_STRIP_LEN_1, PVR_STRIP_LEN_2, PVR_STRIP_LEN_4, PVR_STRIP_LEN_6, -}; +} pvr_strip_len_t; /** \brief Polygon header type This enum contains the possible PVR header types. */ -enum pvr_hdr_type { +typedef enum pvr_hdr_type { PVR_HDR_EOL = 0, PVR_HDR_USERCLIP = 1, PVR_HDR_OBJECT_LIST_SET = 2, PVR_HDR_POLY = 4, PVR_HDR_SPRITE = 5, -}; +} pvr_hdr_type_t; /** \brief Texture address @@ -217,82 +217,87 @@ static inline pvr_txr_ptr_t to_pvr_txr_ptr(pvr_ptr_t addr) { return ((uint32_t)addr & 0x00fffff8) >> 3; } +/** \brief Get texture address form VRAM address + + Alias macro for to_pvr_txr_ptr(). +*/ +#define pvr_to_pvr_txr_ptr(addr) to_pvr_txr_ptr(addr) + /** \brief PVR header command This structure contains all the fields for the command of PVR headers. */ -struct pvr_poly_hdr_cmd { - bool uvfmt_f16 :1; /* 0 */ /**< Use 16-bit floating-point U/Vs */ - bool gouraud :1; /* 1 */ /**< Enable gouraud shading */ - bool oargb_en :1; /* 2 */ /**< Enable specular lighting */ - bool txr_en :1; /* 3 */ /**< Enable texturing */ - enum pvr_color_fmts color_fmt :2; /* 5-4 */ /**< Select color encoding */ - bool mod_normal :1; /* 6 */ /**< true: normal, false: cheap shadow */ - bool modifier_en :1; /* 7 */ /**< Enable modifier effects */ - uint32_t __pad0 :8; /* 15-8 */ - enum pvr_clip_mode clip_mode :2; /* 17-16 */ /**< Clipping mode */ - enum pvr_strip_len strip_len :2; /* 19-18 */ /**< Triangle strips length (if non-auto) */ - uint32_t __pad1 :3; /* 22-20 */ - bool auto_strip_len :1; /* 23 */ /**< Auto select triangle strips length */ - - enum pvr_list_type list_type :3; /* 26-24 */ /**< Render list to use */ - uint32_t __pad2 :1; /* 27 */ - bool strip_end :1; /* 28 */ /**< Mark an end-of-strip */ - enum pvr_hdr_type hdr_type :3; /* 31-29 */ /**< Header type */ -}; +typedef struct pvr_poly_hdr_cmd { + bool uvfmt_f16 :1; /* 0 */ /**< Use 16-bit floating-point U/Vs */ + bool gouraud :1; /* 1 */ /**< Enable gouraud shading */ + bool oargb_en :1; /* 2 */ /**< Enable specular lighting */ + bool txr_en :1; /* 3 */ /**< Enable texturing */ + pvr_color_fmts_t color_fmt :2; /* 5-4 */ /**< Select color encoding */ + bool mod_normal :1; /* 6 */ /**< true: normal, false: cheap shadow */ + bool modifier_en :1; /* 7 */ /**< Enable modifier effects */ + uint32_t :8; /* 15-8 */ + pvr_clip_mode_t clip_mode :2; /* 17-16 */ /**< Clipping mode */ + pvr_strip_len_t strip_len :2; /* 19-18 */ /**< Triangle strips length (if non-auto) */ + uint32_t :3; /* 22-20 */ + bool auto_strip_len :1; /* 23 */ /**< Auto select triangle strips length */ + pvr_list_type_t list_type :3; /* 26-24 */ /**< Render list to use */ + uint32_t :1; /* 27 */ + bool strip_end :1; /* 28 */ /**< Mark an end-of-strip */ + pvr_hdr_type_t hdr_type :3; /* 31-29 */ /**< Header type */ +} pvr_poly_hdr_cmd_t; /** \brief PVR header mode1 This structure contains all the fields for the mode1 parameter of PVR headers. */ -struct pvr_poly_hdr_mode1 { - uint32_t __pad3 :25; /* 24-0 */ - bool txr_en :1; /* 25 */ /**< Enable texturing (2nd bit) */ - bool depth_write_dis :1; /* 26 */ /**< Disable depth writes */ - enum pvr_cull_mode culling :2; /* 28-27 */ /**< Culling mode */ - enum pvr_depthcmp_mode depth_cmp :3; /* 31-29 */ /**< Depth comparison mode */ -}; +typedef struct pvr_poly_hdr_mode1 { + uint32_t :25; /* 24-0 */ + bool txr_en :1; /* 25 */ /**< Enable texturing (2nd bit) */ + bool depth_write_dis :1; /* 26 */ /**< Disable depth writes */ + pvr_cull_mode_t culling :2; /* 28-27 */ /**< Culling mode */ + pvr_depthcmp_mode_t depth_cmp :3; /* 31-29 */ /**< Depth comparison mode */ +} pvr_poly_hdr_mode1_t; /** \brief PVR header mode2 This structure contains all the fields for the mode2 parameter of PVR headers. */ -struct pvr_poly_hdr_mode2 { - enum pvr_uv_size v_size :3; /* 2-0 */ /**< Texture height */ - enum pvr_uv_size u_size :3; /* 5-3 */ /**< Texture width */ - enum pvr_txr_shading_mode shading :2; /* 7-6 */ /**< Shading mode */ - uint32_t mip_bias :4; /* 11-8 */ /**< Bias for mipmaps */ - bool supersampling :1; /* 12 */ /**< Enable texture supersampling */ - enum pvr_filter_mode filter_mode :2; /* 14-13 */ /**< Texture filtering mode */ - bool v_clamp :1; /* 15 */ /**< Clamp V to 1.0 */ - bool u_clamp :1; /* 16 */ /**< Clamp U to 1.0 */ - bool v_flip :1; /* 17 */ /**< Flip V after 1.0 */ - bool u_flip :1; /* 18 */ /**< Flip U after 1.0 */ - bool txralpha_dis :1; /* 19 */ /**< Disable alpha channel in textures */ - bool alpha :1; /* 20 */ /**< Enable alpha channel in vertex colors */ - bool fog_clamp :1; /* 21 */ /**< Enable fog clamping */ - enum pvr_fog_type fog_type :2; /* 23-22 */ /**< Select fog type */ - bool blend_dst_acc2 :1; /* 24 */ /**< Blend to the 2nd accumulation buffer */ - bool blend_src_acc2 :1; /* 25 */ /**< Blend from the 2nd accumulation buffer */ - enum pvr_blend_mode blend_dst :3; /* 28-26 */ /**< Blend mode for the background */ - enum pvr_blend_mode blend_src :3; /* 31-29 */ /**< Blend mode for the foreground */ -}; +typedef struct pvr_poly_hdr_mode2 { + pvr_uv_size_t v_size :3; /* 2-0 */ /**< Texture height */ + pvr_uv_size_t u_size :3; /* 5-3 */ /**< Texture width */ + pvr_txr_shading_mode_t shading :2; /* 7-6 */ /**< Shading mode */ + uint32_t mip_bias :4; /* 11-8 */ /**< Bias for mipmaps */ + bool supersampling :1; /* 12 */ /**< Enable texture supersampling */ + pvr_filter_mode_t filter_mode :2; /* 14-13 */ /**< Texture filtering mode */ + bool v_clamp :1; /* 15 */ /**< Clamp V to 1.0 */ + bool u_clamp :1; /* 16 */ /**< Clamp U to 1.0 */ + bool v_flip :1; /* 17 */ /**< Flip V after 1.0 */ + bool u_flip :1; /* 18 */ /**< Flip U after 1.0 */ + bool txralpha_dis :1; /* 19 */ /**< Disable alpha channel in textures */ + bool alpha :1; /* 20 */ /**< Enable alpha channel in vertex colors */ + bool fog_clamp :1; /* 21 */ /**< Enable fog clamping */ + pvr_fog_type_t fog_type :2; /* 23-22 */ /**< Select fog type */ + bool blend_dst_acc2 :1; /* 24 */ /**< Blend to the 2nd accumulation buffer */ + bool blend_src_acc2 :1; /* 25 */ /**< Blend from the 2nd accumulation buffer */ + pvr_blend_mode_t blend_dst :3; /* 28-26 */ /**< Blend mode for the background */ + pvr_blend_mode_t blend_src :3; /* 31-29 */ /**< Blend mode for the foreground */ +} pvr_poly_hdr_mode2_t; /** \brief PVR header mode3 This structure contains all the fields for the mode3 parameter of PVR headers. */ -struct pvr_poly_hdr_mode3 { - pvr_txr_ptr_t txr_base :25; /* 24-0 */ /**< Pre-processed texture address */ - bool x32stride :1; /* 25 */ /**< Set if texture stride is multiple of 32 */ - bool nontwiddled :1; /* 26 */ /**< Set if texture is not twiddled */ - enum pvr_pixel_mode pixel_mode :3; /* 29-27 */ /**< Select the texture's pixel format */ - bool vq_en :1; /* 30 */ /**< Set if the texture is VQ encoded */ - bool mipmap_en :1; /* 31 */ /**< Enable mipmaps */ -}; +typedef struct pvr_poly_hdr_mode3 { + pvr_txr_ptr_t txr_base :25; /* 24-0 */ /**< Pre-processed texture address */ + bool x32stride :1; /* 25 */ /**< Set if texture stride is multiple of 32 */ + bool nontwiddled :1; /* 26 */ /**< Set if texture is not twiddled */ + pvr_pixel_mode_t pixel_mode :3; /* 29-27 */ /**< Select the texture's pixel format */ + bool vq_en :1; /* 30 */ /**< Set if the texture is VQ encoded */ + bool mipmap_en :1; /* 31 */ /**< Enable mipmaps */ +} pvr_poly_hdr_mode3_t; /** \brief PVR polygon header. @@ -301,50 +306,55 @@ struct pvr_poly_hdr_mode3 { */ typedef __attribute__((aligned(32))) struct pvr_poly_hdr { union { - uint32_t cmd; /**< Raw access to cmd param */ - struct pvr_poly_hdr_cmd m0; /**< command parameters */ + uint32_t cmd; /**< Raw access to cmd param */ + pvr_poly_hdr_cmd_t m0; /**< command parameters */ }; union { - uint32_t mode1; /**< Raw access to mode1 param */ - struct pvr_poly_hdr_mode1 m1; /**< mode1 parameters */ + uint32_t mode1; /**< Raw access to mode1 param */ + pvr_poly_hdr_mode1_t m1; /**< mode1 parameters */ }; union { - uint32_t mode2; /**< Raw access to mode2 param */ - uint32_t mode2_0; /**< Legacy name */ - struct pvr_poly_hdr_mode2 m2; /**< mode2 parameters (modifiers: outside volume) */ + uint32_t mode2; /**< Raw access to mode2 param */ + uint32_t mode2_0; /**< Legacy name */ + pvr_poly_hdr_mode2_t m2; /**< mode2 parameters (modifiers: outside volume) */ }; union { - uint32_t mode3; /**< Raw access to mode3 param */ - uint32_t mode3_0; /**< Legacy name */ - struct pvr_poly_hdr_mode3 m3; /**< mode3 parameters (modifiers: outside volume) */ + uint32_t mode3; /**< Raw access to mode3 param */ + uint32_t mode3_0; /**< Legacy name */ + pvr_poly_hdr_mode3_t m3; /**< mode3 parameters (modifiers: outside volume) */ }; union { struct { /* Intensity color */ - float a; /**< Intensity color alpha */ - float r; /**< Intensity color red */ - float g; /**< Intensity color green */ - float b; /**< Intensity color blue */ + float a; /**< Intensity color alpha */ + float r; /**< Intensity color red */ + float g; /**< Intensity color green */ + float b; /**< Intensity color blue */ }; struct { /* Modifier volume */ union { struct { - uint32_t mode2_1; /**< Legacy name */ - uint32_t mode3_1; /**< Legacy name */ + uint32_t mode2_1; /**< Legacy name */ + uint32_t mode3_1; /**< Legacy name */ }; struct { - struct pvr_poly_hdr_mode2 m2; /**< mode2 parameters (modifiers: inside volume) */ - struct pvr_poly_hdr_mode3 m3; /**< mode3 parameters (modifiers: inside volume) */ - } modifier; + pvr_poly_hdr_mode2_t m2; /**< mode2 parameters (modifiers: inside volume) */ + pvr_poly_hdr_mode3_t m3; /**< mode3 parameters (modifiers: inside volume) */ + } modifier; /**< Modifier volume parameters */ }; - uint64_t __pad4; }; struct { /* Sprite */ - uint32_t argb; /**< 32-bit ARGB vertex color for sprites */ - uint32_t oargb; /**< 32-bit ARGB specular color for sprites */ - uint64_t __pad5; + uint32_t argb; /**< 32-bit ARGB vertex color for sprites */ + uint32_t oargb; /**< 32-bit ARGB specular color for sprites */ + }; + struct { + /* User clip area */ + uint32_t start_x; /**< Left (inclusive) border of user clip area */ + uint32_t start_y; /**< Top (inclusive) border of user clip area */ + uint32_t end_x; /**< Right (inclusive) border of user clip area */ + uint32_t end_y; /**< Bottom (inclusive) border of user clip area */ }; }; } pvr_poly_hdr_t; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-25 16:22:15
|
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 a22cbb2314db9344debb8f86be9b4cdc226aa897 (commit) from dbdbc9bf1472212954ee49dedd88f9f9129573f2 (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 a22cbb2314db9344debb8f86be9b4cdc226aa897 Author: QuzarDC <qu...@co...> Date: Thu May 22 15:01:40 2025 -0400 Correct various doxygen warnings/issues. In a few files group end markers were missing, in a few special characters needed escaping, and others had incorrect names in the doc vs the actual code. ----------------------------------------------------------------------- Summary of changes: include/kos/cdefs.h | 10 +++++----- kernel/arch/dreamcast/include/arch/irq.h | 10 +++++----- kernel/arch/dreamcast/include/arch/trap.h | 12 ++++++------ kernel/arch/dreamcast/include/dc/maple/keyboard.h | 2 +- kernel/arch/dreamcast/include/dc/perf_monitor.h | 3 +++ kernel/arch/dreamcast/include/dc/pvr/pvr_header.h | 3 +++ kernel/arch/dreamcast/include/dc/sound/sound.h | 4 ++-- kernel/arch/dreamcast/include/dc/sound/stream.h | 1 - 8 files changed, 25 insertions(+), 20 deletions(-) diff --git a/include/kos/cdefs.h b/include/kos/cdefs.h index e016a51b..dcb1f192 100644 --- a/include/kos/cdefs.h +++ b/include/kos/cdefs.h @@ -31,7 +31,7 @@ # warning Your GCC is too old. This will probably not work right. #endif -/** \defgroup system_attributes +/** \defgroup system_attributes Function Attribute Defines \brief Definitions for builtin attributes and compiler directives \ingroup system @@ -173,7 +173,7 @@ /** @} */ -/** \defgroup system_compat +/** \defgroup system_compat Language Compatibility Defines \brief Definitions for language features \ingroup system @@ -206,7 +206,7 @@ /** @} */ -/** \defgroup system_helpers +/** \defgroup system_helpers Helper Macros \brief General useful language macros \ingroup system @@ -222,7 +222,7 @@ by the compiler. This can only be used within a function. Example: - #include <stddef.h> + \#include <stddef.h> ... static char *foo_to_char(struct foo *foo) { @@ -244,7 +244,7 @@ by the compiler. This can be used in an expression: its value is "0". Example: - #define foo_to_char(foo) \ + \#define foo_to_char(foo) \ ((char *)(foo) \ + __build_assert_or_zero(offsetof(struct foo, string) == 0)) diff --git a/kernel/arch/dreamcast/include/arch/irq.h b/kernel/arch/dreamcast/include/arch/irq.h index 3fcb4752..f4858bd5 100644 --- a/kernel/arch/dreamcast/include/arch/irq.h +++ b/kernel/arch/dreamcast/include/arch/irq.h @@ -1,13 +1,13 @@ /* KallistiOS ##version## - arch/dreamcast/include/irq.h + arch/dreamcast/include/arch/irq.h Copyright (C) 2000-2001 Megan Potter Copyright (C) 2024 Paul Cercueil Copyright (C) 2024 Falco Girgis */ -/** \file +/** \file arch/irq.h \brief Interrupt and exception handling. \ingroup irqs @@ -57,7 +57,7 @@ __BEGIN_DECLS @{ */ -/** \defgroup Context +/** \defgroup irq_context Context \brief Thread execution state and accessors This API includes the structure and accessors for a @@ -437,7 +437,7 @@ typedef struct irq_cb { Passing a NULL value for hnd will remove the current handler, if any. \param code The IRQ type to set the handler for - (see \ref irq_exception_codes). + (see #irq_t). \param hnd A pointer to a procedure to handle the exception. \param data A pointer that will be passed along to the callback. @@ -480,7 +480,7 @@ irq_cb_t irq_get_handler(irq_t code); \retval 0 On success (no error conditions defined). */ -int irq_set_global_handler(irq_handler handler, void *data); +int irq_set_global_handler(irq_handler hnd, void *data); /** Get the global exception handler. diff --git a/kernel/arch/dreamcast/include/arch/trap.h b/kernel/arch/dreamcast/include/arch/trap.h index 4bbf05a6..e21c9003 100644 --- a/kernel/arch/dreamcast/include/arch/trap.h +++ b/kernel/arch/dreamcast/include/arch/trap.h @@ -5,7 +5,7 @@ */ -/** \file +/** \file arch/trap.h \brief Interrupt and exception handling. \ingroup traps @@ -59,15 +59,15 @@ typedef uint8_t trapa_t; /** The type of a TRAPA handler - \param trap The IRQ that caused the handler to be called. + \param code The IRQ that caused the handler to be called. \param context The CPU's context. \param data Arbitrary userdata associated with the handler. */ -typedef void (*trapa_handler)(trapa_t trap, irq_context_t *context, void *data); +typedef void (*trapa_handler)(trapa_t code, irq_context_t *context, void *data); /** Set or remove a handler for a trapa code. - \param trap The value passed to the trapa opcode. + \param code The value passed to the trapa opcode. \param hnd A pointer to the procedure to handle the trap. \param data A pointer that will be passed along to the callback. @@ -75,7 +75,7 @@ typedef void (*trapa_handler)(trapa_t trap, irq_context_t *context, void *data); \sa trapa_get_handler() */ -int trapa_set_handler(trapa_t trap, trapa_handler hnd, void *data); +int trapa_set_handler(trapa_t code, trapa_handler hnd, void *data); /** Get an existing TRAPA handler. @@ -87,7 +87,7 @@ int trapa_set_handler(trapa_t trap, trapa_handler hnd, void *data); \sa trapa_set_handler() */ -trapa_handler trapa_get_handler(trapa_t trap, void **data); +trapa_handler trapa_get_handler(trapa_t code, void **data); /** @} */ diff --git a/kernel/arch/dreamcast/include/dc/maple/keyboard.h b/kernel/arch/dreamcast/include/dc/maple/keyboard.h index ea9862b7..aa0dbdfa 100644 --- a/kernel/arch/dreamcast/include/dc/maple/keyboard.h +++ b/kernel/arch/dreamcast/include/dc/maple/keyboard.h @@ -247,7 +247,7 @@ typedef enum __packed kbd_key { KBD_KEY_QUOTE = 0x34, /**< \brief " key */ KBD_KEY_TILDE = 0x35, /**< \brief ~ key */ KBD_KEY_COMMA = 0x36, /**< \brief , key */ - KBD_KEY_PERIOD = 0x37, /**< \brief . key */ + KBD_KEY_PERIOD = 0x37, /**< \brief \. key */ KBD_KEY_SLASH = 0x38, /**< \brief Slash key */ KBD_KEY_CAPSLOCK = 0x39, /**< \brief Caps Lock key */ KBD_KEY_F1 = 0x3a, /**< \brief F1 key */ diff --git a/kernel/arch/dreamcast/include/dc/perf_monitor.h b/kernel/arch/dreamcast/include/dc/perf_monitor.h index 20617623..8f43d032 100644 --- a/kernel/arch/dreamcast/include/dc/perf_monitor.h +++ b/kernel/arch/dreamcast/include/dc/perf_monitor.h @@ -115,5 +115,8 @@ void perf_monitor_exit(void); */ void perf_monitor_print(FILE *f); +/** @} */ + __END_DECLS + #endif /* __KOS_PERF_MONITOR_H */ diff --git a/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h b/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h index c8f6326c..255bec46 100644 --- a/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h +++ b/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h @@ -351,5 +351,8 @@ typedef __attribute__((aligned(32))) struct pvr_poly_hdr { _Static_assert(sizeof(pvr_poly_hdr_t) == 32, "Invalid header size"); +/** @} */ + __END_DECLS + #endif /* __DC_PVR_PVR_HEADER_H */ diff --git a/kernel/arch/dreamcast/include/dc/sound/sound.h b/kernel/arch/dreamcast/include/dc/sound/sound.h index 963bf05f..8d02693d 100644 --- a/kernel/arch/dreamcast/include/dc/sound/sound.h +++ b/kernel/arch/dreamcast/include/dc/sound/sound.h @@ -222,7 +222,7 @@ void snd_adpcm_split(uint32_t *data, uint32_t *left, uint32_t *right, size_t siz This function returns actual the channel position that stores in SPU memory and updated by the SPU firmware. - \param chn The channel to retrieve position. + \param ch The channel to retrieve position. \return Last channel position in samples. */ @@ -233,7 +233,7 @@ uint16_t snd_get_pos(unsigned int ch); This function returns actual the channel playback state that stores in AICA registers directly. - \param chn The channel to check. + \param ch The channel to check. \return True if the channel is playing. */ diff --git a/kernel/arch/dreamcast/include/dc/sound/stream.h b/kernel/arch/dreamcast/include/dc/sound/stream.h index bcca4a06..851e65b4 100644 --- a/kernel/arch/dreamcast/include/dc/sound/stream.h +++ b/kernel/arch/dreamcast/include/dc/sound/stream.h @@ -194,7 +194,6 @@ void snd_stream_filter_remove(snd_stream_hnd_t hnd, This function has no effect. The stream is prefilled on start. This is deprecated and should be removed if used. - \param hnd Param. */ static const int __snd_stream_prefill __depr("snd_stream_prefill has no effect and should be removed") = 0; #define snd_stream_prefill(x) ((void)__snd_stream_prefill) hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-24 14:38:31
|
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 dbdbc9bf1472212954ee49dedd88f9f9129573f2 (commit) from 7bbff2ddd5b553ed9656ad856992fd3e4aa33dc7 (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 dbdbc9bf1472212954ee49dedd88f9f9129573f2 Author: QuzarDC <qu...@co...> Date: Sat May 24 00:39:37 2025 -0400 Correct logical error in snd_stream double init protection. It was exactly backwards and never could have worked. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/sound/snd_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/arch/dreamcast/sound/snd_stream.c b/kernel/arch/dreamcast/sound/snd_stream.c index 6275f2dd..76d9c7c1 100644 --- a/kernel/arch/dreamcast/sound/snd_stream.c +++ b/kernel/arch/dreamcast/sound/snd_stream.c @@ -323,7 +323,7 @@ int snd_stream_init(void) { int snd_stream_init_ex(int channels, size_t buffer_size) { - if(!sep_buffer[0]) { + if(sep_buffer[0]) { dbglog(DBG_ERROR, "snd_stream_init_ex(): already initialized\n"); return -1; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-23 22:48:56
|
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 7bbff2ddd5b553ed9656ad856992fd3e4aa33dc7 (commit) from 35d77329f77d75bf74343614fede778fea026ec9 (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 7bbff2ddd5b553ed9656ad856992fd3e4aa33dc7 Author: darc <da...@pr...> Date: Fri May 23 14:57:59 2025 -0500 environ_base.sh: Source environ_dreamcast.sh later The $KOS_SH4_PRECISION check is dependent on $KOS_CC being established, so move the sourcing of environ_dreamcast.sh after compiler paths are set. ----------------------------------------------------------------------- Summary of changes: environ_base.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/environ_base.sh b/environ_base.sh index 092d366f..cd2fcf62 100644 --- a/environ_base.sh +++ b/environ_base.sh @@ -14,9 +14,6 @@ fi # Arch kernel folder. export KOS_ARCH_DIR="${KOS_BASE}/kernel/arch/${KOS_ARCH}" -# Pull in the arch environ file. -. ${KOS_BASE}/environ_${KOS_ARCH}.sh - # Add the compiler bins dir to the path if it is not already. if ! expr ":$PATH:" : ".*:${KOS_CC_BASE}/bin:.*" > /dev/null ; then export PATH="${PATH}:${KOS_CC_BASE}/bin" @@ -48,6 +45,10 @@ export KOS_LD="${KOS_CC_BASE}/bin/${KOS_CC_PREFIX}-ld" export KOS_RANLIB="${KOS_CC_BASE}/bin/${KOS_CC_PREFIX}-gcc-ranlib" export KOS_STRIP="${KOS_CC_BASE}/bin/${KOS_CC_PREFIX}-strip" export KOS_SIZE="${KOS_CC_BASE}/bin/${KOS_CC_PREFIX}-size" + +# Pull in the arch environ file. +. ${KOS_BASE}/environ_${KOS_ARCH}.sh + export KOS_CFLAGS="${KOS_CFLAGS} ${KOS_INC_PATHS} -D_arch_${KOS_ARCH} -D_arch_sub_${KOS_SUBARCH} -Wall -g" export KOS_CPPFLAGS="${KOS_CPPFLAGS} ${KOS_INC_PATHS_CPP}" hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-23 02:09:21
|
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 35d77329f77d75bf74343614fede778fea026ec9 (commit) via c2327bd77f36f98ba02d7e17eb3b6dccdf6ba9c1 (commit) from 138477b71b164d466023a29e316631f3e0bfcaef (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 35d77329f77d75bf74343614fede778fea026ec9 Author: QuzarDC <qu...@co...> Date: Thu May 22 21:54:28 2025 -0400 Remove double-init of streams in multi-stream example. commit c2327bd77f36f98ba02d7e17eb3b6dccdf6ba9c1 Author: QuzarDC <qu...@co...> Date: Thu May 22 21:50:32 2025 -0400 Prevent double-init of snd_stream. Without this protection, there would be a memory leak caused by separation buffers being allocated multiple times. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/sound/multi-stream/main.c | 1 - kernel/arch/dreamcast/sound/snd_stream.c | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/dreamcast/sound/multi-stream/main.c b/examples/dreamcast/sound/multi-stream/main.c index 4758bfab..2635afed 100644 --- a/examples/dreamcast/sound/multi-stream/main.c +++ b/examples/dreamcast/sound/multi-stream/main.c @@ -28,7 +28,6 @@ int main(int argc, char **argv) { vid_set_mode(DM_640x480, PM_RGB555); // Initialize sound system and WAV - snd_stream_init(); wav_init(); wav_stream_hnd_t faucet = wav_create("/rd/faucet.wav", LOOP); diff --git a/kernel/arch/dreamcast/sound/snd_stream.c b/kernel/arch/dreamcast/sound/snd_stream.c index 7f51a9f4..6275f2dd 100644 --- a/kernel/arch/dreamcast/sound/snd_stream.c +++ b/kernel/arch/dreamcast/sound/snd_stream.c @@ -322,6 +322,12 @@ int snd_stream_init(void) { } int snd_stream_init_ex(int channels, size_t buffer_size) { + + if(!sep_buffer[0]) { + dbglog(DBG_ERROR, "snd_stream_init_ex(): already initialized\n"); + return -1; + } + max_channels = channels; if(buffer_size > 0) { hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-23 00:07:29
|
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 138477b71b164d466023a29e316631f3e0bfcaef (commit) from f6f303f21187602e2783b64295c73d6650c8c17c (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 138477b71b164d466023a29e316631f3e0bfcaef Author: QuzarDC <qu...@co...> Date: Tue May 20 18:23:58 2025 -0400 Add missing DECLS to pthreads and sys headers. ----------------------------------------------------------------------- Summary of changes: addons/libpthread/pthread-internal.h | 5 +++++ include/sys/_pthreadtypes.h | 5 +++++ include/sys/lock.h | 5 +++++ include/sys/stdio.h | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/addons/libpthread/pthread-internal.h b/addons/libpthread/pthread-internal.h index 9a3b3b2e..c0b457cb 100644 --- a/addons/libpthread/pthread-internal.h +++ b/addons/libpthread/pthread-internal.h @@ -7,6 +7,9 @@ #ifndef __PTHREAD_INTERNAL_H #define __PTHREAD_INTERNAL_H +#include <sys/cdefs.h> +__BEGIN_DECLS + #define __PTHREAD_HAVE_ATTR_TYPE 1 #define __PTHREAD_HAVE_MUTEX_TYPE 1 #define __PTHREAD_HAVE_COND_TYPE 1 @@ -81,4 +84,6 @@ STATIC_ASSERT(__PTHREAD_BARRIER_SIZE == THD_BARRIER_SIZE) #undef STATIC_ASSERT +__END_DECLS + #endif /* !__PTHREAD_INTERNAL_H */ diff --git a/include/sys/_pthreadtypes.h b/include/sys/_pthreadtypes.h index 38291f96..67d6166d 100644 --- a/include/sys/_pthreadtypes.h +++ b/include/sys/_pthreadtypes.h @@ -8,6 +8,9 @@ #ifndef __SYS_PTHREADTYPES_H #define __SYS_PTHREADTYPES_H +#include <sys/cdefs.h> +__BEGIN_DECLS + typedef unsigned long int pthread_t; typedef struct pthread_mutexattr_t { @@ -100,4 +103,6 @@ typedef union pthread_barrier_t { #undef __PTHREAD_BARRIER_SIZE #endif /* !__PTHREAD_HAVE_BARRIER_TYPE */ +__END_DECLS + #endif /* !__SYS_PTHREADTYPES_H */ diff --git a/include/sys/lock.h b/include/sys/lock.h index eec60041..66529899 100644 --- a/include/sys/lock.h +++ b/include/sys/lock.h @@ -19,6 +19,9 @@ #ifndef __SYS_LOCK_H__ #define __SYS_LOCK_H__ +#include <sys/cdefs.h> +__BEGIN_DECLS + /** \cond */ typedef struct { @@ -63,4 +66,6 @@ void __newlib_lock_release_recursive(__newlib_recursive_lock_t*); /** \endcond */ +__END_DECLS + #endif /* __SYS_LOCK_H__ */ diff --git a/include/sys/stdio.h b/include/sys/stdio.h index c186d86c..dee114a5 100644 --- a/include/sys/stdio.h +++ b/include/sys/stdio.h @@ -8,6 +8,9 @@ #ifndef _NEWLIB_STDIO_H #define _NEWLIB_STDIO_H +#include <sys/cdefs.h> +__BEGIN_DECLS + // Cribbed from newlib sys/stdio.h /* Internal locking macros, used to protect stdio functions. In the @@ -31,4 +34,6 @@ #include <stdarg.h> #include <kos/fs.h> +__END_DECLS + #endif /* _NEWLIB_STDIO_H */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-22 14:05:52
|
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 f6f303f21187602e2783b64295c73d6650c8c17c (commit) from f643745ca6342e44612a115f7fe28b0a95435a6a (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 f6f303f21187602e2783b64295c73d6650c8c17c Author: Paul Cercueil <pa...@cr...> Date: Thu May 22 11:08:02 2025 +0200 pvr: Get rid of dummy fields in prim headers Those dummy fields were added to the various primitive headers to make sure that they had the correct size. Now that all primitive headers use the same pvr_poly_hdr_t type, which has the correct size even with the dummy fields removed, all the dummy fields can be removed. Note that the driver code was setting them either to 0 or 0xffff'ffff, for some reason. Given that this was written almost 25 years ago and everything seems to work just fine without writing those fields, it seems safe to drop them. Dropping them also fixes #1034, which happened since the switch to the common pvr_poly_hdr_t type, and was caused by the dummy fields moving around (as prior to that, the d1/d2 fields in a pvr_poly_mod_hdr were at different offsets than the d1/d2 fields in a pvr_poly_hdr, for instance). Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/pvr/pvr_misc.c | 4 ---- kernel/arch/dreamcast/hardware/pvr/pvr_prim.c | 16 ++-------------- kernel/arch/dreamcast/include/dc/pvr/pvr_header.h | 8 -------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c index 91e604d8..00937aca 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c @@ -264,10 +264,6 @@ void pvr_blank_polyhdr_buf(int type, pvr_poly_hdr_t * poly) { /* Put in the list type */ poly->cmd = FIELD_PREP(PVR_TA_CMD_TYPE, type) | 0x80840012; - - /* Fill in dummy values */ - poly->d1 = poly->d2 = poly->d3 = poly->d4 = 0xffffffff; - } pvr_ptr_t pvr_get_front_buffer(void) { diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_prim.c b/kernel/arch/dreamcast/hardware/pvr/pvr_prim.c index 73d6e38a..45da95f2 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_prim.c +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_prim.c @@ -96,16 +96,9 @@ void pvr_poly_compile(pvr_poly_hdr_t *dst, const pvr_poly_cxt_t *src) { if(src->fmt.modifier && src->gen.modifier_mode) { /* If we're affected by a modifier volume, silently promote the header to the one that is affected by a modifier volume. */ - dst->d1 = mode2; - dst->d2 = mode3; + dst->mode2_1 = mode2; + dst->mode3_1 = mode3; } - else { - dst->d1 = 0xffffffff; - dst->d2 = 0xffffffff; - } - - dst->d3 = 0xffffffff; - dst->d4 = 0xffffffff; } /* Create a colored polygon context with parameters similar to @@ -353,8 +346,6 @@ void pvr_mod_compile(pvr_mod_hdr_t *dst, pvr_list_t list, uint32 mode, dst->mode1 = FIELD_PREP(PVR_TA_PM1_MODIFIERINST, mode) | FIELD_PREP(PVR_TA_PM1_CULLING, cull); - - dst->d1 = dst->d2 = dst->d3 = dst->d4 = dst->d5 = dst->d6 = 0; } /* Compile a polygon context into a polygon header that is affected by @@ -467,9 +458,6 @@ void pvr_poly_mod_compile(pvr_poly_mod_hdr_t *dst, const pvr_poly_cxt_t *src) { dst->mode2_1 = mode2; dst->mode3_1 = mode3; - - dst->d1 = 0xffffffff; - dst->d2 = 0xffffffff; } /* Create a colored polygon context for polygons affected by modifier volumes */ diff --git a/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h b/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h index f7d80e6c..c8f6326c 100644 --- a/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h +++ b/kernel/arch/dreamcast/include/dc/pvr/pvr_header.h @@ -311,22 +311,14 @@ typedef __attribute__((aligned(32))) struct pvr_poly_hdr { union { uint32_t mode2; /**< Raw access to mode2 param */ uint32_t mode2_0; /**< Legacy name */ - uint32_t d5; /**< Dummy value 5 */ struct pvr_poly_hdr_mode2 m2; /**< mode2 parameters (modifiers: outside volume) */ }; union { uint32_t mode3; /**< Raw access to mode3 param */ uint32_t mode3_0; /**< Legacy name */ - uint32_t d6; /**< Dummy value 6 */ struct pvr_poly_hdr_mode3 m3; /**< mode3 parameters (modifiers: outside volume) */ }; union { - struct { - uint32_t d1; /**< Dummy value 1 */ - uint32_t d2; /**< Dummy value 2 */ - uint32_t d3; /**< Dummy value 3 */ - uint32_t d4; /**< Dummy value 4 */ - }; struct { /* Intensity color */ float a; /**< Intensity color alpha */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: kosmirror <kos...@us...> - 2025-05-22 14:02:46
|
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 f643745ca6342e44612a115f7fe28b0a95435a6a (commit) from f4657b17a449c13502114404a53835c38de5c3a5 (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 f643745ca6342e44612a115f7fe28b0a95435a6a Author: darc <da...@pr...> Date: Wed May 21 16:27:14 2025 -0500 libpthread: Add support for pthread_getschedparam() and pthread_setschedparam() ----------------------------------------------------------------------- Summary of changes: addons/libpthread/Makefile | 3 ++- addons/libpthread/pthread_getschedparam.c | 31 +++++++++++++++++++++++++++++++ addons/libpthread/pthread_setschedparam.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 addons/libpthread/pthread_getschedparam.c create mode 100644 addons/libpthread/pthread_setschedparam.c diff --git a/addons/libpthread/Makefile b/addons/libpthread/Makefile index 54f2879a..a50f2c46 100644 --- a/addons/libpthread/Makefile +++ b/addons/libpthread/Makefile @@ -66,6 +66,7 @@ OBJS += pthread_barrierattr_init.o pthread_barrierattr_destroy.o \ # Misc. OBJS += pthread_atfork.o pthread_getsetconcurrency.o pthread_yield.o \ - pthread_setprio.o pthread_getprio.o + pthread_setprio.o pthread_getprio.o \ + pthread_setschedparam.o pthread_getschedparam.o include $(KOS_BASE)/addons/Makefile.prefab diff --git a/addons/libpthread/pthread_getschedparam.c b/addons/libpthread/pthread_getschedparam.c new file mode 100644 index 00000000..30da35a2 --- /dev/null +++ b/addons/libpthread/pthread_getschedparam.c @@ -0,0 +1,31 @@ +/* KallistiOS ##version## + + pthread_getschedparam.c + Copyright (C) 2025 Eric Fradella +*/ + +#include "pthread-internal.h" +#include <pthread.h> +#include <sched.h> +#include <errno.h> +#include <kos/thread.h> + +int pthread_getschedparam(pthread_t thread, int *__RESTRICT policy, + struct sched_param *__RESTRICT param) { + kthread_t *thd = (kthread_t *)thread; + + if(!thd) + return EINVAL; + + if(!policy) + return EINVAL; + + if(!param) + return EFAULT; + + *policy = SCHED_RR; + + param->sched_priority = (int)thd_get_prio(thd); + + return 0; +} diff --git a/addons/libpthread/pthread_setschedparam.c b/addons/libpthread/pthread_setschedparam.c new file mode 100644 index 00000000..4f5ae223 --- /dev/null +++ b/addons/libpthread/pthread_setschedparam.c @@ -0,0 +1,30 @@ +/* KallistiOS ##version## + + pthread_setschedparam.c + Copyright (C) 2025 Eric Fradella +*/ + +#include "pthread-internal.h" +#include <pthread.h> +#include <sched.h> +#include <errno.h> +#include <kos/thread.h> + +int pthread_setschedparam(pthread_t thread, int policy, + const struct sched_param *param) { + kthread_t *thd = (kthread_t *)thread; + + if(!thd) + return EINVAL; + + if(policy != SCHED_RR) + return EINVAL; + + if(!param) + return EFAULT; + + if(thd_set_prio(thd, (prio_t)param->sched_priority)) + return EINVAL; + + return 0; +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |