|
From: kosmirror <kos...@us...> - 2025-12-11 08:08:51
|
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 6dbd846ce6de7e3611d7e8acf8bd7b34e4b930c1 (commit)
via 1a01404c44f40962a8db13ed2482e16fb4540a39 (commit)
via 72d33b4b07a459d2525ec55e799c08bdb9af755b (commit)
via b92110ca865bf82c0cbf446daff1c935f8ed5d0f (commit)
via 890c59e5ff1a787410bd785d59fe773a57e8a1ec (commit)
from d142b568fd3a900bbc7bb0d95d15e2469565db40 (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 6dbd846ce6de7e3611d7e8acf8bd7b34e4b930c1
Author: QuzarDC <qu...@co...>
Date: Wed Sep 10 12:47:20 2025 -0400
examples: Replace calls to low-level timer with standard <time.h>
Historically we've not supported this, but as it was all added
in 2022 by BlueCrab and updated further in #506, so there's no
reason to continue delving into kos-specifics for this simple
functionality.
commit 1a01404c44f40962a8db13ed2482e16fb4540a39
Author: QuzarDC <qu...@co...>
Date: Wed Sep 10 10:31:02 2025 -0400
examples: Swap once test from using spinlock to mutex
commit 72d33b4b07a459d2525ec55e799c08bdb9af755b
Author: QuzarDC <qu...@co...>
Date: Wed Sep 10 10:18:03 2025 -0400
examples: Remove extraneous includes of arch headers.
Some of these were in place due to code that has since been changed
to not need it, others it seemed to have just been due to copy+paste.
For some <arch/arch.h> was being included merely for <kos/init.h>.
commit b92110ca865bf82c0cbf446daff1c935f8ed5d0f
Author: QuzarDC <qu...@co...>
Date: Tue Sep 9 20:55:07 2025 -0400
examples: Switch from using `arch_exit` to `exit`.
`arch_exit` was primarily being used in these due to issues with
performing a correct c-standard `exit(int)` that were corrected
with #122 #175 and #209 . This required adding `stdlib` to a few
for `exit`, allowed removing `arch.h` from some, and it seems that
`arch.h` was providing `kos/init.h` to some so that needed to be
added (or the unnecessary KOS_INIT removed).
commit 890c59e5ff1a787410bd785d59fe773a57e8a1ec
Author: QuzarDC <qu...@co...>
Date: Tue Sep 9 22:38:47 2025 -0400
examples: replace deprecated header with new one
This was switched away from in #1168
-----------------------------------------------------------------------
Summary of changes:
examples/dreamcast/basic/fpu/exc/fpu_exc.c | 2 +-
.../threading/general/general_threading_test.c | 3 ++-
.../dreamcast/basic/threading/once/once_test.c | 11 ++++++-----
.../basic/threading/recursive_lock/rlock_test.c | 10 ++++------
.../dreamcast/basic/threading/rwsem/rwsem_test.c | 9 ++++-----
examples/dreamcast/basic/threading/tls/tls_test.c | 4 ++--
examples/dreamcast/basic/watchdog/watchdog.c | 2 +-
examples/dreamcast/cdrom/stream/cd-stream-test.c | 3 +--
examples/dreamcast/conio/adventure/adventure.c | 2 +-
examples/dreamcast/conio/basic/basic.c | 3 ++-
examples/dreamcast/conio/wump/wump.c | 2 +-
examples/dreamcast/filesystem/sd/mke2fs/mke2fs.c | 4 +---
.../filesystem/sd/speedtest/sd-speedtest.c | 18 +++++++----------
examples/dreamcast/g1ata/atatest/atatest.c | 22 ++++++++++-----------
examples/dreamcast/libdream/320x240/320x240.c | 3 ++-
examples/dreamcast/libdream/640x480/640x480.c | 3 ++-
examples/dreamcast/library/library-test.c | 14 ++++++-------
examples/dreamcast/lightgun/basic/lightgun.c | 11 +++++++----
examples/dreamcast/network/dns-client/dns-client.c | 4 ++--
examples/dreamcast/network/ntp/ntp.c | 2 +-
examples/dreamcast/network/ping/ping.c | 4 ++--
examples/dreamcast/network/ping6/ping.c | 2 +-
examples/dreamcast/network/udpecho6/echo.c | 4 ++--
examples/dreamcast/parallax/font/font.c | 3 ++-
.../pthread/general/general_pthread_test.c | 4 ++--
.../dreamcast/pvr/texture_render/texture_render.c | 23 +++++++++++-----------
.../dreamcast/pvr/yuv_converter/YUV420/yuv420.c | 4 +---
.../dreamcast/pvr/yuv_converter/YUV422/yuv422.c | 4 +---
examples/dreamcast/tsunami/banner/banner.cpp | 2 +-
examples/dreamcast/tsunami/font/font.cpp | 2 +-
examples/dreamcast/tsunami/genmenu/genmenu.cpp | 2 +-
examples/dreamcast/video/bfont/bfont.c | 5 ++---
examples/dreamcast/video/multibuffer/multibuffer.c | 3 ++-
examples/dreamcast/vmu/vmu_beep/beep.c | 2 --
examples/dreamcast/vmu/vmu_lcd/lcd.c | 5 ++---
35 files changed, 95 insertions(+), 106 deletions(-)
diff --git a/examples/dreamcast/basic/fpu/exc/fpu_exc.c b/examples/dreamcast/basic/fpu/exc/fpu_exc.c
index 3f42cfaf..9f75de98 100644
--- a/examples/dreamcast/basic/fpu/exc/fpu_exc.c
+++ b/examples/dreamcast/basic/fpu/exc/fpu_exc.c
@@ -110,7 +110,7 @@ int main(int argc, char **argv) {
bool success = true;
/* Exit parachute */
- cont_btn_callback(0, CONT_START, (cont_btn_callback_t)arch_exit);
+ cont_btn_callback(0, CONT_START, (cont_btn_callback_t)exit);
printf("Beginning the FPU exception test!\n");
printf("\tFPU Config: %s\n", SH4_FPU_CONFIG_NAME);
diff --git a/examples/dreamcast/basic/threading/general/general_threading_test.c b/examples/dreamcast/basic/threading/general/general_threading_test.c
index a8afbcf5..56dccb74 100644
--- a/examples/dreamcast/basic/threading/general/general_threading_test.c
+++ b/examples/dreamcast/basic/threading/general/general_threading_test.c
@@ -13,6 +13,7 @@
*/
+#include <stdlib.h>
#include <kos.h>
/* Semaphore used for timing below */
@@ -112,7 +113,7 @@ int main(int argc, char **argv) {
kthread_t * t0, * t1, * t2, *t3[10];
cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y,
- (cont_btn_callback_t)arch_exit);
+ (cont_btn_callback_t)exit);
/* Print a banner */
printf("KOS 2.0.x thread program:\n");
diff --git a/examples/dreamcast/basic/threading/once/once_test.c b/examples/dreamcast/basic/threading/once/once_test.c
index c3c835c4..e632b254 100644
--- a/examples/dreamcast/basic/threading/once/once_test.c
+++ b/examples/dreamcast/basic/threading/once/once_test.c
@@ -16,9 +16,10 @@
#include <string.h>
#include <kos/thread.h>
#include <kos/once.h>
+#include <kos/mutex.h>
+#include <kos/init.h>
#include <arch/arch.h>
-#include <arch/spinlock.h>
#include <dc/maple.h>
#include <dc/maple/controller.h>
@@ -26,13 +27,13 @@
#define THD_COUNT (475 * (DBL_MEM? 2 : 1))
static kthread_once_t once = KTHREAD_ONCE_INIT;
-static spinlock_t lock = SPINLOCK_INITIALIZER;
+static mutex_t lock = MUTEX_INITIALIZER;
static int counter = 0;
static void inner_once_func(void) {
- spinlock_lock(&lock);
+ mutex_lock(&lock);
++counter;
- spinlock_unlock(&lock);
+ mutex_unlock(&lock);
}
static void *inner_thd_func(void *param UNUSED) {
@@ -71,7 +72,7 @@ int main(int argc, char *argv[]) {
kthread_t *thds[THD_COUNT];
cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y,
- (cont_btn_callback_t)arch_exit);
+ (cont_btn_callback_t)exit);
printf("KallistiOS kthread_once test program\n");
diff --git a/examples/dreamcast/basic/threading/recursive_lock/rlock_test.c b/examples/dreamcast/basic/threading/recursive_lock/rlock_test.c
index aa402d37..a5087d84 100644
--- a/examples/dreamcast/basic/threading/recursive_lock/rlock_test.c
+++ b/examples/dreamcast/basic/threading/recursive_lock/rlock_test.c
@@ -13,11 +13,11 @@
merged into the mutex type (when it was rewritten). */
#include <stdio.h>
+#include <stdlib.h>
#include <kos/thread.h>
#include <kos/mutex.h>
-#include <arch/arch.h>
#include <dc/maple.h>
#include <dc/maple/controller.h>
@@ -93,14 +93,12 @@ void *thd2(void *param UNUSED) {
return NULL;
}
-KOS_INIT_FLAGS(INIT_DEFAULT);
-
int main(int argc, char *argv[]) {
kthread_t *t0, *t1, *t2;
/* Exit if the user presses all buttons at once. */
cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y,
- (cont_btn_callback_t)arch_exit);
+ (cont_btn_callback_t)exit);
printf("KallistiOS Recursive Lock test program\n");
@@ -116,11 +114,11 @@ int main(int argc, char *argv[]) {
if(mutex_is_locked(&l)) {
printf("Lock is still locked!\n");
- arch_exit();
+ exit(EXIT_FAILURE);
}
mutex_destroy(&l);
printf("Recursive lock tests completed successfully!\n");
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/examples/dreamcast/basic/threading/rwsem/rwsem_test.c b/examples/dreamcast/basic/threading/rwsem/rwsem_test.c
index e73bcfe4..f6db0b69 100644
--- a/examples/dreamcast/basic/threading/rwsem/rwsem_test.c
+++ b/examples/dreamcast/basic/threading/rwsem/rwsem_test.c
@@ -12,11 +12,11 @@
systems class that I figured would probably be useful for KOS. */
#include <stdio.h>
+#include <stdlib.h>
#include <kos/thread.h>
#include <kos/rwsem.h>
-#include <arch/arch.h>
#include <dc/maple.h>
#include <dc/maple/controller.h>
@@ -109,13 +109,12 @@ void *reader1(void *param UNUSED) {
return NULL;
}
-KOS_INIT_FLAGS(INIT_DEFAULT);
int main(int argc, char *argv[]) {
kthread_t *w0, *w1, *r0, *r1;
/* Exit if the user presses all buttons at once. */
cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y,
- (cont_btn_callback_t)arch_exit);
+ (cont_btn_callback_t)exit);
printf("KallistiOS Reader/Writer Semaphore test program\n");
@@ -134,7 +133,7 @@ int main(int argc, char *argv[]) {
if(rwsem_read_lock(&s)) {
printf("Could not obtain final read lock!\n");
perror("rwsem_read_lock");
- arch_exit();
+ exit(EXIT_FAILURE);
}
printf("Final number: %lu\n", number);
@@ -143,5 +142,5 @@ int main(int argc, char *argv[]) {
rwsem_destroy(&s);
printf("Reader/Writer semaphore tests completed successfully!\n");
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/examples/dreamcast/basic/threading/tls/tls_test.c b/examples/dreamcast/basic/threading/tls/tls_test.c
index e4db75ec..c162678a 100644
--- a/examples/dreamcast/basic/threading/tls/tls_test.c
+++ b/examples/dreamcast/basic/threading/tls/tls_test.c
@@ -16,11 +16,11 @@
#include <errno.h>
#include <string.h>
+#include <kos/init.h>
#include <kos/thread.h>
#include <kos/once.h>
#include <kos/tls.h>
-#include <arch/arch.h>
#include <dc/maple.h>
#include <dc/maple/controller.h>
@@ -100,7 +100,7 @@ int main(int argc, char *argv[]) {
int retval;
cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y,
- (cont_btn_callback_t)arch_exit);
+ (cont_btn_callback_t)exit);
printf("KallistiOS TLS test program\n\n");
diff --git a/examples/dreamcast/basic/watchdog/watchdog.c b/examples/dreamcast/basic/watchdog/watchdog.c
index 79987e8a..7a140ae1 100644
--- a/examples/dreamcast/basic/watchdog/watchdog.c
+++ b/examples/dreamcast/basic/watchdog/watchdog.c
@@ -22,7 +22,7 @@
#include <stdatomic.h>
#include <time.h>
-#include <arch/wdt.h>
+#include <dc/wdt.h>
#include <dc/maple/controller.h>
/* Microsecond-based units */
diff --git a/examples/dreamcast/cdrom/stream/cd-stream-test.c b/examples/dreamcast/cdrom/stream/cd-stream-test.c
index 12b9846e..87bc7fe2 100644
--- a/examples/dreamcast/cdrom/stream/cd-stream-test.c
+++ b/examples/dreamcast/cdrom/stream/cd-stream-test.c
@@ -17,7 +17,6 @@
#include <dc/maple/controller.h>
#include <dc/cdrom.h>
-#include <arch/arch.h>
#include <arch/cache.h>
#include <kos/init.h>
@@ -43,7 +42,7 @@ static void __attribute__((__noreturn__)) wait_exit(void) {
if(state) {
if(state->buttons)
- arch_exit();
+ exit(0);
}
}
}
diff --git a/examples/dreamcast/conio/adventure/adventure.c b/examples/dreamcast/conio/adventure/adventure.c
index 69515931..c1a30150 100644
--- a/examples/dreamcast/conio/adventure/adventure.c
+++ b/examples/dreamcast/conio/adventure/adventure.c
@@ -68,7 +68,7 @@ main(int argc, char **argv) {
struct text *kk;
/* If the user hits start, bail */
- cont_btn_callback(0, CONT_START, (cont_btn_callback_t)arch_exit);
+ cont_btn_callback(0, CONT_START, (cont_btn_callback_t)exit);
pvr_init_defaults();
conio_init(CONIO_TTY_PVR, CONIO_INPUT_LINE);
diff --git a/examples/dreamcast/conio/basic/basic.c b/examples/dreamcast/conio/basic/basic.c
index 4e6b1e60..1a87efb1 100644
--- a/examples/dreamcast/conio/basic/basic.c
+++ b/examples/dreamcast/conio/basic/basic.c
@@ -8,6 +8,7 @@
*/
+#include <stdlib.h>
#include <kos.h>
#include <conio/conio.h>
@@ -16,7 +17,7 @@ int main(int argc, char **argv) {
char buffer[256];
/* If the user hits start, bail */
- cont_btn_callback(0, CONT_START, (cont_btn_callback_t)arch_exit);
+ cont_btn_callback(0, CONT_START, (cont_btn_callback_t)exit);
/* Setup the console */
pvr_init_defaults();
diff --git a/examples/dreamcast/conio/wump/wump.c b/examples/dreamcast/conio/wump/wump.c
index 53d26d7e..a0fc8395 100644
--- a/examples/dreamcast/conio/wump/wump.c
+++ b/examples/dreamcast/conio/wump/wump.c
@@ -160,7 +160,7 @@ int argc;
char **argv;
{
/* If the user hits start, bail */
- cont_btn_callback(0, CONT_START, (cont_btn_callback_t)arch_exit);
+ cont_btn_callback(0, CONT_START, (cont_btn_callback_t)exit);
pvr_init_defaults();
conio_init(CONIO_TTY_PVR, CONIO_INPUT_LINE);
diff --git a/examples/dreamcast/filesystem/sd/mke2fs/mke2fs.c b/examples/dreamcast/filesystem/sd/mke2fs/mke2fs.c
index 104ab81c..f1476bb9 100644
--- a/examples/dreamcast/filesystem/sd/mke2fs/mke2fs.c
+++ b/examples/dreamcast/filesystem/sd/mke2fs/mke2fs.c
@@ -25,8 +25,6 @@
#include <kos/dbgio.h>
#include <kos/blockdev.h>
-#include <arch/arch.h>
-
#include <dc/sd.h>
#include <dc/maple.h>
#include <dc/maple/controller.h>
@@ -98,7 +96,7 @@ static void __attribute__((__noreturn__)) exit_with_error(const char *err) {
if(state) {
if(state->buttons)
- arch_exit();
+ exit(EXIT_FAILURE);
}
}
}
diff --git a/examples/dreamcast/filesystem/sd/speedtest/sd-speedtest.c b/examples/dreamcast/filesystem/sd/speedtest/sd-speedtest.c
index 318d0cc3..3e1d3056 100644
--- a/examples/dreamcast/filesystem/sd/speedtest/sd-speedtest.c
+++ b/examples/dreamcast/filesystem/sd/speedtest/sd-speedtest.c
@@ -14,15 +14,12 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
-#include <errno.h>
+#include <time.h>
#include <dc/sd.h>
#include <dc/maple.h>
#include <dc/maple/controller.h>
-#include <arch/arch.h>
-#include <arch/timer.h>
-
#include <kos/init.h>
#include <kos/dbgio.h>
#include <kos/dbglog.h>
@@ -48,7 +45,7 @@ static void __attribute__((__noreturn__)) wait_exit(void) {
if(state) {
if(state->buttons)
- arch_exit();
+ exit(0);
}
}
}
@@ -60,8 +57,7 @@ static int run_speed_test(sd_interface_t interface, bool check_crc) {
.check_crc = check_crc
};
kos_blockdev_t sd_dev;
- uint64_t begin, end, timer, average;
- uint64_t sum = 0;
+ clock_t begin, end, timer, average, sum = 0;
uint8_t pt;
int i;
@@ -81,7 +77,7 @@ static int run_speed_test(sd_interface_t interface, bool check_crc) {
}
for(i = 0; i < 10; i++) {
- begin = timer_ms_gettime64();
+ begin = clock();
if(sd_dev.read_blocks(&sd_dev, 0, TEST_BLOCK_COUNT, tbuf)) {
dbglog(DBG_ERROR, "couldn't read block: %s\n", strerror(errno));
@@ -89,14 +85,14 @@ static int run_speed_test(sd_interface_t interface, bool check_crc) {
return -1;
}
- end = timer_ms_gettime64();
+ end = clock();
timer = end - begin;
sum += timer;
}
- average = sum / 10;
+ average = (sum / 10) / (CLOCKS_PER_SEC / 1000);
- dbglog(DBG_INFO, "%s: read average took %llu ms (%.3f KB/sec)\n",
+ dbglog(DBG_INFO, "%s: read average took %lu ms (%.3f KB/sec)\n",
interface_name, average, (512 * TEST_BLOCK_COUNT) / ((double)average));
sd_shutdown();
diff --git a/examples/dreamcast/g1ata/atatest/atatest.c b/examples/dreamcast/g1ata/atatest/atatest.c
index 32296e13..9ca2f117 100644
--- a/examples/dreamcast/g1ata/atatest/atatest.c
+++ b/examples/dreamcast/g1ata/atatest/atatest.c
@@ -12,12 +12,10 @@
#include <string.h>
#include <stdint.h>
#include <errno.h>
+#include <time.h>
#include <dc/g1ata.h>
-#include <arch/timer.h>
-#include <arch/types.h>
-
#include <kos/dbglog.h>
#include <kos/blockdev.h>
@@ -27,7 +25,7 @@ static unsigned char tmp[512] __attribute__((aligned(32)));
int main(int argc, char *argv[]) {
kos_blockdev_t bd_pio, bd_dma;
- uint64_t spio, epio, sdma, edma, timer;
+ clock_t spio, epio, sdma, edma, timer;
uint8_t pt;
dbglog(DBG_INFO, "Starting G1 ATA test program...\n");
@@ -56,29 +54,29 @@ int main(int argc, char *argv[]) {
/* Read blocks 0 - 1023 by DMA and print out timing information. */
dbglog(DBG_INFO, "Reading 1024 blocks by DMA!\n");
- sdma = timer_ms_gettime64();
+ sdma = clock();
if(bd_dma.read_blocks(&bd_dma, 0, 1024, dmabuf)) {
dbglog(DBG_ERROR, "couldn't read block by DMA: %s\n", strerror(errno));
return -1;
}
- edma = timer_ms_gettime64();
- timer = edma - sdma;
+ edma = clock();
+ timer = (edma - sdma) / (CLOCKS_PER_SEC / 1000);
- dbglog(DBG_INFO, "DMA read took %llu ms (%f MB/sec)\n", timer,
+ dbglog(DBG_INFO, "DMA read took %lu ms (%f MB/sec)\n", timer,
(512 * 1024) / ((double)timer) / 1000.0);
/* Read blocks 0 - 1023 by PIO and print out timing information. */
dbglog(DBG_INFO, "Reading 1024 blocks by PIO!\n");
- spio = timer_ms_gettime64();
+ spio = clock();
if(bd_pio.read_blocks(&bd_pio, 0, 1024, piobuf)) {
dbglog(DBG_ERROR, "couldn't read block by PIO: %s\n", strerror(errno));
return -1;
}
- epio = timer_ms_gettime64();
- timer = epio - spio;
+ epio = clock();
+ timer = (epio - spio) / (CLOCKS_PER_SEC / 1000);
- dbglog(DBG_INFO, "PIO read took %llu ms (%f MB/sec)\n", timer,
+ dbglog(DBG_INFO, "PIO read took %lu ms (%f MB/sec)\n", timer,
(512 * 1024) / ((double)timer) / 1000.0);
/* Check the buffers for consistency... */
diff --git a/examples/dreamcast/libdream/320x240/320x240.c b/examples/dreamcast/libdream/320x240/320x240.c
index bb1781f8..d33b32d7 100644
--- a/examples/dreamcast/libdream/320x240/320x240.c
+++ b/examples/dreamcast/libdream/320x240/320x240.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include <kos.h>
#define W 320
@@ -8,7 +9,7 @@ int main(int argc, char **argv) {
/* Press all buttons to exit */
cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y,
- (cont_btn_callback_t)arch_exit);
+ (cont_btn_callback_t)exit);
/* Set the video mode */
vid_set_mode(DM_320x240, PM_RGB565);
diff --git a/examples/dreamcast/libdream/640x480/640x480.c b/examples/dreamcast/libdream/640x480/640x480.c
index 31e63fd6..0f212082 100644
--- a/examples/dreamcast/libdream/640x480/640x480.c
+++ b/examples/dreamcast/libdream/640x480/640x480.c
@@ -4,6 +4,7 @@
because you need the port, but you don't want garbage being printed
when it's successful either. */
+#include <stdlib.h>
#include <kos.h>
int main(int argc, char **argv) {
@@ -11,7 +12,7 @@ int main(int argc, char **argv) {
/* Press all buttons to exit */
cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y,
- (cont_btn_callback_t)arch_exit);
+ (cont_btn_callback_t)exit);
/* Bother us with output only if something died */
dbglog_set_level(DBG_DEAD);
diff --git a/examples/dreamcast/library/library-test.c b/examples/dreamcast/library/library-test.c
index d245b43c..8012658e 100644
--- a/examples/dreamcast/library/library-test.c
+++ b/examples/dreamcast/library/library-test.c
...<truncated>...
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|